Bioconductor / AnnotationHub

Client for the Bioconductor AnnotationHub web resource
15 stars 12 forks source link

Error: bad_weak_ptr when accessing annotation hub object using genes() (probable bug) #47

Open klai001 opened 8 months ago

klai001 commented 8 months ago

i've run the following code, ah <- AnnotationHub() human_ens <- query(ah, c("Homo sapiens", "EnsDb")) human_ens <- human_ens[["AH75011"]] annotations_ahb <- genes(human_ens, return.type = "data.frame") # where the error occurs

Full error message:

Error: bad_weak_ptr Traceback:

  1. genes(human_ens, return.type = "data.frame")
  2. genes(human_ens, return.type = "data.frame")
  3. .local(x, ...)
  4. getWhat(x, columns = columns, filter = filter, order.by = order.by, . order.type = order.type, startWith = "gene", join = "suggested")
  5. getWhat(x, columns = columns, filter = filter, order.by = order.by, . order.type = order.type, startWith = "gene", join = "suggested")
  6. .local(x, ...)
  7. .getWhat(x = x, columns = columns, filter = filter, order.by = order.by, . order.type = order.type, group.by = group.by, skip.order.check = skip.order.check, . startWith = startWith, join = join)
  8. dbGetQuery(dbconn(x), Q)
  9. dbGetQuery(dbconn(x), Q)
  10. .local(conn, statement, ...)
  11. dbSendQuery(conn, statement, ...)
  12. dbSendQuery(conn, statement, ...)
  13. .local(conn, statement, ...)
  14. new("SQLiteResult", sql = statement, ptr = result_create(conn@ptr, . statement), conn = conn, bigint = conn@bigint)
  15. initialize(value, ...)
  16. initialize(value, ...)
  17. result_create(conn@ptr, statement)

sessionInfo() R version 4.3.1 (2023-06-16) Platform: x86_64-conda-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

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

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

other attached packages: [1] ensembldb_2.24.1 AnnotationFilter_1.24.0 GenomicFeatures_1.52.2 [4] AnnotationDbi_1.64.1 Biobase_2.60.0 GenomicRanges_1.52.0
[7] GenomeInfoDb_1.36.1 IRanges_2.34.1 S4Vectors_0.38.1
[10] msigdbr_7.5.1 tidyr_1.3.0 dplyr_1.1.3
[13] AnnotationHub_3.8.0 BiocFileCache_2.8.0 dbplyr_2.3.3
[16] BiocGenerics_0.46.0 fgsea_1.26.0

loaded via a namespace (and not attached): [1] jsonlite_1.8.7 magrittr_2.0.3
[3] BiocIO_1.10.0 zlibbioc_1.46.0
[5] vctrs_0.6.3 memoise_2.0.1
[7] Rsamtools_2.16.0 RCurl_1.98-1.12
[9] base64enc_0.1-3 htmltools_0.5.6
[11] S4Arrays_1.2.0 progress_1.2.2
[13] curl_5.0.2 parallelly_1.36.0
[15] lubridate_1.9.2 cachem_1.0.8
[17] uuid_1.1-1 GenomicAlignments_1.36.0
[19] mime_0.12 lifecycle_1.0.3
[21] pkgconfig_2.0.3 Matrix_1.6-1
[23] R6_2.5.1 fastmap_1.1.1
[25] GenomeInfoDbData_1.2.10 MatrixGenerics_1.12.2
[27] future_1.33.0 shiny_1.7.5
[29] digest_0.6.33 colorspace_2.1-0
[31] RSQLite_2.3.3 filelock_1.0.2
[33] progressr_0.14.0 fansi_1.0.4
[35] timechange_0.2.0 httr_1.4.7
[37] abind_1.4-5 compiler_4.3.1
[39] bit64_4.0.5 BiocParallel_1.34.2
[41] DBI_1.1.3 biomaRt_2.56.1
[43] rappdirs_0.3.3 DelayedArray_0.26.6
[45] rjson_0.2.21 tools_4.3.1
[47] interactiveDisplayBase_1.38.0 httpuv_1.6.11
[49] future.apply_1.11.0 glue_1.6.2
[51] restfulr_0.0.15 promises_1.2.1
[53] grid_4.3.1 pbdZMQ_0.3-10
[55] generics_0.1.3 gtable_0.3.4
[57] data.table_1.14.8 hms_1.1.3
[59] sp_2.0-0 xml2_1.3.5
[61] utf8_1.2.3 XVector_0.40.0
[63] BiocVersion_3.17.1 pillar_1.9.0
[65] stringr_1.5.0 babelgene_22.9
[67] IRdisplay_1.1 later_1.3.1
[69] lattice_0.21-8 rtracklayer_1.60.1
[71] bit_4.0.5 tidyselect_1.2.0
[73] Biostrings_2.70.1 ProtGenerics_1.32.0
[75] SummarizedExperiment_1.30.2 timeDate_4022.108
[77] matrixStats_1.0.0 stringi_1.7.12
[79] lazyeval_0.2.2 yaml_2.3.7
[81] evaluate_0.21 codetools_0.2-19
[83] tibble_3.2.1 BiocManager_1.30.22
[85] cli_3.6.1 IRkernel_1.3.2
[87] xtable_1.8-4 repr_1.1.6
[89] munsell_0.5.0 Rcpp_1.0.11
[91] globals_0.16.2 png_0.1-8
[93] XML_3.99-0.14 parallel_4.3.1
[95] ellipsis_0.3.2 ggplot2_3.4.3
[97] blob_1.2.4 prettyunits_1.1.1
[99] bitops_1.0-7 listenv_0.9.0
[101] scales_1.2.1 SeuratObject_4.1.3
[103] purrr_1.0.2 crayon_1.5.2
[105] rlang_1.1.1 cowplot_1.1.1
[107] fastmatch_1.1-4 KEGGREST_1.42.0

