X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=setcurrentcommand.cpp;h=27d7b92764bda85599b2f18cbdafb3e486e704ef;hb=6ede3bf5c0a9eedb23f24577a97da81ab3e1f7df;hp=75d1f943e37a157f66d82987a74b527a0bc5cec3;hpb=86c838c428a9e7d26f902f5492738241fa72c4e7;p=mothur.git diff --git a/setcurrentcommand.cpp b/setcurrentcommand.cpp index 75d1f94..27d7b92 100644 --- a/setcurrentcommand.cpp +++ b/setcurrentcommand.cpp @@ -15,6 +15,7 @@ vector SetCurrentCommand::setParameters(){ 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 pbiom("biom", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pbiom); 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); @@ -31,6 +32,7 @@ vector SetCurrentCommand::setParameters(){ CommandParameter ptree("tree", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(ptree); CommandParameter pshared("shared", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pshared); CommandParameter pordergroup("ordergroup", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pordergroup); + CommandParameter pcount("count", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pcount); CommandParameter prelabund("relabund", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(prelabund); CommandParameter psff("sff", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(psff); CommandParameter poligos("oligos", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(poligos); @@ -52,7 +54,7 @@ string SetCurrentCommand::getHelpString(){ try { string helpString = ""; helpString += "The set.current command allows you to set the current files saved by mothur.\n"; - helpString += "The set.current command parameters are: clear, phylip, column, list, rabund, sabund, name, group, design, order, tree, shared, ordergroup, relabund, fasta, qfile, sff, oligos, accnos, taxonomy.\n"; + helpString += "The set.current command parameters are: clear, phylip, column, list, rabund, sabund, name, group, design, order, tree, shared, ordergroup, relabund, fasta, qfile, sff, oligos, accnos, biom, count and taxonomy.\n"; helpString += "The clear paramter is used to indicate which file types you would like to clear values for, multiple types can be separated by dashes.\n"; helpString += "The set.current command should be in the following format: \n"; helpString += "set.current(fasta=yourFastaFile) or set.current(fasta=amazon.fasta, clear=name-accnos)\n"; @@ -83,6 +85,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 @@ -208,6 +211,14 @@ SetCurrentCommand::SetCurrentCommand(string option) { if (path == "") { parameters["ordergroup"] = inputDir + it->second; } } + it = parameters.find("count"); + //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["count"] = inputDir + it->second; } + } + it = parameters.find("relabund"); //user has given a template file if(it != parameters.end()){ @@ -271,6 +282,14 @@ SetCurrentCommand::SetCurrentCommand(string option) { //if the user has not given a path then, add inputdir. else leave path alone. if (path == "") { parameters["flow"] = inputDir + it->second; } } + + it = parameters.find("biom"); + //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["biom"] = inputDir + it->second; } + } } //check for parameters @@ -308,6 +327,11 @@ SetCurrentCommand::SetCurrentCommand(string option) { if (groupfile == "not open") { m->mothurOut("Ignoring: " + parameters["group"]); m->mothurOutEndLine(); groupfile = ""; } else if (groupfile == "not found") { groupfile = ""; } if (groupfile != "") { m->setGroupFile(groupfile); } + + countfile = validParameter.validFile(parameters, "count", true); + if (countfile == "not open") { m->mothurOut("Ignoring: " + parameters["count"]); m->mothurOutEndLine(); countfile = ""; } + else if (countfile == "not found") { countfile = ""; } + if (countfile != "") { m->setCountTableFile(countfile); } designfile = validParameter.validFile(parameters, "design", true); if (designfile == "not open") { m->mothurOut("Ignoring: " + parameters["design"]); m->mothurOutEndLine(); designfile = ""; } @@ -373,6 +397,11 @@ SetCurrentCommand::SetCurrentCommand(string option) { if (flowfile == "not open") { m->mothurOut("Ignoring: " + parameters["flow"]); m->mothurOutEndLine(); flowfile = ""; } else if (flowfile == "not found") { flowfile = ""; } if (flowfile != "") { m->setFlowFile(flowfile); } + + biomfile = validParameter.validFile(parameters, "biom", true); + if (biomfile == "not open") { m->mothurOut("Ignoring: " + parameters["biom"]); m->mothurOutEndLine(); biomfile = ""; } + else if (biomfile == "not found") { biomfile = ""; } + if (biomfile != "") { m->setBiomFile(biomfile); } processors = validParameter.validFile(parameters, "processors", false); if (processors == "not found") { processors = "1"; } @@ -443,6 +472,10 @@ int SetCurrentCommand::execute(){ m->setTaxonomyFile(""); }else if (types[i] == "flow") { m->setFlowFile(""); + }else if (types[i] == "biom") { + m->setBiomFile(""); + }else if (types[i] == "count") { + m->setCountTableFile(""); }else if (types[i] == "processors") { m->setProcessors("1"); }else if (types[i] == "all") {