From: Agarwal, Silvi (
Date: Sat Mar 06 2010 - 11:52:55 CST

Thanks Olaf for solving my problem. it is working now.


From: Olaf Lenz []
Sent: Fri 3/5/2010 2:06 AM
To: Agarwal, Silvi
Subject: Re: vmd-l: pbc in water count

Hash: SHA1


On 03/04/2010 07:07 PM, Agarwal, Silvi wrote:
> I've been trying to analyze the contacts between water and a given
> peptide from my trajectories. I used a Tcl script that can play in vmd.
> Everything went well, except from the fact that VMD is not able to count
> the water molecules around my peptide from the image
> of my periodic box. I search the mailing list and found there is not
> such handling of pbc in VMD. Do you have any suggestions? Can anyone
> share his Tcl script?

If you use VMD 1.8.7 (1.8.6 does NOT have that feature yet) and if it's
enough for you to know how many waters are in a given distance to any
atom of your peptide, then you can simply use "pbwithin" instead of
"within" in the selection. Example:

        water and pbwithin 5 of chain A

will return all waters within 5 Angstrom of the chain A, taking into
account the periodic boundary conditions.
So, as a Tcl script, you could use

        set sel [atomselect 0 "name O and water and pbwithin 5 of chain A"]
        puts "Found "
        puts [$sel num]
        puts " water molecules close to chain A"


- --
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -