Simulate outbreaks of class 'phybreakdata'
, with the outbreak model of phybreak.
sim.phybreak(obsize = 50, popsize = NA, samplesperhost = 1, R0 = 1.5,
shape.gen = 10, mean.gen = 1, shape.sample = 10, mean.sample = 1,
additionalsampledelay = 0, wh.model = 3, wh.slope = 1, mu = 1e-04,
sequence.length = 10000, output.class = c("phybreakdata", "obkData"))
The outbreak size (number of cases) to obtain. If obsize = NA
, popsize
should be provided.
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
.
Number of samples to be taken per host, either a vector or a single number.
The basic reproduction ratio used for simulation. The offspring distribution is Poisson.
The shape parameter of the gamma-distributed generation interval.
The mean generation interval.
The shape parameter of the gamma-distributed sampling interval.
The mean sampling interval (for the first sample of each host).
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.
The model for within-host pathogen dynamics (effective pathogen population size = N*gE = actual population size * pathogen generation time), used to simulate coalescence events. Options are:
Effective size = 0, so coalescence occurs 'just before' transmission, in the infector
Effective size = Inf, so coalescence occurs 'just after' infection, in the infectee
Effective size at time t after infection = wh.slope * t
Within-host increase of effective population size, used if wh.model = 3
.
Expected number of mutations per nucleotide per unit of time along each lineage.
Number of available nucleotides for mutations.
Class of the simulation output. If package OutbreakTools is available, it is possible to choose
class 'obkData'
The simulation output, either 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
;
or as an object of class 'obkData'
(package OutbreakTools), containing the outbreak data in the following slots:
a data.frame
with individual labels as row names, a vector infector
,
and a vector date
containing the infection times (starting 01-01-2000)
an object of class 'obkSequences'
, with SNP data in dna
and sampling times
in meta$date
an object of class multiphylo
, containing a single tree of class phylo
Klinkenberg et al. (2017) Simultaneous inference of phylogenetic and transmission trees in infectious disease outbreaks. PLoS Comput Biol, 13(5): e1005495.
# NOT RUN {
simulation <- sim.phybreak()
# }
Run the code above in your browser using DataLab