X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=subsamplecommand.cpp;h=49a821045e122b5097fde092a5845378e21afc60;hb=65e21482d022d12f7a78a8d436fb51f322603e41;hp=28cfc3493e5b2ac6ac790445a4acaa397405b2ad;hpb=763d07b1c215b1bdc9d5d63431f78cfecc60acf5;p=mothur.git diff --git a/subsamplecommand.cpp b/subsamplecommand.cpp index 28cfc34..49a8210 100644 --- a/subsamplecommand.cpp +++ b/subsamplecommand.cpp @@ -1522,6 +1522,7 @@ int SubSampleCommand::eliminateZeroOTUS(vector& thislookup) //for each bin vector newBinLabels; + string snumBins = toString(thislookup[0]->getNumBins()); 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; } @@ -1537,7 +1538,13 @@ int SubSampleCommand::eliminateZeroOTUS(vector& thislookup) newLookup[j]->push_back(thislookup[j]->getAbundance(i), thislookup[j]->getGroup()); } //if there is a bin label use it otherwise make one - string binLabel = "Otu" + toString(i+1); + string binLabel = "Otu"; + string sbinNumber = toString(i+1); + if (sbinNumber.length() < snumBins.length()) { + int diff = snumBins.length() - sbinNumber.length(); + for (int h = 0; h < diff; h++) { binLabel += "0"; } + } + binLabel += sbinNumber; if (i < m->currentBinLabels.size()) { binLabel = m->currentBinLabels[i]; } newBinLabels.push_back(binLabel);