From: Roman Petrenko (rpetrenko_at_gmail.com)
Date: Mon Feb 22 2010 - 17:28:19 CST

i have a script exactly for this purpose:
https://bmiwiki.cchmc.org/index.php/Tutorial_on_VMD_scripting#vmd_select.tcl

you can write your own based on this one if you want.

On Mon, Feb 22, 2010 at 4:45 PM, John Stone <johns_at_ks.uiuc.edu> wrote:

>
> Hi,
> Yes, you can do this, however since a DCD file must contain a
> consistent set of atoms, you'll get atoms in the resulting file that
> may have originally started within 5A and ultimately drift beyond that
> point by the end of the trajectory. If you make no special effort to
> create a selection that incorporates the "within 5" results for every
> frame, you'll also get "holes" in your trajectory where you are missing
> some of the atoms within the 5A distance. Depending on whether or not
> this matters to you, you could either just use a "within" selection in the
> File->Save Coordinates menu, subsequently writing a new trajectory, or
> you could write a Tcl script that computes the set of all water atoms that
> ever enter within 5A of the solute, and use those results to save out the
> new trajectory.
>
> Cheers,
> John Stone
> vmd_at_ks.uiuc.edu
>
> On Mon, Feb 22, 2010 at 03:39:54PM -0600, snoze pa wrote:
> > Dear VMD users,
> >
> > I did a NAMD simulation and want to remove all water molecule which
> > are more than 5A away from the main protein. Is it possible to do it
> > through a tcl script which can remove all water molecule in DCD file
> > and retain only water molecules which are only 5A away from the
> > protein.
> >
> > Thank you
> > s
>
> --
> NIH Resource for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> Email: johns_at_ks.uiuc.edu Phone: 217-244-3349
> WWW: http://www.ks.uiuc.edu/~johns/ <http://www.ks.uiuc.edu/%7Ejohns/>
> Fax: 217-244-6078
>

-- 
Thanks,
Roman Petrenko