hyperg | R Documentation |
This function performs a hypergeometric test for over- or under-representation of significant ‘genes’ amongst those assayed in a universe of genes. It provides an interface based on character vectors of identifying member of gene sets and the gene universe.
hyperg(assayed, significant, universe,
representation = c("over", "under"), ...)
assayed |
A vector of assayed genes (or other
identifiers). |
significant |
A vector of assayed genes that were
differentially expressed. If |
universe |
A character vector defining the universe of genes. |
representation |
Either “over” or “under”, to indicate testing for over- or under-representation, respectively, of differentially expressed genes. |
... |
Additional arguments, unused. |
When invoked with a character vector of assayed
genes, a named
numeric vector providing the input values, P-value, odds ratio, and
expected number of significantly expressed genes.
When invoked with a list of character vectors of assayed
genes,
a data frame with columns of input values, P-value, odds ratio, and
expected number of significantly expressed genes.
Martin Morgan mtmorgan@fhcrc.org with contributions from Paul Shannon.
hyperGTest
for convenience functions using Bioconductor
annotation resources such as GO.db.
set.seed(123)
## artifical sets -- affy probes grouped by protein family
library(hgu95av2.db)
map <- select(hgu95av2.db, keys(hgu95av2.db), "PFAM")
sets <- Filter(function(x) length(x) >= 10, split(map$PROBEID, map$PFAM))
universe <- unlist(sets, use.names=FALSE)
siggenes <- sample(universe, length(universe) / 20) ## simulate
sigsets <- Map(function(x, y) x[x %in% y], sets, MoreArgs=list(y=siggenes))
result <- hyperg(sets, sigsets, universe)
head(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.