sim_lattice_biallelic | R Documentation |
Simulate evolution under the lattice model of Kimura and Weiss. Can be defined over a plane or over a torus. Outputs the raw count of the reference allele in each deme, replicated over all specified output times as a list of matrices.
sim_lattice_biallelic(
demes_x,
demes_y,
N,
mu,
m,
t_out,
p_init = 0,
torus = FALSE,
silent = FALSE
)
demes_x, demes_y |
number of demes in each dimension. |
N |
number of individuals per deme. The same for all demes. |
mu |
mutation rate. Assumes finite-alleles model, with equal chance of mutating to each allele. |
m |
per-generation probability of migrating to an adjacent deme in the
x- and y-dimensions. The total probability of leaving a given deme is
therefore |
t_out |
vector of times at which results will be output. |
p_init |
the initial allele frequency, which is the same in all demes. |
torus |
if |
silent |
if |
Assumes a haploid population of size N
and a single,
biallelic locus. Implements a finite-alleles mutation model with equal
chance of mutating to each allele. Initialises allele frequencies at
p_init
in all demes. Under the lattice model demes can only exchange
migrants with other demes immediately adjacent, and do so with probability
m/2
in both the x- and y-dimensions. This means the total probability
of migrating is actually 2m
for each individual in a deme, which
seems strange but is how the lattice model was described in the original
papers of Kimura and Weiss. By default, boundaries are reflecting, meaning
demes at the edges have half the migration probability of demes further in.
This tends to cause edge effects due to the buildup of relatedness at the
boundaries. The option exists to make boundaries periodic, in which case
the lattice model is defined over a torus rather than a plane. This
eliminates edge effects, but leads to complex correlations over long
distances.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.