bpp-phyl3
3.0.0
|
The phylogenetic tree class. More...
#include <Bpp/Phyl/Tree/TreeTemplate.h>
Public Member Functions | |
TreeTemplate () | |
TreeTemplate (const TreeTemplate< N > &t) | |
TreeTemplate (const Tree &t) | |
TreeTemplate (N *root) | |
TreeTemplate< N > & | operator= (const TreeTemplate< N > &t) |
TreeTemplate< N > * | cloneSubtree (int newRootId) const |
clones a Subtree rooted at given node Id More... | |
virtual | ~TreeTemplate () |
TreeTemplate< N > * | clone () const |
std::string | getName () const |
void | setName (const std::string &name) |
int | getRootId () const |
size_t | getNumberOfLeaves () const |
size_t | getNumberOfNodes () const |
size_t | getNumberOfBranches () const |
int | getLeafId (const std::string &name) const |
std::vector< int > | getLeavesId () const |
std::vector< int > | getNodesId () const |
std::vector< int > | getInnerNodesId () const |
std::vector< int > | getBranchesId () const |
std::vector< double > | getBranchLengths () const |
std::vector< std::string > | getLeavesNames () const |
std::vector< int > | getSonsId (int parentId) const |
std::vector< int > | getAncestorsId (int nodeId) const |
int | getFatherId (int parentId) const |
bool | hasFather (int nodeId) const |
std::string | getNodeName (int nodeId) const |
bool | hasNodeName (int nodeId) const |
void | setNodeName (int nodeId, const std::string &name) |
void | deleteNodeName (int nodeId) |
bool | hasNode (int nodeId) const |
bool | isLeaf (int nodeId) const |
bool | hasNoSon (int nodeId) const |
bool | isRoot (int nodeId) const |
double | getDistanceToFather (int nodeId) const |
void | setDistanceToFather (int nodeId, double length) |
void | deleteDistanceToFather (int nodeId) |
bool | hasDistanceToFather (int nodeId) const |
bool | hasNodeProperty (int nodeId, const std::string &name) const |
void | setNodeProperty (int nodeId, const std::string &name, const Clonable &property) |
Clonable * | getNodeProperty (int nodeId, const std::string &name) |
const Clonable * | getNodeProperty (int nodeId, const std::string &name) const |
Clonable * | removeNodeProperty (int nodeId, const std::string &name) |
std::vector< std::string > | getNodePropertyNames (int nodeId) const |
bool | hasBranchProperty (int nodeId, const std::string &name) const |
void | setBranchProperty (int nodeId, const std::string &name, const Clonable &property) |
Clonable * | getBranchProperty (int nodeId, const std::string &name) |
const Clonable * | getBranchProperty (int nodeId, const std::string &name) const |
Clonable * | removeBranchProperty (int nodeId, const std::string &name) |
std::vector< std::string > | getBranchPropertyNames (int nodeId) const |
void | rootAt (int nodeId) |
Change the root node. More... | |
void | newOutGroup (int nodeId) |
Root a tree by specifying an outgroup. More... | |
bool | isRooted () const |
Tell if the tree is rooted. More... | |
bool | unroot () |
Unroot a rooted tree. More... | |
void | resetNodesId () |
Number nodes. More... | |
bool | isMultifurcating () const |
Tell if the tree is multifurcating. More... | |
template<class N2 > | |
bool | hasSameTopologyAs (const TreeTemplate< N2 > &tree, bool ordered=false) const |
Tells if this tree has the same topology as the one given for comparison. More... | |
std::vector< double > | getBranchLengths () |
Get all the branch lengths of a tree. More... | |
double | getTotalLength () |
Get the total length (sum of all branch lengths) of a tree. More... | |
void | setBranchLengths (double brLen) |
Set all the branch lengths of a tree. More... | |
void | setVoidBranchLengths (double brLen) |
Give a length to branches that don't have one in a tree. More... | |
void | scaleTree (double factor) |
Scale a given tree. More... | |
int | getNextId () |
Get an id. More... | |
void | swapNodes (int parentId, size_t i1, size_t i2) |
Specific methods | |
virtual void | setRootNode (N *root) |
virtual N * | getRootNode () |
virtual const N * | getRootNode () const |
virtual std::vector< const N * > | getLeaves () const |
virtual std::vector< N * > | getLeaves () |
virtual std::vector< const N * > | getNodes () const |
virtual std::vector< N * > | getNodes () |
virtual std::vector< const N * > | getInnerNodes () const |
virtual std::vector< N * > | getInnerNodes () |
virtual N * | getNode (int id, bool checkId=false) |
virtual const N * | getNode (int id, bool checkId=false) const |
virtual N * | getNode (const std::string &name) |
virtual const N * | getNode (const std::string &name) const |
void | rootAt (N *newRoot) |
void | newOutGroup (N *outGroup) |
Acting on topology. | |
void | swapNodes (const Tree &tree, int nodeId, size_t i1=0, size_t i2=1) |
Swap two son nodes. More... | |
Private Attributes | |
N * | root_ |
std::string | name_ |
The phylogenetic tree class.
This class is part of the object implementation of phylogenetic trees. Tree are made made of nodes, instances of the class Node. It is possible to use a tree with more complexe Node classes, but currently all nodes of a tree have to be of the same class.
Trees are oriented (rooted), i.e. each node has one father node and possibly many son nodes. Leaves are nodes without descendant and root is defined has the without father. Inner nodes will generally contain two descendants (the tree is then called bifurcating), but mutlifurcating trees are also allowed with this kind of description. In the rooted case, each inner node also defines a subtree. This allows to work recursively on trees, which is very convenient in most cases. To deal with non-rooted trees, we place an artificial root at a particular node: hence the root node appears to be trifurcated. This is the way unrooted trees are described in the parenthetic description, the so called Newick format.
To clone a tree from from another tree with a different template, consider using the TreeTools::cloneSutree<N>() method:
The getNextId() method sends a id value which is not used in the tree. In the current implementation, it uses the TreeTools::getMPNUId() method. This avoids to use duplicated ids, but is time consuming. In most cases, it is of better efficiency if the user deal with the ids himself, by using the Node::setId() method. The TreeTools::getMaxId() method may also prove useful in this respect. The resetNodesId() method can also be used to re-initialize all ids.
Definition at line 57 of file TreeTemplate.h.
|
inline |
Definition at line 70 of file TreeTemplate.h.
|
inline |
Definition at line 73 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getRootNode(), and bpp::TreeTemplate< N >::root_.
|
inline |
Definition at line 81 of file TreeTemplate.h.
References bpp::Tree::getRootId(), and bpp::TreeTemplate< N >::root_.
|
inline |
Definition at line 89 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Definition at line 110 of file TreeTemplate.h.
References bpp::TreeTemplateTools::deleteSubtree(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 116 of file TreeTemplate.h.
Referenced by bpp::TreeTemplate< N >::hasSameTopologyAs().
|
inlinevirtual |
clones a Subtree rooted at given node Id
Implements bpp::Tree.
Definition at line 104 of file TreeTemplate.h.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 192 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 178 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 166 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getAncestorsId(), and bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 143 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getNodesId(), bpp::TreeTemplate< N >::getRootId(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Get all the branch lengths of a tree.
NodeException | If a branch length is lacking. |
Implements bpp::Tree.
Definition at line 329 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getBranchLengths(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 160 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getBranchLengths(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 212 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
Referenced by bpp::TreeTemplate< N >::rootAt().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 214 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 218 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 188 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
Referenced by bpp::TreeTemplate< N >::rootAt().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 168 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Definition at line 403 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getInnerNodes(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Definition at line 401 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getInnerNodes(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 141 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getInnerNodesId(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 135 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getLeafId(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Definition at line 395 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getLeaves(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Definition at line 393 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getLeaves(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 137 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getLeavesId(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 162 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getLeavesNames(), and bpp::TreeTemplate< N >::root_.
Referenced by bpp::TreeTemplateTools::getDistanceMatrix().
|
inlinevirtual |
Methods:
Implements bpp::Tree.
Definition at line 123 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::name_.
|
inlinevirtual |
Get an id.
Implements bpp::Tree.
Definition at line 369 of file TreeTemplate.h.
References bpp::TreeTools::getMPNUId(), and bpp::TreeTemplate< N >::root_.
Referenced by bpp::TreeTemplate< N >::newOutGroup().
|
inlinevirtual |
Definition at line 445 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_, and bpp::TreeTemplateTools::searchNodeWithName().
|
inlinevirtual |
Definition at line 454 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Definition at line 405 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_, bpp::TreeTemplateTools::searchFirstNodeWithId(), and bpp::TextTools::toString().
Referenced by bpp::LegacySubstitutionMappingTools::computeCountsPerSitePerBranchPerType(), bpp::LegacySubstitutionMappingTools::computeCountsPerSitePerType(), bpp::LegacySubstitutionMappingTools::computeCountsPerTypePerBranch(), bpp::TreeTemplate< N >::deleteDistanceToFather(), bpp::TreeTemplate< N >::deleteNodeName(), bpp::TreeTemplateTools::dropLeaf(), bpp::TreeTemplate< N >::getAncestorsId(), bpp::TreeTemplate< N >::getBranchProperty(), bpp::TreeTemplate< N >::getBranchPropertyNames(), bpp::TreeTemplate< N >::getDistanceToFather(), bpp::TreeTemplate< N >::getFatherId(), bpp::TreeTemplate< N >::getNodeName(), bpp::TreeTemplate< N >::getNodeProperty(), bpp::TreeTemplate< N >::getNodePropertyNames(), bpp::TreeTemplate< N >::getSonsId(), bpp::TreeTemplate< N >::hasBranchProperty(), bpp::TreeTemplate< N >::hasDistanceToFather(), bpp::TreeTemplate< N >::hasFather(), bpp::TreeTemplate< N >::hasNodeName(), bpp::TreeTemplate< N >::hasNodeProperty(), bpp::TreeTemplate< N >::hasNoSon(), bpp::TreeTemplate< N >::isLeaf(), bpp::TreeTemplate< N >::isRoot(), bpp::TreeTemplate< N >::newOutGroup(), bpp::TreeTemplate< N >::removeBranchProperty(), bpp::TreeTemplate< N >::removeNodeProperty(), bpp::TreeTemplate< N >::rootAt(), bpp::TreeTemplate< N >::setBranchProperty(), bpp::TreeTemplate< N >::setDistanceToFather(), bpp::TreeTemplate< N >::setNodeName(), and bpp::TreeTemplate< N >::setNodeProperty().
|
inlinevirtual |
Definition at line 425 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_, bpp::TreeTemplateTools::searchFirstNodeWithId(), and bpp::TextTools::toString().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 172 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 200 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 202 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 206 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Definition at line 399 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getNodes(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Definition at line 397 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getNodes(), and bpp::TreeTemplate< N >::root_.
Referenced by bpp::LegacyRewardMappingTools::computeRewardVectors(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectors(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsMarginal(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsNoAveraging(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectorsNoAveragingMarginal(), bpp::TreeTemplate< N >::resetNodesId(), bpp::NNITopologySearch::searchBetter(), bpp::NNITopologySearch::searchFast(), and bpp::NNITopologySearch::searchPhyML().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 139 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getNodesId(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 133 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getNumberOfBranches(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 129 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getNumberOfLeaves(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 131 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getNumberOfNodes(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 127 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_.
Referenced by bpp::LegacyRewardMappingTools::computeRewardVectors(), bpp::LegacySubstitutionMappingTools::computeSubstitutionVectors(), bpp::TreeTemplate< N >::getBranchesId(), bpp::TreeTemplateTools::midRoot(), and bpp::TreeTemplate< N >::newOutGroup().
|
inlinevirtual |
Definition at line 389 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_.
Referenced by bpp::BipartitionList::BipartitionList(), bpp::PhyloTreeTools::buildFromTreeTemplate(), bpp::GlobalClockTreeLikelihoodFunctionWrapper::fireParameterChanged(), bpp::TreeTemplateTools::getDistanceMatrix(), bpp::TreeTemplateTools::getRadius(), bpp::TreeTemplate< N >::hasSameTopologyAs(), bpp::GlobalClockTreeLikelihoodFunctionWrapper::initParameters_(), bpp::TreeTemplateTools::midRoot(), bpp::TreeTemplate< N >::operator=(), bpp::PhyloStatistics::setTree(), bpp::TreeTemplate< N >::TreeTemplate(), bpp::Nhx::treeToParenthesis(), and bpp::TreeTemplateTools::treeToParenthesis().
|
inlinevirtual |
Definition at line 391 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 164 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Get the total length (sum of all branch lengths) of a tree.
NodeException | If a branch length is lacking. |
Implements bpp::Tree.
Definition at line 340 of file TreeTemplate.h.
References bpp::TreeTemplateTools::getTotalLength(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 208 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 194 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
Referenced by bpp::TreeTemplate< N >::rootAt().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 170 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 180 of file TreeTemplate.h.
References bpp::TreeTemplateTools::hasNodeWithId(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 174 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 196 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 184 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inline |
Tells if this tree has the same topology as the one given for comparison.
This method compares recursively all subtrees. The comparison is performed only on the nodes names and the parental relationships. Nodes ids are ignored, and so are branch lengths and any branch/node properties. The default is to ignore the ordering of the descendants, that is (A,B),C) will be considered as having the same topology as (B,A),C). Multifurcations are permitted. If ordering is ignored, a copy of the two trees to be compared is performed and are ordered before comparison, making the whole comparison slower and more memory greedy.
tree | The tree to be compared with. |
ordered | Should the ordering of the branching be taken into account? |
Definition at line 302 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::clone(), bpp::TreeTemplate< N >::getRootNode(), bpp::TreeTemplateTools::haveSameOrderedTopology(), and bpp::TreeTemplateTools::orderTree().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 182 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Tell if the tree is multifurcating.
Implements bpp::Tree.
Definition at line 277 of file TreeTemplate.h.
References bpp::TreeTemplateTools::isMultifurcating(), and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 186 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode(), and bpp::TreeTemplateTools::isRoot().
|
inlinevirtual |
Tell if the tree is rooted.
Implements bpp::Tree.
Definition at line 224 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_.
Referenced by bpp::GlobalClockTreeLikelihoodFunctionWrapper::initParameters_(), bpp::TreeTemplateTools::midRoot(), bpp::TreeTemplate< N >::newOutGroup(), bpp::TreeTemplate< N >::rootAt(), and bpp::TreeTemplate< N >::unroot().
|
inlinevirtual |
Root a tree by specifying an outgroup.
If the tree is rooted, unroot it first, change the root node and then reroot the tree using the previous root id. If the tree is unrooted, change the root node and then create a new root node.
nodeId | The id of the node that will be the new root. |
Implements bpp::Tree.
Definition at line 222 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode(), and bpp::TreeTemplate< N >::newOutGroup().
Referenced by bpp::TreeTemplate< N >::newOutGroup().
|
inline |
Definition at line 491 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNextId(), bpp::TreeTemplate< N >::getRootId(), bpp::TreeTemplate< N >::isRooted(), bpp::TreeTemplate< N >::root_, bpp::TreeTemplate< N >::rootAt(), and bpp::TreeTemplate< N >::unroot().
|
inline |
Definition at line 95 of file TreeTemplate.h.
References bpp::TreeTemplateTools::deleteSubtree(), bpp::TreeTemplate< N >::getRootNode(), bpp::TreeTemplate< N >::name_, and bpp::TreeTemplate< N >::root_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 216 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 204 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Number nodes.
Implements bpp::Tree.
Definition at line 268 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNodes().
|
inlinevirtual |
Change the root node.
Works on unrooted tree. If the tree is rooted, the method unroots it first.
nodeId | The id of the node that will be the new root. |
Implements bpp::Tree.
Definition at line 220 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode(), and bpp::TreeTemplate< N >::rootAt().
Referenced by bpp::TreeTemplateTools::getBestRootInSubtree_(), bpp::TreeTemplateTools::midRoot(), bpp::TreeTemplate< N >::newOutGroup(), and bpp::TreeTemplate< N >::rootAt().
|
inline |
Definition at line 463 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getBranchProperty(), bpp::TreeTemplate< N >::getDistanceToFather(), bpp::TreeTemplateTools::getPathBetweenAnyTwoNodes(), bpp::TreeTemplate< N >::hasDistanceToFather(), bpp::TreeTemplate< N >::isRooted(), bpp::TreeTemplate< N >::root_, and bpp::TreeTemplate< N >::unroot().
|
inlinevirtual |
Scale a given tree.
Multiply all branch lengths by a given factor.
factor | The factor to multiply all branch lengths with. |
NodeException | If a branch length is lacking. |
Implements bpp::Tree.
Definition at line 361 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_, and bpp::TreeTemplateTools::scaleTree().
|
inlinevirtual |
Set all the branch lengths of a tree.
brLen | The branch length to apply. |
Implements bpp::Tree.
Definition at line 345 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_, and bpp::TreeTemplateTools::setBranchLengths().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 210 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 190 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 125 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::name_.
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 176 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Implements bpp::Tree.
Definition at line 198 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::getNode().
|
inlinevirtual |
Definition at line 387 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_.
Referenced by bpp::TreeTemplateTools::dropLeaf(), bpp::TreeTemplateTools::dropSubtree(), and bpp::TreeTemplate< N >::unroot().
|
inlinevirtual |
Give a length to branches that don't have one in a tree.
brLen | The branch length to apply. |
Implements bpp::Tree.
Definition at line 353 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_, and bpp::TreeTemplateTools::setVoidBranchLengths().
|
inherited |
Swap two son nodes.
tree | The tree. |
nodeId | The node. |
i1 | First son node index. |
i2 | Second son node index. |
NodeNotFoundException | If the node is not found. |
IndexOutOfBoundsException | If one node index is not valid, or if the node |
|
inline |
Definition at line 374 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::root_, and bpp::TextTools::toString().
|
inlinevirtual |
Unroot a rooted tree.
UnrootedTreeException | If the tree is already rooted. |
Implements bpp::Tree.
Definition at line 226 of file TreeTemplate.h.
References bpp::TreeTemplate< N >::isRooted(), bpp::TreeTemplate< N >::root_, and bpp::TreeTemplate< N >::setRootNode().
Referenced by bpp::TreeTemplateTools::midRoot(), bpp::TreeTemplate< N >::newOutGroup(), and bpp::TreeTemplate< N >::rootAt().
|
private |
Definition at line 66 of file TreeTemplate.h.
Referenced by bpp::TreeTemplate< N >::getName(), bpp::TreeTemplate< N >::operator=(), and bpp::TreeTemplate< N >::setName().
|
private |
Fields:
Definition at line 65 of file TreeTemplate.h.
Referenced by bpp::TreeTemplate< N >::getBranchesId(), bpp::TreeTemplate< N >::getBranchLengths(), bpp::TreeTemplate< N >::getInnerNodes(), bpp::TreeTemplate< N >::getInnerNodesId(), bpp::TreeTemplate< N >::getLeafId(), bpp::TreeTemplate< N >::getLeaves(), bpp::TreeTemplate< N >::getLeavesId(), bpp::TreeTemplate< N >::getLeavesNames(), bpp::TreeTemplate< N >::getNextId(), bpp::TreeTemplate< N >::getNode(), bpp::TreeTemplate< N >::getNodes(), bpp::TreeTemplate< N >::getNodesId(), bpp::TreeTemplate< N >::getNumberOfBranches(), bpp::TreeTemplate< N >::getNumberOfLeaves(), bpp::TreeTemplate< N >::getNumberOfNodes(), bpp::TreeTemplate< N >::getRootId(), bpp::TreeTemplate< N >::getRootNode(), bpp::TreeTemplate< N >::getTotalLength(), bpp::TreeTemplate< N >::hasNode(), bpp::TreeTemplate< N >::isMultifurcating(), bpp::TreeTemplate< N >::isRooted(), bpp::TreeTemplate< N >::newOutGroup(), bpp::TreeTemplate< N >::operator=(), bpp::TreeTemplate< N >::rootAt(), bpp::TreeTemplate< N >::scaleTree(), bpp::TreeTemplate< N >::setBranchLengths(), bpp::TreeTemplate< N >::setRootNode(), bpp::TreeTemplate< N >::setVoidBranchLengths(), bpp::TreeTemplate< N >::swapNodes(), bpp::TreeTemplate< N >::TreeTemplate(), bpp::TreeTemplate< N >::unroot(), and bpp::TreeTemplate< N >::~TreeTemplate().