visualize\(data\)scores$heatmap

visualize PRS score matrices as heatmaps

Description

Plots one matrix from data$scores as a samples-by-models heatmap, or a models-by-samples heatmap when flip.orientation = TRUE, using ComplexHeatmap. Observation-side and model-side annotations, splits, and facets are resolved with data$fetch().

Usage

visualize.scores.heatmap(
  data,
  scores.layer = X,
  annotate.obs.by = NULL,
  annotate.mod.by = NULL,
  annotate.obs.color = NULL,
  annotate.mod.color = NULL,
  obs.labels = NULL,
  mod.labels = NULL,
  split.obs.by = NULL,
  split.mod.by = NULL,
  facet.obs.by = NULL,
  facet.mod.by = NULL,
  col = colorRampPalette(c("darkgreen", "white", "darkorchid4")),
  n.breaks = 11L,
  symmetrize.range = FALSE,
  center.zero = FALSE,
  flip.orientation = FALSE,
  ...
)

Arguments

data

A PolyGeniusData object containing the score matrix.

scores.layer

Unquoted expression naming the score layer in data$scores. Defaults to X.

annotate.obs.by

Observation-side unquoted expression(s), usually c(…) or list(…), used as row annotations by default and column annotations when flip.orientation = TRUE.

annotate.mod.by

Model-side unquoted expression(s), usually c(…) or list(…), used as column annotations by default and row annotations when flip.orientation = TRUE.

annotate.obs.color

Optional named list of colors for observation annotations, passed to the observation-side heatmap annotation. Categorical annotations should use named color vectors; continuous annotations should use color mapping functions such as circlize::colorRamp2().

annotate.mod.color

Optional named list of colors for model annotations, passed to the model-side heatmap annotation. Categorical annotations should use named color vectors; continuous annotations should use color mapping functions such as circlize::colorRamp2().

obs.labels

Single observation-side unquoted expression used as heatmap row labels by default and column labels when flip.orientation = TRUE.

mod.labels

Single model-side unquoted expression used as heatmap column labels by default and row labels when flip.orientation = TRUE.

split.obs.by

Single observation-side unquoted expression used for row_split by default and column_split when flip.orientation = TRUE.

split.mod.by

Single model-side unquoted expression used for column_split by default and row_split when flip.orientation = TRUE.

facet.obs.by

Single observation-side unquoted expression used to split the matrix into row-faceted heatmaps by default and column-faceted heatmaps when flip.orientation = TRUE.

facet.mod.by

Single model-side unquoted expression used to split the matrix into column-faceted heatmaps by default and row-faceted heatmaps when flip.orientation = TRUE.

col

A colorRampPalette function used to generate heatmap colors.

n.breaks

Integer number of color breaks sampled from col.

symmetrize.range

Logical; whether to force a symmetric color range around zero.

center.zero

Logical; whether zero must be an explicit center break.

flip.orientation

Logical; if FALSE (default), plot the score matrix in the native PolyGeniusData orientation with observations as rows and models as columns. If TRUE, transpose the plotted matrix so models are rows and observations are columns.

Additional arguments passed to ComplexHeatmap::Heatmap().

Details

Faceting follows the visual orientation. With the default orientation, facet.obs.by creates vertical heatmap facets and facet.mod.by creates horizontal heatmap facets. When flip.orientation = TRUE, this is reversed: facet.mod.by creates vertical facets and facet.obs.by creates horizontal facets. When both facet arguments are supplied, the return value is a named list of horizontal heatmap rows; the row facet side is observations by default and models when orientation is flipped.

Value

A ComplexHeatmap::Heatmap object, a ComplexHeatmap::HeatmapList, or, when both observation and model facets are supplied, a named list of horizontally-composed heatmap lists.