From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Mon Jul 27 2015 - 12:31:11 CDT

On Mon, Jul 27, 2015 at 1:16 PM, JeJoon Yeon <sonicturbulent_at_gmail.com> wrote:
> How can I write 'user' field for xyz format files? Does this requires

you cannot.

> additional columns in xyz format? Such as
>
> Si 0 0 0 1
> O 1 1 1 1
> Si 0 0 0 2
> ...
>
> Something like this. Or, is there any example xyz file with 'user' field?

no. the plugin interface that reads the trajectory files has no
support for passing this kind of information along. as i mentioned in
my previous response, this requires writing a Tcl script to read in
the type data after the fact and assign it to the user field. there
should be plenty of informative discussions, examples and pointers
about this topic in the VMD mailing list archives.

>
> Also, I have 10 types of atoms in the xyz file that I want to visualize in
> different colors and size. Does VMD supports user1 ~ user10 or more number
> of user field?

you don't need 10 user fields for that, one is totally sufficient. you
can just store numbers 1 to 10 in it.

axel.

>
>
> 2015-07-27 0:05 GMT-04:00 Axel Kohlmeyer <akohlmey_at_gmail.com>:
>>
>> On Sun, Jul 26, 2015 at 11:17 PM, JeJoon Yeon <sonicturbulent_at_gmail.com>
>> wrote:
>> > Hello
>> >
>> > I have a xyz format file, made up of total 1000 frame and 1761 atoms per
>> > a
>> > frame.
>> >
>> > For the visualization & post processing purpose, I swapped several
>> > atom's
>> > name to the different kind, to distinguish their position and movement
>> > under
>> > specific conditions.
>> >
>> > The position and number of those swapping atoms are different among
>> > frames
>> > to frames. For example, atom #1 can be swapped in first frame, but atom
>> > #20
>> > and #100 can be swapped (while #1 is replaced to original) in the next
>> > frame.
>> >
>> > After the swapping, when I command vmd -xyz file.xyz, something weird
>> > happened. I can't see any of swapped atoms. I changed some Si atoms to
>> > Al or
>> > Mg, but none of Al or Mg were detected during entire frames. I changed
>> > some
>> > O atoms to N and F, but only N is visible, no F were detected.
>> >
>> > More strange thing is, single frame or 10 frame file (which was swapped)
>> > looked perfectly okay. I can see all swapped atoms there. However, only
>> > 1000
>> > frame or 10000 frame files made those problems - swapped Al, Mg, He,
>> > F...
>> > atoms were not visible.
>> >
>> > How can I escape from this situation? I really want to show those
>> > different
>> > atoms.
>>
>> what you observe is a very normal behavior of VMD. VMD was initially
>> conceived for classical MD calculations where the type and
>> connectivity of atoms does not change, thus the atom
>> names/types/labels/residues/etc. are only loaded for the very first
>> frame read.
>>
>> if you want to visualize properties that change over the course of the
>> trajectory, you have several options:
>> - load each frame into a different molecule (i.e. split the
>> trajectory) and use the multimol animation plugin to view only one of
>> them at a time
>> - write a Tcl script that parses the xyz file and stores the special
>> atom properties into the "user" field, after it has been read. then
>> use the user field value when creating representations
>> - same as above, but rather than using a user field, store the type
>> information into special lists and then write a Tcl procedure that
>> swap atom types as needed when the vmd frame number is changed.
>> connect the second proc to the animation loop via the Tcl trace
>> command
>> - write a script that transforms your .xyz trajectory, so that it is
>> properly "padded" that it contains all required atom types in their
>> maximal required counts in all frames and then just map the existing
>> trajectory to it and place all "empty" atoms at a coordinate that is
>> not visible in your visualization (the topotools plugin has a command
>> to do something similar on the fly).
>> - use a different visualization program that has different performance
>> vs. storage tradeoff than VMD
>>
>> axel.
>>
>>
>> >
>> > Thanks
>>
>>
>>
>> --
>> Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0
>> College of Science & Technology, Temple University, Philadelphia PA, USA
>> International Centre for Theoretical Physics, Trieste. Italy.
>
>

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.