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:


Modeling with PyMOL


 

Saving with transformed coordinates

Here is a simple script that saves the molecule with coordinates from the current orientation.
(invoke it with 'run save_transformed.py' and type the new save_transformed.py command thereafter).

Paulo Martel


 

Translate or rotate individual objects

There is a "translate" function similar to "rotate", the docs for these don't exist yet, because the implementation isn't finished. However, feel free to use them in the following forms:

translate vector,object-name,state
   (vector needs to be something like [x,y,z])

   translate [1,0,0],pept

rotate axis,angle,object-name,state
   (axis can be either the letter x,y,z or a 3D vector [x,y,z])

   rotate x,90,pept
   rotate [1,1,1],10,pept

Warren DeLano


 

Moving one segment relative to the rest

This means moving two parts of one object into different directions. The easiest way to do this is to split the objects and then use the rotate command.
EXAMPLE:
split.pml

Warren DeLano


 

Split states to objects

There is also a new command in the 0.95 series:

   split_states object-name
which will spread a PDB "biological unit" (or any multi-state object -- including SD files) over a series of independent objects. This makes it possible to interact with such objects more naturally than with "all_states = 1".
Warren DeLano


 

Altering secondary structures:

Examples:

 alter A/10:34/, ss='H'
 alter A/35:40/, ss='L'
 alter A/41:60/, ss='S'


 

Altering van der Waals radii

Example:

alter (elem Fe),vdw=1.8
rebuild
(The value for Fe is wrecked in PyMOL at the moment, so running the above line might be a good idea).
Warren DeLano


 

Altering atom coordinates

Example:

alter_state 1,(pdb1cse),x=x-10.0 
The latter section can contain formulae involving at least the xyz coordinates, lots of constants and the (+-*/) operators.


 

Deleting bonds

Select the bond using Ctrl-right-click, then either

unbond pk1,pk2
or hit Ctrl-D.
Warren DeLano


 

Converting D- to L- amino acids

The inversion function was changed in version 0.95 to take advantage of multiple picked atoms. To invert a center, Ctrl-middle-click to pick the center atom as pk1 and two stationary atoms as pk2 and pk3. Then type Ctrl-E to invert.

Warren DeLano


 

Adding disulfide bonds

You can use the "bond" command to attach them:

bond 24/sg,26/sg
bond 56/sg,99/sg

unpick
(unpick will hide the bond baton which gets displayed.)
Additionally, the residue names can be changed for bonded cysteines:
alter cys/,name='CYX'
or for specific residues
alter 24+26+56+99/,name='CYX'

Warren DeLano


 

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


 

Protonating ligands

If your ligands come in with valid valencies and formal charges, PyMOL's h_add command can protonate ligands. (NOTE that there is a minor technical hiccup with SD-files which are loaded by default as immutable "discrete" objects.) Suffice it to say that in order to make changes to the chemical structure, an object must be loaded with the "discrete" flag set to zero.
Unfortunately, much of the molecular editing stuff remains to be documented. Here's an example sequence, but I'm not sure it will help to much...as indicated in the manual, this is immature functionality with some major gaps. Attach in particular is very limited...

# show valences
set valence=0.05

# load cysteine fragment
fragment cys

# remove hydrogens
remove (hydro)

# edit gamma S
edit cys////sg

# add hydrogen
attach H,1,1

# add planer, trivalent nitrogen onto C terminus
edit cys////C
attach N,3,3

# edit that nitrogen
edit (elem N and neighbor cys////C)

# attach a tetrahedral methyl (note random position)
attach C,4,4

# here's an example of adding a whole residue from the library
edit cys////N
editor.attach_amino_acid("pk1","ace")

# now restore missing hydrogens (note that the names are off...)
h_add

Warren DeLano


 

Superposition of two molecules

Using pair_fit requires that you specify a set of paired atoms in each structure. Fortunately, you no longer have to specify each pair separately, so long as the ordering is the same in each selection (almost always true).

pair_fit ( trna10 and resid 10:15 and name P ), ( ref4 and resid 10:15 and
name P )
Another example:
pair_fit prot1///11-26/CA, prot2///34-49/CA
would superimpose prot1 on prot2 using C-alphas from residues 11-26 in prot1 and 34-49 in prot2.
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