bioalpha.singlecell.preprocessing.log1p
- bioalpha.singlecell.preprocessing.log1p(data: AnnData | csr_matrix | csc_matrix | ndarray, *, base: Number | None = None, copy: bool = False, chunked: bool = False, chunk_size: int | None = None, layer: str | None = None, obsm: str | None = None, key_added: str | None = None, obs_mask: str | None = None, var_mask: str | None = None, **kwargs) AnnData | csr_matrix | csc_matrix | ndarray | None
Logarithmize the data matrix.
Computes
data = log(data + 1)
, wherelog
denotes the natural logarithm unless a different base is given.- Parameters:
X (Union[
AnnData
,csr_matrix
,csc_matrix
,ndarray
]) – The (annotated) data matrix of shapen_obs
xn_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
) – Determines whether a copy is returned.chunked (
bool
, default =False
) – Process the data matrix in chunks, which will save memory.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.key_added (Optional[
str
], default =filter_genes_mask
) – Name of the field inadata.var
where the filter array is stored. Only for mapping data.obs_mask (Optional[
str
], default =None
) – Ifobs_mask
is notNone
, filter cells byadata.obs[obs_mask]
.var_mask (Optional[
str
], default =None
) – Ifobs_mask
is notNone
, filter genes byadata.obs[obs_mask]
.**kwargs – Other parameters passed to
BatchReader
.
- Return type:
Returns or updates
data
, depending oncopy
.