From: Axel Kohlmeyer (
Date: Mon Nov 08 2004 - 13:31:35 CST

On Mon, 8 Nov 2004, pl wrote:

hi patrick,

what about: measure hbonds $sel ... ?

you will get lists of indices for donors and acceptors and the
hydrogens involved, which you can then turn into selections
with 'index' and then write them via $sel writepdb.
note than you don't have to use 'index 1 or index 2 ...',
but 'index 1 2' will achieve the same you may get away
with something like this (totally untested):

set all [atomselect $molid {all}]

set idx [measure hbonds 3.0 20.0 $all]
set sel [atomselect $molid \
 "index [lindex $idx 0] [lindex $idx 1] [lindex $idx 2]]

$sel writepdb file.pdb


PL> Hi all,
PL> I desperatly try to select waters that are H-Bonded to DNA along a
PL> trajectory. I want to rewrite a trajectory or serie of pdb files
PL> with these waters only plus my DNA.
PL> Could it be possible to include this in VMD plugins or scripts as this
PL> rather sounds like a common feature for hydration studies.
PL> Maybe something like the getbonds command adapted to H-Bonds
PL> (getHbonds.?.) would be of great help.
PL> I am a talent-less tcl programmer and I am glued with this problem
PL> since a few days now...
PL> Maybe someone has a script for this (I tried to adapt
PL> bridging_waters.tcl) but with no succes for the moment.
PL> Bye all

Dr. Axel Kohlmeyer   e-mail:
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum
If you make something idiot-proof, the universe creates a better idiot.