X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rarefactcommand.cpp;fp=rarefactcommand.cpp;h=612e3b4d2a8d1632e1c0f44937be52ce84d28fec;hb=49d2b7459c5027557564b21e9487dadafbbbdc96;hp=0fdd0798e2cdda014a6cc568d3a1c895362c3158;hpb=ee8403d4eb5760187d62b42a9cf4272de8fc0ec4;p=mothur.git diff --git a/rarefactcommand.cpp b/rarefactcommand.cpp index 0fdd079..612e3b4 100644 --- a/rarefactcommand.cpp +++ b/rarefactcommand.cpp @@ -74,6 +74,39 @@ string RareFactCommand::getHelpString(){ exit(1); } } +//********************************************************************************************************************** +string RareFactCommand::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 == "rarefaction") { outputFileName = "rarefaction"; } + else if (type == "r_chao") { outputFileName = "r_chao"; } + else if (type == "r_ace") { outputFileName = "r_ace"; } + else if (type == "r_jack") { outputFileName = "r_jack"; } + else if (type == "r_shannon") { outputFileName = "r_shannon"; } + else if (type == "r_shannoneven") { outputFileName = "r_shannoneven"; } + else if (type == "r_smithwilson") { outputFileName = "r_smithwilson"; } + else if (type == "r_npshannon") { outputFileName = "r_npshannon"; } + else if (type == "r_simpson") { outputFileName = "r_simpson"; } + else if (type == "r_simpsoneven") { outputFileName = "r_simpsoneven"; } + else if (type == "r_invsimpson") { outputFileName = "r_invsimpson"; } + else if (type == "r_bootstrap") { outputFileName = "r_bootstrap"; } + else if (type == "r_coverage") { outputFileName = "r_coverage"; } + else if (type == "r_nseqs") { outputFileName = "r_nseqs"; } + 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, "RareFactCommand", "getOutputFileNameTag"); + exit(1); + } +} //********************************************************************************************************************** RareFactCommand::RareFactCommand(){ @@ -305,52 +338,52 @@ int RareFactCommand::execute(){ for (i=0; i 1) { file2Group[outputNames.size()-1] = groups[p]; } }