From: Sahu, Subin (
Date: Wed Apr 27 2016 - 11:05:04 CDT

Dear VMD users,

I'm trying to find number of Hydrogen bonds for a particular oxygen atom in
my system and I found that "hbonds" package and "measure hbonds" gives a
very different results. The "measure hbonds" gives smaller value compare to
the "hbonds". Could anyone help me understand why is it so? I will really
appreciate your help.


# using hbonds package
mol load psf cons.psf dcd cons.dcd
set sel1 [atomselect top "index 487"]
set sel2 [atomselect top "name OH2 and not index 487"]
package require hbonds
hbonds -sel1 $sel1 -sel2 $sel2 -dist 3.6 -ang 30 -outfile hbondsWW.dat

#using measure hbonds
set nframes [molinfo top get numframes]
for {set f 0} {$f<$nframes} {incr f} {
    molinfo top set frame $f
    set sel1 [atomselect top "index 487"]
    set sel2 [atomselect top "name OH2 and not index 487"]
    set hb [measure hbonds 3.6 30 $sel1 $sel2]
    set acc [lindex $hb 0]
    set n [llength $acc]
    puts $outFile "$f \t $n"
mol delete top