From: Mgr. Lubos Vrbka (lubos.vrbka_at_uochb.cas.cz)
Date: Wed May 10 2006 - 05:52:32 CDT

hi,

> I want to monitor water around a certain residue, but my protein is
> drifting
> out of the water box. When I used the selection "water and within * of
> resid
> # ", VMD showed the water molecules within the distance, but only those
> inside the box. When I turn on peridoic cell in the diection protein
> drifting, VMD still wouldn't show those water molecules. Neither did they
> appear on the other side of the water box. Could someone give me some
> advises how to solve this problem?
vmd doesn't support selections across the periodic boundary yet.

you should be able to re-center your whole protein/residue of interest
in the simulation box (ptraj can do it for amber and charmm
trajectories, iirc). so do this if you are not interested in e.g.,
diffusion contstants, etc.

there is also another way. i was facing a similar problem some time ago.
for me, the easiest solution was to create all the boxes surrounding the
simulation box (i.e., the central box + 26 replicas) and to do the
selections in this structure. different replicas have different segment
IDs, so you can then use something like
water and within * of (resid # and segid 0)
water would include all waters from all replicas, but resid would be
taken only from the 'central' residue replica.

of course it is a little bit slower than the normal operation and
requires more memory, but i think there is no other simple way.

if you need an example of the code, check the ColorCoord in the vmd
script library - it contains the tcl routine you will need. you will
also need psfgen and psf/topology files for your simulation.

regards,
lubos

-- 
.....................................................
Mgr. Lubos Vrbka
Center for Biomolecules and Complex Molecular Systems
Institute of Organic Chemistry and Biochemistry
Academy of Sciences of the Czech Republic
Prague, Czech Republic
http://www.molecular.cz/~vrbka
.....................................................