get_hm_clust | R Documentation |
Get data frame of genes per cluster from ComplexHeatmap output
get_hm_clust(dat, hm, dimension)
dat |
Ordered and scaled matrix of gene counts |
hm |
ComplexHeatMap output specified with draw(h) |
dimension |
Row or column clusters |
Data frame of genes per row/column, which row or column they owe to, and which cluster number
library(ComplexHeatmap)
library(dplyr)
library(tidyr)
library(tibble)
hm.dat <- example.model$lme %>%
select(gene, variable, pval) %>%
pivot_wider(names_from = variable, values_from = pval) %>%
column_to_rownames("gene") %>% as.matrix()
example.hm <- Heatmap(hm.dat, row_km=3, column_km=2)
example.hm <- draw(example.hm)
row_clust <- get_hm_clust(dat = hm.dat,
hm = example.hm, dimension = "row")
column_clust <- get_hm_clust(dat = hm.dat,
hm = example.hm, dimension = "col")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.