]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed order of unifrac commands so that it matches the summary commands
authorwestcott <westcott>
Thu, 23 Sep 2010 17:53:42 +0000 (17:53 +0000)
committerwestcott <westcott>
Thu, 23 Sep 2010 17:53:42 +0000 (17:53 +0000)
metastatscommand.cpp
mothur
sharedutilities.cpp
summarysharedcommand.cpp
unifracweightedcommand.cpp
unweighted.cpp
weighted.cpp

index a94c72cb4649c9136175bb75cb3c49846dbcdb1e..7d1f4df1e95fa10241225ca20dba35c1f069d6ff 100644 (file)
@@ -177,7 +177,7 @@ int MetaStatsCommand::execute(){
                
                int numGroups = Sets.size();
                for (int a=0; a<numGroups; a++) { 
-                       for (int l = a+1; l < numGroups; l++) { 
+                       for (int l = 0; l < a; l++) {   
                                vector<string> groups; groups.push_back(Sets[a]); groups.push_back(Sets[l]);
                                namesOfGroupCombos.push_back(groups);
                        }
diff --git a/mothur b/mothur
index 7bf5ba30b99fe799c4b6a337553b64c3f60594f7..83351b287dacac7a37d1b4b590375e1c5e6bcd1b 100755 (executable)
Binary files a/mothur and b/mothur differ
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]);
+                               }
                        }
                } 
        }
index e43c99708cd81a231286c10dc1c12d9035059fce..e6472a8af60b281eb84c021516dc1a88f6c01cb3 100644 (file)
@@ -231,7 +231,7 @@ int SummarySharedCommand::execute(){
                input = globaldata->ginput;
                lookup = input->getSharedRAbundVectors();
                string lastLabel = lookup[0]->getLabel();
-               
+       
                /******************************************************/
                //output headings for files
                /******************************************************/
@@ -412,7 +412,7 @@ int SummarySharedCommand::process(vector<SharedRAbundVector*> thisLookup, string
                                
                        #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
                                if(processors == 1){
-                                       driver(thisLookup, 0, numGroups, sumFileName, sumAllFileName);
+                                       driver(thisLookup, 0, numGroups, sumFileName+".temp", sumAllFileName+".temp");
                                        m->appendFiles((sumFileName + ".temp"), sumFileName);
                                        remove((sumFileName + ".temp").c_str());
                                        if (mult) {
index 1417b5a34a6e4ca8a133cc6f2c8ae390ffb81271..e4a0a9d66e3128753371dca2d90554c43c4b59a9 100644 (file)
@@ -158,7 +158,7 @@ int UnifracWeightedCommand::execute() {
                                //calculate number of comparisons i.e. with groups A,B,C = AB, AC, BC = 3;
                                vector< vector<string> > namesOfGroupCombos;
                                for (int a=0; a<numGroups; a++) { 
-                                       for (int l = a+1; l < numGroups; l++) { 
+                                       for (int l = 0; l < a; l++) {   
                                                vector<string> groups; groups.push_back(globaldata->Groups[a]); groups.push_back(globaldata->Groups[l]);
                                                namesOfGroupCombos.push_back(groups);
                                        }
index a9515d160a93c50813f61f5a54c1da6423cd4da3..8103688fb04d34542ee2174728d3399055a5d452 100644 (file)
@@ -24,7 +24,7 @@ EstOutput Unweighted::getValues(Tree* t, int p, string o) {
                int numComp = 0;
                vector< vector<string> > namesOfGroupCombos;
                for (int r=0; r<numGroups; r++) { 
-                       for (int l = r+1; l < numGroups; l++) {
+                       for (int l = 0; l < r; l++) {
                                numComp++;
                                vector<string> groups; groups.push_back(globaldata->Groups[r]); groups.push_back(globaldata->Groups[l]);
                                namesOfGroupCombos.push_back(groups);
@@ -241,7 +241,7 @@ EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB, int p, st
                int numComp = 0;
                vector< vector<string> > namesOfGroupCombos;
                for (int r=0; r<numGroups; r++) { 
-                       for (int l = r+1; l < numGroups; l++) {
+                       for (int l = 0; l < r; l++) {
                                numComp++;
                                vector<string> groups; groups.push_back(globaldata->Groups[r]); groups.push_back(globaldata->Groups[l]);
                                namesOfGroupCombos.push_back(groups);
index fd7f8541494e78ade54e78f6832e7f4eab20ea2e..52d90c8ac4487d83acd1587b1d0f5c30b0c4cfe0 100644 (file)
@@ -30,7 +30,7 @@ EstOutput Weighted::getValues(Tree* t, int p, string o) {
                //calculate number of comparisons i.e. with groups A,B,C = AB, AC, BC = 3;
                vector< vector<string> > namesOfGroupCombos;
                for (int i=0; i<numGroups; i++) { 
-                       for (int l = i+1; l < numGroups; l++) { 
+                       for (int l = 0; l < i; l++) {   
                                //initialize weighted scores
                                //WScore[globaldata->Groups[i]+globaldata->Groups[l]] = 0.0;
                                vector<string> groups; groups.push_back(globaldata->Groups[i]); groups.push_back(globaldata->Groups[l]);