X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trimseqscommand.cpp;h=580fc22c978e0105b464e214593599fe15970f1d;hb=f07bf12e0d04340698aff7a36d2fee7c959ffe59;hp=705ac25f5a5e727424a2567a0d358b4c1dc951e5;hpb=8ef6687c1f586285d01c000cc5e359bf9c07c717;p=mothur.git diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 705ac25..580fc22 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -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(inFASTA),istreambuf_iterator(), '>'); + 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(inFASTA),istreambuf_iterator(), '>'); + 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; }