+//**********************************************************************************************************************
+vector<string> NormalizeSharedCommand::setParameters(){
+ try {
+ CommandParameter pshared("shared", "InputTypes", "", "", "LRSS", "LRSS", "none","shared",false,false,true); parameters.push_back(pshared);
+ CommandParameter prelabund("relabund", "InputTypes", "", "", "LRSS", "LRSS", "none","shared",false,false,true); parameters.push_back(prelabund);
+ CommandParameter pgroups("groups", "String", "", "", "", "", "","",false,false); parameters.push_back(pgroups);
+ CommandParameter pmethod("method", "Multiple", "totalgroup-zscore", "totalgroup", "", "", "","",false,false,true); parameters.push_back(pmethod);
+ CommandParameter pnorm("norm", "Number", "", "0", "", "", "","",false,false); parameters.push_back(pnorm);
+ CommandParameter pmakerelabund("makerelabund", "Boolean", "", "F", "", "", "","",false,false); parameters.push_back(pmakerelabund);
+ 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, "NormalizeSharedCommand", "setParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string NormalizeSharedCommand::getHelpString(){
+ try {
+ string helpString = "";
+ helpString += "The normalize.shared command parameters are shared, relabund, groups, method, norm, makerelabund and label. shared or relabund is required, unless you have a valid current file.\n";
+ helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like included. The group names are separated by dashes.\n";
+ helpString += "The label parameter allows you to select what distance levels you would like, and are also separated by dashes.\n";
+ helpString += "The method parameter allows you to select what method you would like to use to normalize. The options are totalgroup and zscore. We hope to add more ways to normalize in the future, suggestions are welcome!\n";
+ helpString += "The makerelabund parameter allows you to convert a shared file to a relabund file before you normalize. default=f.\n";
+ helpString += "The norm parameter allows you to number you would like to normalize to. By default this is set to the number of sequences in your smallest group.\n";
+ helpString += "The normalize.shared command should be in the following format: normalize.shared(groups=yourGroups, label=yourLabels).\n";
+ helpString += "Example normalize.shared(groups=A-B-C, scale=totalgroup).\n";
+ helpString += "The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n";
+ helpString += "The normalize.shared command outputs a .norm.shared file.\n";
+ helpString += "Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n";
+ return helpString;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "NormalizeSharedCommand", "getHelpString");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string NormalizeSharedCommand::getOutputPattern(string type) {
+ try {
+ string pattern = "";
+
+ if (type == "shared") { pattern = "[filename],[distance],norm.shared"; }
+ else { m->mothurOut("[ERROR]: No definition for type " + type + " output pattern.\n"); m->control_pressed = true; }
+
+ return pattern;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "NormalizeSharedCommand", "getOutputPattern");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+NormalizeSharedCommand::NormalizeSharedCommand(){
+ try {
+ abort = true; calledHelp = true;
+ setParameters();
+ vector<string> tempOutNames;
+ outputTypes["shared"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "NormalizeSharedCommand", "NormalizeSharedCommand");
+ exit(1);
+ }
+}