I am trying to generate the lfcshrinkage using apeglm and it gives me the following error:
> resApeglm <- lfcShrink(dds, coef=2, type="apeglm")
Error in optimHess(par = init, fn = nbinomFn, gr = nbinomGr, x = x, y = y, :
non-finite value supplied by optim
Assuming that the dispersion is causing issues with the lfcshrinkage estimation, I have used ashr and that worked fine. But want to understand why the optimization step failed when I used apeglm ?
Please get used to provide command lines/code and if possible a MRE.
I got the same issue. Please let me know if you get solved it.
While understandable in its motivation, posts like this do not help. The issue at hand is still not reproducible. Please provide anything to debug. We neither know what data you're running, nor the full code or even the DESeq2 and Bioconductor versions. Providing a representative dataset would help, so does code and sessionInfo, for example via a reprex.
I have the exact same problem. I was using DESeq2 1.24.0 with R 4.0.2 before and everything worked fine. Recently I updated to R4.3.0 and DESeq2 1.40.1 and get the same error with data and code which was working fine before. The error seems to be not specific for apeglm as there are reports for other packages as well. In addition, the error pops up only after some time during the LFC shrinkage using apeglm but not ashr.