visualize\(data\)similarity

visualize pre-computed similarity matrices

Description

Internal helper for similarity heatmaps. Set context = “obs” to work on data$obsp matrices (observation similarity) and context = “mod” to work on data$modp matrices (model similarity). Requires installed packages .pkg ComplexHeatmap and .pkg circlize.

Usage

.visualize.similarity(
  data,
  key,
  type = "heatmap",
  cluster = TRUE,
  label.by = NULL,
  cols = colorRampPalette(c("darkgreen", "white", "darkorchid4")),
  n.breaks = 11L,
  symmetrize.range = FALSE,
  center.zero = FALSE,
  drop.na = TRUE,
  context = c("obs", "mod"),
  ...
)

Arguments

data

A PolyGeniusData object.

key

Name of the similarity matrix stored in data$obsp or data$modp.

type

Plot type. Currently only “heatmap” is supported.

cluster

Logical; whether to cluster rows and columns.

label.by

Optional column name from data$obs or data$mod for labels.

cols

A colorRampPalette function used to generate colors.

n.breaks

Integer number of color breaks sampled from cols.

symmetrize.range

Logical; if TRUE, use a symmetric range around zero.

center.zero

Logical; if TRUE, center the color scale at zero.

drop.na

Logical; drop rows/columns that are entirely NA.

context

Character; “obs” for obsp, “mod” for modp.

Additional arguments passed to ComplexHeatmap::Heatmap().