+ CommandParameter poutput("output", "Multiple", "name-number", "name", "", "", "","",false,false); parameters.push_back(poutput);
+ CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none","otuheirarchy",false,true,true); parameters.push_back(plist);
+ 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, "OtuHierarchyCommand", "setParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string OtuHierarchyCommand::getHelpString(){
+ try {
+ string helpString = "";
+ helpString += "The otu.hierarchy command is used to see how otus relate at two distances. \n";
+ helpString += "The otu.hierarchy command parameters are list, label and output. list and label parameters are required. \n";
+ helpString += "The output parameter allows you to output the names of the sequence in the OTUs or the OTU numbers. Options are name and number, default is name. \n";
+ helpString += "The otu.hierarchy command should be in the following format: \n";
+ helpString += "otu.hierarchy(list=yourListFile, label=yourLabels).\n";
+ helpString += "Example otu.hierarchy(list=amazon.fn.list, label=0.01-0.03).\n";
+ helpString += "The otu.hierarchy command outputs a .otu.hierarchy file which is described on the wiki.\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, "OtuHierarchyCommand", "getHelpString");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string OtuHierarchyCommand::getOutputPattern(string type) {
+ try {
+ string pattern = "";
+
+ if (type == "otuheirarchy") { pattern = "[filename],[distance1],[tag],[distance2],otu.hierarchy"; }
+ else { m->mothurOut("[ERROR]: No definition for type " + type + " output pattern.\n"); m->control_pressed = true; }
+
+ return pattern;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "OtuHierarchyCommand", "getOutputPattern");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+OtuHierarchyCommand::OtuHierarchyCommand(){
+ try {
+ abort = true; calledHelp = true;
+ setParameters();
+ vector<string> tempOutNames;
+ outputTypes["otuheirarchy"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "OtuHierarchyCommand", "OtuHierarchyCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+OtuHierarchyCommand::OtuHierarchyCommand(string option) {
+ try {
+ abort = false; calledHelp = false;
+