Skip to content

scdef.tl.set_global_factors

set_global_factors(model: scDEF, factors: Optional[Sequence[str]] = None, layer_idx: int = 0, n_eff_parents_min: float = 1.5, exclude_technical: bool = True) -> None

Mark global (shared-across-lineages) factors in factor_obs.

Global factors are identified from hierarchy diagnostics (high effective parents). They are excluded from make_biological_hierarchy. Use drop_technical to remove technical factors from the active model.

Parameters:

Name Type Description Default
model scDEF

scDEF model instance

required
factors Optional[Sequence[str]]

explicit factor names to mark as global (resolved like set_technical_factors). When None, uses get_global_factors.

None
layer_idx int

child layer for automatic selection (default 0).

0
n_eff_parents_min float

minimum effective-parent score when factors is None.

1.5
exclude_technical bool

do not mark technical factors as global.

True