Seurat: Dot plot not changing average expression

Created on 30 Jul 2020  路  3Comments  路  Source: satijalab/seurat

Hello everyone,

I'm trying to plot different features from my integrated data set (cells coming from two different seurat objects) using dotplot function. I'm trying to set limits for the scale of gene expression with col.max/col.min but Idk why I'm not able to change them (it's always ranging from 0.0 to 0.6).
Here the code;
DotPlot(IL17_comparisions, features = c("CD44","IL23R","RORA","IL7R","IL2RA","SOX13","CCR6","RORC","IL17A","S100A6","IL18R1","ICOS","BLK","MAF","CXCR6","IL17F"), cols = c("lightgrey","red"), col.min = 0, col.max = 3, group.by = "project.id") + RotatedAxis()

I would like also to recreate an aesthetics like this one from here;
image

Do you know how to change features to a different axis (from x to y axis) and how to include 3 colors in the gradient?

Thank you in advance for your help,

Guillem

Most helpful comment

Setting col.max will clip values larger than that value to the values specified by col.max. It sounds like the max value in your dataset is smaller than the max value you're setting, which is why there's no clipping performed and the scale does not change.

We only allow specifying two colors in the function call. To use more colors, you can use the color scale functions in ggplot2, for example:

library(Seurat)
library(ggplot2)

pbmc_small <- ScaleData(pbmc_small, rownames(pbmc_small))
DotPlot(pbmc_small, assay = "RNA", features = head(rownames(pbmc_small))) +
  scale_color_viridis_c()

To flip the x and y axes use ggplot2::coord_flip():

DotPlot(pbmc_small, assay = "RNA", features = head(rownames(pbmc_small))) +
  scale_color_viridis_c() +
  coord_flip()

Screen Shot 2020-07-31 at 2 10 07 pm

All 3 comments

Setting col.max will clip values larger than that value to the values specified by col.max. It sounds like the max value in your dataset is smaller than the max value you're setting, which is why there's no clipping performed and the scale does not change.

We only allow specifying two colors in the function call. To use more colors, you can use the color scale functions in ggplot2, for example:

library(Seurat)
library(ggplot2)

pbmc_small <- ScaleData(pbmc_small, rownames(pbmc_small))
DotPlot(pbmc_small, assay = "RNA", features = head(rownames(pbmc_small))) +
  scale_color_viridis_c()

To flip the x and y axes use ggplot2::coord_flip():

DotPlot(pbmc_small, assay = "RNA", features = head(rownames(pbmc_small))) +
  scale_color_viridis_c() +
  coord_flip()

Screen Shot 2020-07-31 at 2 10 07 pm

Hi @guillemsanchezsanchez1996 if you want to use manual colors in ggplot2:

DotPlot(object = seuratobject, # your seurat object
        features = feature.plot, #list of genes
        dot.scale = 10, 
        col.min = 0,
        col.max = 2,
        ) + scale_colour_gradient2(low = "#0200ad", mid = "#ffe272", high = "#ff0000") # color scale

Find more here: Pancreas_ductal_scRNAseq

@Dragonmasterx87 @timoast Thank you both for the fast answers. I managed to solve it following your suggestions.

Kind regards,

Guillem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tmccra2 picture tmccra2  路  3Comments

rajasreemenon picture rajasreemenon  路  3Comments

milanmlft picture milanmlft  路  3Comments

RuiyangLiu94 picture RuiyangLiu94  路  3Comments

htc502 picture htc502  路  3Comments