]> git.donarmstrong.com Git - mothur.git/blobdiff - classifyseqscommand.cpp
added [ERROR] flag if command aborts
[mothur.git] / classifyseqscommand.cpp
index 9030948074003f663978ab10ff0128adc0ad7c37..2dfe05a05f9e267390c7e7656dee12d0ee1ab169 100644 (file)
@@ -30,8 +30,7 @@ vector<string> ClassifySeqsCommand::getValidParameters(){
 //**********************************************************************************************************************
 ClassifySeqsCommand::ClassifySeqsCommand(){    
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["taxonomy"] = tempOutNames;
                outputTypes["taxsummary"] = tempOutNames;
@@ -68,10 +67,10 @@ vector<string> ClassifySeqsCommand::getRequiredFiles(){
 //**********************************************************************************************************************
 ClassifySeqsCommand::ClassifySeqsCommand(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 {
                        
@@ -421,7 +420,7 @@ void ClassifySeqsCommand::help(){
 
 int ClassifySeqsCommand::execute(){
        try {
-               if (abort == true) {    return 0;       }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if(method == "bayesian"){       classify = new Bayesian(taxonomyFileName, templateFileName, search, kmerSize, cutoff, iters);           }
                else if(method == "knn"){       classify = new Knn(taxonomyFileName, templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch, numWanted);                               }
@@ -461,7 +460,7 @@ int ClassifySeqsCommand::execute(){
                        for (int i = 0; i < lines.size(); i++) {  delete lines[i];  }  lines.clear();
                        
 #ifdef USE_MPI 
-                               int pid, end, numSeqsPerProcessor; 
+                               int pid, numSeqsPerProcessor; 
                                int tag = 2001;
                                vector<unsigned long int> MPIPos;
                                
@@ -652,7 +651,7 @@ int ClassifySeqsCommand::execute(){
                        
                        //get maxLevel from phylotree so you know how many 'unclassified's to add
                        int maxLevel = taxaSum.getMaxLevel();
-                       
+                                                       
                        //read taxfile - this reading and rewriting is done to preserve the confidence scores.
                        string name, taxon;
                        while (!inTax.eof()) {