After a recent update to the Matrix package, users have encountered issues running Seurat functions that depend on certain Matrix generics. Typically, this results in one of two errors:
Error in irlba(A = t(x = object), nv = n, work = irlba.work, tol = tol) :
function 'as_cholmod_sparse' not provided by package 'Matrix'
OR
Error in .local(x, na.rm, dims, ...) :
object 'CRsparse_colSums' not found
Solution
To resolve the first error, re-install the irlba package from source:
install.packages("irlba", type="source", force = TRUE)
To resolve the second error, re-install the TFBSTools package from source:
BiocManager::install("TFBSTools", type = "source", force = TRUE)
Details
The errors are encountered if either irlba or TFBSTools was installed with Matrix <=1.6-1 and then run with Matrix >=1.6-2. When a package is installed, the definitions for all its S4 classes/methods are cached, including methods from its dependencies (unless they're explicitly included in the package's NAMESPACE using an importClassesFrom directive). In this case, S4 references from Matrix <= 1.6-1 that were cached by irlba and TFBSTools and then dropped in Matrix >= 1.6-2, cannot be properly resolved. For a more detailed discussion on S4 caching and the Matrix package, please checkout this thread.
Re-installing the affected packages from source resolves the issue by refreshing their S4 method caches.
After a recent update to the
Matrixpackage, users have encountered issues runningSeuratfunctions that depend on certainMatrixgenerics. Typically, this results in one of two errors:OR
Solution
To resolve the first error, re-install the
irlbapackage from source:To resolve the second error, re-install the
TFBSToolspackage from source:Details
The errors are encountered if either
irlbaorTFBSToolswas installed withMatrix<=1.6-1 and then run withMatrix>=1.6-2. When a package is installed, the definitions for all its S4 classes/methods are cached, including methods from its dependencies (unless they're explicitly included in the package's NAMESPACE using animportClassesFromdirective). In this case, S4 references fromMatrix<= 1.6-1 that were cached byirlbaandTFBSToolsand then dropped inMatrix>= 1.6-2, cannot be properly resolved. For a more detailed discussion on S4 caching and theMatrixpackage, please checkout this thread.Re-installing the affected packages from source resolves the issue by refreshing their S4 method caches.