X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=sffinfocommand.cpp;h=207328203a24088c111054de2b157fae9235876c;hb=b1d143351bcd1b3b4a06ec525c386f161579ee32;hp=8c50247c6845867ff9f99f62760d81300d433779;hpb=86c838c428a9e7d26f902f5492738241fa72c4e7;p=mothur.git diff --git a/sffinfocommand.cpp b/sffinfocommand.cpp index 8c50247..2073282 100644 --- a/sffinfocommand.cpp +++ b/sffinfocommand.cpp @@ -82,6 +82,7 @@ SffInfoCommand::SffInfoCommand(string option) { //allow user to run help if(option == "help") { help(); abort = true; calledHelp = true; } + else if(option == "citation") { citation(); abort = true; calledHelp = true;} else { //valid paramters for this command @@ -169,7 +170,7 @@ SffInfoCommand::SffInfoCommand(string option) { //erase from file list filenames.erase(filenames.begin()+i); i--; - } + }else { m->setSFFFile(filenames[i]); } } } @@ -282,7 +283,7 @@ SffInfoCommand::SffInfoCommand(string option) { } if ((sfftxtFilename == "") && (filenames.size() == 0)) { - //if there is a current fasta file, use it + //if there is a current sff file, use it string filename = m->getSFFFile(); if (filename != "") { filenames.push_back(filename); m->mothurOut("Using " + filename + " as input file for the sff parameter."); m->mothurOutEndLine(); } else { m->mothurOut("[ERROR]: you must provide a valid sff or sfftxt file."); m->mothurOutEndLine(); abort=true; } @@ -900,13 +901,20 @@ int SffInfoCommand::parseSffTxt() { //output file names ofstream outFasta, outQual, outFlow; string outFastaFileName, outQualFileName; - string outFlowFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "flow"; + string fileRoot = m->getRootName(m->getSimpleName(sfftxtFilename)); + if (fileRoot.length() > 0) { + //rip off last . + fileRoot = fileRoot.substr(0, fileRoot.length()-1); + fileRoot = m->getRootName(fileRoot); + } + + string outFlowFileName = outputDir + fileRoot + "flow"; if (trim) { - outFastaFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "fasta"; - outQualFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "qual"; + outFastaFileName = outputDir + fileRoot + "fasta"; + outQualFileName = outputDir + fileRoot + "qual"; }else{ - outFastaFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "raw.fasta"; - outQualFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "raw.qual"; + outFastaFileName = outputDir + fileRoot + "raw.fasta"; + outQualFileName = outputDir + fileRoot + "raw.qual"; } if (fasta) { m->openOutputFile(outFastaFileName, outFasta); outputNames.push_back(outFastaFileName); outputTypes["fasta"].push_back(outFastaFileName); }