X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=taxonomyequalizer.cpp;h=c0507261eaf2c96c9381172a646317c7cb6a1db3;hb=250e3b11b1c9c1e1ad458ab6c7e71ac2e67e11d9;hp=d3b24d1297f280f0b4f11a30724a3c9d61d8427f;hpb=260ae19c36cb11a53ddc5a75b5e507f8dd8b31d6;p=mothur.git diff --git a/taxonomyequalizer.cpp b/taxonomyequalizer.cpp index d3b24d1..c050726 100644 --- a/taxonomyequalizer.cpp +++ b/taxonomyequalizer.cpp @@ -46,7 +46,7 @@ TaxEqualizer::TaxEqualizer(string tfile, int c, string o) : cutoff(c), outputDir in >> name >> tax; m->gobble(in); - if (containsConfidence) { removeConfidences(tax); } + if (containsConfidence) { m->removeConfidences(tax); } //is this a taxonomy that needs to be extended? if (seqLevels[name] < highestLevel) { @@ -61,7 +61,7 @@ TaxEqualizer::TaxEqualizer(string tfile, int c, string o) : cutoff(c), outputDir in.close(); out.close(); - if (m->control_pressed) { remove(equalizedFile.c_str()); } + if (m->control_pressed) { m->mothurRemove(equalizedFile); } }else { inTax.close(); } } @@ -152,29 +152,4 @@ void TaxEqualizer::truncateTaxonomy(string name, string& tax, int desiredLevel) } } /**************************************************************************************************/ -void TaxEqualizer::removeConfidences(string& tax) { - try { - - string taxon; - string newTax = ""; - - while (tax.find_first_of(';') != -1) { - //get taxon - taxon = tax.substr(0,tax.find_first_of(';')); - taxon = taxon.substr(0, taxon.find_first_of('(')); //rip off confidence - taxon += ";"; - - tax = tax.substr(tax.find_first_of(';')+1, tax.length()); - newTax += taxon; - } - - tax = newTax; - } - catch(exception& e) { - m->errorOut(e, "TaxEqualizer", "removeConfidences"); - exit(1); - } -} - -/**************************************************************************************************/