X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=treegroupscommand.cpp;h=c26199d673088b5b64872b672ab8e64ca780e616;hb=2b11c674bb4d57c4542ecb89989e1590dd9f07a7;hp=2542431f111f85b5bc344d93388662364045a509;hpb=696633b3cf5f0b6928216069a780fccc87a69f0b;p=mothur.git diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index 2542431..c26199d 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -570,13 +570,6 @@ vector< vector > TreeGroupCommand::makeSimsDist() { int TreeGroupCommand::makeSimsShared() { try { - numGroups = lookup.size(); - lines.resize(processors); - for (int i = 0; i < processors; i++) { - lines[i].start = int (sqrt(float(i)/float(processors)) * numGroups); - lines[i].end = int (sqrt(float(i+1)/float(processors)) * numGroups); - } - if (subsample) { if (subsampleSize == -1) { //user has not set size, set size = smallest samples size subsampleSize = lookup[0]->getNumSeqs(); @@ -601,8 +594,17 @@ int TreeGroupCommand::makeSimsShared() { lookup = temp; m->setGroups(Groups); } + + if (lookup.size() < 2) { m->mothurOut("You have not provided enough valid groups. I cannot run the command."); m->mothurOutEndLine(); m->control_pressed = true; return 0; } } + numGroups = lookup.size(); + lines.resize(processors); + for (int i = 0; i < processors; i++) { + lines[i].start = int (sqrt(float(i)/float(processors)) * numGroups); + lines[i].end = int (sqrt(float(i+1)/float(processors)) * numGroups); + } + set processedLabels; set userLabels = labels;