My software notes

September 11, 2012

[PyMOL] customize spectrum colors

Filed under: pymol/ molmol — kpwu @ 12:29 am
Tags: ,

Saw a post at recent Pymol mailing list and found the nice example of “spectrumany” at PymolWiki.

Here is the example I created using “spectrumany” to show customized spectral colors of the example protein TBEV envelope protein “PDBV entry: 1SVB”.

By using the built-in command “spectrum”, one can color the envelope protein in 2 or 3 gradient colors or use the “rainbow” to colorful gradient.

The figure below was drew using command “spectrum count, red_white_blue, all“. (more pymol built-in color schemes are listed at my older post: [pymol] example– coloring surface by b-factor).

After downloding “” and run “”, one can customize gradient colors on his/her target. The example shown at here using command: “spectrumany count, red green blue yellow white, resi 1-395“.

In this pymol script, colors are separated by “space”. For example: red blue cyan white yellow

Note: In a lot of crystal protein structure PDB files, there are a lot of water molecules as well as some heavy metal ions. I found that using “spectrumany count, red green blue yellow white, all” will result in the image below.

All water molecules are colored in white not not shown in the image. The reasons are 1) water are numbered after 400 (421-800) and 2). water H2O is not shown in cartoon mode. When water molecules are presented in “sphere” mode, you can see the water molecules are colored from yellow to white.  In order to make right color gradient schemes (in cartoon mode) either using pymol-provided “spectrum” or the “” script, it better to define the residue ranges (resi xxx-yyy) not use “all”.



  1. This article will assist the internet people for building up new website that consider colors as one more important requirement. I simply wish too giv you a huge thumbs up for your great informatiion you have here on this post.

    Comment by onlinershub — December 23, 2014 @ 7:20 pm | Reply

  2. […] tutorial on coloring a protein cartoon expands on info from a few other blog […]

    Pingback by PyMOL Color By Data – Structural Biology Hints and Tips — April 12, 2017 @ 10:13 am | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: