High-level Bioconductor integration for DuckDB-backed data — read and write Experiment objects as Parquet, analyze them on disk.
BiocDuckDB is the integration layer of the BiocDuckDB suite. It brings
together DuckDBDataFrame,
DuckDBArray, and
DuckDBGRanges to provide:
writeParquet() / readParquet() — serialize a SummarizedExperiment,
SingleCellExperiment, MultiAssayExperiment, or MultiAssaySpatialExperiment
to a self-describing directory of columnar Parquet, and read it back as a
DuckDB-backed experiment with the same Bioconductor API (assays become
DuckDBArray, rowData/colData become DuckDBDataFrame, rowRanges becomes
DuckDBGRanges).DuckDBMatrix without realizing it.The on-disk format is a Frictionless Data Package, readable by other tools and languages, not just R.
# once available from Bioconductor:
if (!require("BiocManager")) install.packages("BiocManager")
BiocManager::install("BiocDuckDB")
library(BiocDuckDB)
library(SummarizedExperiment)
data(airway, package = "airway")
# write to Parquet, read back as DuckDB-backed
path <- file.path(tempdir(), "airway_se")
writeParquet(airway, path)
se <- readParquet(path)
assay(se, "counts") # a DuckDBArray, on disk
colSums(assay(se[1:1000, ], "counts")) # pushed to SQL
Many scran/scuttle steps run directly on the DuckDB-backed matrix:
library(scuttle)
perCellQCMetrics(assay(se, "counts")) # SQL-optimized, no realization
For data larger than memory: filter and summarize on disk with DuckDB, realize the manageable subset into memory, run the standard pipeline, and persist results back to Parquet. See the Introduction to BiocDuckDB vignette.
writeParquet/readParquet workflow,
storage layout, operations pushed to SQL, genomic coordinates, single-cell data,
and the filter-realize-analyze pattern (vignettes/BiocDuckDB.Rmd).scran/scuttle methods on a
DuckDBMatrix vs in-memory and HDF5Array, from precomputed full-scale results
(vignettes/BiocDuckDB-benchmark.Rmd).MIT License. Copyright Genentech, Inc., 2026. See inst/COPYRIGHTS for bundled
third-party schema components.