From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Mon Oct 13 2008 - 14:25:11 CDT

On Mon, 13 Oct 2008, Suman Chakrabarty wrote:

SC> Hi,
SC>
SC> I want to color all of the atoms (bonds) of a polymer chain based on the
SC> dihedral angle of each bond, e.g. for -C2-C3-C4-C5- portion, C2-C3 bond
SC> will have one color if the dihedral angle is 60 degrees and another if
SC> it is 180 degrees.
SC>
SC> Is it possible to do so by any means?

yes.

a lot of functionality can be added to VMD by
creative tcl scripting. you can compute the dihedral
angles and then you can store the resulting value
in the "user" field and use "User" as colorization
method. see the following URL for an example where
the deviation from an ideal sphere is color coded:

http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-vmd/part3.html#chap5_sect3

please note, that for any realistic system, dihedrals
(or other computed non-integral properties) will
practically never be _exactly_ of a given numerical
value, so one should either assign specific numbers
for ranges of values or just store the computed value
directly and actually see intermediats through the
colormapping.

cheers,
   axel.

SC>
SC>
SC> Thanks,
SC> Suman.
SC>
SC>
SC>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.