From: Axel Kohlmeyer (akohlmey_at_vitae.cmm.upenn.edu)
Date: Mon Apr 17 2006 - 10:50:38 CDT

On Mon, 17 Apr 2006, Margaret Shun Cheung wrote:

MC>
MC> Dear Axel,
MC> Thank you very much for the syntax. I think this is what I'd
MC> like to have.
MC> Thank you for reminding to check "update selection every frame".

dear margaret,
 
MC> I wonder how I can write these results that only include the water into a
MC> file. Thank you.

you have to create a script for that. please have a look at
the mailing list archives, there might be some examples.

generally, from a given selection $sel1 (created in a scriptfile)
you can do '$sel1 writepdb some_filename.pdb' (or $sel1 writexyz etc.)
to output the structure in the selection to a file. now you basically
have to create the selection, loop over the timesteps and do
$sel1 frame $n
$sel1 update
$sel1 writepdb "some_file_$n.pdb"

or use somthing more fancy as shown in:
http://www.theochem.rub.de/~axel.kohlmeyer/cpmd-vmd/part6.html#chap8_sect4

see the section below for how to loop over a trajectory
and elsewhere in the pages is an example for how to look
at trajectories with changing numbers of atoms (as VMD does
not support this natively (yet).

best regards,
    axel.

MC> Sincerely,
MC> Margaret
MC>
MC> On Sat, 15 Apr 2006, Axel Kohlmeyer wrote:
MC>
MC> > On Sat, 15 Apr 2006, Margaret Shun Cheung wrote:
MC> >
MC> > MC>
MC> > MC> Dear VMD wizards,
MC> >
MC> > MC> I am struggling with the tcl syntax (VMD tkconsole).
MC> > MC> I'd like to select water molecules between two residues in a trajectory
MC> > MC> (eg 100 frames).
MC> > MC>
MC> > MC> The "within 5 of protein" seems to only select waters around proteins. But
MC> > MC> how could I identify water molecules that are enclosed between two or more
MC> > MC> residues?
MC> >
MC> > you can easily combine multiple conditions, e.g.:
MC> >
MC> > water and ((within 5.0 of residue 4 5) and (within 5.0 of residue 20))
MC> >
MC> > please see the user's guide for more details on the selection syntax.
MC> > remember to activate 'Update selection' or it will stick to the first
MC> > selection and also please note the subtle difference between 'residue'
MC> > - which is unique but always renumbered starting from 0 - and 'resid'
MC> > which is the number from the initial structure (e.g. pdb / psf file)
MC> > - which which can be useful if you have multiple peptides with the
MC> > same sequence in your system.
MC> >
MC> > best regards,
MC> > axel.
MC> >
MC> > MC> Thank you very much for your help!
MC> > MC> Sincerely,
MC> > MC>
MC> > MC> Margaret S. Cheung,
MC> > MC> Ph. D. Postdoctoral Fellow,
MC> > MC>
MC> > MC> ------------------------------------------------------------
MC> > MC> Room 2117 Tel: (301) 405-4892
MC> > MC> Inst. for Phys. Sci. & Tech. Fax: (301) 314-9404
MC> > MC> University of Maryland http://glue.umd.edu/~mscheung
MC> > MC> College Park, MD 20742-2431 email: mscheung_at_ipst.umd.edu
MC> > MC> ------------------------------------------------------------
MC> > MC>
MC> >
MC> > --
MC> > =======================================================================
MC> > Axel Kohlmeyer akohlmey_at_cmm.chem.upenn.edu http://www.cmm.upenn.edu
MC> > Center for Molecular Modeling -- University of Pennsylvania
MC> > Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
MC> > tel: 1-215-898-1582, fax: 1-215-573-6233, office-tel: 1-215-898-5425
MC> > =======================================================================
MC> > If you make something idiot-proof, the universe creates a better idiot.
MC> >
MC> >
MC>
MC> Margaret S. Cheung,
MC> Ph. D. Postdoctoral Fellow,
MC>
MC> ------------------------------------------------------------
MC> Room 2117 Tel: (301) 405-4892
MC> Inst. for Phys. Sci. & Tech. Fax: (301) 314-9404
MC> University of Maryland http://glue.umd.edu/~mscheung
MC> College Park, MD 20742-2431 email: mscheung_at_ipst.umd.edu
MC> ------------------------------------------------------------
MC>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.