Skip to contents

Visualize results generated by RunCNV() from the unified srt@tools[[tool_name]] result bundle.

Usage

CNVPlot(
  srt,
  plot_type = c("heatmap", "dim", "spatial", "bar", "tree"),
  tool_name = "CNV",
  method = NULL,
  group.by = NULL,
  reduction = NULL,
  value = NULL,
  cluster_tree_by = c("cluster", "cell"),
  palette = "Chinese",
  palcolor = NULL,
  heatmap_palette = "RdBu",
  heatmap_palcolor = NULL,
  title = NULL,
  subtitle = NULL,
  theme_use = "theme_scop",
  theme_args = list(),
  ...
)

Arguments

srt

A Seurat object.

plot_type

Plot type. "heatmap" draws a chromosome-ordered CNV heatmap, "dim" shows CNV metadata on a reduction, "spatial" shows CNV metadata on spatial coordinates, "bar" summarizes calls by group, and "tree" returns a hierarchical clustering of cells or CNV clusters.

tool_name

Name of the CNV tool bundle in srt@tools.

method

Method stored under srt@tools[[tool_name]]$methods. If NULL, the active method is used.

group.by

Metadata column(s) used to color cells.

reduction

Reduction to plot. NULL uses DefaultReduction.

value

Metadata value used by "dim" and "spatial" plots. If NULL, CNV_prediction is preferred when available, otherwise CNV_score.

cluster_tree_by

For plot_type = "tree", use "cell" or "cluster" level profiles.

palette, palcolor

Palette passed to SCOP discrete plots and annotations.

heatmap_palette, heatmap_palcolor

Palette used for CNV heatmap values.

title, subtitle

Plot title and subtitle for ggplot-based views.

theme_use, theme_args

Theme name or function, plus extra theme arguments.

...

Additional parameters forwarded to the underlying plotting function.

Value

A plot object. For "heatmap", returns a ComplexHeatmap object; for "tree", returns an hclust object.

See also

Examples

if (FALSE) { # \dontrun{
srt <- RunCNV(srt, method = "copykat", genome = "hg38")

CNVPlot(srt, plot_type = "heatmap", group.by = "CNV_prediction")
CNVPlot(srt, plot_type = "dim", value = "CNV_prediction")
CNVPlot(srt, plot_type = "dim", value = "CNV_score")
CNVPlot(srt, plot_type = "bar", group.by = "seurat_clusters")
CNVPlot(srt, plot_type = "tree", cluster_tree_by = "cell")
} # }