Colour UMAP based on expression of multiple genes
Entering edit mode
11 months ago
Ciaran ▴ 20

Hi all,

I was just wondering if anybody had any experience with coloring something like a UMAP made in ggplot based on the expression of multiple genes at the same time? What I want to do is something like the blend function in Seurat featureplots, but with 3 genes / colors instead of 2.

I'm looking to make something like this:

Image 1

Where the colors for the genes combine where there is overlap.

What I've gotten to so far is

ggplot(FD, vars = c("UMAP_1", "UMAP_2", "FOSL2", "JUNB", "HES1"), aes(x = UMAP_1, y = UMAP_2, colour = FOSL2)) +
geom_point(size=0.3, alpha=1) +
scale_colour_gradientn(colours = c("lightgrey", colour1), limits = c(0, 0.3), oob = scales::squish) +
new_scale_color() +
geom_point(aes(colour = JUNB), size=0.3, alpha=0.7) +
scale_colour_gradientn(colours = c("lightgrey", colour2), limits = c(0.1, 0.2), oob = scales::squish) +
new_scale_color() +
geom_point(aes(colour = HES1), size=0.3, alpha=0.1) +
scale_colour_gradientn(colours = c("lightgrey", colour3), limits = c(0, 0.3), oob = scales::squish)

Where FD is a data frame containing the information from the seurat object for the UMAP coordinates and the expression levels of the three genes of interest. All I can get is a plot where the points from one layer obscure those below it, I've tried messing around with the colours, gradients, alpha and scales but I'm guessing I'm doing it the wrong way.

Image 2

If anyone knows of a way to make this work or has any suggestions on something else to try that would be very much appreciated.

visualisation scRNAseq ggplot • 1000 views
Entering edit mode
11 months ago
Ciaran ▴ 20

Just in case anyone was searching for an answer for this in the future, I asked the same question over on StackExchange too and was suggested an answer that worked perfectly for me.


Login before adding your answer.

Traffic: 659 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6