]> git.donarmstrong.com Git - mothur.git/blobdiff - unifracweightedcommand.cpp
fixed bug with tree reading
[mothur.git] / unifracweightedcommand.cpp
index 29cdf94091cebb65104e1b5691e5691e19a4e495..f868129fd2236a3aca06cf27f2e25b2229013ccf 100644 (file)
@@ -48,7 +48,7 @@ string UnifracWeightedCommand::getHelpString(){
                helpString += "Example unifrac.weighted(groups=A-B-C, iters=500).\n";
                helpString += "The default value for groups is all the groups in your groupfile, and iters is 1000.\n";
                helpString += "The unifrac.weighted command output two files: .weighted and .wsummary their descriptions are in the manual.\n";
-               helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n";
+               helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n";
                return helpString;
        }
        catch(exception& e) {
@@ -133,6 +133,10 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) {
                        }
                        
                        m->runParse = true;
+                       m->Groups.clear();
+                       m->namesOfGroups.clear();
+                       m->Treenames.clear();
+                       m->names.clear();
                        
                        //check for required parameters
                        treefile = validParameter.validFile(parameters, "tree", true);
@@ -200,6 +204,8 @@ int UnifracWeightedCommand::execute() {
        
                if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
+               m->setTreeFile(treefile);
+               
                if (groupfile != "") {
                        //read in group map info.
                        tmap = new TreeMap(groupfile);