X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mgclustercommand.cpp;h=06f05192ad1e91a1c85b2de8e986039d82d5c375;hb=13f0aaa1f941bb5c066e626331549fa177810732;hp=42f6d0ad72b7fcc35674b3734664f4c48b2e0fab;hpb=a8ff535f332ee97582f735a35ef8f3dfb04f8de1;p=mothur.git diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index 42f6d0a..06f0519 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -235,16 +235,16 @@ int MGClusterCommand::execute(){ read = new ReadBlast(blastfile, cutoff, penalty, length, minWanted, hclusterWanted); read->read(nameMap); -// list = new ListVector(nameMap->getListVector()); -// RAbundVector* rabund = NULL; -// -// if(large) { -// map nameMapCounts = m->readNames(namefile); -// createRabund(nameMapCounts); -// rabund = &rav; -// }else { -// rabund = new RAbundVector(list->getRAbundVector()); -// } + list = new ListVector(nameMap->getListVector()); + RAbundVector* rabund = NULL; + + if(large) { + map nameMapCounts = m->readNames(namefile); + createRabund(nameMapCounts); + rabund = &rav; + }else { + rabund = new RAbundVector(list->getRAbundVector()); + } list = new ListVector(nameMap->getListVector()); @@ -714,22 +714,22 @@ void MGClusterCommand::sortHclusterFiles(string unsortedDist, string unsortedOve } //********************************************************************************************************************** -// -//void MGClusterCommand::createRabund(map nameMapCounts){ -// try { -// //RAbundVector rav; -// map::iterator it; -// //it = nameMapCounts.begin(); -// //for(int i = 0; i < list->getNumBins(); i++) { rav.push_back((*it).second); it++; } -// for ( it=nameMapCounts.begin(); it!=nameMapCounts.end(); it++ ) { rav.push_back( it->second ); } -// //return rav; -// } -// catch(exception& e) { -// m->errorOut(e, "MGClusterCommand", "createRabund"); -// exit(1); -// } -// -//} + +void MGClusterCommand::createRabund(map nameMapCounts){ + try { + //RAbundVector rav; + map::iterator it; + //it = nameMapCounts.begin(); + //for(int i = 0; i < list->getNumBins(); i++) { rav.push_back((*it).second); it++; } + for ( it=nameMapCounts.begin(); it!=nameMapCounts.end(); it++ ) { rav.push_back( it->second ); } + //return rav; + } + catch(exception& e) { + m->errorOut(e, "MGClusterCommand", "createRabund"); + exit(1); + } + +} //**********************************************************************************************************************