diffsvg.tl.setup_model#

diffsvg.tl.setup_model(adata, likelihood='normal', priors=None)#

Configure the per-gene GAM, given adata pre-processed by diffsvg.pp.bin_obs.

This validates adata/likelihood and bundles them into a DiffSVGModelSetup - it does not build any pm.Model. Actual model construction happens lazily, per gene, once fit_model starts fitting (see DiffSVGModelSetup), so this is cheap regardless of gene count.

Parameters:
adata

Annotated data matrix that diffsvg.pp.bin_obs was already run on (i.e. "binned" in adata.uns).

likelihood default: 'normal'

Observation model. Only "normal" (the default) is implemented.

priors default: None

Overrides for any of DEFAULT_PRIORS, as {name: (distribution, *params)} - e.g. {"beta": ("normal", 0.0, 2.0), "sigma": ("exponential", 1.0)}. Anything not named keeps its default, so the models are unchanged unless asked. Validated here rather than inside a worker, so a typo fails immediately.

Returns:

DiffSVGModelSetup