-
Notifications
You must be signed in to change notification settings - Fork 915
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
Bug(s) in SpatialDimPlot #6179
Comments
me too! If there is any solution, please let me know |
I've encountered this as well in v4.1.1, while it worked in v4.1.0. It appears to bisect to commit 4024b0c, where the addition of The workaround for me was just to comment out this line. I also tried replacing |
Fix satijalab#6179. If the `ident` column is not present in the data, all colors get filtered out. Only filter colors if this column is non-null.
Hi, I have updated my Seurat to 4.3.0, however, the Luckily, I found a suggestion here. The suggestion fixes the error. My version of the solution is like this: numCluster <- my_seurat_object@meta.data$seurat_clusters %>% unique %>% length
colors = Seurat::DiscretePalette(n = numCluster, palette = "polychrome")
Idents(my_seurat_object) # should be seurat clusters.
# The colors, which is a character vector of different color codes, need the names for the vector.
names(colors) <- Idents(my_seurat_object) %>% levels()
the_ggplot_list <- SpatialDimPlot(
my_seurat_object, # the seurat object here contain only one sample, though it can contain more samples.
images = "my_image_name",
group.by = c("seurat_clusters"),
pt.size.factor = 1.15,
label = TRUE,
label.size = 6,
repel = TRUE,
combine = FALSE,
cols = colors
)
print(the_ggplot_list) If the error could be further investigated by the devolopers, that would be terrific. Otherwise, it would be helpful if the document of Thank you very much for your contribution to the science community. |
I have an alternative trick here, it seems that the SpatialDimPlot still works on the Idents of the Seurat object. Idents(ST.seu) <- ST.seu$group
SpatialDimPlot(ST.seu) |
It's glad to know that SpatialDimPlot works on the Idents of the Seurat object again. |
Thanks for using Seurat! It appears that this issue has gone stale. In an effort to keep our Issues board from getting more unruly than it already is, we’re going to begin closing out issues that haven’t had any activity since the release of v4.4.0. If this issue is still relevant we strongly encourage you to reopen or repost it, especially if you didn’t initially receive a response from us. |
Hi Seurat team,
Thank you so much for your service to the community.
Similar to previous issue #5975 I am unable to use SpatialDimPlot or SpatialPlot with group.by after upgrading to Seurat 4.1.1. The plots appear as unlabeled points no matter which metadata column is used to group the data.
These are critical functions for plotting any type of spatial data so a bug fix would really be appreciated :) Thank you!
The text was updated successfully, but these errors were encountered: