This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Seurat Dotplot _ How can I have different panels on my doplot?

I'm trying to generate a dotplot like the following one using a seurat object and seurat Dotplot function, Does anyone know how can I generate it? I want to have different panels based on experiment conditions?

enter image description here

dotplot scrnaseq seurat

You can use patchwork to easily combine multiple plots. dot1 <- DotPlot(...) dot2 <- DotPlot(...) dot3 <- DotPlot(...) and then dot1 / dot2 / dot3 or dot1 | dot2 | dot3 for horizontal alignment.

2 answers

You can use the dittoSeq package, which readily interprets Seurat objects and allows you to either use their in-built split.by parameters or to report extra.vars so that you can use standard ggplot2 syntax, e.g.

my_dotPlot <- dittoSeq(SeuratObject, ...., extra.vars = "mouse.type")
my_dotPlot + facet_wrap(~mouse.type)

You can use patchwork R package. You can save your plot into variables and all you have to do is the following:

dot1 <- DotPlot(...)
dot2 <- DotPlot(...)
dot3 <- DotPlot(...)

to draw them vertically above each other:

dot1 / dot2 / dot3

to draw them side by side:

dot1 + dot2 + dot3

Log in to answer this question.