]> git.donarmstrong.com Git - mothur.git/blobdiff - sharedutilities.cpp
fixed order of unifrac commands so that it matches the summary commands
[mothur.git] / sharedutilities.cpp
index 6dffee95e1c9a2e17bbda649424d0cb53402e513..d2a43eabb6ee5f832ddba748474ce2ba0b1f16a1 100644 (file)
@@ -275,9 +275,13 @@ void SharedUtil::getCombos(vector<string>& groupComb, vector<string> userGroups,
                numComp = 0;
                for (int i=0; i< userGroups.size(); i++) { 
                        numComp += i; 
-                       for (int l = i+1; l < userGroups.size(); l++) {
-                               //set group comparison labels
-                               groupComb.push_back(userGroups[i] + "-" + userGroups[l]);
+                       for (int l = 0; l < i; l++) {
+                               if (userGroups[i] > userGroups[l]) {
+                                       //set group comparison labels
+                                       groupComb.push_back(userGroups[l] + "-" + userGroups[i]);
+                               }else{
+                                       groupComb.push_back(userGroups[i] + "-" + userGroups[l]);
+                               }
                        }
                } 
        }