]> git.donarmstrong.com Git - mothur.git/blobdiff - unifracunweightedcommand.cpp
parsimony command now uses groups, fixed bug with unweighted groups
[mothur.git] / unifracunweightedcommand.cpp
index 3eedb2ecd99ff2a68342c23ab617639c3c82e312..bf2129c8b2bbc2e8e727c88bea45049464947bad 100644 (file)
@@ -37,9 +37,16 @@ UnifracUnweightedCommand::UnifracUnweightedCommand() {
                        //if the user only entered invalid groups
                        if (globaldata->Groups.size() == 0) { 
                                cout << "When using the groups parameter you must have at least 1 valid group. I will run the command using all the groups in your groupfile." << endl; 
-                       }               
+                               for (int i = 0; i < tmap->namesOfGroups.size(); i++) {
+                                       globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+                               }
+                       }
+               }else {
+                       for (int i = 0; i < tmap->namesOfGroups.size(); i++) {
+                               globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+                       }
                }
-
+               
                convert(globaldata->getIters(), iters);  //how many random trees to generate
                unweighted = new Unweighted(tmap);
 
@@ -154,6 +161,9 @@ int UnifracUnweightedCommand::execute() {
                printUnweightedFile();
                printUWSummaryFile();
                
+               //reset groups parameter
+               globaldata->Groups.clear();
+               
                delete randT;
                
                return 0;