From: Eduard Schreiner (eduard.schreiner_at_rub.de)
Date: Tue Dec 11 2007 - 07:49:44 CST

Hi Anil,

a script like the one below would do the job.
Before I explain it, let me point some things:

1. This is a quick solution and there might be better ways to do that
2. The script needs an additional file containing all the names for every atom
in every step, let's call it "allcrystalline.name" (actually I took the
first column of the trajectory you sent and removed all "Atom" and "1000")
3. The script is not safe in the sense that it does not check, whether
this additional name file is synchronous to the trajectory.
4. Might be there are some other drawbacks, but it works (at least for me)

#=======================
set molid 0
set nr_atoms 1000
#here I manually set these numbers
puts "number of atoms is set to $nr_atoms"

set nr_fr [molinfo $molid get numframes]
puts "molecule $molid: $nr_fr frames"

set fp [open "allcrystalline.name" r]
#this is the additional file I told about
puts "setting user values for molecule $molid"

for {set j 0} {$j < $nr_fr} {incr j} {
#going through the trajectory
    for {set i 0} {$i < $nr_atoms} {incr i} {
        set name [gets $fp]
#here an entry from "allcrystalline.name" is read
        if { $name == "Na" } { set usr 0 } else {
            if { $name == "Ar" } { set usr 1 }
        }
#and the variable usr is set depending on the name
        set sel [atomselect $molid "index $i" frame $j]
#select the i'th atom in the current frame
        $sel set user $usr
#set the user value for this atom
        $sel delete; unset sel
    }
}

unset j
unset nr_fr
unset fp
unset i
unset name
unset nr_atoms

#====================

After you applied the above script, you can select the coloring according to
the user value, or select the corresponding atoms directly .....

Eddi

On Tuesday 11 December 2007 11:20, Anil Kumar wrote:
> Dear Eddi and all,
>
>
> First, thank you for your reply. Yes I am using graphical interface and I
> checked it after activating the
> 1. Update selection every frame
> 2. Update color every frame.
>
> But unfortunately it did not work. I am attaching my trajectory file with
> this email and I would appreciate if any of you could solve this problem.
>
> Thanks
> Anil
>
> > > On Dec 11, 2007 2:06 PM, Eduard Schreiner <eduard.schreiner_at_rub.de >
>
> wrote:
> > > > Hi Anil,
> > > >
> > > > I assume you are using the graphical interface.
> > > > It sounds like the selection is not updated every frame.
> > > > Thus, activate:
> > > > "Update SelectionEvery Frame"
> > > > and
> > > > "Update Color Every Frame"
> > > > for your selections in
> > > > Graphics -> Representations -> Trajectory
> > > >
> > > >
> > > > Hope this helps.
> > > >
> > > >
> > > > Eddi
> > > >
> > > > On Tuesday 11 December 2007 05:43, Anil Kumar wrote:
> > > > > Dear all,
> > > > >
> > > > > I want to make a movie, in VMD, of a trajectory(xyz coordinate
> > > >
> > > > file)
> > > >
> > > > > which is obtained from MC simulation. Trajectory file has two type
> > > >
> > > > of
> > > >
> > > > > atoms (say A and B). Initial configuration has 10% of A atoms and
> > > >
> > > > 90% of B
> > > >
> > > > > atoms. During the simulation number of A type atoms increases and
> > > >
> > > > number
> > > >
> > > > > of B type atoms decreases. Final configuration has say 80% of A and
> > > >
> > > > 20% of
> > > >
> > > > > B atoms.
> > > > >
> > > > > 1. Now I have given two elemental name for A and B atoms (say Ar &
> > > >
> > > > Na).
> > > >
> > > > > When I visualize this file in VMD. Then color code it shows only
> > > >
> > > > from the
> > > >
> > > > > initial configuration(I mean 10% of particles have color A and 90%
> > > >
> > > > of
> > > >
> > > > > particles have color B.) But it can't visualize the way the number
> > > >
> > > > of A
> > > >
> > > > > particles have increased during simulation.
> > > > >
> > > > >
> > > > > 2. Also, If I take only A type of Atoms in my trajectory file, so
> > > >
> > > > this
> > > >
> > > > > trajectory file contains different number of Atoms in different
> > > >
> > > > frame(As
> > > >
> > > > > number of A type atoms increases during simulation). VMD can't
> > > >
> > > > visualize
> > > >
> > > > > this file.
> > > > >
> > > > > Could you please help me how to visualize above both type of
> > > >
> > > > trajectory
> > > >
> > > > > in VMD.
> > > > >
> > > > >
> > > > > Thanking you in anticipation.
> > > > >
> > > > > With Best Regards,
> > > > > Anil
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > **************************
> > > > > Anil Kumar
> > > > > Research Scholar
> > > > > Theoretical Sciences Unit
> > > > > JNCASR, Bangalore
> > > > > India -560064
> > > > > Phone : 080-22082834
> > > > > Mob. : 09342399856
> > > > > Email:anilk_at_jncasr.ac.in
> > > > > **************************
> > > >
> > > > --
> > > >
> > > > --
> > > >
> > > >
> > > > =====================================================================
> > > >========
>
> Eduard Schreiner e-mail:
> > > > eduard.schreiner_at_theochem.rub.de
> > > > Lehrstuhl fuer Theoretische Chemie Phone: ++49
> > > > (0)234/32-22121
> > > > Ruhr-Universitaet Bochum - NC 03/52 Fax: ++49
> > > > (0)234/32-14045
> > > > D-44780 Bochum
> > > > http://www.theochem.rub.de
> > > >
> > > > =
>
> *************************
> Anil Kumar,
> Graduate Student,
> Theoretical Sciences Unit,
> JNCASR, Bangalore -560064
> India
> Phone : +91 80 2208 2834
> ***************************

-- 
--
=============================================================================
Eduard Schreiner                     e-mail: eduard.schreiner_at_theochem.rub.de
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-22121
Ruhr-Universitaet Bochum - NC 03/52         Fax:   ++49 (0)234/32-14045
D-44780 Bochum                              http://www.theochem.rub.de
=============================================================================