alphapepttools.pp.scale_and_center#
- alphapepttools.pp.scale_and_center(adata, scaler='standard', layer=None, *, copy=False)#
Scale and center data.
Either use standard or robust scaling. ‘robust’ scaling relies on interquartile range and is more resistant to outliers. Scaling operates on columns only for now.
- Parameters:
adata (
AnnData) – Anndata object with data to scale.scaler (
str(default:'standard')) – Sklearn scaler to use. Available scalers are ‘standard’ and ‘robust’.layer (
Optional[str] (default:None)) – Name of the layer to scale. If None (default), the data matrix X is used.copy (
bool(default:False)) – Whether to return a modified copy (True) of the anndata object. If False (default) modifies the object inplace
- Return type:
- Returns:
None | anndata.AnnData If
copy=Falsemodifies the anndata object at layer inplace and returns None. Ifcopy=True, returns a modified copy.