X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=seqsummarycommand.cpp;h=c328a041267d01e21ed2e99780f18de486571685;hb=957d67f7d8bbadfd2930de061e89fd9b149270fd;hp=1ea58c584054b9b4b5944db18d198fd49e78cc51;hpb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc;p=mothur.git diff --git a/seqsummarycommand.cpp b/seqsummarycommand.cpp index 1ea58c5..c328a04 100644 --- a/seqsummarycommand.cpp +++ b/seqsummarycommand.cpp @@ -45,6 +45,26 @@ string SeqSummaryCommand::getHelpString(){ exit(1); } } +//********************************************************************************************************************** +string SeqSummaryCommand::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 == "summary") { outputFileName = "summary"; } + 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, "SeqSummaryCommand", "getOutputFileNameTag"); + exit(1); + } +} //********************************************************************************************************************** SeqSummaryCommand::SeqSummaryCommand(){ @@ -155,7 +175,7 @@ int SeqSummaryCommand::execute(){ //set current fasta to fastafile m->setFastaFile(fastafile); - string summaryFile = outputDir + m->getSimpleName(fastafile) + ".summary"; + string summaryFile = outputDir + m->getRootName(m->getSimpleName(fastafile)) + getOutputFileNameTag("summary"); int numSeqs = 0;