visualize\(data\)scores$distribution.heatmap

visualize PRS score distributions as heatmaps

Description

Converts one score layer into a model-by-distribution heatmap. Rows represent models and columns represent score bins or density grid points. Observation faceting splits samples before each model distribution is calculated.

Usage

visualize.scores.distribution.heatmap(
  data,
  scores.layer = X,
  models = NULL,
  obs = NULL,
  type = c("density", "histogram"),
  n.bins = 100L,
  annotate.mod.by = NULL,
  annotate.mod.color = NULL,
  mod.labels = NULL,
  split.mod.by = NULL,
  facet.obs.by = NULL,
  col = colorRampPalette(c("white", "darkgreen")),
  n.breaks = 11L,
  symmetrize.range = FALSE,
  center.zero = FALSE,
  ...
)

Arguments

data

A PolyGeniusData object containing the score matrix.

scores.layer

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

models

Optional unquoted model-side selector. Supports the same subsetting forms as PolyGeniusData: numeric indices, character model names, logical vectors, or single logical expressions resolved with data$fetch(…, .context = “mod”).

obs

Optional unquoted observation-side selector. Supports the same subsetting forms as PolyGeniusData: numeric indices, character observation names, logical vectors, or single logical expressions resolved with data$fetch(…, .context = “obs”).

type

Distribution summary, either “density” or “histogram”.

n.bins

Integer number of distribution grid points or histogram bins.

annotate.mod.by

Model-side unquoted expression(s), usually c(…) or list(…), used as row annotations.

annotate.mod.color

Optional named list of colors for model annotations. Categorical annotations should use named color vectors; continuous annotations should use color mapping functions such as circlize::colorRamp2().

mod.labels

Single model-side unquoted expression used as heatmap row labels.

split.mod.by

Single model-side unquoted expression used for row_split.

facet.obs.by

Single observation-side unquoted expression used to split observations before calculating model distributions. Observation facets are combined horizontally.

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.

Additional arguments passed to ComplexHeatmap::Heatmap().

Value

A ComplexHeatmap::Heatmap object, or a horizontally-composed ComplexHeatmap::HeatmapList when facet.obs.by is supplied.