fungenomics / braindex

A web portal for exploring scRNAseq data in the developing brain, including our in-house atlas of the E10-P6 forebrain and brainstem
http://cc-shiny-01.functionalgenomics.ca/braindex/clusters/
GNU General Public License v3.0
0 stars 1 forks source link

Handle all-zero (?) expression rescaling in heatmap #45

Open bhavyaac opened 3 years ago

bhavyaac commented 3 years ago

Although I've specified NA values to be coloured grey in the heatmap (na_col = "#e5e5e5" in pheatmap), there are some genes that still display all-white rows when certain cell types are selected: image (above I've selected Astrocytes, Neurons, and Other, and the gene with an all-white row is Gm37381)

What's weirder is that these same genes don't have all-white rows when I add an extra cell type to the existing choices: image (above I've selected Ependymal, Astrocytes, Neurons, Other, and the same gene Gm37381 is now all blue except for some Ependymal expression)

This behaviour makes me think that the gene has all-zero expression in the first combination of cell types I chose, not NA values. I suspect that the row rescaling in the heatmap has shifted all of the zero values to 0.5 (which is white according to the legend) before plotting.

I want to handle this case by making sure that the expression is not rescaled if the gene has all-zero expression across all cell types chosen - this should hopefully also give better clustering results. (Simply changing the colour of these points and not the values themselves will not take care of possible changes in clustering)

I also want to include a note about the row rescaling taking place in this tab's documentation.

bhavyaac commented 3 years ago

The same gene Gm37381 also causes issues in the joint expression by sample tab - this was documented in #35 . I may want to solve both of these issues in the same update.