PrecomputedKernel.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')
  • basis (str) – Basis in anndata.AnnData.obsm for which to compute the projection.

  • key_added (Optional[str]) – If not None and copy = False, save the result to anndata.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 modify adata inplace.

Return type



If copy=True, the projection array of shape (n_cells, n_components). Otherwise, it modifies anndata.AnnData.obsm with a key based on key_added.