X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=unifracunweightedcommand.cpp;h=a404f79222ac83cf41d42c04ceb614df1e01dceb;hb=2bb9267aa4b4ecdf8488b06605cc9f3f36fa4332;hp=cc175e17fd74f0d808fc9efa11442f582333e73d;hpb=55386dddad84cc1140d736cabaf4dd0ae16f2e01;p=mothur.git diff --git a/unifracunweightedcommand.cpp b/unifracunweightedcommand.cpp index cc175e1..a404f79 100644 --- a/unifracunweightedcommand.cpp +++ b/unifracunweightedcommand.cpp @@ -155,7 +155,7 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option) { else { m->setGroupFile(groupfile); } namefile = validParameter.validFile(parameters, "name", true); - if (namefile == "not open") { abort = true; } + if (namefile == "not open") { namefile = ""; abort = true; } else if (namefile == "not found") { namefile = ""; } else { m->setNameFile(namefile); } @@ -171,7 +171,7 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option) { } itersString = validParameter.validFile(parameters, "iters", false); if (itersString == "not found") { itersString = "1000"; } - convert(itersString, iters); + m->mothurConvert(itersString, iters); string temp = validParameter.validFile(parameters, "distance", false); if (temp == "not found") { phylip = false; outputForm = ""; } @@ -188,7 +188,7 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); if (!random) { iters = 0; } //turn off random calcs @@ -198,6 +198,11 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option) { m->splitAtDash(groups, Groups); m->setGroups(Groups); } + + if (namefile == "") { + vector files; files.push_back(treefile); + parser.getNameFile(files); + } } } @@ -282,10 +287,11 @@ int UnifracUnweightedCommand::execute() { m->openOutputFile(sumFile, outSum); util = new SharedUtil(); - vector Groups = m->getGroups(); + Groups = m->getGroups(); vector namesGroups = tmap->getNamesOfGroups(); util->setGroups(Groups, namesGroups, allGroups, numGroups, "unweighted"); //sets the groups the user wants to analyze util->getCombos(groupComb, Groups, numComp); + m->setGroups(Groups); delete util; if (numGroups == 1) { numComp++; groupComb.push_back(allGroups); }