Skip to contents

Truncate a tree at a distance dist from the root. Useful for identifying subclones and especially for embryonic development rate estimation. Imagine taking a tree, drawing a line across it at a time dist, and only evaluating the tree from above that line.

Usage

truncate_tree(tree, dist)

Arguments

tree

An ultrametric (time-based) or mutation-based tree of class 'phylo' (see ape package for documentation).

dist

Evolutionary distance (in time or mutations) down the tree at which to truncate. Note that the units should be the same as the units for the tree's edge lengths.

Value

A truncated tree with the same units of edge lengths as the input tree

Examples

tree <- cloneRate::realCloneData$fullTrees[["KX001"]]
dist=5
truncated_tree <- truncate_tree(tree, dist)