plotHeatmap.Rd
Plot a heatmap where rows are cells, columns are genome coordinates and colours map to (allele-specific) copy-number states
plotHeatmap(
cn,
tree = NULL,
clusters = NULL,
annotations = NULL,
normalize_ploidy = FALSE,
normalize_tree = FALSE,
branch_length = 1,
spacer_cols = 20,
plottree = TRUE,
plotcol = "state",
reorderclusters = FALSE,
pctcells = 0.05,
library_mapping = NULL,
clone_pal = NULL,
sample_label_idx = 1,
fillna = TRUE,
frequencycutoff = 2,
frequency_bar_width = 0.5,
maxf = NULL,
plotfrequency = FALSE,
frequency_height = 1.4,
show_legend = TRUE,
show_library_label = TRUE,
show_clone_label = TRUE,
show_clone_text = TRUE,
widenarm = FALSE,
umapmetric = "euclidean",
chrlabels = TRUE,
labeladjust = -5,
SV = NULL,
seed = NULL,
nticks = 4,
Mb = TRUE,
fillgenome = FALSE,
annotation_height = NULL,
annofontsize = 10,
na_col = "white",
linkheight = 2.5,
newlegendname = NULL,
str_to_remove = NULL,
maxCNcol = 11,
anno_width = 0.4,
rasterquality = 15,
tree_width = 4,
ladderize = TRUE,
...
)
Either a hscn object or a single cell allele specific copy number dataframe with the following columns: `cell_id`, `chr`, `start`, `end`, `state`, `copy`
Tree in newick format to plot alongside the heatmap, default = NULL
data.frame assigning cells to clusters, needs the following columns `cell_id`, `clone_id` default = NULL
Optional dataframe containing cell_id column and additional annotation columns
Normalize ploidy of all cells to 2
default = FALSE
scales branch lengths to this size, default = 2
number of empty columns between chromosomes, default = 20
Binary value of whether to plot tree or not, default = TRUE
Which column to colour the heatmap by, should be one of "state", "state_BAF", "state_phase", "state_AS", "state_min", "copy", "BAF", "A", "B"
Reorder the cells according to cluster if no tree is specified
Minimum size of cluster in terms of perecentage of cells in umap clustering
Named vector mapping library names to labels for legend
pallette to colour clusters by
default = 1
Smooth over NA values, default = TRUE
default = 2
Width of bars for frequency track, default = 0.5
Max frequency when plotting the frequency track, default = NULL infers this from the data
Plot the frequency track of gains and losses across the genome
height of the frequency track if using, default = 1.4
plot legend or not, boolean
show library label or not, boolean
show clone label or not, boolean
Show small inset labels next to clone/cluster annotation
Widen the copy number data table to include all bins
metric to use in umap dimensionality reduction if no clusters are specified
include chromosome labels or not, boolean
sv data frame
seed for UMAP
number of ticks in x-axis label when plotting a single chromosome
Use Mb ticks when plotting single chromosome
fill in any missing bins and add NA to centromeric regions
Height of the annotations
Font size to use for annotations, default = 10
colour of NA values
height of x-axis ticks
overwrite default legend name
string to remove from cell_id's when plotting labels
max value for color scale when plotting raw data
width of left annotations
default = 15
Width of phylogenetic tree, default = 4
ladderize the tree, default = TRUE, same as default in ggtree
If clusters are set to NULL then the function will compute clusters using UMAP and HDBSCAN.
if (FALSE) { # \dontrun{
data("haplotypes")
data("CNbins")
haplotypes <- format_haplotypes_dlp(haplotypes, CNbins)
hscn <- callHaplotypeSpecificCN(CNbins, haplotypes, likelihood = "binomial")
plotHeatmap(hscn)
} # }