X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=getrelabundcommand.cpp;fp=getrelabundcommand.cpp;h=7c623fbfd8ced3cd88bff70b3579e893d6e6cfa0;hb=49d2b7459c5027557564b21e9487dadafbbbdc96;hp=8c8d8e1539b8be7e76656be1304ee1f1f01f9a02;hpb=ee8403d4eb5760187d62b42a9cf4272de8fc0ec4;p=mothur.git diff --git a/getrelabundcommand.cpp b/getrelabundcommand.cpp index 8c8d8e1..7c623fb 100644 --- a/getrelabundcommand.cpp +++ b/getrelabundcommand.cpp @@ -49,6 +49,26 @@ string GetRelAbundCommand::getHelpString(){ } } //********************************************************************************************************************** +string GetRelAbundCommand::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 == "relabund") { outputFileName = "relabund" ; } + 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, "GetRelAbundCommand", "getOutputFileNameTag"); + exit(1); + } +} +//********************************************************************************************************************** GetRelAbundCommand::GetRelAbundCommand(){ try { abort = true; calledHelp = true; @@ -154,7 +174,7 @@ int GetRelAbundCommand::execute(){ if (abort == true) { if (calledHelp) { return 0; } return 2; } - string outputFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "relabund"; + string outputFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + getOutputFileNameTag("relabund"); ofstream out; m->openOutputFile(outputFileName, out); out.setf(ios::fixed, ios::floatfield); out.setf(ios::showpoint);