scvelo.tl.velocity_embedding

scvelo.tl.velocity_embedding(data, basis=None, vkey='velocity', scale=10, self_transitions=True, use_negative_cosines=True, direct_pca_projection=None, retain_scale=False, autoscale=True, all_comps=True, T=None, copy=False)

Computes the single cell velocities in the embedding

Parameters:
data : AnnData

Annotated data matrix.

basis : str (default: ‘tsne’)

Which embedding to use.

vkey : str (default: ‘velocity’)

Name of velocity estimates to be used.

scale : int (default: 10)

Scale parameter of gaussian kernel for transition matrix.

self_transitions : bool (default: True)

Whether to allow self transitions, based on the confidences of transitioning to neighboring cell.

use_negative_cosines : bool (default: True)

Whether to use not only positive, but also negative cosines and use those transitions to the opposite way.

direct_pca_projection : bool (default: None)

Whether to directly project the velocities into PCA space, thus skipping velocity graph.

retain_scale : bool (default: False)

Whether to retain scale from high dimensional space in embedding.

autoscale : bool (default: True)

Whether to scale the embedded velocities by a scalar multiplier, which simply ensures that the arrows in the embedding are properly scaled.

all_comps : bool (default: True)

Whether to compute the velocities on all embedding components or just the first two.

T : csr_matrix (default: None)

Allows the user to directly pass a transition matrix.

copy : bool (default: False)

Return a copy instead of writing to adata.

Returns:

  • Returns or updates adata with the attributes
  • velocity_basis (.obsm) – coordinates of velocity projection on embedding