Closed JihedC closed 4 years ago
Hi Jihed,
Not a member of the Dev team but hopefully this helps. So your example code isn't attempting to do the same thing as the DotPlot in the Vignette you linked which is likely the issue.
In the Vignette:
DotPlot(immune.combined, features = rev(markers.to.plot), cols = c("blue", "red"), dot.scale = 8, split.by = "stim") + RotatedAxis()
Specifically, the key is the split.by
argument. In the Vignette they splitting by the condition from metadata "stim".
You are splitting by "orig.ident" which isn't doing the same thing. If you change split.by
to be whatever you have named that information in your metadata slot does that solve the issue?
Best, Sam
Hi @samuel-marsh ,
Thanks for your quick reply!
I have tried to change the split.by
argument by sample
which is a metadata column indicating whether the cell is coming from an heterozygous or an homozygous sample. And it still doesn't work. :(
DotPlot(test, features = c("Tcf7", "Cd3e"), cols = c("blue", "red"), dot.scale = 8, split.by = "sample") + RotatedAxis()
I tried the to split for the violin plot and it works nicely also with split.by = "origine.ident"
. I don't know why it's not working.
Best,
Jihed
Hi, you can try to use "-" instead of " " in your cluster name. A cluster name with any "" will result in grey dots (seems a bug...).
Thanks for pointing this out , we will fix (@timoast)
I am facing the same problem described above. Did anybody come up with a way to fix it? @satijalab
This should be fixed in the development version of Seurat. To install the development version of Seurat, please see the instructions here.
Thanks!
Dear @timoast, dear @mojaveazure,
I'm posting my issue to this one, since I feel it's closely related to this previous bug.
I am on Seurat Version 4.0.3 and when I plot gene expression using DotPlot()
and split by two different experimental conditions, I get grey dots for some of the clusters. Upon closer inspection, I believe that a "+"
symbol in cluster names might be the cause of this, similarly as the "_"
symbol caused this issue for OP.
Thank you and keep up the great work!
I am still facing this issue. I tried replacing "_" with "-" in the labels on the y axis and it didn't work. What is the solution to this very annoying issue? :(
Dear all, I am too facing the same issues.
I am using Seurat ver ‘4.0.4’.
Here is the code I am using:
DotPlot(object = comb6, features = c("Tcf7l2", "Lef1", "Pygo2", "Tle1", "Ctnnb1", "Axin2", "Gsk3b"), group.by = "mycells", split.by = "ages", cols = c("red", "blue", "green", "orange", "purple"))
Has anyone worked out a solution to the problem? I would love to know. Been at it since a day now :P Thanks a lot.
Dear all, I am too facing the same issues.
I am using Seurat ver ‘4.0.4’.
Here is the code I am using:
DotPlot(object = comb6, features = c("Tcf7l2", "Lef1", "Pygo2", "Tle1", "Ctnnb1", "Axin2", "Gsk3b"), group.by = "mycells", split.by = "ages", cols = c("red", "blue", "green", "orange", "purple"))
Has anyone worked out a solution to the problem? I would love to know. Been at it since a day now :P Thanks a lot.
I could not solve the bug but I just went ahead with an alternate visualization of plotting the data in facets instead of the split.by option. The grouped data was plotted in facets. Let me know if you need the code for it.
Dear all, I am too facing the same issues. I am using Seurat ver ‘4.0.4’. Here is the code I am using: DotPlot(object = comb6, features = c("Tcf7l2", "Lef1", "Pygo2", "Tle1", "Ctnnb1", "Axin2", "Gsk3b"), group.by = "mycells", split.by = "ages", cols = c("red", "blue", "green", "orange", "purple")) Has anyone worked out a solution to the problem? I would love to know. Been at it since a day now :P Thanks a lot.
I could not solve the bug but I just went ahead with an alternate visualization of plotting the data in facets instead of the split.by option. The grouped data was plotted in facets. Let me know if you need the code for it.
Yes please. This would be so very helpful for anyone else facing the same issues. :) I can inform on how I get a long so that others can see a solution. Thanks a lot.
Dear all, I am too facing the same issues. I am using Seurat ver ‘4.0.4’. Here is the code I am using: DotPlot(object = comb6, features = c("Tcf7l2", "Lef1", "Pygo2", "Tle1", "Ctnnb1", "Axin2", "Gsk3b"), group.by = "mycells", split.by = "ages", cols = c("red", "blue", "green", "orange", "purple")) Has anyone worked out a solution to the problem? I would love to know. Been at it since a day now :P Thanks a lot.
I could not solve the bug but I just went ahead with an alternate visualization of plotting the data in facets instead of the split.by option. The grouped data was plotted in facets. Let me know if you need the code for it.
Yes please. This would be so very helpful for anyone else facing the same issues. :) I can inform on how I get along so that others can see a solution. Thanks a lot.
This is the code for the plot that provides an alternate visualization -
replace <- Vectorize(function(x) {
gsub("_"," ",x)
})
_DotPlot(Seuratobject, features = c(< gene names you want to include>), group.by= "subclass", dot.scale = 30) + RotatedAxis() + labs(y="Class", x = "Genes") + theme(axis.text=element_text(size=13)) + scale_y_discrete(labels = replace) +theme(panel.grid.minor = element_blank(),panel.grid.major = element_line(colour = "gray",linetype = "dashed", size=0.35), panel.border = element_rect(colour = "black", fill=NA, size=2))+ facet_grid(~ unique(Seuratobject@meta.data$condition))
Hi, you can try to use "-" instead of " " in your cluster name. A cluster name with any "" will result in grey dots (seems a bug...).
Could you kindly help me understand how to do that? I tried changing the label names and it did not help.
Hi, I had the same problem earlier, and my code below worked well. So if you split your dataset, you need a multidimensional vector of the color panel.
x1 <- c("Pink", "Blue") x2 <- c("Pink", "Red") panel <- data.frame(x1, x2)
top10 = top10[!duplicated(top10$gene),] select_genes_all = split(top10$gene,top10$cluster) select_genes_all
dotcluster <- DotPlot(object = merge.sp, features=select_genes_all, split.by = 'stim', cols = panel) + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=0.5, size = 10.5))
Here is my sample figure. I hope it helps.
Hello, I am using Seurat since few weeks now and I found it great! I would like to compare the gene expression of clusters I have identified after integration of data from a control and a treated samples. Dotplot would be great to have a normalized gene expression per cluster but I can't make It work as in the example here
This is the code :
and this is the output
I would like to have a different color for the control and the stimulated but I can't get it to work. Can someone help me?
Jihed