]> git.donarmstrong.com Git - mothur.git/blobdiff - sensspeccommand.cpp
added pipeline commands which involved change to command factory and command class...
[mothur.git] / sensspeccommand.cpp
index 8489bfefc841f6dd34fea17ef15b416e08c4c6c8..78dce1794003457a077fe993958c75909c1020a7 100644 (file)
@@ -9,6 +9,53 @@
 
 #include "sensspeccommand.h"
 
+//**********************************************************************************************************************
+vector<string> SensSpecCommand::getValidParameters(){  
+       try {
+               string Array[] =  {"list", "phylip", "column", "name", "hard", "label", "cutoff", "precision", "outputdir", "inputdir"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SensSpecCommand", "getValidParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+SensSpecCommand::SensSpecCommand(){    
+       try {
+               //initialize outputTypes
+               vector<string> tempOutNames;
+               outputTypes["sensspec"] = tempOutNames;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SensSpecCommand", "SensSpecCommand");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> SensSpecCommand::getRequiredParameters(){       
+       try {
+               string Array[] =  {"list","phylip","column","or"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SensSpecCommand", "getRequiredParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> SensSpecCommand::getRequiredFiles(){    
+       try {
+               vector<string> myArray;
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SensSpecCommand", "getRequiredFiles");
+               exit(1);
+       }
+}
 //***************************************************************************************************************
 
 SensSpecCommand::SensSpecCommand(string option)  {
@@ -38,6 +85,10 @@ SensSpecCommand::SensSpecCommand(string option)  {
                                if (validParameter.isValidParameter(it->first, myArray, it->second) != true) {  abort = true;  }
                        }
                        
+                       //initialize outputTypes
+                       vector<string> tempOutNames;
+                       outputTypes["sensspec"] = 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 = "";          }
@@ -159,6 +210,7 @@ int SensSpecCommand::execute(){
                if (abort == true) { return 0; }
 
                setUpOutput();
+               outputNames.push_back(sensSpecFileName); outputTypes["sensspec"].push_back(sensSpecFileName);
                if(format == "phylip")          {       processPhylip();        }
                else if(format == "column")     {       processColumn();        }