sHWE | R Documentation |
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 \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1101/240804")} for more
details.
sHWE(X, LF, B, max_iter = 100, tol = 1e-10)
X |
A matrix of SNP genotypes, i.e. an integer matrix of 0's,
1's, 2's and |
LF |
matrix of logistic factors |
B |
number of null datasets to generate, |
max_iter |
Maximum number of iterations for logistic regression |
tol |
Tolerance value passed to |
a vector of p-values for each SNP.
# get LFs
LF <- lfa(hgdp_subset, 4)
# look at a small (300) number of SNPs for rest of this example:
hgdp_subset_small <- hgdp_subset[ 1:300, ]
gof_4 <- sHWE(hgdp_subset_small, LF, 3)
LF <- lfa(hgdp_subset, 10)
gof_10 <- sHWE(hgdp_subset_small, LF, 3)
hist(gof_4)
hist(gof_10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.