]> git.donarmstrong.com Git - mothur.git/blobdiff - clusterfragmentscommand.cpp
added pipeline commands which involved change to command factory and command class...
[mothur.git] / clusterfragmentscommand.cpp
index 0c4dec353a97d3e02bccd69f5af5126e051da617..b5681db57833ae10e9bf665b53e77bea363473c2 100644 (file)
@@ -25,6 +25,54 @@ inline bool comparePriority(seqRNode first, seqRNode second) {
        return better; 
 }
 //**********************************************************************************************************************
+vector<string> ClusterFragmentsCommand::getValidParameters(){  
+       try {
+               string AlignArray[] =  {"fasta","name","outputdir","inputdir"};
+               vector<string> myArray (AlignArray, AlignArray+(sizeof(AlignArray)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "ClusterFragmentsCommand", "getValidParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+ClusterFragmentsCommand::ClusterFragmentsCommand(){    
+       try {
+               //initialize outputTypes
+               vector<string> tempOutNames;
+               outputTypes["fasta"] = tempOutNames;
+               outputTypes["name"] = tempOutNames;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "ClusterFragmentsCommand", "ClusterFragmentsCommand");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> ClusterFragmentsCommand::getRequiredParameters(){       
+       try {
+               string Array[] =  {"fasta"};
+               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "ClusterFragmentsCommand", "getRequiredParameters");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
+vector<string> ClusterFragmentsCommand::getRequiredFiles(){    
+       try {
+               vector<string> myArray;
+               return myArray;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "ClusterFragmentsCommand", "getRequiredFiles");
+               exit(1);
+       }
+}
+//**********************************************************************************************************************
 ClusterFragmentsCommand::ClusterFragmentsCommand(string option) {
        try {
                abort = false;
@@ -48,6 +96,11 @@ ClusterFragmentsCommand::ClusterFragmentsCommand(string option) {
                                if (validParameter.isValidParameter(it2->first, myArray, it2->second) != true) {  abort = true;  }
                        }
                        
+                       //initialize outputTypes
+                       vector<string> tempOutNames;
+                       outputTypes["fasta"] = tempOutNames;
+                       outputTypes["name"] = 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 = "";          }
@@ -193,6 +246,7 @@ int ClusterFragmentsCommand::execute(){
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                m->mothurOut(newFastaFile); m->mothurOutEndLine();      
                m->mothurOut(newNamesFile); m->mothurOutEndLine();      
+               outputNames.push_back(newFastaFile);  outputNames.push_back(newNamesFile); outputTypes["fasta"].push_back(newFastaFile); outputTypes["name"].push_back(newNamesFile);
                m->mothurOutEndLine();
 
                return 0;