pr_independent_alleles {numberofalleles} | R Documentation |
Compute the probability distribution of the number of independent alleles in a mixture with dropout
Description
Without dropout, each mixture contributor has two independent but not necessarily distinct alleles that are represented in the DNA mixture. If the probability of dropout for a mixture contributor is greater than zero, then the mixture contributor has either 0 (full dropout), 1 (partial dropout) or 2 (no dropout) independent alleles that are represented in the mixture. This function computes the probability distribution of the number of independent alleles that unrelated mixture contributors have in total for a locus given their dropout parameters.
Usage
pr_independent_alleles(dropout_prs)
Arguments
dropout_prs |
Numeric vector. Dropout probabilities per contributor. |
Value
A named numeric vector describing the probability distribution. Numeric values are the probabilities corresponding to the names describing integer values.
See Also
Examples
# a dropout pr. of 0.5
p <- pr_independent_alleles(0.5)
stopifnot(all.equal(as.vector(p),
c(0.5^2, 2 * 0.5 * 0.5, (1-0.5)^2)))
# one contrib. without dropout and one with d=0.5
p1 <- pr_independent_alleles(c(0, 0.5))
stopifnot(identical(as.integer(names(p1)),
as.integer(names(p)) + 2L))