X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=getrabundcommand.cpp;h=d5f5a8b8b8450deef538f564d59885b57647c430;hb=67ea6ccd74dbd64828d31b952808255f206364ff;hp=5a33253ff1ec2b67a9e995b940f09349241494f5;hpb=19fcbbdba99658f5eca244803280f9ee7f9f6607;p=mothur.git diff --git a/getrabundcommand.cpp b/getrabundcommand.cpp index 5a33253..d5f5a8b 100644 --- a/getrabundcommand.cpp +++ b/getrabundcommand.cpp @@ -12,12 +12,12 @@ //********************************************************************************************************************** vector GetRAbundCommand::setParameters(){ try { - CommandParameter plist("list", "InputTypes", "", "", "LRSS", "LRSS", "none",false,false); parameters.push_back(plist); - CommandParameter psabund("sabund", "InputTypes", "", "", "LRSS", "LRSS", "none",false,false); parameters.push_back(psabund); - CommandParameter psorted("sorted", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(psorted); - 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","rabund",false,false, true); parameters.push_back(plist); + CommandParameter psabund("sabund", "InputTypes", "", "", "LRSS", "LRSS", "none","rabund",false,false, true); parameters.push_back(psabund); + CommandParameter psorted("sorted", "Boolean", "", "T", "", "", "","",false,false); parameters.push_back(psorted); + 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); } @@ -47,6 +47,21 @@ string GetRAbundCommand::getHelpString(){ exit(1); } } +//********************************************************************************************************************** +string GetRAbundCommand::getOutputPattern(string type) { + try { + string pattern = ""; + + if (type == "rabund") { pattern = "[filename],rabund"; } + 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); + } +} //********************************************************************************************************************** GetRAbundCommand::GetRAbundCommand(){ @@ -173,7 +188,9 @@ int GetRAbundCommand::execute(){ if (abort == true) { if (calledHelp) { return 0; } return 2; } - filename = outputDir + m->getRootName(m->getSimpleName(inputfile)) + "rabund"; + map variables; + variables["[filename]"] = outputDir + m->getRootName(m->getSimpleName(inputfile)); + filename = getOutputFileName("rabund", variables); m->openOutputFile(filename, out); input = new InputData(inputfile, format); @@ -255,7 +272,7 @@ int GetRAbundCommand::execute(){ } 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["rabund"].push_back(filename); m->mothurOutEndLine();