hwe | R Documentation |
Performs an exact test for Hardy-Weinberg equilibrium on Single-Nucleotide Variants
## S4 method for signature 'SeqVarGDSClass'
hwe(gdsobj, permute=FALSE, parallel=FALSE)
gdsobj |
A |
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 |
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.
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 |
Stephanie Gogarten
SeqVarGDSClass
,
applyMethod
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.