]> git.donarmstrong.com Git - mothur.git/blobdiff - chimeraccodecommand.cpp
fixed clearcut version bug, added group count output to get.groups and remove.groups
[mothur.git] / chimeraccodecommand.cpp
index 286681a51d78de92590d7677a2e67a3c70fcaec1..457eaf314bf304fe3d7f9e5eec67509f07236a35 100644 (file)
@@ -25,6 +25,7 @@ vector<string> ChimeraCcodeCommand::getValidParameters(){
 //**********************************************************************************************************************
 ChimeraCcodeCommand::ChimeraCcodeCommand(){    
        try {
+               abort = true; calledHelp = true;
                vector<string> tempOutNames;
                outputTypes["chimera"] = tempOutNames;
                outputTypes["mapinfo"] = tempOutNames;
@@ -61,10 +62,10 @@ vector<string> ChimeraCcodeCommand::getRequiredFiles(){
 //***************************************************************************************************************
 ChimeraCcodeCommand::ChimeraCcodeCommand(string option)  {
        try {
-               abort = false;
+               abort = false; calledHelp = false;   
                
                //allow user to run help
-               if(option == "help") { help(); abort = true; }
+               if(option == "help") { help(); abort = true; calledHelp = true; }
                
                else {
                        //valid paramters for this command
@@ -239,7 +240,7 @@ ChimeraCcodeCommand::~ChimeraCcodeCommand(){        /*      do nothing      */      }
 int ChimeraCcodeCommand::execute(){
        try{
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                for (int s = 0; s < fastaFileNames.size(); s++) {
                                
@@ -272,7 +273,7 @@ int ChimeraCcodeCommand::execute(){
                        
                #ifdef USE_MPI
                
-                               int pid, end, numSeqsPerProcessor; 
+                               int pid, numSeqsPerProcessor; 
                                int tag = 2001;
                                vector<unsigned long int> MPIPos;
                                                                
@@ -434,6 +435,14 @@ int ChimeraCcodeCommand::execute(){
                        m->mothurOutEndLine(); m->mothurOut("It took " + toString(time(NULL) - start) + " secs to check " + toString(numSeqs) + " sequences."); m->mothurOutEndLine();
                }
                
+               
+               //set accnos file as new current accnosfile
+               string current = "";
+               itTypes = outputTypes.find("accnos");
+               if (itTypes != outputTypes.end()) {
+                       if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setAccnosFile(current); }
+               }
+               
                m->mothurOutEndLine();
                m->mothurOut("Output File Names: "); m->mothurOutEndLine();
                for (int i = 0; i < outputNames.size(); i++) {  m->mothurOut(outputNames[i]); m->mothurOutEndLine();    }       
@@ -550,7 +559,7 @@ int ChimeraCcodeCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_File
                                        if (m->control_pressed) {       delete candidateSeq; return 1;  }
                
                                        //print results
-                                       bool isChimeric = chimera->print(outMPI, outAccMPI);
+                                       chimera->print(outMPI, outAccMPI);
                                }
                        }
                        delete candidateSeq;