From: J. Rui Rodrigues (
Date: Wed Nov 30 2005 - 07:28:41 CST

You must select frame and update selections inside the "for" loop:

for {set i 0} {$i<$nf} {incr i} {
$D frame $i
$A frame $i
$D update
$A update
set hbonds [measure hbonds 3.0 25 $D $A]
puts $outfile "Frame $i, $hbonds"

Rui Rodrigues

Michel Espinoza-Fonseca <> escreveu:

> Dear all,
> I've been trying to calculate the presence or absence of a specific hbond
within my trajectory. Unfortunately, I haven't succeeded. I'm using the
following script, but is not working:
> set outfile [open hbonds.txt w]
> set nf [molinfo top get numframes]
> set D [atomselect top "resid 54"]
> set A [atomselect top "resid 23"]
> for {set i 0} {$i<$nf} {incr i} {
> set hbonds [measure hbonds 3.0 25 $D $A]
> puts $outfile "Frame $i, $hbonds"
> }
> close $outfile
> 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!)
> Thanks a lot
> Michel

J. Rui Rodrigues
Departamento de Química
Faculdade de Ciências e Tecnologia
Universidade de Coimbra
3004-535 Coimbra