X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=validcalculator.cpp;h=f8c7cc3352e9281defb720c24d15ebda4337a44d;hb=df905918ace8537273616b4120d404ebd29dc9cc;hp=c0e5eed7d014f96c2ebb4b39ea8aa6e1c793b8e6;hpb=f15f7092c97277337d4fdd9ef674015c15a13220;p=mothur.git diff --git a/validcalculator.cpp b/validcalculator.cpp index c0e5eed..f8c7cc3 100644 --- a/validcalculator.cpp +++ b/validcalculator.cpp @@ -12,6 +12,8 @@ /********************************************************************/ ValidCalculators::ValidCalculators() { try { + m = MothurOut::getInstance(); + initialSingle(); initialShared(); initialRarefaction(); @@ -27,13 +29,9 @@ ValidCalculators::ValidCalculators() { 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"; + m->errorOut(e, "ValidCalculator", "ValidCalculator"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function ValidCalculator. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ @@ -50,11 +48,11 @@ bool ValidCalculators::isValidCalculator(string parameter, string calculator) { if ((single.find(calculator)) != (single.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the collect.single command and will be disregarded. Valid estimators are "; + m->mothurOut(calculator + " is not a valid estimator for the collect.single command and will be disregarded. Valid estimators are "); for (it = single.begin(); it != single.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } //are you looking for a calculator for a shared parameter }else if (parameter == "shared") { @@ -62,11 +60,11 @@ bool ValidCalculators::isValidCalculator(string parameter, string calculator) { if ((shared.find(calculator)) != (shared.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the collect.shared command and will be disregarded. Valid estimators are "; + m->mothurOut(calculator + " is not a valid estimator for the collect.shared command and will be disregarded. Valid estimators are "); for (it = shared.begin(); it != shared.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } //are you looking for a calculator for a rarefaction parameter }else if (parameter == "rarefaction") { @@ -74,11 +72,11 @@ bool ValidCalculators::isValidCalculator(string parameter, string calculator) { if ((rarefaction.find(calculator)) != (rarefaction.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the rarefaction.single command and will be disregarded. Valid estimators are "; + m->mothurOut(calculator + " is not a valid estimator for the rarefaction.single command and will be disregarded. Valid estimators are "); for (it = rarefaction.begin(); it != rarefaction.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } //are you looking for a calculator for a summary parameter }else if (parameter == "summary") { @@ -86,11 +84,11 @@ bool ValidCalculators::isValidCalculator(string parameter, string calculator) { if ((summary.find(calculator)) != (summary.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the summary.shared command and will be disregarded. Valid estimators are "; + m->mothurOut(calculator + " is not a valid estimator for the summary.shared command and will be disregarded. Valid estimators are "); for (it = summary.begin(); it != summary.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } //are you looking for a calculator for a sharedsummary parameter }else if (parameter == "sharedsummary") { @@ -98,112 +96,108 @@ bool ValidCalculators::isValidCalculator(string parameter, string calculator) { if ((sharedsummary.find(calculator)) != (sharedsummary.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the summary.shared command and will be disregarded. Valid estimators are "; + m->mothurOut(calculator + " is not a valid estimator for the summary.shared command and will be disregarded. Valid estimators are "); for (it = sharedsummary.begin(); it != sharedsummary.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } }else if (parameter == "sharedrarefaction") { //is it valid if ((sharedrarefaction.find(calculator)) != (sharedrarefaction.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the rarefaction.shared command and will be disregarded. Valid estimator is "; + m->mothurOut(calculator + " is not a valid estimator for the rarefaction.shared command and will be disregarded. Valid estimator is "); for (it = sharedrarefaction.begin(); it != sharedrarefaction.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } }else if (parameter == "vennsingle") { //is it valid if ((vennsingle.find(calculator)) != (vennsingle.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the venn command in single mode and will be disregarded. Valid estimators are "; + m->mothurOut(calculator + " is not a valid estimator for the venn command in single mode and will be disregarded. Valid estimators are "); for (it = vennsingle.begin(); it != vennsingle.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } }else if (parameter == "vennshared") { //is it valid if ((vennshared.find(calculator)) != (vennshared.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the venn command in shared mode and will be disregarded. Valid estimators are "; + m->mothurOut(calculator + " is not a valid estimator for the venn command in shared mode and will be disregarded. Valid estimators are "); for (it = vennshared.begin(); it != vennshared.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } }else if (parameter == "treegroup") { //is it valid if ((treegroup.find(calculator)) != (treegroup.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the tree.shared command and will be disregarded. Valid estimators are "; + m->mothurOut(calculator + " is not a valid estimator for the tree.shared command and will be disregarded. Valid estimators are "); for (it = treegroup.begin(); it != treegroup.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } }else if (parameter == "matrix") { //is it valid if ((matrix.find(calculator)) != (matrix.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the matrix.output command and will be disregarded. Valid estimators are "; + m->mothurOut(calculator + " is not a valid estimator for the matrix.output command and will be disregarded. Valid estimators are "); for (it = matrix.begin(); it != matrix.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); 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 "; + m->mothurOut(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 << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } }else if (parameter == "boot") { //is it valid if ((boot.find(calculator)) != (boot.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the bootstrap.shared command and will be disregarded. Valid estimators are "; + m->mothurOut(calculator + " is not a valid estimator for the bootstrap.shared command and will be disregarded. Valid estimators are "); for (it = boot.begin(); it != boot.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } }else if (parameter == "distance") { //is it valid if ((distance.find(calculator)) != (distance.end())) { return true; }else { - cout << calculator << " is not a valid estimator for the distance command and will be disregarded. Valid calculators are "; + m->mothurOut(calculator + " is not a valid estimator for the distance command and will be disregarded. Valid calculators are "); for (it = distance.begin(); it != distance.end(); it++) { - cout << it->first << ", "; + m->mothurOut(it->first + ", "); } - cout << endl; + m->mothurOutEndLine(); return false; } //not a valid parameter }else { return false; } } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function isValidCalculator. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "isValidCalculator"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function isValidCalculator. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ @@ -215,11 +209,16 @@ void ValidCalculators::initialSingle() { single["jack"] = "jack"; single["shannon"] = "shannon"; single["npshannon"] = "npshannon"; + single["shannoneven"] = "shannoneven"; + single["smithwilson"] = "smithwilson"; + single["heip"] = "heip"; single["simpson"] = "simpson"; + single["simpsoneven"] = "simpsoneven"; + single["invsimpson"] = "invsimpson"; single["bergerparker"] = "bergerparker"; single["bootstrap"] = "bootstrap"; single["geometric"] = "geometric"; - single["logseries"] = "logseries"; + single["logseries"] = "logseries"; single["qstat"] = "qstat"; single["bstick"] = "bstick"; single["goodscoverage"] = "goodscoverage"; @@ -232,13 +231,9 @@ void ValidCalculators::initialSingle() { single["default"] = "default"; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialSingle. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialSingle"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialSingle. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ @@ -265,16 +260,30 @@ void ValidCalculators::initialShared() { shared["lennon"] = "lennon"; shared["morisitahorn"] = "morisitahorn"; shared["braycurtis"] = "braycurtis"; + shared["odum"] = "odum"; + shared["canberra"] = "canberra"; + shared["structeuclidean"] = "structeuclidean"; + shared["structchord"] = "structchord"; + shared["hellinger"] = "hellinger"; + shared["manhattan"] = "manhattan"; + shared["structpearson"] = "structpearson"; + shared["soergel"] = "soergel"; + shared["spearman"] = "spearman"; + shared["structkulczynski"] = "structkulczynski"; + shared["structchi2"] = "structchi2"; + shared["speciesprofile"] = "speciesprofile"; + shared["hamming"] = "hamming"; + shared["gower"] = "gower"; + shared["memchi2"] = "memchi2"; + shared["memchord"] = "memchord"; + shared["memeuclidean"] = "memeuclidean"; + shared["mempearson"] = "mempearson"; shared["default"] = "default"; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialShared. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialShared"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialShared. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ @@ -285,21 +294,22 @@ void ValidCalculators::initialRarefaction() { rarefaction["ace"] = "ace"; rarefaction["jack"] = "jack"; rarefaction["shannon"] = "shannon"; + rarefaction["smithwilson"] = "smithwilson"; + rarefaction["heip"] = "heip"; rarefaction["npshannon"] = "npshannon"; + rarefaction["shannoneven"] = "shannoneven"; rarefaction["simpson"] = "simpson"; + rarefaction["invsimpson"] = "invsimpson"; + rarefaction["simpsoneven"] = "simpsoneven"; rarefaction["bootstrap"] = "bootstrap"; rarefaction["nseqs"] = "nseqs"; rarefaction["coverage"] = "coverage"; rarefaction["default"] = "default"; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialRarefaction. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialRarefaction"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialRarefaction. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ @@ -311,8 +321,13 @@ void ValidCalculators::initialSummary() { summary["ace"] = "ace"; summary["jack"] = "jack"; summary["shannon"] = "shannon"; + summary["heip"] = "heip"; + summary["shannoneven"] = "shannoneven"; + summary["smithwilson"] = "smithwilson"; + summary["invsimpson"] = "invsimpson"; summary["npshannon"] = "npshannon"; summary["simpson"] = "simpson"; + summary["simpsoneven"] = "simpsoneven"; summary["bergerparker"] = "bergerparker"; summary["geometric"] = "geometric"; summary["bootstrap"] = "bootstrap"; @@ -329,13 +344,9 @@ void ValidCalculators::initialSummary() { summary["default"] = "default"; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialSummary. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialSummary"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialSummary. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ @@ -345,7 +356,7 @@ void ValidCalculators::initialSharedSummary() { sharedsummary["sharedchao"] = "sharedchao"; sharedsummary["sharedace"] = "sharedace"; sharedsummary["jabund"] = "jabund"; - sharedsummary["sorabund"] = "sorabund"; + sharedsummary["sorabund"] = "sorabund"; sharedsummary["jclass"] = "jclass"; sharedsummary["sorclass"] = "sorclass"; sharedsummary["jest"] = "jest"; @@ -362,16 +373,30 @@ void ValidCalculators::initialSharedSummary() { sharedsummary["lennon"] = "lennon"; sharedsummary["morisitahorn"] = "morisitahorn"; sharedsummary["braycurtis"] = "braycurtis"; + sharedsummary["odum"] = "odum"; + sharedsummary["canberra"] = "canberra"; + sharedsummary["structeuclidean"] = "structeuclidean"; + sharedsummary["structchord"] = "structchord"; + sharedsummary["hellinger"] = "hellinger"; + sharedsummary["manhattan"] = "manhattan"; + sharedsummary["structpearson"] = "structpearson"; + sharedsummary["structkulczynski"] = "structkulczynski"; + sharedsummary["structchi2"] = "structchi2"; + sharedsummary["soergel"] = "soergel"; + sharedsummary["spearman"] = "spearman"; + sharedsummary["speciesprofile"] = "speciesprofile"; + sharedsummary["hamming"] = "hamming"; + sharedsummary["gower"] = "gower"; + sharedsummary["memchi2"] = "memchi2"; + sharedsummary["memchord"] = "memchord"; + sharedsummary["memeuclidean"] = "memeuclidean"; + sharedsummary["mempearson"] = "mempearson"; sharedsummary["default"] = "default"; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialSharedSummary. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialSharedSummary"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialSharedSummary. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } @@ -384,13 +409,9 @@ void ValidCalculators::initialSharedRarefact() { sharedrarefaction["default"] = "default"; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialSharedRarefact. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialSharedRarefact"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialSharedRarefact. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } @@ -404,13 +425,9 @@ void ValidCalculators::initialVennSingle() { vennsingle["default"] = "default"; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialSingle. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialVennSingle"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialSingle. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ @@ -422,18 +439,17 @@ void ValidCalculators::initialVennShared() { vennshared["default"] = "default"; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialSingle. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialVennShared"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialSingle. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ void ValidCalculators::initialTreeGroups() { try { + treegroup["sharedsobs"] = "sharedsobs"; + treegroup["sharedchao"] = "sharedchao"; + treegroup["sharedace"] = "sharedace"; treegroup["jabund"] = "jabund"; treegroup["sorabund"] = "sorabund"; treegroup["jclass"] = "jclass"; @@ -442,17 +458,40 @@ void ValidCalculators::initialTreeGroups() { 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) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialTreeGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialTreeGroups"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialTreeGroups. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ void ValidCalculators::initialHeat() { @@ -469,37 +508,59 @@ void ValidCalculators::initialHeat() { 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"; + m->errorOut(e, "ValidCalculator", "initialHeat"); 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 { - matrix["jabund"] = "jabund"; + matrix["sharedsobs"] = "sharedsobs"; + matrix["sharedchao"] = "sharedchao"; + matrix["sharedace"] = "sharedace"; + matrix["jabund"] = "jabund"; matrix["sorabund"] = "sorabund"; - matrix["jclass"] = "jclass"; + matrix["jclass"] = "jclass"; matrix["sorclass"] = "sorclass"; matrix["jest"] = "jest"; - matrix["sorest"] = "sorest"; + matrix["sorest"] = "sorest"; matrix["thetayc"] = "thetayc"; - matrix["thetan"] = "thetan"; + 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["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) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialMatrix. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialMatrix"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialMatrix. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ @@ -517,13 +578,9 @@ void ValidCalculators::initialBoot() { boot["braycurtis"] = "braycurtis"; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialBoot. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialBoot"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialBoot. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ void ValidCalculators::initialDistance() { @@ -533,13 +590,9 @@ void ValidCalculators::initialDistance() { distance["onegap"] = "onegap"; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function initialDistance. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "initialDistance"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function initialDistance. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } } /********************************************************************/ @@ -591,6 +644,10 @@ void ValidCalculators::printCalc(string parameter, ostream& out) { 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 << ", "; @@ -604,14 +661,9 @@ void ValidCalculators::printCalc(string parameter, ostream& out) { out << endl; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ValidCalculator class Function printCalc. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ValidCalculator", "printCalc"); exit(1); } - catch(...) { - cout << "An unknown error has occurred in the ValidCalculator class function printCalc. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - } /********************************************************************/