1
$\begingroup$

I want to use the DotPlot function from Seurat v3 to visualise the expression of some genes across clusters. However when the expression of a gene is zero or very low, the dot size is so small that it is not clearly visible when printed on paper. Please is there a possibility to increase the minimum dot size in the DotPlot function to make the dot sizes more visible when printed?

For example, I would like to have a minimum dot size set to be like

in this image

from this publication

Rather than:

this image

from this other publication

Thank you in advance for your helpful hint.

$\endgroup$
4
  • $\begingroup$ You can set the scale using the dot.scale option. This will affect all the points, not only the 0s. $\endgroup$
    – fra
    Nov 8, 2019 at 9:45
  • $\begingroup$ @fra. Thank you but when I increase the dot.scale parameter,only the bigger points really change. The smaller points change only when the dot.scale value is really high and the rest of the image now looks unappealing. $\endgroup$
    – Charles
    Nov 8, 2019 at 12:04
  • $\begingroup$ It would be much easier to answer your question if you provided a reproducible example $\endgroup$
    – jan-glx
    Nov 18, 2019 at 17:38
  • $\begingroup$ Had also been asked on github.com/satijalab/seurat/issues/2297 . $\endgroup$
    – jan-glx
    Nov 18, 2019 at 18:09

2 Answers 2

2
$\begingroup$

Did you try to use DotPlot(..., scale.by = "size")?

In contrast to the default scale.by= "radius", this will link the area (==2*pi*r^2), not the radius, of the circles to the fraction of cells expressing the feature. This corresponds much better to our perception of size and will make differences in low values easier to see.

Reading ?Seurat::DotPlot the scale.min parameter looked promising but looking at the code it seems to censor the data as well.

Since Seurat's plotting functionality is based on ggplot2 you can also adjust the color scale by simply adding scale_fill_viridis() etc. to the returned plot. This might also work for size. Try something like:

DotPlot(...) + scale_size(range = c(5, 10)) # will likely warn about supplying the same scale twice

Apart from this, Seurat's plotting system is not very hackable and I find it much easier to extract the relevant data and plot them myself with ggplot2.

Yet another comment: Your plot with the strong differences looks much more convincing to me wrt. to the marker property of these genes than the cited plot.

$\endgroup$
0
$\begingroup$

You can define your breaks with:

p + scale_size(breaks = c(0, 25, 50, 75))

You can adjust the size of the points with:

p + scale_size(range = c(1,8))     # Note: c(1,6) is the default

For more info, see ??scale_size

$\endgroup$

Your Answer

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

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