]> git.donarmstrong.com Git - mothur.git/blobdiff - makegroupcommand.cpp
fixed get.lienage and remove.lineage bug with confidence scores that are floats....
[mothur.git] / makegroupcommand.cpp
index 12be82690fc7068e4d713353ee84d79aa6330ba7..8adfe09f7db893f6f8366f7cbecd18639b72f42c 100644 (file)
@@ -25,8 +25,7 @@ vector<string> MakeGroupCommand::getValidParameters(){
 //**********************************************************************************************************************
 MakeGroupCommand::MakeGroupCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["group"] = tempOutNames;
        }
@@ -63,10 +62,10 @@ vector<string> MakeGroupCommand::getRequiredFiles(){
 MakeGroupCommand::MakeGroupCommand(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 {
                        
@@ -198,7 +197,7 @@ void MakeGroupCommand::help(){
 
 int MakeGroupCommand::execute(){
        try {
-               if (abort == true) { return 0;  }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                if (outputDir == "") { outputDir = m->hasPath(fastaFileNames[0]); }
                        
@@ -230,7 +229,14 @@ int MakeGroupCommand::execute(){
                m->mothurOutEndLine();
                m->mothurOut("Output File Name: " + filename); m->mothurOutEndLine(); outputNames.push_back(filename); outputTypes["group"].push_back(filename); 
                m->mothurOutEndLine();
-
+               
+               //set group file as new current groupfile
+               string current = "";
+               itTypes = outputTypes.find("group");
+               if (itTypes != outputTypes.end()) {
+                       if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setGroupFile(current); }
+               }
+               
                return 0;
        }
        catch(exception& e) {