enrichment_test.Rd
Perform enrichment test of genes/features in categories with Fisher's exact test or Kolmogorov-Smirnov Tests.
enrichment_test( object, fit, group, test = c("fet", "kst"), alternative = c("both", "greater", "less", "two.sided"), p.cutoff )
object |
|
---|---|
fit | ModelFit. The result of |
group | character. The fdata column of object that will be used as the categories to perform enrichment analysis. |
test | character. Must be "fet" for Fisher's exact test or "kst" for Kolmogorov-Smirnov test. |
alternative | character. One of both, greater, less, or two.sided. Default is both, that both greater and less were calculated and returned. |
p.cutoff | numeric. The p-value cutoff to define increase or decreasing. Only useful with fet. The default value of this argument is 0.05 when alternative equals to two.sided, and is 1 otherwise. |
A list-like S3 object. pval
is the pvalues for enrichment of
each category. For fet, the odds.ratio
has the odds ratio for each
category, and the matrix
has the N, m, n, k, and x values. For kst,
adj.p.val
has the transformed p-values under each of the alternative
hypothesis of greater or less.
For Fisher's exact test, the question being answered is, whether the number of genes/features in category A that are increased (or decreased) in treatment different from the background. In other words, the Fisher's exact test is used to test the independency of gene/feature category A and whether genes/features are increased (or decreased).
For Kilmogorov-Smirnov test, a similar hypothesis is tested. The p-values
are first tranformed into one-tail. The transformation is done using the
statistic values returned by model_fit
. The transformed
p-values are then compared to an arithmetic sequence between 0 and 1 using
ks.test
.
HTSet-class
model_fit
fisher.test
phyper
ks.test
design = model.matrix(~ Condition, data = exrna$pdata) coef = "ConditionSystemic Lupus Erythematosus" fit = model_fit(exrna, design, coef, engine = "limma", args = list(voom = TRUE))#>en = enrichment_test(exrna, fit, "gene_type", "fet") en = enrichment_test(exrna, fit, "gene_type", "kst")#> Warning: p-value will be approximate in the presence of ties#> Warning: p-value will be approximate in the presence of ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: p-value will be approximate in the presence of ties#> Warning: p-value will be approximate in the presence of ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties#> Warning: cannot compute exact p-value with ties