+
+ //setup the pairwise comparions of sets for metastats
+ //calculate number of comparisons i.e. with groups A,B,C = AB, AC, BC = 3;
+ //make sure sets are all in designMap
+ SharedUtil* util = new SharedUtil();
+ util->setGroups(Sets, designMap->namesOfGroups);
+ delete util;
+
+ int numGroups = Sets.size();
+ for (int a=0; a<numGroups; a++) {
+ for (int l = a+1; l < numGroups; l++) {
+ vector<string> groups; groups.push_back(Sets[a]); groups.push_back(Sets[l]);
+ namesOfGroupCombos.push_back(groups);
+ }
+ }
+
+
+ //only 1 combo
+ if (numGroups == 2) { processors = 1; }
+ else if (numGroups < 2) { m->mothurOut("Not enough sets, I need at least 2 valid sets. Unable to complete command."); m->mothurOutEndLine(); m->control_pressed = true; }
+
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ if(processors != 1){
+ int numPairs = namesOfGroupCombos.size();
+ int numPairsPerProcessor = numPairs / processors;
+
+ for (int i = 0; i < processors; i++) {
+ int startPos = i * numPairsPerProcessor;
+ if(i == processors - 1){
+ numPairsPerProcessor = numPairs - i * numPairsPerProcessor;
+ }
+ lines.push_back(linePair(startPos, numPairsPerProcessor));
+ }
+ }
+ #endif
+