From: Axel Kohlmeyer (
Date: Wed Nov 30 2005 - 09:22:16 CST

On Wed, 30 Nov 2005, Michel Espinoza-Fonseca wrote:

ME> Dear all,


ME> I've been trying to calculate the presence or absence of a specific
ME> hbond within my trajectory. Unfortunately, I haven't succeeded. I'm
ME> using the following script, but is not working:
ME> set outfile [open hbonds.txt w]
ME> set nf [molinfo top get numframes]
ME> set D [atomselect top "resid 54"]
ME> set A [atomselect top "resid 23"]
ME> for {set i 0} {$i<$nf} {incr i} {

here you need to add:

     $D frame $i
     $A frame $i

how else should the measure command know which
frame to take the coordinates from? if you
have a more complicated selection, you may
also need to add '$D update $i; $A update $i'
to recompute the selection.


ME> set hbonds [measure hbonds 3.0 25 $D $A]
ME> puts $outfile "Frame $i, $hbonds"
ME> }
ME> close $outfile
ME> When I run my script, I get that this hbond exist in all frames! And when I visualize the same frames on VMD, they don't exist. I would like to know if any of you have any idea, or if I'm skipping something important to successfully get the presence of hbonds (for sure I'm missing something!)
ME> Thanks a lot
ME> Michel

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.