]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed bug in chimera.uchime
authorwestcott <westcott>
Wed, 18 May 2011 12:32:06 +0000 (12:32 +0000)
committerwestcott <westcott>
Wed, 18 May 2011 12:32:06 +0000 (12:32 +0000)
chimeraslayercommand.cpp
chimerauchimecommand.cpp

index 097664efc2640af01a0b10cfa3bcd9efcc46d5e3..a422c8883ea9f172fe076961fa7705cb548e767e 100644 (file)
@@ -305,9 +305,10 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option)  {
                                        
                                        templatefile = validParameter.validFile(parameters, "reference", true);
                                        if (templatefile == "not open") { abort = true; }
-                                       else if (templatefile == "not found") { templatefile = "";  m->mothurOut("reference is a required parameter for the chimera.slayer command."); m->mothurOutEndLine(); abort = true;  }  
+                                       else if (templatefile == "not found") { templatefile = "";  m->mothurOut("reference is a required parameter for the chimera.slayer command, unless and namefile is given."); m->mothurOutEndLine(); abort = true;  }    
                                }
-                       }
+                       }else if (hasName) {  templatefile = "self"; }
+                       else { templatefile = "";  m->mothurOut("reference is a required parameter for the chimera.slayer command."); m->mothurOutEndLine(); abort = true;  }   
                        
                        string temp = validParameter.validFile(parameters, "processors", false);        if (temp == "not found"){       temp = m->getProcessors();      }
                        m->setProcessors(temp);
index a47aed0ca840197331cdf251ef48bcb68cf9df56..5deeff755de28c54b6f06ed2caa84482788c7d1a 100644 (file)
@@ -309,9 +309,11 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option)  {
                                        
                                        templatefile = validParameter.validFile(parameters, "reference", true);
                                        if (templatefile == "not open") { abort = true; }
-                                       else if (templatefile == "not found") { templatefile = "";  m->mothurOut("reference is a required parameter for the chimera.slayer command."); m->mothurOutEndLine(); abort = true;  }  
+                                       else if (templatefile == "not found") { templatefile = "";  m->mothurOut("reference is a required parameter for the chimera.uchime command."); m->mothurOutEndLine(); abort = true;  }  
                                }
-                       }
+                       }else if (hasName) {  templatefile = "self"; }
+                       else { templatefile = "";  m->mothurOut("reference is a required parameter for the chimera.uchime command, unless you have a namefile."); m->mothurOutEndLine(); abort = true;  }       
+
                        
                        string temp = validParameter.validFile(parameters, "processors", false);        if (temp == "not found"){       temp = m->getProcessors();      }
                        m->setProcessors(temp);
@@ -370,7 +372,7 @@ int ChimeraUchimeCommand::execute(){
                        int start = time(NULL); 
                        string nameFile = "";
                        
-                       if (templatefile == "self") { //you want to run slayer with a refernce template
+                       if (templatefile == "self") { //you want to run uchime with a refernce template
                                
                                #ifdef USE_MPI  
                                        int pid; 
@@ -694,6 +696,8 @@ int ChimeraUchimeCommand::driver(string outputFName, string filename, string acc
                for(int i = 0; i < cPara.size(); i++)  {  delete[] cPara[i];  }
                delete[] uchimeParameters; 
                
+               if (m->control_pressed) { return 0; }
+               
                //create accnos file from uchime results
                ifstream in; 
                m->openInputFile(outputFName, in);