]> git.donarmstrong.com Git - mothur.git/blobdiff - seqsummarycommand.cpp
added pipeline commands which involved change to command factory and command class...
[mothur.git] / seqsummarycommand.cpp
index a47364adf9cf436a6f780f541f1fcfbf6bf3ef04..7d074c4e05d441d350d552d2eb3796007191943a 100644 (file)
 #include "seqsummarycommand.h"
 #include "sequence.hpp"
 
+//**********************************************************************************************************************
+vector<string> SeqSummaryCommand::getValidParameters(){        
+       try {
+               string Array[] =  {"fasta","processors","outputdir","inputdir"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SeqSummaryCommand", "getValidParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+SeqSummaryCommand::SeqSummaryCommand(){        
+       try {
+               //initialize outputTypes
+               vector<string> tempOutNames;
+               outputTypes["summary"] = tempOutNames;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SeqSummaryCommand", "SeqSummaryCommand");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> SeqSummaryCommand::getRequiredParameters(){     
+       try {
+               string Array[] =  {"fasta"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SeqSummaryCommand", "getRequiredParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> SeqSummaryCommand::getRequiredFiles(){  
+       try {
+               vector<string> myArray;
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SeqSummaryCommand", "getRequiredFiles");
+               exit(1);
+       }
+}
 //***************************************************************************************************************
 
 SeqSummaryCommand::SeqSummaryCommand(string option)  {
@@ -49,6 +96,10 @@ SeqSummaryCommand::SeqSummaryCommand(string option)  {
                                }
                        }
                        
+                       //initialize outputTypes
+                       vector<string> tempOutNames;
+                       outputTypes["summary"] = tempOutNames;
+                       
                        //check for required parameters
                        fastafile = validParameter.validFile(parameters, "fasta", true);
                        if (fastafile == "not open") { abort = true; }
@@ -289,7 +340,7 @@ int SeqSummaryCommand::execute(){
                
                m->mothurOutEndLine();
                m->mothurOut("Output File Name: "); m->mothurOutEndLine();
-               m->mothurOut(summaryFile); m->mothurOutEndLine();       
+               m->mothurOut(summaryFile); m->mothurOutEndLine();       outputNames.push_back(summaryFile); outputTypes["summary"].push_back(summaryFile);
                m->mothurOutEndLine();
                
                #ifdef USE_MPI