I am new to single cell sequencing data analysis but I have basic programming background in R and python. I want to be able to plot differential expression of two genes, Gene1 and Gene2, across three cell types and across three conditions on one plot. I have followed this tutorial to perform QC and various differential analyses using Seurat package on my data up till now.

My data set is one object, containing information about the three cell types under three various conditions. The metadata slot of my data set contains information about my cell types as well as the conditions under which they are tested. Using the following DotPlot commands I am able to generate separate plots of gene expression with respect to cell type and with respect to condition:

Seurat::DotPlot(object = object, genes.plot = c("Gene1", "Gene2"), plot.legend = TRUE, group.by = "cell_types")

Seurat::DotPlot(object = object, 
        genes.plot = c("Gene1", "Gene2"), plot.legend = TRUE, group.by = "tissue_types" )

For elegant representation of my data, I want to be able to have the information of the following plots into one plot.

I will be very grateful for any hint on how I can proceed to achieve an elegant presentation as well as information about other possible ways to graphically represent gene expression data for publication or presentation purposes.

Thank you in advance for your help.

enter image description here


1 Answer 1


Try using SplitDotPlotGG, this will allow you to color the dots by some additional variable (eg condition).

In your case you would want to do something like this:


SplitDotPlotGG(object = object,
               genes.plot = c("Gene1", "Gene2"),
               plot.legend = TRUE,
               group.by = "cell_types",
               grouping.var = "tissue_types")

This would give a result similar to below (an example from https://satijalab.org/seurat/immune_alignment.html).

enter image description here

  • 1
    $\begingroup$ Thank you very much, it works. However the plot does not appear (plotting space on Rstudio remains blank) when I set plot.legend = TRUE, but the plot does appear without a legend when I set plot.legend = FALSE. How can I proceed to fix this? @TimStuart $\endgroup$
    – Charles
    Jan 15, 2019 at 9:50
  • 1
    $\begingroup$ You probably need to make the plotting device bigger $\endgroup$
    – TimStuart
    Jan 15, 2019 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.