rsScoreHeatmap: Heatmap of region set scores

Description Usage Arguments Value Examples

View source: R/visualization.R

Description

Heatmap of the ranking of region set scores across PCs A visualization of the rank of region sets in each PC, allowing the user to see if a region set is ranked highly in all PCs or only a subset. Region sets will be ranked from highest scoring to lowest based on their score for 'orderByPC'. The ComplexHeatmap package is used and additional parameters for the ComplexHeatmap::Heatmap function may be passed to this function to modify the heatmap.

Usage

1
2
3
4
5
6
7
rsScoreHeatmap(rsScores, PCsToAnnotate = paste0("PC", 1:5),
  orderByPC = "PC1", rsNameCol = "rsName", topX = 20,
  col = c("red", "#EEEEEE", "blue"), row_title = "Region Set",
  column_title = "Principal Component", column_title_side = "bottom",
  cluster_rows = FALSE, cluster_columns = FALSE,
  show_row_names = TRUE, row_names_max_width = unit(10000, "mm"),
  name = "Rank within PC", ...)

Arguments

rsScores

a data.frame with scores for each region set from main COCOA function 'runCOCOA'. Each row is a region set. Columns are scores, one column for each PCs Also can have columns with info on region set overlap with the original data. Should be in the same order as GRList (the list of region sets used to create it.)

PCsToAnnotate

A character vector with principal components to include. eg c("PC1", "PC2"). Must be column names of rsScores.

orderByPC

a character object. PC to order by in heatmap (arranged in decreasing order for scores so p values should be -log transformed). Must be the name of a column in rsScores.

rsNameCol

character. Name of the column in rsScores that has the names/identifiers for the region sets so these can be included in the plot as row names.

topX

Number of top region sets to include in the heatmap

col

a vector of colors or a color mapping function which will be passed to the ComplexHeatmap::Heatmap() function. See ?Heatmap (the "col" parameter) for more details. "#EEEEEE" is the code for a color similar to white.

row_title

character object, row title

column_title

character object, column title

column_title_side

character object, where to put the column title: "top" or "bottom"

cluster_rows

"logical" object, whether rows should be clustered. This should be kept as FALSE to keep the correct ranking of region sets.

cluster_columns

"logical" object, whether to cluster columns. It is recommended to keep this as FALSE so it will be easier to compare PCs (with cluster_columns = FALSE, they will be in the same specified order in different heatmaps)

show_row_names

"logical" object, display row names (ie region set names)

row_names_max_width

"unit" object. The amount of room to allocate for row names. See ?grid::unit for object type.

name

character object, legend title

...

optional parameters for ComplexHeatmap::Heatmap().

Value

A heatmap of region set scores across. Each row is a region set, each column is a PC. The color corresponds to the relative rank of a region set's score for a given PC out of all tested region sets.

Examples

1
2
3
data("rsScores")
scoreHeatmap <- rsScoreHeatmap(rsScores, 
          PCsToAnnotate=paste0("PC", 1:2), orderByPC = "PC2")

databio/PCRSA documentation built on Dec. 7, 2018, 8:57 a.m.