HWETest | R Documentation |
Test experiment features for Hardy Weinberg equilibrium.
HWETest(
object,
experiment = c("hla_alleles", "hla_aa", "hla_g_groups", "hla_supertypes",
"hla_NK_ligands"),
HWE_group = NULL,
HWE_cutoff = NULL,
as.MiDAS = FALSE
)
object |
|
experiment |
String specifying experiment to test. Valid values
includes |
HWE_group |
Expression defining samples grouping to test for Hardy Weinberg equilibrium. By default samples are not grouped. |
HWE_cutoff |
Number specifying p-value threshold. When |
as.MiDAS |
Logical flag indicating if MiDAS object should be returned. |
Setting as.MiDAS
to TRUE
will filter MiDAS object based on
p-value cut-off given by HWE_cutoff
.
Data frame with Hardy Weinberg Equilibrium test results or a filtered MiDAS object.
# create MiDAS object
midas <- prepareMiDAS(hla_calls = MiDAS_tut_HLA,
colData = MiDAS_tut_pheno,
experiment = "hla_alleles"
)
# get HWE p-values as data frame
HWETest(midas, experiment = "hla_alleles")
# get HWE in groups defined by disease status
# grouping by `disease == 1` will divide samples into two groups:
# `disease == 1` and `not disease == 1`
HWETest(midas, experiment = "hla_alleles", HWE_group = disease == 1)
# filter MiDAS object by HWE test p-value
HWETest(midas, experiment = "hla_alleles", HWE_cutoff = 0.05, as.MiDAS = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.