]> git.donarmstrong.com Git - mothur.git/blobdiff - trimseqscommand.cpp
made a small mod to the alignment parameters in trim.seqs
[mothur.git] / trimseqscommand.cpp
index 705ac25f5a5e727424a2567a0d358b4c1dc951e5..580fc22c978e0105b464e214593599fe15970f1d 100644 (file)
@@ -163,7 +163,7 @@ void TrimSeqsCommand::help(){
                m->mothurOut("The trim.seqs command reads a fastaFile and creates .....\n");
                m->mothurOut("The trim.seqs command parameters are fasta, flip, oligos, maxambig, maxhomop, minlength, maxlength, qfile, qthreshold, qaverage, diffs, qtrim and allfiles.\n");
                m->mothurOut("The fasta parameter is required.\n");
-               m->mothurOut("The flip parameter .... The default is 0.\n");
+               m->mothurOut("The flip parameter will output the reverse compliment of your trimmed sequence. The default is false.\n");
                m->mothurOut("The oligos parameter .... The default is "".\n");
                m->mothurOut("The maxambig parameter .... The default is -1.\n");
                m->mothurOut("The maxhomop parameter .... The default is 0.\n");
@@ -224,8 +224,9 @@ int TrimSeqsCommand::execute(){
                #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
                                if(processors == 1){
                                        ifstream inFASTA;
+                                       int numSeqs;
                                        openInputFile(fastaFile, inFASTA);
-                                       int numSeqs=count(istreambuf_iterator<char>(inFASTA),istreambuf_iterator<char>(), '>');
+                                       getNumSeqs(inFASTA, numSeqs);
                                        inFASTA.close();
                                        
                                        lines.push_back(new linePair(0, numSeqs));
@@ -266,8 +267,9 @@ int TrimSeqsCommand::execute(){
                                if (m->control_pressed) {  return 0; }
                #else
                                ifstream inFASTA;
+                               int numSeqs;
                                openInputFile(fastaFile, inFASTA);
-                               int numSeqs=count(istreambuf_iterator<char>(inFASTA),istreambuf_iterator<char>(), '>');
+                               getNumSeqs(inFASTA, numSeqs);
                                inFASTA.close();
                                
                                lines.push_back(new linePair(0, numSeqs));
@@ -650,7 +652,7 @@ int TrimSeqsCommand::stripBarcode(Sequence& seq, int& group){
                                                maxLength = it->first.length();
                                        }
                                }
-                               alignment = new NeedlemanOverlap(-2.0, 1.0, -1.0, (maxLength+bdiffs+1));  
+                               alignment = new NeedlemanOverlap(-1.0, 1.0, -1.0, (maxLength+bdiffs+1));  
 
                        }else{ alignment = NULL; } 
                        
@@ -684,6 +686,9 @@ int TrimSeqsCommand::stripBarcode(Sequence& seq, int& group){
                                
                                int newStart=0;
                                int numDiff = countDiffs(oligo, temp);
+                               
+//                             cout << oligo << '\t' << temp << '\t' << numDiff << endl;                               
+                               
                                if(numDiff < minDiff){
                                        minDiff = numDiff;
                                        minCount = 1;
@@ -764,7 +769,7 @@ int TrimSeqsCommand::stripForward(Sequence& seq){
                                                maxLength = forPrimer[i].length();
                                        }
                                }
-                               alignment = new NeedlemanOverlap(-2.0, 1.0, -1.0, (maxLength+pdiffs+1));  
+                               alignment = new NeedlemanOverlap(-1.0, 1.0, -1.0, (maxLength+pdiffs+1));  
 
                        }else{ alignment = NULL; }