simulatetree: Simulate tree and sequences in two-population SIR-model

Description Usage Arguments Value Author(s)

Description

simulatetree does a deterministic simulation of a two-population SIR-model, takes samples and simulates a phylogenetic tree. For all this, it makes use of phydynR (https://github.com/emvolz-phylodynamics/phydynR). Then it simulates DNA-sequences for these samples, with simSeq (phangorn).

Usage

1
2
3
4
5
simulatetree(N = c(100, 10000), beta = array(c(1.5, 0, 0, 2, 1.5, 0, 0.1,
  2), dim = c(2, 2, 2)), gamma = 1, mu = 0.05, I0 = c(1, 1), t1 = c(50,
  100), res = 1000, sampletimes = c("incidence", "regular"),
  samplesize = 200, sampleperiod = c(0, tail(t1, 1)),
  sampledist = c("incidence", "popsize", "fixed"), samplebias = 1, ...)

Arguments

N

the population sizes of the two populations

beta

an array of 2x2 transmission rate matrices. The third dimension is the number of matrices, which is the number of time intervals with different transmission rates. Transmission is modelled with frequency-dependent transmission terms (division by N).

gamma

the recovery rate

mu

the death rate. Births balance deaths.

I0

initial numbers of infecteds. The rest is assumed susceptible.

t1

a vector with times at which the transmission rates change to the next matrix in beta. The last time is the duration of the simulation

res

resolution of the epidemic simulation per transmission rate interval (ODE solver)

sampletimes

indicates if sampling occurs at random times proportional to incidence (default "incidence") or at random uniform times ("regular")

samplesize

the number of samples to be taken

sampleperiod

the time interval from which the sampling times should be taken

sampledist

indicates how samples should be divided over the two populations, apart from bias. The default "incidence" indicates proportionality to incidence; "popsize" indicates proportionality to population size; "fixed" indicates no proportionality, i.e. fifty-fifty

samplebias

indicates the extra weight (multiplication factor) given for sampling the first population relative to the second. If equal to 1, the weight is completely determined by sampledist.

...

arguments to be passed to simSeq (phangorn)

Value

A list with a tree (class phylo), and a set of sequences (class phyDat), and the time course of the prevalence (and susceptible populations).

Author(s)

Don Klinkenberg (don@xs4all.nl)


Hackout3/saphy documentation built on May 6, 2019, 10:52 p.m.