Difference between revisions of "Advanced colouring"
import>Csw34 |
import>Csw34 |
||
Line 26: | Line 26: | ||
</pre> |
</pre> |
||
This shades atoms in the selection (object) ''''all''' in a spectrum from red, through white, to blue - by the value of '''pc.'''. |
This shades atoms in the selection (object) ''''all''' in a spectrum from red, through white, to blue - by the value of '''pc.'''. |
||
+ | |||
+ | '''NOTE: this will not work if you load in a .pdb as it does not contain charge information!''' |
Revision as of 11:13, 20 August 2008
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.
Shading with a spectrum representing an atomic property
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. For this example. there are three files required - OTV_bcc.top and OTV_resp.top are actually AMBER .prmtop files. I have renamed them .top as this is what Pymol expects. You can force a file format with the load command however. Finally, min1.rst is an amber coordinate file. If you have problems using .rst files, compare them to an equivalent .inpcrd file and check the spacing.
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..
NOTE: this will not work if you load in a .pdb as it does not contain charge information!