scib.metrics.trajectory_conservation

scib.metrics.trajectory_conservation(adata_pre, adata_post, label_key, pseudotime_key='dpt_pseudotime', batch_key=None)

Trajectory conservation score

Trajectory conservation is measured by spearman’s rank correlation coefficient \(s\), between the pseudotime values before and after integration. The final score was scaled to a value between 0 and 1 using the equation

\[trajectory \, conservation = \frac {s + 1} {2}\]

This function Expects pseudotime values to be precomputed.

Parameters
  • adata_pre – unintegrated adata

  • adata_post – integrated adata

  • label_key – column in adata_pre.obs of the groups used to precompute the trajectory

  • pseudotime_key – column in adata_pre.obs in which the pseudotime is saved in. Column can contain empty entries, the dataset will be subset to the cells with scores.

  • batch_key – set to batch key if if you want to compute the trajectory metric by batch