Learn R Programming

HardyWeinberg (version 1.7.8)

Statistical Tests and Graphics for Hardy-Weinberg Equilibrium

Description

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) , 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 .

Copy Link

Version

Install

install.packages('HardyWeinberg')

Monthly Downloads

3,832

Version

1.7.8

License

GPL (>= 2)

Maintainer

Jan Graffelman

Last Published

April 6th, 2024

Functions in HardyWeinberg (1.7.8)

HWIlrPlot

Plot bi-allelic genetic markers in isometric log ratio coordinates
HWAlrPlot

Plot genetic markers in additive log-ratio coordinates
HWLRAllTests

Perform most relevant likelihood ratio test for Hardy-Weinberg equilibrium and equality of allele frequencies
HWExactPrevious

Exact test for Hardy-Weinberg equilibrium
HWExactStats

Computation of Exact p-values for Hardy-Weinberg equilibrium for sets of SNPs
HWPosterior

Calculation of posterior probabilities and Bayes factors for Hardy-Weinberg tests at X-chromosomal variants.
HWEM

Estimation of contributions of two populations to a sample of genotype frequencies with the EM algorithm.
HWMissing

Test a bi-allelic marker for Hardy-Weinberg equilibrium in the presence of missing genotype information.
HWNetwork

Autosomal and X-chromosomal exact tests for HWE via a Network algorithm
HWLindley

Calculate a posteriori density for Lindley's alpha
HWLRtest

Perform likelihood ratio test comparing two nested scenarios for a bi-allelic genetic variant, distinguishing the two sexes.
HWData

Generate genetic marker data in or out of Hardy-Weinberg Equilibrium
HWPower

Compute the power of a test for Hardy-Weinberg equilibrium.
HWExactMat

Matrix version of HWExact
HWIlr

Compute isometric log ratio coordinates.
JPTmultiallelicsChr7

Multi-allelic autosomal variants of the Japanese population of the 1000 genomes project
HWLratio

Likelihood ratio test for Hardy Weinberg equilibrium
HWLindley.cri

Calculate a credible interval for Lindley's alpha for HWE,
HWPerm.mult

Permutation tests fo variants with multiple alleles
TSIXTriAllelics

Tri-allelic polymorphisms on the X chromosome of the TSI population
HWStr

Testing a set of microsatellites (STRs) for Hardy-Weinberg equilibrium
JPTmultiallelicsChrX

Multi-allelic X-chromosomal variants of the Japanese population of the 1000 genomes project
HWStrata

Asymptotic test for HWE across strata for a single biallelic marker
HWQqplot

A Q-Q plot for Hardy-Weinberg equilibrium
HWf

Computation of inbreeding coefficient
HWGenotypePlot

Scatter plot of the genotype frequencies
HWPerm

Permutation test for Hardy-Weinberg equilibrium
Mourant

Genotype frequencies for blood group locus MN
HWExact

Exact test for Hardy-Weinberg equilibrium
HWTriExact

Exact test for Hardy-Weinberg equilibrium and equality of allele frequencies for tri-allelic variants.
ThetatoF

Convert theta to an inbreeding coefficient
he

Calculate expected heterozygosity (He)
dlevene

Calculate Levene's exact density for k alleles
dlevene.bi

Calculate Levene's density for a bi-allelic variant
HWTernaryPlot

Ternary plot with the Hardy-Weinberg acceptance region
MakeCounts

Create genotype counts from bi-allelic marker data
ifisherz

Inverse Fisher z transformation
genlabels

Label genotype counts of a vector or matrix
JPTtriallelicsChrX

Tri-allelic variants on the X-chromosome of the Japanese (JPT) sample of the 1000 genomes project
NistSTRs

NIST autosomal STR data
strsort

Sort tokens of a set of strings
toTriangular

Convert a vector of genotype counts to triangular format
is.mono

Detects autosomal and X-chromosomal monomorphic variants
vaf

Computes the sample variance of the allele frequency for a biallelic marker.
MakeFactor

Make factors from genotyping data
Markers

SNP data and intensities
UniqueGenotypeCounts

Extract unique genotypic compositions from a matrix
af

Function to compute allele frequencies
recode

Recode genotype information
fisherz

Fisher's z transformation
maf

Function to compute minor allele frequencies
mac

Compute the minor allele count.
shannon

Shannon index
fold

Fold a square matrix
afx

Function to compute X-chromosomal allele frequencies
JPTsnps

Bi-allelic SNPs from a Japanese population stratified by gender
HardyWeinberg-package

Statistical Tests and Graphics for Hardy-Weinberg Equilibrium
order.x

Reordering of X-chromosomal genotype counts
HapMapCHBChr1

Genotype frequencies for 225 SNPs on chromosome 1 of the CHB population.
alleles

Extract alleles
dgraffelmanweir.bi

Calculate Graffelman-Weir exact density for bi-allelic X-chromosomal variant
agcounts

Calculate allele and genotype counts for X-chromosomal markers
qqunif

Q-Q plot for a uniform distribution.
order.auto

Reordering of autosomal genotype counts
n.alleles

Number of alleles
JPTtriallelicsChr7

Tri-allelic variants on chromosome 7 of the Japanese (JPT) sample of the 1000 genomes project
HWAIC

Compute Akaike's Information Criterion (AIC) for HWP and EAF models
HWAlr

Compute additive log-ratio transformation
EAFExact

Exact test for equality of allele frequencies in males and females
CEUchr22

Biallelic polymorphisms sampled from chromosome 22 of the CEU population of the 1000 Genomes project.
GenerateSamples

Generate genotypic compositions
HWChisqMat

Matrix version of HWChisq
HWABO

Estimate allele frequencies and test for Hardy-Weinberg equilibrium with a tri-allelic ABO system.
HWClrPlot

Plot genetic markers in centred log-ratio coordinates
AllelesToTriangular

Calculate triangular genotype matrix for vector(s) of alleles.
HWClr

Compute the centred log-ratio transformation
HWChisq

Chi square tests for Hardy Weinberg equilibrium
HWAlltests

Perform all tests for Hardy-Weinberg equilibrium
Alzheimer

Genotype frequencies for 70 SNPs related to Alzheimer's disease
HWChisqStats

Fast computation of chi-square statistics for Hardy-Weinberg equilibrium
Glyoxalase

Glyoxalase genotype data
AFtest

Exact test of equality of allele frequencies for males and females
HWCondProbAB

Compute probability of a genotypic sample
HWD

Compute disequilibrium statistic D
HWClo

Convert genotype counts to compositions