X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=classify.cpp;h=5f97c7ec693a97997554683188a013b1054eb3d7;hp=36179f471da4ac5d40b563e609feb2f8d3d32e6c;hb=050a3ff02473a3d4c0980964e1a9ebe52e55d6b8;hpb=9b53f130ac9af5e95444ce2e817fce25ed19ff03 diff --git a/classify.cpp b/classify.cpp index 36179f4..5f97c7e 100644 --- a/classify.cpp +++ b/classify.cpp @@ -309,16 +309,19 @@ int Classify::readTaxonomy(string file) { taxonomy.clear(); m->readTax(file, taxonomy); - map tempTaxonomy; + + //commented out to save time with large templates. 6/12/13 + //map tempTaxonomy; for (map::iterator itTax = taxonomy.begin(); itTax != taxonomy.end(); itTax++) { - if (m->inUsersGroups(itTax->first, names)) { - phyloTree->addSeqToTree(itTax->first, itTax->second); - tempTaxonomy[itTax->first] = itTax->second; - }else { - m->mothurOut("[WARNING]: " + itTax->first + " is in your taxonomy file and not in your reference file, ignoring.\n"); - } + //if (m->inUsersGroups(itTax->first, names)) { + phyloTree->addSeqToTree(itTax->first, itTax->second); + if (m->control_pressed) { break; } + //tempTaxonomy[itTax->first] = itTax->second; + // }else { + // m->mothurOut("[WARNING]: " + itTax->first + " is in your taxonomy file and not in your reference file, ignoring.\n"); + //} } - taxonomy = tempTaxonomy; + //taxonomy = tempTaxonomy; #endif phyloTree->assignHeirarchyIDs(0); @@ -340,21 +343,8 @@ int Classify::readTaxonomy(string file) { vector Classify::parseTax(string tax) { try { vector taxons; - - tax = tax.substr(0, tax.length()-1); //get rid of last ';' - - //parse taxonomy - string individual; - while (tax.find_first_of(';') != -1) { - individual = tax.substr(0,tax.find_first_of(';')); - tax = tax.substr(tax.find_first_of(';')+1, tax.length()); - taxons.push_back(individual); - - } - //get last one - taxons.push_back(tax); - - return taxons; + m->splitAtChar(tax, taxons, ';'); + return taxons; } catch(exception& e) { m->errorOut(e, "Classify", "parseTax");