]> git.donarmstrong.com Git - mothur.git/blobdiff - classifyseqscommand.cpp
final fixes for 1.7
[mothur.git] / classifyseqscommand.cpp
index 25642931164bd09c3e1cd91b0e6a9bd4009ff184..40bf93817976d1a81a12c9e5604ca470b8bf33cb 100644 (file)
@@ -181,9 +181,8 @@ int ClassifySeqsCommand::execute(){
                        inFASTA.close();
                        
                        lines.push_back(new linePair(0, numFastaSeqs));
-                       
+               
                        driver(lines[0], newTaxonomyFile, tempTaxonomyFile);
-                       
                }
                else{
                        vector<int> positions;
@@ -227,15 +226,14 @@ int ClassifySeqsCommand::execute(){
                }
 #else
                ifstream inFASTA;
-               openInputFile(candidateFileName, inFASTA);
+               openInputFile(fastaFileName, inFASTA);
                numFastaSeqs=count(istreambuf_iterator<char>(inFASTA),istreambuf_iterator<char>(), '>');
                inFASTA.close();
                
                lines.push_back(new linePair(0, numFastaSeqs));
                
                driver(lines[0], newTaxonomyFile, tempTaxonomyFile);
-#endif
-               
+#endif 
                delete classify;
                
                //make taxonomy tree from new taxonomy file 
@@ -356,27 +354,14 @@ int ClassifySeqsCommand::driver(linePair* line, string taxFName, string tempTFNa
                        taxonomy = classify->getTaxonomy(candidateSeq);
                        
                        if (taxonomy != "bad seq") {
-                               //if (method != "bayesian") {
-                                       outTax << candidateSeq->getName() << '\t' << taxonomy << endl;
-                                       outTaxSimple << candidateSeq->getName() << '\t' << classify->getSimpleTax() << endl;
-                               //}else{
-                                       //vector<string> pTax = classify->parseTax(taxonomy);
-                                       //map<string, int> confidence = classify->getConfidenceScores();
-                                       
-                                       //outTax << candidateSeq->getName() << '\t';
-                                       //for (int j = 0; j < pTax.size(); j++) {
-                                               //if (confidence[pTax[j]] > cutoff) {
-                                               //      outTax << pTax[j] << "(" << confidence[pTax[j]] << ");";
-                                               //}else{ break; }
-                                       //}
-                                       //outTax << endl;
-                               //}
+                               outTax << candidateSeq->getName() << '\t' << taxonomy << endl;
+                               outTaxSimple << candidateSeq->getName() << '\t' << classify->getSimpleTax() << endl;
                        }
                                                        
                        delete candidateSeq;
                        
-                       if(i % 100 == 0){
-                               mothurOut("Classifying sequence " + toString(i)); mothurOutEndLine();
+                       if((i+1) % 100 == 0){
+                               mothurOut("Classifying sequence " + toString(i+1)); mothurOutEndLine();
                        }
                }