X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=unifracweightedcommand.cpp;h=00bb5d6c39eb0894389be1e5fecaba838d4303bd;hb=65b6a38d00b3a72021611211e7c25392022c69ed;hp=29cdf94091cebb65104e1b5691e5691e19a4e495;hpb=ca9ac1d80c62f57270b0dcd49410ebe08a8aecd6;p=mothur.git diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index 29cdf94..00bb5d6 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -48,7 +48,7 @@ string UnifracWeightedCommand::getHelpString(){ helpString += "Example unifrac.weighted(groups=A-B-C, iters=500).\n"; helpString += "The default value for groups is all the groups in your groupfile, and iters is 1000.\n"; helpString += "The unifrac.weighted command output two files: .weighted and .wsummary their descriptions are in the manual.\n"; - helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n"; return helpString; } catch(exception& e) { @@ -80,6 +80,7 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) { //allow user to run help if(option == "help") { help(); abort = true; calledHelp = true; } + else if(option == "citation") { citation(); abort = true; calledHelp = true;} else { vector myArray = setParameters(); @@ -133,6 +134,10 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) { } m->runParse = true; + m->Groups.clear(); + m->namesOfGroups.clear(); + m->Treenames.clear(); + m->names.clear(); //check for required parameters treefile = validParameter.validFile(parameters, "tree", true); @@ -141,16 +146,18 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) { treefile = m->getTreeFile(); if (treefile != "") { m->mothurOut("Using " + treefile + " as input file for the tree parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current tree file and the tree parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setTreeFile(treefile); } //check for required parameters groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = ""; } @@ -200,6 +207,8 @@ int UnifracWeightedCommand::execute() { if (abort == true) { if (calledHelp) { return 0; } return 2; } + m->setTreeFile(treefile); + if (groupfile != "") { //read in group map info. tmap = new TreeMap(groupfile);