From: Axel Kohlmeyer (
Date: Fri May 18 2007 - 11:22:27 CDT

On Fri, 18 May 2007, Kailee wrote:

K> Dear all,

dear kailee,

K> into the protein. What I want to do is, I want to know at what time, which
K> gas molecule (ID) get close to a certain distance to the active site? so for
K> example, when one gas molecule become within 5 angstrom to the Fe atom in
K> the active site, the atom ID of that gas molecule and the frame number can
K> be recorded automatically.

K> I looked at the VMD script library but couldn't find similar script
K> available, can I ask has anyone wrote similar script already? or have some

there should be plenty of similar scripts (not to do this specific
kind of analysis, but just to track a property across a trajectory)
that use the kind of framework that you need to step through the
trajectory. what you need to do is roughly:

create a selection for your region of interest eg using
'resname XX exwithin 5.0 of name Fe' as selection string.
open a file, figure out how many frames your trajectory has.
then do a loop over the frame numbers (starting from 0) and
do a
$selvar frame $i
$selvar update
to advance the selection to the next frame and recompute it
and finally do a:
set inrange [lsort -unique [$selvar get resid]]
puts $fp "$i [llength $inrage] $inrange"

and after the end of the loop you have close the file.
then your file will contain for each frame:
the frame number, the number of molecules in range
and a list of their residue ids.

hope that helps,

K> suggestions how to do this? as there might be some better ideas~ any help is
K> appreciated! Thank you.
K> Best regards,
K> Kailee

Axel Kohlmeyer
   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.