rapids_singlecell.pp.log1p#
- rapids_singlecell.pp.log1p(data, *, 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
baseis given.- Parameters:
- data
Union[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 anAnnDataobject, the transformed matrix is returned.- 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. IfNone,Xis normalized.- obsm
str|None(default:None) Entry of
.obsmto transform.- inplace
bool(default:True) Whether to update
dataor return the matrix. Only applies toAnnDatainput.- copy
bool(default:False) Whether to return a copy or update
data. Not compatible withinplace=False. Only applies toAnnDatainput.
- data
- Return type:
- Returns:
The resulting matrix after applying the logarithm of one plus the input matrix. If a matrix is passed, the transformed matrix is returned. If an AnnData object is passed and
copyisTrue, returns the modified AnnData. Otherwise, updates thedataobject in-place and returns None.