muon.pp.l2norm

Contents

muon.pp.l2norm#

muon.pp.l2norm(mdata: MuData | AnnData, mod: Iterable[str] | str | None = None, rep: Iterable[str] | str | None = None, n_pcs: Iterable[int] | int | None = 0, copy: bool = False) MuData | AnnData | None#

Normalize observations to unit L2 norm.

Parameters:
  • mdata – The MuData or AnnData object to normalize.

  • mod – If mdata is a MuData object, this specifies the modalities to normalize. None indicates all modalities.

  • rep – The representation to normalize. X or any key for .obsm is valid. If None, the representation is chosen automatically. If mdata is a MuData object and this is not an iterable, the given representation will be used for all modalities.

  • n_pcs – The number of principal components to use. This affects the result only if a PCA representation is being normalized. If mdata is a MuData object and this is not an iterable, the given number will be used for all modalities.

  • copy – Return a copy instead of writing to mdata.

Returns: Depending on copy, returns or updates mdata.