heatmap.annotation: Only draw annotation

View source: R/Heatmap.R

heatmap.annotationR Documentation

Only draw annotation

Description

Only draw annotation

Usage

heatmap.annotation(
  group = NULL,
  annotation.df = NULL,
  annotation.color = NULL,
  sort.group = TRUE,
  title = "",
  group.color = "aaas",
  group.prefix = "",
  column_split = TRUE
)

Arguments

annotation.df

Column is variable, row is sample

annotation.color

A list object, the name should be corresponded to df column names

sort.group

Order the group

column_split

Default TRUE

Examples

set.seed(111)
group = sample(c(1,2),10,replace = T)
annotation.df = data.frame(Gender = sample(c("Male","Female"),10,replace = T),
                           Age = runif(10, min=50, max=80),
                           stringsAsFactors = FALSE)
#Gender.col = loonR::get.palette.color("aaas",2)
#names(Gender.col) = unique(annotation.df$Gender)
Gender.col = c("Male"="blue", "Female"="red")

col_fun = circlize::colorRamp2(c(50, 100), c("blue", "red")) # continuous variable

annotation.color = list(Gender=Gender.col, Age=col_fun)

loonR::heatmap.annotation(group = group, annotation.df = annotation.df,
                   annotation.color = annotation.color, sort.group = T)

ProfessionalFarmer/loonR documentation built on Oct. 9, 2024, 9:56 p.m.