diffsvg.tl.fit_profiles#

diffsvg.tl.fit_profiles(adata, model_setup, n_workers=1, progressbar=True, inplace=True, use_binned=True, profiles_key='dsvg_profiles', sample_kwargs=None, predictive_seed=None, inference='auto', **pymc_kwargs)#

Fit the condition-free model for every gene, giving one expression profile per gene.

The counterpart to fit_model for data binned without a condition (diffsvg.pp.bin_obs(..., condition=None)): it drops the condition covariate and its spline interaction, so each gene gets a single curve rather than one per condition. No differential statistic is computed here - one_vs_rest produces that by comparing genes against each other.

Also usable on data that does have conditions, in which case both conditions’ bins feed one pooled curve per gene. That is an alternative to what one_vs_rest does by default there (averaging the two fitted condition curves), and the two need not agree exactly.

Parameters:
adata

The AnnData model_setup.binned was built from; the write target when inplace is True.

model_setup

Output of setup_model.

n_workers default: 1

Deprecated since version 0.1.0: It has no effect: the curves are the posterior of the mean function, computed without new random draws.

As in fit_model.

progressbar default: True

Deprecated since version 0.1.0: It has no effect: the curves are the posterior of the mean function, computed without new random draws.

As in fit_model.

use_binned default: True

Deprecated since version 0.1.0: It has no effect: the curves are the posterior of the mean function, computed without new random draws.

As in fit_model.

sample_kwargs default: None

Deprecated since version 0.1.0: It has no effect: the curves are the posterior of the mean function, computed without new random draws.

As in fit_model.

predictive_seed default: None

Deprecated since version 0.1.0: It has no effect: the curves are the posterior of the mean function, computed without new random draws.

As in fit_model.

**pymc_kwargs

Deprecated since version 0.1.0: It has no effect: the curves are the posterior of the mean function, computed without new random draws.

As in fit_model.

inplace default: True

If True (default), write the results to adata.varm and return None; otherwise return (profile_dfs, diagnostics_df).

profiles_key default: 'dsvg_profiles'

Prefix for three adata.varm tables (n_genes x (n_bins + 1)), one per {"mean", "ci_low", "ci_high"}, plus a f"{profiles_key}_diagnostics" table of per-gene sampler diagnostics and f"{profiles_key}_beta" (n_genes x n_bsplines, the posterior means of the spline coefficients, for diffsvg.tl.cluster_curves with by="profile"). With inplace=False that table is profile_dfs["beta"].

Returns:

None or tuple[dict[str, pandas.DataFrame], pandas.DataFrame]