Heatplus (version 2.18.0)

heatmapLayout: Generate a layout for an (annotated) heatmap

Description

Generate a layout for an (annotated) heatmap. This function will generally not be called directly, but only via annHeatmap2.

Usage

heatmapLayout(dendrogram, annotation, leg.side = NULL, show = FALSE)

Arguments

dendrogram
A list with named entries Row and Col. Each of these is a list with a named entry status. If the value of status is the string "yes", space will be set aside for drawing a row- and/or column dendrogram.
annotation
A list with named entries Row and Col. Each of these is a list with a named entry data. If the value of data is not NULL, space will be set aside for a picket plot showing the row- and/or column annotation.
leg.side
An integer indicating on where to reserve space for the legend: values 1-4 correspond to below, to the left, above and to the right, as in e.g. axis. For a value of NULL, the function provides a reasonable default where there is space left in the layout. For any other value, no space for a legend is put aside.
show
A logical value; if TRUE, the layout defined by the arguments is displayed graphically.

Value

A list with the following entries:
plot
A matrix describing the plot layout; see layout
width
relative widths of plots (i.e. columns)
height
relative heights of plots (i.e. rows)
legend.side
side where to draw the legend

Details

Space for plots is reserved via the layout mechanism. The function starts with an empty maximum layout, fills in the plot, dendrograms, annotation plots and legend as required, and compresses the resulting layout by removing empty slots.

See Also

annHeatmap2, picketPlot, layout

Examples

Run this code
    ## Heatmap with column dendrogram, column annotation, default legend
    dnd = list(Row=list(status="no"), Col=list(status="yes"))
    ann = list(Row=list(data=NULL), Col=list(data=1))
    ## 1 = heatmap, 2=dendrogram, 3=annotation, 4=legend
    ll = heatmapLayout(dendrogram=dnd, annotation=ann, leg.side=NULL, show=TRUE)
    ll

Run the code above in your browser using DataCamp Workspace