Skip to content

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

@bhavyaac

Description

@bhavyaac

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingclusters-appdocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions