grimbough / biomaRt

R package providing query functionality to BioMart instances like Ensembl
https://bioconductor.org/packages/biomaRt/
34 stars 13 forks source link

Error in UseMethod("filter_") : #38

Closed SunnyWit closed 3 years ago

SunnyWit commented 3 years ago

There are my codes:

library(biomaRt) mart.snp.hs <- useMart(host="http://grch37.ensembl.org",
biomart = "ENSEMBL_MART_SNP",
dataset = "hsapiens_snp") res <- getBM(attributes = c( "refsnp_id","chr_name", "chrom_start", "chrom_end","allele"),
filters = list(chr_name=1,
start=c(222133118),
end=c(222204361)),
mart = mart.snp.hs)

Then it shows errors:

Error in UseMethod("filter") : "filter"没有适用于"c('tbl_SQLiteConnection', 'tbl_dbi', 'tbl_sql', 'tbllazy', 'tbl')"目标对象的方法 此外: Warning messages: 1: `select()is deprecated as of dplyr 0.7.0. Please useselect()instead. This warning is displayed once every 8 hours. Calllifecycle::lastwarnings()to see where this warning was generated. 2:filter()is deprecated as of dplyr 0.7.0. Please usefilter()instead. See vignette('programming') for more help This warning is displayed once every 8 hours. Calllifecycle::last_warnings()` to see where this warning was generated.

How can I solve this problem? Thanks for you help!

grimbough commented 3 years ago

This is because the latest version of dplyr is incompatible with old version of BiocFileCache (and in turn biomaRt). You'll need to update R & Biocondutor. There's a bit more information in these threads:

https://support.bioconductor.org/p/p132704/#p132714 https://support.bioconductor.org/p/p132709/#p133220

SunnyWit commented 3 years ago

Thanks! I will try it