rapids_singlecell.pp.normalize_shifted_clr#
- rapids_singlecell.pp.normalize_shifted_clr(adata, *, alpha=None, use=None, out=False, layer=None, inplace=True, copy=False)[source]#
Normalize counts with the shifted centered log-ratio (PFlog) transform [BHGMP26].
If
alphais not provided, it is estimated from the input matrix. PFlog is then computed aswhich is equivalent to centering because the constant cancels during CLR centering.
Note
CLR centering generally maps zeros to non-zero values, so the resulting matrix is dense even when the input is sparse.
- Parameters:
- adata
AnnData The annotated data matrix of shape
n_obs×n_vars. Rows correspond to cells and columns to genes.- alpha
float|None(default:None) Negative-binomial overdispersion of the dataset (
var = μ + α·μ²). IfNone, it is estimated from the input matrix. A positive numeric value uses that value directly. PFlog applieslog1p(4 * alpha * x)before CLR centering.- use
LayerAcc|MultiAcc|str|None(default:None) Which matrix to normalize, e.g.
A.X,A.layers['counts']orA.obsm['x']. Strings are resolved byanndata.acc.AdAcc.resolve(), e.g.'layers.counts'.- out
LayerAcc|MultiAcc|str|bool(default:False) Where to write the result, e.g.
A.layers['k'](or'layers.k'). IfTrue, the result is returned instead of written. IfFalse, it is written to the placeusereads from.
- adata
- Return type:
AnnData|ndarray|Array|dict[str,ndarray|Array] |None- Returns:
The normalized matrix if
out=True, elseNone.