You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu系统biomaRt+dbplyr调用getBM时collect报错求助

BiomaRt在Ubuntu系统获取Ensembl注释的兼容性错误求助

在Ubuntu系统使用biomaRt获取Ensembl注释时,已更新所有相关包,但仍反复触发相同错误,Mac系统下无此问题。

运行代码

ensembl <- useMart(
  "ENSEMBL_MART_ENSEMBL",
  dataset = "hsapiens_gene_ensembl", 
  host="https://may2021.archive.ensembl.org"
)
ids <- as.vector(row.names(OS_total))
ids
listAttributes(ensembl)
annot <- getBM(
  attributes=c(
    "ensembl_gene_id",
    "transcript_length", 
    "percentage_gene_gc_content",
    "gene_biotype",
    "chromosome_name", 
    "start_position",
    "end_position",
    "external_gene_name",
    "external_gene_source"
  ),
  filters="ensembl_gene_id",
  values=ids,
  mart=ensembl
)

错误详情

rlang::last_trace()
<error/rlang_error>
Error in collect():
! Failed to collect lazy table.
Caused by error in db_collect():
! Arguments in ... must be used.
✖ Problematic argument:
• ..1 = Inf
ℹ Did you misspell an argument name?

回溯信息

  1. ├─biomaRt::getBM(...)
  2. │ └─BiocFileCache::BiocFileCache(cache, ask = FALSE)
  3. │ └─BiocFileCache:::.sql_create_db(bfc)
  4. │ └─BiocFileCache:::.sql_validate_version(bfc)
  5. │ └─BiocFileCache:::.sql_schema_version(bfc)
  6. │ ├─base::tryCatch(...)
  7. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  8. │ └─tbl(src, "metadata") %>% collect(Inf)
  9. ├─dplyr::collect(., Inf)
  10. └─dbplyr:::collect.tbl_sql(., Inf)
  11. ├─base::tryCatch(...)
  12. │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  13. │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  14. │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
  15. └─dbplyr::db_collect(x$src$con, sql, n = n, warn_incomplete = warn_incomplete, ...)

已尝试操作

  • 查阅BiocFileCache与新版dbplyr兼容性相关内容
  • 从GitHub更新所有相关包

解决建议

  • 降级dbplyr到兼容版本:新版dbplyr的collect函数参数逻辑变更,导致BiocFileCache调用报错,安装dbplyr 2.3.4版本:
    install.packages("dbplyr", version = "2.3.4")
    
  • 清理BiocFileCache缓存:清除旧缓存避免数据库schema冲突:
    BiocFileCache::bfcpurge()
    
  • 指定临时缓存目录:调用useMart时指定临时目录作为缓存,绕过现有缓存问题:
    ensembl <- useMart(
      "ENSEMBL_MART_ENSEMBL",
      dataset = "hsapiens_gene_ensembl", 
      host="https://may2021.archive.ensembl.org",
      cache = tempdir()
    )
    
  • 检查系统依赖:Ubuntu系统确保安装libsqlite3-dev依赖:
    sudo apt-get install libsqlite3-dev
    

内容的提问来源于stack exchange,提问作者Roberto Salatino

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 01:42:34