Learn R Programming

polyRAD (version 1.6)

AddGenotypePriorProb_HWE: Estimate Genotype Prior Probabilities In the Absence of Population Structure

Description

Assuming Hardy-Weinberg Equilibrium, this function uses allele frequencies and possible ploidies stored in a “RADdata” object to estimate genotype frequencies in the population, then stores these genotype frequencies in the $priorProb slot. Inbreeding can also be simulated using the selfing.rate argument.

Usage

AddGenotypePriorProb_HWE(object, ...)
# S3 method for RADdata
AddGenotypePriorProb_HWE(object, selfing.rate = 0, ...)

Value

A “RADdata” object identical that passed to the function, but with data stored in two new slots:

priorProb

A list of matrices, with one matrix per possible ploidy. For each matrix, allele copy number (from zero to the total ploidy) is in rows, and alleles are in columns. Each value is the probability of sampling an individual with that allele copy number from the population.

priorProbPloidies

A list identical to object$possiblePloidies. It is in the same order as $priorProb, with each item indicating the inheritance mode for the corresponding prior probability matrix.

Arguments

object

A “RADdata” object that has had allele frequencies added with AddAlleleFreqHWE.

selfing.rate

A number ranging from zero to one indicating the frequency of self-fertilization in the species.

...

Additional arguments (none currently implemented).

Author

Lindsay V. Clark

Details

For an autopolyploid, or within one subgenome of an allopolyploid, genotype prior probabilities are estimated as:

$$P(G_i) = {k \choose i} p^i * (1 - p)^{k - i}$$

where \(k\) is the ploidy, \(i\) is the copy number of a given allele, and \(p\) is the allele frequency in the population.

If the selfing rate is above zero, genotype prior probabilities are adjusted according to Equation 6 of de Silva et al. (2005):

$$P(G_{self}) = (1 - s)(I - sA)^{-1}P(G)$$

where \(s\) is the selfing rate. \(A\) is a \(k + 1 \times k + 1\) matrix, with each column representing the allele copy number from 0 to \(k\) of a parental genotype, and each row representing the allele copy number from 0 to \(k\) of a progeny genotype, and matrix elements representing the frequencies of progeny after self-fertilization (each column summing to one).

References

De Silva, H. N., Hall, A. J., Rikkerink, E., and Fraser, L. G. (2005) Estimation of allele frequencies in polyploids under certain patterns of inheritance. Heredity 95, 327--334. tools:::Rd_expr_doi("10.1038/sj.hdy.6800728")

See Also

AddGenotypePriorProb_Mapping2Parents, AddGenotypeLikelihood, AddGenotypePriorProb_ByTaxa

Examples

Run this code
# load in an example dataset
data(exampleRAD)
# add allele frequencies
exampleRAD <- AddAlleleFreqHWE(exampleRAD)
# add inheritance modes
exampleRAD$possiblePloidies <- list(2L, 4L, c(2L, 2L))

# estimate genotype prior probabilities
exampleRAD <- AddGenotypePriorProb_HWE(exampleRAD)

# examine results
exampleRAD$alleleFreq
exampleRAD$priorProb

# try it with inbreeding
exampleRAD2 <- AddGenotypePriorProb_HWE(exampleRAD, selfing.rate = 0.5)
exampleRAD2$priorProb

Run the code above in your browser using DataLab