Is your feature request related to a problem? Please describe.
With the switch to formulaic designs in v0.5.0, the ref_level argument of DeseqDataSet was deprecated. As a result, we may encounter cases in which it is not possible to shrink a given LFC coefficient because it does not correspond to a column in the design matrix. C.f. #361.
Describe the solution you'd like
The reference level can actually be set using the following syntax: design = '~ C(condition, contr.treatment(base="B")).
As this requires some knowledge of formulaic's API, we should
Describe alternatives you've considered
It might be possible to update the columns of the design matrix without re-fitting dispersions. Something like
dds.design = '~ C(condition, contr.treatment(base="B"))
dds.formulaic_contrasts = FormulaicContrasts(dds.obs, dds.design)
dds.obsm["design_matrix"] = dds.formulaic_contrasts.design_matrix
And then run the pipeline step by step from dds.fit_LFC().
We could consider implementing a method to achieve this.
Additional context
C.f. the discussion in #361.
Is your feature request related to a problem? Please describe.
With the switch to
formulaicdesigns in v0.5.0, theref_levelargument ofDeseqDataSetwas deprecated. As a result, we may encounter cases in which it is not possible to shrink a given LFC coefficient because it does not correspond to a column in the design matrix. C.f. #361.Describe the solution you'd like
The reference level can actually be set using the following syntax:
design = '~ C(condition, contr.treatment(base="B")).As this requires some knowledge of
formulaic's API, we shouldref_level's deprecation messagelfc_shrink's docstring (and maybe raise a warning whenlfc_shrinkis called on a non-existant coefficient?)Describe alternatives you've considered
It might be possible to update the columns of the design matrix without re-fitting dispersions. Something like
And then run the pipeline step by step from
dds.fit_LFC().We could consider implementing a method to achieve this.
Additional context
C.f. the discussion in #361.