X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=classifyotucommand.cpp;fp=classifyotucommand.cpp;h=f36631a0590725867dffc402f74fd73af6168e20;hp=7b1a04f3658bcb0a3e919fefe34a30dedcfaa882;hb=74dc92cf53df65fd8b14d8eaf35489bbecbccac6;hpb=4c5e7a20a03ddc6feb49ff9d21fcb4c79bc5508d diff --git a/classifyotucommand.cpp b/classifyotucommand.cpp index 7b1a04f..f36631a 100644 --- a/classifyotucommand.cpp +++ b/classifyotucommand.cpp @@ -368,7 +368,7 @@ int ClassifyOtuCommand::readTaxonomyFile() { m->gobble(in); //are there confidence scores, if so remove them - if (tax.find_first_of('(') != -1) { removeConfidences(tax); } + if (tax.find_first_of('(') != -1) { m->removeConfidences(tax); } taxMap[name] = tax; @@ -550,7 +550,7 @@ int ClassifyOtuCommand::process(ListVector* processList) { out << (i+1) << '\t' << size << '\t' << conTax << endl; string noConfidenceConTax = conTax; - removeConfidences(noConfidenceConTax); + m->removeConfidences(noConfidenceConTax); //add this bins taxonomy to summary if (basis == "sequence") { @@ -604,36 +604,6 @@ string ClassifyOtuCommand::addUnclassifieds(string tax, int maxlevel) { exit(1); } } - -/**************************************************************************************************/ -void ClassifyOtuCommand::removeConfidences(string& tax) { - try { - - string taxon; - string newTax = ""; - - while (tax.find_first_of(';') != -1) { - //get taxon - taxon = tax.substr(0,tax.find_first_of(';')); - - int pos = taxon.find_first_of('('); - if (pos != -1) { - taxon = taxon.substr(0, pos); //rip off confidence - } - - taxon += ";"; - - tax = tax.substr(tax.find_first_of(';')+1, tax.length()); - newTax += taxon; - } - - tax = newTax; - } - catch(exception& e) { - m->errorOut(e, "ClassifyOtuCommand", "removeConfidences"); - exit(1); - } -} //**********************************************************************************************************************