X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=classifyotucommand.cpp;fp=classifyotucommand.cpp;h=ef41ee1bab8853f6741938005f775076b60723ab;hp=ec22de8b35762adf92e2a3b750198dcbb91f0396;hb=e0b6040c7b6ad4ecdad4aa90b4326c0528379178;hpb=e7ae6e6b27c45b5691c19f423ec56faae8e2f255 diff --git a/classifyotucommand.cpp b/classifyotucommand.cpp index ec22de8..ef41ee1 100644 --- a/classifyotucommand.cpp +++ b/classifyotucommand.cpp @@ -544,7 +544,9 @@ int ClassifyOtuCommand::process(ListVector* processList) { taxaSum = new PhyloSummary(groupfile); } + //for each bin in the list vector + string snumBins = toString(processList->getNumBins()); for (int i = 0; i < processList->getNumBins(); i++) { if (m->control_pressed) { break; } @@ -555,7 +557,15 @@ int ClassifyOtuCommand::process(ListVector* processList) { if (m->control_pressed) { out.close(); return 0; } //output to new names file - out << (i+1) << '\t' << size << '\t' << conTax << endl; + 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; + + out << binLabel << '\t' << size << '\t' << conTax << endl; string noConfidenceConTax = conTax; m->removeConfidences(noConfidenceConTax);