X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=makefastqcommand.cpp;h=c6dcf2c83092303abdd685848efe9c875ca75976;hb=49d2b7459c5027557564b21e9487dadafbbbdc96;hp=0f6e030bb0d1fec3f7cf99614fa0827c66de2bb5;hpb=ee8403d4eb5760187d62b42a9cf4272de8fc0ec4;p=mothur.git diff --git a/makefastqcommand.cpp b/makefastqcommand.cpp index 0f6e030..c6dcf2c 100644 --- a/makefastqcommand.cpp +++ b/makefastqcommand.cpp @@ -46,6 +46,26 @@ string MakeFastQCommand::getHelpString(){ } } //********************************************************************************************************************** +string MakeFastQCommand::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 == "fastq") { outputFileName = "fastq"; } + 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, "MakeFastQCommand", "getOutputFileNameTag"); + exit(1); + } +} +//********************************************************************************************************************** MakeFastQCommand::MakeFastQCommand(){ try { abort = true; calledHelp = true; @@ -145,7 +165,7 @@ int MakeFastQCommand::execute(){ if (abort == true) { if (calledHelp) { return 0; } return 2; } - string outputFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "fastq"; + string outputFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + getOutputFileNameTag("fastq"); outputNames.push_back(outputFile); outputTypes["fastq"].push_back(outputFile); ofstream out;