X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=trimseqscommand.h;h=e280c8a1d4b50336f125dda5788d91d2af76c09a;hp=ba4e61411b8498820139e8ae2b1ed71cb37b0432;hb=ee8403d4eb5760187d62b42a9cf4272de8fc0ec4;hpb=2c97dd48b8e27ee0a6a86c7a082f4c504c3357c6 diff --git a/trimseqscommand.h b/trimseqscommand.h index ba4e614..e280c8a 100644 --- a/trimseqscommand.h +++ b/trimseqscommand.h @@ -413,11 +413,13 @@ static DWORD WINAPI MyTrimThreadFunction(LPVOID lpParam){ outGroupsFile << currSeq.getName() << '\t' << thisGroup << endl; + int numRedundants = 0; if (pDataArray->nameFile != "") { map::iterator itName = pDataArray->nameMap.find(currSeq.getName()); if (itName != pDataArray->nameMap.end()) { vector thisSeqsNames; pDataArray->m->splitAtChar(itName->second, thisSeqsNames, ','); + numRedundants = thisSeqsNames.size()-1; //we already include ourselves below for (int k = 1; k < thisSeqsNames.size(); k++) { //start at 1 to skip self outGroupsFile << thisSeqsNames[k] << '\t' << thisGroup << endl; } @@ -425,8 +427,8 @@ static DWORD WINAPI MyTrimThreadFunction(LPVOID lpParam){ } map::iterator it = pDataArray->groupCounts.find(thisGroup); - if (it == pDataArray->groupCounts.end()) { pDataArray->groupCounts[thisGroup] = 1; } - else { pDataArray->groupCounts[it->first]++; } + if (it == pDataArray->groupCounts.end()) { pDataArray->groupCounts[thisGroup] = 1 + numRedundants; } + else { pDataArray->groupCounts[it->first] += (1 + numRedundants); } } }