X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=anosimcommand.cpp;h=50b6f283d8d58de276b0a08f573894628a98295f;hp=c5cb4d60c751d6614b82cd961c29d9e645fcbaa8;hb=ae57e166b2ed7b475ec3f466106bd76fabadd063;hpb=55386dddad84cc1140d736cabaf4dd0ae16f2e01 diff --git a/anosimcommand.cpp b/anosimcommand.cpp index c5cb4d6..50b6f28 100644 --- a/anosimcommand.cpp +++ b/anosimcommand.cpp @@ -176,10 +176,16 @@ int AnosimCommand::execute(){ //link designMap to rows/columns in distance matrix map > origGroupSampleMap; for(int i=0;igetGroup(sampleNames[i])].push_back(i); + string group = designMap->getGroup(sampleNames[i]); + + if (group == "not found") { + m->mothurOut("[ERROR]: " + sampleNames[i] + " is not in your design file, please correct."); m->mothurOutEndLine(); m->control_pressed = true; + }else { origGroupSampleMap[group].push_back(i); } } int numGroups = origGroupSampleMap.size(); + if (m->control_pressed) { delete designMap; return 0; } + //create a new filename ofstream ANOSIMFile; string ANOSIMFileName = outputDir + m->getRootName(m->getSimpleName(phylipFileName)) + "anosim";