cellrank.tl.kernels.PalantirKernel.compute_transition_matrix

PalantirKernel.compute_transition_matrix(k=3, density_normalize=True)[source]

Compute transition matrix based on KNN graph and pseudotemporal ordering.

This is a re-implementation of the Palantir algorithm by [Setty19]. Note that this won’t exactly reproduce the original Palantir results, for three reasons:

  • Palantir computes the KNN graph in a scaled space of diffusion components.

  • Palantir uses its own pseudotime to bias the KNN graph which is not implemented here.

  • Palantir uses a slightly different mechanism to ensure the graph remains connected when removing edges that point into the “pseudotime past”.

If you would like to reproduce the original results, please use the original Palantir algorithm.

Parameters
  • k (int) – Number of neighbors to keep for each node, regardless of pseudotime. This is done to ensure that the graph remains connected.

  • density_normalize (bool) – Whether or not to use the underlying KNN graph for density normalization.

Returns

Makes transition_matrix available.

Return type

cellrank.tl.kernels.PalantirKernel