]> git.donarmstrong.com Git - mothur.git/blobdiff - validcalculator.cpp
added heatmap.sim command and changed heatmap to heatmap.bin
[mothur.git] / validcalculator.cpp
index 25efa1f2fc784f2fca37e3a478fc2740507df8ab..c0e5eed7d014f96c2ebb4b39ea8aa6e1c793b8e6 100644 (file)
@@ -24,6 +24,7 @@ ValidCalculators::ValidCalculators() {
                 initialBoot();
                 initialDistance();
                 initialMatrix();
+                initialHeat();
        }
        catch(exception& e) {
                cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function ValidCalculator. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
@@ -158,6 +159,17 @@ bool ValidCalculators::isValidCalculator(string parameter, string calculator) {
                                }
                                cout << endl;
                                return false; }
+               }else if (parameter == "heat") {
+                       //is it valid
+                       if ((heat.find(calculator)) != (heat.end())) {
+                               return true;
+                       }else { 
+                               cout << calculator << " is not a valid estimator for the heatmap.sim command and will be disregarded. Valid estimators are ";
+                               for (it = heat.begin(); it != heat.end(); it++) {
+                                       cout << it->first << ", ";
+                               }
+                               cout << endl;
+                               return false; }
                }else if (parameter == "boot") {
                        //is it valid
                        if ((boot.find(calculator)) != (boot.end())) {
@@ -442,6 +454,30 @@ void ValidCalculators::initialTreeGroups() {
                exit(1);
        }       
 }
+/********************************************************************/
+void ValidCalculators::initialHeat() {
+       try {   
+               heat["jabund"]                          = "jabund";
+               heat["sorabund"]                        = "sorabund";
+               heat["jclass"]                          = "jclass";
+               heat["sorclass"]                        = "sorclass";
+               heat["jest"]                            = "jest";
+               heat["sorest"]                          = "sorest";
+               heat["thetayc"]                         = "thetayc";
+               heat["thetan"]                          = "thetan";
+               heat["morisitahorn"]            = "morisitahorn";
+               heat["braycurtis"]                      = "braycurtis";
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialHeat. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the ValidCalculator class function initialHeat. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }       
+}
+
 /********************************************************************/
 void ValidCalculators::initialMatrix() {
        try {