Learn R Programming

SCORPION (version 1.3.3)

enrichEdges: Gene set enrichment analysis of TF-target edges

Description

Performs gene set enrichment analysis separately for each transcription factor (TF) using the edge-level values supplied in numericValue. Enrichment is performed with the multilevel implementation of fgsea. Calculations for individual TFs are performed in parallel.

Usage

enrichEdges(edgesDF, geneSets, numericValue, nCores = 3, seed = 1)

Value

A data.frame of enrichment results with one row per TF-gene set pair:

  • tf: Transcription factor

  • geneSet: Gene set identifier

  • pValue: Raw enrichment p-value

  • pAdj: Benjamini-Hochberg adjusted p-value

  • log2Err: Expected log2 error of the p-value estimate

  • ES: Enrichment score

  • NES: Normalized enrichment score

  • geneSetSize: Number of genes from the set found among the targets

Arguments

edgesDF

A data.frame of TF-target edges, typically produced by testEdges. Must contain a tf column, a target column, and the numeric column named by numericValue.

geneSets

A named list of gene sets. The names of the list elements are used as gene set identifiers.

numericValue

Character string naming the column in edgesDF used as the ranking statistic for enrichment analysis.

nCores

Integer specifying the number of parallel workers to use. Default 3.

seed

Integer specifying the random seed used by the parallel enrichment calculations. Default 1.

Author

Daniel Osorio <daniecos@uio.no>

Details

For each TF, the values in numericValue are used as ranked statistics for its target genes. Edges with missing targets or missing or non-finite values in the selected numeric column are excluded before enrichment analysis. If a target occurs more than once for a TF, only the observation with the largest absolute value of the selected ranking statistic is retained.

Gene set enrichment is performed using fgsea::fgseaMultilevel; the fgsea package (Bioconductor) is required. The leadingEdge column returned by fgseaMultilevel is not included in the output. P-values are adjusted across all TF-gene set enrichment tests using the Benjamini-Hochberg procedure.

See Also

testEdges, maEdges

Examples

Run this code
if (FALSE) {
data(scorpionTest)
nets <- runSCORPION(
  gexMatrix = scorpionTest$gex,
  tfMotifs = scorpionTest$tf,
  ppiNet = scorpionTest$ppi,
  cellsMetadata = scorpionTest$metadata,
  groupBy = c("donor", "region")
)
res <- testEdges(
  networksDF = nets,
  testType = "two.sample",
  group1 = grep("--T$", colnames(nets), value = TRUE),
  group2 = grep("--N$", colnames(nets), value = TRUE)
)

geneSets <- list(SetA = c("ACKR1", "ACTA2"), SetB = c("ACTG2", "ADAMDEC1"))
enr <- enrichEdges(
  edgesDF = res,
  geneSets = geneSets,
  numericValue = "log2FoldChange"
)
}

Run the code above in your browser using DataLab