pbzarr
A Rust library for PBZ (Per-Base Zarr) — a Zarr v3 convention for storing per-base resolution genomic data such as read depths, methylation levels, and boolean masks.
PBZ is a modern alternative to D4 and bigWig. This crate handles store layout, metadata, region parsing, and chunk I/O, delegating array storage and compression to zarrs.
Installation
[]
= "0.1"
Quick Start
use ;
use Array2;
// Create a store
let contigs = vec!;
let lengths = vec!;
let store = create?;
// Create a track
let config = new
.columns;
let track = store.create_track?;
// Write a chunk
let data = zeros;
track.?;
// Read it back
let chunk: = track.read_chunk?;
Features
- Zarr v3 only with Blosc/Zstd compression and PackBits for booleans
- Chunk-level I/O with
ndarray::Array2<T> - Region parsing:
"chr1:1000-2000"with comma-stripped numbers - Escape hatches to raw
zarrs::Arrayobjects - All standard dtypes: u8, u16, u32, i8, i16, i32, f32, f64, bool