X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=binsequencecommand.cpp;h=738c3241732c814d01b87052fa3cafd899c74182;hb=6b32d112bb60e9f7eb6d4407a4eed4c49b67bced;hp=7798a4d74f749eed04d4554c796776a58697b98b;hpb=1a5c2356c1b955c6ec024b2baf9f46377ee7c72e;p=mothur.git diff --git a/binsequencecommand.cpp b/binsequencecommand.cpp index 7798a4d..738c324 100644 --- a/binsequencecommand.cpp +++ b/binsequencecommand.cpp @@ -249,7 +249,7 @@ int BinSeqCommand::execute(){ //if user gave a namesfile then use it if (namesfile != "") { readNamesFile(); } - if (countfile != "") { ct.readTable(countfile); } + if (countfile != "") { ct.readTable(countfile, true, false); } input = new InputData(listfile, "list"); list = input->getListVector(); @@ -398,6 +398,7 @@ int BinSeqCommand::process(ListVector* list) { m->mothurOut(list->getLabel()); m->mothurOutEndLine(); //for each bin in the list vector + vector binLabels = list->getLabels(); for (int i = 0; i < list->size(); i++) { if (m->control_pressed) { return 1; } @@ -421,11 +422,11 @@ int BinSeqCommand::process(ListVector* list) { } if (groups.size() != 0) { groupInfo += groups[groups.size()-1]; } else { groupInfo = "not found"; } - name = name + "\t" + groupInfo + "\t" + toString(i+1)+ "\tNumRep=" + toString(ct.getNumSeqs(name)); + name = name + "\t" + groupInfo + "\t" + binLabels[i] + "\tNumRep=" + toString(ct.getNumSeqs(name)); out << ">" << name << endl; out << sequence << endl; }else { - name = name + "\t" + toString(i+1) + "\tNumRep=" + toString(ct.getNumSeqs(name)); + name = name + "\t" + binLabels[i] + "\tNumRep=" + toString(ct.getNumSeqs(name)); out << ">" << name << endl; out << sequence << endl; } @@ -435,7 +436,7 @@ int BinSeqCommand::process(ListVector* list) { if (sequence != "not found") { //if you don't have groups if (groupfile == "") { - name = name + "\t" + toString(i+1); + name = name + "\t" + binLabels[i]; out << ">" << name << endl; out << sequence << endl; }else {//if you do have groups @@ -444,7 +445,7 @@ int BinSeqCommand::process(ListVector* list) { m->mothurOut(name + " is missing from your group file. Please correct. "); m->mothurOutEndLine(); return 1; }else{ - name = name + "\t" + group + "\t" + toString(i+1); + name = name + "\t" + group + "\t" + binLabels[i]; out << ">" << name << endl; out << sequence << endl; }