]> git.donarmstrong.com Git - mothur.git/blobdiff - unifracunweightedcommand.cpp
fixed bug with tree reading
[mothur.git] / unifracunweightedcommand.cpp
index 81601a168a43875dcc20db786460bfa2cbc93faa..a9ca4d01260340fbdc08ccf423c6022f8dd5abbc 100644 (file)
@@ -82,9 +82,7 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option)  {
                if(option == "help") { help(); abort = true; calledHelp = true; }
                
                else {
-                       //valid paramters for this command
-                       string Array[] =  {"groups","iters","distance","random","root", "processors","outputdir","inputdir"};
-                       vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+                       vector<string> myArray = setParameters();
                        
                        OptionParser parser(option);
                        map<string,string> parameters = parser.getParameters();
@@ -135,6 +133,10 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(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);
@@ -208,6 +210,8 @@ int UnifracUnweightedCommand::execute() {
                
                if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
+               m->setTreeFile(treefile);
+               
                if (groupfile != "") {
                        //read in group map info.
                        tmap = new TreeMap(groupfile);