BatchGSEA: Performs GSEA for all Hotgenes contrasts

Description Usage Arguments Value Examples

View source: R/BatchGSEA.R

Description

Performs GSEA for all Hotgenes contrasts

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
BatchGSEA(
  m_df = NULL,
  HotgenesObj = NULL,
  nTop = 10,
  cut_padj = 0.1,
  minSize = 15,
  maxSize = 1000,
  nperm = 1e+05,
  nproc = 1
)

Arguments

m_df

GeneSet generated using msigdbr function

HotgenesObj

R object generated by DEseq2_export function

nTop

number of pathways to return

cut_padj

Adjusted pvalue cut off. Default is 0.1.

minSize

Minimal size of a gene set to test. All pathways below the threshold are excluded.

maxSize

Maximal size of a gene set to test. All pathways above the threshold are excluded.

nperm

Number of permutations to do. Minimial possible nominal p-value is about 1/nperm

nproc

If not equal to zero sets BPPARAM to use nproc workers (default = 0).

Value

HotgenesObj appended with GSEA for each contrast

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Example_Hotgenes_dir<-system.file("extdata",
"Example_Hotgenes.Rdata",
package = "Hotgenes", mustWork = TRUE)
load(Example_Hotgenes_dir)
library(msigdbr)

# GO annotations
m_df = msigdbr(species = "Homo sapiens", category = "C5", subcategory = "BP")

# Reactome annotations
# m_df = msigdbr(species = "Homo sapiens", category = "C2", 
# subcategory = "CP:REACTOME")  

qbat<-BatchGSEA(HotgenesObj=Example_Hotgenes,
m_df= m_df)

# View enriched pathways
lapply(qbat$OuputGSEA, function(x) head(x$fgRes$pathway))

# plot of enriched pathways
qbat$OuputGSEA$shEWS$g

# Prep for GSEA plot
m_list = qbat$m_list

# top pathways
qbat$OuputGSEA$shEWS$top$pathway
pyid<-qbat$OuputGSEA$shEWS$top$pathway[[2]]
pyid

Gene_Ranks <- qbat$OuputGSEA$shEWS$Gene_Ranks
fgsea::plotEnrichment(m_list[[pyid]], Gene_Ranks,
gseaParam = 1, ticksSize = 0.2) +
ggplot2::labs(title=stringr::str_wrap(pyid, 20))

Rvirgenslane/Hotgenes documentation built on Aug. 22, 2020, 2:11 a.m.