X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=classifyseqscommand.cpp;h=473d4d11d78bed00e56a02472afeb4980e19e87e;hb=c99f3846e7a7b6f06ab46508baa5409204ad6290;hp=3e4f6ad3b36f4a137ceef8cb774b905b238c2f20;hpb=ee4dd201fa4f2c4ede5b2e525c82cce0a37de363;p=mothur.git 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;