Skip to contents

For each GO node, with N genes in the background, M annotated to the node, a study list of n genes of which k are annotated, the p-value is the upper-tail hypergeometric sum \(P = 1 - \sum_{i=0}^{k-1} C(M,i) C(N-M,n-i) / C(N,n)\), the probability of k or more annotated genes by chance (one-tailed Fisher exact test). Optional Bonferroni correction multiplies each p-value by the number of terms and caps at 1.

Usage

Goenr(
  hits,
  list_size,
  term_size,
  background_size,
  correction = c("none", "bonferroni")
)

Arguments

hits

Annotated genes in the study list, one entry per term.

list_size

Size n of the study list.

term_size

Genes M annotated to each term in the background.

background_size

Total genes N in the background.

correction

Either "none" or "bonferroni".

Value

List with pvalue, padj, expected, fold_enrichment, hits, term_size, n, N, method.

References

Boyle, E. I., Weng, S., Gollub, J., Jin, H., Botstein, D., Cherry, J. M. and Sherlock, G. (2004), GO::TermFinder–open source software for accessing Gene Ontology information and finding significantly enriched Gene Ontology terms associated with a list of genes, Bioinformatics 20(18), 3710-3715 (PMC3037731). Hypergeometric formula and Bonferroni correction, Algorithm section, p. 3711.

Examples

set.seed(1)
r <- Goenr(hits = rnorm(10), list_size = 8L, term_size = 8L, background_size = 8L); TRUE
#> [1] TRUE