Skip to content

scdef.tl.build_differentiation_paths

build_differentiation_paths(model: scDEF, rel_parent_weight: float = 0.25, abs_parent_weight: float = 0.0, max_paths_per_leaf: int = 8, key_added: str = 'differentiation_paths') -> List[List[str]]

Build hierarchy-consistent differentiation paths (top->leaf).

Paths are generated by walking from each layer-0 factor upward through adjacent-layer parent weights, keeping all parent links that pass adaptive filtering:

w >= max(abs_parent_weight, rel_parent_weight * max_parent_weight_for_child).

Parameters:

Name Type Description Default
model scDEF

fitted scDEF model with at least two layers. A single-layer model stores an empty path set and returns [].

required
rel_parent_weight float

keep a parent link whose weight is at least this fraction of the child's strongest link. This adapts per child, so a child with one dominant parent yields one path while an ambiguous child branches.

0.25
abs_parent_weight float

absolute floor on a parent link's weight, applied on top of the relative rule. The default of 0.0 leaves the relative rule in charge.

0.0
max_paths_per_leaf int

cap on the paths generated from each layer-0 factor, bounding the branching when many parents survive filtering.

8
key_added str

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

'differentiation_paths'

Returns:

Type Description
List[List[str]]

One list of factor names per path, ordered from the top layer down to the leaf.