est.freqs: Estimate allelic frequencies in reference database

Description Usage Arguments Details Examples

Description

Estimate allelic frequencies in reference database

Usage

1

Arguments

x

profiles object

labels

(optional) list of per-locus labels of alleles (repeat numbers for integers, like factor levels)

Details

The allele frequencies are estimated using the counting method. That is, the empirical fraction of each allele is taken as an estimate of the frequency.

Since alleles are stored as integer, labels can be supplied that map the integer to a repeat number (similar to a factor level). See below for an example.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(freqsNLsgmplus)

set.seed(123)

# sample a small reference db
x <- sample.profiles(N = 1e3,freqs=freqsNLsgmplus)

# estimate frequencies
fr0 <- est.freqs(x,labels = lapply(get.freqs(x),names))

# mean absolut difference between fr0 and freqsNLsgmplus is small
mean(abs(c(fr0,recursive = TRUE)-c(freqsNLsgmplus,recursive=TRUE)))

DNAprofiles documentation built on Jan. 15, 2017, 9:27 p.m.