dynamo.tl.confident_cell_velocities(adata, group, lineage_dict, ekey='M_s', vkey='velocity_S', basis='umap', confidence_threshold=0.85, only_transition_genes=False)[source]

Compute transition probability and perform velocity projection

Confidently compute transition probability and project high dimension velocity vector to existing low dimension embeddings using progenitors and mature cell groups priors.

  • adata (AnnData) – An AnnData object.

  • group (str) – The column key/name that identifies the cell state grouping information of cells. This will be used for calculating gene-wise confidence score in each cell state.

  • lineage_dict (Dict[str, Union[List[str], str]]) – A dictionary describes lineage priors. Keys correspond to the group name from group that corresponding to the state of one progenitor type while values correspond to the group names from group of one or multiple terminal cell states. The best practice for determining terminal cell states are those fully functional cells instead of intermediate cell states. Note that in python a dictionary key cannot be a list, so if you have two progenitor types converge into one terminal cell state, you need to create two records each with the same terminal cell as value but different progenitor as the key. Value can be either a string for one cell group or a list of string for multiple cell groups.

  • ekey (Optional[str]) – The layer that will be used to retrieve data for identifying the gene is in induction or repression phase at each cell state. If None, .X is used. Defaults to “M_s”.

  • vkey (Optional[str]) – The layer that will be used to retrieve velocity data for calculating gene-wise confidence. If None, velocity_S is used. Defaults to “velocity_S”.

  • basis (str) – The dictionary key that corresponds to the reduced dimension in .obsm attribute. Defaults to “umap”.

  • confidence_threshold (float) – The minimal threshold of the mean of the average progenitors and the average mature cells prior based gene-wise velocity confidence score. Only genes with score larger than this will be considered as confident transition genes for velocity projection. Defaults to 0.85.

  • only_transition_genes (bool) – Whether only use previous identified transition genes for confident gene selection, followed by velocity projection. Defaults to False.


Exception – RNA velocity not evaluated.

Return type:



An updated ~anndata.AnnData with only confident genes based transition_matrix and projected embedding of high dimension velocity vectors in the existing embeddings of current cell state, calculated using either the cosine kernel method from (La Manno et al. 2018) or the Itô kernel for the FP method, etc.