From: westcott Date: Thu, 23 Sep 2010 17:53:42 +0000 (+0000) Subject: fixed order of unifrac commands so that it matches the summary commands X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4745a956b3116a719f52f341d2a2db84df4817da;hp=61798fe609675abfedf511e542cc48c56a531199;p=mothur.git fixed order of unifrac commands so that it matches the summary commands --- diff --git a/metastatscommand.cpp b/metastatscommand.cpp index a94c72c..7d1f4df 100644 --- a/metastatscommand.cpp +++ b/metastatscommand.cpp @@ -177,7 +177,7 @@ int MetaStatsCommand::execute(){ int numGroups = Sets.size(); for (int a=0; a groups; groups.push_back(Sets[a]); groups.push_back(Sets[l]); namesOfGroupCombos.push_back(groups); } diff --git a/mothur b/mothur index 7bf5ba3..83351b2 100755 Binary files a/mothur and b/mothur differ diff --git a/sharedutilities.cpp b/sharedutilities.cpp index 6dffee9..d2a43ea 100644 --- a/sharedutilities.cpp +++ b/sharedutilities.cpp @@ -275,9 +275,13 @@ void SharedUtil::getCombos(vector& groupComb, vector 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]); + } } } } diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index e43c997..e6472a8 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -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 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) { diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index 1417b5a..e4a0a9d 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -158,7 +158,7 @@ int UnifracWeightedCommand::execute() { //calculate number of comparisons i.e. with groups A,B,C = AB, AC, BC = 3; vector< vector > namesOfGroupCombos; for (int a=0; a groups; groups.push_back(globaldata->Groups[a]); groups.push_back(globaldata->Groups[l]); namesOfGroupCombos.push_back(groups); } diff --git a/unweighted.cpp b/unweighted.cpp index a9515d1..8103688 100644 --- a/unweighted.cpp +++ b/unweighted.cpp @@ -24,7 +24,7 @@ EstOutput Unweighted::getValues(Tree* t, int p, string o) { int numComp = 0; vector< vector > namesOfGroupCombos; for (int r=0; r 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 > namesOfGroupCombos; for (int r=0; r groups; groups.push_back(globaldata->Groups[r]); groups.push_back(globaldata->Groups[l]); namesOfGroupCombos.push_back(groups); diff --git a/weighted.cpp b/weighted.cpp index fd7f854..52d90c8 100644 --- a/weighted.cpp +++ b/weighted.cpp @@ -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 > namesOfGroupCombos; for (int i=0; iGroups[i]+globaldata->Groups[l]] = 0.0; vector groups; groups.push_back(globaldata->Groups[i]); groups.push_back(globaldata->Groups[l]);