]> git.donarmstrong.com Git - mothur.git/blobdiff - unifracweightedcommand.cpp
classify.seqs allows sequences to be in taxonomy file that are not in template. ...
[mothur.git] / unifracweightedcommand.cpp
index e698fffb58e435ddae9d3f496f5f19d33923c5c2..541131efd5b15401c229a21966655d39e320a496 100644 (file)
@@ -305,7 +305,8 @@ int UnifracWeightedCommand::execute() {
                string s; //to make work with setgroups
                Groups = m->getGroups();
                vector<string> 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; }