rapids_singlecell.pp.log1p

Contents

rapids_singlecell.pp.log1p#

rapids_singlecell.pp.log1p(adata, *, base=None, layer=None, obsm=None, inplace=True, copy=False)[source]#

Logarithmize the data matrix.

Computes \(X = \log(X + 1)\), where \(log\) denotes the natural logarithm unless a different base is given.

Parameters:
adata AnnData

AnnData object

base float | None (default: None)

Base of the logarithm. Natural logarithm is used by default.

layer str | None (default: None)

Layer to normalize instead of X. If None, X is normalized.

obsm str | None (default: None)

Entry of .obsm to transform.

inplace bool (default: True)

Whether to update adata or return the matrix.

copy bool (default: False)

Whether to return a copy or update adata. Not compatible with inplace=False.

Return type:

Union[AnnData, spmatrix, ndarray, None]

Returns:

The resulting matrix after applying the logarithm of one plus the input matrix. If copy is set to True, returns the modified AnnData. Otherwise, updates the adata object in-place and returns None.