X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=getrelabundcommand.cpp;h=08e9228b215819f5e19e4d697137384294392422;hb=37eac2026d91179acda0494c4dcca22f176551b9;hp=8c28c47b220e1554972d3cdb97bd2218af4f1c77;hpb=605ab6fa594317a38f0df7bb6797740c735b2348;p=mothur.git diff --git a/getrelabundcommand.cpp b/getrelabundcommand.cpp index 8c28c47..08e9228 100644 --- a/getrelabundcommand.cpp +++ b/getrelabundcommand.cpp @@ -275,8 +275,6 @@ int GetRelAbundCommand::execute(){ int GetRelAbundCommand::getRelAbundance(vector& thisLookUp, ofstream& out){ try { - if (pickedGroups) { eliminateZeroOTUS(thisLookUp); } - for (int i = 0; i < thisLookUp.size(); i++) { out << thisLookUp[i]->getLabel() << '\t' << thisLookUp[i]->getGroup() << '\t' << thisLookUp[i]->getNumBins() << '\t'; @@ -320,48 +318,5 @@ int GetRelAbundCommand::getRelAbundance(vector& thisLookUp, } } //********************************************************************************************************************** -int GetRelAbundCommand::eliminateZeroOTUS(vector& thislookup) { - try { - - vector newLookup; - for (int i = 0; i < thislookup.size(); i++) { - SharedRAbundVector* temp = new SharedRAbundVector(); - temp->setLabel(thislookup[i]->getLabel()); - temp->setGroup(thislookup[i]->getGroup()); - newLookup.push_back(temp); - } - - //for each bin - for (int i = 0; i < thislookup[0]->getNumBins(); i++) { - if (m->control_pressed) { for (int j = 0; j < newLookup.size(); j++) { delete newLookup[j]; } return 0; } - - //look at each sharedRabund and make sure they are not all zero - bool allZero = true; - for (int j = 0; j < thislookup.size(); j++) { - if (thislookup[j]->getAbundance(i) != 0) { allZero = false; break; } - } - - //if they are not all zero add this bin - if (!allZero) { - for (int j = 0; j < thislookup.size(); j++) { - newLookup[j]->push_back(thislookup[j]->getAbundance(i), thislookup[j]->getGroup()); - } - } - } - - for (int j = 0; j < thislookup.size(); j++) { delete thislookup[j]; } - - thislookup = newLookup; - - return 0; - - } - catch(exception& e) { - m->errorOut(e, "GetRelAbundCommand", "eliminateZeroOTUS"); - exit(1); - } -} - -//**********************************************************************************************************************