heatmap_extract_cluster: Extract the clusters from a ComplexHeatmap

Description Usage Arguments Examples

View source: R/heatmap.R

Description

Extract the clusters from a ComplexHeatmap

Usage

1
heatmap_extract_cluster(heatmap_obj, matrix_obj, which = "column")

Arguments

heatmap_obj

a Heatmap object

matrix_obj

the matrix that was used to create the heatmap, needs col and or row names

which

row or column cluster

Examples

1
2
3
4
5
6
7
8
9
mat = matrix(rnorm(80, 2), 8, 10)
mat = rbind(mat, matrix(rnorm(40, -2), 4, 10))
mat = matrix(rnorm(80, 2), 8, 10)
mat = rbind(mat, matrix(rnorm(40, -2), 4, 10))
rownames(mat) = letters[1:12]
colnames(mat) = letters[1:10]
HM <- ComplexHeatmap::Heatmap(mat, km=3)  #Make a heatmap, and have 3 clusters
HM <- ComplexHeatmap::draw(HM)  #Show the heatmap
heatmap_extract_cluster(HM, mat, which = "row")

joelgsponer/waRRior2 documentation built on Feb. 22, 2020, 3:34 a.m.