X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=unifracweightedcommand.cpp;h=541131efd5b15401c229a21966655d39e320a496;hb=9b53f130ac9af5e95444ce2e817fce25ed19ff03;hp=e698fffb58e435ddae9d3f496f5f19d33923c5c2;hpb=5c5c0428f6d548c28a8b903ac80efed4f92d59db;p=mothur.git diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index e698fff..541131e 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -305,7 +305,8 @@ int UnifracWeightedCommand::execute() { string s; //to make work with setgroups Groups = m->getGroups(); vector nameGroups = ct->getNamesOfGroups(); - util.setGroups(Groups, nameGroups, s, numGroups, "weighted"); //sets the groups the user wants to analyze + if (nameGroups.size() < 2) { m->mothurOut("[ERROR]: You cannot run unifrac.weighted with less than 2 groups, aborting.\n"); delete ct; for (int i = 0; i < T.size(); i++) { delete T[i]; } return 0; } + util.setGroups(Groups, nameGroups, s, numGroups, "weighted"); //sets the groups the user wants to analyze m->setGroups(Groups); if (m->control_pressed) { delete ct; for (int i = 0; i < T.size(); i++) { delete T[i]; } return 0; }