X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=parsesffcommand.cpp;h=c636ec99221d874ec6b497e2ae3965fd353c8dc0;hp=03d8e96d44308c6a07eaba10344d8fce860e3943;hb=8bc3e5b38c2317a1715f53be22fa96455868c281;hpb=f663afa231c9bc1b5e18e0ea3bdd2b2ee784f5b2 diff --git a/parsesffcommand.cpp b/parsesffcommand.cpp index 03d8e96..c636ec9 100644 --- a/parsesffcommand.cpp +++ b/parsesffcommand.cpp @@ -10,6 +10,53 @@ #include "parsesffcommand.h" #include "sequence.hpp" +//********************************************************************************************************************** +vector ParseSFFCommand::getValidParameters(){ + try { + string Array[] = {"sff", "oligos", "minlength", "outputdir", "inputdir"}; + vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); + return myArray; + } + catch(exception& e) { + m->errorOut(e, "ParseSFFCommand", "getValidParameters"); + exit(1); + } +} +//********************************************************************************************************************** +ParseSFFCommand::ParseSFFCommand(){ + try { + //initialize outputTypes + vector tempOutNames; + outputTypes["flow"] = tempOutNames; + } + catch(exception& e) { + m->errorOut(e, "ParseSFFCommand", "ParseSFFCommand"); + exit(1); + } +} +//********************************************************************************************************************** +vector ParseSFFCommand::getRequiredParameters(){ + try { + string Array[] = {"sff"}; + vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); + return myArray; + } + catch(exception& e) { + m->errorOut(e, "ParseSFFCommand", "getRequiredParameters"); + exit(1); + } +} +//********************************************************************************************************************** +vector ParseSFFCommand::getRequiredFiles(){ + try { + vector myArray; + return myArray; + } + catch(exception& e) { + m->errorOut(e, "ParseSFFCommand", "getRequiredFiles"); + exit(1); + } +} //********************************************************************************************************************** ParseSFFCommand::ParseSFFCommand(string option){ @@ -36,6 +83,10 @@ ParseSFFCommand::ParseSFFCommand(string option){ if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; } } + //initialize outputTypes + vector tempOutNames; + outputTypes["flow"] = 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 = ""; } @@ -115,7 +166,7 @@ int ParseSFFCommand::execute(){ } else{ flowFileNames.push_back(new ofstream((outputDir + m->getRootName(m->getSimpleName(sffFile)) + "flow").c_str(), ios::ate)); - outputNames.push_back((outputDir + m->getRootName(m->getSimpleName(sffFile)) + "flow")); + outputNames.push_back((outputDir + m->getRootName(m->getSimpleName(sffFile)) + "flow")); outputTypes["flow"].push_back((outputDir + m->getRootName(m->getSimpleName(sffFile)) + "flow")); } for(int i=0;icontrol_pressed) { for(int i=0;iclose(); } return 0; } + if (m->control_pressed) { outputTypes.clear(); for(int i=0;iclose(); } return 0; } // ofstream fastaFile; // m->openOutputFile(m->getRootName(sffFile) + "fasta", fastaFile); @@ -151,7 +202,7 @@ int ParseSFFCommand::execute(){ for(int i=0;icontrol_pressed) { for(int i=0;iclose(); } return 0; } + if (m->control_pressed) { outputTypes.clear(); for(int i=0;iclose(); } return 0; } inSFF >> seqName; seqName = seqName.substr(1); @@ -282,6 +333,7 @@ void ParseSFFCommand::getOligos(vector& outSFFFlowVec){ outSFFFlowVec.push_back(new ofstream((outputDir + m->getRootName(m->getSimpleName(sffFile)) + group + ".flow").c_str(), ios::ate)); outputNames.push_back((outputDir + m->getRootName(m->getSimpleName(sffFile)) + group + "flow")); + outputTypes["flow"].push_back((outputDir + m->getRootName(m->getSimpleName(sffFile)) + group + "flow")); } } m->gobble(inOligos);