Skip to contents

Plot CNV Results into a Heatmap Builds a heatmap to visualize the CNV results based on genomic scores.

Usage

plotCNVResults(
  seuratObj,
  referenceVar = NULL,
  clustersVar = "cnv_clusters",
  splitPlotOnVar = clustersVar,
  savePath = ".",
  printPlot = FALSE,
  referencePalette = "default",
  clusters_palette = "default",
  outputType = "png"
)

Arguments

seuratObj

A Seurat object containing the genomic scores computed previously.

referenceVar

The name of the metadata column in the Seurat object containing reference annotations.

clustersVar

The name of the metadata column containing cluster information (default = "cnv_clusters").

splitPlotOnVar

The name of the metadata column used to split the heatmap rows (e.g., cell type or cluster) (default = clustersVar).

savePath

The path where the heatmap will be saved. If NULL, the plot will not be saved (default = ".").

printPlot

Logical. If TRUE, prints the heatmap to the console.

referencePalette

A color palette for referenceVar. You can provide a custom palette as a vector of color codes (e.g., c("#FF0000", "#00FF00")).

clusters_palette

A color palette for clustersVar. You can provide a custom palette as a vector of color codes (e.g., c("#F8766D", "#A3A500", "#00BF7D")).

outputType

Character. Specifies the file format for saving the plot, either "png" or "pdf".

Value

This function generates a heatmap and saves it as a .pdf or .png file in the specified path (default = working directory).