]> git.donarmstrong.com Git - mothur.git/blobdiff - libshuffcommand.cpp
minor mods to seq.error
[mothur.git] / libshuffcommand.cpp
index dd3a65d5eba509888d26f6f1fd57124ab33333b3..c993a06282d4abec617318d87ec9ec18bb64c5e2 100644 (file)
@@ -56,7 +56,7 @@ string LibShuffCommand::getHelpString(){
                helpString += "Example libshuff(groups=A-B-C, iters=500, form=discrete, step=0.01, cutOff=2.0).\n";
                helpString += "The default value for groups is all the groups in your groupfile, iters is 10000, cutoff is 1.0, form is integral and step is 0.01.\n";
                helpString += "The libshuff command output two files: .coverage and .slsummary their descriptions are in the manual.\n";
-               helpString += "Note: No spaces between parameter labels (i.e. iters), '=' and parameters (i.e.yourIters).\n\n";
+               helpString += "Note: No spaces between parameter labels (i.e. iters), '=' and parameters (i.e.yourIters).\n";
                return helpString;
        }
        catch(exception& e) {
@@ -86,6 +86,7 @@ LibShuffCommand::LibShuffCommand(string option)  {
                
                //allow user to run help
                if(option == "help") { help(); abort = true; calledHelp = true; }
+               else if(option == "citation") { citation(); abort = true; calledHelp = true;}
                
                else {
                        vector<string> myArray = setParameters();
@@ -137,7 +138,7 @@ LibShuffCommand::LibShuffCommand(string option)  {
                                        m->mothurOut("You must provide a phylip file."); m->mothurOutEndLine(); 
                                        abort = true;
                                } 
-                       }       
+                       }else { m->setPhylipFile(phylipfile); } 
                        
                        //check for required parameters
                        groupfile = validParameter.validFile(parameters, "group", true);
@@ -149,7 +150,7 @@ LibShuffCommand::LibShuffCommand(string option)  {
                                        m->mothurOut("You must provide a group file."); m->mothurOutEndLine(); 
                                        abort = true;
                                } 
-                       }       
+                       }else { m->setGroupFile(groupfile); }   
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  
@@ -242,7 +243,11 @@ int LibShuffCommand::execute(){
                
                        
                setGroups();                                                            //set the groups to be analyzed and sorts them
-                       
+               
+               if (numGroups < 2) { m->mothurOut("[ERROR]: libshuff requires at least 2 groups, you only have " + toString(numGroups) + ", aborting."); m->mothurOutEndLine(); m->control_pressed = true; }
+               
+               if (m->control_pressed) { delete groupMap; delete matrix; return 0; }
+               
                /********************************************************************************************/
                //this is needed because when we read the matrix we sort it into groups in alphabetical order
                //the rest of the command and the classes used in this command assume specific order