]> git.donarmstrong.com Git - mothur.git/blobdiff - phylotree.cpp
fixed bug with dist.shared subsampling. added mode parameter to dist.shared so...
[mothur.git] / phylotree.cpp
index dba1e3b56951f8ae1c484ace22187a9b65053d35..4ed3d8c1c02e1c5a1ee93b9dd6143309f5606f5c 100644 (file)
@@ -128,8 +128,6 @@ PhyloTree::PhyloTree(string tfile){
                maxLevel = 0;
                calcTotals = true;
                string name, tax;
-               addSeqToTree("unknown", "unknown;");
-
                
                #ifdef USE_MPI
                        int pid, num, processors;
@@ -193,7 +191,16 @@ PhyloTree::PhyloTree(string tfile){
                #endif
        
                assignHeirarchyIDs(0);
-       
+        
+        
+        string unknownTax = "unknown;";
+        //added last taxon until you get desired level
+               for (int i = 1; i < maxLevel; i++) {
+                       unknownTax += "unclassfied;";
+               }
+        
+        addSeqToTree("unknown", unknownTax);
+        
                //create file for summary if needed
                setUp(tfile);
        }
@@ -612,13 +619,15 @@ bool PhyloTree::ErrorCheck(vector<string> templateFileNames){
                map<string, int>::iterator itFind;
                map<string, int> taxonomyFileNames = name2Taxonomy;
                
+        if (m->debug) { m->mothurOut("[DEBUG]: in error check. Numseqs in template = " + toString(templateFileNames.size()) + ". Numseqs in taxonomy = " + toString(taxonomyFileNames.size()) + ".\n"); }
+        
                for (int i = 0; i < templateFileNames.size(); i++) {
                        itFind = taxonomyFileNames.find(templateFileNames[i]);
                        
                        if (itFind != taxonomyFileNames.end()) { //found it so erase it
                                taxonomyFileNames.erase(itFind);
                        }else {
-                               m->mothurOut(templateFileNames[i] + " is in your template file and is not in your taxonomy file. Please correct."); m->mothurOutEndLine();
+                               m->mothurOut("'" +templateFileNames[i] + "' is in your template file and is not in your taxonomy file. Please correct."); m->mothurOutEndLine();
                                okay = false;
                        }