Preprocessing#

Annotate, quality-control, normalize, select and batch-correct profiles.

Annotation#

pp.annotate_controls(adata[, negcon, ...])

Mark negative (and optionally positive) controls.

pp.annotate_jump(adata[, kind, copy])

Join the JUMP annotation onto profiles read from the Cell Painting Gallery.

pp.find_perturbation_key(adata[, ...])

Resolve which obs column holds the perturbation identity.

pp.standardize_feature_names(adata[, ...])

Rename features to target grammar, keeping the original in var.

Quality control#

pp.calculate_qc_metrics(adata[, ...])

Compute per-cell and per-feature QC metrics.

pp.filter_cells(adata[, min_cells_per_well, ...])

Drop cells that fail QC or sit in under-populated wells.

pp.filter_features(adata[, drop_nan, ...])

Drop all-NaN, low-variance and blocklisted features.

pp.outliers(adata[, method, contamination, ...])

Flag outlying cells.

pp.image_qc(adata[, metrics, channel, ...])

Flag low-quality images and broadcast the verdict onto their cells.

pp.filter_images(adata[, copy])

Drop every cell belonging to an image that failed image_qc().

pp.well_qc(adata[, min_cells, ...])

Flag wells with too few cells, too much missing data, or unstable controls.

pp.downsample(adata[, n_per_group, groupby, ...])

Return at most n_per_group rows from each group.

Normalization#

pp.normalize(adata[, method, by, reference, ...])

Normalize features within groups, optionally fitting on reference rows only.

pp.rank_int(adata[, by, c, stochastic, ...])

Replace every feature by the normal quantile of its rank.

Feature selection#

pp.feature_select(adata[, operations, ...])

Flag the features worth keeping.

pp.subset_features(adata[, key])

Return a new object holding only the features flagged by var[key].

pp.feature_select_chatterjee(adata[, ...])

Keep features whose values depend on the group, monotonically or otherwise.

pp.feature_reproducibility(adata[, groupby, ...])

Score each feature by how consistently replicates of a perturbation agree on it.

pp.feature_batch_sensitivity(adata[, ...])

Test each feature for dependence on the batch, after whatever correction was applied.

Batch correction#

pp.sphere(adata[, method, reference, ...])

Whiten profiles with a transform fitted on the reference rows.

pp.tvn(adata[, batch_key, reference, ...])

Typical variation normalization, then align each batch's controls onto the pooled controls [Celik et al., 2024].

pp.correct_plate_position(adata[, method, ...])

Remove row and column position effects, per plate and per feature.

pp.regress_out(adata[, keys, by, reference, ...])

Regress confounders out of every feature, within groups.

pp.harmony(adata[, batch_key, use_rep, ...])

Correct an embedding for batch with Harmony.