X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=splitmatrix.cpp;h=384b09af1bb94be09c5607c8b863b28b16215731;hb=957d67f7d8bbadfd2930de061e89fd9b149270fd;hp=59e49a79e9e702cfcf70c47ffee3a42da8a0b537;hpb=bdd77df6a7df8a5775b57d0a7ec8b55de45e7b5b;p=mothur.git diff --git a/splitmatrix.cpp b/splitmatrix.cpp index 59e49a7..384b09a 100644 --- a/splitmatrix.cpp +++ b/splitmatrix.cpp @@ -91,16 +91,13 @@ int SplitMatrix::splitClassify(){ //build tree from users taxonomy file PhyloTree* phylo = new PhyloTree(); - ifstream in; - m->openInputFile(taxFile, in); - - //read in users taxonomy file and add sequences to tree - string seqname, tax; - while(!in.eof()){ - in >> seqname >> tax; m->gobble(in); - phylo->addSeqToTree(seqname, tax); - } - in.close(); + map temp; + m->readTax(taxFile, temp); + + for (map::iterator itTemp = temp.begin(); itTemp != temp.end();) { + phylo->addSeqToTree(itTemp->first, itTemp->second); + temp.erase(itTemp++); + } phylo->assignHeirarchyIDs(0);