cellrank.external.kernels.StationaryOTKernel.compute_projection
- StationaryOTKernel.compute_projection(basis='umap', key_added=None, copy=False)
Compute a projection of the transition matrix in the embedding.
Projections can only be calculated for kNN based kernels. The projected matrix can be then visualized as:
scvelo.pl.velocity_embedding(adata, vkey='T_fwd', basis='umap')
- Parameters
basis (
str
) – Basis inanndata.AnnData.obsm
for which to compute the projection.key_added (
Optional
[str
]) – If not None andcopy = False
, save the result toanndata.AnnData.obsm
['{key_added}']
. Otherwise, save the result to ‘T_fwd_{basis}’ or T_bwd_{basis}, depending on the direction.copy (
bool
) – Whether to return the projection or modifyadata
inplace.
- Return type
- Returns
If
copy=True
, the projection array of shape (n_cells, n_components). Otherwise, it modifiesanndata.AnnData.obsm
with a key based onkey_added
.