GRTNode

public class tyche.evolution.tree.GRTNode extends beast.base.evolution.tree.Node

A GermlineRootTree compatible node type, that keeps the height of the germline and the root together.

GRTNode germline
double EPSILON

branch length between root and germline since branches shouldn’t be zero

protected void addGermline(GRTNode germ)

associate a germline node with this node

Parameters:

germ – GRTNode representing the germline to associate with this node

protected boolean isGermline()

is this node the germline?

Returns:

true if germline, otherwise false

public boolean hasGermline()

does this node have the germline as a child?

Returns:

true if germline is associated with this node, otherwise false

private void setHeight(double height, boolean isDA)

Private helper function that sets the height of this node, either as normal or as data augmentation, but keeps

the germline and root height together.

Parameters:
  • height – new node height

  • isDA – is this data augmentation?

protected void setSuperHeight(double height, boolean isDA)

Helper function that calls the parent class/super set height function, appropriate for normal nodes (i.e. not

part of a germline-root pair).

Parameters:
  • height – new node height

  • isDA – is this data augmentation?

private void setNormalDirt()

Helper function to set dirt normally (non-data-augmentation), i.e. this node and all its internal nodes in its

subtree.

public void assignTo(Node nodes)

assign values to a tree in array representation

public void assignFrom(Node nodes, Node node)

assign values from a tree in array representation

public void setHeight(double height)

Sets the height of this node, but if this node is the germline or the root, sets their heights together.

Parameters:

height – the new height of this node

public void setHeightDA(double height)

Sets the height of this node in operators for data augmentation likelihood, but if this node is the germline or

the root, sets their heights together.

It only changes this node to be dirty, not any of child nodes.

Parameters:

height – the new height of this node

public double getMinimumHeight()

Get the minimum height this node can be set to.

If this node is the root and has the germline associated with it, the minimum height is just the height of

its non-germline child.

In all other cases, this is the maximum of its children’s heights.

Returns:

a double representing the minimum height this node can be set to

private void adjustRootAndGermline(double newHeight)

Helper function to set the root and the germline height together.

Parameters:

newHeight – new root height

static public GRTNode makeNewFromNode(Node original)

Makes a new GRTNode from a regular node

Parameters:

original – the node to recreate as a GRTNode

Returns:

a new GRTNode

public double getHeight()

get the height of this node

Returns:

double representing the height of this node

public double getDate()

get the date of this node

Returns:

double representing the date of this node

public void addChild(Node child)

Adds a child to this node.

Parameters:

child – the child to add

public void removeChild(Node child)

Removes a child from this node, if it is the germline, unassociates germline from this node.

Parameters:

child – the child to remove

public Node copy()

Makes a deepy copy of a node.

Returns:

(deep) copy of node

public int scale(double scale)

scale height of this node and all its internal descendants, but if this node is the root and has a germline

child, set the germline height with the root height.

Parameters:

scale – scale factor

Returns:

degrees of freedom scaled (used for HR calculations)