]> git.donarmstrong.com Git - mothur.git/blobdiff - commandfactory.cpp
added parse.list command
[mothur.git] / commandfactory.cpp
index ddb70290936458fdbc5ca85d550fff1bc1d6ea96..baef2164942f5e637f43d8b3b6431091ef13ca63 100644 (file)
@@ -64,6 +64,7 @@
 #include "pcacommand.h"
 #include "otuhierarchycommand.h"
 #include "setdircommand.h"
+#include "parselistscommand.h"
 
 /*******************************************************/
 
@@ -134,9 +135,11 @@ CommandFactory::CommandFactory(){
        commands["phylotype"]                   = "phylotype";
        commands["mgcluster"]                   = "mgcluster";
        commands["pre.cluster"]                 = "pre.cluster";
-       commands["pca"]                                 = "pca";
+       commands["pcoa"]                                = "pcoa";
        commands["otu.hierarchy"]               = "otu.hierarchy";
        commands["set.dir"]                             = "set.dir";
+       commands["merge.files"]                 = "merge.files";
+       commands["parse.list"]                  = "parse.list";
 }
 /***********************************************************/
 
@@ -155,11 +158,16 @@ Command* CommandFactory::getCommand(string commandName, string optionString){
                delete command;   //delete the old command
                
                //user has opted to redirect output from dir where input files are located to some other place
-               if (outputDir != "") { optionString += ", outputdir=" + outputDir; }
+               if (outputDir != "") { 
+                       if (optionString != "") { optionString += ", outputdir=" + outputDir; }
+                       else { optionString += "outputdir=" + outputDir; }
+               }
                
                //user has opted to redirect input from dir where mothur.exe is located to some other place
-               if (inputDir != "") { optionString += ", inputdir=" + inputDir; }
-
+               if (inputDir != "") { 
+                       if (optionString != "") { optionString += ", inputdir=" + inputDir; }
+                       else { optionString += "inputdir=" + inputDir; }
+               }
                
                if(commandName == "read.dist")                                  {       command = new ReadDistCommand(optionString);                    }
                else if(commandName == "read.otu")                              {       command = new ReadOtuCommand(optionString);                             }
@@ -212,9 +220,10 @@ Command* CommandFactory::getCommand(string commandName, string optionString){
                else if(commandName == "phylotype")                             {       command = new PhylotypeCommand(optionString);                   }
                else if(commandName == "mgcluster")                             {       command = new MGClusterCommand(optionString);                   }
                else if(commandName == "pre.cluster")                   {       command = new PreClusterCommand(optionString);                  }
-               else if(commandName == "pca")                                   {       command = new PCACommand(optionString);                                 }
+               else if(commandName == "pcoa")                                  {       command = new PCACommand(optionString);                                 }
                else if(commandName == "otu.hierarchy")                 {       command = new OtuHierarchyCommand(optionString);                }
-               else if(commandName == "set.dir")                               {       command = new SetDirectoryCommand(optionString);        }
+               else if(commandName == "set.dir")                               {       command = new SetDirectoryCommand(optionString);                }
+               else if(commandName == "parse.list")                    {       command = new ParseListCommand(optionString);                   }
                else                                                                                    {       command = new NoCommand(optionString);                                  }
 
                return command;