plot_pathway_gsea: plot GSEA pathway scores as heatmap, returns a list...

View source: R/utils.R

plot_pathway_gseaR Documentation

plot GSEA pathway scores as heatmap, returns a list containing results and plot.

Description

plot GSEA pathway scores as heatmap, returns a list containing results and plot.

Usage

plot_pathway_gsea(
  mat,
  pathway_list,
  n_perm = 1000,
  scale = TRUE,
  topn = 5,
  returning = "both"
)

Arguments

mat

expression matrix

pathway_list

a list of vectors, each named for a specific pathway, or dataframe

n_perm

Number of permutation for fgsea function. Defaults to 1000.

scale

convert expr_mat into zscores prior to running GSEA?, default = TRUE

topn

number of top pathways to plot

returning

to return "both" list and plot, or either one

Value

list of matrix and plot, or just plot, matrix of GSEA NES values, cell types as row names, pathways as column names

Examples

gl <- list(
    "n" = c("PPBP", "LYZ", "S100A9"),
    "a" = c("IGLL5", "GNLY", "FTL")
)

pbmc_avg <- average_clusters(
    mat = pbmc_matrix_small,
    metadata = pbmc_meta,
    cluster_col = "classified"
)

plot_pathway_gsea(
    pbmc_avg,
    gl,
    5
)

NCBI-Hackathons/RClusterCT documentation built on Aug. 30, 2024, 2:05 a.m.