Skip to content

Top level

The store reader and the exceptions, re-exported from the compiled core.

bixverse

Single-cell streaming for Python, in Rust.

Opens a bixverse binary sparse store and yields minibatches fast enough to keep a GPU training loop fed. The decode never leaves Rust: a feeder thread decompresses and materialises batches ahead of the consumer, releasing the GIL while it works.

>>> import bixverse as bv
>>> reader = bv.CellReader("counts.bin")
>>> loader = bv.CellLoader(reader, batch_size=256, layer="norm")
>>> for batch in loader:
...     x = batch.scipy_csr()

Batches are sparse CSR by default. Pass sparse=False for a dense (batch_size, n_genes) array, and expect it to cost a zero-fill and a scatter over every gene whether or not it holds a count.

CellReader

CellReader(path: str)

Handle on a bixverse binary sparse store.

is_cell_based property

is_cell_based: bool

Whether the store is cell-major. Only cell-major stores can be looped.

target_size property

target_size: float | None

Library size the normalised layer was scaled against, when recorded.

total_cells property

total_cells: int

Total number of cells in the store.

total_genes property

total_genes: int

Total number of genes in the store.

BixverseError

Bases: Exception

SparseFileError

Bases: BixverseError