This function performs fast gene set enrichment analysis (fGSEA) on the results of a random-effects model meta-analysis. Three ranking strategies are supported: by summary fold-change, by signed significance, or by a weighted combination of both. Gene sets can be provided directly or downloaded automatically from MSigDB via msigdbr.
enrichment_mv(
remres,
pathways = NULL,
species = "Homo sapiens",
category = "C5",
subcategory = NULL,
ranking = "fc",
minSize = 15,
maxSize = 500,
nPermSimple = 10000,
plot_top_n = 30,
plot_padj = 0.1,
clean_pathway_names = TRUE,
colors = c(down = "#083e46", up = "#811820"),
plot_title = NULL,
seed = 42
)MetaVolcano object. Output of the rem_mv() function <MetaVolcano>
named list of gene sets (character vectors). If NULL, gene sets are automatically downloaded via msigdbr using species, category, and subcategory parameters
species name for msigdbr. Default "Homo sapiens"
MSigDB category: "H" (hallmarks), "C2" (curated), "C5" (GO), "C7" (immunologic), etc. Default "C5"
optional MSigDB subcategory: "GO:BP", "GO:CC", "GO:MF", "CP:KEGG", "CP:REACTOME", etc. Default NULL (all)
method for ranking genes: "fc" uses the REM summary fold-change; "signed_p" uses -log10(p) * sign(FC); "weighted_fc" uses FC * -log10(p) <string>
minimum gene set size to test <integer>
maximum gene set size to test <integer>
number of permutations for p-value estimation <integer>
number of top pathways to plot <integer>
adjusted p-value threshold for plotting. Default 0.1
logical. If TRUE, removes database prefixes (e.g. GOBP_, KEGG_) and replaces underscores with spaces. Default TRUE
vector of 2 colors for the plot c(down, up)
custom plot title. If NULL, auto-generated
random seed for reproducibility <integer>
list with two elements: result (data.frame with fGSEA
results) and plot (ggplot2 lollipop plot)
if (FALSE) { # \dontrun{
data(diffexplist)
mv <- rem_mv(diffexplist, metathr = 0.01)
# Using automatic MSigDB download (GO Biological Process)
enrich <- enrichment_mv(mv, subcategory = "GO:BP")
enrich$plot
# Using Hallmarks
enrich <- enrichment_mv(mv, category = "H")
# Using KEGG
enrich <- enrichment_mv(mv, category = "C2", subcategory = "CP:KEGG")
# Using custom pathways
library(msigdbr)
my_paths <- split(
msigdbr(species = "Homo sapiens", category = "C5")$gene_symbol,
msigdbr(species = "Homo sapiens", category = "C5")$gs_name
)
enrich <- enrichment_mv(mv, pathways = my_paths)
head(enrich$result)
} # }