]> git.donarmstrong.com Git - mothur.git/blobdiff - classify.cpp
added code to check path for uchime and catchall executables
[mothur.git] / classify.cpp
index 4c6c6d8c8f0d628653ff772a367b07cdbadecced..7726b3e00cca9de19971b70656f9581e43e97c8a 100644 (file)
@@ -47,7 +47,7 @@ void Classify::generateDatabaseAndNames(string tfile, string tempFile, string me
                                }
                        }
                        else if(method == "suffix")             {       database = new SuffixDB(numSeqs);                                                               }
-                       else if(method == "blast")              {       database = new BlastDB(tempFile.substr(0,tempFile.find_last_of(".")+1), gapOpen, gapExtend, match, misMatch, "");       }
+                       else if(method == "blast")              {       database = new BlastDB(tempFile.substr(0,tempFile.find_last_of(".")+1), gapOpen, gapExtend, match, misMatch, "", threadID);     }
                        else if(method == "distance")   {       database = new DistanceDB();    }
                        else {
                                m->mothurOut(method + " is not a valid search option. I will run the command using kmer, ksize=8.");
@@ -89,7 +89,7 @@ void Classify::generateDatabaseAndNames(string tfile, string tempFile, string me
                        m->mothurOut("Generating search database...    "); cout.flush();
        #ifdef USE_MPI  
                                int pid, processors;
-                               vector<unsigned long int> positions;
+                               vector<unsigned long long> positions;
                                int tag = 2001;
                        
                                MPI_Status status; 
@@ -123,7 +123,7 @@ void Classify::generateDatabaseAndNames(string tfile, string tempFile, string me
                                //create database
                                if(method == "kmer")                    {       database = new KmerDB(tempFile, kmerSize);                      }
                                else if(method == "suffix")             {       database = new SuffixDB(numSeqs);                                                               }
-                               else if(method == "blast")              {       database = new BlastDB(tempFile.substr(0,tempFile.find_last_of(".")+1), gapOpen, gapExtend, match, misMatch, "");       }
+                               else if(method == "blast")              {       database = new BlastDB(tempFile.substr(0,tempFile.find_last_of(".")+1), gapOpen, gapExtend, match, misMatch, "", pid);  }
                                else if(method == "distance")   {       database = new DistanceDB();    }
                                else {
                                        m->mothurOut(method + " is not a valid search option. I will run the command using kmer, ksize=8."); m->mothurOutEndLine();
@@ -176,7 +176,7 @@ void Classify::generateDatabaseAndNames(string tfile, string tempFile, string me
                                }
                        }
                        else if(method == "suffix")             {       database = new SuffixDB(numSeqs);                                                               }
-                       else if(method == "blast")              {       database = new BlastDB(tempFile.substr(0,tempFile.find_last_of(".")+1), gapOpen, gapExtend, match, misMatch, "");       }
+                       else if(method == "blast")              {       database = new BlastDB(tempFile.substr(0,tempFile.find_last_of(".")+1), gapOpen, gapExtend, match, misMatch, "", threadID);     }
                        else if(method == "distance")   {       database = new DistanceDB();    }
                        else {
                                m->mothurOut(method + " is not a valid search option. I will run the command using kmer, ksize=8.");
@@ -238,7 +238,7 @@ void Classify::generateDatabaseAndNames(string tfile, string tempFile, string me
        }
 }
 /**************************************************************************************************/
-Classify::Classify() {         m = MothurOut::getInstance();   database = NULL;        }
+Classify::Classify() {         m = MothurOut::getInstance();   database = NULL;        flipped=false; }
 /**************************************************************************************************/
 
 int Classify::readTaxonomy(string file) {
@@ -249,10 +249,11 @@ int Classify::readTaxonomy(string file) {
                
                m->mothurOutEndLine();
                m->mothurOut("Reading in the " + file + " taxonomy...\t");      cout.flush();
-
+        if (m->debug) { m->mothurOut("[DEBUG]: Taxonomies read in...\n"); }
+        
 #ifdef USE_MPI 
                int pid, num, processors;
-               vector<unsigned long int> positions;
+               vector<unsigned long long> positions;
                int tag = 2001;
                
                MPI_Status status; 
@@ -296,7 +297,9 @@ int Classify::readTaxonomy(string file) {
                        delete buf4;
 
                        istringstream iss (tempBuf,istringstream::in);
-                       iss >> name >> taxInfo;
+                       iss >> name; m->gobble(iss);
+            iss >> taxInfo;
+            if (m->debug) { m->mothurOut("[DEBUG]: name = " + name + " tax = " + taxInfo + "\n"); }
                        taxonomy[name] = taxInfo;
                        phyloTree->addSeqToTree(name, taxInfo);
                }
@@ -309,8 +312,11 @@ int Classify::readTaxonomy(string file) {
        
                //read template seqs and save
                while (!inTax.eof()) {
-                       inTax >> name >> taxInfo;
-                       
+                       inTax >> name; m->gobble(inTax);
+            inTax >> taxInfo;
+            
+            if (m->debug) {  m->mothurOut("[DEBUG]: name = '" + name + "' tax = '" + taxInfo + "'\n");  }
+
                        taxonomy[name] = taxInfo;
                        
                        phyloTree->addSeqToTree(name, taxInfo);
@@ -319,6 +325,8 @@ int Classify::readTaxonomy(string file) {
                }
                inTax.close();
 #endif 
+        
+        
        
                phyloTree->assignHeirarchyIDs(0);