refinery-platform / heatmap-scatter-dash

Interactive visualizations for differential expression
MIT License
25 stars 1 forks source link

Option to scale and center counts #113

Open mccalluc opened 6 years ago

mccalluc commented 6 years ago

From Geoff:

One motivating example for centering/scaling is 2 genes that behave similarly (i.e. go up/down) to the various conditions, but, at baseline, there's a lot of one and only a little of the other in the cell. The color intensities would be different between these 2 rows based on high vs low counts, but people are often interested in groups of genes that behave similarly (could mean the genes belong to the same cellular pathway).

I believe centering/scaling is done as stated in the scale doc (https://stat.ethz.ch/R-manual/R-devel/library/base/html/scale.html) I linked to (pasting sections here): If center is TRUE then centering is done by subtracting the column means (omitting NAs) of x from their corresponding columns If scale is TRUE then scaling is done by dividing the (centered) columns of x by their standard deviations if center is TRUE, and the root mean square otherwise.

In the example I gave above, you would actually want to center/scale by rows (not columns). Anyway, all of that to say -- is this possible in Plotly?

mccalluc commented 6 years ago

Folks in core emphasized row-scaling.

mccalluc commented 6 years ago

Covered by #167... except I want to disable/grey-out log scale if either the original or derived data includes negative values.

mccalluc commented 6 years ago

@gmnelson or @scottx611x : I think that having one control depend on the state of another could be confusing, and hard to implement. As an alternative, get rid of the separate "Center and Scale" section, and instead add to the "Scale" menu. It currently has the choices

Add to those a third option

This would apply a linear scale on the heatmap and the axes, and would additionally scale and center the data. Sound ok?