X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=unweighted.cpp;h=431323f066665bd07edce8da80c32dadb1600cf2;hb=2bb9267aa4b4ecdf8488b06605cc9f3f36fa4332;hp=a75ddc54058f878f63c579a4834754cb3890a374;hpb=f3edf14c46814ca437960f0e1070abfbea582c26;p=mothur.git diff --git a/unweighted.cpp b/unweighted.cpp index a75ddc5..431323f 100644 --- a/unweighted.cpp +++ b/unweighted.cpp @@ -13,12 +13,11 @@ EstOutput Unweighted::getValues(Tree* t, int p, string o) { try { - globaldata = GlobalData::getInstance(); processors = p; outputDir = o; //if the users enters no groups then give them the score of all groups - int numGroups = globaldata->Groups.size(); + int numGroups = m->getNumGroups(); //calculate number of comparsions int numComp = 0; @@ -26,7 +25,7 @@ EstOutput Unweighted::getValues(Tree* t, int p, string o) { for (int r=0; r groups; groups.push_back(globaldata->Groups[r]); groups.push_back(globaldata->Groups[l]); + vector groups; groups.push_back((m->getGroups())[r]); groups.push_back((m->getGroups())[l]); namesOfGroupCombos.push_back(groups); } } @@ -35,15 +34,15 @@ EstOutput Unweighted::getValues(Tree* t, int p, string o) { vector groups; if (numGroups == 0) { //get score for all users groups - for (int i = 0; i < tmap->namesOfGroups.size(); i++) { - if (tmap->namesOfGroups[i] != "xxx") { - groups.push_back(tmap->namesOfGroups[i]); + for (int i = 0; i < (tmap->getNamesOfGroups()).size(); i++) { + if ((tmap->getNamesOfGroups())[i] != "xxx") { + groups.push_back((tmap->getNamesOfGroups())[i]); } } namesOfGroupCombos.push_back(groups); }else { - for (int i = 0; i < globaldata->Groups.size(); i++) { - groups.push_back(globaldata->Groups[i]); + for (int i = 0; i < m->getNumGroups(); i++) { + groups.push_back((m->getGroups())[i]); } namesOfGroupCombos.push_back(groups); } @@ -152,7 +151,7 @@ EstOutput Unweighted::createProcesses(Tree* t, vector< vector > namesOfG m->gobble(in); } in.close(); - remove(s.c_str()); + m->mothurRemove(s); } m->mothurOut("DONE."); m->mothurOutEndLine(); m->mothurOutEndLine(); @@ -257,12 +256,11 @@ EstOutput Unweighted::driver(Tree* t, vector< vector > namesOfGroupCombo EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB, int p, string o) { try { - globaldata = GlobalData::getInstance(); processors = p; outputDir = o; //if the users enters no groups then give them the score of all groups - int numGroups = globaldata->Groups.size(); + int numGroups = m->getNumGroups(); //calculate number of comparsions int numComp = 0; @@ -270,7 +268,7 @@ EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB, int p, st for (int r=0; r groups; groups.push_back(globaldata->Groups[r]); groups.push_back(globaldata->Groups[l]); + vector groups; groups.push_back((m->getGroups())[r]); groups.push_back((m->getGroups())[l]); namesOfGroupCombos.push_back(groups); } } @@ -279,15 +277,15 @@ EstOutput Unweighted::getValues(Tree* t, string groupA, string groupB, int p, st vector groups; if (numGroups == 0) { //get score for all users groups - for (int i = 0; i < tmap->namesOfGroups.size(); i++) { - if (tmap->namesOfGroups[i] != "xxx") { - groups.push_back(tmap->namesOfGroups[i]); + for (int i = 0; i < (tmap->getNamesOfGroups()).size(); i++) { + if ((tmap->getNamesOfGroups())[i] != "xxx") { + groups.push_back((tmap->getNamesOfGroups())[i]); } } namesOfGroupCombos.push_back(groups); }else { - for (int i = 0; i < globaldata->Groups.size(); i++) { - groups.push_back(globaldata->Groups[i]); + for (int i = 0; i < m->getNumGroups(); i++) { + groups.push_back((m->getGroups())[i]); } namesOfGroupCombos.push_back(groups); } @@ -395,7 +393,7 @@ EstOutput Unweighted::createProcesses(Tree* t, vector< vector > namesOfG m->gobble(in); } in.close(); - remove(s.c_str()); + m->mothurRemove(s); } return results; @@ -414,7 +412,7 @@ EstOutput Unweighted::driver(Tree* t, vector< vector > namesOfGroupCombo int count = 0; - Tree* copyTree = new Tree; + Tree* copyTree = new Tree(tmap); for (int h = start; h < (start+num); h++) {