mantispy.pp.rank_int

Contents

mantispy.pp.rank_int#

mantispy.pp.rank_int(adata, by=None, c=0.375, stochastic=True, seed=0, key_added=None, copy=False)#

Replace every feature by the normal quantile of its rank.

Parameters:
  • adata (AnnData) – Object to transform. Run it after normalize(), as the JUMP recipe and the batch-correction benchmark do.

  • by (str | None (default: None)) – Rank within each group of this column. None ranks globally, as the reference implementation does, which keeps every feature comparable across the screen. Ranking per plate also removes plate-level differences in distribution shape, but can hide a plate that failed.

  • c (float (default: 0.375)) – Blom’s constant.

  • stochastic (bool (default: True)) – Tie handling; see rank_inverse_normal.

  • seed (int (default: 0)) – Tie handling; see rank_inverse_normal.

  • key_added (str | None (default: None)) – Write to layers[key_added] instead of overwriting X.

  • copy (bool (default: False)) – Return a modified copy instead of transforming in place.

Return type:

AnnData | None

Returns:

None, or the modified copy. Writes X or layers[key_added].

Notes

Every feature comes out standard normal, so no feature dominates a distance through its units. Effect sizes are lost as well: a feature that doubled and one that moved by one percent look the same if they reorder the same wells. Keep the untransformed values with key_added for effect sizes and dose-response curves.