rapids_singlecell.pp.log1p#

rapids_singlecell.pp.log1p(data, *, base=None, use=None, out=False, 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:
data AnnData | ndarray | csc_matrix | csr_matrix | Array

The (annotated) data matrix of shape n_obs × n_vars. Rows correspond to cells and columns to genes. If a matrix is passed instead of an AnnData object, the transformed matrix is returned.

base float | None (default: None)

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

use LayerAcc | MultiAcc | str | None (default: None)

Which matrix to transform, e.g. A.X, A.layers['counts'] or A.obsm['x']. Strings are resolved by anndata.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'). If True, the result is returned instead of written. If False, it is written to the place use reads from.

Return type:

AnnData | spmatrix | ndarray | None

Returns:

The transformed matrix if a matrix is passed or out=True, else None.