X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=collect.cpp;fp=collect.cpp;h=ec5366b627d8e8f776ffd00c0bb63f98a748f4bc;hb=75c5a235ac3eb22e0f97d36874f4b2dcf9591f2e;hp=79e997de38bc8938bbcdb72d7134a566a7b9a2bb;hpb=8f89a92f4ada82a2b3bf51b23b6a977770f2b9e2;p=mothur.git diff --git a/collect.cpp b/collect.cpp index 79e997d..ec5366b 100644 --- a/collect.cpp +++ b/collect.cpp @@ -132,17 +132,25 @@ try { //how many comparisons to make i.e. for group a, b, c = ab, ac, bc. int n = 1; + bool pair = true; for (int k = 0; k < (lookup.size() - 1); k++) { // pass cdd each set of groups to commpare for (int l = n; l < lookup.size(); l++) { subset.clear(); //clear out old pair of sharedrabunds //add new pair of sharedrabund vectors subset.push_back(lookup[k]); subset.push_back(lookup[l]); - ccd->updateSharedData(subset, i+1, globaldata->Groups.size()); + + //load subset with rest of lookup for those calcs that need everyone to calc for a pair + for (int w = 0; w < lookup.size(); w++) { + if ((w != k) && (w != l)) { subset.push_back(lookup[w]); } + } + + ccd->updateSharedData(subset, i+1, globaldata->Groups.size(), pair); } n++; } //if this is a calculator that can do multiples then do them - ccd->updateSharedData(lookup, i+1, globaldata->Groups.size()); + pair = false; + ccd->updateSharedData(lookup, i+1, globaldata->Groups.size(), pair); } totalNumSeq = i+1; } @@ -151,17 +159,25 @@ try { if(numSeqs % increment != 0){ //how many comparisons to make i.e. for group a, b, c = ab, ac, bc. int n = 1; + bool pair = true; for (int k = 0; k < (lookup.size() - 1); k++) { // pass cdd each set of groups to commpare for (int l = n; l < lookup.size(); l++) { subset.clear(); //clear out old pair of sharedrabunds //add new pair of sharedrabund vectors subset.push_back(lookup[k]); subset.push_back(lookup[l]); - ccd->updateSharedData(subset, totalNumSeq, globaldata->Groups.size()); + + //load subset with rest of lookup for those calcs that need everyone to calc for a pair + for (int w = 0; w < lookup.size(); w++) { + if ((w != k) && (w != l)) { subset.push_back(lookup[w]); } + } + + ccd->updateSharedData(subset, totalNumSeq, globaldata->Groups.size(), pair); } n++; } //if this is a calculator that can do multiples then do them - ccd->updateSharedData(lookup, totalNumSeq, globaldata->Groups.size()); + pair = false; + ccd->updateSharedData(lookup, totalNumSeq, globaldata->Groups.size(), pair); } //resets output files