+ 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 == "sharedchao") { outputFileName = "shared.chao"; }
+ else if (type == "sharedsobs") { outputFileName = "shared.sobs"; }
+ else if (type == "sharedace") { outputFileName = "shared.ace"; }
+ else if (type == "jabund") { outputFileName = "jabund"; }
+ else if (type == "sorabund") { outputFileName = "sorabund"; }
+ else if (type == "jclass") { outputFileName = "jclass"; }
+ else if (type == "sorclass") { outputFileName = "sorclass"; }
+ else if (type == "jest") { outputFileName = "jest"; }
+ else if (type == "sorest") { outputFileName = "sorest"; }
+ else if (type == "thetayc") { outputFileName = "thetayc"; }
+ else if (type == "thetan") { outputFileName = "thetan"; }
+ else if (type == "kstest") { outputFileName = "kstest"; }
+ else if (type == "whittaker") { outputFileName = "whittaker"; }
+ else if (type == "sharednseqs") { outputFileName = "shared.nseqs"; }
+ else if (type == "ochiai") { outputFileName = "ochiai"; }
+ else if (type == "anderberg") { outputFileName = "anderberg"; }
+ else if (type == "kulczynski") { outputFileName = "kulczynski"; }
+ else if (type == "kulczynskicody") { outputFileName = "kulczynskicody"; }
+ else if (type == "lennon") { outputFileName = "lennon"; }
+ else if (type == "morisitahorn") { outputFileName = "morisitahorn"; }
+ else if (type == "braycurtis") { outputFileName = "braycurtis"; }
+ else if (type == "odum") { outputFileName = "odum"; }
+ else if (type == "canberra") { outputFileName = "canberra"; }
+ else if (type == "structeuclidean") { outputFileName = "structeuclidean"; }
+ else if (type == "structchord") { outputFileName = "structchord"; }
+ else if (type == "hellinger") { outputFileName = "hellinger"; }
+ else if (type == "manhattan") { outputFileName = "manhattan"; }
+ else if (type == "structpearson") { outputFileName = "structpearson"; }
+ else if (type == "soergel") { outputFileName = "soergel"; }
+ else if (type == "spearman") { outputFileName = "spearman"; }
+ else if (type == "structkulczynski") { outputFileName = "structkulczynski";}
+ else if (type == "structchi2") { outputFileName = "structchi2"; }
+ else if (type == "speciesprofile") { outputFileName = "speciesprofile"; }
+ else if (type == "hamming") { outputFileName = "hamming"; }
+ else if (type == "gower") { outputFileName = "gower"; }
+ else if (type == "memchi2") { outputFileName = "memchi2"; }
+ else if (type == "memchord") { outputFileName = "memchord"; }
+ else if (type == "memeuclidean") { outputFileName = "memeuclidean"; }
+ else if (type == "mempearson") { outputFileName = "mempearson"; }
+ 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, "CollectSharedCommand", "getOutputFileNameTag");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+CollectSharedCommand::CollectSharedCommand(){
+ try {
+ abort = true; calledHelp = true;
+ setParameters();
+ vector<string> tempOutNames;
+ outputTypes["sharedchao"] = tempOutNames;
+ outputTypes["sharedsobs"] = tempOutNames;
+ outputTypes["sharedace"] = tempOutNames;
+ outputTypes["jabund"] = tempOutNames;
+ outputTypes["sorabund"] = tempOutNames;
+ outputTypes["jclass"] = tempOutNames;
+ outputTypes["sorclass"] = tempOutNames;
+ outputTypes["jest"] = tempOutNames;
+ outputTypes["sorest"] = tempOutNames;
+ outputTypes["thetayc"] = tempOutNames;
+ outputTypes["thetan"] = tempOutNames;
+ outputTypes["kstest"] = tempOutNames;
+ outputTypes["whittaker"] = tempOutNames;
+ outputTypes["sharednseqs"] = tempOutNames;
+ outputTypes["ochiai"] = tempOutNames;
+ outputTypes["anderberg"] = tempOutNames;
+ outputTypes["kulczynski"] = tempOutNames;
+ outputTypes["kulczynskicody"] = tempOutNames;
+ outputTypes["lennon"] = tempOutNames;
+ outputTypes["morisitahorn"] = tempOutNames;
+ outputTypes["braycurtis"] = tempOutNames;
+ outputTypes["odum"] = tempOutNames;
+ outputTypes["canberra"] = tempOutNames;
+ outputTypes["structeuclidean"] = tempOutNames;
+ outputTypes["structchord"] = tempOutNames;
+ outputTypes["hellinger"] = tempOutNames;
+ outputTypes["manhattan"] = tempOutNames;
+ outputTypes["structpearson"] = tempOutNames;
+ outputTypes["soergel"] = tempOutNames;
+ outputTypes["spearman"] = tempOutNames;
+ outputTypes["structkulczynski"] = tempOutNames;
+ outputTypes["structchi2"] = tempOutNames;
+ outputTypes["speciesprofile"] = tempOutNames;
+ outputTypes["hamming"] = tempOutNames;
+ outputTypes["gower"] = tempOutNames;
+ outputTypes["memchi2"] = tempOutNames;
+ outputTypes["memchord"] = tempOutNames;
+ outputTypes["memeuclidean"] = tempOutNames;
+ outputTypes["mempearson"] = tempOutNames;
+
+ }
+ catch(exception& e) {
+ m->errorOut(e, "CollectSharedCommand", "CollectSharedCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+CollectSharedCommand::CollectSharedCommand(string option) {
+ try {
+ abort = false; calledHelp = false;