Skip to contents

Creates a heatmap summarizing FGSEA results.

Usage

enrichmat(
  x,
  n_top = 15,
  top_pathways = NULL,
  rownames_column = "pathway",
  NES_column = "NES",
  padj_column = "padj",
  padj_legend_title = padj_column,
  padj_cutoff = 0.05,
  plot_sig_only = TRUE,
  padj_fill = "grey",
  colors = c("#3366ff", "darkred"),
  scale_by = c("row", "column", "none"),
  cell_size = unit(14, "points"),
  filename = character(0),
  height = 5,
  width = 5,
  units = "in",
  heatmap_args = list(),
  padj_args = list(),
  save_args = list(),
  draw_args = list()
)

Arguments

x

object of class data.frame; output of fgsea or fgsea2. Must contain a "contrast" column.

n_top

integer; number of pathways to display. Defaults to the top 15 pathways that are most significantly enriched across all contrasts.

top_pathways

character; vector of specific pathways to display. If NULL (default), the n_top pathways will be displayed instead.

rownames_column

character; the name of a column in x containing unique identifiers that will be used as the rownames in the heatmap. Default is "pathway".

NES_column

similar to rownames_column. The name of a column containing the normalized enrichment scores (NES) that determines the heatmap body colors. Values between -1 and +1 (noise) will appear white.

padj_column

similar to rownames_column. The name of a column containing the adjusted p-values that determine the area of each circle in the heatmap.

padj_legend_title

character; title of the background fill legend. Defaults to padj_column.

padj_cutoff

numeric; cutoff for terms to be statistically significant. If plot_sig_only=TRUE, only those pathways with at least one padj_column value less than this threshold may appear in the heatmap. Default is 0.05.

plot_sig_only

logical; whether to plot only those n_top terms that have at least one padj_column value less than padj_cutoff.

padj_fill

character; the background color used for values in padj_column that are less than padj_cutoff. Default is "lightgrey".

colors

character; vector of length 2 specifying the colors for the largest negative and largest positive values, respectively. Defaults to blue (#3366ff) and red (specifically, darkred).

scale_by

character; whether to scale the circles such that the most-significant term in each row (scale_by="row"), column (scale_by="column"), or overall (scale_by="none") is of maximum area. Default is "row" to better visualize patterns across contrasts.

cell_size

unit object; the size of each heatmap cell. Default is unit(14, "points").

filename

character; the filename used to save the heatmap. If character(0) (default), the heatmap will be displayed instead.

height

numeric; height of the file in units.

width

same as height.

units

character; units that define height and width. Defaults to "in" (inches).

heatmap_args

list; additional arguments passed to Heatmap.

padj_args

list; additional arguments passed to Legend. Modifies the adjusted p-value legend.

save_args

list; additional arguments passed to the graphics device. See png for options.

draw_args

list; additional arguments passed to draw-HeatmapList-method.

Author

Tyler Sagendorf