My software notes

September 18, 2012

[PyMOL] side-by-side comparison of 3 electrostatic surface potentials

Filed under: pymol/ molmol — kpwu @ 2:22 am
Tags: , , , ,

Here is an example using “grid mode” provided in PyMOL to show the charged states of a protein (PDB entry: 1Z66) at pH 4 (left), 7 (center) and 11 (right).  PyMOL script is attached after the figure.

First,  the potential maps at three pH states have to be generated. I used APBS web server combined with PROPKA to get  calculated pH-dependent potentials (.dx files).

Then I load 1z66.pdb and load all 3 .dx files. Draw first protein with one of the potentials. After that, turn on the grid mode and then duplicate pdb object twice.

Last, assign the potentials to duplicated objects. The electrostatic surface views at 3 pH states can be shown easily!

I really like the grid mode in PyMOL!  No need to use any image editor to assemble 3 potential views. No worry of sizes of molecules if generated separately.

Tips of “grid mode” can be found in my earlier post: [PyMOL] grid mode.

Steps to “Draw the electrostatic surface” can be checked at my earlier post, too.

=======pymol log.pml =================

load 1z66.pdb
load 1z66-pH4.dx, emap_pH4
load 1z66-pH7.dx, emap_pH7
load 1z66-pH11.dx, emap_pH11
set grid_mode, on
cmd.show_as(“surface” ,”1z66″)
ramp_new elvl1, emap_pH4, [-5,0,5]
set surface_color, elvl1, 1z66,
ramp_new elvl2, emap_pH7, [-5,0,5]
set surface_color, elvl2, obj01,
ramp_new elvl3, emap_pH11, [-5,0,5]
set surface_color, elvl3, obj02,
bg_color white
ray 600
png 1z66.png

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”.

Create a free website or blog at