Creates a ComplexHeatmap visualization of copy number data across genomic coordinates, with annotations for clone identities and chromosome locations. The function specifically handles integer copy number states and includes customizable color schemes.

plot_truth_heatmap(
  seg_dat,
  title,
  clone_identity_vector,
  clone_color_anno,
  chr_bar,
  integer_col,
  max_int = 8
)

Arguments

seg_dat

A numeric matrix containing segmented copy number data, where rows represent cells and columns represent genomic windows

title

Character string specifying the title for the heatmap

clone_identity_vector

A vector specifying clone assignments for each cell (row)

clone_color_anno

A named vector of colors for clone annotation

chr_bar

A HeatmapAnnotation object for chromosome visualization (typically created by draw_chr_bar function)

integer_col

Logical indicating whether to treat data as integer copy numbers (TRUE) or continuous values (FALSE)

max_int

Integer specifying the maximum copy number state to display. Values above this will be shown as NA (default: 8)

Value

Draws a ComplexHeatmap visualization and invisibly returns the Heatmap object

Details

The function creates a heatmap with the following features:

  • Left annotation showing clone identities

  • Top annotation showing chromosome boundaries

  • Custom color scheme for integer copy numbers using ocean.balance palette

  • NA values (including values > max_int) shown in yellow

  • Non-clustered visualization preserving genomic order

See also

draw_chr_bar for creating chromosome bar annotations

Examples

if (FALSE) { # \dontrun{
# Create sample data
seg_data <- matrix(sample(0:8, 1000, replace = TRUE), nrow = 20)
clone_ids <- rep(c("Clone1", "Clone2"), each = 10)
clone_colors <- c("Clone1" = "red", "Clone2" = "blue")

# Create chromosome bar annotation
chr_bar <- draw_chr_bar(window_data)

# Plot heatmap
plot_truth_heatmap(
  seg_dat = seg_data,
  title = "Copy Number Profile",
  clone_identity_vector = clone_ids,
  clone_color_anno = clone_colors,
  chr_bar = chr_bar,
  integer_col = TRUE,
  max_int = 8
)
} # }