X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=phylotree.cpp;h=3dde18680c625eb816230a8d13774ccfc47032cf;hb=957d67f7d8bbadfd2930de061e89fd9b149270fd;hp=a9ef6cb0d85f44bde915606eb452db993ec40d8d;hpb=91a27e0483827c06c21c4fe89558923bbfe86573;p=mothur.git diff --git a/phylotree.cpp b/phylotree.cpp index a9ef6cb..3dde186 100644 --- a/phylotree.cpp +++ b/phylotree.cpp @@ -178,16 +178,13 @@ PhyloTree::PhyloTree(string tfile){ MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case #else - ifstream in; - m->openInputFile(tfile, in); - - //read in users taxonomy file and add sequences to tree - while(!in.eof()){ - in >> name >> tax; m->gobble(in); - - addSeqToTree(name, tax); - } - in.close(); + map temp; + m->readTax(tfile, temp); + + for (map::iterator itTemp = temp.begin(); itTemp != temp.end();) { + addSeqToTree(itTemp->first, itTemp->second); + temp.erase(itTemp++); + } #endif assignHeirarchyIDs(0); @@ -619,13 +616,15 @@ bool PhyloTree::ErrorCheck(vector templateFileNames){ map::iterator itFind; map taxonomyFileNames = name2Taxonomy; + if (m->debug) { m->mothurOut("[DEBUG]: in error check. Numseqs in template = " + toString(templateFileNames.size()) + ". Numseqs in taxonomy = " + toString(taxonomyFileNames.size()) + ".\n"); } + for (int i = 0; i < templateFileNames.size(); i++) { itFind = taxonomyFileNames.find(templateFileNames[i]); if (itFind != taxonomyFileNames.end()) { //found it so erase it taxonomyFileNames.erase(itFind); }else { - m->mothurOut(templateFileNames[i] + " is in your template file and is not in your taxonomy file. Please correct."); m->mothurOutEndLine(); + m->mothurOut("'" +templateFileNames[i] + "' is in your template file and is not in your taxonomy file. Please correct."); m->mothurOutEndLine(); okay = false; }