Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

selectArea

Select an area in the heatmap


Description

Select an area in the heatmap

Usage

selectArea(ht_list, pos1 = NULL, pos2 = NULL, mark = TRUE, verbose = TRUE,
    ht_pos = NULL)

Arguments

ht_list

A HeatmapList-class object returned by draw,Heatmap-method or draw,HeatmapList-method.

mark

Whether mark the selected area as a rectangle.

pos1

If the value is NULL, it can be selected by click on the heatmap (of cource, the heatmap should be on the interactive graphic device). If it is set, it must be a unit object with length two which corresponds to the x and y position of the point.

pos2

Another point as pos1, together with pos1 defines the selected region.

verbose

Whether to print messages.

ht_pos

A value returned by ht_pos_on_device.

Details

The regions can be selected interactively or manually by setting pos1 and pos2.

Value

A DataFrame object with row indices and column indices corresponding to the selected region.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

if(interactive()) {
	m = matrix(rnorm(100), 10)
	rownames(m) = 1:10
	colnames(m) = 1:10

ht = Heatmap(m)
	ht = draw(ht)
	selectArea(ht)

set.seed(123)
	ht = Heatmap(m, row_km = 2, column_km = 2)
	ht = draw(ht)
	selectArea(ht)
}

ComplexHeatmap

Make Complex Heatmaps

v2.6.2
MIT + file LICENSE
Authors
Zuguang Gu
Initial release
2020-11-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.