geom_th_bar: Annotation barplot

View source: R/geom_th_bar.R

geom_th_barR Documentation

Annotation barplot

Description

This adds a barplot to annotate rows or columns of a heatmap with showing the scale of the barplot.

Usage

geom_th_bar(
  name = NULL,
  th_data = NULL,
  mapping = NULL,
  side = c("top", "bottom", "right", "left"),
  gap = 1,
  width = 0.3,
  rel_width = 1,
  rel_height = 1,
  n = 2,
  ...,
  axis_ticks_length = NULL,
  axis_color = "black",
  axis_label_color = "black",
  axis_label_size = 3,
  axis_label_nudge_x = 0,
  axis_label_nudge_y = 0,
  axis_location = NULL,
  border_color = "grey",
  border_size = 0.5
)

geom_th_bar0(
  name = NULL,
  th_data = NULL,
  mapping = NULL,
  side = "right",
  gap = 1,
  rel_width = 1,
  rel_height = 1,
  n = 2,
  ...
)

Arguments

name

a name to select heatmap

th_data

a data frame. It should include one column named as rowLab to store the row name of the heatmap when side is left or right; otherwise, it should include one column named as colLab to store the column name of the heatmap when side is top or bottom.

mapping

Set of aesthetic mappings created by aes.

side

a character to specify where to put the barplot. It is selected from left, right to annotate rows of the heatmap, or top, bottom to annotate columns of the heatmap.

gap

a numeric value to specify the gap between the selected heatmap and the bar plot.

width

Bar width. By default, set to 90% of the resolution of the data.

rel_width

a numeric value decide the relative width of the barplot compared to the selected heatmap

rel_height

a numeric value decide the relative height of the barplot compared to the selected heatmap

n

a number to decide the number of ticks. See pretty.

...

More arguments accepted by geom_bar.

axis_ticks_length

a number to decide the length of ticks.

axis_color

the color of the axis

axis_label_color

the color of axis labels

axis_label_size

the size of axis labels

axis_label_nudge_x

adjust the location of labels along x-axis

axis_label_nudge_y

adjust the location of labels along y-axis

axis_location

NULL. If side is "top" or "bottom", it should be "left" or "right"; otherwise, it should be "top" or "bottom".

border_color

the color of the rectangular border

border_size

the size of the border line

Value

a list of geom layers

Author(s)

Ruizhu Huang


fionarhuang/TreeHeatmap documentation built on Feb. 1, 2024, 7:30 a.m.