- designfile = validParameter.validFile(parameters, "design", true);
- if (designfile == "not open") { abort = true; }
- else if (designfile == "not found") { designfile = ""; m->mothurOut("You must provide an design file."); m->mothurOutEndLine(); abort = true; }
-
- //make sure the user has already run the read.otu command
- if ((globaldata->getSharedFile() == "")) {
- if ((phylipfile == "")) {
- m->mothurOut("You must read a list and a group, a shared file or provide a distance matrix before you can use the homova command."); m->mothurOutEndLine(); abort = true;
- }
- }else { sharedfile = globaldata->getSharedFile(); }
-
- //use distance matrix if one is provided
- if ((sharedfile != "") && (phylipfile != "")) { sharedfile = ""; }
-
- //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") { m->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 {
- m->splitAtDash(groups, Groups);
- globaldata->Groups = Groups;
- }
-
- sets = validParameter.validFile(parameters, "sets", false);
- if (sets == "not found") { sets = ""; pickedGroups = false; }
- else {
- pickedGroups = true;
- m->splitAtDash(sets, Sets);
- }
-
-
- string temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; }
- convert(temp, iters);
-
- temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = "1"; }
- convert(temp, processors);
-
- vector<string> Estimators;
- calc = validParameter.validFile(parameters, "calc", false);
- if (calc == "not found") { calc = "morisitahorn"; }
- m->splitAtDash(calc, Estimators);
-
- if (abort == false) {
-
- ValidCalculators* validCalculator = new ValidCalculators();
-
- for (int i=0; i<Estimators.size(); i++) {
- if (validCalculator->isValidCalculator("treegroup", Estimators[i]) == true) {
- if (Estimators[i] == "sharedsobs") {
- calculators.push_back(new SharedSobsCS());
- }else if (Estimators[i] == "sharedchao") {
- calculators.push_back(new SharedChao1());
- }else if (Estimators[i] == "sharedace") {
- calculators.push_back(new SharedAce());
- }else if (Estimators[i] == "jabund") {
- calculators.push_back(new JAbund());
- }else if (Estimators[i] == "sorabund") {
- calculators.push_back(new SorAbund());
- }else if (Estimators[i] == "jclass") {
- calculators.push_back(new Jclass());
- }else if (Estimators[i] == "sorclass") {
- calculators.push_back(new SorClass());
- }else if (Estimators[i] == "jest") {
- calculators.push_back(new Jest());
- }else if (Estimators[i] == "sorest") {
- calculators.push_back(new SorEst());
- }else if (Estimators[i] == "thetayc") {
- calculators.push_back(new ThetaYC());
- }else if (Estimators[i] == "thetan") {
- calculators.push_back(new ThetaN());
- }else if (Estimators[i] == "kstest") {
- calculators.push_back(new KSTest());
- }else if (Estimators[i] == "sharednseqs") {
- calculators.push_back(new SharedNSeqs());
- }else if (Estimators[i] == "ochiai") {
- calculators.push_back(new Ochiai());
- }else if (Estimators[i] == "anderberg") {
- calculators.push_back(new Anderberg());
- }else if (Estimators[i] == "kulczynski") {
- calculators.push_back(new Kulczynski());
- }else if (Estimators[i] == "kulczynskicody") {
- calculators.push_back(new KulczynskiCody());
- }else if (Estimators[i] == "lennon") {
- calculators.push_back(new Lennon());
- }else if (Estimators[i] == "morisitahorn") {
- calculators.push_back(new MorHorn());
- }else if (Estimators[i] == "braycurtis") {
- calculators.push_back(new BrayCurtis());
- }else if (Estimators[i] == "whittaker") {
- calculators.push_back(new Whittaker());
- }else if (Estimators[i] == "odum") {
- calculators.push_back(new Odum());
- }else if (Estimators[i] == "canberra") {
- calculators.push_back(new Canberra());
- }else if (Estimators[i] == "structeuclidean") {
- calculators.push_back(new StructEuclidean());
- }else if (Estimators[i] == "structchord") {
- calculators.push_back(new StructChord());
- }else if (Estimators[i] == "hellinger") {
- calculators.push_back(new Hellinger());
- }else if (Estimators[i] == "manhattan") {
- calculators.push_back(new Manhattan());
- }else if (Estimators[i] == "structpearson") {
- calculators.push_back(new StructPearson());
- }else if (Estimators[i] == "soergel") {
- calculators.push_back(new Soergel());
- }else if (Estimators[i] == "spearman") {
- calculators.push_back(new Spearman());
- }else if (Estimators[i] == "structkulczynski") {
- calculators.push_back(new StructKulczynski());
- }else if (Estimators[i] == "speciesprofile") {
- calculators.push_back(new SpeciesProfile());
- }else if (Estimators[i] == "hamming") {
- calculators.push_back(new Hamming());
- }else if (Estimators[i] == "structchi2") {
- calculators.push_back(new StructChi2());
- }else if (Estimators[i] == "gower") {
- calculators.push_back(new Gower());
- }else if (Estimators[i] == "memchi2") {
- calculators.push_back(new MemChi2());
- }else if (Estimators[i] == "memchord") {
- calculators.push_back(new MemChord());
- }else if (Estimators[i] == "memeuclidean") {
- calculators.push_back(new MemEuclidean());
- }else if (Estimators[i] == "mempearson") {
- calculators.push_back(new MemPearson());
- }
- }
- }
- }