satijalab / seurat

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

addModuleScore error and general errors #8830

Closed jimena2 closed 2 weeks ago

jimena2 commented 2 months ago

I would like to addModuleScore to my R object. If I use my default assay of integrated, then I get errors that my features are not present in my object

If I switch to RNA assay as my default, I get the following error: Error inGetAssayData(): ! GetAssayData doesn't work for multiple layers in v5 assay. Runrlang::last_trace()to see where the error occurred.

I've tried the function on another R object and it works, however I cannot get it to work with my current object and am unsure why.

It works for this one:

Screenshot 2024-04-27 at 11 27 07 PM

does not work for this one:

Screenshot 2024-04-27 at 11 27 44 PM

I also am not sure why I have layers present like "scale.data.mock2.1" in my monkeypox.integrated object, this becomes an error when I attempt to access the data at: rownames(monkeypox.integrated@assays$RNA$counts) where it makes me pick either counts.mock2.1 or counts.mkpx2.2, but am unsure which one to use in the context of calculating DEGs and running string DB. How do you know when to use which?

longmanz commented 2 weeks ago

Hi, After integration please consider JoinLayers() to merge all your subsets together and then run LayerData() to access your count data or normalized data. Please also make sure you are using Seurat v5 and follow the corresponding correct vignette (https://satijalab.org/seurat/articles/integration_introduction). GetAssayData() is deprecated in Seurat v5.

In addition, please do not use integrated assay to perform any downstream analysis. And note that the integrated assay no longer presents in Seurat v5.