Advanced colouring

From CUC3
Revision as of 11:08, 20 August 2008 by import>Csw34
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

You can do all sorts of weird and wonderful colouring with Pymol - but the syntax is slightly cryptic. You can find some examples on the Pymol Wiki here and here.

As an example - say you have the AMBER topology files for a small drug molecule which has been parametrised in two different ways, and you would like to compare the partial atomic charges on each molecule. Firstly - you'll need to load the structures into Pymol. For topology files, you first need to define the topology object, and then load the coordinates in.

Defining the topology object for each:

load OTV_bcc.top , OTVbcc
load OTV_resp.top , OTVresp

We now need to load the coordinates for each topology into the appropriate object. For a charge comparison, it makes sense to use the same coordinates for both topologies:

load min1.rst , OTVbcc
load min1.rst , OTVresp

You should now see both structures. Once you have altered their appearance to your satisfaction, you need to do the colouring. Partial charge is contained in the .pc array. For example, you can select all atoms with partial charge greater than 0.1 using:

sele pc. > 0.1 

You could use this approach to sequentially select sets of atoms and colour them manually, but the spectrum command saves you a lot of work:

cmd.spectrum("pc.", 'red_white_blue', selection="all");

This shades atoms in the selection (object) 'all in a spectrum from red, through white, to blue - by the value of pc..