Package: HardyWeinberg 1.7.8

HardyWeinberg: Statistical Tests and Graphics for Hardy-Weinberg Equilibrium

Contains tools for exploring Hardy-Weinberg equilibrium (Hardy, 1908; Weinberg, 1908) for bi and multi-allelic genetic marker data. All classical tests (chi-square, exact, likelihood-ratio and permutation tests) with bi-allelic variants are included in the package, as well as functions for power computation and for the simulation of marker data under equilibrium and disequilibrium. Routines for dealing with markers on the X-chromosome are included (Graffelman & Weir, 2016) <doi:10.1038/hdy.2016.20>, including Bayesian procedures. Some exact and permutation procedures also work with multi-allelic variants. Special test procedures that jointly address Hardy-Weinberg equilibrium and equality of allele frequencies in both sexes are supplied, for the bi and multi-allelic case. Functions for testing equilibrium in the presence of missing data by using multiple imputation are also provided. Implements several graphics for exploring the equilibrium status of a large set of bi-allelic markers: ternary plots with acceptance regions, log-ratio plots and Q-Q plots. The functionality of the package is explained in detail in a related JSS paper <doi:10.18637/jss.v064.i03>.

Authors:Jan Graffelman [aut, cre], Christopher Chang [ctb], Xavi Puig [ctb], Jan Wigginton [ctb], Leonardo Ortoleva [ctb], William R. Engels [ctb]

HardyWeinberg_1.7.8.tar.gz
HardyWeinberg_1.7.8.zip(r-4.5)HardyWeinberg_1.7.8.zip(r-4.4)HardyWeinberg_1.7.8.zip(r-4.3)
HardyWeinberg_1.7.8.tgz(r-4.4-x86_64)HardyWeinberg_1.7.8.tgz(r-4.4-arm64)HardyWeinberg_1.7.8.tgz(r-4.3-x86_64)HardyWeinberg_1.7.8.tgz(r-4.3-arm64)
HardyWeinberg_1.7.8.tar.gz(r-4.5-noble)HardyWeinberg_1.7.8.tar.gz(r-4.4-noble)
HardyWeinberg_1.7.8.tgz(r-4.4-emscripten)HardyWeinberg_1.7.8.tgz(r-4.3-emscripten)
HardyWeinberg.pdf |HardyWeinberg.html
HardyWeinberg/json (API)

