Learn R Programming

paramlink (version 0.7-0)

markerSim: Simulate SNP markers

Description

Simulates SNP markers conditional on the pedigree structure, affection statuses and disease model.

Usage

markerSim(x, N=1, available=x$orig.ids, alleles=NULL, afreq=NULL, partialmarker=NULL, 
          loop_breakers=NULL, eliminate=0, seed=NULL, method=3, 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.
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 are 1:alleles. Should be NULL if partialmarker is not NULL.
afreq
a vector of length 2 containing the population frequencies for the marker alleles. Should be NULL if partialmarker is not NULL.
partialmarker
Either NULL (resulting in unconditional simulation), or a marker object on which the simulation should be conditioned.
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 not 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 partialmarkers is non-NULL and the number of alleles is large.
seed
NULL, or a numeric seed for the random number generator.
method
either 1,2 or 3: If 1, genotypes for all available individuals are simulated conditionally by brute force, one by one. This requires many likelihood calculations and is potentially very slow. If 2, the joint genotype probabilities for some of the indiv
verbose
a logical.

Value

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

Details

This implementats (with various time savers) the algortihm used in SLINK of the LINKAGE/FASTLINK suite.

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

linkage.power

Examples

Run this code
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, method=2)
markerSim(x, N=1, available=4, partialmarker=partial, method=3)

Run the code above in your browser using DataLab