X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rarefactsharedcommand.cpp;fp=rarefactsharedcommand.cpp;h=a312df07ec1508d1d257bc443ac895467be61525;hb=49d2b7459c5027557564b21e9487dadafbbbdc96;hp=fecf972c7ec99f80dda6f921706c6916a9d1679f;hpb=ee8403d4eb5760187d62b42a9cf4272de8fc0ec4;p=mothur.git diff --git a/rarefactsharedcommand.cpp b/rarefactsharedcommand.cpp index fecf972..a312df0 100644 --- a/rarefactsharedcommand.cpp +++ b/rarefactsharedcommand.cpp @@ -62,7 +62,27 @@ string RareFactSharedCommand::getHelpString(){ exit(1); } } - +//********************************************************************************************************************** +string RareFactSharedCommand::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 == "sharedrarefaction") { outputFileName = "shared.rarefaction"; } + else if (type == "sharedr_nseqs") { outputFileName = "shared.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, "RareFactSharedCommand", "getOutputFileNameTag"); + exit(1); + } +} //********************************************************************************************************************** RareFactSharedCommand::RareFactSharedCommand(){ try { @@ -286,11 +306,11 @@ int RareFactSharedCommand::process(GroupMap& designMap, string thisSet){ for (int i=0; i