Open jairaj-mathur opened 1 year ago
I am encountering consistent convergence issues when trying to fit the dispersion curve using the vst_fit
function in the PyDESeq2 package. These issues occur regardless of whether I use the full design matrix or not.
dds
.dds.vst_fit(use_design=True)
and dds.vst_fit(use_design=False)
.dds.vst()
.I expect the dispersion fitting process to converge properly so that I can proceed with applying the variance stabilizing transformation.
Both attempts to fit the dispersion with use_design=True
and use_design=False
result in warnings and do not converge. Subsequently, when attempting to apply the VST transformation directly using dds.vst()
, another runtime error is triggered:
When using use_design=True
:
/home/vjsanchez/miniforge3/envs/pydeseq2/lib/python3.10/site-packages/pydeseq2/dds.py:363: UserWarning: The dispersion trend curve fitting did not converge. Switching to a mean-based dispersion trend.
self._fit_parametric_dispersion_trend(vst=True)
When using use_design=False
:
Fitting dispersions...
done in 20.00 seconds.
/home/vjsanchez/miniforge3/envs/pydeseq2/lib/python3.10/site-packages/pydeseq2/dds.py:381: UserWarning: The dispersion trend curve fitting did not converge. Switching to a mean-based dispersion trend.
self._fit_parametric_dispersion_trend(vst=True)
Error upon calling dds.vst()
:
/home/vjsanchez/miniforge3/envs/pydeseq2/lib/python3.10/site-packages/pydeseq2/dds.py:333 in vst
self.layers["vst_counts"] = self.vst_transform()
/home/vjsanchez/miniforge3/envs/pydeseq2/lib/python3.10/site-packages/pydeseq2/dds.py:435 in vst_transform raise RuntimeError("Fit the dispersion curve prior to applying VST.")
RuntimeError: Fit the dispersion curve prior to applying VST.
Thank you for your assistance!
Sorry for the delay @victorsanchezarevalo, it seems like you are indeed having problems with the parametric fit. Try using dds.vst(fit_type = 'mean')
Solved, Thank you very much!
Is your feature request related to a problem? Please describe. vst doent have 'local' as a fitType option
Describe the solution you'd like If vst could also have local as an option, that would be great
Describe alternatives you've considered Alternatively, I just import my code into R and do it from there