]> git.donarmstrong.com Git - mothur.git/blobdiff - readtreecommand.cpp
fixed bug with creation of .tree.sum file
[mothur.git] / readtreecommand.cpp
index da66ee1eb0971362e8f19ff62155c26239da5615..07aa5b3e4071289a25400e7cb03f616b34ad18ba 100644 (file)
@@ -108,8 +108,10 @@ void ReadTreeCommand::help(){
        try {
                m->mothurOut("The read.tree command must be run before you execute a unifrac.weighted, unifrac.unweighted. \n");
                m->mothurOut("It also must be run before using the parsimony command, unless you are using the randomtree parameter.\n");
+               m->mothurOut("The read.tree command parameters are tree, group and name.\n");
                m->mothurOut("The read.tree command should be in the following format: read.tree(tree=yourTreeFile, group=yourGroupFile).\n");
                m->mothurOut("The tree and group parameters are both required.\n");
+               m->mothurOut("The name parameter allows you to enter a namefile.\n");
                m->mothurOut("Note: No spaces between parameter labels (i.e. tree), '=' and parameters (i.e.yourTreefile).\n\n");
        }
        catch(exception& e) {
@@ -141,6 +143,13 @@ int ReadTreeCommand::execute(){
 
                //assemble users trees
                for (int i = 0; i < T.size(); i++) {
+                       if (m->control_pressed) {  
+                               for (int i = 0; i < T.size(); i++) {  delete T[i];  }
+                               globaldata->gTree.clear();
+                               delete globaldata->gTreemap;
+                               return 0;
+                       }
+       
                        T[i]->assembleTree();
                }
 
@@ -154,6 +163,13 @@ int ReadTreeCommand::execute(){
                                        count++;
                                }
                                
+                               if (m->control_pressed) {  
+                                       for (int i = 0; i < T.size(); i++) {  delete T[i];  }
+                                       globaldata->gTree.clear();
+                                       delete globaldata->gTreemap;
+                                       return 0;
+                               }
+                               
                                //then you did not find it so report it 
                                if (count == globaldata->Treenames.size()) { 
                                        //if it is in your namefile then don't remove
@@ -166,6 +182,8 @@ int ReadTreeCommand::execute(){
                                        }
                                }
                        }
+                       
+                       globaldata->gTreemap = treeMap;
                }
                
                return 0;