]> git.donarmstrong.com Git - mothur.git/blobdiff - knn.cpp
finished work on classify.seqs bayesian method and various bug fixes
[mothur.git] / knn.cpp
diff --git a/knn.cpp b/knn.cpp
index 6d57fb135f14398fb6b7ab776eb81e84e4728406..0a62e743b0dd8d4f5435d504127a70724f9f27a8 100644 (file)
--- a/knn.cpp
+++ b/knn.cpp
@@ -60,18 +60,7 @@ string Knn::findCommonTaxonomy(vector<string> closest)  {
                
                        string tax = taxonomy[closest[i]];  //we know its there since we checked in getTaxonomy
                
-                       tax = tax.substr(0, tax.length()-1);  //get rid of last ';'
-       
-                       //parse taxonomy
-                       string individual;
-                       while (tax.find_first_of(';') != -1) {
-                               individual = tax.substr(0,tax.find_first_of(';'));
-                               tax = tax.substr(tax.find_first_of(';')+1, tax.length());
-                               taxons[i].push_back(individual);
-                       
-                       }
-                       //get last one
-                       taxons[i].push_back(tax);
+                       taxons[i] = parseTax(tax);
                
                        //figure out who has the shortest taxonomy info. so you can start comparing there
                        if (taxons[i].size() < smallest) {