setMutmod {pedtools}R Documentation

Set a mutation model

Description

This function offers a convenient way to set or modify mutation models to markers attached to a pedigree. 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

setMutmod(x, markers = NULL, ..., update = FALSE)

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.)

...

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

update

A logical. If TRUE, existing mutation models (if present) are updated with the parameters specified in .... If FALSE (default), any previous models are ignored, and new mutation models are created from the parameters in ....

Details

Currently, the following models are supported:

Value

An object similar to x.

Examples


### Example requires the pedmut package ###

if (requireNamespace("pedmut", quietly = TRUE)){

# A pedigree with 1 empty marker; attach 'equal' mutation model
x = nuclearPed(1) |>
  addMarker() |>
  setMutmod(model = "equal", rate = 0.01)

mutmod(x, 1)

# Update rate (but still "equal" model)
y = setMutmod(x, rate = 0.05, update = TRUE)
mutmod(y, 1)

# Change to stepwise model
z = setMutmod(x, model = "stepwise",
              rate = list(female = 0.01, male = 0.02),
              range = 0.1, rate2 = 1e-6)
mutmod(z, 1)

# Remove mutation model
w = setMutmod(x, model = NULL)
mutmod(w, 1)

}


[Package pedtools version 2.6.0 Index]