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_modelfor data binned without acondition(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_restproduces 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_restdoes by default there (averaging the two fitted condition curves), and the two need not agree exactly.- Parameters:
- adata
The
AnnDatamodel_setup.binnedwas built from; the write target wheninplaceisTrue.- 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 toadata.varmand returnNone; otherwise return(profile_dfs, diagnostics_df).- profiles_key default:
'dsvg_profiles' Prefix for three
adata.varmtables (n_genes x (n_bins + 1)), one per{"mean", "ci_low", "ci_high"}, plus af"{profiles_key}_diagnostics"table of per-gene sampler diagnostics andf"{profiles_key}_beta"(n_genes x n_bsplines, the posterior means of the spline coefficients, fordiffsvg.tl.cluster_curveswithby="profile"). Withinplace=Falsethat table isprofile_dfs["beta"].
- Returns:
None or tuple[dict[str, pandas.DataFrame], pandas.DataFrame]