Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

markerSim

Marker simulation


Description

Simulates marker genotypes conditional on the pedigree structure, affection statuses and disease model.

Usage

markerSim(x, N = 1, available = NULL, alleles = NULL, afreq = NULL,
  partialmarker = NULL, loop_breakers = NULL, eliminate = 0,
  seed = NULL, verbose = TRUE)

Arguments

x

a linkdat object

N

a positive integer: the number of markers to be simulated

available

a vector containing IDs of the available individuals, i.e. those whose genotypes should be simulated. By default, all individuals are included.

alleles

a vector containing the alleles for the marker to be simulation. If a single integer is given, this is interpreted as the number of alleles, and the actual alleles as 1:alleles. Must be NULL if partialmarker is non-NULL.

afreq

a vector of length 2 containing the population frequencies for the marker alleles. Must be NULL if partialmarker is non-NULL.

partialmarker

Either NULL (resulting in unconditional simulation), a marker object (on which the simulation should be conditioned) or the index of an existing marker of x.

loop_breakers

a numeric containing IDs of individuals to be used as loop breakers. Relevant only if the pedigree has loops, and only if partialmarker is non-NULL. See breakLoops.

eliminate

A non-negative integer, indicating the number of iterations in the internal genotype-compatibility algorithm. Positive values can save time if partialmarker is non-NULL and the number of alleles is large.

seed

NULL, or a numeric seed for the random number generator.

verbose

a logical.

Details

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.

Value

a linkdat object equal to x except its markerdata entry, which consists of the N simulated markers.

Author(s)

Magnus Dehli Vigeland

References

G. M. Lathrop, J.-M. Lalouel, C. Julier, and J. Ott, Strategies for Multilocus Analysis in Humans, PNAS 81(1984), pp. 3443-3446.

See Also

Examples

x = nuclearPed(2)
partial = marker(x, 3, 1, alleles=1:3)
markerSim(x, N=1, alleles=1:3)
markerSim(x, N=1, partialmarker=partial)
markerSim(x, N=1, partialmarker=partial)
markerSim(x, N=1, available=4, partialmarker=partial)

paramlink

Parametric Linkage and Other Pedigree Analysis in R

v1.1-2
GPL (>= 2)
Authors
Magnus Dehli Vigeland [aut, cre], Thore Egeland [ctb], Guro Doerum [ctb]
Initial release
2018-01-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.