sim_phybreak: Outbreak simulation.

Description Usage Arguments Value Author(s) References Examples

View source: R/sim_phybreak.R

Description

Simulate outbreaks of class phybreakdata, with the outbreak model of phybreak (sim.phybreak is deprecated).

Usage

1
2
3
4
5
6
7
8
9
sim_phybreak(obsize = 50, popsize = NA, samplesperhost = 1,
  R0 = 1.5, spatial = FALSE, gen.shape = 10, gen.mean = 1,
  sample.shape = 10, sample.mean = 1, additionalsampledelay = 0,
  wh.model = "linear", wh.bottleneck = "auto", wh.slope = 1,
  wh.exponent = 1, wh.level = 0.1, dist.model = "power",
  dist.exponent = 2, dist.scale = 1, mu = 1e-04,
  sequence.length = 10000, ...)

sim.phybreak(...)

Arguments

obsize

The outbreak size (number of cases) to obtain. If obsize = NA, popsize should be provided.

popsize

The population size in which to simulate. If it is not defined (default), an optimal population size will be chosen based on R0 and obsize. Be aware that choosing a popsize and an obsize can severely increase the simulation time, depending on R0.

samplesperhost

Number of samples to be taken per host, either a vector or a single number.

R0

The basic reproduction ratio used for simulation. The offspring distribution is Poisson.

spatial

If TRUE, the hosts are placed on a square with density 1, and a distance kernel is used to model transmission probabilities between the hosts.

gen.shape

The shape parameter of the gamma-distributed generation interval.

gen.mean

The mean generation interval.

sample.shape

The shape parameter of the gamma-distributed sampling interval.

sample.mean

The mean sampling interval (for the first sample of each host).

additionalsampledelay

Sampling intervals since first sampling times of each host. Values in this vector will be used first for all additional samples of host 1, then of host 2, etc.

wh.model

The model for within-host pathogen dynamics (effective pathogen population size = N*gE = actual population size * pathogen generation time), used to simulate coalescence events. Names and numbers are allowed. Options are:

  1. "single": effective size = 0, so coalescence occurs 'just before' transmission in the infector (complete bottleneck)

  2. "infinite": effective size = Inf, with complete bottleneck, so coalescence occurs 'just after' transmission in the infectee

  3. "linear": effective size at time t after infection = wh.level + wh.slope * t (complete or wide bottleneck; if complete, wh.level = 0)

  4. "exponential": effective size at time t after infection = wh.level * exp(wh.exponent * t) (wide bottleneck)

  5. "constant": effective size = wh.level (wide bottleneck)

wh.bottleneck

Whether the bottleneck should be complete or wide, which is only an option if wh.model = "linear" (in that case, "auto" defaults to "complete").

wh.slope

Within-host slope, used if wh.model = "linear".

wh.exponent

Within-host exponent, used if wh.model = "exponential"

wh.level

Within-host effective pathogen size at transmission, used if wh.bottleneck = "wide" (if wh.model = "exponential" or "constant", and optional if wh.model = "linear")

dist.model

The distance kernel to use if spatial = TRUE. Options are:

  1. "power": a power law function pr(dist) ~ 1 / (1 + (dist/dist.scale) ^ dist.exponent)

  2. "exponential": an exponential function pr(dist) ~ exp(-dist.exponent * dist)

dist.exponent

Distance model exponent.

dist.scale

Distance model scale, only with power law distance model.

mu

Expected number of mutations per nucleotide per unit of time along each lineage.

sequence.length

Number of available nucleotides for mutations.

...

If arguments from previous versions of this function are used, they may be interpreted correctly through this argument, but it is better to provide the correct argument names.

Value

The simulation output as an object of class 'phybreakdata' with sequences (class 'phyDat') and sampling times (which would be the observations), and infection times, infectors, and phylogenetic tree of class phylo.

Author(s)

Don Klinkenberg don@xs4all.nl

References

Klinkenberg et al. (2017) Simultaneous inference of phylogenetic and transmission trees in infectious disease outbreaks. PLoS Comput Biol, 13(5): e1005495.

Examples

1
simulation <- sim_phybreak()

donkeyshot/phybreak documentation built on Sept. 17, 2021, 9:32 p.m.