scanpy.pp.log1p
- scanpy.pp.log1p(X, *, base=None, copy=False, chunked=None, chunk_size=None, layer=None, obsm=None)
- scanpy.pp.log1p(X: scipy.sparse._base.spmatrix, *, base: Optional[numbers.Number] = None, copy: bool = False)
- scanpy.pp.log1p(X: numpy.ndarray, *, base: Optional[numbers.Number] = None, copy: bool = False)
- scanpy.pp.log1p(adata: anndata._core.anndata.AnnData, *, base: Optional[numbers.Number] = None, copy: bool = False, chunked: bool = False, chunk_size: Optional[int] = None, layer: Optional[str] = None, obsm: Optional[str] = None) Optional[anndata._core.anndata.AnnData]
Logarithmize the data matrix.
Computes \(X = \log(X + 1)\), where \(log\) denotes the natural logarithm unless a different base is given.
- Parameters
- X :
Union
[AnnData
,ndarray
,spmatrix
] The (annotated) data matrix of shape
n_obs
×n_vars
. Rows correspond to cells and columns to genes.- base :
Optional
[Number
] (default:None
) Base of the logarithm. Natural logarithm is used by default.
- copy :
bool
(default:False
) If an
AnnData
is passed, determines whether a copy is returned.- chunked :
Optional
[bool
] (default:None
) Process the data matrix in chunks, which will save memory. Applies only to
AnnData
.- chunk_size :
Optional
[int
] (default:None
) n_obs
of the chunks to process the data in.- layer :
Optional
[str
] (default:None
) Entry of layers to tranform.
- obsm :
Optional
[str
] (default:None
) Entry of obsm to transform.
- X :
- Returns
Returns or updates
data
, depending oncopy
.