X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=classify.cpp;h=212e563f94c4ae7af3ba0916d1040afd9b0e11fa;hb=6ede3bf5c0a9eedb23f24577a97da81ab3e1f7df;hp=3bf0d572f88d0ad7ffd76989d71f10807e8cc659;hpb=16abd6271c455bd01b34ff89a2e3641bef0fa128;p=mothur.git diff --git a/classify.cpp b/classify.cpp index 3bf0d57..212e563 100644 --- a/classify.cpp +++ b/classify.cpp @@ -249,7 +249,8 @@ int Classify::readTaxonomy(string file) { m->mothurOutEndLine(); m->mothurOut("Reading in the " + file + " taxonomy...\t"); cout.flush(); - + if (m->debug) { m->mothurOut("[DEBUG]: Taxonomies read in...\n"); } + #ifdef USE_MPI int pid, num, processors; vector positions; @@ -296,30 +297,21 @@ int Classify::readTaxonomy(string file) { delete buf4; istringstream iss (tempBuf,istringstream::in); - iss >> name >> taxInfo; + iss >> name; m->gobble(iss); + iss >> taxInfo; + if (m->debug) { m->mothurOut("[DEBUG]: name = " + name + " tax = " + taxInfo + "\n"); } taxonomy[name] = taxInfo; phyloTree->addSeqToTree(name, taxInfo); } MPI_File_close(&inMPI); MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case -#else - ifstream inTax; - m->openInputFile(file, inTax); - - //read template seqs and save - while (!inTax.eof()) { - inTax >> name >> taxInfo; - - taxonomy[name] = taxInfo; - - phyloTree->addSeqToTree(name, taxInfo); - - m->gobble(inTax); - } - inTax.close(); +#else + + taxonomy.clear(); + m->readTax(file, taxonomy); + for (map::iterator itTax = taxonomy.begin(); itTax != taxonomy.end(); itTax++) { phyloTree->addSeqToTree(itTax->first, itTax->second); } #endif - phyloTree->assignHeirarchyIDs(0); phyloTree->setUp(file);