cycombinepy.normalize

cycombinepy.normalize(adata, markers=None, method='scale', batch_key='batch', ties_method='average', layer=None, copy=False)[source]

Batch-wise normalize marker columns of adata.

Port of normalize in R/02_batch_correct.R:27-111. Each batch is processed independently, so that downstream clustering is less influenced by between-batch shifts.

Parameters:
  • adata (AnnData) – AnnData containing expression in adata.X (or a layer).

  • markers (Optional[Iterable[str]]) – Var names to normalize. If None, cycombinepy.get_markers() is used.

  • method (Literal['scale', 'rank', 'CLR', 'CLR_seu', 'CLR_med', 'qnorm', 'none']) – One of "scale", "rank", "CLR", "CLR_seu", "CLR_med", "qnorm", "none".

  • batch_key (str) – Column in adata.obs identifying the batch.

  • ties_method (Literal['average', 'min', 'max', 'dense', 'ordinal']) – Tie-breaking rule for method="rank".

  • layer (str | None) – If given, read / write that layer instead of adata.X.

  • copy (bool) – If True, return a copy; otherwise modify in place and return None.

Return type:

AnnData | None