satijalab / seurat

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

error when subsetting seurat object #7100

Closed jhong26 closed 1 year ago

jhong26 commented 1 year ago

Hi, I am getting the following error when subsetting my seurat object. I get the same error when trying to use the subset function. Any input would be much appreciated. Thank you.

sub=SeurObj[,c(1:5)] Error in LayerData<-(object = *tmp*, layer = i, ..., value = value) : 'value' must be a 'matrix' or 'dgCMatrix'

sub=subset(SeurObj, cells = vectorofcellnames) Error in LayerData<-(object = *tmp*, layer = i, ..., value = value) : 'value' must be a 'matrix' or 'dgCMatrix'

Priyadarshini-Rai commented 1 year ago

I am also getting the same error. Though it was working fine few days backs.

Gesmira commented 1 year ago

Hi, thanks for reporting this. Could you share some more info about your object so I can try to reproduce the issue? The output of running SeurObj would be helpful

jhong26 commented 1 year ago

Sure. I have the same issue with multiome and ATAC objects but not RNA:

MultiomeObj An object of class Seurat 257520 features across 61633 samples within 4 assays Active assay: SCT (29942 features, 3000 variable features) 3 layers present: counts, data, scale.data 3 other assays present: RNA, ATAC, GeneActivity 8 dimensional reductions calculated: pca, harmonyPcaRna, umap.rnaharmony, harmony_atac, umap_harmony_atac, lsi, harmony_wnn.umap, spca

ATACObj An object of class Seurat 197224 features across 73359 samples within 2 assays Active assay: ATAC (177617 features, 177617 variable features) 2 layers present: counts, data 1 other assay present: RNA 4 dimensional reductions calculated: lsi, harmony_atac, umap_harmony_atac, umap.atac

RNAObj An object of class Seurat 60186 features across 68969 samples within 2 assays Active assay: SCT (29832 features, 3000 variable features) 3 layers present: counts, data, scale.data 1 other assay present: RNA 3 dimensional reductions calculated: pca, harmonyPcaRna, umap.rnaharmony

Gesmira commented 1 year ago

Have you installed the v5 version of Signac as well? If not, restart R and install like so: remotes::install_github("stuart-lab/signac", "seurat5")

jhong26 commented 1 year ago

this worked for me. Thank you!

Fernandobec commented 1 year ago

Hey, I get the same error when trying to run the FindTopFeatures on my multiome dataset, I did this without problems before installing the v5 and now I get the error: Error in LayerData<-: ! 'value' must be a 'matrix' or 'dgCMatrix' Run rlang::last_trace() to see where the error occurred. I already used the library(Seurat) options(Seurat.object.assay.version = "v5") What could be the problem? Thanks!

ryf0810 commented 1 year ago

Hi, I have same problem, but subset won't go wrong for only sc-RNA dataset. Best

ShanshanHe-44 commented 1 year ago

I also got the same problem. The same code works under previous Seurat version, once I updated to the latest version,it returned this error.

chrarnold commented 1 year ago

Having the same issue here... Any solutions? Seems to be a bug in Seurat v5 without any solution so far?

jgarces02 commented 11 months ago

It's enought with normally re-installing Signac (ie, install.packages("Signac"))