Replies: 1 comment
-
|
Possibly related: #8225 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Seurat now use
geom_scattermore()by default to render scatter plots with more than 100,000 cells under the hood (this can be overriden usingraster = FALSE). However, the results can be suboptimal when prioritizing subpopulations with high gene expression on UMAP/t-SNE plots usingorder = TRUE. In these cases, positive cells blend with negative ones, resulting in a grayish and blurry appearance. This is partially due to{scattermore}'s specialized blending algorithm (this has been discussed in exaexa/scattermore#25), which treat all overlapping points the same for blending colors. This behavior is currently hardcoded, and for some reasons the package author has not implemented alternative blending options ingeom_scattermore().To address this, extra efforts are warranted to bend its low-level API, and compatibility with faceting functions would be a great problem. As an alternative,
{ggrastr}can also rasterize specific layers while preserving others as editable vectors. Meanwhile, it can produces clearer, publication-ready results (at the cost of increased time and memory usage). Notably,ggrastr::geom_point_rast()serves as a drop-in replacement forgeom_point()without hassle, when compared withgeom_scattermore()/geom_scattermost().However,
{ggrastr}is much slower than{scattermore}and introduces dependencies like Cairo and ragg. A practical solution would be to offer a backend option:ggrastrfor quality andscattermorefor performance. While specialized packages like{scpubr}may be a better place to address this issue, implementing this flexibility could be a valuable addition to this package.-- Update --
Seems that Seurat has already using
{ggrastr}for rasterizing jitter points inVlnPlot()(as implemented inSingleExiPlot()). It would be nice we could do the same for scatter plots.Codes for benchmarking:
Details
ggrastr::geom_point_rast()(about 22s):benchplot(plot_ggrastr)scattermore::geom_scattermore()(less than 1s):Setting
pointsizeto values other than 0 would slightly increase total time.Beta Was this translation helpful? Give feedback.
All reactions