stereo.algorithm.spa_track.SpaTrack.get_velocity

SpaTrack.get_velocity(spatial_key=None, n_neigh_pos=10, n_neigh_gene=0, grid_num=50, smooth=0.5, density=1.0)[source]

Get the velocity of each cell and simultaneously convert cell velocity to grid velocity for streamline display.

The speed can be determined in terms of the cell location and/or gene expression.

Parameters:
  • spatial_key (Optional[str]) – The key to get position information of cells, by default, the data.spatial_key will be used.

  • n_neigh_pos (int) – Number of neighbors based on cell positions such as spatial or umap coordinates, defaults to 10

  • n_neigh_gene (int) – Number of neighbors based on gene expression, defaults to 0

  • grid_num (int) – the number of grids, defaults to 50

  • smooth (float) – The factor for scale in Gaussian pdf, defaults to 0.5

  • density (float) – grid density, defaults to 1.0