Das Erwachen

Bioinformatics

"Python looks to me like the illegitimate spawn of C and BASIC, but then I used to program in 6502 machine code so what do I know ..." (Laurence Pearl, PyMOL user)

 
 

Tips for PyMOL from the PyMOL mailing list

Disclaimer: All the contributions displayed on this page were made by subscribers of the PyMOL mailing list at sourceforge.net and Warren L. DeLano himself. Although i have checked most of the things listed here, i cannot guarantee that everythings works well. I cannot even guarantee that i have understood everything written on this page. Please be cautious.

Kristian Rother

Available Subtopics:


Displaying biochemical Properties

 
 

Selecting secondary structures

Examples:

 select helix, (ss h)
 select sheet, (ss s)
 select loop, (ss l+'')


 

Color by atom type from a script

The "util" module contains a number of functions that color the atoms according to type, with different colors for the C atoms. For instance,

  util.cbay three
in a .pml script will color object "three" by atom type, with the carbon atoms in yellow ("color by atom yellow").

Other functions from ../modules/pymol/util.py are cbag, cbac, cbas, cbap, cbak, cbaw and cbab (grey (carbon), cyan, salmon, purple, pink, white (hydrogen) and slate).
Lieven Buts


 

Displaying double bonds

You can try going into lines mode and turning on the valence display:

hide
show lines
set valence, 0.1
a higher value for valence spreads things out more. I don't know of a way to get the dotted notation.

Michael George Lerner


 

Calculating dihedral angles

The get_dihedral function requires four single-atom selections to work:

get_dihedral prot1///9/C, prot1///10/N, prot1///10/CA, prot1///10/C


 

Adding hydrogen bonds

Regarding H-bonds. There isn't a built-in function yet, but you can show H-bonds between two objects using atom selections so long as hydrogens are present in both molecules. If you don't have hydrogens, you can use h_add on the proteins or provide ligands with valence information and then use h_add.

Two examples are below. For clarity, they draw dashes between the heavy atoms and hide the hydrogens.

EXAMPLE 1: Show hydrogen bonds between protein and docked ligands
EXAMPLE 2: Show hydrogen bonds between two proteins
There is also a script drawing nice hydrogen bonds from Gareth Stockwell

Warren DeLano


 

Assign color by B-factor

Robert Campbell has a color_b.py python script on his PyMOL web page that you can use.
it has a number of options including the selection and two types of colouring schemes (rainbow versus a blue-magenta-red gradient) and two types of binning of the colours (equal number of atoms in each colour or equal spacing of colours along the B-factor range).

See http://biophysics.med.jhmi.edu/rlc/work/pymol to download. There is a script 'data2bfacor' to display arbitrary data assigned to atoms as well.

Robert L. Campbell


 

Polar surface area

For a solvent accessible PSA approximation:

set dot_density, 3
remove hydro
remove solvent
show dots
set dot_solvent, on
get_area elem N+O
get_area elem C+S
get_area all
For molecular PSA approximation
set dot_density, 3
remove hydro
remove solvent
set dot_solvent, off
get_area elem N+O
get_area elem C+S
get_area all
Showing dots isn't mandatory, but it's a good idea to confirm that you're getting the value for the atom dot surface you think you're using.
Please realize that the resulting numbers are only approximate, reflecting the sum of partial surface areas for all the dots you see. To increase accuracy, set dot_density to 4, but be prepared to wait...
Warren DeLano


 

Display solvent accessible surface

Using the surface display mode, PyMOL doesn't show the solvent accessible surface, rather it shows the solvent/protein contact surface. The solvent accessible surface area is usually defined as the surface traced out by the center of a water sphere, having a radius of about 1.4 angstroms, rolled over the protein atoms. The contact surface is the surface traced out by the vdw surfaces of the water atoms when in contact with the protein.

PyMOL can only show solvent accessible surfaces using the dot or sphere representations:

for dots:

show dots
set dot_mode,1
set dot_density,3

for spheres:

alter all,vdw=vdw+1.4
show spheres

Kaushik Raha


 

Displaying the C-Alpha trace of proteins

hide
show ribbon
set ribbon_sampling,1
And if your model only contains CA atoms, you'll also need to issue:
set ribbon_trace,1

Warren DeLano


 

Displaying the Phosphate backbone of nucleic acids

Should you ever want to show the phosphate trace of a nucleic acid molecule:

def p_trace(selection="(all)"):
    s = str(selection)
    cmd.hide('lines',"("+s+")")
    cmd.hide('spheres',"("+s+")")
    cmd.hide('sticks',"("+s+")")
    cmd.hide('ribbon',"("+s+")")
    cmd.show('cartoon',"("+s+")")
    cmd.set('cartoon_sampling',1,"("+s+")")
    cmd.set('cartoon_tube_radius',0.5,"("+s+")")
cmd.extend('p_trace',p_trace)

and then:
p_trace (selection)

Luca Jovine


 

Align proteins with CA fit

If the proteins have significant homology, then you can use the align command:

align prot1////ca,prot2
which will perform a sequence alignment of prot1 against prot2, and then an optimizing fit using the CA positions. I'm not sure if the help text for align got into 0.82, but the next version will definitely have it.
Warren DeLano

 
Rubor : http://www.rubor.de
Post an Kristian Rother: kristian.rother@charite.de

Last modified: Wed Apr 28 07:24:35 CEST 2004