Code Monkey home page Code Monkey logo

pymol_viridis's Introduction

DOI

pymol_viridis

Script to add viridis and other colorblind-accessible (and perceptually uniform) palettes to PyMOL and viridis to color (C) menus. The default palette for spectrum is set to turbo.

All the new palettes (viridis, magma, inferno, plasma, cividis, turbo) can be used in pymol wherever builtin palettes can be specified, e.g. instead of specifying ... spectrum palette="blue_green" ... , specify ... spectrum="viridis" ....

Just run viridispalettes.py and you are off!

preview with viridis menu

Technical details

New palettes are added to the dictionary pymol.viewing.palette_colors_dict with their common name as key and palette specified as space-delimited string of hex colors (prefix 0x not #) as value.

spectrum uses palette=rainbow by default and is monkey patched to use palette=turbo by default instead.

New menus/menu-options are created where ever spectrum options exist by simply specifying the palette='viridis' to the spectrum invocation. Text is colorized for viridis options by using the \\RGB specification.

The new colormaps are added via their 256-hex colors from bokeh.palettes (not via named colors) to stay as true as possible to the original colormap specifications.

Interpolation (when done) is handled by spectrumany. In the current release (v2.3), this is done linearly in RGB space. In future versions, interpolation can be done in a more perceptual space (Issue in Pymol repo/PR by @speleo3). Since the colormaps here are specified in terms of 256 hex colors, interpolation in RGB will be just fine.

pymol_viridis's People

Contributors

smsaladi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pymol_viridis's Issues

Color by chain menu items (util.color_by_chains()) not working

TypeError: cbc() got an unexpected keyword argument 'pallet' (PyMOL 2.4.2 - Incentive Product)

None of the viridis 'color by chain menu items' not appear to accept the 'pallet=' argument and fail.

$ util.cbc('(all)', 'pallet=viridis')

from the command line ignores the color pallet and results in default chain coloring

$ util.cbc('(all)', pallet='viridis')

TypeError: cbc() got an unexpected keyword argument 'pallet'

$ util.color_by_chains('4d10', pallet='viridis')

AttributeError: module 'pymol.util' has no attribute 'color_by_chains'

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.