+ //if user has specified groups make new groupfile for them
+ if (globaldata->Groups.size() != 0) { //make new group file
+ string groups = "";
+ for (int i = 0; i < globaldata->Groups.size(); i++) {
+ groups += globaldata->Groups[i] + ".";
+ }
+
+ string newGroupFile = getRootName(globaldata->inputFileName) + groups + "groups";
+ ofstream outGroups;
+ openOutputFile(newGroupFile, outGroups);
+
+ vector<string> names = groupMap->getNamesSeqs();
+ string groupName;
+ for (int i = 0; i < names.size(); i++) {
+ groupName = groupMap->getGroup(names[i]);
+ if (isValidGroup(groupName, globaldata->Groups)) {
+ outGroups << names[i] << '\t' << groupName << endl;
+ }
+ }
+ outGroups.close();
+ }
+