jbloomlab / dmslogo

draw sequence logos tailored to deep mutational scanning (DMS) data
GNU General Public License v3.0
12 stars 1 forks source link

change colormap so divergent color schemes can be used properly #21

Closed bblarsen-sci closed 1 year ago

bblarsen-sci commented 1 year ago

@WillHannon-MCB @jbloom I am trying to use dmslogo to apply a divergent color scale to a figure. Right now I am using this:

map1 = ValueToColorMap(processed_df['effect'].min(),
                           processed_df['effect'].max(),
                           cmap='BrBG')

The issue is because my effect data are non symmetrical around 0 (range -3 to 0.5) it ends up coloring things incorrectly where values of -0.5 end up being green. I only want green values to be above 0, so that it matches the same colors when this divergent color scheme is used for the functional effects heatmap. Would it be possible to modify the code in ValueToColorMap so that I can correctly apply my color map so the divergent color scale is correctly applied?