Package jebl.evolution.trees
Interface RootedTree
-
- All Superinterfaces:
Attributable
,Graph
,Tree
- All Known Implementing Classes:
CompactRootedTree
,FilteredRootedTree
,MutableRootedTree
,ReRootedTree
,RootedFromUnrooted
,RootedSubtree
,SimpleRootedTree
,SortedRootedTree
,TransformedRootedTree
public interface RootedTree extends Tree
A tree with a root (node with maximum height). This interface provides the concept of a direction of time that flows from the root to the tips. Each node in the tree has a node height that is less than its parent's height and greater than it children's heights.- Version:
- $Id: RootedTree.java 936 2008-08-06 14:12:07Z rambaut $
- Author:
- rambaut, Alexei Drummond
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jebl.evolution.graphs.Graph
Graph.NoEdgeException, Graph.Utils
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
conceptuallyUnrooted()
Due to current implementation limitations, trees store "branch" information in nodes.java.util.List<Node>
getChildren(Node node)
double
getHeight(Node node)
double
getLength(Node node)
Node
getParent(Node node)
Node
getRootNode()
The root of the tree has the largest node height of all nodes in the tree.boolean
hasHeights()
boolean
hasLengths()
boolean
isRoot(Node node)
-
Methods inherited from interface jebl.util.Attributable
getAttribute, getAttributeMap, getAttributeNames, removeAttribute, setAttribute
-
Methods inherited from interface jebl.evolution.graphs.Graph
getAdjacencies, getEdge, getEdgeLength, getEdges, getEdges, getNodes, getNodes, getNodes
-
Methods inherited from interface jebl.evolution.trees.Tree
getExternalEdges, getExternalNodes, getInternalEdges, getInternalNodes, getNode, getTaxa, getTaxon, isExternal, renameTaxa
-
-
-
-
Method Detail
-
getChildren
java.util.List<Node> getChildren(Node node)
- Parameters:
node
- the node whose children are being requested.- Returns:
- the list of nodes that are the children of the given node. The set may be empty for a terminal node (a tip).
-
hasHeights
boolean hasHeights()
- Returns:
- Whether this tree has node heights available
-
getHeight
double getHeight(Node node)
- Parameters:
node
- the node whose height is being requested.- Returns:
- the height of the given node. The height will be less than the parent's height and greater than it children's heights.
-
hasLengths
boolean hasLengths()
- Returns:
- Whether this tree has branch lengths available
-
getLength
double getLength(Node node)
- Parameters:
node
- the node whose branch length (to its parent) is being requested.- Returns:
- the length of the branch to the parent node (0.0 if the node is the root).
-
getParent
Node getParent(Node node)
- Parameters:
node
- the node whose parent is requested- Returns:
- the parent node of the given node, or null if the node is the root node.
-
getRootNode
Node getRootNode()
The root of the tree has the largest node height of all nodes in the tree.- Returns:
- the root of the tree.
-
conceptuallyUnrooted
boolean conceptuallyUnrooted()
Due to current implementation limitations, trees store "branch" information in nodes. So, internally rooted trees are genetrated when un-rooted would be more natural. This should be removed. If this is a rooted tree then it is rooted. This can really only confuse things. Trees are unrooted, RootedTrees are rooted. This is not an implementation limitation. It may be that a RootedTree has an arbitrary root but it is still rooted. With a rooted tree, it is convenient to store branch information at the node (i.e., for the branch above the node) because there is no "branch" object. Andrew. This function will probably become deprecated once the "development" tree viewer becomes in sync with the main tree viewer branch and some method of handling this concept has been introduced. Until then, this method remains.- Returns:
- true if tree(s) are to be viewed as unrooted
-
isRoot
boolean isRoot(Node node)
- Parameters:
node
- the node- Returns:
- true if the node is the root of this tree.
-
-