runEnrichr: Run Enrichr

View source: R/enrichr.R

runEnrichrR Documentation

Run Enrichr

Description

Runs Enrichr on the specified genes against all libraries

If you find that this function is not flexible enough, you can run Enrichr as follows.

  • Update the internal list of the libraries (if necessary) by running parseEnrichrLibNames

  • Register gene list with enrichrAddList

  • Run enrichment analysis with enrichrEnrich

  • Check the length failure element of the response to see if there were any failures

  • Filter the success element of the response by using filterEnrichrResults

Usage

runEnrichr(
  genes,
  minScore = 12,
  maxAdjP = 0.01,
  minOverlapGenes = 3,
  softFilter = F,
  maxResult = NA,
  connectionN = 10
)

Arguments

genes

A list or vector containing gene names

minScore

Combined score (log(AdjP) * z) threshold to filter the results.

maxAdjP

Adjusted p (Benjamini-Hochberg method) threshold to filter the results.

minOverlapGenes

Minimum number of genes in the overlap

softFilter

select libraries with at least one significant result but report all results

maxResult

maximum number of results to return

connectionN

Maximum number of connections to open simultaneously for the enrichment analysis.

Value

A named list with library names as names and data.frame objects as values. An entire result set is retained if there is at least one significant gene based on the supplied criteria.

Author(s)

Roman Briskine

Examples

## Not run: 
genes <- c("HPS1", "HPS3", "HPS5", "PSMD11", "CUL7", "SNAPC4", "GNB2")
resList <- runEnrichr(genes, minScore = 15, maxAdjP = 1e-4, minOverlapGenes = 3, connectionN = 20)
resList = lapply(names(resList), function(nm){return(cbind("Gene-set library"=nm, resList[[nm]]))}) ## add the name as a first column
resMerged = do.call("rbind", resList)

## End(Not run)

# Alternative usage
## Not run: 
addResp <- enrichrAddList(genes)
names(addResp)
# [1] "shortId"    "userListId"
# This will check all libraries specified in the internal list (extdata/enrichr_libnames.txt)
res <- enrichrEnrich(addResp$userListId)
# Check if any requests failed
if (length(res$failure) > 0) {
  cat(length(res$failure), " requests failed")
  allLibs <- getEnrichrLibNames()
  # Libraries that failed
  setdiff(allLibs, names(res$success))
}
# Filter the data sets
resFilt <- filterEnrichrResults(res$success, maxPAdj = 0.01, maxZ = -3, minCombinedScore = 12, minOverlapGenes = 3)

## End(Not run)

uzh/ezRun documentation built on Dec. 26, 2024, 9:53 a.m.