Entering edit mode
I have been trying to create an EnsDb object using AnnotationHub. This code had worked just fine for me till today. Now when I run the following code I get the error
library(ensembldb)
library(dplyr)
library(AnnotationHub)
## Load the annotation resource.
ah <- AnnotationHub()
## Query for all available EnsDb databases
query(ah, "EnsDb")
ahDb <- query(ah, pattern = c("Homo sapiens", "EnsDb", 97))
Error in UseMethod("filter_"): no applicable method for 'filter_' applied to an object of class "c('tbl_SQLiteConnection', 'tbl_dbi', 'tbl_sql', 'tbl_lazy', 'tbl')"
Traceback:
1. AnnotationHub()
2. .Hub("AnnotationHub", hub, cache, proxy, localHub, ...)
3. .create_cache(.class, url, cache, proxy, localHub)
4. .updateHubDB(hub_bfc, .class, url, proxy, localHub)
5. bfcquery(bfc, paste0(tolower(.class), ".sqlite3"), field = "rname",
. exact = TRUE)
6. bfcquery(bfc, paste0(tolower(.class), ".sqlite3"), field = "rname",
. exact = TRUE)
7. bfcinfo(x, rids)
8. bfcinfo(x, rids)
9. .sql_get_resource_table(x, rids)
10. tryCatch({
. con <- .sql_connect_RO(.sql_dbfile(bfc))
. src <- src_dbi(con)
. tbl <- tbl(src, "resource")
. if (missing(rids)) {
. }
. else if (length(rids) == 0) {
. tbl <- tbl %>% filter_(~rid == NA_character_)
. }
. else if (length(rids) == 1) {
. tbl <- tbl %>% filter_(~rid == rids)
. }
. else {
. tbl <- tbl %>% filter_(~rid %in% rids)
. }
. meta <- setdiff(dbListTables(con), .RESERVED$TABLES)
. for (m in meta) tbl <- left_join(tbl, tbl(src, m), by = "rid")
. tbl <- tbl %>% collect
. }, finally = {
. dbDisconnect(con)
. })
11. tryCatchList(expr, classes, parentenv, handlers)
12. tbl %>% filter_(~rid == NA_character_)
13. withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
14. eval(quote(`_fseq`(`_lhs`)), env, env)
15. eval(quote(`_fseq`(`_lhs`)), env, env)
16. `_fseq`(`_lhs`)
17. freduce(value, `_function_list`)
18. withVisible(function_list[[k]](value))
19. function_list[[k]](value)
20. filter_(., ~rid == NA_character_)
Thank you in advance
Best,
Georgia
Here is my sessionInfo()
sessionInfo( )
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3
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] grid parallel stats4 stats graphics grDevices utils
[8] datasets methods base
other attached packages:
[1] httr_1.4.2 forcats_0.5.0 stringr_1.4.0
[4] purrr_0.3.4 readr_1.3.1 tidyverse_1.3.0
[7] AnnotationHub_2.16.1 BiocFileCache_1.10.2 dbplyr_2.0.0
[10] ensembldb_2.8.1 AnnotationFilter_1.8.0 GenomicFeatures_1.38.2
[13] AnnotationDbi_1.48.0 Biobase_2.46.0 ggbio_1.32.0
[16] ggpubr_0.4.0 Gviz_1.28.3 GenomicRanges_1.38.0
[19] GenomeInfoDb_1.22.1 IRanges_2.20.2 S4Vectors_0.24.4
[22] BiocGenerics_0.32.0 scales_1.1.1 gridExtra_2.3
[25] edgeR_3.26.8 limma_3.42.2 pheatmap_1.0.12
[28] RColorBrewer_1.1-2 ggrepel_0.8.2 ggplot2_3.3.2
[31] tibble_3.0.4 tidyr_1.1.2 dplyr_1.0.2.9000
loaded via a namespace (and not attached):
[1] tidyselect_1.1.0 RSQLite_2.2.1
[3] htmlwidgets_1.5.2 BiocParallel_1.20.1
[5] devtools_2.3.2 munsell_0.5.0
[7] pbdZMQ_0.3-3 withr_2.3.0
[9] colorspace_1.4-1 OrganismDbi_1.26.0
[11] knitr_1.30 uuid_0.1-4
[13] rstudioapi_0.11 ggsignif_0.6.0
[15] repr_1.1.0 GenomeInfoDbData_1.2.2
[17] bit64_4.0.5 rprojroot_1.3-2
[19] vctrs_0.3.4 generics_0.1.0
[21] xfun_0.17 biovizBase_1.32.0
[23] R6_2.5.0 locfit_1.5-9.4
[25] bitops_1.0-6 reshape_0.8.8
[27] DelayedArray_0.12.3 assertthat_0.2.1
[29] promises_1.1.1 nnet_7.3-14
[31] gtable_0.3.0 processx_3.4.4
[33] rlang_0.4.8 splines_3.6.1
[35] rtracklayer_1.46.0 rstatix_0.6.0
[37] lazyeval_0.2.2 dichromat_2.0-0
[39] broom_0.7.0 checkmate_2.0.0
[41] BiocManager_1.30.10 yaml_2.2.1
[43] reshape2_1.4.4 abind_1.4-5
[45] modelr_0.1.8 backports_1.2.0
[47] httpuv_1.5.4 Hmisc_4.4-1
[49] RBGL_1.60.0 usethis_1.6.3
[51] tools_3.6.1 ellipsis_0.3.1
[53] sessioninfo_1.1.1 Rcpp_1.0.5
[55] plyr_1.8.6 base64enc_0.1-3
[57] progress_1.2.2 zlibbioc_1.32.0
[59] RCurl_1.98-1.2 ps_1.4.0
[61] prettyunits_1.1.1 rpart_4.1-15
[63] openssl_1.4.3 SummarizedExperiment_1.16.1
[65] haven_2.3.1 cluster_2.1.0
[67] fs_1.5.0 magrittr_1.5
[69] data.table_1.13.2 openxlsx_4.2.2
[71] reprex_0.3.0 ProtGenerics_1.16.0
[73] matrixStats_0.57.0 pkgload_1.1.0
[75] hms_0.5.3 mime_0.9
[77] evaluate_0.14 xtable_1.8-4
[79] XML_3.99-0.3 rio_0.5.16
[81] jpeg_0.1-8.1 readxl_1.3.1
[83] testthat_3.0.0 compiler_3.6.1
[85] biomaRt_2.42.1 crayon_1.3.4
[87] htmltools_0.5.0 later_1.1.0.1
[89] Formula_1.2-3 lubridate_1.7.9
[91] DBI_1.1.0 rappdirs_0.3.1
[93] Matrix_1.2-18 car_3.0-9
[95] cli_2.1.0 pkgconfig_2.0.3
[97] GenomicAlignments_1.22.1 foreign_0.8-74
[99] IRdisplay_0.7.0 xml2_1.3.2
[101] XVector_0.26.0 rvest_0.3.6
[103] VariantAnnotation_1.30.1 callr_3.5.1
[105] digest_0.6.27 graph_1.62.0
[107] Biostrings_2.54.0 cellranger_1.1.0
[109] htmlTable_2.1.0 curl_4.3
[111] shiny_1.5.0 Rsamtools_2.2.3
[113] lifecycle_0.2.0 jsonlite_1.7.1
[115] carData_3.0-4 desc_1.2.0
[117] askpass_1.1 BSgenome_1.52.0
[119] fansi_0.4.1 pillar_1.4.6
[121] lattice_0.20-41 GGally_2.0.0
[123] fastmap_1.0.1 pkgbuild_1.1.0
[125] survival_3.2-3 remotes_2.2.0
[127] interactiveDisplayBase_1.22.0 glue_1.4.2
[129] zip_2.1.1 png_0.1-7
[131] bit_4.0.4 stringi_1.5.3
[133] blob_1.2.1 latticeExtra_0.6-29
[135] memoise_1.1.0.9000 IRkernel_1.1.1
Thank you for your quick response :) . Loading the
dplyr
after the query did not make a difference in my case and had the same error. Updating R and Bioconductor would be sure an option but what worked in my case was to reinstall an older version ofdplyr
(version 0.8) as well asdbplyr
(version 1.3) and then reinstallAnnotationHub
specifying the Bioconductor version.Best wishes,
Georgia
georgiakatsoula93
Hello,
I have thee same problem.
I can not go through the code of
ah<-AnnotationHub()
.Would you please check it for me?
Thank you in advance for your great help!
Best,
Yue
Update your R / Bioconductor installation to R version 4.0.3 and Bioconductor version 3.12.
Hello Martin Morgan,
Thank you so much for your great help!
Thank you again!
Best,
Yue
This is a Bioconductor package, so follow the installation instructions on the package landing page
Still having problems? Make sure your version is correct and installation valid
Hello Martin Morgan,
Thank you so much for your great help!
Thank you again and really appreciated!
Best,
Yue
Thanks this was very useful. Just a note that there is a typo in the 2nd command which forwrdas the installation to dplyr archive instead of dbplyr.
Thank you indeed, I edited my previous answer, the correct is:
devtools::install_url(https://cran.r-project.org/src/contrib/Archive/dbplyr/dbplyr_1.3.0.tar.gz )
for installing a previous version of
dbplyr
. I had to downgradedbplyr
too to have a previous version ofdplyr
working for me.Best, Georgia
The url is still wrong. It's missing an underscore. You want:
http://cran.r-project.org/src/contrib/Archive/dbplyr/dbplyr_1.3.0.tar.gz
Also, latest minfi required dplyr 0.8.2 so I downgraded to that. That also works.
No the last one is right.. I do not see which underscore you mean here, worked fine for me
Hi, I am running into similar problem, I am trying to run honeybadge and when I try to run a code similar to this
hb$setGexpMats(gexp, ref, mart.obj, filter=FALSE, scale=FALSE, verbose=TRUE)
get this error
Initializing expression matrices ... Normalizing gene expression for 7652 genes and 161 cells ... Error in UseMethod("filter_") : no applicable method for 'filter_' applied to an object of class "c('tbl_SQLiteConnection', 'tbl_dbi', 'tbl_sql', 'tbl_lazy', 'tbl')"
I'm unfamiliar with honeybadge. dplyr made updates this past year deprecating methods. The underlying packgae has to update to use the newer version of dplyr. If they do not, you have to downgrade your version of dplyr as described previously in this thread.
I tried doing so.
But I couldn't go back to previous version of dplyr
Thanks again
Try to downgrade before loading any packages. In a fresh R instance before running anything else
Same error here. It is fixed by upgrading to latest R (4.0.3) and all Bioconductor packages. I think this problem could be pinned down to incompatibilities between dplyr and biomaRt utilities. Also see this: Answer: BiomaRt::getBM Error in UseMethod(filter_)
dplyr made an update (I think middle of last year) regarding the filter_ and I think select_ functions. Packages that utilized these functions needed to update their code. I believe all the necessary changes were made for AnnotationHub/ExperimentHub. It is possible that there may be some lingering. Updating to the most recent R and all accompanied packages is the recommended course of action. Cheer!
I ran into this same error today trying to run
select()
on an OrgDb AnnotationHub object. I have the most recent versions of R (4.0.3) and Bioconductor (3.12). I was able to resolve it by loading dplyr after my call toselect()
, but then I have to unload dplyr before calling the code again. It doesn't appear that the issue is resolved in the current version.If you feel like the issue is not resolved please make a report on the github issues for the repository and include the complete code you tried to run with ERROR and sessionInfo(). Report at https://github.com/Bioconductor/AnnotationHub/issues
In an interactive session, where you have both AnnotationDbi and dplyr loaded, you need to specify where the select function is coming from, e.g.,
dplyr::select()
orAnnotationDbi::select()
. It might be tempting to put an alias at the head of your scriptdselect <- dplyr::select; aselect <- AnnotationDbi::select
and use those, but it will be confusing to others (and perhaps yourself at some future time) when they seedselect()
in your code and haven't paid attention to the assignment earlier.