5 #ifndef BPP_PHYL_TREE_TREE_H
6 #define BPP_PHYL_TREE_TREE_H
139 virtual void setName(
const std::string& name) = 0;
159 virtual int getLeafId(
const std::string& name)
const = 0;
169 virtual std::vector<int>
getSonsId(
int parentId)
const = 0;
186 virtual void setNodeName(
int nodeId,
const std::string& name) = 0;
200 virtual bool isLeaf(
int nodeId)
const = 0;
204 virtual bool isRoot(
int nodeId)
const = 0;
Interface for phylogenetic tree objects.
virtual std::vector< int > getSonsId(int parentId) const =0
virtual bool isRoot(int nodeId) const =0
void swapNodes(const Tree &tree, int nodeId, size_t i1=0, size_t i2=1)
Swap two son nodes.
virtual bool isRooted() const =0
Tell if the tree is rooted.
virtual std::vector< int > getNodesId() const =0
virtual void setBranchLengths(double brLen)=0
Set all the branch lengths of a tree.
virtual Clonable * removeBranchProperty(int nodeId, const std::string &name)=0
virtual size_t getNumberOfNodes() const =0
virtual bool hasFather(int nodeId) const =0
virtual void setDistanceToFather(int nodeId, double length)=0
virtual void setBranchProperty(int nodeId, const std::string &name, const Clonable &property)=0
virtual std::string getNodeName(int nodeId) const =0
virtual void setName(const std::string &name)=0
virtual Clonable * getBranchProperty(int nodeId, const std::string &name)=0
virtual int getFatherId(int parentId) const =0
virtual std::string getName() const =0
Tree name.
virtual bool hasNodeProperty(int nodeId, const std::string &name) const =0
virtual std::vector< int > getBranchesId() const =0
virtual void resetNodesId()=0
Number nodes.
virtual bool unroot()=0
Unroot a rooted tree.
virtual int getNextId()=0
Get an id.
virtual bool hasNode(int nodeId) const =0
virtual void deleteNodeName(int nodeId)=0
virtual Clonable * getNodeProperty(int nodeId, const std::string &name)=0
virtual const Clonable * getBranchProperty(int nodeId, const std::string &name) const =0
virtual bool isLeaf(int nodeId) const =0
virtual std::vector< std::string > getBranchPropertyNames(int nodeId) const =0
virtual bool isMultifurcating() const =0
Tell if the tree is multifurcating.
virtual Clonable * removeNodeProperty(int nodeId, const std::string &name)=0
virtual bool hasDistanceToFather(int nodeId) const =0
virtual Tree * cloneSubtree(int newRootId) const =0
clones a Subtree rooted at given node Id
virtual void scaleTree(double factor)=0
Scale a given tree.
virtual double getTotalLength()=0
Get the total length (sum of all branch lengths) of a tree.
virtual bool hasNodeName(int nodeId) const =0
virtual void setNodeName(int nodeId, const std::string &name)=0
virtual void setVoidBranchLengths(double brLen)=0
Give a length to branches that don't have one in a tree.
virtual std::vector< double > getBranchLengths() const =0
virtual size_t getNumberOfBranches() const =0
virtual std::vector< std::string > getNodePropertyNames(int nodeId) const =0
virtual double getDistanceToFather(int nodeId) const =0
virtual bool hasNoSon(int nodeId) const =0
virtual std::vector< int > getLeavesId() const =0
virtual void newOutGroup(int nodeId)=0
Root a tree by specifying an outgroup.
virtual std::vector< int > getAncestorsId(int nodeId) const =0
virtual const Clonable * getNodeProperty(int nodeId, const std::string &name) const =0
virtual bool hasBranchProperty(int nodeId, const std::string &name) const =0
virtual void deleteDistanceToFather(int nodeId)=0
virtual std::vector< double > getBranchLengths()=0
Get all the branch lengths of a tree.
virtual std::vector< int > getInnerNodesId() const =0
virtual int getRootId() const =0
virtual void setNodeProperty(int nodeId, const std::string &name, const Clonable &property)=0
virtual void rootAt(int nodeId)=0
Change the root node.
virtual int getLeafId(const std::string &name) const =0
virtual size_t getNumberOfLeaves() const =0
virtual std::vector< std::string > getLeavesNames() const =0
Defines the basic types of data flow nodes.