griffithlab / GenVisR

Genome data visualizations
Creative Commons Zero v1.0 Universal
206 stars 62 forks source link

Error in heatmap_grob[["grobs"]][[ind_legend]] : no such index at level 2 #395

Closed glscaglione closed 5 months ago

glscaglione commented 6 months ago

Hello,

waterfall(brcaMAF) fails after upgrading to R.4.3.2 Issue on dockerised Rstudio (R.4.3.2 - Ubuntu 22.04.2 LTS) and also on Windows 10 Pro (R.4.3.2 or R.4.3.3 - Version 10.0.19045)

Thank you for your great work.

Regards Gianluca

MarialeG-M commented 5 months ago

I have exactly the same problem! Have you solve it already?

Best Maria

glscaglione commented 5 months ago

Hi Maria,

not yet. In order to use library(GenVisR) without errors, I'm working on a dockerised Rstudio with R 4.2.2 (docker pull ghcr.io/rocker-org/rstudio:4.2.2). I hope this will help

Best Gianluca

glscaglione commented 5 months ago

Hi,

I fixed on mac and Win by downgrading ggplot2 from version 3.5.0 to 3.4.4.

Steps:

  1. Uninstall latest ggplot version (3.5.0 for me)
  2. Download ggplot2 v3.4.4 tar.gz file from CRAN (link here) https://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_3.4.4.tar.gz
  3. In RStudio run install.packages( "/ggplot2_3.4.4.tar.gz", repos = NULL, type ="source" ) Then load library(GenVisR) and finally test with waterfall(brcaMAF)

Best Gianluca

chrisamiller commented 4 months ago

@zlskidmore This probably deserves to be left open and addressed. I encountered the same error today, and while downgrading ggplot2 worked as a temporary workaround, it'll have to be addressed longer term

zlskidmore commented 3 months ago

Downgrading will work, these are breaking changes from the recent ggplot2 update, specifically the legend grobs are now different. Quite a while ago I had upgraded with a new Waterfall() function and deprecated the old one. For anyone coming across this the new function has it's own tutorial here: https://currentprotocols.onlinelibrary.wiley.com/doi/full/10.1002/cpz1.252

As it is so popular I will bring back the old version once I've fixed these issues.

chrisamiller commented 3 months ago

Thanks, Zach.

As of right now, my version of GenVisR (1.34.0) still shows this in the man page:

Waterfall-class            package:GenVisR             R Documentation

Class Waterfall

Description:

An S4 class for the waterfall plot object, under development!!!

I see that there's a newer version that 1.34.0 on bioconductor, but at least here on github, that "under development" line still seems to be in place making it seem like it's not ready for prime-time. Is that just something that needs to be cleaned up (and I should switch to the newer capital-w Waterfall?)

Would also be nice to deprecate the old one if it's incompatible and not supposed to be used. Maybe throw up a warning or something?

zlskidmore commented 3 months ago

ah, I missed that, I cleaned up the error message but missed the docs. I'll fix that and I agree that I should've deprecated. there was a sever time crunch with bioc, but I'll bring the original function back in a deprecated state.