myGSEA: Wrapper for clusterProlifer's GSEA()

View source: R/myGSEA.R

myGSEAR Documentation

Wrapper for clusterProlifer's GSEA()

Description

Runs GSEA() from clusterProfiler and creates useful visualizations.

Usage

myGSEA(
  ranks,
  TERM2GENE,
  padjustedCutoff = 0.05,
  returnDataOnly = TRUE,
  nperm = 2000,
  topPlots = FALSE,
  outDir,
  Condition = "GSEA Results",
  plotFile = "GSEA_results"
)

Arguments

ranks

Numeric of gene 'scores' ordered by decreasing value and named with gene symbols.

TERM2GENE

Data frame with two columns: gene set identifiers and gene symbols. Can be generated using correlationAnalyzeR::getTERM2GENE()

padjustedCutoff

Value to use as a cutoff for returned gene sets.

returnDataOnly

Should GSEA data/plots be saved to file? Default: TRUE

nperm

Number of permutations to run. Default is 2000

topPlots

Should top GSEA pathways be plotted? Default: FALSE

outDir

output directory.

Condition

Name to use for titles of plots. Default = "GSEA Results".

plotFile

prefix to use for naming output files.

Value

Named list containing GSEA() output, GSEA data frame, and visualizations.

Examples

corrDF <- correlationAnalyzeR::analyzeSingleGenes(genesOfInterest = c("BRCA1"),
                                                  returnDataOnly = TRUE,
                                                  runGSEA = FALSE,
                                                  Sample_Type = "normal")
ranks <- corrDF$correlations[,1]
names(ranks) <- rownames(corrDF$correlations)
TERM2GENE <- correlationAnalyzeR::getTERM2GENE(GSEA_Type = "simple",
                                               Species = "hsapiens")
res <- correlationAnalyzeR::myGSEA(ranks = ranks,
                                   TERM2GENE = TERM2GENE,
                                   plotFile = "GSEA_out", outDir = getwd(),
                                   topPlots = FALSE, returnDataOnly=TRUE,
                                    Condition = "GSEA Results")


Bishop-Laboratory/correlationAnalyzeR documentation built on June 28, 2022, 8:31 p.m.