decoupler.swap_layer
- decoupler.swap_layer(adata, layer_key, X_layer_key='X', inplace=False)
Swaps an
adata.Xfor a given layer.Swaps an AnnData
Xmatrix with a given layer. Generates a new object by default.- Parameters:
- adataAnnData
Annotated data matrix.
- layer_keystr
.layerskey to place in.X.- X_layer_keystr, None
.layerskey where to move and store the original.X. If None, the original.Xis discarded.- inplacebool
If
False, return a copy. Otherwise, do operation inplace and returnNone.
- Returns:
- layerAnnData, None
If
inplace=False, new AnnData object.