X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=treegroupscommand.cpp;h=c26199d673088b5b64872b672ab8e64ca780e616;hb=2009a1a1f47e7467094d844e7c07ab8ddf7bb447;hp=3eeeae292e674dbc7823522ce8e35d8d531ab70e;hpb=f55cf350ca6643f8eb070d8336e1957699a3f109;p=mothur.git diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index 3eeeae2..c26199d 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -27,7 +27,7 @@ vector TreeGroupCommand::setParameters(){ CommandParameter pcalc("calc", "Multiple", "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan-kstest-sharednseqs-ochiai-anderberg-kulczynski-kulczynskicody-lennon-morisitahorn-braycurtis-whittaker-odum-canberra-structeuclidean-structchord-hellinger-manhattan-structpearson-soergel-spearman-structkulczynski-speciesprofile-hamming-structchi2-gower-memchi2-memchord-memeuclidean-mempearson", "jclass-thetayc", "", "", "",true,false); parameters.push_back(pcalc); CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors); - CommandParameter poutput("output", "Multiple", "lt-square", "lt", "", "", "",false,false); parameters.push_back(poutput); +//CommandParameter poutput("output", "Multiple", "lt-square", "lt", "", "", "",false,false); parameters.push_back(poutput); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir); @@ -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;