Description Usage Arguments Details Value Examples
View source: R/setMutationModel.R
This function offers a convenient way to attach mutation models to a pedigree
with marker data. It wraps pedmut::mutationModel()
, which does the main
work of creating the models, but relieves the user from having to loop
through the markers in order to supply the correct alleles and frequencies
for each marker.
1  setMutationModel(x, markers = NULL, model, ...)

x 
A 
markers 
A vector of names or indices referring to markers attached to

model 
A model name implemented by 
... 
Arguments forwarded to 
Currently, the following models are implemented in the pedmut
package:
equal
: All mutations equally likely; probability 1rate of no
mutation
proportional
: Mutation probabilities are proportional to the target
allele frequencies
onestep
: A mutation model for microsatellite markers, allowing mutations
only to the nearest neighbours in the allelic ladder. For example, '10' may
mutate to either '9' or '11', unless '10' is the lowest allele, in which case
'11' is the only option. This model is not applicable to loci with
nonintegral microvariants.
stepwise
: A common model in forensic genetics, allowing different
mutation rates between integer alleles (like '16') and noninteger
"microvariants" like '9.3'). Mutations also depend on the size of the
mutation if the parameter 'range' differs from 1.
custom
: Allows any mutation matrix to be provided by the user, in the
matrix
parameter
random
: This produces a matrix of random numbers, where each row is
normalised so that it sums to 1
trivial
: The identity matrix; i.e. no mutations are possible.
An object similar to x
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  ### Example requires the pedmut package ###
if (requireNamespace("pedmut", quietly = TRUE)){
# A pedigree with data from a single marker
x = nuclearPed(1)
x = setMarkers(x, marker(x, geno = c("a/a", NA, "b/b"))) # mutation!
# Set `equal` model
x = setMutationModel(x, marker = 1, model = "equal", rate = 0.01)
# Inspect model
mutmod(x, 1)
# Likelihood
likelihood(x, 1)
}

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.