Annotated Heatmap Layout Preview

Description

Shows a diagram of an annotated heatmap layout for given specification.

Usage

aheatmap_layout(layout = "daml", size = NULL)

Arguments

layout
layout specification that indicates the relative position of the heatmap's components. Two layouts can be defined: one horizontal, which relates to components associated to rows, and one vertical, which relates to components associated with columns. Each layout is specified as a character strings, composed of characters that encode the order of each component: dendrogram (d), annotation tracks (a), data matrix (m), labels (l) and legend (L). See section Layout syntax for a complete specification
size
list defining the size of each component (mainly for internal use).

Details

Layout syntax:

Layouts are specified as character strings that can contain the following characters, each associated with a given component or behaviour:

Components

  1. ‘d’ dendrogram component
  2. ‘a’ annotation tracks
  3. ‘m’ data matrix
  4. ‘l’ labels
  5. ‘L’ scale legend

Behaviours

  1. ‘^’ align top (resp. left) for horizontal (resp. vertical) layout.
  2. ‘-’ align middle (resp. center) for horizontal (resp. vertical) layout.
  3. ‘_’ align bottom (resp. right) for horizontal (resp. vertical) layout. If used alone (i.e. layout = "_"), then this is equivalent to "|.L_", which places the legend horizontally on the bottom-right corner.
  4. ‘*’ used either alone or after after ‘L’ to specifiy that the legend should expand to full height/width.

The specification must contain one instance of each of these character.

The default horizontal/vertical layout is "daml", and can also be specified as ".".

Separate layouts can be passed as a character vector with 2 element (e.g., c("daml", "mald")), or as a single string, with layouts separated by "|" (e.g., "almd | L."). When using this separator, a layout specification may be omitted, indicating that the default layout shoud be used: "almd|" is equivalent to "almd | .". If only one layout specification is passed (i.e. a string without "|"), then it is used for both horizontal and vertical layouts.

Shortcuts

  • layout = "*" is a shortcut for layout = ".L*", which expands the legend to take up full height;
  • layout = "_" is a shortcut for layout = "|.L_", which puts the legend at bottom-right corner;
  • layout = "_^" is a shortcut for layout = "|.L^", which puts the legend at bottom-left corner;
  • layout = "_*" is a shortcut for layout = "|.L*", which puts the legend at bottom, expanded to take up full width;
  • layout = "^" is a shortcut for layout = "L^.|", which puts the legend on the top-left corner.

Examples:

  • layout = "dlma" puts labels at the leaves of the dendrograms and annotation track below or at the right of the data matrix
  • layout = ". | amld" use the default layout for rows, put column annotation track on top of the data matrix, followed by column labels and dendrogram.

Examples



# default layout
aheatmap_layout()

plot of chunk rd_example_aheatmap_layout_/tmp/RtmpZvcJW3/file15bc25713d99

# Common row/column layout: annotations > data > labels > dendrogram
aheatmap_layout('amld')

plot of chunk rd_example_aheatmap_layout_/tmp/RtmpZvcJW3/file15bc25713d99

# Separate row/column layout: row as above / column as default
aheatmap_layout('amld | .')

plot of chunk rd_example_aheatmap_layout_/tmp/RtmpZvcJW3/file15bc25713d99

## Legend
# horizontal bottom-right
aheatmap_layout('_')

plot of chunk rd_example_aheatmap_layout_/tmp/RtmpZvcJW3/file15bc25713d99

# hotizontal top-left (equivalent to "|L^.")
aheatmap_layout('^')

plot of chunk rd_example_aheatmap_layout_/tmp/RtmpZvcJW3/file15bc25713d99