NSF-2132247 License: GPL v3 CRAN status R-CMD-check codecov Lifecycle: stable

Inference concerning equilibrium and random mating in autopolyploids. Methods are available to test for equilibrium and random mating at any even ploidy level (>2) in the presence of double reduction at biallelic loci. For autopolyploid populations in equilibrium, methods are available to estimate the degree of double reduction. We also provide functions to calculate genotype frequencies at equilibrium, or after one or several rounds of random mating, given rates of double reduction. For details of these methods, see Gerard (2022a) <doi:10.1111/biom.13722> and Gerard (2022b) <doi:10.1101/2022.08.11.503635>.

The main functions for inference are:

Functions are provided for calculating genotype frequencies for individuals and gametes:

The bounds on the double reduction rate under the complete equational segregation model are provided by drbounds().

Functions for evaluating the uniformity of p-values are provided in ts_bands() and qqpvalue().


You can install the released version of hwep from CRAN with:


You can install the development version from GitHub with:

# install.packages("devtools")


To cite hwep in publications use:

Gerard D (2022). “Double reduction estimation and equilibrium tests in natural autopolyploid populations.” Biometrics In press. doi:10.1111/biom.13722.

A BibTeX entry for LaTeX users is

  title = {Double reduction estimation and equilibrium tests in natural autopolyploid populations},
  author = {David Gerard},
  journal = {Biometrics},
  year = {2022},
  doi = {10.1111/biom.13722},
  volume = {In press},

If you use rmbayes(), rmbayesgl(), or menbayeslg(), then please also cite

Gerard D (2022). “Bayesian tests for random mating in autopolyploids.” bioRxiv. doi:10.1101/2022.08.11.503635.

A BibTeX entry for LaTeX users is

    author = {Gerard, David},
    title = {Bayesian Tests for Random Mating in Autopolyploids},
    year = {2022},
    doi = {10.1101/2022.08.11.503635},
    publisher = {Cold Spring Harbor Laboratory},
    journal = {bioRxiv}


This material is based upon work supported by the National Science Foundation under Grant No. 2132247. The opinions, findings, and conclusions or recommendations expressed are those of the author and do not necessarily reflect the views of the National Science Foundation.

Code of Conduct

Please note that the hwep project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.