clonevol icon indicating copy to clipboard operation
clonevol copied to clipboard

Incompatibility with newer ggplot (v 4.0.0)

Open dmkv1 opened this issue 2 months ago • 0 comments

Plotting the variant clusters from test AML data produces "The show_guide argument of layer() was deprecated in ggplot2 2.0.0 and is now defunct." error. It suggests using show.legend instead, but the error happens at ggplot::layer() level of the execution.

Code:

library(tidyverse)
library(clonevol)

x <- aml1$variants

vaf.col.names <- grep('.vaf', colnames(x), value=T)
sample.names <- gsub('.vaf', '', vaf.col.names)
x[, sample.names] <- x[, vaf.col.names]
vaf.col.names <- sample.names

sample.groups <- c('P', 'R')
names(sample.groups) <- vaf.col.names

x <- x[order(x$cluster),]

clone.colors <- c('#999793', '#8d4891', '#f8e356', '#fe9536', '#d7352e')

plot.variant.clusters(
  x,
  cluster.col.name = 'cluster',
  show.cluster.size = FALSE,
  cluster.size.text.color = 'blue',
  vaf.col.names = vaf.col.names,
  vaf.limits = 70,
  sample.title.size = 20,
  violin = FALSE,
  box = FALSE,
  jitter = TRUE,
  jitter.shape = 1,
  jitter.color = clone.colors,
  jitter.size = 3,
  jitter.alpha = 1,
  jitter.center.method = 'median',
  jitter.center.size = 1,
  jitter.center.color = 'darkgray',
  jitter.center.display.value = 'none',
  highlight = 'is.driver',
  highlight.shape = 21,
  highlight.color = 'blue',
  highlight.fill.color = 'green',
  highlight.note.col.name = 'gene',
  highlight.note.size = 2,
  order.by.total.vaf = FALSE
)

Warning and error produced by plot.variant.clusters:

Warning: The `fun.y` argument of `stat_summary()` is deprecated as of ggplot2 3.3.0.
ℹ Please use the `fun` argument instead.
ℹ The deprecated feature was likely used in the clonevol package.
  Please report the issue to the authors.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
ℹ The deprecated feature was likely used in the clonevol package.
  Please report the issue to the authors.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.

 Error:
! The `show_guide` argument of `layer()` was deprecated in ggplot2 2.0.0 and is now defunct.
ℹ Please use the `show.legend` argument instead.
Run `rlang::last_trace()` to see where the error occurred.

Session info:

R version 4.4.2 (2024-10-31)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/Prague
tzcode source: system (glibc)

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] gridExtra_2.3    clonevol_0.99.11 lubridate_1.9.4  forcats_1.0.1    stringr_1.5.2    dplyr_1.1.4      purrr_1.1.0      readr_2.1.5      tidyr_1.3.1     
[10] tibble_3.3.0     ggplot2_4.0.0    tidyverse_2.0.0 

loaded via a namespace (and not attached):
 [1] gtable_0.3.6       crayon_1.5.3       compiler_4.4.2     tidyselect_1.2.1   scales_1.4.0       R6_2.6.1           generics_0.1.4     knitr_1.50        
 [9] pillar_1.11.1      RColorBrewer_1.1-3 tzdb_0.5.0         rlang_1.1.6        stringi_1.8.7      xfun_0.53          S7_0.2.0           timechange_0.3.0  
[17] cli_3.6.5          withr_3.0.2        magrittr_2.0.4     rstudioapi_0.17.1  hms_1.1.3          lifecycle_1.0.4    vctrs_0.6.5        evaluate_1.0.5    
[25] glue_1.8.0         farver_2.1.2       tools_4.4.2        pkgconfig_2.0.3   

dmkv1 avatar Nov 05 '25 14:11 dmkv1