This function produces labaled heatmaps divided into several plots. This is useful for large heatmaps where labels on individual columns and rows may become unreadably small (or overlap).
labeledHeatmap.multiPage(
# Input data and ornaments
Matrix,
xLabels, yLabels = NULL,
xSymbols = NULL, ySymbols = NULL,
textMatrix = NULL, # Paging options
rowsPerPage = NULL, maxRowsPerPage = 20,
colsPerPage = NULL, maxColsPerPage = 10,
addPageNumberToMain = TRUE,
# Further arguments to labeledHeatmap
zlim = NULL,
signed = TRUE,
main = "",
# Separator line specification
verticalSeparator.x = NULL,
verticalSeparator.col = 1,
verticalSeparator.lty = 1,
verticalSeparator.lwd = 1,
verticalSeparator.ext = 0,
horizontalSeparator.y = NULL,
horizontalSeparator.col = 1,
horizontalSeparator.lty = 1,
horizontalSeparator.lwd = 1,
horizontalSeparator.ext = 0,
...)
numerical matrix to be plotted in the heatmap.
labels for the columns. See Details.
labels for the rows. See Details.
additional labels used when xLabels
are interpreted as colors. See Details.
additional labels used when yLabels
are interpreted as colors. See Details.
optional text entries for each cell. Either a matrix of the same dimensions as
Matrix
or a vector of the same length as the number of entries in Matrix
.
optional list in which each component is a vector specifying which rows should appear
together in each plot. If not given, will be generated automatically based on maxRowsPerPage
below
and the number of rows in Matrix
.
integer giving maximum number of rows appearing on each plot (page).
optional list in which each component is a vector specifying which columns should appear
together in each plot. If not given, will be generated automatically based on maxColsPerPage
below
and the number of rows in Matrix
.
integer giving maximum number of columns appearing on each plot (page).
logical: should plot/page number be added to the main
title of each plot?
Optional specification of the extreme values for the color scale. If not given, will be determined from the
input Matrix
.
Main title for each plot/page, optionally with the plot/page number added.
logical: should the input Matrix
be converted to colors using a scale centered at zero?
indices of columns after which separator lines (vertical lines between columns)
should be drawn. NULL
means no lines will be drawn.
color(s) of the vertical separator lines. Recycled if need be.
line type of the vertical separator lines. Recycled if need be.
line width of the vertical separator lines. Recycled if need be.
number giving the extension of the separator line into the margin as a fraction of the margin width. 0 means no extension, 1 means extend all the way through the margin.
indices of columns after which separator lines (horizontal lines between
columns)
should be drawn. NULL
means no lines will be drawn.
color(s) of the horizontal separator lines. Recycled if need be.
line type of the horizontal separator lines. Recycled if need be.
line width of the horizontal separator lines. Recycled if need be.
number giving the extension of the separator line into the margin as a fraction of the margin width. 0 means no extension, 1 means extend all the way through the margin.
other arguments to function labeledHeatmap
.
None.
The function labeledHeatmap
is used to produce each plot/page; most arguments are described
in more detail in the help file for that function.
In each plot/page labeledHeatmap
plots a standard heatmap plot of an appropriate
sub-rectangle of Matrix
and embellishes it with
row and column labels and/or with text within the heatmap entries. Row and column labels can be either
character strings or color squares, or both.
To get simple text labels, use colorLabels=FALSE
and pass the desired row and column labels in
yLabels
and xLabels
, respectively.
To label rows and columns by color squares, use
colorLabels=TRUE
; yLabels
and xLabels
are then expected to represent valid colors.
For reasons of compatibility with other functions, each entry in yLabels
and xLabels
is
expected to consist of a color designation preceded by 2 characters: an example would be
MEturquoise
. The first two characters can be arbitrary, they are stripped.
Any labels that do not represent valid colors will be considered text labels and printed in full,
allowing the user to mix text and color labels.
It is also possible to label rows and columns by both color squares and additional text annotation. To
achieve this, use the above technique to get color labels and, additionally, pass the desired text
annotation in the xSymbols
and ySymbols
arguments.
If rowsPerPage
(colsPerPage
) is not given, rows (columns) are allocated automatically as
uniformly as possible, in contiguous blocks of size at most maxRowsPerPage
(maxColsPerPage
).
The allocation is performed by the function allocateJobs
.
The workhorse function labeledHeatmap
for the actual heatmap plot;
function allocateJobs
for the allocation of rows/columns to each plot.