X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=secondarystructurecommand.cpp;h=c9002cab4a458c1ef9fbb3a2acb85706e01513dc;hb=4169642e8a8d45f71a4a7241ee02f1b1aae29520;hp=c08ee6ab2d512b56c6d39fa2a1290ab12da22bde;hpb=260ae19c36cb11a53ddc5a75b5e507f8dd8b31d6;p=mothur.git diff --git a/secondarystructurecommand.cpp b/secondarystructurecommand.cpp index c08ee6a..c9002ca 100644 --- a/secondarystructurecommand.cpp +++ b/secondarystructurecommand.cpp @@ -10,15 +10,62 @@ #include "secondarystructurecommand.h" #include "sequence.hpp" +//********************************************************************************************************************** +vector AlignCheckCommand::getValidParameters(){ + try { + string Array[] = {"fasta","map", "outputdir","inputdir"}; + vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); + return myArray; + } + catch(exception& e) { + m->errorOut(e, "AlignCheckCommand", "getValidParameters"); + exit(1); + } +} +//********************************************************************************************************************** +AlignCheckCommand::AlignCheckCommand(){ + try { + abort = true; calledHelp = true; + vector tempOutNames; + outputTypes["aligncheck"] = tempOutNames; + } + catch(exception& e) { + m->errorOut(e, "AlignCheckCommand", "AlignCheckCommand"); + exit(1); + } +} +//********************************************************************************************************************** +vector AlignCheckCommand::getRequiredParameters(){ + try { + string Array[] = {"fasta","map"}; + vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); + return myArray; + } + catch(exception& e) { + m->errorOut(e, "AlignCheckCommand", "getRequiredParameters"); + exit(1); + } +} +//********************************************************************************************************************** +vector AlignCheckCommand::getRequiredFiles(){ + try { + vector myArray; + return myArray; + } + catch(exception& e) { + m->errorOut(e, "AlignCheckCommand", "getRequiredFiles"); + exit(1); + } +} //********************************************************************************************************************** AlignCheckCommand::AlignCheckCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; haderror = 0; //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 @@ -36,6 +83,10 @@ AlignCheckCommand::AlignCheckCommand(string option) { if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; } } + //initialize outputTypes + vector tempOutNames; + outputTypes["aligncheck"] = tempOutNames; + //if the user changes the input directory command factory will send this info to us in the output parameter string inputDir = validParameter.validFile(parameters, "inputdir", false); if (inputDir == "not found"){ inputDir = ""; } @@ -103,7 +154,7 @@ void AlignCheckCommand::help(){ int AlignCheckCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //get secondary structure info. readMap(); @@ -140,7 +191,7 @@ int AlignCheckCommand::execute(){ m->mothurOutEndLine(); m->mothurOut("Output File Name: "); m->mothurOutEndLine(); - m->mothurOut(outfile); m->mothurOutEndLine(); + m->mothurOut(outfile); m->mothurOutEndLine(); outputNames.push_back(outfile); outputTypes["aligncheck"].push_back(outfile); m->mothurOutEndLine(); return 0;