]> git.donarmstrong.com Git - mothur.git/blobdiff - rarefactsharedcommand.cpp
paralellized the indicator command
[mothur.git] / rarefactsharedcommand.cpp
index 746b09e8df8f4719f7ded9504e4f732b49fb559b..717fec2fea1fc1ba23564fc683149e38d177496e 100644 (file)
@@ -49,7 +49,7 @@ string RareFactSharedCommand::getHelpString(){
                helpString += validCalculator.printCalc("sharedrarefaction");
                helpString += "The label parameter is used to analyze specific labels in your input.\n";
                helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed.  You must enter at least 2 valid groups.\n";
-               helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n";
+               helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n";
                return helpString;
        }
        catch(exception& e) {
@@ -81,6 +81,7 @@ RareFactSharedCommand::RareFactSharedCommand(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();
@@ -123,7 +124,7 @@ RareFactSharedCommand::RareFactSharedCommand(string option)  {
                                sharedfile = m->getSharedFile(); 
                                if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }
+                       }else { m->setSharedFile(sharedfile); }
                        
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
@@ -146,6 +147,11 @@ RareFactSharedCommand::RareFactSharedCommand(string option)  {
                                 if (calc == "default")  {  calc = "sharedobserved";  }
                        }
                        m->splitAtDash(calc, Estimators);
+                       if (m->inUsersGroups("citation", Estimators)) { 
+                               ValidCalculators validCalc; validCalc.printCitations(Estimators); 
+                               //remove citation from list of calcs
+                               for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") {  Estimators.erase(Estimators.begin()+i); break; } }
+                       }
                        
                        groups = validParameter.validFile(parameters, "groups", false);                 
                        if (groups == "not found") { groups = ""; }