flow-pacmap
PaCMAP dimensionality reduction for large-n flow cytometry datasets.
Overview
flow-pacmap is an implementation of PaCMAP (Pairwise Controlled Manifold
Approximation Projection) as described by Wang et al. 2021 (JMLR 22,
Algorithm 1). It embeds high-dimensional event data into 2D using a three-phase
pair-weighted optimization: near-neighbour attraction, mid-near attraction, and
further-pair repulsion. It is designed for large event counts typical in flow
cytometry:
- Flat
&[f32]/Vec<[f32; 2]>API (no ndarray coupling) - PCA initialization via
faerSVD on thed × dcovariance - Optional HNSW KNN (
usearch) or exact k-d tree (kiddo) - Progress reporting and cooperative cancellation
Installation
[]
= "0.1.1"
Features
| Feature | Description |
|---|---|
hnsw (default) |
Approximate nearest neighbours via usearch |
kdtree (default) |
Exact k-d tree search via kiddo (good for low-d / moderate-n) |
Quick start
use ;
let embedding = fit_transform?;
References
Wang, Y., Huang, H., Rudin, C., & Shaposhnik, Y. (2021). Understanding How Dimension Reduction Tools Work: An Empirical Approach to Deciphering t-SNE, UMAP, TriMap, and PaCMAP for Data Visualization. Journal of Machine Learning Research, 22(201), 1–73.
License
MIT