stemangiola / tidyHeatmap

Draw heatmap simply using a tidy data frame
https://stemangiola.github.io/tidyHeatmap/
319 stars 23 forks source link

Adding more than 2 heatmaps side-by-side not working #123

Open jantusan opened 1 year ago

jantusan commented 1 year ago

Hello,

Thank you for the useful package! I am trying to add heatmaps side by side with the + function of ComplexHeatmap, but it doesn't work if it is more than 2 heatmaps

p_heatmap = heatmap(mtcars_tidy, `Car name`, Property, Value, scale = "row") 

# works and throws the expected warning
p_heatmap + p_heatmap
#> Warning: Heatmap/annotation names are duplicated: Value

# gives an additional warning and an error
p_heatmap + p_heatmap + p_heatmap
#> Warning: Heatmap/annotation names are duplicated: Value
#> Warning: Incompatible methods ("+.AdditiveUnit", "+.InputHeatmap") for "+"
#> Error in p_heatmap + p_heatmap + p_heatmap : non-numeric argument to binary operator

is there a way to add more than 2 heatmaps side-by-side like in ComplexHeatmap?

mschubert commented 1 year ago

This also fails for me:

p_heatmap + patchwork::plot_spacer()
# Error in p_heatmap + plot_spacer() :
#   non-numeric argument to binary operator
# In addition: Warning message:
# Incompatible methods ("+.InputHeatmap", "+.gg") for "+"
stemangiola commented 1 year ago

Sorry, for the slowness of the response I have been a little overwhelmed with work recently.

stemangiola commented 1 year ago

Just to mention that if someone would like to take this challenge and propose a fix, this would be more than welcome. This could be the introduction to the tidyomics project and get involved in upcoming papers!