+ CommandParameter poutput("output", "Multiple", "name-number", "name", "", "", "",false,false); parameters.push_back(poutput);
+ CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none",false,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::getOutputFileNameTag(string type, string inputName=""){
+ try {
+ string outputFileName = "";
+ map<string, vector<string> >::iterator it;
+
+ //is this a type this command creates
+ it = outputTypes.find(type);
+ if (it == outputTypes.end()) { m->mothurOut("[ERROR]: this command doesn't create a " + type + " output file.\n"); }
+ else {
+ if (type == "otuheirarchy") { outputFileName = "otu.hierarchy"; }
+ else { m->mothurOut("[ERROR]: No definition for type " + type + " output file tag.\n"); m->control_pressed = true; }
+ }
+ return outputFileName;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "OtuHierarchyCommand", "getOutputFileNameTag");
+ 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;
+