Doplot to display 2 metadata variables
1
1
Entering edit mode
8 months ago
Jessica ▴ 10

We are trying to generate a dotplot similar to this:

enter image description here

Specifically, we need to show gene expression within 3 different injection groups (shown by the colored dots on the bottom), side by side and then repeat for each cell type class (top). The only way we have been able to do this is by repeating the gene for each injection, making it difficult to compare between the injections. Has anyone made something similar with the gene only listed once?

single-cell seurat analysis dotpolot • 419 views
ADD COMMENT
3
Entering edit mode
8 months ago
fracarb8 ★ 1.7k

You can create a dummy variable by pasting the cell type and the groups together.

srtobject@meta.data$combined <- paste0(srtobject@meta.data$cellType, "-",srtobject@meta.data$injection_group)
DotPlot(srtobject, your_genes, group.by = "combined") + coord_flip()

Another option is to simply group.by celltype and split.by injection groups.

In both cases, the x axis should be ordered by celltype (venous-injectio1, venous-injection2,....), but if not, you can reorder the factors to the order you need.

ADD COMMENT

Login before adding your answer.

Traffic: 1985 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6