From: Sarah Westcott Date: Mon, 13 May 2013 15:34:21 +0000 (-0400) Subject: cluster.split was not sorting the list file in order of abundance X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=a91c60b9d7fd350dd7a03afc205d05d558db8126 cluster.split was not sorting the list file in order of abundance --- diff --git a/clustersplitcommand.cpp b/clustersplitcommand.cpp index 74867eb..270ea62 100644 --- a/clustersplitcommand.cpp +++ b/clustersplitcommand.cpp @@ -843,9 +843,12 @@ int ClusterSplitCommand::mergeLists(vector listNames, map us if (itLabel->first == -1) { thisLabel = "unique"; } else { thisLabel = toString(itLabel->first, length-1); } - outList << thisLabel << '\t' << itLabel->second << '\t'; + //outList << thisLabel << '\t' << itLabel->second << '\t'; RAbundVector* rabund = NULL; + ListVector completeList; + completeList.setLabel(thisLabel); + if (countfile == "") { rabund = new RAbundVector(); rabund->setLabel(thisLabel); @@ -854,7 +857,8 @@ int ClusterSplitCommand::mergeLists(vector listNames, map us //add in singletons if (listSingle != NULL) { for (int j = 0; j < listSingle->getNumBins(); j++) { - outList << listSingle->get(j) << '\t'; + //outList << listSingle->get(j) << '\t'; + completeList.push_back(listSingle->get(j)); if (countfile == "") { rabund->push_back(m->getNumNames(listSingle->get(j))); } } } @@ -871,7 +875,8 @@ int ClusterSplitCommand::mergeLists(vector listNames, map us if (list == NULL) { m->mothurOut("Error merging listvectors in file " + listNames[k]); m->mothurOutEndLine(); } else { for (int j = 0; j < list->getNumBins(); j++) { - outList << list->get(j) << '\t'; + //outList << list->get(j) << '\t'; + completeList.push_back(list->get(j)); if (countfile == "") { rabund->push_back(m->getNumNames(list->get(j))); } } delete list; @@ -884,7 +889,8 @@ int ClusterSplitCommand::mergeLists(vector listNames, map us sabund.print(outSabund); rabund->print(outRabund); } - outList << endl; + //outList << endl; + completeList.print(outList); if (rabund != NULL) { delete rabund; } }