Skip to content

scdef.tl.build_transition_paths

build_transition_paths(model: scDEF, rel_parent_weight: float = 0.2, abs_parent_weight: float = 0.0, max_path_len: int = 5, max_paths_per_pair: int = 5, terminal_layer_idx: int = 0, sources: Optional[Sequence[str]] = None, targets: Optional[Sequence[str]] = None, key_added: str = 'transition_paths') -> List[List[str]]

Build transition paths on a soft inter-layer factor graph.

Unlike build_differentiation_paths, which only walks upward, this treats the inter-layer graph as undirected, so a path may rise through a shared parent and descend again — the shape a transition between two states takes.

De novo mode: sources=None and targets=None -> all terminal pairs. Targeted mode: provide both sources and targets factor-name lists.

Parameters:

Name Type Description Default
model scDEF

fitted scDEF model.

required
rel_parent_weight float

keep an edge whose weight is at least this fraction of the child's strongest link.

0.2
abs_parent_weight float

absolute floor on an edge weight, applied on top of the relative rule.

0.0
max_path_len int

maximum number of nodes in a path, at least 2. Longer limits allow routes through more intermediate layers.

5
max_paths_per_pair int

cap on paths kept per source/target pair, shortest first (through the lowest common ancestor), then by the product of edge weights.

5
terminal_layer_idx int

layer whose factors act as the path endpoints, layer 0 (the finest) by default.

0
sources Optional[Sequence[str]]

factor names to start from. Must be given together with targets; leave both unset to use every pair of terminal factors.

None
targets Optional[Sequence[str]]

factor names to end at, paired with sources.

None
key_added str

key in adata.uns the paths and their parameters are stored under.

'transition_paths'

Returns:

Type Description
List[List[str]]

One list of factor names per path, ordered from source to target.