#include "needlemanoverlap.hpp"
//**********************************************************************************************************************
+
vector<string> TrimSeqsCommand::getValidParameters(){
try {
string Array[] = {"fasta", "flip", "oligos", "maxambig", "maxhomop", "group","minlength", "maxlength", "qfile",
exit(1);
}
}
+
//**********************************************************************************************************************
+
TrimSeqsCommand::TrimSeqsCommand(){
try {
abort = true;
exit(1);
}
}
+
//**********************************************************************************************************************
+
vector<string> TrimSeqsCommand::getRequiredParameters(){
try {
string Array[] = {"fasta"};
exit(1);
}
}
+
//**********************************************************************************************************************
+
vector<string> TrimSeqsCommand::getRequiredFiles(){
try {
vector<string> myArray;
exit(1);
}
}
+
//***************************************************************************************************************
TrimSeqsCommand::TrimSeqsCommand(string option) {
exit(1);
}
}
+
//**********************************************************************************************************************
void TrimSeqsCommand::help(){
try {
ofstream outFASTA;
- int able = m->openOutputFile(trimFile, outFASTA);
+ m->openOutputFile(trimFile, outFASTA);
ofstream scrapFASTA;
m->openOutputFile(scrapFile, scrapFASTA);
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'; }
}
exit(1);
}
}
+
//***************************************************************************************************************
void TrimSeqsCommand::getOligos(vector<string>& outFASTAVec, vector<string>& outQualVec){
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;
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;
}
}
+
//***************************************************************************************************************
int TrimSeqsCommand::countDiffs(string oligo, string seq){