+/********************************************************************/
+void ValidCalculators::initialTreeGroups() {
+ try {
+ treegroup["sharedsobs"] = "sharedsobs";
+ treegroup["sharedchao"] = "sharedchao";
+ treegroup["sharedace"] = "sharedace";
+ treegroup["jabund"] = "jabund";
+ treegroup["sorabund"] = "sorabund";
+ treegroup["jclass"] = "jclass";
+ treegroup["sorclass"] = "sorclass";
+ treegroup["jest"] = "jest";
+ treegroup["sorest"] = "sorest";
+ treegroup["thetayc"] = "thetayc";
+ treegroup["thetan"] = "thetan";
+ treegroup["kstest"] = "kstest";
+ treegroup["whittaker"] = "whittaker";
+ treegroup["sharednseqs"] = "sharednseqs";
+ treegroup["ochiai"] = "ochiai";
+ treegroup["anderberg"] = "anderberg";
+ treegroup["kulczynski"] = "kulczynski";
+ treegroup["kulczynskicody"] = "kulczynskicody";
+ treegroup["lennon"] = "lennon";
+ treegroup["morisitahorn"] = "morisitahorn";
+ treegroup["braycurtis"] = "braycurtis";
+ treegroup["odum"] = "odum";
+ treegroup["canberra"] = "canberra";
+ treegroup["structeuclidean"] = "structeuclidean";
+ treegroup["structchord"] = "structchord";
+ treegroup["hellinger"] = "hellinger";
+ treegroup["manhattan"] = "manhattan";
+ treegroup["structpearson"] = "structpearson";
+ treegroup["structkulczynski"] = "structkulczynski";
+ treegroup["structchi2"] = "structchi2";
+ treegroup["soergel"] = "soergel";
+ treegroup["spearman"] = "spearman";
+ treegroup["speciesprofile"] = "speciesprofile";
+ treegroup["hamming"] = "hamming";
+ treegroup["gower"] = "gower";
+ treegroup["memchi2"] = "memchi2";
+ treegroup["memchord"] = "memchord";
+ treegroup["memeuclidean"] = "memeuclidean";
+ treegroup["mempearson"] = "mempearson";
+
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ValidCalculator", "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) {
+ m->errorOut(e, "ValidCalculator", "initialHeat");
+ exit(1);
+ }
+}
+
+/********************************************************************/
+void ValidCalculators::initialMatrix() {
+ try {
+ matrix["sharedsobs"] = "sharedsobs";
+ matrix["sharedchao"] = "sharedchao";
+ matrix["sharedace"] = "sharedace";
+ matrix["jabund"] = "jabund";
+ matrix["sorabund"] = "sorabund";
+ matrix["jclass"] = "jclass";
+ matrix["sorclass"] = "sorclass";
+ matrix["jest"] = "jest";
+ matrix["sorest"] = "sorest";
+ matrix["thetayc"] = "thetayc";
+ matrix["thetan"] = "thetan";
+ matrix["kstest"] = "kstest";
+ matrix["whittaker"] = "whittaker";
+ matrix["sharednseqs"] = "sharednseqs";
+ matrix["ochiai"] = "ochiai";
+ matrix["anderberg"] = "anderberg";
+ matrix["kulczynski"] = "kulczynski";
+ matrix["kulczynskicody"] = "kulczynskicody";
+ matrix["lennon"] = "lennon";
+ matrix["morisitahorn"] = "morisitahorn";
+ matrix["braycurtis"] = "braycurtis";
+ matrix["odum"] = "odum";
+ matrix["canberra"] = "canberra";
+ matrix["structeuclidean"] = "structeuclidean";
+ matrix["structchord"] = "structchord";
+ matrix["hellinger"] = "hellinger";
+ matrix["manhattan"] = "manhattan";
+ matrix["structpearson"] = "structpearson";
+ matrix["structkulczynski"] = "structkulczynski";
+ matrix["structchi2"] = "structchi2";
+ matrix["soergel"] = "soergel";
+ matrix["spearman"] = "spearman";
+ matrix["speciesprofile"] = "speciesprofile";
+ matrix["hamming"] = "hamming";
+ matrix["gower"] = "gower";
+ matrix["memchi2"] = "memchi2";
+ matrix["memchord"] = "memchord";
+ matrix["memeuclidean"] = "memeuclidean";
+ matrix["mempearson"] = "mempearson";
+
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ValidCalculator", "initialMatrix");
+ exit(1);
+ }
+}
+
+/********************************************************************/
+void ValidCalculators::initialBoot() {
+ try {
+ boot["jabund"] = "jabund";
+ boot["sorabund"] = "sorabund";
+ boot["jclass"] = "jclass";
+ boot["sorclass"] = "orclass";
+ boot["jest"] = "jest";
+ boot["sorest"] = "sorest";
+ boot["thetayc"] = "thetayc";
+ boot["thetan"] = "thetan";
+ boot["morisitahorn"] = "morisitahorn";
+ boot["braycurtis"] = "braycurtis";
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ValidCalculator", "initialBoot");
+ exit(1);
+ }
+}
+/********************************************************************/
+void ValidCalculators::initialDistance() {
+ try {
+ distance["nogaps"] = "nogaps";
+ distance["eachgap"] = "eachgap";
+ distance["onegap"] = "onegap";
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ValidCalculator", "initialDistance");
+ exit(1);
+ }
+}
+
+/********************************************************************/
+void ValidCalculators::printCalc(string parameter, ostream& out) {
+ try{
+ out << "The available estimators for calc are ";
+ //are you looking for a calculator for a single parameter
+ if (parameter == "single") {
+ for (it = single.begin(); it != single.end(); it++) {
+ out << it->first << ", ";
+ }
+ //are you looking for a calculator for a shared parameter
+ }else if (parameter == "shared") {
+ for (it = shared.begin(); it != shared.end(); it++) {
+ out << it->first << ", ";
+ }
+ //are you looking for a calculator for a rarefaction parameter
+ }else if (parameter == "rarefaction") {
+ for (it = rarefaction.begin(); it != rarefaction.end(); it++) {
+ out << it->first << ", ";
+ }
+ //are you looking for a calculator for a summary parameter
+ }else if (parameter == "summary") {
+ for (it = summary.begin(); it != summary.end(); it++) {
+ out << it->first << ", ";
+ }
+ //are you looking for a calculator for a sharedsummary parameter
+ }else if (parameter == "sharedsummary") {
+ for (it = sharedsummary.begin(); it != sharedsummary.end(); it++) {
+ out << it->first << ", ";
+ }
+ }else if (parameter == "sharedrarefaction") {
+ for (it = sharedrarefaction.begin(); it != sharedrarefaction.end(); it++) {
+ out << it->first << ", ";
+ }
+ }else if (parameter == "vennsingle") {
+ for (it = vennsingle.begin(); it != vennsingle.end(); it++) {
+ out << it->first << ", ";
+ }
+ }else if (parameter == "vennshared") {
+ for (it = vennshared.begin(); it != vennshared.end(); it++) {
+ out << it->first << ", ";
+ }
+ }else if (parameter == "treegroup") {
+ for (it = treegroup.begin(); it != treegroup.end(); it++) {
+ out << it->first << ", ";
+ }
+ }else if (parameter == "matrix") {
+ for (it = matrix.begin(); it != matrix.end(); it++) {
+ out << it->first << ", ";
+ }
+ }else if (parameter == "heat") {
+ for (it = heat.begin(); it != heat.end(); it++) {
+ out << it->first << ", ";
+ }
+ }else if (parameter == "boot") {
+ for (it = boot.begin(); it != boot.end(); it++) {
+ out << it->first << ", ";
+ }
+ }else if (parameter == "distance") {
+ for (it = distance.begin(); it != distance.end(); it++) {
+ out << it->first << ", ";
+ }
+ }
+
+ out << endl;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ValidCalculator", "printCalc");
+ exit(1);
+ }
+}
+/********************************************************************/
+string ValidCalculators::printCalc(string parameter) {
+ try{
+ string output = "The available estimators for calc are ";
+ //are you looking for a calculator for a single parameter
+ if (parameter == "single") {
+ for (it = single.begin(); it != single.end(); it++) {
+ output += it->first + ", ";
+ }
+ //are you looking for a calculator for a shared parameter
+ }else if (parameter == "shared") {
+ for (it = shared.begin(); it != shared.end(); it++) {
+ output += it->first + ", ";
+ }
+ //are you looking for a calculator for a rarefaction parameter
+ }else if (parameter == "rarefaction") {
+ for (it = rarefaction.begin(); it != rarefaction.end(); it++) {
+ output += it->first + ", ";
+ }
+ //are you looking for a calculator for a summary parameter
+ }else if (parameter == "summary") {
+ for (it = summary.begin(); it != summary.end(); it++) {
+ output += it->first + ", ";
+ }
+ //are you looking for a calculator for a sharedsummary parameter
+ }else if (parameter == "sharedsummary") {
+ for (it = sharedsummary.begin(); it != sharedsummary.end(); it++) {
+ output += it->first + ", ";
+ }
+ }else if (parameter == "sharedrarefaction") {
+ for (it = sharedrarefaction.begin(); it != sharedrarefaction.end(); it++) {
+ output += it->first + ", ";
+ }
+ }else if (parameter == "vennsingle") {
+ for (it = vennsingle.begin(); it != vennsingle.end(); it++) {
+ output += it->first + ", ";
+ }
+ }else if (parameter == "vennshared") {
+ for (it = vennshared.begin(); it != vennshared.end(); it++) {
+ output += it->first + ", ";
+ }
+ }else if (parameter == "treegroup") {
+ for (it = treegroup.begin(); it != treegroup.end(); it++) {
+ output += it->first + ", ";
+ }
+ }else if (parameter == "matrix") {
+ for (it = matrix.begin(); it != matrix.end(); it++) {
+ output += it->first + ", ";
+ }
+ }else if (parameter == "heat") {
+ for (it = heat.begin(); it != heat.end(); it++) {
+ output += it->first + ", ";
+ }
+ }else if (parameter == "boot") {
+ for (it = boot.begin(); it != boot.end(); it++) {
+ output += it->first + ", ";
+ }
+ }else if (parameter == "distance") {
+ for (it = distance.begin(); it != distance.end(); it++) {
+ output += it->first + ", ";
+ }
+ }
+
+ //rip off comma
+ output = output.substr(0, output.length()-1);
+ output += "\n";
+
+ return output;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ValidCalculator", "printCalc");
+ exit(1);
+ }
+}
+/********************************************************************/