Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featureplot works but Dotplot does not #9705

Open
Y-CBob opened this issue Feb 24, 2025 · 1 comment
Open

Featureplot works but Dotplot does not #9705

Y-CBob opened this issue Feb 24, 2025 · 1 comment

Comments

@Y-CBob
Copy link

Y-CBob commented Feb 24, 2025

Hi everyone,
I was trying to just make a very simple dotplot with the Dotplot function
R environment is 4.22 and the version of Seurat package is 4.1.1
The Seurat object is SCTransformed

So this is what I ran:
GOI <-c("Ccl17", "Hsp90aa1", "Rhoc")
DefaultAssay(seurat.obj)<-"SCT"
DotPlot(seurat.obj, features = GOI, group.by = "compare")+RotatedAxis()

and this is the warning I got:

Warning: Found the following features in more than one assay, excluding the default. We will not include these in the final data frame: Ccl17, Hsp90aa1, Rhoc
Error in FetchData.Seurat(object = object, vars = features, cells = cells) :
None of the requested variables were found: Ccl17, Hsp90aa1, Rhoc
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

On the other hand, if I run a very similar code but making Featureplots:

GOI <-c("Ccl17", "Hsp90aa1", "Rhoc")
DefaultAssay(seurat.obj)<-"SCT"
FeaturePlot(seurat.obj, features = GOI)

No warning will be shown and the plots will be generated successfully.

I wonder what might be the reason of such a discrepancy and what might be the solution.
I am deeply perplexed and I desperately need help...

Thank you!

@mhkowalski
Copy link
Contributor

Based on the warning, it seems like the features you are requesting may not be in the SCT assay.
Can you try the following and check if the features are in the SCT assay?

grep("Ccl17", rownames(LayerData(seurat.obj[['SCT']], layer="data")))

Otherwise I will look into reproducing this issue, it would be great if you could try to provide a reproducible example using pbmc_small as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants