This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to modify right annotation in heatmap without changing the rest of parameters

Hi everybody, I am getting stuck on a problem with heatmap created with the library Complex Heatmap in R. I need only to change the right row annotation but I don't want to change any other parameter. Because of course I can add the modification inside Heatmap(..., right_annotion = row_annotation...), but in this way also my heatmap changes, and I want to preserve the first heatmap generated.

I attach the image, what I want to do is to change only the annotation kn the row without touching the rest of the heatmap. Anyone can help me, please?

Thank you

annotation complexheatmap heatmap

Please add image, code and some data, so basically a minimal reproducible example.

Yes sure, sorry!

This is my code for the heatmap:

library(ComplexHeatmap)

ht2 <- Heatmap(zed, column_order = order(as.numeric(gsub('T', '', colnames(zed)))),
              row_names_gp = gpar(fontsize = 1), column_dend_side = 'top', km=7,
              right_annotation = rowAnnotation(foo = anno_block(gp = gpar(fill = c(1,2,2,1,3,3,1),
                                                                labels = c('','Ascending','Ascending','','Discending','Discending',''),
                                                                labels_gp = gpar(col = 'white')))))

I have done an error on the annotation and I want to modify it without redo all the heatmap, otherwise it changes.

enter image description here

0 answers

No answers yet.

Log in to answer this question.