satijalab / seurat

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

Warning: Layer counts isn't present in the assay object; returning NULL #8938

Open jianguotao opened 1 month ago

jianguotao commented 1 month ago

I was able to use the fastMNN integration back in February, and now it's reporting errors when I run it. Same data, the R package used to be like 5.0? it seems to have been automatically upgraded to 5.1.0

sce.big_QC1_LV An object of class Seurat 21903 features across 6266 samples within 1 assay Active assay: RNA (21903 features, 2000 variable features) 5 layers present: counts.GSM4677820_Sp7_cKO, counts.GSM4677821_WT, data.GSM4677820_Sp7_cKO, data.GSM4677821_WT, scale.data 4 dimensional reductions calculated: pca, tsne, umap, integrated.cca

FastMNN

sce.big_QC1_LV <- IntegrateLayers( object = sce.big_QC1_LV, method = FastMNNIntegration, new.reduction = "integrated.mnn", verbose = FALSE )

Warning: Layer counts isn't present in the assay object; returning NULL

CarlCoyle32 commented 1 month ago

I am also seeing this error when running IntegrateData.

LaurensV1000 commented 1 month ago

I have the same error.

scs298 commented 1 month ago

me as well

cole-aifi commented 1 month ago

I'm seeing this when using TransferData

marcoco90 commented 1 month ago

Used Transferdata yesterday with no problem. Today I run the same commands on the same samples and got that error message as well

kmshort commented 1 month ago

I'll add a "me too" to this, for IntegrateData. I have 3 seurat5 objects which I'm tring to integrate. SelectIntegrationFeatures works, PrePSCTIntegration works, FindIntegrationAnchors works, but during IntegrateData, I get the

Warning: Layer counts isn't present in the assay object; returning NULL

The SCT and RNA layers in the source objects both have "counts" layers. The resulting integrated object has an integrated assay that only has 'data' and 'scale.data' layers. It has 3000 features and 3000 variable features. The integrated object also has SCT and RNA assays, and they contain 'counts', 'data' and 'scale.data' layers.

So the warning is real, and the integrated object's 'integrated assay' has no counts.

regards, Kieran

feanaros commented 1 month ago

me too

BDXH-FY24 commented 1 month ago

me too

silgoni17 commented 3 weeks ago

Me too

aimutishammy commented 3 weeks ago

Same

hanhyebin commented 2 weeks ago

I also need help with this.

sergio-rutella commented 2 weeks ago

Ditto!

AntoniaChroni commented 2 weeks ago

I get the same error message: Warning: Layer counts isn't present in the assay object; returning NULL when seurat_obj <- IntegrateData(anchorset = anchors, normalization.method = "SCT", verbose = TRUE). Is this related to the Seurat v5 vs4 that stores data in layers (and not as ‘slots’)? BTW I am using SeuratObject_5.0.2 and Seurat_4.4.0 .

Any insights on what's going on?

umutcakir commented 2 weeks ago

Me too when I am using TransferData

zhoujiaqi704 commented 1 week ago

same when using IntegrateData

anitasalamon commented 4 days ago

I also got this error

HOKYOUNGWWW commented 4 days ago

Me too

pedrodcb commented 3 days ago

@AntoniaChroni I think so. I was getting this warning too when using the Azimuth package and thanks to your comment I downgraded SeuratObject to version 5.0.1 : install.packages("https://cran.r-project.org/src/contrib/Archive/SeuratObject/SeuratObject_5.0.1.tar.gz", repos=NULL, type="source") and everything seems to be working now.

rpisalive commented 2 hours ago

@AntoniaChroni I think so. I was getting this warning too when using the Azimuth package and thanks to your comment I downgraded SeuratObject to version 5.0.1 : install.packages("https://cran.r-project.org/src/contrib/Archive/SeuratObject/SeuratObject_5.0.1.tar.gz", repos=NULL, type="source") and everything seems to be working now.

May I ask what version of seurat are you using? My Seurat version is 5.1.0 and it showed me the error: Error: package ‘SeuratObject’ 5.0.1 was found, but >= 5.0.2 is required by ‘Seurat’ when I downgraded SeuratObject to 5.0.1. I wanted to try Seurat 4.4.0 like @AntoniaChroni suggested but my SeuratObjects are all V5. Currently, I am also experiencing the "Warning: Layer counts isn't present in the assay object; returning NULL" problem and it seems downgrading SeuratObject to 5.0.1 the only feasible solution for me.

pedrodcb commented 1 hour ago

@rpisalive yes, I'm using version 4.4.0 just like @AntoniaChroni so I can't speak for versions above that. I've noticed another issue that comes up however upon downgrading. It's with the FeaturePlot() function and it's similar to the one described here: #2507. Basically, upon subsetting a Seurat object and running UMAP() on it again, DimPlot() returns the correct UMAP for the subset but FeaturePlot() doesn't. It returns the UMAP for the full object, as if the UMAP reduction was not updated on the latter. Yet DimPlot() detects it. This issue goes away for me if I upgrade SeuratObject to v. 5.0.2 OR if I downgrade it to v. 4.1.4. It is of course also solved by doing what @AlisonCole did on the issue referenced above:

This is resolved if I give the RunUMAP command a different output name and specify this in the FeaturePlot command:

RunUMAP(newdata, dims = c(1:10), reduction.name = 'umapNew')
FeaturePlot(newdata, 'nFeature_RNA', reduction = 'umapNew') 

Just wanted to let people know of this here.