]> git.donarmstrong.com Git - mothur.git/blobdiff - commandfactory.cpp
test
[mothur.git] / commandfactory.cpp
index ddb70290936458fdbc5ca85d550fff1bc1d6ea96..c787d07e066ae08db298efb849966dcf0782113d 100644 (file)
@@ -134,7 +134,7 @@ 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";
 }
@@ -155,11 +155,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,7 +217,7 @@ 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                                                                                    {       command = new NoCommand(optionString);                                  }