X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trimseqscommand.cpp;h=2dc07794be5abb2f239e4b228c3aacbf51c51b6e;hb=d04f948b1a2a1a2984fc4a45d04403b8c121c5bc;hp=20002049ce986b01f5395ed2b807471cf954133f;hpb=bf83aa09a52403a2faf1a1f82489d1e0c8c32283;p=mothur.git diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 2000204..2dc0779 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -455,7 +455,7 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string try { ofstream outFASTA; - int able = m->openOutputFile(trimFile, outFASTA); + m->openOutputFile(trimFile, outFASTA); ofstream scrapFASTA; m->openOutputFile(scrapFile, scrapFASTA); @@ -556,16 +556,16 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string if(qFileName != ""){ + int origLength = currSeq.getNumBases(); if(qThreshold != 0) { success = currQual.stripQualThreshold(currSeq, qThreshold); } else if(qAverage != 0) { success = currQual.cullQualAverage(currSeq, qAverage); } else if(qRollAverage != 0) { success = currQual.stripQualRollingAverage(currSeq, qRollAverage); } else if(qWindowAverage != 0){ success = currQual.stripQualWindowAverage(currSeq, qWindowStep, qWindowSize, qWindowAverage); } else { success = 1; } - -// if (qtrim == 1 && (origSeq.length() != currSeq.getUnaligned().length())) { -// success = 0; //if you don't want to trim and the sequence does not meet quality requirements, move to scrap -// } + + //you don't want to trim, if it fails above then scrap it + if ((!qtrim) && (origLength != currSeq.getNumBases())) { success = 0; } if(!success) { trashCode += 'q'; } } @@ -1095,7 +1095,6 @@ int TrimSeqsCommand::stripBarcode(Sequence& seq, QualityScores& qual, int& group oligo = oligo.substr(0,alnLength); temp = temp.substr(0,alnLength); - int newStart=0; int numDiff = countDiffs(oligo, temp); // cout << oligo << '\t' << temp << '\t' << numDiff << endl; @@ -1220,7 +1219,6 @@ int TrimSeqsCommand::stripForward(Sequence& seq, QualityScores& qual, int& group oligo = oligo.substr(0,alnLength); temp = temp.substr(0,alnLength); - int newStart=0; int numDiff = countDiffs(oligo, temp); // cout << oligo << '\t' << temp << '\t' << numDiff << endl;