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

FindNeighbors Error #7993

Closed
s-e-h opened this issue Nov 9, 2023 · 9 comments
Closed

FindNeighbors Error #7993

s-e-h opened this issue Nov 9, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@s-e-h
Copy link

s-e-h commented Nov 9, 2023

Dear Satijalab,
have run
I have recently updated my Seurat to Version 5.0.0 and have been getting this error every time I have tried to run the FindNeighbors() function:

SO <- FindNeighbors(SO, dims = 1:5)
Computing nearest neighbor graph
Computing SNN
Error in validObject(.Object) :
invalid class “Graph” object: superclass "mMatrix" not defined in the environment of the object's class

My Matrix Package is version 1.6-2

For reference:

sessionInfo()
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

I saw there was an issue similar to this in 2021 but that had been resolved. Any help with this would be greatly appreciated.

@s-e-h s-e-h added the bug Something isn't working label Nov 9, 2023
@shanshenbing
Copy link

shanshenbing commented Nov 9, 2023

Get the same error. The error is correlated with #4445. Hope for help. Finally, I re-instal Matrix 1.6-1.1 will solve the bug. I was inspired by #7986.
you can try:
devtools::install_version("Matrix",version = "1.6-1.1")

@sinanugur
Copy link

Downgrading Matrix version may help, for example to 1.5_3

@s-e-h
Copy link
Author

s-e-h commented Nov 9, 2023

@shanshenbing this worked, thanks very much for the help!

@shanshenbing
Copy link

Happily know it works.

@ellefeg ellefeg mentioned this issue Nov 10, 2023
@zijianni
Copy link

Encountered similar problem. Seems there is an incompatibility issue between Seurat v5 and Matrix 1.6-2, and it's being reported by multiple users, e.g. here, #7983 , and this issue.

Does Seurat maintainer team have any plan to resolve the conflict?

@ellefeg
Copy link

ellefeg commented Nov 10, 2023

I had the same issue with FindNeighbors and was struggling to downgrade Matrix due to gfortran issues. In case anyone else has the same problem, here's what I did. First confirm you have gfortran installed:

du -sh /usr/local/gfortran/

And then follow the instructions on this post to point R in the right direction. Copy the following into a file called ~/.R/Makevars

FC      = usr/local/opt/gcc/bin/gfortran
F77     = /usr/local/opt/gcc/bin/gfortran
FLIBS   = -L/usr/local/opt/gcc/lib

Restart R and install Matrix:

devtools::install_version("Matrix",version = "1.6-1.1")

I haven't run the whole Seurat pipeline yet but the FindNeighbors step works now.

@longmanz
Copy link
Contributor

longmanz commented Nov 10, 2023

Hi All,
Thanks everyone for reporting this and answering this issue. This is a confirmed issue for Seurat (SeuratObject) when using Matrix 1.6-2 (satijalab/seurat-object#145). Please down-grade your Matrix package back to 1.6-1.1 to avoid this. remotes::install_version("Matrix", version = "1.6-1.1")

@HelloWorldLTY
Copy link

HelloWorldLTY commented Nov 19, 2023

Hi, I cannot resolve thisd question becuase it seems that we cannot use matrix lower than 1.6.3 for seurat:

namespace ‘Matrix’ 1.6-1 is already loaded, but >= 1.6.3 is required

Could you please help me? Thanks.

Update: It seems that this bug has been resolved in Seurat v5.

@Lil-Psilocybe
Copy link

I had the same issue with FindNeighbors and was struggling to downgrade Matrix due to gfortran issues. In case anyone else has the same problem, here's what I did. First confirm you have gfortran installed:

du -sh /usr/local/gfortran/

And then follow the instructions on this post to point R in the right direction. Copy the following into a file called ~/.R/Makevars

FC      = usr/local/opt/gcc/bin/gfortran
F77     = /usr/local/opt/gcc/bin/gfortran
FLIBS   = -L/usr/local/opt/gcc/lib

Restart R and install Matrix:

devtools::install_version("Matrix",version = "1.6-1.1")

I haven't run the whole Seurat pipeline yet but the FindNeighbors step works now.

This was still helpful in 2024!

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

8 participants