Learn R Programming

hwep (version 2.0.3)

p_from_alpha: Obtain gamete frequencies at equilibrium given rates of double reduction.

Description

Given the rate of double reduction and the major allele frequency, this function will calculate the gametic frequencies.

Usage

p_from_alpha(alpha, p, ploidy)

Value

A numeric vector of length ploidy / 2 + 1, where element i is the probability that a gamete carries i-1 copies of the major allele.

Arguments

alpha

A numeric vector containing the double reduction parameter(s). This should be a vector of length floor(ploidy/4) where alpha[i] is the probability of exactly i pairs of IBDR alleles being in the gamete. Note that sum(alpha) should be less than 1, as 1 - sum(alpha) is the probability of no double reduction.

p

The allele frequency of the major allele.

ploidy

The ploidy of the species.

Author

David Gerard

Examples

Run this code
p_from_alpha(0.2, 0.5, 4)

Run the code above in your browser using DataLab