igordot / msigdbr

MSigDB gene sets for multiple organisms in a tidy data format
https://igordot.github.io/msigdbr
Other
70 stars 14 forks source link

getting error #26

Closed rominaappierdo closed 1 year ago

rominaappierdo commented 1 year ago

Hello and thank you for your work,

I have this piece of code

library(msigdbr)

all_gene_sets <- msigdbr(species = "Mus musculus")
head(all_gene_sets)

but I am having the following error:

Error in parse(text = elt): <text>:1:5: simbolo inatteso
1: Use of
        ^
Traceback:

1. msigdbr(species = "Mus musculus")
2. orthologs(genes = genesets_subset$human_ensembl_gene, species = species) %>% 
 .     select(-any_of(c("human_symbol", "human_entrez"))) %>% rename(human_ensembl_gene = .data$human_ensembl, 
 .     gene_symbol = .data$symbol, entrez_gene = .data$entrez, ensembl_gene = .data$ensembl, 
 .     ortholog_sources = .data$support, num_ortholog_sources = .data$support_n)
3. rename(., human_ensembl_gene = .data$human_ensembl, gene_symbol = .data$symbol, 
 .     entrez_gene = .data$entrez, ensembl_gene = .data$ensembl, 
 .     ortholog_sources = .data$support, num_ortholog_sources = .data$support_n)
4. rename.data.frame(., human_ensembl_gene = .data$human_ensembl, 
 .     gene_symbol = .data$symbol, entrez_gene = .data$entrez, ensembl_gene = .data$ensembl, 
 .     ortholog_sources = .data$support, num_ortholog_sources = .data$support_n)
5. tidyselect::eval_rename(expr(c(...)), .data)
6. rename_impl(data, names(data), as_quosure(expr, env), strict = strict, 
 .     name_spec = name_spec, allow_predicates = allow_predicates, 
 .     error_call = error_call)
7. eval_select_impl(x, names, {
 .     {
 .         sel
 .     }
 . }, strict = strict, name_spec = name_spec, type = "rename", allow_predicates = allow_predicates, 
 .     error_call = error_call)
8. with_subscript_errors(out <- vars_select_eval(vars, expr, strict = strict, 
 .     data = x, name_spec = name_spec, uniquely_named = uniquely_named, 
 .     allow_rename = allow_rename, allow_empty = allow_empty, allow_predicates = allow_predicates, 
 .     type = type, error_call = error_call), type = type)
9. try_fetch(expr, vctrs_error_subscript = function(cnd) {
 .     cnd$subscript_action <- subscript_action(type)
 .     cnd$subscript_elt <- "column"
 .     cnd_signal(cnd)
 . })
10. withCallingHandlers(expr, vctrs_error_subscript = function(cnd) {
  .     {
  .         .__handler_frame__. <- TRUE
  .         .__setup_frame__. <- frame
  .     }
  .     out <- handlers[[1L]](cnd)
  .     if (!inherits(out, "rlang_zap")) 
  .         throw(out)
  . })
11. vars_select_eval(vars, expr, strict = strict, data = x, name_spec = name_spec, 
  .     uniquely_named = uniquely_named, allow_rename = allow_rename, 
  .     allow_empty = allow_empty, allow_predicates = allow_predicates, 
  .     type = type, error_call = error_call)
12. walk_data_tree(expr, data_mask, context_mask)
13. eval_c(expr, data_mask, context_mask)
14. reduce_sels(node, data_mask, context_mask, init = init)
15. walk_data_tree(new, data_mask, context_mask)
16. expr_kind(expr, context_mask, error_call)
17. call_kind(expr, context_mask, error_call)
18. lifecycle::deprecate_soft("1.2.0", what, details = cli::format_inline("Please use {.code {str}} instead of `.data${var}`"), 
  .     user_env = env)
19. signal_stage("deprecated", what)
20. spec(what, env = env)
21. spec_what(spec, "spec", signaller)
22. parse_expr(what)
23. parse_exprs(x)
24. chr_parse_exprs(x)
25. map(x, function(elt) as.list(parse(text = elt)))
26. lapply(.x, .f, ...)
27. FUN(X[[i]], ...)
28. as.list(parse(text = elt))
29. parse(text = elt)

Could you provide help to solve this issue? Thank you in advance

igordot commented 1 year ago

The error looks like it might be related to the tidyselect package.

Can you post the output of sessionInfo()?

rominaappierdo commented 1 year ago

sure, thank you so much!

R version 4.2.0 (2022-04-22)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS/LAPACK: /home/appierdo/.conda/envs/r/lib/libopenblasp-r0.3.21.so

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

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

other attached packages:
 [1] msigdbr_7.5.1        msigdb_1.4.0         data.table_1.14.4   
 [4] GSEABase_1.58.0      graph_1.74.0         annotate_1.74.0     
 [7] XML_3.99-0.13        AnnotationDbi_1.58.0 IRanges_2.30.1      
[10] S4Vectors_0.34.0     Biobase_2.56.0       BiocGenerics_0.42.0 
[13] GSVA_1.44.5         

loaded via a namespace (and not attached):
 [1] MatrixGenerics_1.8.1        httr_1.4.4                 
 [3] BiocSingular_1.12.0         bit64_4.0.5                
 [5] jsonlite_1.8.0              DelayedMatrixStats_1.18.2  
 [7] assertthat_0.2.1            blob_1.2.3                 
 [9] GenomeInfoDbData_1.2.8      pillar_1.7.0               
