daler / metaseq

Framework for integrated analysis and plotting of ChIP/RIP/RNA/*-seq data
https://daler.github.io/metaseq
MIT License
87 stars 36 forks source link

Fixes bug where colormaps would be unordered #14

Closed grmwld closed 9 years ago

grmwld commented 9 years ago

When generating a smart_colormap, if vmin is positive, zeropoint become negative. This cascades into generating the new cmap from a list containing the following values: [0, <0, 1] This list being unordered causes an exception when trying to save the figure:

File "/opt/anaconda21/lib/python2.7/site-packages/matplotlib/colors.py", line 731, in _init self.N, self._segmentdata['red'], self._gamma) File "/opt/anaconda21/lib/python2.7/site-packages/matplotlib/colors.py", line 471, in makeMappingArray "data mapping points must have x in increasing order") ValueError: data mapping points must have x in increasing order

This commit just changes zeropoint to it's absolute value, ensuring that it is contained between 0 and 1

daler commented 9 years ago

Thanks!