X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=unifracweightedcommand.cpp;h=2646ede2643feef23477167cb9d627c884cd884c;hb=fc9bc621a09de13eb76ca4f5cee930b03de43dcd;hp=9f961a9a6658683a3661290757ebe01048002371;hpb=8bc3e5b38c2317a1715f53be22fa96455868c281;p=mothur.git diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index 9f961a9..2646ede 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -211,7 +211,6 @@ int UnifracWeightedCommand::execute() { } if (random) { - vector sums = weighted->getBranchLengthSums(T[i]); //calculate number of comparisons i.e. with groups A,B,C = AB, AC, BC = 3; vector< vector > namesOfGroupCombos; @@ -245,12 +244,12 @@ int UnifracWeightedCommand::execute() { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) if(processors == 1){ - driver(T[i], namesOfGroupCombos, 0, namesOfGroupCombos.size(), sums, rScores); + driver(T[i], namesOfGroupCombos, 0, namesOfGroupCombos.size(), rScores); }else{ - createProcesses(T[i], namesOfGroupCombos, sums, rScores); + createProcesses(T[i], namesOfGroupCombos, rScores); } #else - driver(T[i], namesOfGroupCombos, 0, namesOfGroupCombos.size(), sums, rScores); + driver(T[i], namesOfGroupCombos, 0, namesOfGroupCombos.size(), rScores); #endif if (m->control_pressed) { delete output; outSum.close(); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; } @@ -322,7 +321,7 @@ int UnifracWeightedCommand::execute() { } /**************************************************************************************************/ -int UnifracWeightedCommand::createProcesses(Tree* t, vector< vector > namesOfGroupCombos, vector& sums, vector< vector >& scores) { +int UnifracWeightedCommand::createProcesses(Tree* t, vector< vector > namesOfGroupCombos, vector< vector >& scores) { try { #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) int process = 1; @@ -339,7 +338,7 @@ int UnifracWeightedCommand::createProcesses(Tree* t, vector< vector > na processIDS.push_back(pid); //create map from line number to pid so you can append files in correct order later process++; }else if (pid == 0){ - driver(t, namesOfGroupCombos, lines[process].start, lines[process].num, sums, scores); + driver(t, namesOfGroupCombos, lines[process].start, lines[process].num, scores); //pass numSeqs to parent ofstream out; @@ -352,7 +351,7 @@ int UnifracWeightedCommand::createProcesses(Tree* t, vector< vector > na }else { m->mothurOut("unable to spawn the necessary processes."); m->mothurOutEndLine(); exit(0); } } - driver(t, namesOfGroupCombos, lines[0].start, lines[0].num, sums, scores); + driver(t, namesOfGroupCombos, lines[0].start, lines[0].num, scores); //force parent to wait until all the processes are done for (int i=0;i<(processors-1);i++) { @@ -383,7 +382,7 @@ int UnifracWeightedCommand::createProcesses(Tree* t, vector< vector > na } /**************************************************************************************************/ -int UnifracWeightedCommand::driver(Tree* t, vector< vector > namesOfGroupCombos, int start, int num, vector& sums, vector< vector >& scores) { +int UnifracWeightedCommand::driver(Tree* t, vector< vector > namesOfGroupCombos, int start, int num, vector< vector >& scores) { try { Tree* randT = new Tree(); @@ -404,7 +403,7 @@ int UnifracWeightedCommand::driver(Tree* t, vector< vector > namesOfGrou if (m->control_pressed) { delete randT; return 0; } //get wscore of random tree - EstOutput randomData = weighted->getValues(randT, groupA, groupB, sums); + EstOutput randomData = weighted->getValues(randT, groupA, groupB); if (m->control_pressed) { delete randT; return 0; }