calour icon indicating copy to clipboard operation
calour copied to clipboard

Robust quantiles

Open mortonjt opened this issue 7 years ago • 5 comments

Would be nice if the heatmap colors were scaled to robust quantiles rather than the extreme values

See seaborn robust parameter http://seaborn.pydata.org/generated/seaborn.heatmap.html

mortonjt avatar Jul 11 '17 22:07 mortonjt

second that. looks very useful

RNAer avatar Aug 07 '17 22:08 RNAer

Its honestly the only reason why I use seaborn anymore. Is there any interest in adding this into calour?

mortonjt avatar Jun 25 '19 03:06 mortonjt

how much code is it? the main obstacle is dev time

RNAer avatar Jun 25 '19 12:06 RNAer

looks like in seaborn what they do is: if vmin is None: vmin = np.percentile(calc_data, 2) if robust else calc_data.min() if vmax is None: vmax = np.percentile(calc_data, 98) if robust else calc_data.max()

so should be a piece of tasty cake :) (main question is how to integrate into the calour heatmap api - what parameter...)

amnona avatar Jun 25 '19 12:06 amnona

seaborn is just doing robust=True for their parameter I think this should be an easy first pass.

Matplotlib also has vmin/vmax parameters, where you can specify the specific quantiles.

P.S. Is midpoint normalize implemented in calour? https://matplotlib.org/users/colormapnorms.html Seaborn seems to have multiple bugs popping up recently and now it can't perform midpoint normalize anymore -- may issue a bug report in the near future.

On Tue, Jun 25, 2019 at 8:59 AM amnona [email protected] wrote:

looks like in seaborn what they do is: if vmin is None: vmin = np.percentile(calc_data, 2) if robust else calc_data.min() if vmax is None: vmax = np.percentile(calc_data, 98) if robust else calc_data.max()

so should be a piece of tasty cake :) (main question is how to integrate into the calour heatmap api - what parameter...)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/biocore/calour/issues/38?email_source=notifications&email_token=AA75VXMZ47A2CBKDO7UAHTDP4IJBJA5CNFSM4DSTQXRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYQEYOA#issuecomment-505433144, or mute the thread https://github.com/notifications/unsubscribe-auth/AA75VXIPIA7DQEZCIE6ZTS3P4IJBJANCNFSM4DSTQXRA .

mortonjt avatar Jun 25 '19 13:06 mortonjt