feat_selection: Feature: Selection
This feature adds selection to a model. Only one site per locus can be under
selection. Using this feature requires that
msms is installed, see
(strength_AA = 0, strength_Aa = 0, strength_aa = 0,
strength_A = , population = "all", , = ,
start_frequency = 5e-04, Ne = 10000, position = 0.5,
force_keep = , locus_group = "all")
The selection strength for the selected homozygote.
The parameter is valid for the chosen population and the time further
past-wards from either time 0 on if
start = TRUE, or from
onwards. The same applies for
The selection strength for the heterozygote.
The selection strength for the recessive homozygote.
This sets the strength for the selected allele in a
haploid model or a diploid model with additive selection.
are ignored when this is argument is given.
The population in which the allele is selected. Can either
all for all population, or the number of a population.
The time at which the selection starts if
start == TRUE
(looking forwards in time), or the time at which the selection strength
start == FALSE. The new strength applies for the time
period further into the past in this case.
Whether selection should start at this time point. At this time,
the selected allele is introduced in the population with an initial
starting frequency. This must be set to
TRUE for exactly one
selection feature in the model. The values of
force_keep are used for the model.
You can add additional selection feature to the model to set the
selection strength for more demes or change it at different time points,
but these need to have
start = FALSE.
The start frequency at which the selected allele is
time. If the model has multiple population, this
can either be a numeric vector that contains the initial frequency for each
population or a single number. In the latter case, the value is used for
all population specified with
populations, and 0 is used for all
The effective population size that is used for the forward
The position of the selected site, relative to the
simulated sequence. Values between 0 and 1 are within the simulated area,
while smaller values are to the left of it and larger ones to the right.
Whether to restart simulations in which the selected goes to
extinction or not.
The loci for which this features is used. Can either be
"all" (default), in which case the feature is used for simulating
all loci, or a numeric vector. In the latter case, the feature is only
used for the loci added in
locus_ commands with the corresponding
index starting from 1 in order in which the commands where added to the
model. For example, if a model has
locus_single(10) + locus_averaged(10, 11) + locus_single(12) and
this argument is
c(2, 3), than the feature is used for all but
the first locus (that is locus 2 - 12).
The feature, which can be added to a model created with
For using rates that variate between the loci in a model:
For summary statistics that are sensitive for selection:
For creating a model:
# Positive additive selection in population 2:
model <- ((10, 13), 1, 10000) +
(.5, 2, 1) +
(strength_A = 1000,
population = 2,
= ("tau")) +
(population = 2)
## Not run: simulate(model, pars = c(tau = 0.03))