markerSim | R Documentation |
Simulates marker genotypes conditional on the pedigree structure and known
genotypes. Note: This function simulates independent realisations at a single
locus. Equivalently, it can be thought of as independent simulations of
identical, unlinked markers. For simulations of a set of markers, see
profileSim()
.
markerSim(
x,
N = 1,
ids = NULL,
alleles = NULL,
afreq = NULL,
mutmod = NULL,
rate = NULL,
partialmarker = NULL,
loopBreakers = NULL,
seed = NULL,
verbose = TRUE
)
x |
A |
N |
A positive integer: the number of (independent) markers to be simulated. |
ids |
A vector containing ID labels of those pedigree members whose genotypes should be simulated. By default, all individuals are included. |
alleles |
(Only if
|
afreq |
(Only if |
mutmod , rate |
Arguments specifying a mutation model, passed on to
|
partialmarker |
Either NULL (resulting in unconditional simulation), a
marker object (on which the simulation should be conditioned) or the name
(or index) of a marker attached to |
loopBreakers |
A numeric containing IDs of individuals to be used as
loop breakers. Relevant only if the pedigree has loops, and only if
|
seed |
An integer seed for the random number generator (optional). |
verbose |
A logical. |
This implements (with various time savers) the algorithm used in SLINK of the
LINKAGE/FASTLINK suite. If partialmarker
is NULL, genotypes are simulated
by simple gene dropping, using simpleSim()
.
A ped
object equal to x
except its MARKERS
entry, which
consists of the N
simulated markers.
Magnus Dehli Vigeland
G. M. Lathrop, J.-M. Lalouel, C. Julier, and J. Ott, Strategies for Multilocus Analysis in Humans, PNAS 81(1984), pp. 3443-3446.
profileSim()
, simpleSim()
x = nuclearPed(2)
# Unconditional simulation
markerSim(x, N = 2, alleles = 1:3)
# Conditional on one child being homozygous 1/1
x = addMarker(x, "3" = "1/1", alleles = 1:3)
markerSim(x, N = 2, partialmarker = 1)
markerSim(x, N = 1, ids = 4, partialmarker = 1, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.