sim_wrightfisher | R Documentation |
Simulate Wright-Fisher evolution in a series of partially connected demes.
sim_wrightfisher(
N,
L,
alleles,
mu,
mig_mat,
t_out,
initial_method = 1,
initial_params = NULL,
silent = FALSE
)
N |
number of individuals per deme. Must be the same for all demes. |
L |
number of loci (assumed independent). |
alleles |
number of alleles. Can be a single number for all loci or a
vector of length |
mu |
mutation rate. Assumes finite-alleles model, with equal chance of mutating from any allele to any other. |
mig_mat |
migration matrix specifying the per-generation probability of an individual migrating from any deme (in rows) to any other deme (in columns). |
t_out |
vector of times at which results will be output. |
initial_method, initial_params |
method of initialising allele frequencies, and parameters that are used in initialisation. There are two possible options:
|
silent |
if |
Assumes a haploid population and independent loci (no linkage
disequilibrium). Implements a finite-alleles mutation model with equal
chance of mutating from any allele to any other. Initialises allele
frequencies by drawing from a symmetric Dirichlet(theta/k) distribution,
where theta = 2*N*mu
, which is the analytical equilibrium
distribution between drift and finite-alleles mutation, ignoring migration
between demes. Migration is implemented by proposing random swaps of
individuals between demes, thereby ensuring population sizes remain
constant over time. For this reason, N
must be the same for all
demes.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.