+/**************************************************************************************************/
+string ClassifyOtuCommand::addUnclassifieds(string tax, int maxlevel) {
+ try{
+ string newTax, taxon;
+ int level = 0;
+
+ //keep what you have counting the levels
+ while (tax.find_first_of(';') != -1) {
+ //get taxon
+ taxon = tax.substr(0,tax.find_first_of(';'))+';';
+ tax = tax.substr(tax.find_first_of(';')+1, tax.length());
+ newTax += taxon;
+ level++;
+ }
+
+ //add "unclassified" until you reach maxLevel
+ while (level < maxlevel) {
+ newTax += "unclassified;";
+ level++;
+ }
+
+ return newTax;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ClassifyOtuCommand", "addUnclassifieds");
+ exit(1);
+ }
+}
+