]> git.donarmstrong.com Git - mothur.git/blobdiff - makecontigscommand.cpp
have make contigs use \r instead of \n
[mothur.git] / makecontigscommand.cpp
index 15f002bffdbdc96e65ba18522955d500aa0fa8b0..d2ddc06e8af6b9ffa9ac783ca8e2b6f61a612f83 100644 (file)
@@ -1059,7 +1059,8 @@ int MakeContigsCommand::driver(vector<string> files, string outputFasta, string
                     }else { contig += seq1[i]; } //with no quality info, then we keep it?
                 }else if (((seq1[i] != '-') && (seq1[i] != '.')) && ((seq2[i] != '-') && (seq2[i] != '.'))) { //both bases choose one with better quality
                     if (thisfqualfile != "") {
-                        if (abs(scores1[ABaseMap[i]] - scores2[BBaseMap[i]]) >= deltaq) { //is the difference in qual scores >= deltaq, if yes choose base with higher score
+                      if (ABaseMap[i] <= scores1.size() && BBaseMap[i] <= scores2.size() && // this check is dumb; we should determine this earlier
+                          abs(scores1[ABaseMap[i]] - scores2[BBaseMap[i]]) >= deltaq) { //is the difference in qual scores >= deltaq, if yes choose base with higher score
                             char c = seq1[i];
                             if (scores1[ABaseMap[i]] < scores2[BBaseMap[i]]) { c = seq2[i]; }
                             contig += c;
@@ -1447,7 +1448,7 @@ vector< vector<string> > MakeContigsCommand::readFastaFiles(unsigned long int& c
             }
                }
                //report progress
-               if((count) % 10000 != 0){       m->mothurOut(toString(count)); m->mothurOutEndLine();           }
+               if((count) % 10000 != 0){       m->mothurOut(toString(count)); m->mothurOut("\r");              }
         
         if (uniques.size() != 0) {
             for (itUniques = uniques.begin(); itUniques != uniques.end(); itUniques++) {