heatmapLayout: Generate a layout for an (annotated) heatmap

Description Usage Arguments Details Value See Also Examples

View source: R/annHeatmap.R

Description

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

Usage

1
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.

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.

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

See Also

annHeatmap2, picketPlot, layout

Examples

1
2
3
4
5
6
    ## 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

Example output

$plot
          leg2 image
colDendro    0     2
image        4     1
colAnn       0     3

$width
[1] 1 5

$height
[1] 2 5 2

$legend.side
[1] 2

Heatplus documentation built on May 2, 2018, 4:03 a.m.