Run: Run

RunR Documentation

Run

Description

Run is an R6 class that is derived from Model. It inherits all simulation model features including CompartmentTypes, Compartments, and Lineages. Unlike Model, a Run object is used to track an outcome of the simulation model and is therefore mutable where Model is immutable. For example, Run tracks which lineages are extant and the numbers of pairs of Lineages that can coalesce over time. In addition, the number of unsampled compartments is stochastic outcome of the model that is tracked at this level.

Public fields

lineages:

list of Lineage objects

extant.lineages:

list of Lineage objects filtered by sampling time

locations:

a named list of Lineage objects keyed by Compartment

counts:

a data frame of population dynamics

Active bindings

lineages:

list of Lineage objects

extant.lineages:

list of Lineage objects filtered by sampling time

locations:

a named list of Lineage objects keyed by Compartment

counts:

a data frame of population dynamics

Methods

Public methods


Method new()

Usage
Run$new(model)

Method get.eventlog()

Usage
Run$get.eventlog()

Method set.eventlog()

Usage
Run$set.eventlog(e)

Method get.counts()

Usage
Run$get.counts()

Method set.counts()

Usage
Run$set.counts(df)

Method get.initial.conds()

Usage
Run$get.initial.conds()

Method get.fixed.samplings()

Usage
Run$get.fixed.samplings()

Method get.types()

Usage
Run$get.types()

Method get.compartments()

Usage
Run$get.compartments()

Method get.lineages()

Usage
Run$get.lineages()

Method get.unsampled.hosts()

Usage
Run$get.unsampled.hosts()

Method get.num.extant()

Usage
Run$get.num.extant(time, location = NA)

Method get.sampling.times()

Usage
Run$get.sampling.times()
Arguments
time:

reference time point

location:

(optional) name of Compartment object

Returns

integer, number of extant lineages

Retrieves a list of Lineage objects that are extant at the specified time. Note that because Lineages are being added and removed through coalescent and bottleneck events, the output will change over the course of inner tree simulation.


Method get.extant.lineages()

Usage
Run$get.extant.lineages(time, comp = NA)

Method add.lineage()

Usage
Run$add.lineage(lineage)
Arguments
time:

coalescent (cumulative time) of the simulation

comp:

R6 object of class Compartment

Returns

a named list of Lineage objects.


Method remove.lineage()

Usage
Run$remove.lineage(lineage)

Method move.lineage()

Usage
Run$move.lineage(lineage, comp)

Method get.locations()

Usage
Run$get.locations()

Method get.node.ident()

Usage
Run$get.node.ident(prefix = "Node")

Method generate.unsampled()

Usage
Run$generate.unsampled(type.name)

Method clear.unsampled()

Usage
Run$clear.unsampled()

Method clone()

The objects of this class are cloneable with this method.

Usage
Run$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Note

https://github.com/r-lib/roxygen2/issues/415 count the number of Lineages that are extant (has been sampled) more recently than the user-specified time


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