, vkey='velocity', xkey='Ms', tkey=None, basis=None, n_neighbors=None, n_recurse_neighbors=None, random_neighbors_at_max=None, sqrt_transform=False, approx=False, copy=False)

Computes velocity graph based on cosine similarities.

The cosine similarities are computed between velocities and potential cell state transitions.

data : AnnData

Annotated data matrix.

vkey : str (default: ‘velocity’)

Name of velocity estimates to be used.

n_neighbors : int or None (default: None)

Use fixed number of neighbors or do recursive neighbor search (if None).

n_recurse_neighbors : int (default: 2)

Number of recursions to be done for neighbors search.

random_neighbors_at_max : int or None (default: None)

If number of iterative neighbors for an individual cell is higher than this threshold, a random selection of such are chosen as reference neighbors.

sqrt_transform : bool (default: False)

Whether to variance-transform the cell states changes and velocities before computing cosine similarities.

copy : bool (default: False)

Return a copy instead of writing to adata.


  • Returns or updates adata with the attributes
  • velocity_graph (.uns) – sparse matrix with transition probabilities