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

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

MC>
MC>
MC> Dear Axel,
MC> Thank you very much for the hints and weblinks.
MC> I think this goes where I got confused at the beginning.
MC>
MC> I think I can do
MC>
MC> water and (within 5 of residue 0 to 10)
MC>
MC> at "Selected Atoms" under "Graphical Representations" and that gave me
MC> something in the Display screen.
MC>
MC> But when I go Extensions->TKconsole, and I want to select the citeria
MC> and write into a file, it gave me the following error
MC>
MC> Main console display active (Tcl8.4.1 / Tk8.4.1)
MC> >Main< (150ps) 2 % water and within 5 of reside 0 to 10
MC> invalid command name "water"
MC> >Main< (150ps) 3 %
MC>
MC> I think I am missing something very crucial to understand how things work
MC> in VMD. Please drop me a hint or a website. I went over the tutorials
MC> and I think my learning curve improved a bit at this point.

well, you cannot drop a selection string into a command line and
expect this to work. what you basically have to do is to write
a fully working Tcl (or Python) script and then use the additional
commands as provided by VMD.

please have a look at the VMD user's guide, especially at:
http://www.ks.uiuc.edu/Research/vmd/current/ug/node104.html
that should get you started on the Tcl interface, also
there are a ton of resources at http://www.tcl.tk/

best regards,
   axel.

MC> Thank you very much.
MC> Sincerely,
MC> Margaret
MC>
MC>
MC>
MC>
MC>
MC> On Mon, 17 Apr 2006, Axel Kohlmeyer wrote:
MC>
MC> > On Mon, 17 Apr 2006, Margaret Shun Cheung wrote:
MC> >
MC> > MC>
MC> > MC> Dear Axel,
MC> > MC> Thank you very much for the syntax. I think this is what I'd
MC> > MC> like to have.
MC> > MC> Thank you for reminding to check "update selection every frame".
MC> >
MC> > dear margaret,
MC> >
MC> > MC> I wonder how I can write these results that only include the water into a
MC> > MC> file. Thank you.
MC> >
MC> > you have to create a script for that. please have a look at
MC> > the mailing list archives, there might be some examples.
MC> >
MC> > generally, from a given selection $sel1 (created in a scriptfile)
MC> > you can do '$sel1 writepdb some_filename.pdb' (or $sel1 writexyz etc.)
MC> > to output the structure in the selection to a file. now you basically
MC> > have to create the selection, loop over the timesteps and do
MC> > $sel1 frame $n
MC> > $sel1 update
MC> > $sel1 writepdb "some_file_$n.pdb"
MC> >
MC> > or use somthing more fancy as shown in:
MC> > http://www.theochem.rub.de/~axel.kohlmeyer/cpmd-vmd/part6.html#chap8_sect4
MC> >
MC> > see the section below for how to loop over a trajectory
MC> > and elsewhere in the pages is an example for how to look
MC> > at trajectories with changing numbers of atoms (as VMD does
MC> > not support this natively (yet).
MC> >
MC> > best regards,
MC> > axel.
MC> >
MC> >
MC> > MC> Sincerely,
MC> > MC> Margaret
MC> > MC>
MC> > MC> On Sat, 15 Apr 2006, Axel Kohlmeyer wrote:
MC> > MC>
MC> > MC> > On Sat, 15 Apr 2006, Margaret Shun Cheung wrote:
MC> > MC> >
MC> > MC> > MC>
MC> > MC> > MC> Dear VMD wizards,
MC> > MC> >
MC> > MC> > MC> I am struggling with the tcl syntax (VMD tkconsole).
MC> > MC> > MC> I'd like to select water molecules between two residues in a trajectory
MC> > MC> > MC> (eg 100 frames).
MC> > MC> > MC>
MC> > MC> > MC> The "within 5 of protein" seems to only select waters around proteins. But
MC> > MC> > MC> how could I identify water molecules that are enclosed between two or more
MC> > MC> > MC> residues?
MC> > MC> >
MC> > MC> > you can easily combine multiple conditions, e.g.:
MC> > MC> >
MC> > MC> > water and ((within 5.0 of residue 4 5) and (within 5.0 of residue 20))
MC> > MC> >
MC> > MC> > please see the user's guide for more details on the selection syntax.
MC> > MC> > remember to activate 'Update selection' or it will stick to the first
MC> > MC> > selection and also please note the subtle difference between 'residue'
MC> > MC> > - which is unique but always renumbered starting from 0 - and 'resid'
MC> > MC> > which is the number from the initial structure (e.g. pdb / psf file)
MC> > MC> > - which which can be useful if you have multiple peptides with the
MC> > MC> > same sequence in your system.
MC> > MC> >
MC> > MC> > best regards,
MC> > MC> > axel.
MC> > MC> >
MC> > MC> > MC> Thank you very much for your help!
MC> > MC> > MC> Sincerely,
MC> > MC> > MC>
MC> > MC> > MC> Margaret S. Cheung,
MC> > MC> > MC> Ph. D. Postdoctoral Fellow,
MC> > MC> > MC>
MC> > MC> > MC> ------------------------------------------------------------
MC> > MC> > MC> Room 2117 Tel: (301) 405-4892
MC> > MC> > MC> Inst. for Phys. Sci. & Tech. Fax: (301) 314-9404
MC> > MC> > MC> University of Maryland http://glue.umd.edu/~mscheung
MC> > MC> > MC> College Park, MD 20742-2431 email: mscheung_at_ipst.umd.edu
MC> > MC> > MC> ------------------------------------------------------------
MC> > MC> > MC>
MC> > MC> >
MC> > MC> > --
MC> > MC> > =======================================================================
MC> > MC> > Axel Kohlmeyer akohlmey_at_cmm.chem.upenn.edu http://www.cmm.upenn.edu
MC> > MC> > Center for Molecular Modeling -- University of Pennsylvania
MC> > MC> > Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
MC> > MC> > tel: 1-215-898-1582, fax: 1-215-573-6233, office-tel: 1-215-898-5425
MC> > MC> > =======================================================================
MC> > MC> > If you make something idiot-proof, the universe creates a better idiot.
MC> > MC> >
MC> > MC> >
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> 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.