Plot normalized accessibility of peaks over metacells, ordered by clustering
Source:R/plot.R
plot_atac_peak_map.Rd
Plot normalized accessibility of peaks over metacells, ordered by clustering
Usage
plot_atac_peak_map(
atac_mc,
atac_mc_clust = NULL,
peak_clust = NULL,
peak_annotation = NULL,
filename = NULL,
dev = png,
main = atac_mc@id,
colors = colorRampPalette(c("blue4", "white", "red4"))(100),
...
)
Arguments
- atac_mc
McPeaks object
- atac_mc_clust
output of
gen_atac_mc_clust
(for meaningful visuals, make sure this is ordered by cluster)- peak_clust
output of
gen_atac_peak_clust
or other clustering of peaks (for meaningful visuals, make sure this is ordered by cluster)- peak_annotation
(optional) a list of a named vector and a dataframe conforming to the pheatmap
annotation_colors
andannotation_row
conventions- filename
(optional) path and filename of where to save the figure; if unspecified, figure isn't saved
- dev
(optional; default - png) graphical device to save figure with
- colors
(optional) colorRampPalette vector of colors for scaling colors in heatmap
- ...
Arguments passed on to
save_pheatmap
width
the width of the device.
height
the height of the device.
res
The nominal resolution in ppi which will be recorded in the bitmap file, if a positive integer. Also used for
units
other than the default, and to convert points to pixels.
Examples
if (FALSE) {
peak_clust <- gen_atac_peak_clust(my_mcatac, 16)
plot_atac_peak_map(my_mcatac, order(my_mcatac@metadata$cell_type), order(peak_clust), "./my_figures/my_mcatac_heatmap.png")
## Peak annotation example
is_dyn <- setNames(as.numeric(rownames(my_mcatac@mat) %in% my_mcatac_dynamic_peaks_only@peaks$peak_name), rownames(my_mcatac@mat))
pa1 <- list("is_dyn" = setNames(c("black", "red"), c(0, 1)))
pa2 <- tibble::column_to_rownames(enframe(is_dyn, name = "peak_name", value = "is_dyn"), "peak_name")
pa <- list(pa1, pa2)
plot_atac_peak_map(my_mcatac, atac_mc_clust = order(my_mcatac@metadata$cell_type), peak_annotation = pa)
}