decoupler.tl.rankby_order

Contents

decoupler.tl.rankby_order#

decoupler.tl.rankby_order(adata, order, stat='dcor', verbose=False, **kwargs)#

Rank features along a continuous, ordered process such as pseudotime.

Parameters:
  • adata (AnnData) – Annotated data matrix with observations (rows) and features (columns).

  • order (str) – The name of the column in adata.obs to consider for ordering.

  • stat (str (default: 'dcor')) –

    Which statistic to compute. Must be one of these:

    • dcor (distance correlation from dcor.independence.distance_correlation_t_test)

    • pearsonr (Pearson’s R from scipy.stats.pearsonr)

    • spearmanr (Spearman’s R from scipy.stats.spearmanr)

    • kendalltau (Kendall’s Tau from scipy.stats.kendalltau)

  • verbose (bool (default: False)) – Whether to display progress messages and additional execution details.

  • kwargs – Key arguments passed to the selected stat function.

Return type:

DataFrame

Returns:

DataFrame with features associated with the ordering variable.

Example

import decoupler as dc

adata, net = dc.ds.toy(pstime=True)
dc.tl.rankby_order(adata, order="pstime", names=["G01", "G02", "G03"])