fisherTest-character-character-character-method: Perform Fisher's exact test on a gene set

fisherTest,character,character,character-methodR Documentation

Perform Fisher's exact test on a gene set

Description

Perform Fisher's exact test on a gene set

Usage

## S4 method for signature 'character,character,character'
fisherTest(
  genes,
  genesets,
  universe,
  gsName,
  gsNamespace,
  makeUniqueNonNA = TRUE,
  checkUniverse = TRUE,
  useEASE = FALSE
)

Arguments

genes

a collection of genes of which over-representation of the gene set is tested

genesets

A vector of character strings, genes belonging to one gene set.

universe

universe of genes

gsName

gene set name, can be left missing

gsNamespace

gene set namespace name, can be left missing

makeUniqueNonNA

Logical, whether genes, geneSetGenes, and universe should be filtered to remove NA and made unique. The default is set to TRUE. When the uniqueness and absence of NA is ensured, this flag can be set to FALSE to accelerate the operation.

checkUniverse

Logical, if TRUE, then genes that are in genes but are not in universe are appended to universe

useEASE

Logical, whether to use the EASE method to report the p-value.

This function performs one-sided Fisher's exact test to test the over-representation of gene set genes in the input gene list.

If useEASE is TRUE, one gene is penalized (removed) within geneSetGenes that are in genes and calculating the resulting Fisher exact probability for that namespace. The theoretical basis of the EASE score lies in the concept of jackknifing a probability. See Hosack et al. for details.

Note

Duplicated items in genes, genesets' genes, and the universe are per default removed

References

Hosack et al.

Hosack, Douglas A., Glynn Dennis, Brad T. Sherman, H. Clifford Lane, and Richard A. Lempicki. Identifying Biological Themes within Lists of Genes with EASE. Genome Biology 4 (2003): R70. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1186/gb-2003-4-10-r70")}

Examples

myGenes <- LETTERS[1:3]
myGeneSet1 <- LETTERS[1:6]
myGeneSet2 <- LETTERS[4:7]
myUniverse <- LETTERS
fisherTest(genes=myGenes, genesets=myGeneSet1, universe=myUniverse)
fisherTest(genes=myGenes, genesets=myGeneSet2, universe=myUniverse)
fisherTest(genes=myGenes, genesets=myGeneSet1, universe=myUniverse, 
           gsName="My gene set1", gsNamespace="Letters")

## note that duplicated items are removed by default
resWoRp <- fisherTest(genes=rep(myGenes,2), genesets=myGeneSet1, 
                      universe=myUniverse)
resWithRp <- fisherTest(genes=rep(myGenes,2), genesets=myGeneSet1, 
                      universe=rep(myUniverse,2))
identical(resWoRp, resWithRp)

resWithRpNoUnique <- fisherTest(genes=rep(myGenes,2), genesets=myGeneSet1, 
           universe=rep(myUniverse,2), makeUniqueNonNA=FALSE)
identical(resWoRp, resWithRpNoUnique)

bedapub/ribiosGSEA documentation built on March 30, 2023, 3:26 p.m.