const char* docstring="" "RemoveNonQueryPosition clustalo.fasta > clustalo.noquerygap.fasta\n" " delete any position corresponding to gap in query\n" ; #include #include #include #include #include #include using namespace std; int RemoveNonQueryPosition(const string infile="-", const string outfile="-") { ifstream fp_in; ofstream fp_out; if (infile!="-") fp_in.open(infile.c_str(),ios::in); if (outfile!="-") fp_out.open(outfile.c_str(),ofstream::out); string sequence,line; int nseqs=0; int i; vector nongap_pos; // position not corresponding to gap in query string no_query_gap_sequence; while ((infile!="-")?fp_in.good():cin.good()) { if (infile!="-") getline(fp_in,line); else getline(cin,line); if (line.length()==0) continue; if (line[0]=='>') { if (sequence.length()>0) { if (nongap_pos.size()==0) for (i=0;i