tr_test_enrichment: Perform a basic enrichment test

View source: R/tr_test_enrichment.R

tr_test_enrichmentR Documentation

Perform a basic enrichment test

Description

Performs Fisher's Exact test to determine enrichment of a set of genes of interest compared to some list of experimentally derived genes. Uses alternative = "greater" in the call to fisher.test().

Usage

tr_test_enrichment(query_set, enrichment_set, total_genes)

Arguments

query_set

List of experimentally or otherwise derived genes, in which one wishes to test for enrichment

enrichment_set

Set of genes of interest, such as virulence genes

total_genes

Total number of genes for the organism/species

Value

Numeric: the raw p-value from fisher.test()

References

?stats::fisher.test

See Also

https://www.github.com/travis-m-blimkie/tRavis

Examples

all_genes <- paste0("gene", sample(1:10000, 5000))
de_genes <- sample(all_genes, 1500)
ex_set <- sample(all_genes, 100)

tr_test_enrichment(
  query_set = de_genes,
  enrichment_set = ex_set,
  total_genes = 5000
)


travis-m-blimkie/tRavis documentation built on April 9, 2024, 11:45 p.m.