Skip to contents

This function visualizes copy number alteration (CNA) segments across clusters based on data stored in a muscadet object. It displays CNAs for each clusters and scales the y-axis based on the proportion of cells in each cluster.

Usage

plotCNA(
  x,
  title = NULL,
  cna.colors = c(gain = "#EF6F6AFF", loss = "#6699CCFF", cnloh = "#44AA99FF")
)

Arguments

x

A muscadet object containing CNA calling data to be visualized (generated using cnaCalling()).

title

An optional title for the plot. Default is NULL.

cna.colors

A vector of 3 colors for CNA states: gain, loss, and cnloh (or named vector where names are "gain", "loss", and "cnloh" and the values are their respective colors). Default is c("gain" = "#EF6F6AFF", "loss" = "#6699CCFF", "cnloh" = "#44AA99FF").

Value

A ggplot object representing the CNA segments plot.

Examples

if (FALSE) { # \dontrun{
library("ggplot2")

# Load example muscadet object
data(muscadet_obj)

# Plot CNA segments
p <- plotCNA(muscadet_obj, title = "Copy Number Alterations in Example Data")
p
ggsave(
    filename = file.path("CNAplot.png"),
    plot = p,
    width = 3000,
    height = 800,
    units = "px"
)
} # }