cycombinepy¶
cycombinepy is an AnnData-based implementation inspired by
cyCombine for batch correction of
single-cell cytometry data. It uses established Python packages for the main
numerical steps:
Component |
Library |
|---|---|
ComBat correction |
|
SOM clustering |
|
FCS I/O |
|
Batch-effect metrics |
Scope and provenance¶
cyCombinePy implements the core AnnData workflow inspired by the R cyCombine package: normalization for clustering, FlowSOM clustering, and per-cluster ComBat correction.
Batch-wise normalize each marker (
cycombinepy.normalize)Self-organizing map clustering of cells (
cycombinepy.create_som)Per-cluster ComBat correction with optional covariates (
cycombinepy.correct_data)
Step 1 operates on a normalized view so that downstream clusters are less driven by technical variation. Step 3 is applied to the unnormalized data per cluster so rare populations are not over-corrected.
The API also validates requested marker names, missing observation
metadata, finite marker matrices, and requested layers before numerical
routines run. Correction functions write an H5AD-safe report to
adata.uns["cycombinepy_correction"], and strict defaults fail closed for
ComBat errors or fully confounded covariate/anchor designs.
Out of scope for cyCombinePy are Seurat / SingleCellExperiment wrappers, panel
merging, ComBat_seq, alternative clustering backends, and run_analysis.
Main entry points¶
cycombinepy.batch_correct(): run normalization, FlowSOM clustering, and per-cluster ComBat in one call.cycombinepy.correct_data(): run audited per-cluster ComBat when SOM labels already exist.cycombinepy.detect_batch_effect_express()andcycombinepy.detect_batch_effect(): inspect marker-level and embedding batch effects before correction.Main cyCombine workflow (Python port): source-only vignette for the correction workflow, including
return_report=True, strict policies, and the layer-based modular API.Detecting batch effects (Python port): source-only vignette for diagnostic plots and validation behavior.
CITE-seq ADT batch correction benchmark: rendered CITE-seq ADT benchmark comparing cyCombinePy with Harmony and totalVI.
Getting started