--- /dev/null
+/*
+ * removerarecommand.cpp
+ * mothur
+ *
+ * Created by westcott on 1/21/11.
+ * Copyright 2011 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "removerarecommand.h"
+#include "sequence.hpp"
+#include "groupmap.h"
+#include "sharedutilities.h"
+#include "inputdata.h"
+
+//**********************************************************************************************************************
+vector<string> RemoveRareCommand::getValidParameters(){
+ try {
+ string Array[] = {"rabund","sabund", "group", "list", "shared", "nseqs","groups","label","outputdir","inputdir"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveRareCommand", "getValidParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+RemoveRareCommand::RemoveRareCommand(){
+ try {
+ abort = true;
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["rabund"] = tempOutNames;
+ outputTypes["sabund"] = tempOutNames;
+ outputTypes["list"] = tempOutNames;
+ outputTypes["group"] = tempOutNames;
+ outputTypes["shared"] = tempOutNames;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveRareCommand", "RemoveRareCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> RemoveRareCommand::getRequiredParameters(){
+ try {
+ string Array[] = {"nseqs"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveRareCommand", "getRequiredParameters");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+vector<string> RemoveRareCommand::getRequiredFiles(){
+ try {
+ vector<string> myArray;
+ return myArray;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveRareCommand", "getRequiredFiles");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+RemoveRareCommand::RemoveRareCommand(string option) {
+ try {
+ abort = false;
+ allLines = 1;
+
+ //allow user to run help
+ if(option == "help") { help(); abort = true; }
+
+ else {
+ //valid paramters for this command
+ string Array[] = {"rabund","sabund", "group", "list", "shared", "nseqs","groups","label","outputdir","inputdir"};
+ vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
+
+ OptionParser parser(option);
+ map<string,string> parameters = parser.getParameters();
+
+ ValidParameters validParameter;
+ map<string,string>::iterator it;
+
+ //check to make sure all parameters are valid for command
+ for (it = parameters.begin(); it != parameters.end(); it++) {
+ if (validParameter.isValidParameter(it->first, myArray, it->second) != true) { abort = true; }
+ }
+
+ //initialize outputTypes
+ vector<string> tempOutNames;
+ outputTypes["rabund"] = tempOutNames;
+ outputTypes["sabund"] = tempOutNames;
+ outputTypes["list"] = tempOutNames;
+ outputTypes["group"] = tempOutNames;
+ outputTypes["shared"] = tempOutNames;
+
+ //if the user changes the output directory command factory will send this info to us in the output parameter
+ outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = ""; }
+
+ //if the user changes the input directory command factory will send this info to us in the output parameter
+ string inputDir = validParameter.validFile(parameters, "inputdir", false);
+ if (inputDir == "not found"){ inputDir = ""; }
+ else {
+ string path;
+ it = parameters.find("list");
+ //user has given a template file
+ if(it != parameters.end()){
+ path = m->hasPath(it->second);
+ //if the user has not given a path then, add inputdir. else leave path alone.
+ if (path == "") { parameters["list"] = inputDir + it->second; }
+ }
+
+ it = parameters.find("group");
+ //user has given a template file
+ if(it != parameters.end()){
+ path = m->hasPath(it->second);
+ //if the user has not given a path then, add inputdir. else leave path alone.
+ if (path == "") { parameters["group"] = inputDir + it->second; }
+ }
+
+ it = parameters.find("sabund");
+ //user has given a template file
+ if(it != parameters.end()){
+ path = m->hasPath(it->second);
+ //if the user has not given a path then, add inputdir. else leave path alone.
+ if (path == "") { parameters["sabund"] = inputDir + it->second; }
+ }
+
+ it = parameters.find("rabund");
+ //user has given a template file
+ if(it != parameters.end()){
+ path = m->hasPath(it->second);
+ //if the user has not given a path then, add inputdir. else leave path alone.
+ if (path == "") { parameters["rabund"] = inputDir + it->second; }
+ }
+
+ it = parameters.find("shared");
+ //user has given a template file
+ if(it != parameters.end()){
+ path = m->hasPath(it->second);
+ //if the user has not given a path then, add inputdir. else leave path alone.
+ if (path == "") { parameters["shared"] = inputDir + it->second; }
+ }
+ }
+
+
+ //check for file parameters
+ listfile = validParameter.validFile(parameters, "list", true);
+ if (listfile == "not open") { abort = true; }
+ else if (listfile == "not found") { listfile = ""; }
+
+ sabundfile = validParameter.validFile(parameters, "sabund", true);
+ if (sabundfile == "not open") { abort = true; }
+ else if (sabundfile == "not found") { sabundfile = ""; }
+
+ rabundfile = validParameter.validFile(parameters, "rabund", true);
+ if (rabundfile == "not open") { abort = true; }
+ else if (rabundfile == "not found") { rabundfile = ""; }
+
+ groupfile = validParameter.validFile(parameters, "group", true);
+ if (groupfile == "not open") { abort = true; }
+ else if (groupfile == "not found") { groupfile = ""; }
+
+ sharedfile = validParameter.validFile(parameters, "shared", true);
+ if (sharedfile == "not open") { abort = true; }
+ else if (sharedfile == "not found") { sharedfile = ""; }
+
+ if ((sabundfile == "") && (rabundfile == "") && (sharedfile == "") && (listfile == "")) { m->mothurOut("You must provide at least one of the following: rabund, sabund, shared or list."); m->mothurOutEndLine(); abort = true; }
+
+ groups = validParameter.validFile(parameters, "groups", false);
+ if (groups == "not found") { groups = "all"; }
+ m->splitAtDash(groups, Groups);
+
+ label = validParameter.validFile(parameters, "label", false);
+ if (label == "not found") { label = ""; }
+ else {
+ if(label != "all") { m->splitAtDash(label, labels); allLines = 0; }
+ else { allLines = 1; }
+ }
+
+ string temp = validParameter.validFile(parameters, "nseqs", false);
+ if (temp == "not found") { m->mothurOut("nseqs is a required parameter."); m->mothurOutEndLine(); abort = true; }
+ else { convert(temp, nseqs); }
+ }
+
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveRareCommand", "RemoveRareCommand");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+
+void RemoveRareCommand::help(){
+ try {
+ //m->mothurOut("The remove.seqs command reads an .accnos file and at least one of the following file types: fasta, name, group, list, taxonomy, quality or alignreport file.\n");
+ //m->mothurOut("It outputs a file containing the sequences NOT in the .accnos file.\n");
+ //m->mothurOut("The remove.seqs command parameters are accnos, fasta, name, group, list, taxonomy, qfile, alignreport and dups. You must provide accnos and at least one of the file parameters.\n");
+ //m->mothurOut("The dups parameter allows you to remove the entire line from a name file if you remove any name from the line. default=true. \n");
+ //m->mothurOut("The remove.seqs command should be in the following format: remove.seqs(accnos=yourAccnos, fasta=yourFasta).\n");
+ //m->mothurOut("Example remove.seqs(accnos=amazon.accnos, fasta=amazon.fasta).\n");
+ //m->mothurOut("Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFasta).\n\n");
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveRareCommand", "help");
+ exit(1);
+ }
+}
+
+//**********************************************************************************************************************
+
+int RemoveRareCommand::execute(){
+ try {
+
+ if (abort == true) { return 0; }
+
+ if (m->control_pressed) { return 0; }
+
+ //read through the correct file and output lines you want to keep
+ if (sabundfile != "") { processSabund(); }
+ if (rabundfile != "") { processRabund(); }
+ if (listfile != "") { processList(); }
+ //if (sharedfile != "") { processShared(); }
+
+ if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
+
+ if (outputNames.size() != 0) {
+ m->mothurOutEndLine();
+ m->mothurOut("Output File Names: "); m->mothurOutEndLine();
+ for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
+ m->mothurOutEndLine();
+ }
+
+ return 0;
+ }
+
+ catch(exception& e) {
+ m->errorOut(e, "RemoveRareCommand", "execute");
+ exit(1);
+ }
+}
+
+//**********************************************************************************************************************
+int RemoveRareCommand::processList(){
+ try {
+ string thisOutputDir = outputDir;
+ if (outputDir == "") { thisOutputDir += m->hasPath(listfile); }
+ string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(listfile)) + "pick" + m->getExtension(listfile);
+ string outputGroupFileName = thisOutputDir + m->getRootName(m->getSimpleName(groupfile)) + "pick" + m->getExtension(groupfile);
+
+ ofstream out, outGroup;
+ m->openOutputFile(outputFileName, out);
+
+ bool wroteSomething = false;
+
+ //you must provide a label because the names in the listfile need to be consistent
+ string thisLabel = "";
+ if (allLines) { m->mothurOut("For the listfile you must select one label, using first label in your listfile."); m->mothurOutEndLine(); }
+ else if (labels.size() > 1) { m->mothurOut("For the listfile you must select one label, using " + (*labels.begin()) + "."); m->mothurOutEndLine(); thisLabel = *labels.begin(); }
+ else { thisLabel = *labels.begin(); }
+
+ InputData input(listfile, "list");
+ ListVector* list = input.getListVector();
+
+ //get first one or the one we want
+ if (thisLabel != "") {
+ //use smart distancing
+ set<string> userLabels; userLabels.insert(thisLabel);
+ set<string> processedLabels;
+ string lastLabel = list->getLabel();
+ while((list != NULL) && (userLabels.size() != 0)) {
+ if(userLabels.count(list->getLabel()) == 1){
+ processedLabels.insert(list->getLabel());
+ userLabels.erase(list->getLabel());
+ break;
+ }
+
+ if ((m->anyLabelsToProcess(list->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
+ processedLabels.insert(list->getLabel());
+ userLabels.erase(list->getLabel());
+ delete list;
+ list = input.getListVector(lastLabel);
+ break;
+ }
+ lastLabel = list->getLabel();
+ delete list;
+ list = input.getListVector();
+ }
+ if (userLabels.size() != 0) {
+ m->mothurOut("Your file does not include the label " + thisLabel + ". I will use " + lastLabel + "."); m->mothurOutEndLine();
+ list = input.getListVector(lastLabel);
+ }
+ }
+
+ //if groupfile is given then use it
+ GroupMap* groupMap;
+ if (groupfile != "") {
+ groupMap = new GroupMap(groupfile); groupMap->readMap();
+ SharedUtil util;
+ util.setGroups(Groups, groupMap->namesOfGroups);
+ m->openOutputFile(outputGroupFileName, outGroup);
+ }
+
+
+ if (list != NULL) {
+ //make a new list vector
+ ListVector newList;
+ newList.setLabel(list->getLabel());
+
+ //for each bin
+ for (int i = 0; i < list->getNumBins(); i++) {
+ if (m->control_pressed) { if (groupfile != "") { delete groupMap; outGroup.close(); remove(outputGroupFileName.c_str()); } out.close(); remove(outputFileName.c_str()); return 0; }
+
+ //parse out names that are in accnos file
+ string binnames = list->get(i);
+ vector<string> names;
+ string saveBinNames = binnames;
+ m->splitAtComma(binnames, names);
+
+ vector<string> newGroupFile;
+ if (groupfile != "") {
+ vector<string> newNames;
+ saveBinNames = "";
+ for(int k = 0; k < names.size(); k++) {
+ string group = groupMap->getGroup(names[k]);
+
+ if (m->inUsersGroups(group, Groups)) {
+ newGroupFile.push_back(names[k] + "\t" + group);
+
+ newNames.push_back(names[k]);
+ saveBinNames += names[k] + ",";
+ }
+ }
+ names = newNames;
+ saveBinNames = saveBinNames.substr(0, saveBinNames.length()-1);
+ }
+
+ if (names.size() > nseqs) { //keep bin
+ newList.push_back(saveBinNames);
+ for(int k = 0; k < newGroupFile.size(); k++) { outGroup << newGroupFile[k] << endl; }
+ }
+ }
+
+ //print new listvector
+ if (newList.getNumBins() != 0) {
+ wroteSomething = true;
+ newList.print(out);
+ }
+ }
+
+ out.close();
+ if (groupfile != "") { outGroup.close(); outputTypes["group"].push_back(outputGroupFileName); outputNames.push_back(outputGroupFileName); }
+
+ if (wroteSomething == false) { m->mothurOut("Your file contains only rare sequences."); m->mothurOutEndLine(); }
+ outputTypes["list"].push_back(outputFileName); outputNames.push_back(outputFileName);
+
+ return 0;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveRareCommand", "processList");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+int RemoveRareCommand::processSabund(){
+ try {
+ string thisOutputDir = outputDir;
+ if (outputDir == "") { thisOutputDir += m->hasPath(sabundfile); }
+ string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(sabundfile)) + "pick" + m->getExtension(sabundfile);
+ outputTypes["sabund"].push_back(outputFileName); outputNames.push_back(outputFileName);
+
+ ofstream out;
+ m->openOutputFile(outputFileName, out);
+
+ //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
+ InputData input(sabundfile, "sabund");
+ SAbundVector* sabund = input.getSAbundVector();
+ string lastLabel = sabund->getLabel();
+ set<string> processedLabels;
+ set<string> userLabels = labels;
+
+ while((sabund != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
+
+ if (m->control_pressed) { delete sabund; out.close(); return 0; }
+
+ if(allLines == 1 || labels.count(sabund->getLabel()) == 1){
+
+ m->mothurOut(sabund->getLabel()); m->mothurOutEndLine();
+ processedLabels.insert(sabund->getLabel());
+ userLabels.erase(sabund->getLabel());
+
+ if (sabund->getMaxRank() > nseqs) {
+ for(int i = 1; i <=nseqs; i++) { sabund->set(i, 0); }
+ }else { sabund->clear(); }
+
+ if (sabund->getNumBins() > 0) { sabund->print(out); }
+ }
+
+ if ((m->anyLabelsToProcess(sabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
+ string saveLabel = sabund->getLabel();
+
+ delete sabund;
+ sabund = input.getSAbundVector(lastLabel);
+
+ m->mothurOut(sabund->getLabel()); m->mothurOutEndLine();
+ processedLabels.insert(sabund->getLabel());
+ userLabels.erase(sabund->getLabel());
+
+ if (sabund->getMaxRank() > nseqs) {
+ for(int i = 1; i <=nseqs; i++) { sabund->set(i, 0); }
+ }else { sabund->clear(); }
+
+ if (sabund->getNumBins() > 0) { sabund->print(out); }
+
+ //restore real lastlabel to save below
+ sabund->setLabel(saveLabel);
+ }
+
+ lastLabel = sabund->getLabel();
+
+ delete sabund;
+ sabund = input.getSAbundVector();
+ }
+
+ if (m->control_pressed) { out.close(); return 0; }
+
+ //output error messages about any remaining user labels
+ set<string>::iterator it;
+ bool needToRun = false;
+ for (it = userLabels.begin(); it != userLabels.end(); it++) {
+ m->mothurOut("Your file does not include the label " + *it);
+ if (processedLabels.count(lastLabel) != 1) {
+ m->mothurOut(". I will use " + lastLabel + "."); m->mothurOutEndLine();
+ needToRun = true;
+ }else {
+ m->mothurOut(". Please refer to " + lastLabel + "."); m->mothurOutEndLine();
+ }
+ }
+
+ //run last label if you need to
+ if (needToRun == true) {
+ if (sabund != NULL) { delete sabund; }
+ sabund = input.getSAbundVector(lastLabel);
+
+ m->mothurOut(sabund->getLabel()); m->mothurOutEndLine();
+
+ if (sabund->getMaxRank() > nseqs) {
+ for(int i = 1; i <=nseqs; i++) { sabund->set(i, 0); }
+ }else { sabund->clear(); }
+
+ if (sabund->getNumBins() > 0) { sabund->print(out); }
+
+ delete sabund;
+ }
+
+ return 0;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveRareCommand", "processSabund");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+int RemoveRareCommand::processRabund(){
+ try {
+ string thisOutputDir = outputDir;
+ if (outputDir == "") { thisOutputDir += m->hasPath(rabundfile); }
+ string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(rabundfile)) + "pick" + m->getExtension(rabundfile);
+ outputTypes["rabund"].push_back(outputFileName); outputNames.push_back(outputFileName);
+
+ ofstream out;
+ m->openOutputFile(outputFileName, out);
+
+ //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
+ InputData input(rabundfile, "rabund");
+ RAbundVector* rabund = input.getRAbundVector();
+ string lastLabel = rabund->getLabel();
+ set<string> processedLabels;
+ set<string> userLabels = labels;
+
+ while((rabund != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
+
+ if (m->control_pressed) { delete rabund; out.close(); return 0; }
+
+ if(allLines == 1 || labels.count(rabund->getLabel()) == 1){
+
+ m->mothurOut(rabund->getLabel()); m->mothurOutEndLine();
+ processedLabels.insert(rabund->getLabel());
+ userLabels.erase(rabund->getLabel());
+
+ RAbundVector newRabund; newRabund.setLabel(rabund->getLabel());
+ for (int i = 0; i < rabund->getNumBins(); i++) {
+ if (rabund->get(i) > nseqs) {
+ newRabund.push_back(rabund->get(i));
+ }
+ }
+ if (newRabund.getNumBins() > 0) { newRabund.print(out); }
+ }
+
+ if ((m->anyLabelsToProcess(rabund->getLabel(), userLabels, "") == true) && (processedLabels.count(lastLabel) != 1)) {
+ string saveLabel = rabund->getLabel();
+
+ delete rabund;
+ rabund = input.getRAbundVector(lastLabel);
+
+ m->mothurOut(rabund->getLabel()); m->mothurOutEndLine();
+ processedLabels.insert(rabund->getLabel());
+ userLabels.erase(rabund->getLabel());
+
+ RAbundVector newRabund; newRabund.setLabel(rabund->getLabel());
+ for (int i = 0; i < rabund->getNumBins(); i++) {
+ if (rabund->get(i) > nseqs) {
+ newRabund.push_back(rabund->get(i));
+ }
+ }
+ if (newRabund.getNumBins() > 0) { newRabund.print(out); }
+
+ //restore real lastlabel to save below
+ rabund->setLabel(saveLabel);
+ }
+
+ lastLabel = rabund->getLabel();
+
+ delete rabund;
+ rabund = input.getRAbundVector();
+ }
+
+ if (m->control_pressed) { out.close(); return 0; }
+
+ //output error messages about any remaining user labels
+ set<string>::iterator it;
+ bool needToRun = false;
+ for (it = userLabels.begin(); it != userLabels.end(); it++) {
+ m->mothurOut("Your file does not include the label " + *it);
+ if (processedLabels.count(lastLabel) != 1) {
+ m->mothurOut(". I will use " + lastLabel + "."); m->mothurOutEndLine();
+ needToRun = true;
+ }else {
+ m->mothurOut(". Please refer to " + lastLabel + "."); m->mothurOutEndLine();
+ }
+ }
+
+ //run last label if you need to
+ if (needToRun == true) {
+ if (rabund != NULL) { delete rabund; }
+ rabund = input.getRAbundVector(lastLabel);
+
+ m->mothurOut(rabund->getLabel()); m->mothurOutEndLine();
+
+ RAbundVector newRabund; newRabund.setLabel(rabund->getLabel());
+ for (int i = 0; i < rabund->getNumBins(); i++) {
+ if (rabund->get(i) > nseqs) {
+ newRabund.push_back(rabund->get(i));
+ }
+ }
+ if (newRabund.getNumBins() > 0) { newRabund.print(out); }
+
+ delete rabund;
+ }
+
+ return 0;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "RemoveRareCommand", "processSabund");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+
+
+
+
*/
#include "treegroupscommand.h"
+#include "sharedsobscollectsummary.h"
+#include "sharedchao1.h"
+#include "sharedace.h"
+#include "sharednseqs.h"
#include "sharedjabund.h"
#include "sharedsorabund.h"
#include "sharedjclass.h"
#include "sharedsorest.h"
#include "sharedthetayc.h"
#include "sharedthetan.h"
+#include "sharedkstest.h"
+#include "whittaker.h"
+#include "sharedochiai.h"
+#include "sharedanderbergs.h"
+#include "sharedkulczynski.h"
+#include "sharedkulczynskicody.h"
+#include "sharedlennon.h"
#include "sharedmorisitahorn.h"
#include "sharedbraycurtis.h"
+#include "sharedjackknife.h"
+#include "whittaker.h"
+#include "odum.h"
+#include "canberra.h"
+#include "structeuclidean.h"
+#include "structchord.h"
+#include "hellinger.h"
+#include "manhattan.h"
+#include "structpearson.h"
+#include "soergel.h"
+#include "spearman.h"
+#include "structkulczynski.h"
+#include "structchi2.h"
+#include "speciesprofile.h"
+#include "hamming.h"
+#include "gower.h"
+#include "memchi2.h"
+#include "memchord.h"
+#include "memeuclidean.h"
+#include "mempearson.h"
//**********************************************************************************************************************
vector<string> TreeGroupCommand::getValidParameters(){
int i;
for (i=0; i<Estimators.size(); i++) {
if (validCalculator->isValidCalculator("treegroup", Estimators[i]) == true) {
- if (Estimators[i] == "jabund") {
+ if (Estimators[i] == "sharedsobs") {
+ treeCalculators.push_back(new SharedSobsCS());
+ }else if (Estimators[i] == "sharedchao") {
+ treeCalculators.push_back(new SharedChao1());
+ }else if (Estimators[i] == "sharedace") {
+ treeCalculators.push_back(new SharedAce());
+ }else if (Estimators[i] == "jabund") {
treeCalculators.push_back(new JAbund());
}else if (Estimators[i] == "sorabund") {
treeCalculators.push_back(new SorAbund());
treeCalculators.push_back(new ThetaYC());
}else if (Estimators[i] == "thetan") {
treeCalculators.push_back(new ThetaN());
+ }else if (Estimators[i] == "kstest") {
+ treeCalculators.push_back(new KSTest());
+ }else if (Estimators[i] == "sharednseqs") {
+ treeCalculators.push_back(new SharedNSeqs());
+ }else if (Estimators[i] == "ochiai") {
+ treeCalculators.push_back(new Ochiai());
+ }else if (Estimators[i] == "anderberg") {
+ treeCalculators.push_back(new Anderberg());
+ }else if (Estimators[i] == "kulczynski") {
+ treeCalculators.push_back(new Kulczynski());
+ }else if (Estimators[i] == "kulczynskicody") {
+ treeCalculators.push_back(new KulczynskiCody());
+ }else if (Estimators[i] == "lennon") {
+ treeCalculators.push_back(new Lennon());
}else if (Estimators[i] == "morisitahorn") {
treeCalculators.push_back(new MorHorn());
}else if (Estimators[i] == "braycurtis") {
treeCalculators.push_back(new BrayCurtis());
+ }else if (Estimators[i] == "whittaker") {
+ treeCalculators.push_back(new Whittaker());
+ }else if (Estimators[i] == "odum") {
+ treeCalculators.push_back(new Odum());
+ }else if (Estimators[i] == "canberra") {
+ treeCalculators.push_back(new Canberra());
+ }else if (Estimators[i] == "structeuclidean") {
+ treeCalculators.push_back(new StructEuclidean());
+ }else if (Estimators[i] == "structchord") {
+ treeCalculators.push_back(new StructChord());
+ }else if (Estimators[i] == "hellinger") {
+ treeCalculators.push_back(new Hellinger());
+ }else if (Estimators[i] == "manhattan") {
+ treeCalculators.push_back(new Manhattan());
+ }else if (Estimators[i] == "structpearson") {
+ treeCalculators.push_back(new StructPearson());
+ }else if (Estimators[i] == "soergel") {
+ treeCalculators.push_back(new Soergel());
+ }else if (Estimators[i] == "spearman") {
+ treeCalculators.push_back(new Spearman());
+ }else if (Estimators[i] == "structkulczynski") {
+ treeCalculators.push_back(new StructKulczynski());
+ }else if (Estimators[i] == "speciesprofile") {
+ treeCalculators.push_back(new SpeciesProfile());
+ }else if (Estimators[i] == "hamming") {
+ treeCalculators.push_back(new Hamming());
+ }else if (Estimators[i] == "structchi2") {
+ treeCalculators.push_back(new StructChi2());
+ }else if (Estimators[i] == "gower") {
+ treeCalculators.push_back(new Gower());
+ }else if (Estimators[i] == "memchi2") {
+ treeCalculators.push_back(new MemChi2());
+ }else if (Estimators[i] == "memchord") {
+ treeCalculators.push_back(new MemChord());
+ }else if (Estimators[i] == "memeuclidean") {
+ treeCalculators.push_back(new MemEuclidean());
+ }else if (Estimators[i] == "mempearson") {
+ treeCalculators.push_back(new MemPearson());
}
}
}