sHWE: Hardy-Weinberg Equilibrium in structure populations

Description Usage Arguments Value Examples

View source: R/lfa.R

Description

Compute structural Hardy-Weinberg Equilibrium (sHWE) p-values on a SNP-by-SNP basis. These p-values can be aggregated to determine genome-wide goodness-of-fit for a particular value of d. See https://doi.org/10.1101/240804 for more details.

Usage

1
sHWE(X, LF, B)

Arguments

X

a matrix of SNP genotypes, i.e. an integer matrix of 0's, 1's, and 2's. Sparse matrices of class Matrix are not supported (yet).

LF

matrix of logistic factors

B

number of null datasets to generate - B=1 is usualy sufficient. If computational time/power allows, a few extra B could be helpful

Value

a vector of p-values for each SNP.

Examples

1
2
3
4
5
6
LF <- lfa(hgdp_subset, 4)
gof_4 <- sHWE(hgdp_subset, LF, 3)
LF <- lfa(hgdp_subset, 10)
gof_10 <- sHWE(hgdp_subset, LF, 3)
hist(gof_4)
hist(gof_10)

lfa documentation built on Nov. 8, 2020, 7:30 p.m.

Related to sHWE in lfa...