hwe: Exact test for Hardy-Weinberg equilibrium

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Performs an exact test for Hardy-Weinberg equilibrium on Single-Nucleotide Variants

Usage

1
2
## S4 method for signature 'SeqVarGDSClass'
hwe(gdsobj, permute=FALSE, parallel=FALSE)

Arguments

gdsobj

A SeqVarGDSClass object with VCF data.

permute

A logical indicating whether to permute the genotypes to get a set of p-values under the null hypothesis.

parallel

Logical, numeric, or other value to control parallel processing; see seqParallel for details.

Details

HWE calculations are performed with the HWExact function in the GWASExactHW package.

permute=TRUE will permute the genotypes prior to running the test. This can be useful for obtaining a set of expected values under the null hypothesis to compare to the observed values.

P values are set to NA for all multiallelic and monomorphic variants.

Value

A data.frame with the following columns:

variant.id

The unique identifier for the variant

nAA

The number of reference homozygotes

nAa

The number of heterozygotes

naa

The number of alternate homozygotes

afreq

The reference allele frequency

p

p values for the exact test

f

The inbreeding coefficient, 1 - observed heterozygosity / expected heterozygosity

Author(s)

Stephanie Gogarten

See Also

SeqVarGDSClass, applyMethod

Examples

1
2
3
4
5
6
7
8
9
gds <- seqOpen(seqExampleFileName("gds"))
## autosomal variants only
auto <- seqGetData(gds, "chromosome") %in% 1:22
var.auto <- seqGetData(gds, "variant.id")[auto]
hw <- applyMethod(gds, hwe, variant=var.auto)
head(hw)
sum(is.na(hw$p))
range(hw$p, na.rm=TRUE)
seqClose(gds)

SeqVarTools documentation built on Nov. 22, 2020, 2 a.m.