]> git.donarmstrong.com Git - mothur.git/blobdiff - setcurrentcommand.cpp
added current as option is lists of file names, processors now outputted with current...
[mothur.git] / setcurrentcommand.cpp
index 16685b24c7c706d0c6cf5aa9d15da2e08e863112..75d1f943e37a157f66d82987a74b527a0bc5cec3 100644 (file)
@@ -12,7 +12,9 @@
 //**********************************************************************************************************************
 vector<string> SetCurrentCommand::setParameters(){     
        try {
-                       
+               
+               CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors);
+               CommandParameter pflow("flow", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pflow);
                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 pfasta("fasta", "InputTypes", "", "", "none", "none", "none",false,false); parameters.push_back(pfasta);
@@ -261,6 +263,14 @@ SetCurrentCommand::SetCurrentCommand(string option)  {
                                        //if the user has not given a path then, add inputdir. else leave path alone.
                                        if (path == "") {       parameters["taxonomy"] = inputDir + it->second;         }
                                }
+                               
+                               it = parameters.find("flow");
+                               //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["flow"] = inputDir + it->second;             }
+                               }
                        }
                        
                        //check for parameters
@@ -359,6 +369,15 @@ SetCurrentCommand::SetCurrentCommand(string option)  {
                        else if (taxonomyfile == "not found") {  taxonomyfile = "";  }  
                        if (taxonomyfile != "") { m->setTaxonomyFile(taxonomyfile); }
                        
+                       flowfile = validParameter.validFile(parameters, "flow", true);
+                       if (flowfile == "not open") { m->mothurOut("Ignoring: " + parameters["flow"]); m->mothurOutEndLine(); flowfile = ""; }
+                       else if (flowfile == "not found") {  flowfile = "";  }  
+                       if (flowfile != "") { m->setFlowFile(flowfile); }
+                       
+                       processors = validParameter.validFile(parameters, "processors", false);
+                       if (processors == "not found") {  processors = "1";  }  
+                       if (processors != "") { m->setProcessors(processors); }
+                       
                        clearTypes = validParameter.validFile(parameters, "clear", false);                      
                        if (clearTypes == "not found") { clearTypes = ""; }
                        else { m->splitAtDash(clearTypes, types);       }
@@ -422,6 +441,10 @@ int SetCurrentCommand::execute(){
                                        m->setAccnosFile("");
                                }else if (types[i] == "taxonomy") {
                                        m->setTaxonomyFile("");
+                               }else if (types[i] == "flow") {
+                                       m->setFlowFile("");
+                               }else if (types[i] == "processors") {
+                                       m->setProcessors("1");
                                }else if (types[i] == "all") {
                                        m->clearCurrentFiles();
                                }else {