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 aSummarizedExperiment,SingleCellExperiment,MultiAssayExperiment, orMultiAssaySpatialExperimentto a self-describing directory of columnar Parquet, and read it back as a DuckDB-backed experiment with the same Bioconductor API (assays becomeDuckDBArray,rowData/colDatabecomeDuckDBDataFrame,rowRangesbecomesDuckDBGRanges).- SQL-optimized scuttle and
scran — QC metrics, normalization,
pseudo-bulk aggregation, variance modelling, and marker detection implemented as
DuckDB queries, so they run directly on a
DuckDBMatrixwithout 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 SQLMany scran/scuttle steps run directly on the DuckDB-backed matrix:
library(scuttle)
perCellQCMetrics(assay(se, "counts")) # SQL-optimized, no realizationFor 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.
- Introduction to BiocDuckDB — the
writeParquet/readParquetworkflow, storage layout, operations pushed to SQL, genomic coordinates, single-cell data, and the filter-realize-analyze pattern (vignettes/BiocDuckDB.Rmd). - Benchmarking BiocDuckDB — the SQL-optimized
scran/scuttlemethods on aDuckDBMatrixvs in-memory andHDF5Array, from precomputed full-scale results (vignettes/BiocDuckDB-benchmark.Rmd).
MIT License. Copyright Genentech, Inc., 2026. See inst/COPYRIGHTS for bundled
third-party schema components.