From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Fri Jun 29 2012 - 10:26:27 CDT

On Fri, Jun 29, 2012 at 9:57 AM, Wolf Dapp <wolf.dapp_at_googlemail.com> wrote:
> Hi there,
>
> I am struggling with VMD's selection capabilities. I have several frames of
> xyz data. Some atoms have different types in different frames, and I want to
> reflect this in atom size (in VDW representation).
>
> I know VMD does this not automatically (see
> http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/11142.html )
>
> After long googling, I tried to include the following in my startup file:
>
> set num [molinfo top get numframes]
> set sel0 [atomselect top "name Q"]
> mol selupdate 0 0 1                  # **
> for {set i 0} {$i < $num} {incr i} {
>    animate goto $i                  # **
>    $sel0 frame $i                   # **
>    $sel0 update                     # **
>    puts "frame: [$sel0 frame], particles in selection0: [$sel0 num]"
>    $sel0 set radius 0.5
> }
>
> The commands marked with "# **" I tried with and without, in various
> combinations.
>
> The result is that the selection is always empty (in the initial frame,
> there are no atoms of type Q). [I've tried different names as well]
>
> I also tried using pdb input files instead of xyz files, and put a condition
> in the (otherwise unused) "occupancy" field, with a boolean comparison, also
> to no avail.
>
> It seems (also from the GUI output, such as coloring by occupancy, and
> labelling atoms by name) that neither occupancy nor name is updating at all,
> even though "update every frame" is activated.
>
> Is there something I am overlooking or am blatantly doing wrong? Is there a
> better property to use rather than name or occupancy?

you are overlooking the core of what john has been saying.
the atom names in all but the first frame will be ignored.
so your "script magic" will fail. you have two options to
deal with this:

1) split your trajectory into separate files and load each file as a
new molecule.
you can then use the "Multiple Molecule Animation" and "Clone Representations"
plugins (Extensions->Visualization) to turn this into some
visualization close to
what you seem to expect.

2) use the script included in the TopoTools plugin:
http://sites.google.com/site/akohlmey/software/topotools/topotools---documentation#TOC-readvarxyz-file-name-
this requires you to use an up-to-date VMD package and possibly even manually
update the topotools plugin from my homepage.

both approaches have benefits and shortcoming and none is perfect
for your scenario, which is unexpected for the common use case of
VMD (for which it is optimized).

axel.

> I am using "VMD for LINUX, version 1.8.7 (August 1, 2009)" on OpenSuse 11.3.
> Does this matter?

>
> Thanks in advance for any pointers you can give me.
>
> Wolf Dapp

-- 
Dr. Axel Kohlmeyer
akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science and Technology
Temple University, Philadelphia PA, USA.