fisherTest-character-GmtList-character-method: Perform Fisher's exact test on a GmtList object

fisherTest,character,GmtList,character-methodR Documentation

Perform Fisher's exact test on a GmtList object

Description

Perform Fisher's exact test on a GmtList object

Usage

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

Arguments

genes

character strings of gene list to be tested

genesets

An GmtList object

universe

Universe (background) gene list

gsNamespace

Character string, gene-set namespace(s)

makeUniqueNonNA

Logical, whether genes 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.

Value

A data.table containing Fisher's exact test results of all gene-sets, in the same order as the input gene-sets, with following columns:

  1. GeneSetNamespace

  2. GeneSetName

  3. GeneSetEffectiveSize, the count of genes in the gene-set that are found in the universe

  4. HitCount, the count of genes in the genes input that are in the gene-set

  5. Hits, a vector of character string, representing hits

  6. PValue

  7. FDR, PValue adjusted by the Benjamini-Hochberg method. If more than one gene-set categories are provided, the FDR correction is performed per namespace

Examples

gs1 <- list(name="GeneSet1", desc="desc", genes=LETTERS[1:4], namespace="A")
gs2 <- list(name="GeneSet2", desc="desc", genes=LETTERS[5:8], namespace="A")
gs3 <- list(name="GeneSet3", desc="desc", genes=LETTERS[seq(2,8,2)], namespace="A")
gs4 <- list(name="GeneSet3", desc="desc", genes=LETTERS[seq(1,7,2)], namespace="B")
gmtList <- BioQC::GmtList(list(gs1, gs2, gs3, gs4))
myInput <- LETTERS[2:6]
myUniverse <- LETTERS
myFisherRes <- fisherTest(myInput, gmtList, myUniverse)

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