expected_number_of_distinct_alleles {numberofalleles}R Documentation

Compute the expectation of the number of distinct alleles observed in a DNA mixture for a locus

Description

For a given number of independent alleles, compute the mean and variance of the number of distinct alleles observed in a DNA mixture.

Usage

expected_number_of_distinct_alleles(number_of_independent_alleles, f, fst = 0)

Arguments

number_of_independent_alleles

Integer. Number of independent alleles in the mixture.

f

Numeric vector with allele frequencies

fst

Numeric value for sub-population correction (also known as theta)

Details

Due to allele sharing between DNA mixture contributors, the number of distinct alleles observed in a mixture is often less than the number of independent alleles in the mixture. For example, if mixture comprises two unrelated contributors, there are four independent alleles. Some of these four independent alleles may be of the same allelic type so that at least one and at most four distinct alleles are observed.

This function computes the probability distribution of the number of distinct alleles observed when the mixtures comprises a given number of independent alleles. Optionally, a sub-population correction may be applied by setting fst>0.

Value

Expected value (numeric of length one)

Examples

f <- c(A = 0.1, B = 0.2, C = 0.7)

e <- expected_number_of_distinct_alleles(3, f)

# by hand calculation
p <- pr_number_of_distinct_alleles(3, f)
e_by_hand <- sum(as.numeric(names(p)) * p)

stopifnot(isTRUE(all.equal(e, e_by_hand)))

[Package numberofalleles version 1.0.1 Index]