X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sharedcommand.cpp;h=542f8d346447322aea63491e092b97632449bd62;hb=5c5c0428f6d548c28a8b903ac80efed4f92d59db;hp=1150e53735481aea3377ec81f78c0d2544f324e6;hpb=fdfbfe59134dd7dd3e49d90609d129128ba2d370;p=mothur.git diff --git a/sharedcommand.cpp b/sharedcommand.cpp index 1150e53..542f8d3 100644 --- a/sharedcommand.cpp +++ b/sharedcommand.cpp @@ -188,7 +188,11 @@ SharedCommand::SharedCommand(string option) { 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? @@ -825,7 +829,7 @@ int SharedCommand::createSharedFromListGroup(string filename) { 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 @@ -1083,8 +1087,12 @@ int SharedCommand::ListGroupSameSeqs(vector& groupMapsSeqs, SharedListVe 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]); } } }