Learn R Programming

dartR (version 1.1.11)

gl.report.hwe: Reports departure from Hardy-Weinberg Equilibrium

Description

Calculates the probabilities of agreement with H-W equilibrium based on observed frequencies of reference homozygotes, heterozygotes and alternate homozygotes. Uses the exact calculations contained in function prob.hwe() as developed by Wigginton, JE, Cutler, DJ, and Abecasis, GR.

Usage

gl.report.hwe(gl, p = 0.05, subset = "each")

Arguments

gl

-- a genlight object containing the SNP genotypes [Required]

p

-- level of significance (per locus) [Default 0.05]

subset

-- list populations to combine in the analysis | each | all [Default "all"]

Value

a dataframe containing loci, counts of reference SNP homozygotes, heterozygotes and alternate SNP homozygotes; probability of departure from H-W equilibrium, and per locus significance with and without Bonferroni Correction.

Details

#Input is a genlight adegenet object containing SNP genotypes (0 homozygous for reference SNP, #1 heterozygous, 2 homozygous for alternate SNP).

Tests are applied to all populations pooled (subset="all"), to each population treated separately (subset="each") or to selected populations (subset=c("pop1","pop2")). Tests for Hwe are only valid if there is no population substructure, and the tests have sufficient power only when there is sufficient sample size (n>20).

Examples

Run this code
# NOT RUN {
list <- gl.report.hwe(testset.gl,0.05, subset=c("EmmacMaclGeor", "EmmacCoopCully"))
list <- gl.report.hwe(testset.gl,0.05, subset="all")
list <- gl.report.hwe(testset.gl,0.05, subset="each")
# }

Run the code above in your browser using DataLab