caravagnalab / rcongas

rcongas
GNU General Public License v3.0
7 stars 1 forks source link

Error in `mutate()` when plotting example data #24

Closed mmfalco closed 1 year ago

mmfalco commented 1 year ago

I liked the idea behind CONGAS, and I was about to try it on my dataset. But after installing I could not run the example datasets. The following error popped out:

> data(congas_example)

> print(congas_example)
── [ Rcongas ]  ──────────────────────────────────────────────────────────────────────────────────

→ Data: 503 cells with 8564 genes, aggregated in 70 segments.

ℹ Clusters: k = 2, model with AIC = 577427.35.

● Cluster c1, n = 379 [75.35% of total cells].
● Cluster c2, n = 124 [24.65% of total cells].

── CNA highlights (alpha = 0.05) 

Error in `mutate()`:
! Problem while computing `cluster = ifelse(...)`.
Caused by error in `str_starts()`:
! could not find function "str_starts"
Run `rlang::last_error()` to see where the error occurred.

> plot(congas_example)
Error in `mutate()`:
! Problem while computing `cluster = ifelse(...)`.
Caused by error in `str_starts()`:
! could not find function "str_starts"
Run `rlang::last_error()` to see where the error occurred.

> rlang::last_error()
<error/dplyr:::mutate_error>
Error in `mutate()`:
! Problem while computing `cluster = ifelse(...)`.
Caused by error in `str_starts()`:
! could not find function "str_starts"
---
Backtrace:
  1. base::plot(congas_example)
 22. base::ifelse(...)
Run `rlang::last_trace()` to see the full context.

It seems like a package version issue but I updated all the dependencies, so I am not sure if I should try some old versions for dplyr or stringr packages. Which versions did you use?

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.5 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/liblapack.so.3

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

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

other attached packages:
[1] Rcongas_0.1.0

loaded via a namespace (and not attached):
 [1] gtools_3.9.3          clisymbols_1.2.0      tidyselect_1.1.2.9000 akima_0.6-3.4         remotes_2.4.2         purrr_0.3.4           reshape2_1.4.4       
 [8] lattice_0.20-45       carData_3.0-5         testthat_3.1.4        colorspace_2.0-3      vctrs_0.4.1.9000      generics_0.1.3        usethis_2.1.5        
[15] utf8_1.2.2            rlang_1.0.5           pkgbuild_1.3.1        ggpubr_0.4.0          pillar_1.8.1          withr_2.5.0           glue_1.6.2           
[22] sp_1.5-0              sessioninfo_1.2.2     lifecycle_1.0.2.9000  plyr_1.8.7            stringr_1.4.1         munsell_0.5.0         ggsignif_0.6.3       
[29] gtable_0.3.1          devtools_2.4.3        memoise_2.0.1         callr_3.7.2           fastmap_1.1.0         ps_1.7.1              curl_4.3.2           
[36] fansi_1.0.3           broom_1.0.1           Rcpp_1.0.9            backports_1.4.1       scales_1.2.1          cachem_1.0.6          desc_1.4.2           
[43] pkgload_1.3.0         abind_1.4-5           fs_1.5.2              brio_1.1.3            ggplot2_3.3.6         stringi_1.7.8         rstatix_0.7.0        
[50] processx_3.7.0        dplyr_1.0.99.9000     rprojroot_2.0.3       grid_4.2.1            cli_3.4.0             tools_4.2.1           magrittr_2.0.3       
[57] patchwork_1.1.2       tibble_3.1.8          crayon_1.5.1          car_3.1-0             tidyr_1.2.1           pkgconfig_2.0.3       ellipsis_0.3.2       
[64] prettyunits_1.1.1     extraDistr_1.9.1      rstudioapi_0.14       R6_2.5.1              CNAqc_1.0.0           compiler_4.2.1    
Militeee commented 1 year ago

Hi @mmfalco, sorry totally my fault, forgot to import the actual function, should be fixed now. Let me know if you find other bugs or need any help (by experience I know reticulate setup can be nasty).

Cheers