dynamo.vf.velocities

dynamo.vf.velocities(adata, init_cells=None, init_states=None, basis=None, vector_field_class=None, layer='X', dims=None, Qkey='PCs')[source]

Calculate the velocities for any cell state with the reconstructed vector field function.

Parameters:
  • adata (AnnData) – AnnData object that contains the reconstructed vector field function in the uns attribute.

  • init_cells (Optional[List]) – Cell name or indices of the initial cell states for the historical or future cell state prediction with numerical integration. If the names in init_cells are not found in the adata.obs_name, they will be treated as cell indices and must be integers.

  • init_states (Optional[list]) – Initial cell states for the historical or future cell state prediction with numerical integration.

  • basis (Optional[str]) – The embedding data to use for calculating velocities. If basis is either umap or pca, the reconstructed trajectory will be projected back to high dimensional space via the inverse_transform function.

  • vector_field_class (Optional[BaseVectorField]) – If not None, the speed will be computed using this class instead of the vector field stored in adata. You can set up the class with a known ODE function, useful when the data is generated through simulation.

  • layer (Optional[str]) – Which layer of the data will be used for predicting cell fate with the reconstructed vector field function. The layer once provided, will override the basis argument and this function will then predict cell fate in high dimensional space.

  • dims (Union[int, list, None]) – The dimensions that will be selected for velocity calculation.

  • Qkey (str) – The key of the PCA loading matrix in .uns. Only used when basis is pca.

Return type:

AnnData

Returns:

AnnData object that is updated with the “velocities” related key in the .uns.