cycombinepy.transform_asinh

cycombinepy.transform_asinh(adata, markers=None, cofactor=5.0, derand=True, reverse=False, layer=None, copy=False, seed=None)[source]

Asinh-transform marker columns of adata with an optional derandomization step.

Port of transform_asinh in R/01_prepare_data.R:375. Derandomization mirrors randomize_matrix in R/utils_helper.R: take ceil(x) then subtract a uniform draw on [0, 0.9999] before the asinh.

Parameters:
  • adata (AnnData) – AnnData with raw expression in adata.X (or adata.layers[layer]).

  • markers (Optional[Iterable[str]]) – Var names to transform. If None, uses cycombinepy.get_markers().

  • cofactor (float) – Asinh cofactor. Common values: 5 (CyTOF), 150 (flow), 6000 (spectral).

  • derand (bool) – If True, apply the derandomization before asinh.

  • reverse (bool) – If True, apply sinh(x) * cofactor instead (inverse transform).

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

  • seed (int | None) – Seed for derandomization RNG.

Return type:

AnnData | None