From c99f3846e7a7b6f06ab46508baa5409204ad6290 Mon Sep 17 00:00:00 2001 From: pschloss Date: Tue, 26 Jan 2010 18:13:06 +0000 Subject: [PATCH] pat's edits from 1/26/2010 --- chimeraseqscommand.cpp | 2 +- chimeraslayer.cpp | 3 ++- classifyseqscommand.cpp | 9 +++++---- mothur.cpp | 8 ++++---- preclustercommand.cpp | 7 ++----- trimseqscommand.cpp | 6 ++++-- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/chimeraseqscommand.cpp b/chimeraseqscommand.cpp index 3632e63..9bd13e3 100644 --- a/chimeraseqscommand.cpp +++ b/chimeraseqscommand.cpp @@ -196,7 +196,7 @@ int ChimeraSeqsCommand::execute(){ else if (method == "pintail") { chimera = new Pintail(fastafile, templatefile); } else if (method == "ccode") { chimera = new Ccode(fastafile, templatefile); } else if (method == "chimeracheck") { chimera = new ChimeraCheckRDP(fastafile, templatefile); } - //else if (method == "chimeraslayer") { chimera = new ChimeraSlayer(fastafile, templatefile); } + else if (method == "chimeraslayer") { chimera = new ChimeraSlayer(fastafile, templatefile); } else { mothurOut("Not a valid method."); mothurOutEndLine(); return 0; } //set user options diff --git a/chimeraslayer.cpp b/chimeraslayer.cpp index 9b85b5c..ab4bd1f 100644 --- a/chimeraslayer.cpp +++ b/chimeraslayer.cpp @@ -33,11 +33,12 @@ void ChimeraSlayer::print(ostream& out) { for (int i = 0; i < querySeqs.size(); i++) { if (chimeraFlags[i] == "yes") { + cout << i << endl; if ((chimeraResults[i][0].bsa >= 90.0) || (chimeraResults[i][0].bsb >= 90.0)) { mothurOut(querySeqs[i]->getName() + "\tyes"); mothurOutEndLine(); out << querySeqs[i]->getName() << "\tyes" << endl; }else { - out << querySeqs[i]->getName() << "\tno" << endl; + out << querySeqs[i]->getName() << "\tyes" << endl; //mothurOut(querySeqs[i]->getName() + "\tno"); mothurOutEndLine(); } diff --git a/classifyseqscommand.cpp b/classifyseqscommand.cpp index 3e4f6ad..473d4d1 100644 --- a/classifyseqscommand.cpp +++ b/classifyseqscommand.cpp @@ -200,8 +200,8 @@ int ClassifySeqsCommand::execute(){ try { if (abort == true) { return 0; } - if(method == "bayesian") { classify = new Bayesian(taxonomyFileName, templateFileName, search, kmerSize, cutoff, iters); } - else if(method == "knn") { classify = new Knn(taxonomyFileName, templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch, numWanted); } + if(method == "bayesian"){ classify = new Bayesian(taxonomyFileName, templateFileName, search, kmerSize, cutoff, iters); } + else if(method == "knn"){ classify = new Knn(taxonomyFileName, templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch, numWanted); } else { mothurOut(search + " is not a valid method option. I will run the command using bayesian."); mothurOutEndLine(); @@ -380,7 +380,7 @@ string ClassifySeqsCommand::addUnclassifieds(string tax, int maxlevel) { //keep what you have counting the levels while (tax.find_first_of(';') != -1) { //get taxon - taxon = tax.substr(0,tax.find_first_of(';')); + taxon = tax.substr(0,tax.find_first_of(';'))+';'; tax = tax.substr(tax.find_first_of(';')+1, tax.length()); newTax += taxon; level++; @@ -480,13 +480,14 @@ int ClassifySeqsCommand::driver(linePair* line, string taxFName, string tempTFNa if (candidateSeq->getName() != "") { taxonomy = classify->getTaxonomy(candidateSeq); - + if (taxonomy != "bad seq") { //output confidence scores or not if (probs) { outTax << candidateSeq->getName() << '\t' << taxonomy << endl; }else{ outTax << candidateSeq->getName() << '\t' << classify->getSimpleTax() << endl; + cout << classify->getSimpleTax() << endl; } outTaxSimple << candidateSeq->getName() << '\t' << classify->getSimpleTax() << endl; diff --git a/mothur.cpp b/mothur.cpp index 7fd5d1e..ab4fea0 100644 --- a/mothur.cpp +++ b/mothur.cpp @@ -20,11 +20,11 @@ int main(int argc, char *argv[]){ try { //remove old logfile - string log = "mothur.logFile"; - remove(log.c_str()); +// string log = "mothur.logFile"; +// remove(log.c_str()); time_t ltime = time(NULL); /* calendar time */ - string logFileName = "mothur." + toString(asctime( localtime(<ime) )) + ".logfile"; + string logFileName = "mothur." + toString(ltime) + ".logfile"; //version #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) @@ -110,7 +110,7 @@ int main(int argc, char *argv[]){ delete mothur; - rename(log.c_str(), logFileName.c_str()); //logfile with timestamp +// rename(log.c_str(), logFileName.c_str()); //logfile with timestamp return 0; } diff --git a/preclustercommand.cpp b/preclustercommand.cpp index 66fd850..89e6cbf 100644 --- a/preclustercommand.cpp +++ b/preclustercommand.cpp @@ -99,12 +99,9 @@ int PreClusterCommand::execute(){ //sort seqs by number of identical seqs sort(alignSeqs.begin(), alignSeqs.end(), comparePriority); - //go through active list and cluster everthing you can, until all nodes are inactive - //taking advantage of the fact that maps are already sorted -// map::iterator itActive; -// map::iterator it2Active; int count = 0; - + + //think about running through twice... for (int i = 0; i < numSeqs; i++) { //are you active diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index a6950ac..b185da0 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -301,7 +301,9 @@ void TrimSeqsCommand::getOligos(vector& outFASTAVec){ forPrimer.push_back(oligo); } else if(type == "reverse"){ - revPrimer.push_back(oligo); + Sequence oligoRC("reverse", oligo); + oligoRC.reverseComplement(); + revPrimer.push_back(oligoRC.getUnaligned()); } else if(type == "barcode"){ inOligos >> group; @@ -406,7 +408,7 @@ bool TrimSeqsCommand::stripReverse(Sequence& seq){ } if(compareDNASeq(oligo, rawSequence.substr(rawSequence.length()-oligo.length(),oligo.length()))){ - seq.setUnaligned(rawSequence.substr(rawSequence.length()-oligo.length())); + seq.setUnaligned(rawSequence.substr(0,rawSequence.length()-oligo.length())); success = 1; break; } -- 2.39.2