X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=unifracweightedcommand.cpp;h=0ccdf2f5b58888741328346b230b47cdf874a7d2;hb=fca3f55d5ded10c3dc77856f3cc4a1c53b02bb6f;hp=1fa1a2833c1fa7604a9e2cbb07bf255ace9dcd94;hpb=7762fd5ec7582a78a31bb690a5c05b76e5b899c2;p=mothur.git diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index 1fa1a28..0ccdf2f 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -12,7 +12,7 @@ //********************************************************************************************************************** vector UnifracWeightedCommand::getValidParameters(){ try { - string Array[] = {"groups","iters","distance","random","processors","outputdir","inputdir"}; + string Array[] = {"groups","iters","distance","random","processors","root","outputdir","inputdir"}; vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); return myArray; } @@ -72,7 +72,7 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) { else { //valid paramters for this command - string Array[] = {"groups","iters","distance","random","processors","outputdir","inputdir"}; + string Array[] = {"groups","iters","distance","random","processors","root","outputdir","inputdir"}; vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); OptionParser parser(option); @@ -120,9 +120,12 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) { else { m->mothurOut("Options for distance are: lt, square, or column. Using lt."); m->mothurOutEndLine(); phylip = true; outputForm = "lt"; } } - temp = validParameter.validFile(parameters, "random", false); if (temp == "not found") { temp = "F"; } + temp = validParameter.validFile(parameters, "random", false); if (temp == "not found") { temp = "F"; } random = m->isTrue(temp); + temp = validParameter.validFile(parameters, "root", false); if (temp == "not found") { temp = "F"; } + includeRoot = m->isTrue(temp); + temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = "1"; } convert(temp, processors); @@ -141,7 +144,7 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) { util->setGroups(globaldata->Groups, tmap->namesOfGroups, s, numGroups, "weighted"); //sets the groups the user wants to analyze util->getCombos(groupComb, globaldata->Groups, numComp); - weighted = new Weighted(tmap); + weighted = new Weighted(tmap, includeRoot); } } @@ -158,11 +161,12 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) { void UnifracWeightedCommand::help(){ try { m->mothurOut("The unifrac.weighted command can only be executed after a successful read.tree command.\n"); - m->mothurOut("The unifrac.weighted command parameters are groups, iters, distance, processors and random. No parameters are required.\n"); + m->mothurOut("The unifrac.weighted command parameters are groups, iters, distance, processors, root and random. No parameters are required.\n"); m->mothurOut("The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed. You must enter at least 2 valid groups.\n"); m->mothurOut("The group names are separated by dashes. The iters parameter allows you to specify how many random trees you would like compared to your tree.\n"); m->mothurOut("The distance parameter allows you to create a distance file from the results. The default is false.\n"); m->mothurOut("The random parameter allows you to shut off the comparison to random trees. The default is false, meaning don't compare your trees with randomly generated trees.\n"); + m->mothurOut("The root parameter allows you to include the entire root in your calculations. The default is false, meaning stop at the root for this comparision instead of the root of the entire tree.\n"); m->mothurOut("The processors parameter allows you to specify the number of processors to use. The default is 1.\n"); m->mothurOut("The unifrac.weighted command should be in the following format: unifrac.weighted(groups=yourGroups, iters=yourIters).\n"); m->mothurOut("Example unifrac.weighted(groups=A-B-C, iters=500).\n");