View source: R/plotStackProfile.R
plotStackProfile | R Documentation |
Display a heatmap of an epigenetic track centered at genomic anchors such as Transcription Start Sites or peak center.
plotStackProfile(
rse,
assay = NULL,
x_labels = c("Before", "Anchor", "After"),
title = "",
zlim = NULL,
palette = function(n) grDevices::hcl.colors(n, rev = TRUE),
target_height = 650,
summary_func = function(x) mean(x, na.rm = TRUE),
n_core = 1,
pattern = NULL
)
rse |
a RangedSummarizedExperiment input. Aletrnatively: can be a
GRanges object
(for backward compatibility, |
assay |
specify the name of the assay to plot,
that should match one of |
x_labels |
a character vectors of length 3 used to label the x-axis. |
title |
The title of the heatmap |
zlim |
The minimum and maximum z values to match color to values. Format: zlim = c (min, max) |
palette |
a palette of color, (i.e. a function of parameter n that should retrun n colors). |
target_height |
The matrix height is reduced to this number of rows before plotting. Useful to limit overplotting artefacts. It should roughtly be set to the pixel height in the final heatmap. |
summary_func |
function passed to |
n_core |
multicore option, passed to |
pattern |
only if |
The visualisation is centered on an anchor,
a set of genomic coordinated that can be transcription start sites or
peak center for example. Anchor coordinates are those of the
RangedSummarizedExperiment
object used as an input
(hereafter rse
).
Anchors are plotted from top to bottom in the same order as in rse
.
One should sort rse
before plotting if needed.
The matrix used to display the heatmap should be passed as
assay of rse
. Such matrix can be obtained using
EnrichedHeatmap::normalizeToMatrix()
for example.
This function scale reasonnably wells up to hundred thousands
of regions. Overplotting issues are solved by last-minute reduction of the
matrix size using redimMatrix()
.
Display a plot.
plotAverageProfile
,
plotEpistack
,
normalizeToMatrix
,
plotStackProfileLegend
data("stackepi")
plotStackProfile(stackepi,
target_height = 650,
zlim = c(0, 1),
palette = colorRampPalette(c("white", "dodgerblue", "black")),
title = "DNA methylation")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.