]> git.donarmstrong.com Git - mothur.git/blobdiff - amovacommand.cpp
mods to seq.errror
[mothur.git] / amovacommand.cpp
index a88baf0a673d9e3c8cd34313962d808448ce7f54..e1a161d0889e313ba018c6cccb8bdc6d9f233083 100644 (file)
@@ -66,8 +66,7 @@ vector<string> AmovaCommand::getValidParameters(){
 //**********************************************************************************************************************
 AmovaCommand::AmovaCommand(){  
        try {
-               abort = true;
-               //initialize outputTypes
+               abort = true; calledHelp = true; 
                vector<string> tempOutNames;
                outputTypes["amova"] = tempOutNames;
        }
@@ -105,12 +104,12 @@ vector<string> AmovaCommand::getRequiredFiles(){
 AmovaCommand::AmovaCommand(string option) {
        try {
                globaldata = GlobalData::getInstance();
-               abort = false;
+               abort = false; calledHelp = false;   
                allLines = 1;
                labels.clear();
                
                //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
@@ -173,7 +172,7 @@ AmovaCommand::AmovaCommand(string option) {
                                        m->mothurOut("You must read a list and a group, a shared file or provide a distance matrix before you can use the amova command."); m->mothurOutEndLine(); abort = true; 
                                }
                        }else { sharedfile = globaldata->getSharedFile(); } 
-                       
+                               
                        //use distance matrix if one is provided
                        if ((sharedfile != "") && (phylipfile != "")) { sharedfile = ""; }
                        
@@ -319,12 +318,13 @@ AmovaCommand::AmovaCommand(string option) {
 
 void AmovaCommand::help(){
        try {
+               m->mothurOut("Referenced: Anderson MJ (2001). A new method for non-parametric multivariate analysis of variance. Austral Ecol 26: 32-46.\n");
                m->mothurOut("The amova command can only be executed after a successful read.otu command of a list and group or shared file, or by providing a phylip formatted distance matrix.\n");
                m->mothurOut("The amova command outputs a .amova file. \n");
                m->mothurOut("The amova command parameters are phylip, iters, groups, label, design, sets and processors.  The design parameter is required.\n");
                m->mothurOut("The design parameter allows you to assign your groups to sets when you are running amova. It is required. \n");
                m->mothurOut("The design file looks like the group file.  It is a 2 column tab delimited file, where the first column is the group name and the second column is the set the group belongs to.\n");
-               m->mothurOut("The sets parameter allows you to specify which of the sets in your designfile you would like to analyze. The set names are separated by dashes. THe default is all sets in the designfile.\n");
+               m->mothurOut("The sets parameter allows you to specify which of the sets in your designfile you would like to analyze. The set names are separated by dashes. THe default is all sets in the designfile. To run the pairwise comparisons of all sets use sets=all.\n");
                m->mothurOut("The iters parameter allows you to set number of randomization for the P value.  The default is 1000. \n");
                m->mothurOut("The groups parameter allows you to specify which of the groups you would like included. The group names are separated by dashes. groups=all will find all pairwise comparisons. \n");
                m->mothurOut("The label parameter allows you to select what distance levels you would like, and are also separated by dashes.\n");
@@ -349,7 +349,7 @@ AmovaCommand::~AmovaCommand(){}
 int AmovaCommand::execute(){
        try {
                
-               if (abort == true) { return 0; }
+               if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
                
                //read design file
                designMap = new GroupMap(designfile);
@@ -412,7 +412,7 @@ int AmovaCommand::execute(){
                                out.close();
                        }
                        
-                       InputData input("sharedfile", sharedfile);
+                       InputData input(sharedfile, "sharedfile");
                        vector<SharedRAbundVector*> lookup = input.getSharedRAbundVectors();
                        string lastLabel = lookup[0]->getLabel();