- VelocityKernel.compute_transition_matrix(mode=VelocityMode.DETERMINISTIC, backward_mode=BackwardMode.TRANSPOSE, scheme=Scheme.CORRELATION, softmax_scale=None, n_samples=1000, seed=None, check_irreducibility=False, **kwargs)
Compute transition matrix based on velocity directions on the local manifold.
For each cell, infer transition probabilities based on the cell’s velocity-extrapolated cell state and the cell states of its K nearest neighbors.
Literal[‘deterministic’, ‘stochastic’, ‘sampling’, ‘monte_carlo’]) –
How to compute transition probabilities. Valid options are:
’deterministic’ - deterministic computation that doesn’t propagate uncertainty.
’monte_carlo’ - Monte Carlo average of randomly sampled velocity vectors.
’stochastic’ - second order approximation, only available when
’sampling’ - sample 1 transition matrix from the velocity distribution.
Literal[‘transpose’, ‘negate’]) –
Only matters if initialized as
= True. Valid options are:
’transpose’ - compute transitions from neighboring cells \(j\) to cell \(i\).
’negate’ - negate the velocity vector.
float]) – Scaling parameter for the softmax. If None, it will be estimated using
1 / median(correlations). The idea behind this is to scale the softmax to counter everything tending to orthogonality in high dimensions.
Similarity scheme between cells as described in [Li et al., 2021]. Can be one of the following:
Alternatively, any function can be passed as long as it follows the signature of
int) – Number of bootstrap samples when
mode = 'monte_carlo'.
bool) – Optional check for irreducibility of the final transition matrix.
show_progress_bar – Whether to show a progress bar. Disabling it may slightly improve performance.
n_jobs – Number of parallel jobs. If -1, use all available cores. If None or 1, the execution is sequential.
backend – Which backend to use for parallelization. See
joblib.Parallelfor valid options.
- Return type
Self and updates the following fields: