]> git.donarmstrong.com Git - mothur.git/blobdiff - pipelinepdscommand.cpp
testing 1.14.0
[mothur.git] / pipelinepdscommand.cpp
index 46081df5466b74ff03e9384cefcbee4ca82997a6..2bbf2234e6a1e99cf0c15975c54eba842281fe84 100644 (file)
@@ -238,6 +238,8 @@ int PipelineCommand::execute(){
        try {
                if (abort == true) { return 0; }
                
+               int start = time(NULL);
+               
                if (pipeFilename == "") { 
                        createPatsPipeline(); 
                        
@@ -279,6 +281,8 @@ int PipelineCommand::execute(){
                
                if (m->control_pressed) { return 0; }
                
+               m->mothurOut("It took " + toString(time(NULL) - start) + " secs to run the pipeline analysis."); m->mothurOutEndLine(); m->mothurOutEndLine();
+               
                m->mothurOutEndLine();
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }
@@ -371,8 +375,11 @@ bool PipelineCommand::checkForValidAndRequiredParameters(string name, string opt
                                itMade = mothurMadeFiles.find(it->first);
                                
                                if (itMade == mothurMadeFiles.end()) {  
-                                       m->mothurOut("You have the " + it->first + " listed as a mothurmade file for the " + name + " command, but it seems mothur will not make that file in your current pipeline, please correct."); m->mothurOutEndLine();
-                                       return true;
+                                       if ((name == "align.seqs") && (it->first == "candidate")) {} //do nothing about candidate
+                                       else {
+                                               m->mothurOut("You have the " + it->first + " listed as a mothurmade file for the " + name + " command, but it seems mothur will not make that file in your current pipeline, please correct."); m->mothurOutEndLine();
+                                               return true;
+                                       }
                                }
                        }
                }
@@ -532,18 +539,23 @@ bool PipelineCommand::fillInMothurMade(string& options, map<string, vector<strin
                
                //fill in mothurmade filenames
                for (it = parameters.begin(); it != parameters.end(); it++) { 
+                       string paraType = it->first;
+                       
                        if (it->second == "mothurmade") {
-                               itMade = mothurMadeFiles.find(it->first);
+                               
+                               if (it->first == "candidate") { paraType = "fasta"; }
+                       
+                               itMade = mothurMadeFiles.find(paraType);
                                
                                if (itMade == mothurMadeFiles.end()) { 
-                                       m->mothurOut("Looking for a mothurmade " + it->first + " file, but it seems mothur has not made that file type in your current pipeline, please correct."); m->mothurOutEndLine();
+                                       m->mothurOut("Looking for a mothurmade " + paraType + " file, but it seems mothur has not made that file type in your current pipeline, please correct."); m->mothurOutEndLine();
                                        return true;
                                }else{
                                        vector<string> temp = itMade->second;
                                        
                                        if (temp.size() > 1) {
                                                //ask user which file to use
-                                               m->mothurOut("More than one file has been created for the " + it->first + " parameter. "); m->mothurOutEndLine();
+                                               m->mothurOut("More than one file has been created for the " + paraType + " parameter. "); m->mothurOutEndLine();
                                                for (int i = 0; i < temp.size(); i++) {
                                                        m->mothurOut(toString(i) + " - " + temp[i]); m->mothurOutEndLine();
                                                }
@@ -554,7 +566,7 @@ bool PipelineCommand::fillInMothurMade(string& options, map<string, vector<strin
                                                
                                                if ((num < 0) || (num > (temp.size()-1))) { m->mothurOut("Not a valid response, quitting."); m->mothurOutEndLine(); return true; }
                                                else {
-                                                       parameters[it->first] = temp[num];
+                                                       parameters[paraType] = temp[num];
                                                }
                                
                                                //clears buffer so next command doesn't have error
@@ -562,15 +574,15 @@ bool PipelineCommand::fillInMothurMade(string& options, map<string, vector<strin
                                                getline(cin, s);
                                                
                                        }else if (temp.size() == 0){
-                                               m->mothurOut("Sorry, we seem to think you created a " + it->first + " file, but it seems mothur doesn't have a filename."); m->mothurOutEndLine();
+                                               m->mothurOut("Sorry, we seem to think you created a " + paraType + " file, but it seems mothur doesn't have a filename."); m->mothurOutEndLine();
                                                return true;
                                        }else{
-                                               parameters[it->first] = temp[0];
+                                               parameters[paraType] = temp[0];
                                        }
                                }
                        }
                        
-                       options += it->first + "=" + parameters[it->first] + ", ";
+                       options += it->first + "=" + parameters[paraType] + ", ";
                }
                
                //rip off extra comma
@@ -595,7 +607,7 @@ void PipelineCommand::createPatsPipeline(){
                //trim.seqs command
                string fastaFile = m->getRootName(m->getSimpleName(sffFile)) + "fasta";
                string qualFile = m->getRootName(m->getSimpleName(sffFile)) + "qual";
-               thisCommand = "trim.seqs(processors=" + toString(processors) + ", fasta=" + fastaFile + ", allfiles=F, maxambig=0, maxhomop=8, flip=T, bdiffs=1, pdiffs=2, qwindowaverage=35, qwindowsize=50, oligos=" + oligosFile + ", qfile=" + qualFile + ")";
+               thisCommand = "trim.seqs(processors=" + toString(processors) + ", fasta=" + fastaFile + ", allfiles=T, maxambig=0, maxhomop=8, flip=T, bdiffs=1, pdiffs=2, qwindowaverage=35, qwindowsize=50, oligos=" + oligosFile + ", qfile=" + qualFile + ")";
                commands.push_back(thisCommand);
                
                //unique.seqs
@@ -613,7 +625,7 @@ void PipelineCommand::createPatsPipeline(){
                
                //screen.seqs
                fastaFile = m->getRootName(m->getSimpleName(fastaFile)) + "align";
-               thisCommand = "screen.seqs(processors=" + toString(processors) + ", fasta=" + fastaFile + ", name=" + nameFile + "group=" + groupFile + ", optimize=end-minlength)";
+               thisCommand = "screen.seqs(processors=" + toString(processors) + ", fasta=" + fastaFile + ", name=" + nameFile + "group=" + groupFile + ", optimize=end-minlength)";
                commands.push_back(thisCommand);
                
                //chimera.slayer
@@ -625,7 +637,6 @@ void PipelineCommand::createPatsPipeline(){
                
                //remove.seqs
                string accnosFile = m->getRootName(m->getSimpleName(fastaFile))  + "slayer.accnos";
-               fastaFile = m->getRootName(m->getSimpleName(fastaFile)) + "slayer.chimeras";
                thisCommand = "remove.seqs(fasta=" + fastaFile + ", name=" + nameFile + ", group=" + groupFile + ", accnos=" + accnosFile + ", dups=T)";
                commands.push_back(thisCommand);