5 #ifndef BPP_PHYL_DISTANCE_PGMA_H
6 #define BPP_PHYL_DISTANCE_PGMA_H
9 #include "../Tree/Tree.h"
10 #include "../Tree/TreeTemplate.h"
39 PGMA(
bool weighted =
true) :
74 double computeDistancesFromPair(
const std::vector<size_t>& pair,
const std::vector<double>& branchLengths,
size_t pos);
Partial implementation of the AgglomerativeDistanceMethod interface.
virtual void setDistanceMatrix(const DistanceMatrix &matrix) override
Set the distance matrix to use.
void computeTree() override
Compute the tree corresponding to the distance matrix.
The phylogenetic node class.
Compute WPGMA and UPGMA trees from a distance matrix.
std::string getName() const
std::vector< double > computeBranchLengthsForPair(const std::vector< size_t > &pair)
Compute the branch lengths for two nodes to agglomerate.
void setDistanceMatrix(const DistanceMatrix &matrix)
Set the distance matrix to use.
virtual Node * getParentNode(int id, Node *son1, Node *son2)
Get an inner node.
double computeDistancesFromPair(const std::vector< size_t > &pair, const std::vector< double > &branchLengths, size_t pos)
Actualizes the distance matrix according to a given pair and the corresponding branch lengths.
void setWeighted(bool weighted)
std::vector< size_t > getBestPair()
Get the best pair of nodes to agglomerate.
virtual Node * getLeafNode(int id, const std::string &name)
Get a leaf node.
PGMA(const DistanceMatrix &matrix, bool weighted=true, bool verbose=true)
Create a (U/W)PGMA object instance.
void finalStep(int idRoot)
Method called when there ar eonly three remaining node to agglomerate, and creates the root node of t...
Defines the basic types of data flow nodes.
Inner data structure for WPGMA and UPGMA distance methods.