Anders,

* Anders Madsen <mad...@ccs.ki.ku.dk> [2005-06-21 16:33] wrote:
> Dear PyMol users,
> I would like to colour the beautiful
> PyMol molecular surfaces according to
> properties of the atoms involved.
> Has anyone experimented with this?
> 
> E.g. by accessing the coordinates that define
> the surface and assign a colour to each triangle
> involved in the surface mesh?

If you only need to colour it at the resolution of the atoms (as opposed
to individual surface vertices), then you can do so by altering the
B-factor or occupancy values and colouring the structure on those. I
have a script for reading a file of data and applying it to the B-factor
or occupancy. Then you just need to colour using the built-in spectrum
method or using my color_b.py script. See the data2bfactor.py script in:

  http://adelie.biochem.queensu.ca/~rlc/work/pymol

Within that script, four functions are defined:
  data2b_atom
  data2b_res
  data2q_atom
  data2q_res

The "2b" functions alter the B-factor and the "2q" functions alter the
occupancy.  The "_atom" functions are used to apply a value to
individual atoms, while the "_res" functions are used to apply a single
value to the whole residue.

You just need to create a data file that looks like:

A 1 ALA N  data
A 1 ALA CA  data
A 1 ALA C  data
A 1 ALA O  data
A 1 ALA CB  data

etc.  (or omit the chain if not defined in your structure)

or 

A 1 ALA data
A 2 SER data
A 3 PRO data

etc. (again omit the chain if not defined).


Cheers,
Rob
-- 
Robert L. Campbell, Ph.D.                         <r...@post.queensu.ca>
Senior Research Associate                            phone: 613-533-6821
Dept. of Biochemistry, Queen's University,             fax: 613-533-2497
Kingston, ON K7L 3N6  Canada       http://adelie.biochem.queensu.ca/~rlc
    PGP Fingerprint: 9B49 3D3F A489 05DC B35C  8E33 F238 A8F5 F635 C0E2

Reply via email to