mutRate {pedmut} | R Documentation |
Overall mutation rate
Description
Calculate the overall mutation rate at a locus, given a mutation model an a set of allele frequencies.
Usage
mutRate(mut, afreq = NULL)
Arguments
mut |
|
afreq |
A vector of allele frequencies. |
Details
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.
Value
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".
Examples
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))
[Package pedmut version 0.7.1 Index]