+//**********************************************************************************************************************
+vector<string> ParseListCommand::setParameters(){
+ try {
+ CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none","list",false,true,true); parameters.push_back(plist);
+ CommandParameter pcount("count", "InputTypes", "", "", "CountGroup", "CountGroup", "none","",false,false,true); parameters.push_back(pcount);
+ CommandParameter pgroup("group", "InputTypes", "", "", "CountGroup", "CountGroup", "none","",false,false,true); parameters.push_back(pgroup);
+ 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<string> myArray;
+ for (int i = 0; i < parameters.size(); i++) { myArray.push_back(parameters[i].name); }
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ParseListCommand", "setParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string ParseListCommand::getHelpString(){
+ try {
+ string helpString = "";
+ helpString += "The parse.list command reads a list and group or count file and generates a list file for each group in the group or count file. \n";
+ helpString += "The parse.list command parameters are list, group, count and label.\n";
+ helpString += "The list and group or count parameters are required.\n";
+ helpString += "If a count file is provided, mothur assumes the list file contains only unique names.\n";
+ helpString += "If a group file is provided, mothur assumes the list file contains all names.\n";
+ helpString += "The label parameter is used to read specific labels in your input you want to use.\n";
+ helpString += "The parse.list command should be used in the following format: parse.list(list=yourListFile, group=yourGroupFile, label=yourLabels).\n";
+ helpString += "Example: parse.list(list=abrecovery.fn.list, group=abrecovery.groups, label=0.03).\n";
+ helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n";
+ return helpString;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ParseListCommand", "getHelpString");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string ParseListCommand::getOutputPattern(string type) {
+ try {
+ string pattern = "";
+
+ if (type == "list") { pattern = "[filename],[group],list"; }
+ else { m->mothurOut("[ERROR]: No definition for type " + type + " output pattern.\n"); m->control_pressed = true; }
+
+ return pattern;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ParseListCommand", "getOutputPattern");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+ParseListCommand::ParseListCommand(){
+ try {
+ abort = true; calledHelp = true;
+ setParameters();
+ vector<string> tempOutNames;
+ outputTypes["list"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ParseListCommand", "ParseListCommand");
+ exit(1);
+ }
+}