# Install 'HardyWeinberg' in R:
install.packages('HardyWeinberg', repos = c('https://jangraffelman.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • Alzheimer - Genotype frequencies for 70 SNPs related to Alzheimer's disease
  • CEUchr22 - Biallelic polymorphisms sampled from chromosome 22 of the CEU population of the 1000 Genomes project.
  • Glyoxalase - Glyoxalase genotype data
  • HapMapCHBChr1 - Genotype frequencies for 225 SNPs on chromosome 1 of the CHB population.
  • JPTmultiallelicsChr7 - Multi-allelic autosomal variants of the Japanese population of the 1000 genomes project
  • JPTmultiallelicsChrX - Multi-allelic X-chromosomal variants of the Japanese population of the 1000 genomes project
  • JPTsnps - Bi-allelic SNPs from a Japanese population stratified by gender
  • JPTtriallelicsChr7 - Tri-allelic variants on chromosome 7 of the Japanese (JPT) sample of the 1000 genomes project
  • JPTtriallelicsChrX - Tri-allelic variants on the X-chromosome of the Japanese (JPT) sample of the 1000 genomes project
  • Markers - SNP data and intensities
  • Mourant - Genotype frequencies for blood group locus MN
  • NistSTRs - NIST autosomal STR data
  • TSIXTriAllelics - Tri-allelic polymorphisms on the X chromosome of the TSI population

On CRAN:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

6.21 score 4 packages 159 scripts 4.3k downloads 18 mentions 71 exports 62 dependencies

Last updated 8 months agofrom:59bc105de5. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 03 2024
R-4.5-win-x86_64OKNov 03 2024
R-4.5-linux-x86_64OKNov 03 2024
R-4.4-win-x86_64OKNov 03 2024
R-4.4-mac-x86_64OKNov 03 2024
R-4.4-mac-aarch64OKNov 03 2024
R-4.3-win-x86_64OKNov 03 2024
R-4.3-mac-x86_64OKNov 03 2024
R-4.3-mac-aarch64OKNov 03 2024

Exports:afAFtestafxagcountsallelesAllelesToTriangulardgraffelmanweir.bidlevenedlevene.biEAFExactfisherzfoldGenerateSamplesgenlabelsheHWABOHWAICHWAlltestsHWAlrHWAlrPlotHWChisqHWChisqMatHWChisqStatsHWCloHWClrHWClrPlotHWCondProbABHWDHWDataHWEMHWExactHWExactMatHWExactPreviousHWExactStatsHWfHWGenotypePlotHWIlrHWIlrPlotHWLindleyHWLindley.criHWLRAllTestsHWLratioHWLRtestHWMissingHWNetworkHWPermHWPerm.multHWPosteriorHWPowerHWQqplotHWStrHWStrataHWTernaryPlotHWTriExactifisherzis.monomacmafMakeCountsMakeFactorn.allelesorder.autoorder.xqqunifrecodeshannonstrsortThetatoFtoTriangularUniqueGenotypeCountsvaf

Dependencies:backportsbitbit64bootbroomclicliprcodetoolscpp11crayondplyrfansiforcatsforeachgenericsglmnetgluehavenhmsiteratorsjomolatticelifecyclelme4magrittrMASSMatrixmiceminqamitmlnlmenloptrnnetnumDerivordinalpanpillarpkgconfigprettyunitsprogresspurrrR6RcppRcppEigenreadrrlangrpartRsolnpshapestringistringrsurvivaltibbletidyrtidyselecttruncnormtzdbucminfutf8vctrsvroomwithr

Example session with the HardyWeinberg package

Rendered fromHardyWeinbergExampleSession.Rmdusingknitr::rmarkdownon Nov 03 2024.

Last update: 2024-04-01
Started: 2024-04-01

Exploring diallelic genetic markers: the \pkg{HardyWeinberg} package

Rendered fromHardyWeinberg.Rnwusingutils::Sweaveon Nov 03 2024.

Last update: 2024-04-01
Started: 2015-02-24

Readme and manuals

Help Manual

Help pageTopics
Statistical Tests and Graphics for Hardy-Weinberg EquilibriumHardyWeinberg-package HardyWeinberg
Function to compute allele frequenciesaf
Exact test of equality of allele frequencies for males and femalesAFtest
Function to compute X-chromosomal allele frequenciesafx
Calculate allele and genotype counts for X-chromosomal markersagcounts
Extract allelesalleles
Calculate triangular genotype matrix for vector(s) of alleles.AllelesToTriangular
Genotype frequencies for 70 SNPs related to Alzheimer's diseaseAlzheimer
Biallelic polymorphisms sampled from chromosome 22 of the CEU population of the 1000 Genomes project.CEUchr22
Calculate Graffelman-Weir exact density for bi-allelic X-chromosomal variantdgraffelmanweir.bi
Calculate Levene's exact density for k allelesdlevene
Calculate Levene's density for a bi-allelic variantdlevene.bi
Exact test for equality of allele frequencies in males and femalesEAFExact
Fisher's z transformationfisherz
Fold a square matrixfold
Generate genotypic compositionsGenerateSamples
Label genotype counts of a vector or matrixgenlabels
Glyoxalase genotype dataGlyoxalase
Genotype frequencies for 225 SNPs on chromosome 1 of the CHB population.HapMapCHBChr1
Calculate expected heterozygosity (He)he
Estimate allele frequencies and test for Hardy-Weinberg equilibrium with a tri-allelic ABO system.HWABO
Compute Akaike's Information Criterion (AIC) for HWP and EAF modelsHWAIC
Perform all tests for Hardy-Weinberg equilibriumHWAlltests
Compute additive log-ratio transformationHWAlr
Plot genetic markers in additive log-ratio coordinatesHWAlrPlot
Chi square tests for Hardy Weinberg equilibriumHWChisq
Matrix version of HWChisqHWChisqMat
Fast computation of chi-square statistics for Hardy-Weinberg equilibriumHWChisqStats
Convert genotype counts to compositionsHWClo
Compute the centred log-ratio transformationHWClr
Plot genetic markers in centred log-ratio coordinatesHWClrPlot
Compute probability of a genotypic sampleHWCondProbAB
Compute disequilibrium statistic DHWD
Generate genetic marker data in or out of Hardy-Weinberg EquilibriumHWData
Estimation of contributions of two populations to a sample of genotype frequencies with the EM algorithm.HWEM
Exact test for Hardy-Weinberg equilibriumHWExact
Matrix version of HWExactHWExactMat
Exact test for Hardy-Weinberg equilibriumHWExactPrevious
Computation of Exact p-values for Hardy-Weinberg equilibrium for sets of SNPsHWExactStats
Computation of inbreeding coefficientHWf
Scatter plot of the genotype frequenciesHWGenotypePlot
Compute isometric log ratio coordinates.HWIlr
Plot bi-allelic genetic markers in isometric log ratio coordinatesHWIlrPlot
Calculate a posteriori density for Lindley's alphaHWLindley
Calculate a credible interval for Lindley's alpha for HWE,HWLindley.cri
Perform most relevant likelihood ratio test for Hardy-Weinberg equilibrium and equality of allele frequenciesHWLRAllTests
Likelihood ratio test for Hardy Weinberg equilibriumHWLratio
Perform likelihood ratio test comparing two nested scenarios for a bi-allelic genetic variant, distinguishing the two sexes.HWLRtest
Test a bi-allelic marker for Hardy-Weinberg equilibrium in the presence of missing genotype information.HWMissing
Autosomal and X-chromosomal exact tests for HWE via a Network algorithmHWNetwork
Permutation test for Hardy-Weinberg equilibriumHWPerm
Permutation tests fo variants with multiple allelesHWPerm.mult
Calculation of posterior probabilities and Bayes factors for Hardy-Weinberg tests at X-chromosomal variants.HWPosterior
Compute the power of a test for Hardy-Weinberg equilibrium.HWPower
A Q-Q plot for Hardy-Weinberg equilibriumHWQQplot HWQqplot
Testing a set of microsatellites (STRs) for Hardy-Weinberg equilibriumHWStr
Asymptotic test for HWE across strata for a single biallelic markerHWStrata
Ternary plot with the Hardy-Weinberg acceptance regionHWTernaryPlot
Exact test for Hardy-Weinberg equilibrium and equality of allele frequencies for tri-allelic variants.HWTriExact
Inverse Fisher z transformationifisherz
Detects autosomal and X-chromosomal monomorphic variantsis.mono
Multi-allelic autosomal variants of the Japanese population of the 1000 genomes projectJPTmultiallelicsChr7
Multi-allelic X-chromosomal variants of the Japanese population of the 1000 genomes projectJPTmultiallelicsChrX
Bi-allelic SNPs from a Japanese population stratified by genderJPTsnps
Tri-allelic variants on chromosome 7 of the Japanese (JPT) sample of the 1000 genomes projectJPTtriallelicsChr7
Tri-allelic variants on the X-chromosome of the Japanese (JPT) sample of the 1000 genomes projectJPTtriallelicsChrX
Compute the minor allele count.mac
Function to compute minor allele frequenciesmaf
Create genotype counts from bi-allelic marker dataMakeCounts
Make factors from genotyping dataMakeFactor
SNP data and intensitiesMarkers
Genotype frequencies for blood group locus MNMourant
Number of allelesn.alleles
NIST autosomal STR dataNistSTRs
Reordering of autosomal genotype countsorder.auto
Reordering of X-chromosomal genotype countsorder.x
Q-Q plot for a uniform distribution.qqunif
Recode genotype informationrecode
Shannon indexshannon
Sort tokens of a set of stringsstrsort
Convert theta to an inbreeding coefficientThetatoF
Convert a vector of genotype counts to triangular formattoTriangular
Tri-allelic polymorphisms on the X chromosome of the TSI populationTSIXTriAllelics
Extract unique genotypic compositions from a matrixUniqueGenotypeCounts
Computes the sample variance of the allele frequency for a biallelic marker.vaf