run_driver_process_sim: Runs a multiple driver scenario

View source: R/wrapped_sims.R

run_driver_process_simR Documentation

Runs a multiple driver scenario

Description

The user specifies the rate at which drivers are introduced and the distribution the selective coefficients are drawn from. Note that unlike in run_selection_sim the drivers are allowed to stochastically die out. The drivers at the specified rate with the gap between successive introductions exponentially distributed.

Usage

run_driver_process_sim(
  initial_division_rate = 0.1,
  final_division_rate = 1/365,
  target_pop_size = 1e+05,
  drivers_per_year = 0.1,
  nyears = 40,
  fitnessGen = function() {     0 },
  bForceReseed = FALSE,
  offset = 0
)

Arguments

initial_division_rate
  • Rate of symmetric cell division during development

final_division_rate
  • Rate of symmetric cell division once population equilibrium is reached.

target_pop_size
  • Size of target population

drivers_per_year
  • The expected number of drivers per year

nyears
  • Total number of years to run the simulation

fitnessGen
  • Function that returns a single value for the selective coefficient

bForceReseed
  • Whether to reseed.

offset
  • time offset for choosing seed.

Value

simpop object.

Examples

fitnessGen=function(){
 trials=rexp(100,rate=30)
 idx=which(trials>0.05)
 if(length(idx)==0){
  fitnessGen()
 }else{
  trials[idx[1]]
 }
}
dps=run_driver_process_sim(0.1,1/(2*190),target_pop_size = 1e5,nyears = 30,fitness=fitnessGen,drivers_per_year = 5)


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