bpp-phyl3
3.0.0
|
Interface for phylogenetic tree objects. More...
#include <Bpp/Phyl/Tree/Tree.h>
Public Member Functions | |
Tree () | |
virtual | ~Tree () |
Tree * | clone () const =0 |
virtual Tree * | cloneSubtree (int newRootId) const =0 |
clones a Subtree rooted at given node Id More... | |
virtual size_t | getNumberOfLeaves () const =0 |
virtual size_t | getNumberOfNodes () const =0 |
virtual size_t | getNumberOfBranches () const =0 |
virtual std::vector< double > | getBranchLengths () const =0 |
virtual std::vector< std::string > | getLeavesNames () const =0 |
virtual void | rootAt (int nodeId)=0 |
Change the root node. More... | |
virtual void | newOutGroup (int nodeId)=0 |
Root a tree by specifying an outgroup. More... | |
virtual bool | isRooted () const =0 |
Tell if the tree is rooted. More... | |
virtual bool | unroot ()=0 |
Unroot a rooted tree. More... | |
virtual void | resetNodesId ()=0 |
Number nodes. More... | |
virtual bool | isMultifurcating () const =0 |
Tell if the tree is multifurcating. More... | |
virtual std::vector< double > | getBranchLengths ()=0 |
Get all the branch lengths of a tree. More... | |
virtual double | getTotalLength ()=0 |
Get the total length (sum of all branch lengths) of a tree. More... | |
virtual void | setBranchLengths (double brLen)=0 |
Set all the branch lengths of a tree. More... | |
virtual void | setVoidBranchLengths (double brLen)=0 |
Give a length to branches that don't have one in a tree. More... | |
virtual void | scaleTree (double factor)=0 |
Scale a given tree. More... | |
virtual int | getNextId ()=0 |
Get an id. More... | |
virtual std::string | getName () const =0 |
Tree name. More... | |
virtual void | setName (const std::string &name)=0 |
Retrieving ids. | |
virtual int | getRootId () const =0 |
virtual int | getLeafId (const std::string &name) const =0 |
virtual std::vector< int > | getLeavesId () const =0 |
virtual std::vector< int > | getNodesId () const =0 |
virtual std::vector< int > | getInnerNodesId () const =0 |
virtual std::vector< int > | getBranchesId () const =0 |
virtual std::vector< int > | getSonsId (int parentId) const =0 |
virtual std::vector< int > | getAncestorsId (int nodeId) const =0 |
virtual int | getFatherId (int parentId) const =0 |
virtual bool | hasFather (int nodeId) const =0 |
Dealing with node names. | |
virtual std::string | getNodeName (int nodeId) const =0 |
virtual void | setNodeName (int nodeId, const std::string &name)=0 |
virtual void | deleteNodeName (int nodeId)=0 |
virtual bool | hasNodeName (int nodeId) const =0 |
Several tests. | |
virtual bool | hasNode (int nodeId) const =0 |
virtual bool | isLeaf (int nodeId) const =0 |
virtual bool | hasNoSon (int nodeId) const =0 |
virtual bool | isRoot (int nodeId) const =0 |
Acting on topology. | |
void | swapNodes (const Tree &tree, int nodeId, size_t i1=0, size_t i2=1) |
Swap two son nodes. More... | |
Dealing with branch lengths. | |
virtual double | getDistanceToFather (int nodeId) const =0 |
virtual void | setDistanceToFather (int nodeId, double length)=0 |
virtual void | deleteDistanceToFather (int nodeId)=0 |
virtual bool | hasDistanceToFather (int nodeId) const =0 |
Node properties. | |
virtual bool | hasNodeProperty (int nodeId, const std::string &name) const =0 |
virtual void | setNodeProperty (int nodeId, const std::string &name, const Clonable &property)=0 |
virtual Clonable * | getNodeProperty (int nodeId, const std::string &name)=0 |
virtual const Clonable * | getNodeProperty (int nodeId, const std::string &name) const =0 |
virtual Clonable * | removeNodeProperty (int nodeId, const std::string &name)=0 |
virtual std::vector< std::string > | getNodePropertyNames (int nodeId) const =0 |
Branch properties. | |
virtual bool | hasBranchProperty (int nodeId, const std::string &name) const =0 |
virtual void | setBranchProperty (int nodeId, const std::string &name, const Clonable &property)=0 |
virtual Clonable * | getBranchProperty (int nodeId, const std::string &name)=0 |
virtual const Clonable * | getBranchProperty (int nodeId, const std::string &name) const =0 |
virtual Clonable * | removeBranchProperty (int nodeId, const std::string &name)=0 |
virtual std::vector< std::string > | getBranchPropertyNames (int nodeId) const =0 |
|
pure virtual |
Implements bpp::Clonable.
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
clones a Subtree rooted at given node Id
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Get all the branch lengths of a tree.
NodeException | If a branch length is lacking. |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::BootstrapValuesTreeDrawingListener::afterDrawBranch(), bpp::TreeTemplateTools::cloneSubtree(), bpp::TreeTools::nodeToParenthesis(), and bpp::TreeTools::treeToParenthesis().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTemplateTools::cloneSubtree().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::BranchLengthsTreeDrawingListener::afterDrawBranch(), bpp::TreeTemplateTools::cloneSubtree(), bpp::TreeTools::computeBranchLengthsGrafen(), bpp::TreeTools::constrainedMidPointRooting(), bpp::TreeTools::convertToClockTree(), bpp::TreeTools::convertToClockTree2(), bpp::TreeTools::getBranchLengths(), bpp::TreeTools::getDistanceBetweenAnyTwoNodes(), bpp::TreeTools::getHeight(), bpp::TreeTools::getHeights(), bpp::TreeTools::getTotalLength(), bpp::TreeTools::midpointRooting(), bpp::TreeTools::nodeToParenthesis(), bpp::TreeTools::scaleTree(), and bpp::TreeTools::statFromNode_().
|
pure virtual |
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTools::getDistanceMatrix(), and bpp::TreeTools::midpointRooting().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
|
pure virtual |
Tree name.
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::PairedSiteLikelihoods::appendModel().
|
pure virtual |
Get an id.
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::LeafNamesTreeDrawingListener::afterDrawNode(), bpp::LabelInnerNodesTreeDrawingListener::afterDrawNode(), bpp::LabelCollapsedNodesTreeDrawingListener::afterDrawNode(), bpp::TreeTemplateTools::cloneSubtree(), bpp::TreeTools::nodeToParenthesis(), bpp::TreeTools::searchLeaf(), bpp::TreeTools::treeToParenthesis(), and bpp::NexusIOTree::write_().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTemplateTools::cloneSubtree().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTemplateTools::cloneSubtree().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTools::checkIds(), bpp::SubstitutionModelSet::checkOrphanNodes(), bpp::SubstitutionModelSet::checkUnknownNodes(), bpp::SubstitutionModelSetTools::createHomogeneousModelSet(), and bpp::SubstitutionModelSetTools::createNonHomogeneousModelSet().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::BipartitionList::BipartitionList().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::SubstitutionModelSet::checkOrphanNodes(), bpp::SubstitutionModelSet::checkUnknownNodes(), bpp::TreeTools::computeBranchLengthsGrafen(), bpp::TreeTools::constrainedMidPointRooting(), bpp::SubstitutionModelSetTools::createHomogeneousModelSet(), bpp::SubstitutionModelSetTools::createNonHomogeneousModelSet(), bpp::TreeLikelihoodTools::getAncestralFrequencies(), bpp::TreeTools::getLastCommonAncestor(), bpp::TreeTools::initBranchLengthsGrafen(), bpp::TreeTools::midpointRooting(), bpp::RNonHomogeneousMixedTreeLikelihood::RNonHomogeneousMixedTreeLikelihood(), bpp::TreeTemplate< N >::TreeTemplate(), and bpp::TreeTools::treeToParenthesis().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTemplateTools::cloneSubtree(), bpp::TreeTools::computeBranchLengthsGrafen(), bpp::TreeTools::constrainedMidPointRooting(), bpp::TreeTools::convertToClockTree(), bpp::TreeTools::convertToClockTree2(), bpp::TreeLikelihoodTools::getAncestralFrequencies_(), bpp::TreeTools::getBranchLengths(), bpp::TreeTools::getDepth(), bpp::TreeTools::getDepths(), bpp::TreeTools::getHeight(), bpp::TreeTools::getHeights(), bpp::TreeTools::getLeavesId(), bpp::TreeTools::getMaxId(), bpp::TreeTools::getNodesId(), bpp::TreeTools::getNumberOfLeaves(), bpp::TreeTools::getTotalLength(), bpp::RNonHomogeneousMixedTreeLikelihood::init(), bpp::TreeTools::initBranchLengthsGrafen(), bpp::TreeTools::midpointRooting(), bpp::TreeTools::nodeToParenthesis(), bpp::TreeTools::statFromNode_(), and bpp::TreeTools::treeToParenthesis().
|
pure virtual |
Get the total length (sum of all branch lengths) of a tree.
NodeException | If a branch length is lacking. |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::BranchLengthsTreeDrawingListener::afterDrawBranch(), bpp::TreeTemplateTools::cloneSubtree(), bpp::TreeTools::computeBranchLengthsGrafen(), bpp::TreeTools::convertToClockTree(), bpp::TreeTools::convertToClockTree2(), bpp::TreeTools::getBranchLengths(), bpp::TreeTools::getHeight(), bpp::TreeTools::getHeights(), bpp::TreeTools::getTotalLength(), bpp::TreeTools::nodeToParenthesis(), bpp::TreeTools::scaleTree(), and bpp::TreeTools::setVoidBranchLengths().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTools::getAncestors(), bpp::TreeTools::getPathBetweenAnyTwoNodes(), and bpp::TreeTools::scaleTree().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTools::computeBranchLengthsGrafen(), bpp::TreeTools::convertToClockTree(), bpp::TreeTools::convertToClockTree2(), bpp::TreeTools::getBranchLengths(), bpp::TreeTools::getDepth(), bpp::TreeTools::getDepths(), bpp::TreeTools::getDistanceBetweenAnyTwoNodes(), bpp::TreeTools::getHeight(), bpp::TreeTools::getHeights(), bpp::TreeTools::getLeavesId(), bpp::TreeTools::getNodesId(), bpp::TreeTools::getNumberOfLeaves(), bpp::TreeTools::getPathBetweenAnyTwoNodes(), bpp::TreeTools::getTotalLength(), bpp::TreeTools::initBranchLengthsGrafen(), bpp::TreeTools::nodeToParenthesis(), bpp::TreeTools::scaleTree(), bpp::TreeTools::setBranchLengths(), and bpp::TreeTools::setVoidBranchLengths().
|
pure virtual |
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTools::nodeToParenthesis(), bpp::TreeTools::searchLeaf(), and bpp::TreeTools::treeToParenthesis().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::LeafNamesTreeDrawingListener::afterDrawNode(), bpp::TreeTools::computeBootstrapValues(), bpp::TreeLikelihoodTools::getAncestralFrequencies_(), bpp::TreeTools::getLeavesId(), bpp::TreeTools::getNumberOfLeaves(), bpp::DRTreeLikelihoodTools::getPosteriorProbabilitiesPerStatePerRate(), and bpp::TreeTools::statFromNode_().
|
pure virtual |
Tell if the tree is multifurcating.
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTools::constrainedMidPointRooting().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Tell if the tree is rooted.
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::BipartitionList::BipartitionList(), bpp::TreeTools::constrainedMidPointRooting(), and bpp::TreeTools::midpointRooting().
|
pure virtual |
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. |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTools::midpointRooting().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Number nodes.
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
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. |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
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. |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Set all the branch lengths of a tree.
brLen | The branch length to apply. |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTools::computeBootstrapValues().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTools::computeBranchLengthsGrafen(), bpp::TreeTools::constrainedMidPointRooting(), bpp::TreeTools::convertToClockTree(), bpp::TreeTools::initBranchLengthsGrafen(), bpp::TreeTools::midpointRooting(), bpp::TreeTools::scaleTree(), bpp::TreeTools::setBranchLengths(), and bpp::TreeTools::setVoidBranchLengths().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::NexusIOTree::write_().
|
pure virtual |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
|
pure virtual |
Give a length to branches that don't have one in a tree.
brLen | The branch length to apply. |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
void bpp::Tree::swapNodes | ( | const Tree & | tree, |
int | nodeId, | ||
size_t | i1 = 0 , |
||
size_t | i2 = 1 |
||
) |
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 |
|
pure virtual |
Unroot a rooted tree.
UnrootedTreeException | If the tree is already rooted. |
Implemented in bpp::TreeTemplate< N >, bpp::TreeTemplate< bpp::Node >, and bpp::TreeTemplate< bpp::NodeTemplate >.
Referenced by bpp::TreeTools::midpointRooting().