plotStackProfile {epistack}R Documentation

plotStackProfile()

Description

Display a heatmap of an epigenetic track centered at genomic anchors such as Transcription Start Sites or peak center.

Usage

plotStackProfile(
  gr,
  pattern = "^window_",
  x_labels = c("Before", "Anchor", "After"),
  title = "",
  zlim = NULL,
  palette = function(n) viridisLite::viridis(n, direction = -1),
  target_height = 650,
  summary_func = function(x) mean(x, na.rm = TRUE),
  n_core = 1
)

Arguments

gr

a GRanges input

pattern

a character vector of length 1 of a column prefixe (can be regular expressions) that should match columns of gr.

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 redimMatrix(). Usualy mean, but can be set to median or max for sparse matrices.

n_core

multicore option, passed to redimMatrix().

Details

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 GRanges used as an input (hereafter gr).

Anchors are plotted from top to bottom in the same order as in gr. One should sort gr before plotting if needed.

The matrix used to display the heatmap should be passed as additional metadata columns of gr. Such matrix can be obtained using EnrichedHeatmap::normalizeToMatrix() for example. The matrix columns names are then specified through what_pattern using a prefix, a suffix or a regular expressions.

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().

Value

Display a plot.

See Also

plotAverageProfile, plotEpistack, normalizeToMatrix, plotStackProfileLegend

Examples

data("stackepi")
plotStackProfile(stackepi,
                   target_height = 650,
                   zlim = c(0, 1),
                   palette = colorRampPalette(c("white", "dodgerblue", "black")),
                   title = "DNA methylation")


[Package epistack version 1.0.0 Index]