sim_pop: Simulates Evolution of Cell Population using a Continuous...

View source: R/sim_pop.R

sim_popR Documentation

Simulates Evolution of Cell Population using a Continuous Time Birth-Death Model

Description

This is the main entry function for carrying out simulations. The parameters (e.g. rates) are fixed for the duration of the simulation. Note: the implementation uses .C - so the actual data is copied on each invocation.

Usage

sim_pop(
  tree,
  params = list(),
  cfg = list(compartment = data.frame(val = c(0, 1), rate = c(-1, 1/120), popsize =
    c(1, 10000)), info = data.frame(val = c(0, 1, 1), fitness = c(-1, 0, 0.2))),
  b_verbose = TRUE,
  b_check = FALSE
)

Arguments

tree

Initial population of cells together with ancestry as an APE phylo object. Null indicates zygote.

cfg

List. Specifies the compartments together with populations size etc.

b_verbose

Boolean.

b_check

Boolean. Check output is valid APE phylo

param

List. Parameter overrides.. list(pop_size=5e4,n_sim_days=365*40,divide_rate=1/120.0,mut_per_div_rate=5.0,driver_dt=1e6,driver_mito=0.2,driver_muta=0,b_run_wright_fisher=1,b_stop_at_pop_size=0,tau_leaping_prop=0)

Value

simpop object

Examples

cfg=getDefaultConfig(target_pop_size,rate=initial_division_rate,ndriver=1,basefit = fitness)
params=list(n_sim_days=nyears_driver_acquisition*365,            b_stop_at_pop_size=1,b_stop_if_empty=0)
growthphase=sim_pop(NULL,params=params,cfg)

NickWilliamsSanger/rsimpop documentation built on Sept. 6, 2024, 12:42 a.m.