ehrapy.preprocessing.quantile_norm#

ehrapy.preprocessing.quantile_norm(adata, vars=None, copy=False, **kwargs)[source]#

Apply quantile normalization.

Functionality is provided by ~sklearn.preprocessing.quantile_transform, see https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.quantile_transform.html for details.

Parameters:
  • adata (AnnData) – AnnData object containing X to normalize values in. Must already be encoded using ~ehrapy.preprocessing.encode.encode.

  • vars (Union[str, Sequence[str], None]) – List of the names of the numeric variables to normalize. If None all numeric variables will be normalized. Defaults to None .

  • copy (bool) – Whether to return a copy or act in place. Defaults to False .

  • **kwargs – Additional arguments passed to quantile_transform()

Return type:

Optional[AnnData]

Returns:

AnnData object with normalized X. Also stores a record of applied normalizations as a dictionary in adata.uns[“normalization”].

Examples

>>> import ehrapy as ep
>>> adata = ep.dt.mimic_2(encoded=True)
>>> adata_norm = ep.pp.quantile_norm(adata, copy=True)