mutRate | R Documentation |
Calculate the overall mutation rate at a locus, given a mutation model an a set of allele frequencies.
mutRate(mut, afreq = NULL)
mut |
A |
afreq |
A vector of allele frequencies. |
The mutation rate is found by the formula 1 - sum(diag(mut) * afreq)
.
If mut
is a mutationModel()
, the rate is calculated separately for the
male and female matrices.
A single number, or (if mut
is a mutationModel()
and the female
and male rates differ) a list of two numbers, named "female" and "male".
m = mutationMatrix("stepwise", alleles = 1:4, afreq = c(.1,.2,.3,.4),
rate = 0.01, rate2 = 1e-6, range = 0.1)
r = mutRate(m)
stopifnot(all.equal(r, 0.01))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.