Learn R Programming

DNAprofiles (version 0.3.1)

sample.profiles: Sample random unrelated profiles

Description

Sample random unrelated profiles

Usage

sample.profiles(N, freqs, markers = names(freqs), theta = 0)

Arguments

N
number of profiles to sample (integer).
freqs
A list specifying the allelic frequencies. Should contain a vector of allelic frequencies for each locus, named after that locus.
markers
A character vector naming the markers of the resulting sample. Default to all markers of the freqs argument.
theta
numeric value specifying the amount of background relatedness, i.e. the probability that both alleles at a locus are identical by descent.

Value

An object of class profiles, which is an integer matrix with $N$ rows and twice the number of loci columns. The integers correspond to the index in the allelic frequency vector, NOT to STRs. Each row is a profile and every two columns contain the two alleles at a locus.

Details

The function randomly samples DNA profiles according to the supplied allelic frequencies.

When $\theta=0$, the function assumes HW-equilibrium, so the alleles of a person at a locus are independent samples.

When $\theta>0$, the alleles of a person at a locus are ibd with probability $\theta$.

See Also

sample.pairs, sample.relatives

Examples

Run this code
data(freqsNLsgmplus)
db <- sample.profiles(N=1e3,freqs=freqsNLsgmplus)

Run the code above in your browser using DataLab