countfile = validParameter.validFile(parameters, "count", true);
if (countfile == "not open") { countfile = ""; abort = true; }
else if (countfile == "not found") { countfile = ""; }
- else { m->setCountTableFile(countfile); }
+ else {
+ m->setCountTableFile(countfile);
+ CountTable temp;
+ if (!temp.testGroups(countfile)) { m->mothurOut("[ERROR]: Your count file does not have group info, aborting."); m->mothurOutEndLine(); abort=true; }
+ }
if ((biomfile == "") && (listfile == "")) {
//is there are current file available for either of these?
int error = ListGroupSameSeqs(namesSeqs, SharedList);
if ((!pickedGroups) && (SharedList->getNumSeqs() != numGroupNames)) { //if the user has not specified any groups and their files don't match exit with error
- m->mothurOut("Your group file contains " + toString(numGroupNames) + " sequences and list file contains " + toString(SharedList->getNumSeqs()) + " sequences. Please correct."); m->mothurOutEndLine();
+ m->mothurOut("Your group file contains " + toString(numGroupNames) + " sequences and list file contains " + toString(SharedList->getNumSeqs()) + " sequences. Please correct."); m->mothurOutEndLine(); m->control_pressed = true;
out.close(); m->mothurRemove(filename); //remove blank shared file you made
for (int j = 0; j < listNames.size(); j++) {
int num = groupNamesSeqs.count(listNames[j]);
- if (num == 0) { error = 1; m->mothurOut("[ERROR]: " + listNames[j] + " is in your listfile and not in your groupfile. Please correct."); m->mothurOutEndLine(); }
- else { groupNamesSeqs.erase(listNames[j]); }
+ if (num == 0) {
+ error = 1;
+ if (groupfile != "") {
+ m->mothurOut("[ERROR]: " + listNames[j] + " is in your listfile and not in your groupfile. Please correct."); m->mothurOutEndLine(); }
+ else{ m->mothurOut("[ERROR]: " + listNames[j] + " is in your listfile and not in your count file. Please correct."); m->mothurOutEndLine(); }
+ }else { groupNamesSeqs.erase(listNames[j]); }
}
}