Package jebl.evolution.trees

# Class TransformedRootedTree

java.lang.Object
jebl.evolution.trees.AbstractRootedTree
jebl.evolution.trees.FilteredRootedTree
jebl.evolution.trees.TransformedRootedTree

All Implemented Interfaces:
  `Graph`, `RootedTree`, `Tree`, `Attributable`

public class TransformedRootedTree extends FilteredRootedTree
This RootedTree class wraps another RootedTree and transforms the branch lengths and node heights using various functions. Currently implemented are equal lengths (all branch lengths are 1.0) and cladogram (the height of a node is proportional to the number of external nodes). Note that all these functions are recalculated on the fly for every call to getHeight and getLength and it may be desirable to precalculate and cache them.

Version:
  $Id: TransformedRootedTree.java 545 2006-11-28 00:08:34Z twobeers $
Author:
  Andrew Rambaut

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`TransformedRootedTree.Transform`

## Nested classes/interfaces inherited from interface jebl.evolution.graphs.Graph

`Graph.NoEdgeException, Graph.Utils`

## Constructor Summary

Constructors
Constructor
Description
`TransformedRootedTree(RootedTree source, TransformedRootedTree.Transform transform)`

## Method Summary

Modifier and Type
Method
Description
`double`
`getHeight(Node node)`
`double`
`getLength(Node node)`
`boolean`
`hasHeights()`
`boolean`
`hasLengths()`
`boolean`
`isHeightsKnown()`
`boolean`
`isLengthsKnown()`

### Methods inherited from class jebl.evolution.trees.FilteredRootedTree

`conceptuallyUnrooted, getAdjacencies, getAttribute, getAttributeMap, getAttributeNames, getChildren, getEdge, getEdgeLength, getEdges, getEdges, getExternalEdges, getExternalNodes, getInternalEdges, getInternalNodes, getNode, getNodes, getNodes, getNodes, getParent, getRootNode, getSource, getTaxa, getTaxon, isExternal, isRoot, removeAttribute, renameTaxa, setAttribute`

### Methods inherited from class jebl.evolution.trees.AbstractRootedTree

`getExternalNodeCount, getExternalNodes`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TransformedRootedTree

public TransformedRootedTree(RootedTree source, TransformedRootedTree.Transform transform)

## Method Details

### hasHeights

public boolean hasHeights()

Specified by:
  `hasHeights` in interface `RootedTree`
Overrides:
  `hasHeights` in class `FilteredRootedTree`
Returns:
  Whether this tree has node heights available

### getHeight

public double getHeight(Node node)

Specified by:
  `getHeight` in interface `RootedTree`
Overrides:
  `getHeight` in class `FilteredRootedTree`
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

public boolean hasLengths()

Specified by:
  `hasLengths` in interface `RootedTree`
Overrides:
  `hasLengths` in class `FilteredRootedTree`
Returns:
  Whether this tree has branch lengths available

### getLength

public double getLength(Node node)

Specified by:
  `getLength` in interface `RootedTree`
Overrides:
  `getLength` in class `FilteredRootedTree`
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).

### isHeightsKnown

public boolean isHeightsKnown()

Specified by:
  `isHeightsKnown` in interface `RootedTree`
Overrides:
  `isHeightsKnown` in class `FilteredRootedTree`
Returns:
  Whether the node heights are known or need to be recalculated from the lengths

### isLengthsKnown

public boolean isLengthsKnown()

Specified by:
  `isLengthsKnown` in interface `RootedTree`
Overrides:
  `isLengthsKnown` in class `FilteredRootedTree`
Returns:
  Whether the branch lengths are known or need to be recalculated from the heights