sim.inner.tree: sim.inner.tree

View source: R/simInnerTree.R

sim.inner.treeR Documentation

sim.inner.tree

Description

Simulate the coalescence of Lineages within Compartments, and resolve migration events that may involve sampled Lineages.

Usage

sim.inner.tree(run)

Arguments

run:

R6 object of class Run. The Run object tracks the locations of Lineage objects among Compartments that are modified by transmission and migration; and tracks the presence/absence of Lineages that change with sampling, coalescence and bottleneck events.

Value

R6 object of class EventLogger

Examples

# load model
path <- system.file('extdata', 'SI.yaml', package='twt')

# load file and parse to construct MODEL object
settings <- yaml.load_file(path)
mod <- Model$new(settings)

# simulate outer tree - returns a Run object carrying EventLogger
run <- sim.outer.tree(mod)

# simulate inner tree
tree <- sim.inner.tree(run)
plot(tree)  # converts to a Phylo object


PoonLab/twt documentation built on Nov. 7, 2024, 4:18 a.m.