setMutationModel: Set a mutation model

Description Usage Arguments Details Value Examples

View source: R/setMutationModel.R

Description

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.

Usage

1
setMutationModel(x, markers = NULL, model, ...)

Arguments

x

A ped object or a list of such.

markers

A vector of names or indices referring to markers attached to x. (Default: All markers.)

model

A model name implemented by pedmut::mutationModel(). See Details.

...

Arguments forwarded to pedmut::mutationModel(), e.g., rate.

Details

Currently, the following models are implemented in the pedmut package:

Value

An object similar to x.

Examples

 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)

}

pedprobr documentation built on Nov. 13, 2020, 5:06 p.m.