X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=collectsharedcommand.cpp;h=baebeb16298b28c3cd6372fe06a2de547e7bfbdc;hb=529ec122f7cac4af987e121d150b878d7c7a0d5d;hp=f3a320b89e0695483a5124b6336d68cf89179293;hpb=0ca63a8165baa0afa459e644ebe140ba496d5ba0;p=mothur.git diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index f3a320b..baebeb1 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -98,6 +98,64 @@ string CollectSharedCommand::getHelpString(){ } } //********************************************************************************************************************** +string CollectSharedCommand::getOutputFileNameTag(string type, string inputName=""){ + try { + string outputFileName = ""; + map >::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; @@ -288,122 +346,122 @@ CollectSharedCommand::CollectSharedCommand(string option) { for (int i=0; i