]> git.donarmstrong.com Git - mothur.git/blobdiff - summarysharedcommand.cpp
added pipeline commands which involved change to command factory and command class...
[mothur.git] / summarysharedcommand.cpp
index 3069a6ffbd8a43f1a0d3c956d3d3190769404a07..99c62a53c0580d51859673288a7955b7347442ae 100644 (file)
 #include "sharedjackknife.h"
 #include "whittaker.h"
 
-
+//**********************************************************************************************************************
+vector<string> SummarySharedCommand::getValidParameters(){     
+       try {
+               string Array[] =  {"label","calc","groups","all","outputdir","distance","inputdir", "processors"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SummarySharedCommand", "getValidParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+SummarySharedCommand::SummarySharedCommand(){  
+       try {
+               //initialize outputTypes
+               vector<string> tempOutNames;
+               outputTypes["summary"] = tempOutNames;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SummarySharedCommand", "SummarySharedCommand");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> SummarySharedCommand::getRequiredParameters(){  
+       try {
+               vector<string> myArray;
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SummarySharedCommand", "getRequiredParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> SummarySharedCommand::getRequiredFiles(){       
+       try {
+               string Array[] =  {"shared"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "SummarySharedCommand", "getRequiredFiles");
+               exit(1);
+       }
+}
 //**********************************************************************************************************************
 
 SummarySharedCommand::SummarySharedCommand(string option)  {
@@ -66,6 +112,10 @@ SummarySharedCommand::SummarySharedCommand(string option)  {
                                 m->mothurOut("You must read a list and a group, or a shared before you can use the summary.shared command."); m->mothurOutEndLine(); abort = true; 
                        }
                        
+                       //initialize outputTypes
+                       vector<string> tempOutNames;
+                       outputTypes["summary"] = tempOutNames;
+                       
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  
                                outputDir = ""; 
@@ -398,8 +448,8 @@ int SummarySharedCommand::execute(){
                m->mothurOutEndLine();
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(outputFileName); m->mothurOutEndLine();    
-               if (mult) { m->mothurOut(outAllFileName); m->mothurOutEndLine();        }
-               for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }
+               if (mult) { m->mothurOut(outAllFileName); m->mothurOutEndLine();        outputTypes["summary"].push_back(outAllFileName); }
+               for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    } outputTypes["summary"].push_back(outputFileName);
                m->mothurOutEndLine();
 
                return 0;