satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.31k stars 920 forks source link

Error: 'RNA' is not an assay when using VlnPlot and FeaturePlot #8833

Closed vayac closed 7 months ago

vayac commented 7 months ago

I read the RDS file and try to make a violin plot but got the error Error: 'RNA' is not an assay

It worked last week but somehow it does not work now. Is there a format change recently? How to solve the problem?

samuel-marsh commented 7 months ago

Hi,

Can you please post the full code you are running and the output of the following (replaced with your object name):

> pbmc
An object of class Seurat 
13714 features across 2638 samples within 1 assay 
Active assay: RNA (13714 features, 2000 variable features)
 3 layers present: counts, data, scale.data
 2 dimensional reductions calculated: pca, umap

Best, Sam

vayac commented 7 months ago

toAnalyseSerObj An object of class Seurat 0 features across samples within 0 assays Error in UseMethod(generic = "VariableFeatures", object = object) : no applicable method for 'VariableFeatures' applied to an object of class "Assay5" Error during wrapup: cannot get a slot ("slots") from an object of type "NULL" Error: no more error handlers available (recursive errors?); invoking 'abort' restart

Seems there's some problem with when reading RDS?

samuel-marsh commented 7 months ago

Ya something appears to be wrong with the object you are trying to read in. I would check how it was created and re-create it or if downloaded try re-downloading it.

Best, Sam

vayac commented 7 months ago

I tried. But the Umap and clustering was slightly different although the parameter was the same. All our analysis was based on the original one and it's nearly published. We just need to check some gene distribution and it's not working anymore. That's so crazy sad...

samuel-marsh commented 7 months ago

I would try restoring environment to as close as possible to date when you performed analysis to see if that helps.: https://posit.co/blog/migrating-from-mran-to-posit-package-manager/

jiangldu commented 1 month ago

have you solved it yet? I also met the same problem when even running in the Docker container.

vayac commented 1 month ago

have you solved it yet? I also met the same problem when even running in the Docker container.

Yes. I think it's the different R version problem. It solved as I pick the right R version.