Genotype frequencies from Huang et al (2019) are used to implement a likelihood procedure to estimate double reduction rates and to test for equilibrium while accounting for double reduction. This approach is only implemented for ploidies 4, 6, 8, and 10.

hwelike(nvec, thresh = 5, effdf = FALSE)

Arguments

nvec

A vector containing the observed genotype counts, where nvec[[i]] is the number of individuals with genotype i-1. This should be of length ploidy+1.

thresh

The threshold for ignoring the genotype. We keep genotypes such that nvec >= thresh. Setting this to 0 uses all genotypes.

effdf

A logical. Should we use the ad-hoc "effective degrees of freedom" (TRUE) or not (FALSE)?

Value

A list with some or all of the following elements:

alpha

The estimated double reduction parameter(s). In diploids, this value is NULL.

r

The estimated allele frequency.

chisq_hwe

The chi-square test statistic for testing against the null of equilibrium.

df_hwe

The degrees of freedom associated with chisq_hwe.

p_hwe

The p-value against the null of equilibrium.

References

  • Huang, K., Wang, T., Dunn, D. W., Zhang, P., Cao, X., Liu, R., & Li, B. (2019). Genotypic frequencies at equilibrium for polysomic inheritance under double-reduction. G3: Genes, Genomes, Genetics, 9(5), 1693-1706. doi:10.1534/g3.119.400132

Author

David Gerard

Examples

thout <- hwefreq(alpha = 0.1, r = 0.3, ploidy = 6)
nvec <- c(stats::rmultinom(n = 1, size = 100, prob = thout))
hwelike(nvec = nvec)
#> $alpha
#> [1] 0.000100009
#> 
#> $r
#> [1] 0.2633333
#> 
#> $chisq_hwe
#> [1] 1.403483
#> 
#> $df_hwe
#> [1] 1
#> 
#> $p_hwe
#> [1] 0.2361413
#>