scanpy.pp.log1p#
- scanpy.pp.log1p(data, *, base=None, use=None, out=False, chunked=None, chunk_size=None, copy=False, layer=None, obsm=None)[source]#
- scanpy.pp.log1p(x, *, base=None, copy=False)
- scanpy.pp.log1p(x, *, base=None, copy=False)
- scanpy.pp.log1p(x, *, base=None, copy=False)
- scanpy.pp.log1p(x, *, base=None, copy=False)
- scanpy.pp.log1p(x, *, base=None, copy=False)
- scanpy.pp.log1p(x, *, base=None, copy=False)
- scanpy.pp.log1p(adata, *, base=None, use=None, out=False, chunked=False, chunk_size=None, layer=None, obsm=None)
Logarithmize the data matrix.
Computes , where denotes the natural logarithm unless a different base is given.
Array type support# Array type
supported
… experimentally in dask
Array✅
✅
✅
✅
- Parameters:
- data
AnnData|ndarray|csr_array|csc_array|csr_matrix|csc_matrix The (annotated) data matrix of shape
n_obs×n_vars. Rows correspond to cells and columns to genes.- base
Number|None(default:None) Base of the logarithm. Natural logarithm is used by default.
- use
LayerAcc|MultiAcc|str|None(default:None) Which matrix to logarithmize. Given by an accessor, e.g.
A.X,A.layers['counts']orA.obsm['pca'].strs areanndata.acc.AdAcc.resolve()d, e.g.'layers.counts'.- layer
str|None(default:None) Deprecated since version 1.13.0: Use
use/outinstead.A key of
layers, i.e.layer='k'isuse=A.layers['k'].- obsm
str|None(default:None) Deprecated since version 1.13.0: Use
use/outinstead.A key of
obsm, i.e.obsm='k'isuse=A.obsm['k'].- out
LayerAcc|MultiAcc|str|bool(default:False) Where to write the result, e.g.
A.layers['scaled'].strs areanndata.acc.AdAcc.resolve()d, e.g.'layers.scaled'. IfTrue, the result is returned instead of written. IfFalse, it is written to the placeusereads from.- chunked
bool|None(default:None) Process the data matrix in chunks, which will save memory. Applies only to
AnnData.- chunk_size
int|None(default:None) n_obsof the chunks to process the data in.- copy
bool(default:False) Deprecated since version 1.13.0: Copy
adatabefore calling this function instead.Whether to return a modified copy instead of modifying
adatain place.
- data
- Return type:
AnnData|ndarray|csr_array|csc_array|csr_matrix|csc_matrix|None- Returns:
Returns
Noneif the result was written, else the logarithmized matrix.