From: Josh Vermaas (
Date: Mon Apr 21 2014 - 10:24:57 CDT

Hi Chiara,

The tools that work "out of the box" don't quite give you the level of
detail you are interested in, since I assume you either want to change
the radii by frame or the opacity by frame to give the illusion of
appearing/disappearing. None of the default tools let you do this
easily, however, with a bit of ingenuity, you can write your own script,
as described in the vmdmovie plugin documentation
(, which has an
example on how to change the opacity towards the end. I've included a
simple script that should work for changing the radii over your
trajectory if you choose to do that instead.
-Josh Vermaas

set magicnumber 100 ; #Number of frames you want in total.
set appearingsel [atomselect top "some atomselection text for the
appearing atoms"]
set disappearingsel [atomselect top "some atomselection text for the
disappearing atoms"]
set arad [$appearingsel get radius]
set drad [$disappearingsel get radius]
proc moviecallback { args } {
    global magicnumber
    global appearingsel
    global disappearingsel
    global arad
    global drad
    set frame $::MovieMaker::userframe
    animate goto $frame
    #Resize the radii. I'm trying to linearly interpolate from full size
when it it fully present, to 0.1 when it is absent.
    $appearingsel set radius [vecscale [expr {0.1 + ((0.9 * $frame) /
$magicnumber)}] $arad]
    $disappearingsel set radius [vecscale [expr {1.0 - ((0.9 * $frame) /
$magicnumber)}] $arad]
proc enablemoviecallback { } {
    global magicnumber
    animate goto 0
    trace add variable ::MovieMaker::userframe write moviecallback
    set ::MovieMaker::numframes $magicnumber
proc disablemoviecallback { } {
    trace remove variable ::MovieMaker::userframe write moviecallback

On 04/21/2014 04:21 AM, Chiara Cardelli wrote:
> I actually work with ORAC and I don't
> have dcd files, just pdb files, but if I need them I'm sure I can
> convert them somehow. Anyway, I know how to make a "normal" video with
> video maker, but maybe I have to explain better which is the issue
> (I'm sorry if I wasn't clear, I'm new in this mailing list and I'm
> still just a student).
> In alchemical transformations the molecule which is "appearing" and
> "disappearing" is actually always present in the coordinate files, so
> it is visualized by vmd during the whole trajectory. But its potential
> interaction with the surrounding is switched off at the beginning and
> then gradually switched on, or viceversa, during the simulation. I
> would like to see the molecule gradually appearing from invisible to
> transparent and then visible, while the potential function is
> switching on. This doesn't happen if I just press play, because the
> molecule is always there, altough it is not interacting so it's like
> "invisible" for the rest of the system. Since the alchemical
> transformations are implemented in NAMD, I was wondering if such a
> visualization tool exists for VMD.
> Thanks for helping,
> Chiara
> 2014-04-21 10:36 GMT+02:00 Fotis Baltoumas <
> <>>:
> Dear Chiara,
> I don't have any experience with alchemical simulations. However,
> visualization of results can't be that different from visualization of
> standard MD simulations. Therefore, if your simulation generates a DCD
> trajectory file, you can visualize that in VMD by loading the
> original PSF
> file as a new molecule and adding the dcd file as data.
> You can have NAMD (I assume you work with NAMD) generate a
> trajectory for
> your simulation by using the DCDfile option (and all other related
> ones)
> in your NAMD configuration file. Then, simply use the Play button
> and the
> "movie" of the simulation will commence.
> If you want to make a movie (in AVI, quicktime or whatever) of the
> result,
> there is a Movie Maker plugin in VMD.
> Hope I helped,
> Fotis
> > Is there any way in VMD to visualize an alchemical
> transformation? I mean
> > like recording a video where a molecule is gradually disappearing
> > somewhere
> > (i.e. while its interaction potential with the surrounding is
> switched
> > off)
> > and contemporarily appearing somewhere else?
> >
> > Thank you,
> > Chiara
> >