X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sharedcommand.cpp;h=542f8d346447322aea63491e092b97632449bd62;hb=e10c72304ee071c0c40e0218a06d89dc4731cbc2;hp=e6e790d1687f27a7607555c176bd7b1ebcd44363;hpb=28bcfc4a41b8b82f66636587e0d4d355d07cbdd1;p=mothur.git diff --git a/sharedcommand.cpp b/sharedcommand.cpp index e6e790d..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? @@ -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]); } } }