# Visualising gene expression across cell type and conditions in one plot, in Single Cell Sequencing data

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.

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:

library(Seurat)

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).

• 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 – Charles Jan 15 '19 at 9:50
• You probably need to make the plotting device bigger – TimStuart Jan 15 '19 at 14:23