View source: R/DrawSummitHeatmaps.R
DrawSummitHeatmaps | R Documentation |
Plots heatmaps of pre-calculated read counts around the centers of provided regions of interest.
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))
)
counts |
A named list of read counts across (peak) region centers, preferentially generated by |
bamNames |
Character vector containing the names to describe the samples in |
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 |
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 |
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 |
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. |
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.
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
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.