gsea.conditions: GSEA for conditions.

Description Usage Arguments Details Value Examples

View source: R/standalone_gsea.R

Description

Perform and plot GSEA heatmap for comparison across condtions.

Usage

1
2
3
4
5
6
7
8
gsea.conditions(
  inputlist,
  pathways = NULL,
  nperm = NULL,
  weightmethod = NULL,
  onlypos = NULL,
  filter_nonsig_pathways = NULL
)

Arguments

inputlist

A list of dataframes. Must be named. Names will be used as x axis. Order of names retained in axis.

pathways

A named "list of lists" of genes. The format of this object is important for functionality of this function and can be previewed in the tamlabscpipeline::hallmark object. The names of each list element provides the Y axis; the genes within each list element are the target genes used for GSEA. If NULL, defaults to the Msigdb's Hallmark pathways for mouse.

nperm

An integer denoting how many permutations FGSEA will run. Default = 10000.

weightmethod

A string, one of either "pvalue", "padj", or "foldchange". Default = "pvalue".

onlypos

T/F. Whether to filter each cluster to only include upregulated genes. Default = F.

filter_nonsig_pathways

T/F. Whether to remove non-significant rows from resulting heatmap. Useful if running very large numbers of pathways, or to generate finalized plots after exploratory analysis. Default = F.

Details

Expects input as list of dataframes. Each dataframe corresponds to a particular condtion; expected dataframe format matches output of Seurat::FindMarkers(). Multiple conditions (ie >= 2) can be run.

Pathways must be a named list of character vectors; by default uses mouse orthologs of Msigdb Hallmark sets, accessible via tamlabscpipeline::hallmark.

See FGSEA package docs for details. Also check out the Broad's Msigdb to view a large database of pathways and the MsigdbR package to get orthologs of the Msigdb pathways for your species of interest.

Output plots can be difficult to read if many pathways are used. Recommended 50-75 or so pathways as the maximum, many more will generate very ugly heatmaps. Utilizes special characters, so pdf printing may be problematic. Alternative PDF devices should be able to handle this though, one can use Quartz if on Mac, or CairoPDF if on Windows.

Value

Returns a ggplot object, and prints a heatmap to the standard out.

Examples

1
2
3
4
5
## Not run: 
inputlist <- list(treatment = treatmentdf, control = controldf)
gsea.clusters(sobjmarkers)

## End(Not run)

apf2139/tamlabscpipeline documentation built on July 23, 2021, 11 a.m.