+ if (createFileGroup || createOligosGroup) {
+ if (makeCount) {
+ for (map<string, string>::iterator itGroup = groupMap.begin(); itGroup != groupMap.end(); itGroup++) {
+ vector<string> groups = compositeCt.getNamesOfGroups();
+ if (m->inUsersGroups(itGroup->second, groups)) {
+ vector<int> tempGroupCounts; tempGroupCounts.resize(groups.size(), 0);
+ compositeCt.push_back(itGroup->first, tempGroupCounts);
+ compositeCt.setAbund(itGroup->first, itGroup->second, 1);
+ }else{
+ compositeCt.addGroup(itGroup->second);
+ vector<int> tempGroupCounts; tempGroupCounts.resize(groups.size()+1, 0);
+ compositeCt.push_back(itGroup->first, tempGroupCounts);
+ compositeCt.setAbund(itGroup->first, itGroup->second, 1);
+ }
+ }
+ }else {
+ if (l == 0) {
+ ofstream outCGroup;
+ m->openOutputFile(compositeGroupFile, outCGroup); outCGroup.close();
+ outputNames.push_back(compositeGroupFile); outputTypes["group"].push_back(compositeGroupFile);
+ }
+ m->appendFiles(outputGroupFileName, compositeGroupFile);
+ if (!allFiles) { m->mothurRemove(outputGroupFileName); }
+ else { outputNames.push_back(outputGroupFileName); outputTypes["group"].push_back(outputGroupFileName); }
+ }
+ for (map<string, int>::iterator itGroups = groupCounts.begin(); itGroups != groupCounts.end(); itGroups++) {
+ map<string, int>::iterator itTemp = totalGroupCounts.find(itGroups->first);
+ if (itTemp == totalGroupCounts.end()) { totalGroupCounts[itGroups->first] = itGroups->second; } //new group create it in totalGroups
+ else { itTemp->second += itGroups->second; } //existing group, update total