Flow cytometry analysis tools, oxidized. The aim of this workspace is to leverage the blazing-fast speed, memory and type safety, and fearless concurrency of the Rust language to scale-up to modern flow cytometry workflows requiring millions of events without breaking a sweat. Biological data can be unpredictable; the tools to analyze it shouldn't be.
The workspace includes libaries for:
- Reading FCS files
- Creating plots
- Working with gates
- QC'ing data
- Performing unmixing
⚠️ Under Construction: This workspace is actively under development. APIs may change, and some features may be incomplete. Use with caution in production environments.
This workspace contains multiple crates for flow cytometry analysis:
| Package | Path | Description |
|---|---|---|
flow-fcs |
fcs/ |
A comprehensive, type-safe API for reading, parsing, writing, and manipulating FCS files. Built on top of Polars for efficient columnar data operations, with zero-copy data access, and SIMD-accelerated operations. |
flow-fcs-compress |
flow-fcs-compress/ |
Codecs for compression and decompression of FCS files, a novel .fcz compressed format |
flow-fcs-bench |
flow-fcs-bench/ |
Synthetic / file harness for compress throughput (unpublished) |
| Package | Path | Description |
|---|---|---|
flow-linalg |
flow-linalg/ |
Pure-Rust linear algebra primitives for flow cytometry, built on faer. Spillover compensation, matrix condition / hotspot matrices |
flow-density |
flow-density/ |
FFT-accelerated KDE (1D/2D) for use with gating, plotting, and high-dimensional reduction and clustering |
flow-clustering |
flow-clustering/ |
K-means, DBSCAN, GMM for automated gating |
flow-knn |
flow-knn/ |
Reusable KnnGraph: Exact / HNSW / GPU-acceleration (optional) |
flow-peak-detection |
flow-peak-detection/ |
Histogram peak isolation, e.g. for single-stain medians |
flow-control-detection |
flow-control-detection/ |
Filename heuristics for unstained / single-stain roles |
| Package | Path | Description |
|---|---|---|
flow-gates |
gates/ |
Manual + GatingML gates, hierarchies, automated scatter/doublets/debris |
flow-plots |
plots/ |
Density, scatter, histogram, and spectral plot rendering to static images |
peacoqc-rs |
peacoqc-rs/ |
PeacoQC time-bin QC (IT / MAD / margins / doublets) |
flow-tru-ols |
tru-ols/ |
Truncated re-unmixing OLS core + quality metrics |
flow-pacmap |
flow-pacmap/ |
PaCMAP embedding (KNN via flow-knn) |
| Package | Path | Description |
|---|---|---|
peacoqc-cli |
peacoqc-cli/ |
CLI for performing PeacoQC on FCS files |
tru-ols-cli |
tru-ols-cli/ |
CLI for performing TRU-OLS spectral unmixing on FCS files |
peacoqc-py |
peacoqc-py/ |
Python bindings for peacoqc-rs |
Tests run under cargo-nextest (cargo install cargo-nextest --locked).
cargo check --workspace
cargo nextest run --workspace --lib --bins
cargo clippy --workspaceNextest does not run doctests, so those stay on the built-in harness:
cargo test --doc --workspaceMIT — see LICENSE.
- Polars for columnar storage of events/parameters
- faer Linear algebra
- PeacoQC (Saeys lab) for the QC algorithm reimplemented in
peacoqc-rs - TRU-OLS (DeNovo Research) for the unmixing algorithm.
- Polars — High-performance dataframe library
- faer — Pure-Rust linear algebra library
- PeacoQC — Peak-based selection of high quality cytometry data
- ISAC FCS — Flow Cytometry Standard
Contributions are welcome! Please submit an Issue or Pull Request to the repository!