- int i;
- for (i=0; i<globaldata->Estimators.size(); i++) {
- if (validCalculator->isValidCalculator("matrix", globaldata->Estimators[i]) == true) {
- if (globaldata->Estimators[i] == "jabund") {
- matrixCalculators.push_back(new JAbund());
- }else if (globaldata->Estimators[i] == "sorabund") {
- matrixCalculators.push_back(new SorAbund());
- }else if (globaldata->Estimators[i] == "jclass") {
- matrixCalculators.push_back(new Jclass());
- }else if (globaldata->Estimators[i] == "sorclass") {
- matrixCalculators.push_back(new SorClass());
- }else if (globaldata->Estimators[i] == "jest") {
- matrixCalculators.push_back(new Jest());
- }else if (globaldata->Estimators[i] == "sorest") {
- matrixCalculators.push_back(new SorEst());
- }else if (globaldata->Estimators[i] == "thetayc") {
- matrixCalculators.push_back(new ThetaYC());
- }else if (globaldata->Estimators[i] == "thetan") {
- matrixCalculators.push_back(new ThetaN());
- }else if (globaldata->Estimators[i] == "morisitahorn") {
- matrixCalculators.push_back(new MorHorn());
- }else if (globaldata->Estimators[i] == "braycurtis") {
- matrixCalculators.push_back(new BrayCurtis());
+ //check for optional parameter and set defaults
+ // ...at some point should added some additional type checking...
+ label = validParameter.validFile(parameters, "label", false);
+ if (label == "not found") { label = ""; }
+ else {
+ if(label != "all") { splitAtDash(label, labels); allLines = 0; }
+ else { allLines = 1; }
+ }
+
+ //if the user has not specified any labels use the ones from read.otu
+ if (label == "") {
+ allLines = globaldata->allLines;
+ labels = globaldata->labels;
+ }
+
+ groups = validParameter.validFile(parameters, "groups", false);
+ if (groups == "not found") { groups = ""; }
+ else {
+ splitAtDash(groups, Groups);
+ globaldata->Groups = Groups;
+ }
+
+ calc = validParameter.validFile(parameters, "calc", false);
+ if (calc == "not found") { calc = "jclass-thetayc"; }
+ else {
+ if (calc == "default") { calc = "jclass-thetayc"; }
+ }
+ splitAtDash(calc, Estimators);
+
+ if (abort == false) {
+
+ validCalculator = new ValidCalculators();
+
+ int i;
+ for (i=0; i<Estimators.size(); i++) {
+ if (validCalculator->isValidCalculator("matrix", Estimators[i]) == true) {
+ if (Estimators[i] == "jabund") {
+ matrixCalculators.push_back(new JAbund());
+ }else if (Estimators[i] == "sorabund") {
+ matrixCalculators.push_back(new SorAbund());
+ }else if (Estimators[i] == "jclass") {
+ matrixCalculators.push_back(new Jclass());
+ }else if (Estimators[i] == "sorclass") {
+ matrixCalculators.push_back(new SorClass());
+ }else if (Estimators[i] == "jest") {
+ matrixCalculators.push_back(new Jest());
+ }else if (Estimators[i] == "sorest") {
+ matrixCalculators.push_back(new SorEst());
+ }else if (Estimators[i] == "thetayc") {
+ matrixCalculators.push_back(new ThetaYC());
+ }else if (Estimators[i] == "thetan") {
+ matrixCalculators.push_back(new ThetaN());
+ }else if (Estimators[i] == "morisitahorn") {
+ matrixCalculators.push_back(new MorHorn());
+ }else if (Estimators[i] == "braycurtis") {
+ matrixCalculators.push_back(new BrayCurtis());
+ }
+ }