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

inmoose.pycombat

SOM clustering

FlowSOM

FCS I/O

pytometry

Batch-effect metrics

scib-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.

  1. Batch-wise normalize each marker (cycombinepy.normalize)

  2. Self-organizing map clustering of cells (cycombinepy.create_som)

  3. 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

Indices