cellxgene icon indicating copy to clipboard operation
cellxgene copied to clipboard

Feature request: distinguish zeros when plotting

Open slinnarsson opened this issue 1 year ago • 0 comments

Single-cell data is sparse (i.e. there are many zeros), and the difference between not-expressed (zero) and expressed (1, 2, 3, ...) can be highly informative. Currently cellxgene plots data using a colormap that does not distinguish zeros. This makes it often near-impossible to distinguish low expression from no expression.

I suggest to first plot all cells in a light grey shade. This shows the position of every cell, regardless of expression. Then, plot all non-zeros on top, using a perceptually uniform, linear colormap that goes from 1 (assuming integer expression values as in 10x Chromium; otherwise use the lowest non-zero value) to the 99th percentile of the data. Of course plot non-zeros in random order.

The difference is stark, as in the example below showing AQP4 expression in glioblasts in the human developing brain:

image

With the common approach of just plotting zeros as the lowest value in the colormap, it becomes near-impossible to distinguish low expression from no expression.

My group has used this approach for many years and it is really preferable. It could be implemented in cellxgene using a checkbox "Use grey for zeros".

slinnarsson avatar Jun 18 '23 13:06 slinnarsson