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
mdatais a MuData object, this specifies the modalities to normalize.Noneindicates all modalities.rep – The representation to normalize.
Xor any key for.obsmis valid. IfNone, the representation is chosen automatically. Ifmdatais 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
mdatais 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 updatesmdata.