From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Tue May 04 2010 - 07:40:37 CDT

On Tue, May 4, 2010 at 7:50 AM, Maxim Paliy <maxim.paliy_at_gmail.com> wrote:
> Dear Axel and John,
>
> Sorry for bothering you, I have a  couple of follow-up questions:

dear maxim,

> Ultimately what I try to achieve is:
> 1) to color a trajectory  (possibly with changing number of atoms)
>  according to some property of interest for each atom (e.g. energy) that
> varies along the trajectory,
> and that  is read from an external file (e.g. pdb, hopefully from the
> same file as the frames are read from) .

using .pdb files for this is pretty much abuse of the file format.
in general, i would recommend against .pdb as it has a lot
of limitations and custom programs easily write incorrectly
formatted .pdb files. that sometimes work and sometimes don't.

> 2) to produce a movie using MoviMaker plugin (or by some other means)
>
> For now, I mimic changing number of atoms  in my PDB f or XYZ by
> assigning some unrealistic off-screen coordinates
>  to those  atoms that are not needed in a given frame.
> However, it seems that  I cannot read in my property of interest even
> through the "occupancy" or "beta"
> fields of  the PDB file - these fields do not change from frame to frame.

that is the way how VMD works.

> The only things that seem to change are x,y,z and  user (user1, user2
> user3)?

and vx, vy, vz. yes. these are currently the only per timesteps
properties supported by VMD.

> Is this correct? Of course  if this is so, one can read the "user"
> values from a separate file  and assign them to
> each frame separately using something like this:
> set sel [atomselect top all]
>  for {set i 0} {$i < $numframes} {incr i} {
> $sel  frame $i
> $sel set user $my_vector
> }
>
> However, I wonder,  Is there a way  to copy e.g.  values from beta field
> to  to the "user"  field immediately
> during the reading of the frames?

no. there is a hack in the current lammps molfile plugin
to remap data fields, but you have to map those properties
to vx, vy, vz as these are currently the only additional per timestep
fields that are supported by the molfile plugin API.

there are plans to revamp the API, but it depends on
time availability of people that work on this, and that
is limited, as there are many valid projects that need
attention in VMD.

> If not, then multiple molecules approach, that you suggested earlier,
> seems  the way to achieve  1) , but I'm not sure  how to make it work
> for 2), together with Moviemaker?
> I do not see right away how (other that diggin in the code)
> to ask moviemaker to loop through multiple molecules.
> It has an option  "user Defined Procedure". Is this a way to go?

what moviemaker does is pretty much a glorified GUI around
a few simple loops. if you are happy with snapshot or internal
tachyon rendering, all you need is to write a short script to
generate the images and then call the movie compression tool.
this can be done with about 10 lines of VMD/tcl code.

cheers,
    axel.

> Thanks a lot in advance for your suggestions,
> Maxim
>
>
>
>
>
> On 5/3/2010 5:47 PM, Axel Kohlmeyer wrote:
>> On Mon, May 3, 2010 at 3:46 PM, John Stone <johns_at_ks.uiuc.edu> wrote:
>>
>>> Hi,
>>>  VMD is currently designed such that it is assumed that atom counts
>>> and atomic element do not change over the course of simulation.  This
>>> allows VMD to significantly optimize various graphics and analysis
>>> operations by taking advantage of this.  If you want to load simulations
>>> like you describe into VMD, you will need to load each of the frames as
>>> a separate molecule, and then use the "multimolanim" plugin to animate
>>> them etc.
>>>
>> actually, there is now a second option. if one uses the latest alpha/beta
>> version of VMD or installs the corresponding version of the topotools
>> plugin from here:
>> http://sites.google.com/site/akohlmey/software/topotools
>>
>> there there is a new command:
>> topo readvarxyz  filename.xyz
>>
>> this generate a dummy molecule that is able to represent all
>> as many particles of each atom type as are in the whole trajectory.
>> it will then read and pad the trajectory with dummy atoms. via
>> a selection "user >0" one should then be able to see only
>> those atoms that are in each original frame. the drawback of
>> this version is that bonds are not preserved (to massively reduce
>> memory consumption) and you have to use dynamic bonds.
>> ... or use multimolanim ;)
>>
>> cheers,
>>      axel.
>>
>>
>>
>>> Cheers,
>>>  John Stone
>>>  vmd_at_ks.uiuc.edu
>>>
>>>
>>> On Mon, May 03, 2010 at 10:10:58AM -0400, Maxim Paliy. wrote:
>>>
>>>> Dear VMD experts.
>>>>
>>>> What is the best way to produce an animation, where
>>>> the number of atoms and their names  change between the frames?
>>>>
>>>> I try to read the frames from a multi-frame pdb or xyz files that I
>>>> make  in my simulation.
>>>>
>>>> However, it seems, VMD  gets the idea about the number and the names of
>>>> atoms present
>>>> from the FIRST frame only.
>>>>
>>>> is the there a way to change this?
>>>>
>>>> Thanks a lot in advance for any suggestions,
>>>> Maxim
>>>>
>>> --
>>> 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
>>>
>>>
>>
>>
>>
>
>

-- 
Dr. Axel Kohlmeyer    akohlmey_at_gmail.com
http://sites.google.com/site/akohlmey/
Institute for Computational Molecular Science
Temple University, Philadelphia PA, USA.