X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=validcalculator.cpp;fp=validcalculator.cpp;h=c0e5eed7d014f96c2ebb4b39ea8aa6e1c793b8e6;hb=f15f7092c97277337d4fdd9ef674015c15a13220;hp=25efa1f2fc784f2fca37e3a478fc2740507df8ab;hpb=5c5b831cf797385966dacb7a94c0ed63f3753a7c;p=mothur.git diff --git a/validcalculator.cpp b/validcalculator.cpp index 25efa1f..c0e5eed 100644 --- a/validcalculator.cpp +++ b/validcalculator.cpp @@ -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 {