Create copy number matrix for heatmap visualization

createCNmatrix(
  CNbins,
  field = "state",
  maxval = 11,
  na.rm = FALSE,
  fillna = FALSE,
  fillnaplot = FALSE,
  wholegenome = FALSE,
  genome = "hg19",
  centromere = FALSE,
  plotallbins = FALSE
)

Arguments

CNbins

Copy number data frame with chr, start, end, cell_id columns

field

Column to use for values in matrix

maxval

Maximum value to cap state at

na.rm

Remove rows with NA values

fillna

Fill NA values by propagating neighboring values

fillnaplot

Fill NA values while preserving centromeric gaps

wholegenome

Expand to all genomic bins (deprecated, use plotallbins)

genome

Genome assembly ("hg19" or "hg38")

centromere

Mark centromeric regions as NA after filling

plotallbins

Include all genomic bins, marking centromeres with sentinel value