scdef.tl.filter ¶
filter(model: scDEF, batch_key: Optional[str] = None, diagnostics_kwargs: Optional[Mapping[str, Any]] = None, **filter_kwargs: Any) -> None
Filter factors and refresh the diagnostics and signatures in one step.
model.filter_factors renames factors, which invalidates everything keyed
by those names — the stored signatures, the hierarchies, and the frozen
upper-layer subset used by factor_diagnostics. Calling the two
separately leaves the model in that in-between state, where
scd.pl.make_graph(show_signatures=True) raises until diagnostics are
re-run. This wrapper does both, so the model is immediately usable::
scd.tl.filter(model, batch_key="Experiment", brd_min=1.0)
Equivalent to::
model.filter_factors(brd_min=1.0)
scd.tl.factor_diagnostics(model, batch_key="Experiment")
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
scDEF
|
scDEF model instance. |
required |
batch_key
|
Optional[str]
|
passed to |
None
|
diagnostics_kwargs
|
Optional[Mapping[str, Any]]
|
optional extra keyword arguments for
|
None
|
**filter_kwargs
|
Any
|
forwarded to |
{}
|
Example
scdef.tl.filter(model, batch_key="Experiment", brd_min=1.0) scdef.pl.make_graph(model, show_signatures=True) # works right away