Minimal input data frame

element | feature | value | annotation | group ------------ | ------------- | ------------- | ------------- | ------------- chr or fctr | chr or fctr | numeric | ... | ...

library(tidyverse)
library(tidyHeatmap)
pasilla_plus = 
    tidyHeatmap::pasilla %>%
        dplyr::mutate(act = activation) %>% 
        tidyr::nest(data = -sample) %>%
        dplyr::mutate(size = rnorm(n(), 4,0.5)) %>%
        dplyr::mutate(age = runif(n(), 50, 200)) %>%
        tidyr::unnest(data) %>%
        dplyr::rename(count = `count normalised adjusted`) %>%
        dplyr::mutate(pathway = if_else(location == "Secretory", "cluster 1", "cluster 2"))
pasilla_plus %>%
  group_by(pathway) %>%
  heatmap( symbol, sample, count ) %>%
    add_tile(condition) %>%
    add_point(activation) %>%
    add_tile(act) %>%
    add_bar(size) %>%
    add_line(age)


stemangiola/tidyHeatmap documentation built on July 30, 2023, 2:14 a.m.