From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Jul 04 2006 - 23:11:56 CDT

Adrian,
  You can run those commands in either the VMD text console,
the TkCon window (Extensions->VMDTkCon),
in a script file that you "source" or "play", etc. If you haven't
gone through the VMD tutorials yet, now would be a good time as
it will help you become familiar with these things. Going through
the VMD tutorials and visiting the Tcl web site will be helpful.

Yes, you can rename any atoms to anything you like, even if the
name didn't previously exist in the trajectory.

Let us know if you have more questions..

  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Jul 05, 2006 at 12:07:57PM +0800, Adrian Koh wrote:
> Hi John,
>
> Thanks for your reply. Please pardon me if this is a silly question...
> But I kept seeing replies suggesting a series of commands to achieve an
> action. How do I get it done in VMD (Windows version)? Do I type in
> the commands in a text file, save it as script.vmd, and then do "File
> --> Load State" in the VMD Main window?
>
> Could similar actions be achieved by just using the available forms in
> the VMD Main window?
>
> Finally, if the name I intended to use for renaming do not exist in the
> trajectory file in the first place, could a new name be created and then
> renamed in a portion of the molecule? For instance, if my original
> trajectory files only consists of names "Pt" and "Frz", would it be
> possible for me to rename part of the molecule to "Ni"? (this could be
> already in your reply but apparently, I did not quite understand the
> script :)).
>
> Thanks!
>
>
> Best Regards,
> Adrian.
>
>
>
> John Stone wrote:
> >Adrian,
> > Yes, if you rename any atom, it is immediately renamed for all frames,
> >since the atom names are only stored once-per-molecule, not once-per-frame
> >currently. e.g.:
> > set sel [atomselect top all]
> > set oldnames [lsort -unique [$sel get name]]
> >
> > set casel [atomselect top "name CA"]
> > $casel set name foo
> > set newnames [lsort -unique [$sel get name]]
> > puts "oldnames: $oldnames"
> > puts "newnames: $newnames"
> >
> > John
> >
> >On Tue, Jul 04, 2006 at 02:44:28PM +0800, Adrian Koh wrote:
> >
> >>Hi,
> >>
> >>I have with me, an .xyz trajectory file containing two atom names "Pt"
> >>and "Frz", containing 250 frames. Would it be possible to rename a
> >>selected region of the molecule (for instance, sqrt(sqr(x)+sqr(y))>10)
> >>to another name say "Cu", at frame 1, which would then apply to all
> >>other frames?
> >>
> >>Thanks :).
> >>
> >>
> >>Best Regards,
> >>Adrian.
> >>
> >>
> >>--
> >>----------------------------------------------------------------------
> >>This email is confidential and may be privileged. If you are not the
> >>intended recipient, please delete it and notify us immediately. Please do
> >>not copy or use it for any purpose, or disclose its contents to any other
> >>person. Thank you.
> >>----------------------------------------------------------------------
> >>
> >>
> >
> >
> >
> >
>
>
> --
> ----------------------------------------------------------------------
> This email is confidential and may be privileged. If you are not the
> intended recipient, please delete it and notify us immediately. Please do
> not copy or use it for any purpose, or disclose its contents to any other
> person. Thank you.
> ----------------------------------------------------------------------
>

-- 
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/      Fax: 217-244-6078