X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=setcurrentcommand.cpp;h=5582abd03d6220da752943278cad50f4bceb1a76;hb=2bb9267aa4b4ecdf8488b06605cc9f3f36fa4332;hp=16685b24c7c706d0c6cf5aa9d15da2e08e863112;hpb=ca9ac1d80c62f57270b0dcd49410ebe08a8aecd6;p=mothur.git diff --git a/setcurrentcommand.cpp b/setcurrentcommand.cpp index 16685b2..5582abd 100644 --- a/setcurrentcommand.cpp +++ b/setcurrentcommand.cpp @@ -12,7 +12,9 @@ //********************************************************************************************************************** vector SetCurrentCommand::setParameters(){ try { - + + CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors); + CommandParameter pflow("flow", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pflow); CommandParameter pphylip("phylip", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pphylip); CommandParameter pcolumn("column", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pcolumn); CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pfasta); @@ -81,6 +83,7 @@ SetCurrentCommand::SetCurrentCommand(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 { //valid paramters for this command @@ -261,6 +264,14 @@ SetCurrentCommand::SetCurrentCommand(string option) { //if the user has not given a path then, add inputdir. else leave path alone. if (path == "") { parameters["taxonomy"] = inputDir + it->second; } } + + it = parameters.find("flow"); + //user has given a template file + if(it != parameters.end()){ + path = m->hasPath(it->second); + //if the user has not given a path then, add inputdir. else leave path alone. + if (path == "") { parameters["flow"] = inputDir + it->second; } + } } //check for parameters @@ -359,6 +370,15 @@ SetCurrentCommand::SetCurrentCommand(string option) { else if (taxonomyfile == "not found") { taxonomyfile = ""; } if (taxonomyfile != "") { m->setTaxonomyFile(taxonomyfile); } + flowfile = validParameter.validFile(parameters, "flow", true); + if (flowfile == "not open") { m->mothurOut("Ignoring: " + parameters["flow"]); m->mothurOutEndLine(); flowfile = ""; } + else if (flowfile == "not found") { flowfile = ""; } + if (flowfile != "") { m->setFlowFile(flowfile); } + + processors = validParameter.validFile(parameters, "processors", false); + if (processors == "not found") { processors = "1"; } + if (processors != "") { m->setProcessors(processors); } + clearTypes = validParameter.validFile(parameters, "clear", false); if (clearTypes == "not found") { clearTypes = ""; } else { m->splitAtDash(clearTypes, types); } @@ -422,6 +442,10 @@ int SetCurrentCommand::execute(){ m->setAccnosFile(""); }else if (types[i] == "taxonomy") { m->setTaxonomyFile(""); + }else if (types[i] == "flow") { + m->setFlowFile(""); + }else if (types[i] == "processors") { + m->setProcessors("1"); }else if (types[i] == "all") { m->clearCurrentFiles(); }else {