X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=phylosummary.cpp;h=5f7bbc3c73a2161417a1841f567719a4bd1f8c4a;hp=2f565150aabeec35cc8a3c03a459d8b85090550b;hb=49d2b7459c5027557564b21e9487dadafbbbdc96;hpb=ee8403d4eb5760187d62b42a9cf4272de8fc0ec4 diff --git a/phylosummary.cpp b/phylosummary.cpp index 2f56515..5f7bbc3 100644 --- a/phylosummary.cpp +++ b/phylosummary.cpp @@ -73,24 +73,16 @@ PhyloSummary::PhyloSummary(string groupFile){ int PhyloSummary::summarize(string userTfile){ try { - - ifstream in; - m->openInputFile(userTfile, in); - - //read in users taxonomy file and add sequences to tree - string name, tax; - int numSeqs = 0; - while(!in.eof()){ - in >> name >> tax; m->gobble(in); - - addSeqToTree(name, tax); + map temp; + m->readTax(userTfile, temp); + + for (map::iterator itTemp = temp.begin(); itTemp != temp.end();) { + addSeqToTree(itTemp->first, itTemp->second); numSeqs++; - - if (m->control_pressed) { break; } - } - in.close(); - - return numSeqs; + temp.erase(itTemp++); + } + + return numSeqs; } catch(exception& e) { m->errorOut(e, "PhyloSummary", "summarize");