Skip to content

Solution for as_cholmod_sparse and CRsparse_rowSums errors #8202

Description

@dcollins15

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions