if (temp == "not found") {
norm = 0; //once you have read, set norm to smallest group number
}else {
- convert(temp, norm);
+ m->mothurConvert(temp, norm);
if (norm < 0) { m->mothurOut("norm must be positive."); m->mothurOutEndLine(); abort=true; }
}
//for each bin
vector<string> 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; }
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);
//for each bin
vector<string> 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; }
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);