plotHeatmap.RdPlot 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,
plotallbins = FALSE,
plotideogram = FALSE,
genome = "hg19",
centromere_col = "#E8E8E8",
ideogram_height = 0.3,
gene_annotations = NULL,
gene_annotation_fontsize = NULL,
gene_link_height = 5,
gene_label_sep = "/",
plotmean = FALSE,
plotdiversity = FALSE,
mean_height = 0.7,
diversity_height = 0.7,
...
)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
Adjustment for chromosome label position
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
Deprecated. Use plotallbins instead.
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
Include all genomic bins in the heatmap, with centromeric regions displayed as NA (light grey). Default is FALSE.
Display chromosome ideogram (cytoband) annotation at the bottom of the heatmap. Requires plotallbins = TRUE. Default is FALSE.
Genome assembly to use for ideogram and centromere identification. Either "hg19" or "hg38". Default is "hg19".
Color to use for centromeric regions when plotallbins = TRUE. Default is "#E8E8E8" (light grey).
Height of the ideogram annotation in cm. Default is 0.3.
Character vector of gene names to annotate at the top of the heatmap. Gene names must match the `ensembl_gene_symbol` column in `gene_locations` data. Default is NULL.
Font size for gene annotation labels. Defaults to `annofontsize` if NULL.
Height of link lines connecting gene labels to positions, in mm. Default is 5.
Separator used when multiple genes fall within the same genomic bin. Default is "/".
Show a mean copy number line track at the top of the heatmap. Only works with numeric plotcol values. Default is FALSE.
Show a copy number diversity (standard deviation) line track at the top of the heatmap. Only works with numeric plotcol values. Default is FALSE.
Height of the mean copy number track in cm. Default is 0.7.
Height of the diversity track in cm. Default is 0.7.
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)
} # }