53 std::list<Treenode*> children;
63 std::vector<int> bestAssign;
71 std::vector<double> table;
82 void addDistance(
double dist){this->distance=dist;}
83 void addSpecies(
string s){this->species=s;}
85 void removeChild(
Treenode *child){children.remove(child);}
87 bool isLeaf()
const {
return (this->children.empty());}
88 bool isRoot()
const {
return (this->parent == NULL);}
89 void setTable(
int pos,
double value){table.at(pos)=value;}
90 double getTable(
int pos)
const{
return table.at(pos);}
91 double getDist()
const {
return distance;}
92 int getIdx()
const {
return idx;}
93 void setIdx(
int i) {this->idx = i;}
94 gsl_matrix* getLogP()
const {
return logP;}
95 void setLogP(gsl_matrix *m) {logP = m;}
96 void resizeTable(
int size,
double val=0);
97 std::string getSpecies()
const {
return species;}
98 Treenode *getParent()
const {
return this->parent;}
99 void printNode()
const;
107 std::list<Treenode*> treenodes;
111 static double phylo_factor;
115 PhyloTree(
const std::vector<std::string> &speciesnames,
double b=1);
123 void getBranchLengths(std::vector<double> &branchset)
const;
124 void scaleTree(
double factor);
125 double getDiversity();
126 void getSpeciesNames(std::vector<std::string> &speciesnames);
127 int numSpecies(){
return numSp;}
128 Treenode *getLeaf(std::string species)
const;
129 void printTree()
const;
130 void printNewick(std::string filename)
const;
131 void recursiveNWK(std::ofstream &file,
Treenode *node)
const;
139 void drop(std::string species);
146 void prune(bit_vector &bv,
Evo *evo);
150 double pruningAlgor(std::string labelpattern,
Evo *evo,
int u=0);
151 double pruningAlgor(std::vector<int> &tuple,
Evo *evo,
int u=0);
152 void printRecursionTable()
const;
161 double MAP(std::vector<int> &labels, std::vector<double> &weights,
Evo *evo,
bool fixLeafLabels=
false);
162 void MAPbacktrack(std::vector<int> &labels,
Treenode* root,
int bestAssign,
bool fixLeafLabels);
163 int fitch(vector<int> &labels,
int states=64);