linkageSim {paramlink}R Documentation

Simulate markers linked to a disease locus.

Description

Simulates markers (with up to 4 alleles) conditional on the pedigree structure, affection statuses and disease model.

Usage

linkageSim(
  x,
  N = 1,
  available = x$available,
  afreq = NULL,
  partialmarker = NULL,
  loop_breakers = NULL,
  unique = FALSE,
  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.

afreq

a vector of length < 5 containing the population frequencies for the marker alleles.

partialmarker

Either NULL (indicating no given marker data), or a marker object.

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.

Details

All markers are simulated under the condition that the recombination fraction between the marker and the disease locus is 0. This is an implementation of the algorithm used in SLINK of the LINKAGE/FASTLINK suite.

Value

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

References

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

See Also

linkage.power

Examples


x = linkdat(toyped, model=1)
y = linkageSim(x, N=10, afreq=c(0.5, 0.5))
stopifnot(length(mendelianCheck(y))==0)

z = addOffspring(cousinPed(1), father=7, mother=8, noffs=1, aff=2)
z = setModel(z, 2)
linkageSim(z, N=1, afreq = c(0.1, 0.2, 0.7))


[Package paramlink version 1.1-5 Index]