]> git.donarmstrong.com Git - mothur.git/blobdiff - unifracunweightedcommand.cpp
fixed bug in read.tree updates help and validparameters strings, added ability for...
[mothur.git] / unifracunweightedcommand.cpp
index 75ab99682974b3152d3c5020130855788ef5f151..2b93df782bccc4d2dbc8533e7cdc38169059d6a7 100644 (file)
@@ -36,7 +36,7 @@ UnifracUnweightedCommand::UnifracUnweightedCommand() {
 /***********************************************************/
 int UnifracUnweightedCommand::execute() {
        try {
-       
+
                userData.resize(numComp,0);  //data[0] = unweightedscore 
                randomData.resize(numComp,0); //data[0] = unweightedscore
                //create new tree with same num nodes and leaves as users
@@ -85,6 +85,7 @@ int UnifracUnweightedCommand::execute() {
                                        //add randoms score to validscores
                                        validScores[randomData[k]] = randomData[k];
                                }
+                               
                        }
                
                for(int a = 0; a < numComp; a++) {
@@ -101,6 +102,8 @@ int UnifracUnweightedCommand::execute() {
                        UWScoreSig[a].push_back(rCumul[a][userData[a]]);
                }
                
+               
+               
                printUnweightedFile();
                printUWSummaryFile();
                
@@ -208,9 +211,11 @@ void UnifracUnweightedCommand::setGroups() {
                                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]);
-                                               numGroups++;
-                                               allGroups += tmap->namesOfGroups[i] + "-";
+                                               if (tmap->namesOfGroups[i] != "xxx") {
+                                                       globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+                                                       numGroups++;
+                                                       allGroups += tmap->namesOfGroups[i] + "-";
+                                               }
                                        }
                                        allGroups = allGroups.substr(0, allGroups.length()-1);
                                }else {
@@ -223,16 +228,20 @@ void UnifracUnweightedCommand::setGroups() {
                        }else{//user has enter "all" and wants the default groups
                                globaldata->Groups.clear();
                                for (int i = 0; i < tmap->namesOfGroups.size(); i++) {
-                                       globaldata->Groups.push_back(tmap->namesOfGroups[i]);
-                                       numGroups++;
-                                       allGroups += tmap->namesOfGroups[i] + "-";
+                                       if (tmap->namesOfGroups[i] != "xxx") {
+                                               globaldata->Groups.push_back(tmap->namesOfGroups[i]);
+                                               numGroups++;
+                                               allGroups += tmap->namesOfGroups[i] + "-";
+                                       }
                                }
                                allGroups = allGroups.substr(0, allGroups.length()-1);
                                globaldata->setGroups("");
                        }
                }else {
                        for (int i = 0; i < tmap->namesOfGroups.size(); i++) {
-                               allGroups += tmap->namesOfGroups[i] + "-";
+                               if (tmap->namesOfGroups[i] != "xxx") {
+                                       allGroups += tmap->namesOfGroups[i] + "-";
+                               }
                        }
                        allGroups = allGroups.substr(0, allGroups.length()-1);
                        numGroups = 1;