]> git.donarmstrong.com Git - mothur.git/blobdiff - tree.cpp
fixed read.tree so that it can read trees generated by fasttree
[mothur.git] / tree.cpp
index 7da3cef3718502640d61377bccbaae0d8e4213d3..8e459810589cbc23e9f443884406028382e4e212 100644 (file)
--- a/tree.cpp
+++ b/tree.cpp
@@ -70,10 +70,11 @@ void Tree::addNamesToCounts() {
                                
                //go through each leaf and update its pcounts and pgroups
                for (int i = 0; i < numLeaves; i++) {
+
                        string name = tree[i].getName();
-                       
+               
                        map<string, string>::iterator itNames = globaldata->names.find(name);
-                       
+               
                        if (itNames == globaldata->names.end()) { m->mothurOut(name + " is not in your name file, please correct."); m->mothurOutEndLine(); exit(1);  }
                        else {
                                vector<string> dupNames;
@@ -131,8 +132,7 @@ void Tree::addNamesToCounts() {
                                tree[i].setGroup(nodeGroups);
                                
                        }//end else
-               }//end for
-                               
+               }//end for                                      
        }
        catch(exception& e) {
                m->errorOut(e, "Tree", "addNamesToCounts");
@@ -713,6 +713,10 @@ void Tree::parseTreeFile() {
                        }
                }
                filehandle.close();
+               
+               //for (int i = 0; i < globaldata->Treenames.size(); i++) {
+//cout << globaldata->Treenames[i] << endl; }
+//cout << globaldata->Treenames.size() << endl;
        }
        catch(exception& e) {
                m->errorOut(e, "Tree", "parseTreeFile");