X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mgclustercommand.cpp;h=e5681efb220d1635382ea6b077a36ea4e0f50226;hb=8772a51e7ab31b1c49dada6d38baf1474444943c;hp=870536d4640e5a0de07d24d4fd8799e218359a34;hpb=49d2b7459c5027557564b21e9487dadafbbbdc96;p=mothur.git diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index 870536d..e5681ef 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -224,15 +224,25 @@ int MGClusterCommand::execute(){ string tag = ""; time_t start; float previousDist = 0.00000; - float rndPreviousDist = 0.00000; + float rndPreviousDist = 0.00000; //read blastfile - creates sparsematrices for the distances and overlaps as well as a listvector //must remember to delete those objects here since readBlast does not read = new ReadBlast(blastfile, cutoff, penalty, length, minWanted, hclusterWanted); read->read(nameMap); - - list = new ListVector(nameMap->getListVector()); - RAbundVector* rabund = new RAbundVector(list->getRAbundVector()); + + list = new ListVector(nameMap->getListVector()); + RAbundVector* rabund = NULL; + if(large) { + map nameMapCounts = m->readNames(namefile); + RAbundVector* rabund = createRabund(list, nameMapCounts); + }else { + RAbundVector* rabund = new RAbundVector(list->getRAbundVector()); + } + + + //list = new ListVector(nameMap->getListVector()); + //RAbundVector* rabund = new RAbundVector(list->getRAbundVector()); if (m->control_pressed) { outputTypes.clear(); delete nameMap; delete read; delete list; delete rabund; return 0; } @@ -699,7 +709,19 @@ void MGClusterCommand::sortHclusterFiles(string unsortedDist, string unsortedOve //********************************************************************************************************************** +RAbundVector MGClusterCommand::createRabund(ListVector list, map nameMapCounts){ + try { + RAbundVector rav; + for(int i = 0; i < list->getNumBins(); i++) { rav.push_back(nameMapCounts[i]); } + return rav; + } + catch(exception& e) { + m->errorOut(e, "MGClusterCommand", "createRabund"); + exit(1); + } + +} - +//**********************************************************************************************************************