heatmap.n2 {heatmapFlex} | R Documentation |
Main heatmap function
Description
This is the main function to be called be end users. It accepts a numeric matrix and draws a heatmap.
Usage
heatmap.n2(
x,
main = "Heatmap",
...,
na.color = "gray80",
sidebars = NULL,
picketdata = NULL,
r.cex = 1,
c.cex = 1,
titleheight = lcm(1.2),
dendroheight = lcm(3),
dendrowidth = lcm(3),
labelheight = lcm(1),
labelwidth = lcm(1),
picketheight = 0.4,
sidebarwidth = lcm(1),
sidebar.cex = 1,
colorkeylabels = FALSE,
legendcorner = "bottomleft",
plot = TRUE,
factorpalettefn = "Pastel1",
add.sig = FALSE,
pv = NULL,
order_list = TRUE,
genes2highl = NULL
)
Arguments
x |
( |
main |
( |
... |
Additional arguments passed to |
na.color |
( |
sidebars |
( |
picketdata |
( |
r.cex |
( |
c.cex |
( |
titleheight |
( |
dendroheight |
( |
dendrowidth |
( |
labelheight |
( |
labelwidth |
( |
picketheight |
( |
sidebarwidth |
( |
sidebar.cex |
( |
colorkeylabels |
( |
legendcorner |
( |
plot |
( |
factorpalettefn |
( |
add.sig |
( |
pv |
( |
order_list |
( |
genes2highl |
( |
Details
The result can be used for zooming. For simple basic cases, picketvar can be given directly. Factor
sidebars are supported, but legends are only shown for the first two.
Arguments that will be passed on the prepare_heatmap_data2
:
labRow (character ). Custom row labels |
|
labCol (character ). Custom column labels |
|
Rowv (dendrogram or integer ). Custom dendrogram object or integer vector giving the ordering index for rows |
|
Colv (dendrogram or integer ). Custom dendrogram object or integer vector giving the ordering index for columns |
|
reorder (logical ). Boolean of length 2 for rows and columns. Should rows and/or columns be reordered according to Rowv /Colv |
|
distfun (function ). Distance function. Defaults to dist |
|
hclustfun (function ). Hierarchical clustering function. Defaults to hclust |
|
rowMembers (character ). Group vector to split rows by |
|
colMembers (character ). Group vector to split columns by |
|
spacer (integer ). Length 1 integer used as spacer to separate groups (see rowMembers /colMembers ). Defaults to 1 |
|
scale (character ). One of "row", "column" or "none": By which dimension should data be scaled? Defaults to "none" |
|
trim (numeric ). Value to "cut off" data distribution. Values and both ends of the distribution, larger or smaller, respectively, will be made equal to +/-trim . Defaults to NULL , no trimming |
|
zlim (numeric ). Value to set the ranges for plotting x and y values. Supports both symmetrical (with default NULL ) and asymmetrical (NA ) automatic zlim. Used for zooming |
|
col (character ) Name (acronym) of the colour palette to use. Can be one of "RdBkGn" (c("green", "black", "red")), "BuYl" (c("blue", "yellow")), "BuWtRd" (c("blue", "white", "red")) or a valid name used by brewer.pal . Defaults to NULL which will set "RdBkGn" |
|
filter (integer or logical .) For filtering rows/columns: TRUE (=1.0) = remove rows/columns with only NAs, 0.5 = remove if >= 50 per cent NAs, etc. Defaults to c(TRUE, TRUE) |
|
Value
In addition to its side-effect of plotting the heatmap (if plot
is TRUE
, which is the default),
the function will invisibly returns the prepared "display list", a list
of all parts of the heatmap used by
hlayout()
to actually draw the final heatmap.
See Also
Examples
# Generate a random 10x10 matrix and plot it using default values
mat <- matrix(rnorm(100), nrow = 10)
heatmap.n2(mat)
# Generate a random 10x10 matrix with two distinct sets, order it using
# default clustering methods, split it into each two groups along both rows
# and columns and adjust colour palette and dendrogram dimensions:
mat <- matrix(c(rnorm(50, mean = 1), rnorm(50, mean = -1)), nrow = 10)
heatmap.n2(mat, col = "BuWtRd", rowMembers=rep(1:2, each=5),
colMembers=rep(1:2, each=5), labRow=paste0("gene-", 1:10),
labCol=paste0(c("A", "B"), rep(1:5, 2)), r.cex=0.8,
dendroheight = lcm(2.2), dendrowidth = lcm(2.4))