This is a test version of Biostars. For the public version, visit https://www.biostars.org.
biomaRt error for different R version

Hello all,

I am trying to run this simple piece of R code which uses the biomaRt package:

#importing biomaRt library 
library(biomaRt)

#delcaring hsap mart 
hsap_mart = useEnsembl(biomart = 'genes', 
                       dataset = 'hsapiens_gene_ensembl',
                       version = 95)

I run this same piece of code for two R versions - 4.3.1 and 4.3.2. The code runs fine for version 4.3.2 but it gives the following error for 4.3.1:

Error in `collect()`:
! Failed to collect lazy table.
Caused by error in `db_collect()`:
! Arguments in `...` must be used.
x Problematic argument:
* ..1 = Inf
i Did you misspell an argument name?
Run `rlang::last_trace()` to see where the error occurred.
Error during wrapup: 'length = 2' in coercion to 'logical(1)'
Error: no more error handlers available (recursive errors?); invoking 'abort' restart

Theoretically, I can just ignore the error and keep using 4.3.2, but just wanted to know what could be causing this error for 4.3.1.

Any ideas?

biomart r

1 answer

There is a proposed solution here and it relates to dplyr: https://stackoverflow.com/questions/77370659/error-failed-to-collect-lazy-table-caused-by-error-in-db-collect-using

This solution works for v.4.3.1.

@Mike Smith may comment.

Yes, this is an issue with dbplyr and BiocFileCache, which then affects biomaRt.

The answer is as suggested in that StackOverflow post and can also be found on the Bioconductor Support Site at https://support.bioconductor.org/p/9154901/#9154924

It should be somewhat independent of the R version (at least as far as 4.3.1 vs 4.3.2 is concerned), and my guess would be that after updating R you also updated some extra packages including BiocFileCache.

Wonderful, and thanks for tagging Mike!

For those who come back for this problem, the following seemed to work for me:

Downgrading dbplyr package:

install.packages("devtools")

devtools::install_version("dbplyr", version = "2.3.4")

Re-running the biomaRt lines:

#importing biomaRt library
library(biomaRt)


#delcaring hsap mart 
hsa_mart = useEnsembl(biomart = "ensembl", dataset = "hsapiens_gene_ensembl")

Log in to answer this question.