]> git.donarmstrong.com Git - mothur.git/blobdiff - tree.cpp
made read.tree not require a groupfile, if one is not given all seqs are assumed...
[mothur.git] / tree.cpp
index 14d86e6daf211b625931c3d52a127cd441086267..3cb26113f8deb8acf3bf28f7040becf2bac7385f 100644 (file)
--- a/tree.cpp
+++ b/tree.cpp
@@ -9,7 +9,19 @@
 
 #include "tree.h"
 
-
+/*****************************************************************/
+Tree::Tree(string g) {
+       try {
+               globaldata = GlobalData::getInstance();
+               m = MothurOut::getInstance();
+               
+               parseTreeFile();  globaldata->runParse = false;  
+       }
+       catch(exception& e) {
+               m->errorOut(e, "Tree", "Tree - just parse");
+               exit(1);
+       }
+}
 /*****************************************************************/
 Tree::Tree() {
        try {
@@ -69,6 +81,9 @@ void Tree::addNamesToCounts() {
 
                                
                //go through each leaf and update its pcounts and pgroups
+               
+               //float A = clock();
+
                for (int i = 0; i < numLeaves; i++) {
 
                        string name = tree[i].getName();
@@ -132,7 +147,11 @@ void Tree::addNamesToCounts() {
                                tree[i].setGroup(nodeGroups);
                                
                        }//end else
-               }//end for                                      
+               }//end for              
+               
+               //float B = clock();
+               //cout << "addNamesToCounts\t" << (B - A) / CLOCKS_PER_SEC << endl;     
+
        }
        catch(exception& e) {
                m->errorOut(e, "Tree", "addNamesToCounts");
@@ -168,7 +187,8 @@ void Tree::setIndex(string searchName, int index) {
 /*****************************************************************/
 int Tree::assembleTree() {
        try {
-       
+               //float A = clock();
+
                //if user has given a names file we want to include that info in the pgroups and pcount info.
                if(globaldata->names.size() != 0) {  addNamesToCounts();  }
                
@@ -179,7 +199,8 @@ int Tree::assembleTree() {
                        tree[i].pGroups = (mergeGroups(i));
                        tree[i].pcount = (mergeGcounts(i));
                }
-               
+               //float B = clock();
+               //cout << "assembleTree\t" << (B-A) / CLOCKS_PER_SEC << endl;
                return 0;
        }
        catch(exception& e) {