X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=validcalculator.cpp;h=0ffa216411077e94a02f69fada77e9421e2d378b;hb=25cde7ff05bbe741da1712f2c740e0bc8706e523;hp=8659be3d85f1956f788f13355bea8f9fa67e5052;hpb=20a2d0350a737a434c89f303662d64a8eeea7b05;p=mothur.git diff --git a/validcalculator.cpp b/validcalculator.cpp index 8659be3..0ffa216 100644 --- a/validcalculator.cpp +++ b/validcalculator.cpp @@ -42,37 +42,72 @@ bool ValidCalculators::isValidCalculator(string parameter, string calculator) { //is it valid if ((single.find(calculator)) != (single.end())) { return true; - }else { cout << calculator << " is not a valid single estimator. Valid single estimators are collect-chao-ace-jack-bootstrap-shannon-npshannon-simpson." << endl; return false; } + }else { + cout << 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 << ", "; + } + cout << endl; + return false; } //are you looking for a calculator for a shared parameter }else if (parameter == "shared") { //is it valid if ((shared.find(calculator)) != (shared.end())) { return true; - }else { cout << calculator << " is not a valid shared estimator. Valid shared estimators are sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN." << endl; return false; } + }else { + cout << 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 << ", "; + } + cout << endl; + return false; } //are you looking for a calculator for a rarefaction parameter }else if (parameter == "rarefaction") { //is it valid if ((rarefaction.find(calculator)) != (rarefaction.end())) { return true; - }else { cout << calculator << " is not a valid rarefaction estimator. Valid rarefaction estimators are rarefaction-rchao-race-rjack-rbootstrap-rshannon-rnpshannon-rsimpson." << endl; return false; } + }else { + cout << 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 << ", "; + } + cout << endl; + return false; } //are you looking for a calculator for a summary parameter }else if (parameter == "summary") { //is it valid if ((summary.find(calculator)) != (summary.end())) { return true; - }else { cout << calculator << " is not a valid summary estimator. Valid summary estimators are collect-chao-ace-jack-bootstrap-shannon-npshannon-simpson." << endl; return false; } + }else { + cout << 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 << ", "; + } + cout << endl; + return false; } //are you looking for a calculator for a sharedsummary parameter }else if (parameter == "sharedsummary") { //is it valid if ((sharedsummary.find(calculator)) != (sharedsummary.end())) { return true; - }else { cout << calculator << " is not a valid sharedsummary estimator. Valid sharedsummary estimators are: sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN." << endl; return false; } - + }else { + cout << 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 << ", "; + } + cout << endl; + return false; } }else if (parameter == "sharedrarefaction") { //is it valid if ((sharedrarefaction.find(calculator)) != (sharedrarefaction.end())) { return true; - }else { cout << calculator << " is not a valid sharedrarefaction estimator. Valid sharedrarefaction estimator is sharedobserved." << endl; return false; } + }else { + cout << 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 << ", "; + } + cout << endl; + return false; } //not a valid paramter }else { return false; } @@ -91,7 +126,7 @@ bool ValidCalculators::isValidCalculator(string parameter, string calculator) { void ValidCalculators::initialSingle() { try { - single["sobs"] = "sobs"; + single["sobs"] = "sobs"; single["chao"] = "chao"; single["ace"] = "ace"; single["jack"] = "jack"; @@ -100,6 +135,7 @@ void ValidCalculators::initialSingle() { single["simpson"] = "simpson"; single["bootstrap"] = "bootstrap"; single["default"] = "default"; + single["nseqs"] = "nseqs"; } 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"; @@ -114,16 +150,25 @@ void ValidCalculators::initialSingle() { /********************************************************************/ void ValidCalculators::initialShared() { try { - shared["sharedChao"] = "sharedChao"; - shared["sharedAce"] = "sharedAce"; - shared["sharedJabund"] = "sharedJabund"; - shared["sharedSorensonAbund"] = "sharedSorensonAbund"; - shared["sharedJclass"] = "sharedJclass"; - shared["sharedSorClass"] = "sharedSorClass"; - shared["sharedJest"] = "sharedJest"; - shared["sharedSorEst"] = "sharedSorEst"; - shared["SharedThetaYC"] = "SharedThetaYC"; - shared["SharedThetaN"] = "SharedThetaN"; + shared["sharedsobs"] = "sharedsobs"; + shared["sharedchao"] = "sharedchao"; + shared["sharedace"] = "sharedace"; + shared["sharedjabund"] = "sharedjabund"; + shared["sharedsorensonabund"] = "sharedsorensonabund"; + shared["sharedjclass"] = "sharedjclass"; + shared["sharedsorclass"] = "sharedsorclass"; + shared["sharedjest"] = "sharedjest"; + shared["sharedsorest"] = "sharedsorest"; + shared["sharedthetayc"] = "sharedthetayc"; + shared["sharedthetan"] = "sharedthetan"; + shared["sharednseqs"] = "sharednseqs"; + shared["sharedochiai"] = "sharedochiai"; + shared["sharedanderberg"] = "sharedanderberg"; + shared["sharedkulczynski"] = "sharedkulczynski"; + shared["sharedkulczynskicody"] = "sharedkulczynskicody"; + shared["sharedlennon"] = "sharedlennon"; + shared["sharedmorisitahorn"] = "sharedmorisitahorn"; + shared["sharedbraycurtis"] = "sharedbraycurtis"; shared["default"] = "default"; } catch(exception& e) { @@ -147,6 +192,7 @@ void ValidCalculators::initialRarefaction() { rarefaction["npshannon"] = "npshannon"; rarefaction["simpson"] = "simpson"; rarefaction["bootstrap"] = "bootstrap"; + rarefaction["nseqs"] = "nseqs"; rarefaction["default"] = "default"; } catch(exception& e) { @@ -171,6 +217,7 @@ void ValidCalculators::initialSummary() { summary["npshannon"] = "npshannon"; summary["simpson"] = "simpson"; summary["bootstrap"] = "bootstrap"; + summary["nseqs"] = "nseqs"; summary["default"] = "default"; } catch(exception& e) { @@ -186,16 +233,25 @@ void ValidCalculators::initialSummary() { /********************************************************************/ void ValidCalculators::initialSharedSummary() { try { - sharedsummary["sharedChao"] = "sharedChao"; - sharedsummary["sharedAce"] = "sharedAce"; - sharedsummary["sharedJabund"] = "sharedJabund"; - sharedsummary["sharedSorensonAbund"] = "sharedSorensonAbund"; - sharedsummary["sharedJclass"] = "sharedJclass"; - sharedsummary["sharedSorClass"] = "sharedSorClass"; - sharedsummary["sharedJest"] = "sharedJest"; - sharedsummary["sharedSorEst"] = "sharedSorEst"; - sharedsummary["SharedThetaYC"] = "SharedThetaYC"; - sharedsummary["SharedThetaN"] = "SharedThetaN"; + sharedsummary["sharedsobs"] = "sharedsobs"; + sharedsummary["sharedchao"] = "sharedchao"; + sharedsummary["sharedace"] = "sharedace"; + sharedsummary["sharedjabund"] = "sharedjabund"; + sharedsummary["sharedsorensonabund"] = "sharedsorensonabund"; + sharedsummary["sharedjclass"] = "sharedjclass"; + sharedsummary["sharedsorclass"] = "sharedsorclass"; + sharedsummary["sharedjest"] = "sharedjest"; + sharedsummary["sharedsorest"] = "sharedsorest"; + sharedsummary["sharedthetayc"] = "sharedthetayc"; + sharedsummary["sharedthetan"] = "sharedthetan"; + sharedsummary["sharednseqs"] = "sharednseqs"; + sharedsummary["sharedochiai"] = "sharedochiai"; + sharedsummary["sharedanderberg"] = "sharedanderberg"; + sharedsummary["sharedkulczynski"] = "sharedkulczynski"; + sharedsummary["sharedkulczynskicody"] = "sharedkulczynskicody"; + sharedsummary["sharedlennon"] = "sharedlennon"; + sharedsummary["sharedmorisitahorn"] = "sharedmorisitahorn"; + sharedsummary["sharedbraycurtis"] = "sharedbraycurtis"; sharedsummary["default"] = "default"; } catch(exception& e) { @@ -214,6 +270,7 @@ void ValidCalculators::initialSharedSummary() { void ValidCalculators::initialSharedRarefact() { try { sharedrarefaction["sharedobserved"] = "sharedobserved"; + sharedrarefaction["sharednseqs"] = "sharednseqs"; sharedrarefaction["default"] = "default"; } catch(exception& e) {