X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=subsamplecommand.cpp;h=fe79fbbae883a409187730e1899fde8b05493193;hb=3914b0d6480f67df53b1e838f51c4e6155710434;hp=32745a25ee0ae66e6f6cbcb50cc4db4469cca21f;hpb=037b7fccc64a5c7d5d5c23a949273a912160a400;p=mothur.git diff --git a/subsamplecommand.cpp b/subsamplecommand.cpp index 32745a2..fe79fbb 100644 --- a/subsamplecommand.cpp +++ b/subsamplecommand.cpp @@ -273,7 +273,7 @@ SubSampleCommand::SubSampleCommand(string option) { else if (countfile == "not found") { countfile = ""; } else { m->setCountTableFile(countfile); - ct.readTable(countfile); + ct.readTable(countfile, true); } if ((namefile != "") && (countfile != "")) { @@ -1007,7 +1007,7 @@ int SubSampleCommand::getSubSampleList() { ListVector* list = input->getListVector(); string lastLabel = list->getLabel(); - //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label. + //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label. set processedLabels; set userLabels = labels; @@ -1265,11 +1265,18 @@ int SubSampleCommand::getSubSampleList() { if (taxonomyfile != "") { if (namefile == "") { - //fake nameMap - for (set::iterator it = subset.begin(); it != subset.end(); it++) { - vector temp; temp.push_back(*it); - nameMap[*it] = temp; + InputData input(listfile, "list"); + ListVector* list = input.getListVector(); + string lastLabel = list->getLabel(); + + for (int i = 0; i < list->getNumBins(); i++) { + vector temp; + string bin = list->get(i); + m->splitAtComma(bin, temp); + for (int j = 0; j < temp.size(); j++) { vector tempFakeOut; tempFakeOut.push_back(temp[j]); nameMap[temp[j]] = tempFakeOut; } } + delete list; + int tcount = getTax(subset); if (tcount != subset.size()) { m->mothurOut("[ERROR]: subsampled list file contains " + toString(subset.size()) + " sequences, but I only found " + toString(tcount) + " in your taxonomy file, did you forget a name file? Please correct."); m->mothurOutEndLine(); } }else {