I am using Seurat for my RNAseq analysis and have been using the same code for over a month now (without issues). FindNeighbors gives an error now (out of the blue) and I can't seem to fix it. The data and code are the same as before.
all.integrated <- all.integrated %>%
FindNeighbors(reduction = "harmony", dims = 1:30) %>%
FindClusters(reduction = "harmony", resolution = 0.1) %>%
RunUMAP(reduction = "harmony", dims=1:30)
> 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
I've checked the class and it is a SeuratObject. The only thing that worked yesterday was deleting and re-installing R and R studio (restart R wouldn't help), but now it gives the same error. What to do?
Many thanks!!
I was having the same problem just now. According to this bug report in the Seurat Github page, it looks like the problem is coming from the new version of the Matrix package (1.6.2).
Downgrading to Matrix v1.6.1 resolved it for me: