muon.pp.l2norm#

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

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.