satijalab / seurat

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

Unable to find features in Seurat object when making Dotplot #7266

Closed Y-CBob closed 1 year ago

Y-CBob commented 1 year ago

Dear experts in the field:

I am having trouble in using the DotPlot() function provided in Seurat package to make dotplot.

When I ran this code today that used to work pretty well:

DotPlot(seurat.subset1, features = c("Il1b"), group.by = "treatment")

This error kept popping up: Warning: Found the following features in more than one assay, excluding the default. We will not include these in the final data frame: Il1b Error in FetchData.Seurat(object = object, vars = features, cells = cells) : None of the requested variables were found: Il1b In addition: Warning message: In cells.idents["NA"] <- names(x = which(x = is.na(x = Idents(object = object)[cells]))) : number of items to replace is not a multiple of replacement length

My seurat object is an object with 4 assay slots being: (1) RNA sequencing reads (2) Hashtag reads (3) feature barcoded antibody reads (4) SCTransformed RNA reads

I have double checked to make sure that the default assay of the seurat object is set to be SCT and that gene is included in the SCTransformed dataset.

When I make a violin plot with a very similar code:

VlnPlot(seurat.subset1, features = c("Il1b"), group.by = "treatment")

The plot is made without any warning.

I am really confused because the exact same code has worked 5 hours ago but now it has stopped working. Any comments, suggestions and advice are highly appreciated!

Bob

Y-CBob commented 1 year ago

I redid the subset of the seurat object and the problem is solved. I guess I am still confused but don't care what happened anymore...