AlignmentCell currentCell = alignment[row][column]; // Start the traceback from the bottom-right corner of the
// matrix
-
+
if(currentCell.prevCell == 'x'){ seqAaln = seqBaln = "NOALIGNMENT"; }//If there's an 'x' in the bottom-
else{ // right corner bail out because it means nothing got aligned
while(currentCell.prevCell != 'x'){ // while the previous cell isn't an 'x', keep going...
Alignment();
virtual void align(string, string) = 0;
- float getAlignmentScore();
+// float getAlignmentScore();
string getSeqAAln();
string getSeqBAln();
int getCandidateStartPos();
if(key == "maxlength") { maxLength = value; }
if(key == "flip" ) { flip = value; }
if(key == "oligos" ) { oligoFile = value; }
- if(key == "forward" ) { forMismatch = value; }
- if(key == "reverse" ) { revMismatch = value; }
- if(key == "barcode" ) { barMismatch = value; }
if(key == "line") {//stores lines to be used in a vector
lines.clear();
if(key == "maxlength") { maxLength = value; }
if(key == "flip" ) { flip = value; }
if(key == "oligos" ) { oligoFile = value; }
- if(key == "forward" ) { forMismatch = value; }
- if(key == "reverse" ) { revMismatch = value; }
- if(key == "barcode" ) { barMismatch = value; }
if(key == "line") {//stores lines to be used in a vector
string GlobalData::getMaxLength() { return maxLength; }
string GlobalData::getFlip() { return flip; }
string GlobalData::getOligosFile() { return oligoFile; }
-string GlobalData::getForwardMismatch() { return forMismatch; }
-string GlobalData::getReverseMismatch() { return revMismatch; }
-string GlobalData::getBarcodeMismatch() { return barMismatch; }
void GlobalData::setListFile(string file) { listfile = file; inputFileName = file; }
minLength = "-1";
maxLength = "-1";
flip = "0";
- forMismatch = "0";
- revMismatch = "0";
- barMismatch = "0";
oligoFile = "";
}
minLength = "-1";
maxLength = "-1";
flip = "0";
- forMismatch = "0";
- revMismatch = "0";
- barMismatch = "0";
oligoFile = "";
}
string getMinLength();
string getMaxLength();
string getFlip();
- string getForwardMismatch();
- string getReverseMismatch();
- string getBarcodeMismatch();
string getOligosFile();
void setListFile(string);
private:
- string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, treefile, sharedfile, line, label, randomtree, groups, cutoff, format, precision, method, fileroot, iters, jumble, freq, calc, abund, step, form, sorted, trump, soft, hard, scale, countends, processors, candidatefile, search, ksize, align, match, size, mismatch, gapopen, gapextend, minLength, maxLength, startPos, endPos, maxAmbig, maxHomoPolymer, flip, forMismatch, revMismatch, barMismatch, oligoFile;
+ string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, orderfile, fastafile, treefile, sharedfile, line, label, randomtree, groups, cutoff, format, precision, method, fileroot, iters, jumble, freq, calc, abund, step, form, sorted, trump, soft, hard, scale, countends, processors, candidatefile, search, ksize, align, match, size, mismatch, gapopen, gapextend, minLength, maxLength, startPos, endPos, maxAmbig, maxHomoPolymer, flip, oligoFile;
static GlobalData* _uniqueInstance;
*/
#include "mothur.h"
+#include "alignment.hpp"
/**************************************************************************************************/
*
*/
-#include "sequence.hpp"
#include "trimseqscommand.h"
//***************************************************************************************************************
TrimSeqsCommand::TrimSeqsCommand(){
try {
- oligos = 0;
- forwardPrimerMismatch = 0;
- reversePrimerMismatch = 0;
- barcodeMismatch = 0;
-
+ oligos = 0;
totalBarcodeCount = 0;
matchBarcodeCount = 0;
cout << "you need to at least enter a fasta file name" << endl;
}
- if(isTrue(globaldata->getFlip())) { flip = 1; }
-
- if(globaldata->getOligosFile() != ""){
- oligos = 1;
- forwardPrimerMismatch = atoi(globaldata->getForwardMismatch().c_str());
- reversePrimerMismatch = atoi(globaldata->getReverseMismatch().c_str());
- barcodeMismatch = atoi(globaldata->getBarcodeMismatch().c_str());
- }
-
- if(!flip && !oligos) { cout << "what was the point?" << endl; }
+ if(isTrue(globaldata->getFlip())) { flip = 1; }
+ if(globaldata->getOligosFile() != "") { oligos = 1; }
+ if(!flip && !oligos) { cout << "huh?" << endl; }
-
}
catch(exception& e) {
cout << "Standard Error: " << e.what() << " has occurred in the TrimSeqsCommand class Function TrimSeqsCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
while(!inFASTA.eof()){
Sequence currSeq(inFASTA);
+ string origSeq = currSeq.getUnaligned();
string group;
string trashCode = "";
}
else{
currSeq.setName(currSeq.getName() + '|' + trashCode);
+ currSeq.setUnaligned(origSeq);
currSeq.printSequence(scrapFASTA);
}
success = 1;
break;
}
-
}
+
totalFPrimerCount++;
return success;
success = 1;
break;
}
-
- }
+ }
+
totalRPrimerCount++;
return success;
#include "mothur.h"
#include "command.hpp"
#include "globaldata.hpp"
+#include "sequence.hpp"
class TrimSeqsCommand : public Command {
public:
bool stripReverse(Sequence&);
GlobalData* globaldata;
-
- int totalBarcodeCount, matchBarcodeCount;
- int totalFPrimerCount, matchFPrimerCount;
- int totalRPrimerCount, matchRPrimerCount;
-
+
+ int totalBarcodeCount, matchBarcodeCount; // to be removed
+ int totalFPrimerCount, matchFPrimerCount; // to be removed
+ int totalRPrimerCount, matchRPrimerCount; // to be removed
bool oligos, flip;
- int forwardPrimerMismatch, reversePrimerMismatch, barcodeMismatch;
int numFPrimers, numRPrimers;
vector<string> forPrimer, revPrimer;
map<string, string> barcodes;
-
};
#endif
string reverseseqsArray[] = {"fasta"};
commandParameters["reverse.seqs"] = addParameters(reverseseqsArray, sizeof(reverseseqsArray)/sizeof(string));
- string trimseqsArray[] = {"fasta", "flip", "oligos", "forward", "reverse", "barcode"};
+ string trimseqsArray[] = {"fasta", "flip", "oligos"};
commandParameters["trim.seqs"] = addParameters(trimseqsArray, sizeof(trimseqsArray)/sizeof(string));
string vennArray[] = {"groups","line","label","calc"};