5 #ifndef BPP_PHYL_TREE_TREETOOLS_H
6 #define BPP_PHYL_TREE_TREETOOLS_H
61 static void getLeavesId(
const Tree& tree,
int nodeId, std::vector<int>& leaves);
81 static int getLeafId(
const Tree& tree,
int nodeId,
const std::string& name);
92 static void searchLeaf(
const Tree& tree,
int nodeId,
const std::string& name,
int*&
id);
173 static size_t getDepths(
const Tree& tree,
int nodeId, std::map<int, size_t>& depths);
203 static double getHeights(
const Tree& tree,
int nodeId, std::map<int, double>& heights);
235 static double getTotalLength(
const Tree& tree,
int nodeId,
bool includeAncestor =
true);
268 static void scaleTree(
Tree& tree,
int nodeId,
double factor);
421 static std::string
nodeToParenthesis(
const Tree& tree,
int nodeId,
bool bootstrap,
const std::string& propertyName);
446 static std::string
treeToParenthesis(
const Tree& tree,
bool bootstrap,
const std::string& propertyName);
474 static void getNodesId(
const Tree& tree,
int nodeId, std::vector<int>& nodes);
507 static bool checkIds(
const Tree& tree,
bool throwException);
526 static std::unique_ptr<VectorSiteContainer>
MRPEncode(
const std::vector<std::unique_ptr<Tree>>& vecTr);
536 static std::unique_ptr<VectorSiteContainer>
MRPEncodeMultilabel(
const std::vector<std::unique_ptr<Tree>>& vecTr);
561 static int robinsonFouldsDistance(
const Tree& tr1,
const Tree& tr2,
bool checkNames =
true,
int* missing_in_tr2 = NULL,
int* missing_in_tr1 = NULL);
574 static std::unique_ptr<BipartitionList>
bipartitionOccurrences(
const std::vector<std::unique_ptr<Tree>>& vecTr, std::vector<size_t>& bipScore);
589 static std::unique_ptr<TreeTemplate<Node>>
thresholdConsensus(
const std::vector<std::unique_ptr<Tree>>& vecTr,
double threshold,
bool checkNames =
true);
601 static std::unique_ptr<TreeTemplate<Node>>
fullyResolvedConsensus(
const std::vector<std::unique_ptr<Tree>>& vecTr,
bool checkNames =
true);
612 static std::unique_ptr<TreeTemplate<Node>>
majorityConsensus(
const std::vector<std::unique_ptr<Tree>>& vecTr,
bool checkNames =
true);
623 static std::unique_ptr<TreeTemplate<Node>>
strictConsensus(
const std::vector<std::unique_ptr<Tree>>& vecTr,
bool checkNames =
true);
638 static std::unique_ptr<Tree>
MRP(
const std::vector<std::unique_ptr<Tree>>& vecTr);
649 static void computeBootstrapValues(
Tree& tree,
const std::vector<std::unique_ptr<Tree>>& vecTr,
bool verbose =
true,
int format = 0);
672 static std::unique_ptr<Tree>
MRPMultilabel(
const std::vector<Tree*>& vecTr);
Interface for phylogenetic tree objects.
Defines the basic types of data flow nodes.
std::vector< double > Vdouble