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

simpleSim

Unconditional marker simulation


Description

Unconditional simulation of unlinked markers

Usage

simpleSim(x, N, alleles, afreq, available, Xchrom = FALSE, mutmat = NULL,
  seed = NULL, verbose = T)

Arguments

x

a linkdat object

N

a positive integer: the number of markers to be simulated

alleles

a vector containing the allele names. If missing, the alleles are taken to be seq_along(afreq).

afreq

a vector of length 2 containing the population frequencies for the alleles. If missing, the alleles are assumed equifrequent.

available

a vector containing IDs of the available individuals, i.e. those whose genotypes should be simulated.

Xchrom

a logical: X linked markers or not?

mutmat

a mutation matrix, or a list of two such matrices named 'female' and 'male'. The matrix/matrices must be square, with the allele labels as dimnames, and each row must sum to 1 (after rounding to 3 decimals).

seed

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

verbose

a logical.

Details

This simulation is done by distributing alleles randomly to all founders, followed by unconditional gene dropping down throughout the pedigree (i.e. for each non-founder a random allele is selected from each of the parents). Finally the genotypes of any individuals not included in available are removed.

Value

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

Author(s)

Magnus Dehli Vigeland

See Also

Examples

x = nuclearPed(1)
simpleSim(x, N=3, afreq=c(0.5, 0.5))

y = addOffspring(cousinPed(1), father=7, mother=8, noffs=1)
simpleSim(y, N=3, alleles=LETTERS[1:10])

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.