Learn R Programming

paramlink (version 0.8-3)

SNPsim: Simulate SNP markers

Description

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

Usage

SNPsim(x, N=1, partialmarker=NULL, available=x$available, afreq=c(0.5, 0.5), loop_breakers=NULL, 
       unique=FALSE, seed=NULL, verbose=TRUE)

Arguments

x
a linkdat object
N
a positive integer: the number of SNPs to be simulated
partialmarker
Either NULL (indicating no given marker data), or a matrix with two columns giving alleles for each individual (0 = unkwown).
available
a vector containing IDs of the available individuals, i.e. those whose genotypes should be simulated.
afreq
a vector of length 2 containing the population frequencies for the SNP alleles.
loop_breakers
a numeric containing IDs of individuals to be used as loop breakers. Relevant only if the pedigree has loops. See breakLoops.
unique
a logical indicating if duplicates among the simulated markers should be removed.
seed
NULL, or a numeric seed for the random number generator.
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 is an implementation of 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
data(toyped)
x = linkdat(toyped, model=1)
y = SNPsim(x, N=3)
plot(y, marker=1)

z = addOffspring(cousinPed(1), father=7, mother=8, noffs=1, aff=2)
z = setModel(z, 2)
SNPsim(z, N=1, loop_breakers=7)

m = marker(z, 9, c(2,2), alleles=1:2)
SNPsim(z, N=1, partialmarker=m, loop_breakers=7)

Run the code above in your browser using DataLab