siteFrequency {cloneRate} | R Documentation |
Get site frequency spectrum of a tree
Description
siteFrequency()
calculates the site frequency in
units of time or mutations, as well as a normalized frequency.
Usage
siteFrequency(tree, includeStem = FALSE)
Arguments
tree |
An ultrametric or mutation-based tree subset to include only the clone of interest. Alternatively, a list with several such trees. |
includeStem |
Boolean indicating whether we should count the stem of the tree as contributing to the site frequency distribution. Default is FALSE. |
Value
A data.frame with three columns: the number of descendant cells, site frequency in units of time or mutations, and normalized site frequency. If a list of trees is input, output will be a list of such data.frames.
See Also
internalLengths()
and sharedMuts()
which
use the sum of edge lengths ancestral to between 2 and n-1 tips to calculate
a growth rate.
Examples
# Get site frequency of a single tree
example.df <- siteFrequency(exampleUltraTrees[[1]])
# Get site frequency of a list of trees
example.list <- siteFrequency(exampleMutTrees)
[Package cloneRate version 0.2.3 Index]