+//**********************************************************************************************************************
+vector<string> CatchAllCommand::setParameters(){
+ try {
+ CommandParameter plabel("label", "String", "", "", "", "", "","",false,false); parameters.push_back(plabel);
+ //can choose shared or sabund not both, so put them in the same chooseOnlyOneGroup
+ CommandParameter pshared("shared", "InputTypes", "", "", "catchallInputs", "catchallInputs", "none","analysis-bestanalysis-models-bubble-summary",false,false,true); parameters.push_back(pshared);
+ CommandParameter psabund("sabund", "InputTypes", "", "", "catchallInputs", "catchallInputs", "none","analysis-bestanalysis-models-bubble-summary",false,false,true); parameters.push_back(psabund);
+ CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir);
+ CommandParameter poutputdir("outputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(poutputdir);
+
+ vector<string> myArray;
+ for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); }
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "CatchAllCommand", "setParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string CatchAllCommand::getHelpString(){
+ try {
+ string helpString = "";
+ helpString += "The catchall command interfaces mothur with the catchall program written by Linda Woodard, Sean Connolly and John Bunge.\n";
+ helpString += "For more information about catchall refer to http://www.northeastern.edu/catchall/index.html \n";
+ helpString += "The catchall executable must be in the same folder as your mothur executable. \n";
+ helpString += "If you are a MAC or Linux user you must also have installed mono, a link to mono is on the webpage. \n";
+ helpString += "The catchall command parameters are shared, sabund and label. shared or sabund is required. \n";
+ helpString += "The label parameter is used to analyze specific labels in your input.\n";
+ helpString += "The catchall command should be in the following format: \n";
+ helpString += "catchall(sabund=yourSabundFile) \n";
+ helpString += "Example: catchall(sabund=abrecovery.fn.sabund) \n";
+ return helpString;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "CatchAllCommand", "getHelpString");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string CatchAllCommand::getOutputPattern(string type) {
+ try {
+ string pattern = "";
+
+ if (type == "analysis") { pattern = "[filename],_Analysis.csv"; }
+ else if (type == "bestanalysis") { pattern = "[filename],_BestModelsAnalysis.csv"; }
+ else if (type == "models") { pattern = "[filename],_BestModelsAnalysis.csv"; }
+ else if (type == "bubble") { pattern = "[filename],_BubblePlot.csv"; }
+ else if (type == "summary") { pattern = "[filename],catchall.summary"; }
+ else if (type == "sabund") { pattern = "[filename],[distance],csv"; }
+ else { m->mothurOut("[ERROR]: No definition for type " + type + " output pattern.\n"); m->control_pressed = true; }
+
+ return pattern;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "CatchAllCommand", "getOutputPattern");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+CatchAllCommand::CatchAllCommand(){
+ try {
+ abort = true; calledHelp = true;
+ setParameters();
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["analysis"] = tempOutNames;
+ outputTypes["bestanalysis"] = tempOutNames;
+ outputTypes["models"] = tempOutNames;
+ outputTypes["bubble"] = tempOutNames;
+ outputTypes["summary"] = tempOutNames;
+ outputTypes["sabund"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "CatchAllCommand", "CatchAllCommand");
+ exit(1);
+ }
+}