]> git.donarmstrong.com Git - mothur.git/blobdiff - classify.cpp
added distance search method to classify.seqs
[mothur.git] / classify.cpp
index 9431c6cef6adf9edff07cfb16d32826c1b3592d9..346c76478eefdf896fe6f04659174321bc721063 100644 (file)
 #include "kmerdb.hpp"
 #include "suffixdb.hpp"
 #include "blastdb.hpp"
+#include "distancedb.hpp"
 
 /**************************************************************************************************/
-
 Classify::Classify(string tfile, string tempFile, string method, int kmerSize, float gapOpen, float gapExtend, float match, float misMatch) : taxFile(tfile), templateFile(tempFile) {         
-       try {                                                                                   
+       try {   
+                                                                                       
                readTaxonomy(taxFile);  
                
                int start = time(NULL);
@@ -42,6 +43,7 @@ Classify::Classify(string tfile, string tempFile, string method, int kmerSize, f
                }
                else if(method == "suffix")             {       database = new SuffixDB(numSeqs);                                                               }
                else if(method == "blast")              {       database = new BlastDB(gapOpen, gapExtend, match, misMatch);    }
+               else if(method == "distance")   {       database = new DistanceDB();    }
                else {
                        mothurOut(method + " is not a valid search option. I will run the command using kmer, ksize=8.");
                        mothurOutEndLine();
@@ -111,10 +113,6 @@ void Classify::readTaxonomy(string file) {
                        
                        taxonomy[name] = taxInfo;
                        
-                       //itTax = taxList.find(taxInfo);
-                       //if (itTax == taxList.end()) { //this is new taxonomy
-                               //taxList[taxInfo] = 1;
-                       //}else { taxList[taxInfo]++;   }
                        phyloTree->addSeqToTree(name, taxInfo);
                
                        gobble(inTax);