else if (namefile == "not found") { namefile = ""; }
else { m->setNameFile(namefile); }
+ groupfile = validParameter.validFile(parameters, "group", true);
+ if (groupfile == "not open") { abort = true; }
+ else if (groupfile == "not found") {
+ //if there is a current group file, use it
+ groupfile = m->getGroupFile();
+ if (groupfile != "") { m->mothurOut("Using " + groupfile + " as input file for the group parameter."); m->mothurOutEndLine(); }
+ else { m->mothurOut("You have no current groupfile and the group parameter is required."); m->mothurOutEndLine(); abort = true; }
+ }else { m->setGroupFile(groupfile); }
+
listfile = validParameter.validFile(parameters, "list", true);
if (listfile == "not open") { abort = true; }
else if (listfile == "not found") { listfile = ""; }
if (groups == "not found") { groups = ""; }
else {
m->splitAtDash(groups, Groups);
- m->Groups = Groups;
+ m->setGroups(Groups);
}
sharedfile = validParameter.validFile(parameters, "shared", true);
//make sure groups are valid
//takes care of user setting groupNames that are invalid or setting groups=all
SharedUtil* util = new SharedUtil();
- util->setGroups(Groups, groupMap->namesOfGroups);
+ vector<string> gNamesOfGroups = groupMap->getNamesOfGroups();
+ util->setGroups(Groups, gNamesOfGroups);
+ groupMap->setNamesOfGroups(gNamesOfGroups);
delete util;
//fill names with names of sequences that are from the groups we want to remove
}
in.close();
- m->Groups = Groups;
+ m->setGroups(Groups);
}
catch(exception& e) {