Boxplot annotation per cluster and column using ComplexHeatmap
0
0
Entering edit mode
2.3 years ago
gdeniz ▴ 20

Hi, I am trying to add boxplot annotations to my heatmap similar as in post1 but with one boxplot per cluster. For a single column heatmap it works as intended:

library(ComplexHeatmap)    
ha = HeatmapAnnotation(summary=anno_summary(height=unit(4,"cm")))
v=rnorm(50)
Heatmap(v,name="mat",top_annotation = ha,width=unit(2,"cm"),km=2)

However, when I have two or more columns I get an error or I get the result as described in the above post.

ha = HeatmapAnnotation(summary=anno_summary(height=unit(4,"cm")))
v=cbind(rnorm(50),rnorm(50,1))
Heatmap(v,name="mat",top_annotation = ha,width=unit(2,"cm"),km=2)
Error: number of observations in top annotation should be as same as ncol of the matrix.

Please advise.

ComplexHeatmap R • 1.7k views
ADD COMMENT
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Thanks for sharing these. Having a hard time understanding how these annotation functions are written. Any more detailed tutorials on those (beyond index, k, m)? The first link you provided uses two separate heatmaps and generates one boxplot per row of each heatmap. I am looking to generate a boxplot for each column and k-means cluster. Not sure how to implement this based on the available information.

ADD REPLY

Login before adding your answer.

Traffic: 2069 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6