DrawSummitHeatmaps: DrawSummitHeatmaps

View source: R/DrawSummitHeatmaps.R

DrawSummitHeatmapsR Documentation

DrawSummitHeatmaps

Description

Plots heatmaps of pre-calculated read counts around the centers of provided regions of interest.

Usage

DrawSummitHeatmaps(
  counts,
  bamNames = names(counts),
  plotcols = rep("darkblue", length(bamNames)),
  use.log = FALSE,
  topCpm,
  medianCpm,
  bottomCpm,
  splitHM,
  TargetHeight = 500,
  orderSample = 1,
  orderWindows = NULL,
  clusterSample = 1,
  summarizing = "mean",
  show_axis = FALSE,
  MetaScale = rep("all", length(bamNames))
)

Arguments

counts

A named list of read counts across (peak) region centers, preferentially generated by SummitHeatmap for compatibility.

bamNames

Character vector containing the names to describe the samples in counts (for example: "H3K9me3"). If no names are supplied, the names of the list provided in counts are used.

plotcols

Character vector of colors of the same length as the number of heatmaps drawn, corresponding to the colors for the medianCpm value for the heatmaps. Default is darkblue for all heatmaps.

use.log

Logical scalar indicating whether the heatmap will be plotted in log2 scale. FALSE by default. A pseudo-count of 1 is added if Zeros are encountered in the matrix.

topCpm

Numeric vector of the same length as the number of heatmaps drawn, indicating the CPM values that correspond to the black color. Any value above that will appear black. If not specified, maximum CPM value in the current count table is used.

medianCpm

Numeric vector of the same length as the number of heatmaps drawn, indicating the CPM values that correspond to the plotcols. Any value above that will appear darker, any value below that will appear more white. If not specified, the median CPM value in the current count table is used.

bottomCpm

Numeric vector of the same length as the number of heatmaps drawn, indicating the CPM values that correspond to the white color. Any value below that will appear white. If not specified, the minimum CPM value in the current count table is used.

splitHM

Character vector of the same length as the number of rows in each table in counts, which indicates for each row in counts the membership within a certain group. The heatmap will then be split into these groups. For example, it could indicate if a peak overlaps a TSS or not. Default is that the heatmap will not be split.

TargetHeight

Integer scalar giving the number of rows the plotted heatmap should have after averaging. Default = 500.

orderSample

Integer scalar giving the index of the heatmap whose values the rows of all heatmaps will be ordered by. Defaults to 1 (the first heatmap). If set to 0, the clusterSample heatmap will clustered by hierarchical clustering instead of ordered.

orderWindows

The heatmap windows that will be used for ordering. By default, the heatmap will be ordered by the mean of all windows. If an integer scalar is supplied, it will be ordered by the middle window plus n windows on each side.

clusterSample

Integer scalar giving the index of the heatmap whose values the rows of all heatmaps will be ordered by hierarchical clustering. Defaults to 1 (the first heatmap).

summarizing

The function to average the heatmaps to generate the metaplot. The cpm or count values are first log2 transformed (with a pseudo count of 1 added, if necessary). Default is mean.

show_axis

Show the axis of the cumulative plot above the heatmap. Default is FALSE.

MetaScale

A character vector of the same length as heatmaps, with values "all" or "individual". Defaults to "all", which means that the maximum of the y-axis for the metaplots will correspond to the maximum of all values in all heatmaps. Otherwise the scale will correspond to the maximum of the current metaplot.

Details

Plots heatmaps of pre-calculated read counts around the centers of provided regions of interest, for example of ChIP peaks. If multiple heatmap count tables are supplied as a named list, it clusters or sorts the rows of a chosen heatmap based on its count values and keeps the rows of all other heatmaps in the same order.

Value

A complex heatmap object containing a heatmap for each sample provided in counts, sorted by the values in the middle window (around peak summit) of the chosen orderSample.

Examples

library(methods)
counts <- list(matrix(abs(rnorm(2100,2,1)),ncol=21,
nrow=100,dimnames=list(1:100,-10:10)),
               matrix(abs(rnorm(2100,2,1)),ncol=21,
               nrow=100,dimnames=list(1:100,-10:10)))
names(counts) <- c("counts1","counts2")
DrawSummitHeatmaps(counts, orderSample=1, bottomCpm = c(0,0), 
topCpm=c(10,10),use.log=FALSE,TargetHeight=0)


fmi-basel/gbuehler-MiniChip documentation built on June 13, 2025, 6:15 a.m.