jokergoo / ComplexHeatmap

Make Complex Heatmaps
https://jokergoo.github.io/ComplexHeatmap-reference/book/
Other
1.31k stars 230 forks source link

Subset annotations while subsetting heatmap #996

Open Rohit-Satyam opened 2 years ago

Rohit-Satyam commented 2 years ago

Hi @jokergoo

I was trying to make a presence-absence heatmap with a broad annotation category. I have 200 signaling pathways and their broad categories. I drew heatmap using the following code for first 20 pathways

ht <- Heatmap(t(p), col = c('White','Grey'), width = 7*unit(5, "mm"), 
        height = 5, show_row_dend = F, show_column_dend = F,row_names_side = "left"
          ,heatmap_legend_param = list(
            title = "",  
            labels = c("Present", "Absent"), border = "Black"
        ))

ht[1:20,] + rowAnnotation(Category=annot2$label[1:20]) 

However, I wish to take this row annotation color bar to the left. How do I do that? image

jokergoo commented 2 years ago
draw(ht[1:20,] + rowAnnotation(Category=annot2$label[1:20]), annotation_legend_side = "left")