X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trimseqscommand.cpp;h=64522a5f157820e529b3261d0acaf898f32136b6;hb=fc3a1319b64fd3638df074e4669a1fb0235d1b8d;hp=ed84cc0c60d404b0d7c12eb0c3751a2e2a601706;hpb=9c37bed33eaa0bb2d3c499085c0e165c0f00886b;p=mothur.git diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index ed84cc0..64522a5 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -432,8 +432,9 @@ int TrimSeqsCommand::execute(){ //output group counts m->mothurOutEndLine(); int total = 0; + if (groupCounts.size() != 0) { m->mothurOut("Group count: \n"); } for (map::iterator it = groupCounts.begin(); it != groupCounts.end(); it++) { - total += it->second; m->mothurOut("Group " + it->first + " contains " + toString(it->second) + " sequences."); m->mothurOutEndLine(); + total += it->second; m->mothurOut(it->first + "\t" + toString(it->second)); m->mothurOutEndLine(); } if (total != 0) { m->mothurOut("Total of all groups is " + toString(total)); m->mothurOutEndLine(); } @@ -650,6 +651,17 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string outGroupsFile << currSeq.getName() << '\t' << thisGroup << endl; + if (nameFile != "") { + map::iterator itName = nameMap.find(currSeq.getName()); + if (itName != nameMap.end()) { + vector thisSeqsNames; + m->splitAtChar(itName->second, thisSeqsNames, ','); + for (int k = 1; k < thisSeqsNames.size(); k++) { //start at 1 to skip self + outGroupsFile << thisSeqsNames[k] << '\t' << thisGroup << endl; + } + }else { m->mothurOut("[ERROR]: " + currSeq.getName() + " is not in your namefile, please correct."); m->mothurOutEndLine(); } + } + map::iterator it = groupCounts.find(thisGroup); if (it == groupCounts.end()) { groupCounts[thisGroup] = 1; } else { groupCounts[it->first]++; }