dynamo.vf.rank_genes(adata, arr_key, groups=None, genes=None, abs=False, normalize=False, fcn_pool=<function <lambda>>, dtype=None, output_values=False)[source]

Rank gene’s absolute, positive, negative vector field metrics by different cell groups.

  • adata (AnnData) – AnnData object that contains the array to be sorted in .var or .layer.

  • arr_key (Union[str, ndarray]) – The key of the to-be-ranked array stored in .var or or .layer. If the array is found in .var, the groups argument will be ignored. If a numpy array is passed, it is used as the array to be ranked and must be either an 1d array of length .n_var, or a .n_obs-by-.n_var 2d array.

  • groups (Optional[str]) – Cell groups used to group the array.

  • genes (Optional[List]) – The gene list that speed will be ranked. If provided, they must overlap the dynamics genes.

  • abs (bool) – When pooling the values in the array (see below), whether to take the absolute values.

  • normalize (bool) – bool (default: False) Whether normalize the array across all cells first, if the array is 2d.

  • fcn_pool (Callable) – callable (default: numpy.mean(x, axis=0)) The function used to pool values in the to-be-ranked array if the array is 2d.

  • output_values (bool) – bool (default: False) Whether output the values along with the rankings.

Return type:



A dataframe of gene names and values based on which the genes are sorted for each cell group.