Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution: object 'CRsparse_colSums' not found raised after upgrading to Seurat v5.0.1 #8202

Open
dcollins15 opened this issue Dec 18, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@dcollins15
Copy link
Contributor

After upgrading to Seurat/SeuratObject v5.0.1 users who also have Azimuth and/or Signac installed may encounter the following error: object 'CRsparse_colSums' not found when trying to run colSums or rowSums on any dgCMatrix. This in turn breaks quite a bit of Seurat's basic functionality.

To resolve the issue, re-install the TFBSTools package from source and then open a fresh R session:

BiocManager::install("TFBSTools", type = "source", force = TRUE)

If you're able to run the following snippet without raising errors, then the problem has been fixed:

library(Matrix)

colSums(m)
TFBSTools::colSums(m)
colSums(m)

The issue was not triggered by any changes to Azimuth or Seurat directly — rather it is caused by upgrading the Matrix package beyond v1.6-1.1 while the TFBSTools package is already installed. Since Azimuth and Signac both depend on TFBSTools, and SeuratObject v5.0.1 requires Matrix to be at least v1.6-3, upgrading to Seurat/SeuratObject v5.0.1 with either package installed triggers the issue.

The underlying problem appears to be related to S4 method caching for the TFBSTools package. In the case that users installed the package before upgrading Matrix to v1.6-3 the method lookup for dgCMatrix gets resolved to include CRsparse_colSums somewhere along its call stack. Since R caches these lookups at compilation time, the method lookup cached for TFBSTools does not change when Matrix is updated and ends up with a bad reference to a nonexistent function (CRsparse_colSums). Re-installing TFBSTools from source forces the package to recompile and the S4 method caches to update, resolving the issue.

@dcollins15 dcollins15 added the bug Something isn't working label Dec 18, 2023
@dcollins15 dcollins15 pinned this issue Dec 18, 2023
@dcollins15 dcollins15 changed the title Error: object 'CRsparse_colSums' not found raised after upgrading to Seurat v5.0.1 Solution: object 'CRsparse_colSums' not found raised after upgrading to Seurat v5.0.1 Dec 21, 2023
@sjm0240111
Copy link

Thanks! @dcollins15 . This works for me!

@Dragonmasterx87
Copy link

Dragonmasterx87 commented Jan 24, 2024

This solution worked for me allowing Pando to be compatible with my current seurat/signac environments. Thanks @dcollins15 !

@Cimorgh-IT
Copy link

Thanks, it worked for me.

@GerardoZA
Copy link

Thank you!
This also worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants