- outGroupsFile << currSeq.getName() << '\t' << barcodeNameVector[barcodeIndex] << endl;
- groupCounts[barcodeIndex]++;
+ string thisGroup = barcodeNameVector[barcodeIndex];
+ if (primers.size() != 0) { thisGroup += "." + primerNameVector[primerIndex]; }
+
+ outGroupsFile << currSeq.getName() << '\t' << thisGroup << endl;
+
+ map<string, int>::iterator it = groupCounts.find(thisGroup);
+ if (it == groupCounts.end()) { groupCounts[thisGroup] = 1; }
+ else { groupCounts[it->first]++; }
+