Open FrederickHuangLin opened 1 year ago
I am encountering something similar when running NetCoMi and phyloseq.
"Error in t(beta) : invalid 'lazy' to R_sparse_transpose()"
EDIT: Actually I just realized, if the issue is what I detail below, if you load lme4 before phyloseq that might fix it? you might have to mess with your .RData/workspace to get this to work if your workspace is automatically loading phyloseq on start though.
As you suggested, the solution I have found for this same compatibility issue that reliably works is really just restarting everything. I suspect, but cannot confirm entirely, that there is a daisy-chain of dependencies and loaded name spaces that makes it hard to entirely fix. I think phyloseq loads things that need a different version of Matrix and if it is already loaded, then Matrix is already loaded as a namespace, so attaching Matrix or reloading it from other sources doesn't set to the more recent version thats actually being used. What I have found useful for my personal situation is to save whatever tables are being used as files to the computer itself, then reload them in a different script after starting a new R session with a clear workspace. I also have had success in the past when I encountered this before by progressively unloading every conflicting dependency and then reattaching the package im trying to use that is calling Matrix (so in your case, lme4) so that it re-attaches the right one. This can be very frustrating to figure out. If I remember right, vegan also can do this, but I am not sure if its because I have been using vegan in the same sessions as phyloseq. I think BiocGenerics and things it calls are potentially problematic. I remember having to remove survival as well.
Encountering this same issue, except it is causing R to segfault. Loading other packages before phyloseq doesn't seem to fix it.
Check out his thread. It worked for my setting.
Hi,
I've encountered a rather peculiar software issue involving the
phyloseq
package and thelme4
package when analyzing longitudinal microbiome data. Below, please find a reproducible example that triggers the error:First, when I run the mixed effects model code provided by
lme4
, it works perfectly:The above code runs without issues. However, when I load the
phyloseq
package and then attempt to run the samelme4
code, it results in errors:Even detaching the
phyloseq
package doesn't resolve the issue and leads to a different error message:As of now, the only solution I've found is to restart the R session. Below is my
sessionInfo()
:Also, I using
Bioconductor
3.17.Any insights or advice on resolving this issue would be greatly appreciated.
Best regards,
Huang