]> git.donarmstrong.com Git - mothur.git/blobdiff - setcurrentcommand.cpp
added method parameter to get.oturep. options method=abundance or distance. default...
[mothur.git] / setcurrentcommand.cpp
index 9d277f3e71ae3635d5f14cf468822fa3e1181e8c..9d59696ba2f47157dd059c066af108d6bb76e731 100644 (file)
@@ -18,6 +18,7 @@ vector<string> SetCurrentCommand::setParameters(){
         CommandParameter pbiom("biom", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pbiom);
                CommandParameter pphylip("phylip", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pphylip);
                CommandParameter pcolumn("column", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pcolumn);
+        CommandParameter psummary("summary", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(psummary);
                CommandParameter pfasta("fasta", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pfasta);
                CommandParameter pname("name", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pname);
                CommandParameter pgroup("group", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pgroup);
@@ -54,7 +55,7 @@ string SetCurrentCommand::getHelpString(){
        try {
                string helpString = "";
                helpString += "The set.current command allows you to set the current files saved by mothur.\n";
-               helpString += "The set.current command parameters are: clear, phylip, column, list, rabund, sabund, name, group, design, order, tree, shared, ordergroup, relabund, fasta, qfile, sff, oligos, accnos, biom, count and taxonomy.\n";
+               helpString += "The set.current command parameters are: clear, phylip, column, list, rabund, sabund, name, group, design, order, tree, shared, ordergroup, relabund, fasta, qfile, sff, oligos, accnos, biom, count, summary and taxonomy.\n";
                helpString += "The clear paramter is used to indicate which file types you would like to clear values for, multiple types can be separated by dashes.\n";
                helpString += "The set.current command should be in the following format: \n";
                helpString += "set.current(fasta=yourFastaFile) or set.current(fasta=amazon.fasta, clear=name-accnos)\n";
@@ -290,6 +291,14 @@ SetCurrentCommand::SetCurrentCommand(string option)  {
                                        //if the user has not given a path then, add inputdir. else leave path alone.
                                        if (path == "") {       parameters["biom"] = inputDir + it->second;             }
                                }
+                
+                it = parameters.find("summary");
+                               //user has given a template file
+                               if(it != parameters.end()){
+                                       path = m->hasPath(it->second);
+                                       //if the user has not given a path then, add inputdir. else leave path alone.
+                                       if (path == "") {       parameters["summary"] = inputDir + it->second;          }
+                               }
                        }
                        
                        //check for parameters
@@ -402,6 +411,12 @@ SetCurrentCommand::SetCurrentCommand(string option)  {
                        if (biomfile == "not open") { m->mothurOut("Ignoring: " + parameters["biom"]); m->mothurOutEndLine(); biomfile = ""; }
                        else if (biomfile == "not found") {  biomfile = "";  }  
                        if (biomfile != "") { m->setBiomFile(biomfile); }
+            
+            summaryfile = validParameter.validFile(parameters, "summary", true);
+                       if (summaryfile == "not open") { m->mothurOut("Ignoring: " + parameters["summary"]); m->mothurOutEndLine(); summaryfile = ""; }
+                       else if (summaryfile == "not found") {  summaryfile = "";  }
+                       if (summaryfile != "") { m->setSummaryFile(summaryfile); }
+
                        
                        processors = validParameter.validFile(parameters, "processors", false);
                        if (processors == "not found") {  processors = "1";  }  
@@ -476,6 +491,8 @@ int SetCurrentCommand::execute(){
                                        m->setBiomFile("");
                 }else if (types[i] == "count") {
                                        m->setCountTableFile("");
+                }else if (types[i] == "summary") {
+                                       m->setSummaryFile("");
                                }else if (types[i] == "processors") {
                                        m->setProcessors("1");
                                }else if (types[i] == "all") {