X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=metastatscommand.cpp;h=c5d349bc77b685b67a1e3251fa70f15602bb215d;hb=4884e09a6f1f67f9a57aafcef82e248a1c633956;hp=e23224bf20e9977e842bc78e765cd95e018a1666;hpb=6b2ac07f3e9ee57594d2358a3a25f9f700bd7362;p=mothur.git diff --git a/metastatscommand.cpp b/metastatscommand.cpp index e23224b..c5d349b 100644 --- a/metastatscommand.cpp +++ b/metastatscommand.cpp @@ -8,7 +8,6 @@ */ #include "metastatscommand.h" -#include "metastats.h" #include "sharedutilities.h" @@ -232,21 +231,19 @@ int MetaStatsCommand::execute(){ //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; + + 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 + 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)); + } + } //as long as you are not at the end of the file or done wih the lines you want while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) { @@ -345,7 +342,7 @@ int MetaStatsCommand::process(vector& thisLookUp){ }else{ int process = 1; vector processIDS; - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) + #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) //loop through and create all the processes you want while (process != processors) { int pid = fork(); @@ -485,12 +482,13 @@ int MetaStatsCommand::driver(int start, int num, vector& th m->mothurOut("Missing shared info for " + setA + " or " + setB + ". Skipping comparison."); m->mothurOutEndLine(); outputNames.pop_back(); }else { + //fill data for (int j = 0; j < thisLookUp[0]->getNumBins(); j++) { //data[j] = new double[subset.size()]; data2[j].resize(subset.size(), 0.0); + for (int i = 0; i < subset.size(); i++) { - //data[j][i] = (subset[i]->getAbundance(j)); data2[j][i] = (subset[i]->getAbundance(j)); } } @@ -502,7 +500,6 @@ int MetaStatsCommand::driver(int start, int num, vector& th MothurMetastats mothurMeta(threshold, iters); mothurMeta.runMetastats(outputFileName , data2, setACount); m->mothurOutEndLine(); - m->mothurOutEndLine(); }