lshep commented 8 months ago

Have you tried updating your versions of packages? Make sure everything is up-to-date with BiocManager::install or BiocManager::valid. I can't tell what version of Bioconductor you are using but with my version of 3.18 this works fine

Bioconductor version 3.18 (BiocManager 1.30.22), R 4.3.1 Patched (2023-08-28
  r85034)
> library(AnnotationHub)
> ah <- AnnotationHub() 
snapshotDate(): 2023-10-19
> human_ens <- query(ah, c("Homo sapiens", "EnsDb"))
> human_ens <- human_ens[["AH75011"]] 
downloading 1 resources
retrieving 1 resource
  |======================================================================| 100%

loading from cache
require("ensembldb")
> annotations_ahb <- genes(human_ens, return.type = "data.frame")
> class(annotations_ahb)
[1] "data.frame"

My session info as follows

> sessionInfo()
R Under development (unstable) (2023-10-25 r85412)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /home/lorikern/R-Installs/bin/R-devel/lib/libRblas.so 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

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

time zone: America/New_York
tzcode source: system (glibc)

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

other attached packages:
 [1] ensembldb_2.27.0        AnnotationFilter_1.27.0 GenomicFeatures_1.55.1 
 [4] AnnotationDbi_1.65.0    Biobase_2.63.0          GenomicRanges_1.55.1   
 [7] GenomeInfoDb_1.39.0     IRanges_2.37.0          S4Vectors_0.41.1       
[10] AnnotationHub_3.11.0    BiocFileCache_2.11.1    dbplyr_2.4.0           
[13] BiocGenerics_0.49.0     praise_1.0.0            BiocManager_1.30.22    

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.0              dplyr_1.1.3                  
 [3] blob_1.2.4                    filelock_1.0.2               
 [5] Biostrings_2.71.1             bitops_1.0-7                 
 [7] lazyeval_0.2.2                fastmap_1.1.1                
 [9] RCurl_1.98-1.12               GenomicAlignments_1.39.0     
[11] promises_1.2.1                XML_3.99-0.14                
[13] digest_0.6.33                 mime_0.12                    
[15] lifecycle_1.0.3               ProtGenerics_1.35.0          
[17] ellipsis_0.3.2                KEGGREST_1.43.0              
[19] interactiveDisplayBase_1.41.0 RSQLite_2.3.2                
[21] magrittr_2.0.3                compiler_4.4.0               
[23] rlang_1.1.1                   progress_1.2.2               
[25] tools_4.4.0                   utf8_1.2.4                   
[27] yaml_2.3.7                    rtracklayer_1.63.0           
[29] prettyunits_1.2.0             S4Arrays_1.3.0               
[31] bit_4.0.5                     curl_5.1.0                   
[33] DelayedArray_0.29.0           xml2_1.3.5                   
[35] abind_1.4-5                   BiocParallel_1.37.0          
[37] withr_2.5.2                   purrr_1.0.2                  
[39] grid_4.4.0                    fansi_1.0.5                  
[41] xtable_1.8-4                  biomaRt_2.59.0               
[43] SummarizedExperiment_1.33.0   cli_3.6.1                    
[45] crayon_1.5.2                  generics_0.1.3               
[47] httr_1.4.7                    rjson_0.2.21                 
[49] DBI_1.1.3                     cachem_1.0.8                 
[51] stringr_1.5.0                 zlibbioc_1.49.0              
[53] parallel_4.4.0                XVector_0.43.0               
[55] restfulr_0.0.15               matrixStats_1.0.0            
[57] vctrs_0.6.4                   Matrix_1.6-1.1               
[59] hms_1.1.3                     bit64_4.0.5                  
[61] glue_1.6.2                    codetools_0.2-19             
[63] stringi_1.7.12                BiocVersion_3.19.1           
[65] later_1.3.1                   BiocIO_1.13.0                
[67] tibble_3.2.1                  pillar_1.9.0                 
[69] rappdirs_0.3.3                htmltools_0.5.6.1            
[71] GenomeInfoDbData_1.2.11       R6_2.5.1                     
[73] lattice_0.22-5                shiny_1.7.5.1                
[75] png_0.1-8                     Rsamtools_2.19.1             
[77] memoise_2.0.1                 httpuv_1.6.12                
[79] Rcpp_1.0.11                   SparseArray_1.3.0            
[81] MatrixGenerics_1.15.0         pkgconfig_2.0.3              
lshep commented 8 months ago

From the looks of things you have very out-of-date packages for using R version 4.3.1