stlearn.pp.scale

stlearn.pp.scale(data: AnnData | spmatrix | ndarray, zero_center: bool = True, max_value: float | None = None, copy: bool = False) AnnData | spmatrix | ndarray | None[source]

Wrap function of scanpy.pp.scale

Scale data to unit variance and zero mean.

Note

Variables (genes) that do not display any variation (are constant across all observations) are retained and set to 0 during this operation. In the future, they might be set to NaNs.

Parameters:
  • data – The (annotated) data matrix of shape n_obs × n_vars. Rows correspond to cells and columns to genes.

  • zero_center – If False, omit zero-centering variables, which allows to handle sparse input efficiently.

  • max_value – Clip (truncate) to this value after scaling. If None, do not clip.

  • copy – If an AnnData is passed, determines whether a copy is returned.

Return type:

Depending on copy returns or updates data with a scaled data.X.