[11] RSQLite_2.2.18              lattice_0.20-45            
[13] glue_1.6.2                  beachmat_2.12.0            
[15] uuid_1.1-0                  digest_0.6.29              
[17] GenomicRanges_1.48.0        XVector_0.36.0             
[19] htmltools_0.5.4             Matrix_1.5-1               
[21] pkgconfig_2.0.3             babelgene_22.9             
[23] zlibbioc_1.42.0             xtable_1.8-4               
[25] ScaledMatrix_1.4.1          HDF5Array_1.24.2           
[27] BiocParallel_1.30.4         tibble_3.1.8               
[29] KEGGREST_1.36.3             generics_0.1.3             
[31] ellipsis_0.3.2              withr_2.5.0                
[33] cachem_1.0.6                SummarizedExperiment_1.26.1
[35] repr_1.1.4                  cli_3.6.0                  
[37] magrittr_2.0.3              crayon_1.5.1               
[39] memoise_2.0.1               evaluate_0.15              
[41] fansi_1.0.3                 tools_4.2.0                
[43] lifecycle_1.0.1             matrixStats_0.63.0         
[45] Rhdf5lib_1.18.2             DelayedArray_0.22.0        
[47] irlba_2.3.5.1               Biostrings_2.64.1          
[49] compiler_4.2.0              GenomeInfoDb_1.32.4        
[51] rsvd_1.0.5                  rlang_1.0.6                
[53] rhdf5_2.40.0                grid_4.2.0                 
[55] RCurl_1.98-1.9              pbdZMQ_0.3-7               
[57] IRkernel_1.3.1.9000         rhdf5filters_1.8.0         
[59] SingleCellExperiment_1.18.1 bitops_1.0-7               
[61] base64enc_0.1-3             codetools_0.2-18           
[63] DBI_1.1.3                   R6_2.5.1                   
[65] dplyr_1.0.10                fastmap_1.1.0              
[67] bit_4.0.4                   utf8_1.2.2                 
[69] parallel_4.2.0              IRdisplay_1.1              
[71] Rcpp_1.0.9                  vctrs_0.4.1                
[73] png_0.1-7                   tidyselect_1.2.0           
[75] sparseMatrixStats_1.8.0    
igordot commented 1 year ago

You may have a conflict due to some of the loaded packages. Can you try using msigdbr in a clean environment where only msigdbr is loaded?

rominaappierdo commented 1 year ago

same error :(

here follows the output of sessionInfo()

I'm trying to detach also the loaded via a namespace (and not attached) packages. Thank you for the suggestion!

R version 4.2.0 (2022-04-22)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS/LAPACK: /home/appierdo/.conda/envs/r/lib/libopenblasp-r0.3.21.so

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

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

other attached packages:
[1] msigdbr_7.5.1

loaded via a namespace (and not attached):
 [1] magrittr_2.0.3      tidyselect_1.2.0    uuid_1.1-0         
 [4] babelgene_22.9      R6_2.5.1            rlang_1.0.6        
 [7] fastmap_1.1.0       fansi_1.0.3         dplyr_1.0.10       
[10] tools_4.2.0         utf8_1.2.2          DBI_1.1.3          
[13] cli_3.6.0           withr_2.5.0         htmltools_0.5.4    
[16] ellipsis_0.3.2      assertthat_0.2.1    digest_0.6.29      
[19] tibble_3.1.8        lifecycle_1.0.1     crayon_1.5.1       
[22] IRdisplay_1.1       repr_1.1.4          base64enc_0.1-3    
[25] vctrs_0.4.1         IRkernel_1.3.1.9000 glue_1.6.2         
[28] evaluate_0.15       pbdZMQ_0.3-7        compiler_4.2.0     
[31] pillar_1.7.0        generics_0.1.3      jsonlite_1.8.0     
[34] pkgconfig_2.0.3   
igordot commented 1 year ago

You still have some extra packages that are loaded, such as IRdisplay and DBI.

For comparison, this is what I am seeing:

> library(msigdbr)
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.6.2

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] msigdbr_7.5.1

loaded via a namespace (and not attached):
 [1] fansi_1.0.4      utf8_1.2.3       dplyr_1.1.0      R6_2.5.1         lifecycle_1.0.3 
 [6] magrittr_2.0.3   pillar_1.8.1     rlang_1.0.6      cli_3.6.0        rstudioapi_0.14 
[11] generics_0.1.3   vctrs_0.5.2      tools_4.2.2      glue_1.6.2       compiler_4.2.2  
[16] pkgconfig_2.0.3  babelgene_22.9   tidyselect_1.2.0 tibble_3.1.8    
rominaappierdo commented 1 year ago

I really appreciated the prompt help, at the moment I can't figure out how to solve the problem, but I've managed to obtain what I needed in a different way. I'm going to close the issue for now. Thanks again!

igordot commented 1 year ago

I am happy to hear you solved your problem. If you decide to try msigdbr again, try reinstalling it first.

rominaappierdo commented 1 year ago

Btw on my local machine msigdbr works fine! It was very useful! I only have trouble in using it on a server machine. The package itself is great!