cellrank.tl.estimators.CFLARE.compute_absorption_probabilities

CFLARE.compute_absorption_probabilities(keys=None, solver='gmres', use_petsc=True, time_to_absorption=None, n_jobs=None, backend='loky', show_progress_bar=True, tol=1e-06, preconditioner=None)

Compute absorption probabilities.

For each cell, this computes the probability of being absorbed in any of the terminal_states. In particular, this corresponds to the probability that a random walk initialized in transient cell \(i\) will reach any cell from a fixed transient state before reaching a cell from any other transient state.

Parameters
  • keys (Optional[Sequence[str]]) – Terminal states for which to compute the absorption probabilities. If None, use all states defined in terminal_states.

  • solver (Union[str, Literal[‘direct’, ‘gmres’, ‘lgmres’, ‘bicgstab’, ‘gcrotmk’]]) –

    Solver to use for the linear problem. Options are ‘direct’, ‘gmres’, ‘lgmres’, ‘bicgstab’ or ‘gcrotmk’ when use_petsc = False or one of petsc4py.PETSc.KPS.Type otherwise.

    Information on the scipy iterative solvers can be found in scipy.sparse.linalg() or for petsc4py solver here.

  • use_petsc (bool) – Whether to use solvers from petsc4py or scipy. Recommended for large problems. If no installation is found, defaults to scipy.sparse.linalg.gmres().

  • time_to_absorption (Union[Literal[‘all’], Sequence[Union[str, Sequence[str]]], Dict[Union[str, Sequence[str]], Literal[‘mean’, ‘var’]], None]) –

    Whether to compute mean time to absorption and its variance to specific absorbing states.

    If a dict, can be specified as {{'Alpha': 'var', ...}} to also compute variance. In case when states are a tuple, time to absorption will be computed to the subset of these states, such as [('Alpha', 'Beta'), ...] or {{('Alpha', 'Beta'): 'mean', ...}}. Can be specified as 'all' to compute it to any absorbing state in keys, which is more efficient than listing all absorbing states explicitly.

    It might be beneficial to disable the progress bar as show_progress_bar = False because of many solves.

  • n_jobs (Optional[int]) – Number of parallel jobs to use when using an iterative solver.

  • backend (Literal[‘loky’, ‘multiprocessing’, ‘threading’]) – Which backend to use for multiprocessing. See joblib.Parallel for valid options.

  • show_progress_bar (bool) – Whether to show progress bar. Only used when solver != 'direct'.

  • tol (float) – Convergence tolerance for the iterative solver. The default is fine for most cases, only consider decreasing this for severely ill-conditioned matrices.

  • preconditioner (Optional[str]) – Preconditioner to use, only available when use_petsc = True. For valid options, see here. We recommend the ‘ilu’ preconditioner for badly conditioned problems.

Return type

None

Returns

Nothing, just updates the following fields: