X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=getsabundcommand.cpp;h=237506e666641ab80e263db5573aec13756e3429;hb=67ea6ccd74dbd64828d31b952808255f206364ff;hp=4ae2eaa004f9df9cc75c12b63626ffa7fad71ea7;hpb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc;p=mothur.git diff --git a/getsabundcommand.cpp b/getsabundcommand.cpp index 4ae2eaa..237506e 100644 --- a/getsabundcommand.cpp +++ b/getsabundcommand.cpp @@ -12,11 +12,11 @@ //********************************************************************************************************************** vector GetSAbundCommand::setParameters(){ try { - CommandParameter plist("list", "InputTypes", "", "", "LRSS", "LRSS", "none",false,false); parameters.push_back(plist); - CommandParameter prabund("rabund", "InputTypes", "", "", "LRSS", "LRSS", "none",false,false); parameters.push_back(prabund); - CommandParameter plabel("label", "String", "", "", "", "", "",false,false); parameters.push_back(plabel); - CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir); - CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir); + CommandParameter plist("list", "InputTypes", "", "", "LRSS", "LRSS", "none","sabund",false,false, true); parameters.push_back(plist); + CommandParameter prabund("rabund", "InputTypes", "", "", "LRSS", "LRSS", "none","sabund",false,false, true); parameters.push_back(prabund); + CommandParameter plabel("label", "String", "", "", "", "", "","",false,false); parameters.push_back(plabel); + CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir); + CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir); vector myArray; for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); } @@ -45,7 +45,21 @@ string GetSAbundCommand::getHelpString(){ exit(1); } } - +//********************************************************************************************************************** +string GetSAbundCommand::getOutputPattern(string type) { + try { + string pattern = ""; + + if (type == "sabund") { pattern = "[filename],sabund"; } + else { m->mothurOut("[ERROR]: No definition for type " + type + " output pattern.\n"); m->control_pressed = true; } + + return pattern; + } + catch(exception& e) { + m->errorOut(e, "GetRAbundCommand", "getOutputPattern"); + exit(1); + } +} //********************************************************************************************************************** GetSAbundCommand::GetSAbundCommand(){ try { @@ -166,7 +180,9 @@ int GetSAbundCommand::execute(){ try { if (abort == true) { if (calledHelp) { return 0; } return 2; } - filename = outputDir + m->getRootName(m->getSimpleName(inputfile)) + "sabund"; + map variables; + variables["[filename]"] = outputDir + m->getRootName(m->getSimpleName(inputfile)); + filename = getOutputFileName("sabund", variables); m->openOutputFile(filename, out); input = new InputData(inputfile, format); @@ -249,7 +265,7 @@ int GetSAbundCommand::execute(){ delete input; m->mothurOutEndLine(); - m->mothurOut("Output File Name: "); m->mothurOutEndLine(); + m->mothurOut("Output File Names: "); m->mothurOutEndLine(); m->mothurOut(filename); m->mothurOutEndLine(); outputNames.push_back(filename); outputTypes["sabund"].push_back(filename); m->mothurOutEndLine();