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 (str or 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 (str or None (default: None)) – Cell groups used to group the array.

  • genes (list or None (default: None)) – The gene list that speed will be ranked. If provided, they must overlap the dynamics genes.

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

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

  • fcn_pool (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 (default: False)) – Whether output the values along with the rankings.


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

Return type