cellrank.tl.estimators.GPCCA.compute_absorption_probabilities
- GPCCA.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 interminal_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 ofpetsc4py.PETSc.KPS.Type
otherwise.Information on the
scipy
iterative solvers can be found inscipy.sparse.linalg()
or forpetsc4py
solver here.use_petsc (
bool
) – Whether to use solvers frompetsc4py
orscipy
. Recommended for large problems. If no installation is found, defaults toscipy.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 atuple
, 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 inkeys
, 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. Seejoblib.Parallel
for valid options.show_progress_bar (
bool
) – Whether to show progress bar. Only used whensolver != '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 whenuse_petsc = True
. For valid options, see here. We recommend the ‘ilu’ preconditioner for badly conditioned problems.
- Return type
- Returns
Nothing, just updates the following fields:
absorption_probabilities
- Absorption probabilities.absorption_times
- Mean and variance of the time until absorption. Only iftime_to_absorption
is specified.