X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=degapseqscommand.cpp;h=7fd2803a4ec6c5e578d7b180a9e08fda1af33385;hb=348de0f8b17d84ede77081dcf67bd6ef43496677;hp=2514ae1a21bd491ffb924700b226b103ea2ca839;hpb=191ae1be0679d5cf4eda950b3b1bf26fb7dd503d;p=mothur.git diff --git a/degapseqscommand.cpp b/degapseqscommand.cpp index 2514ae1..7fd2803 100644 --- a/degapseqscommand.cpp +++ b/degapseqscommand.cpp @@ -25,8 +25,7 @@ vector DegapSeqsCommand::getValidParameters(){ //********************************************************************************************************************** DegapSeqsCommand::DegapSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; } @@ -61,10 +60,10 @@ vector DegapSeqsCommand::getRequiredFiles(){ //*************************************************************************************************************** DegapSeqsCommand::DegapSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -189,7 +188,7 @@ DegapSeqsCommand::~DegapSeqsCommand(){ /* do nothing */ } int DegapSeqsCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } for (int s = 0; s < fastaFileNames.size(); s++) { @@ -220,6 +219,13 @@ int DegapSeqsCommand::execute(){ if (m->control_pressed) { outputTypes.clear(); remove(degapFile.c_str()); for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } return 0; } } + //set fasta file as new current fastafile + string current = ""; + itTypes = outputTypes.find("fasta"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setFastaFile(current); } + } + m->mothurOutEndLine(); m->mothurOut("Output File Name: "); m->mothurOutEndLine(); for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }