Simulate genetic data from a simple model of P. falciparum epidemiology and genetics.
sim_falciparum(
a = 0.3,
p = 0.9,
mu = -log(p),
u = 12,
v = 10,
g = 10,
prob_infection = 0.1,
duration_infection = dgeom(1:500, 1/100),
infectivity = 0.1,
max_infections = 5,
H = 1000,
seed_infections = 100,
M = 1000,
mig_matrix = diag(length(M)),
L = 24,
mean_oocysts = 2,
mean_products = 5,
recomb_prob = 0.1,
max_time = max(sample_dataframe$time),
sample_dataframe = data.frame(deme = 1, time = 365, n = 100),
report_progress = TRUE
)human blood feeding rate. The proportion of mosquitoes that feed on humans each day.
mosquito probability of surviving one day.
mosquito instantaneous death rate. mu = -log(p) unless otherwise specified.
intrinsic incubation period. The number of days from infection to blood-stage infection in a human host.
extrinsic incubation period. The number of days from infection to becoming infectious in a mosquito.
lag time between human blood-stage infection and production of gametocytes.
probability a human becomes infected after being bitten by an infected mosquito. Can be a scalar or a vector. If a vector then each value applies over subsequent infections, creating possibility of an exposure-driven immunity model.
vector specifying probability distribution of time (in days) of a malaria episode.
probability a mosquito becomes infected after biting an infective human host.
maximum number of infections that an individual can hold simultaneously.
human population size, which is assumed to be the same in every deme.
vector specifying the initial number of infected humans in each deme.
vector specifying mosquito population size (strictly the number of adult female mosquitoes) in each deme.
migration matrix specifing the daily probability of migrating from each deme to each other deme. Migration must be equal in both directions, meaning this matrix must be symmetric.
number of loci. The maximum number of loci is 1000, as at higher numbers haplotypes begin to exceed integer representation (2^L).
the average number of viable oocysts generated from gametocytes upon biting an infective host. The actual number of oocysts is generated from a zero-truncated Poisson distribution with this mean.
parasite genotypes are passed from mosquito to host by
sampling N times with replacement from the available oocysts products (the
available number of products is 4 times the number of oocysts). N is drawn
independently for each infection from a zero-truncated Poisson distribution
with mean given by mean_products. Hence, large values of this
parameter increase the chance of co-transmission of multiple genotypes,
while small values increase the chance of picking up just a single
genotype.
the probability of a recombination breakpoint between any sequential pair of loci. Assumed to be the same for all loci.
number of days in the simulation.
a dataframe specifying outputs from the model. Must contain the following three columns:
deme: which numbered deme to sample from.
time: the day on which samples are taken.
n: the number of hosts to randomly sample (without
replacement) from the population.
if TRUE then a progress bar is printed to the
console during simuation.