B-G.24: polars-bio: fast, scalable, and out-of-core genomic intervals and format I/O for Python DataFrames
Motivation. Operations on genomic intervals, such as overlap, nearest, coverage, and count_overlaps, are foundational to bioinformatics pipelines, from variant annotation to 3D chromatin analysis. Yet widely used Python libraries (Pybedtools, PyRanges, Bioframe, GenomicRanges) struggle past a few million intervals, lack multi-threaded out-of-core execution, and tie peak memory to dataset size. The I/O layer feeding them, such as pysam, is an equally severe bottleneck at the biobank scale.
Results. We present polars-bio, a Python/Rust library on Apache DataFusion, Arrow, and Polars unifying genomic format readers (BAM/CRAM/VCF/FASTQ/FASTA/GFF/GTF/BED) and multiple interval operations in a single vectorized, streaming, multi-threaded engine (Wiewiórka et al., Bioinformatics 2025). In single-threaded benchmarks (AIList, 10^7 vs 1.2×10^6 intervals), polars-bio outpaces Bioframe by 6.5× (overlap), 15.5× (nearest), 38× (count_overlaps), and 15× (coverage), using up to 90× less peak memory in streaming mode. Recent releases extend the operation set to eight (adding cluster, complement, merge, and subtract) and, still single-threaded, is the fastest library in all operations on the largest tested dataset, ahead of PyRanges1,GenomicRanges, and Bioframe. polars-bio also delivers fast, out-of-core, multi-threaded I/O across many popular file formats with range predicates pushdown via file indexes (CSI/BAI/CRAI), column pruning, and limit optimizations, and write support for native formats. It enables efficient file-format transformations with near-linear thread scalability on both interval operations and genomic readers. Federated SQL queries over cloud storages extend these capabilities to datasets exceeding local memory and storage. Recent benchmark results are documented in recent project blog posts (https://biodatageeks.org/polars-bio/blog/2026/02/14/benchmarking-genomic-format-readers-in-python-with-polars/; https://biodatageeks.org/polars-bio/blog/2026/02/20/interval-operations-benchmark--update-february-2026/)
Availability. Open source (Apache 2.0)
https://biodatageeks.org/polars-bio/
Co-authors: Tomasz Gambin
Contact Attendee
Warning: Attempt to read property "user_email" on string in /home/1276969.cloudwaysapps.com/ydbgzhdjeq/public_html/wp-content/plugins/my-conference-now/functions.php on line 2826