Skip to main content

Crate bixverse_sc_data

Crate bixverse_sc_data 

Source
Expand description

The single cell data layer: the bixverse binary sparse format, its streaming readers and writers, and ingestion from h5ad, 10x h5 (feature h5) and MTX.

§Feature flags

  • analysis (enabled by default) — Plotting helpers and synthetic data generators. Pulls in bixverse-core, and with it faer, SIMD and nearest neighbour search. Switch it off for a reader that only needs the store formats.
  • h5 — The h5ad and 10x h5 readers and writers. Pulls in HDF5.
  • hdf5-static — Compile the bundled HDF5 C library from source. Leave it off to link an external libhdf5 found via HDF5_DIR or pkg-config, which is what the R package does on Windows: hdf5-metno-src names its output with the host toolchain’s convention, so an msvc host targeting gnu emits libhdf5 and the link fails.
  • hdf5-filters — Compile the LZF (32000) and Blosc (32001) filters into the HDF5 build, so h5ad files written by hdf5plugin with those codecs can be read. Both register through H5Zregister and never touch the HDF5 plugin path, which for a hdf5-metno-src build points at a long gone cargo OUT_DIR. Blosc vendors c-blosc plus lz4, zlib and zstd, all built with cc. Snappy is left out on purpose. It is C++, and the R package links this staticlib without the C++ runtime. Filters outside these two (standalone zstd, bitshuffle, lz4, blosc2) raise ScDataErrors::UnsupportedH5Filter. Blosc with snappy passes that check, since the codec sits in the chunk header, and fails in H5Dread with c-blosc naming the missing compressor.

Modules§

archive_io
Cold-storage archive of the cell-based binary.
bin_merge_io
Helpers for multi-file binary file merging. This is used to combine multiple SingleCells experiments on the R side. It enables the user to combine and merge several experiments.
data_io
Contains the streaming engine for bixverse single cell application. This has the structures for cells/spots and genes ready, plus various utilities, writers and readers.
errors
Errors raised by bixverse-sc-data.
gene_file_io
Builds the gene-based (CSC) binary from the cell-based (CSR) one.
h5_10x_adt_io
Helper functions to specifically extract ADT counts from the h5 file. Can be theoretically used for other modalities, but it does return dense data!
h5_10x_io
10x CellRanger v2/v3 h5 ingestion. Streams the gene-expression modality to the bixverse binarised format. Other modalities (e.g. Antibody Capture) are filtered out here.
h5_10x_multifile_io
Multi-10x loading: scan multiple 10x CellRanger h5 files, apply global gene QC, and write all cells into a single binary file. Mirrors the h5ad and mtx multi-loader designs and reuses the 10x layout helpers from h5_10x_io.
h5_filters
Filter pipeline checks for HDF5 inputs.
h5ad_io
Contains the h5ad-related parts to do read in data from h5ad files and transform them into the binarised files for usage in bixverse-rs.
h5ad_multifile_io
Multi-h5ad loading: scan multiple h5ad files, apply global gene QC, and write all cells into a single binary file.
in_memory_io
An in-memory SingleCellReading store over CompressedSparseData2.
mtx_io
Contains the MTX file-related parts to do read in data from mtx files and transform them into the binarised files for usage in bixverse-rs
mtx_multifile_io
Multi-mtx loading: scan multiple mtx files, apply global gene QC, and write all cells into a single binary file. Mirrors the h5ad multi-loader design.
plotting
Helpers to extract genes for plotting. Can densify raw and normalised counts, do Z-score normalisation for groups and caclulate proportion of cells.
prelude
Re-exports for use crate::prelude::*: the sparse prelude (plus the core prelude under analysis) and the single cell data layer.
r_obj_io
Contains the R-based reading in of data (for example for Seurat type files) to transform the counts into the binary Rust-based files.
sc_synthetic_data
Contains helpers for the generation of synthetic data for testing algorithms. Has the option to create single cell-like data with defined cell types, optional batch effects and different cell abundance distributions per given sample, plus a DIALOGUE fixture carrying a planted multicellular programme.
sc_traits
Contains traits and their implementations, specifically designed for the single cell workflows in this crate.
v4_io
The v4 chunk encoding and the v3 -> v4 converters.

Constants§

CELL_BATCH_SIZE
How many cells to read in per given batch - global constant
SC_FILE_VERSION
Version of the single cell files writers emit: delta bit-packed chunks with the normalised layer recomputed on read.
SC_FILE_VERSION_V3
Previous file version: absolute u32 indices, normalised layer stored. Readers still open it; v4_io::upgrade_store_to_v4 converts it.
VERSION
Version of this crate.