From: Axel Kohlmeyer (akohlmey_at_vitae.cmm.upenn.edu)
Date: Wed Oct 12 2005 - 13:34:37 CDT

On Wed, 12 Oct 2005, syma wrote:

SM> Hi,

hi,

SM> I was just wondering if there is a way for me to create a 3d data set with
SM> tcl? The exact problem is:

yes there is.

SM> I have a file containing the resid and centre of mass of every lipid
SM> molecule in contact with protein atoms during a trajectory. So I have this
SM> info for every frame of my trajectory.
SM>
SM> Is there anyway of binning one of the com coordinates (eg z coordinate) for
SM> each frame, so I end up with number of contacts as a function of time and z
SM> coordinate?

please have a look at:
http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-vmd/part6.html#chap8_sect5
which creates a phi/psi histogram from a trajectory.

the main thing is, that you can have a two dimensional array and
you need to compute the proper indexes for the binning. it is
probably more obvious, if you convert the line:

incr data([expr int(($phi + 180.0) * $w)],[expr int(($psi + 180.0) * $w)])

into:

set ix [expr int(($phi +180.0) * $w)]
set iy [expr int(($psi +180.0) * $w)]
incr data($ix,$iy)

regards,
        axel.

SM>
SM> If so please can someone help me get started with some of the code.
SM> Thank you, in advance.
SM>
SM> -Syma
SM>
SM> ***************************************************
SM>
SM> Dr Syma Khalid
SM> Department of Biochemistry,
SM> University of Oxford
SM> South Parks Road,
SM> Oxford
SM> OX1 3QU
SM> U.K.
SM>
SM>
SM>
SM> ***************************************************
SM>
SM>
SM>

-- 
=======================================================================
Axel Kohlmeyer    e-mail: akohlmey_at_cmm.upenn.edu, tel: ++1-215-898-1582
Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.