From: Raik Grunberg (raik_at_pasteur.fr)
Date: Mon Nov 05 2001 - 14:46:15 CST

Dear Tom,

I am also interested in coloring residues by changing properties during a
MD playback. Instead of loading in tons of pdb files and writing an own
animation script, wouldn't it be easier to register some coloring
method via add_callback() to be executed whenever the frame is changed:

On principle, it should work like this (version 1.0):
-----------------------
gopython # switch to python, I have no clue about Tcl!

import VMDCallback
 
def test(molid, frame): # define a method
        print "next, please"
 
f2 = test
 
VMDCallback.add_callback('frame',f2) # register the method
------------------------

This prints a very useful message every frame and I would guess it could
be used to change the coloring of each frame. I can't do it right now (and
my vmd-scripting experience is extremely limited, i.e. near 0) but if
anyone could give some hints ... :o)

I, in fact, already failed with the visibly more advanced version 2.0:

def test(molid, frame): # define a method
        if frame % 50 == 0:
                print "next, please"

I could register this method but nothing happened..

Thanks for comments!
Raik

|You could modify it however, to create a new script that would
|load in one PDB at a time, color it the way you want, draw it
|(or render with snapshot etc) and then delete it, repeating until
|all frames are done.
|
|Thanks,
| John Stone
| vmd_at_ks.uiuc.edu
|
|
|On Sun, Nov 04, 2001 at 10:02:35AM -0500, tom keyes wrote:
|> The animatepdbs script looks to me like it should allow frame-dependent
|> coloring, so long as I write a zillion little files instead of one big one.
|> However below is what my first attempt gave. I know nothing of Tcl, this is
|> Mac OS X. I opened VMD, made my 'graphics' choices, and attempted to run
|> the script from console. Is there something else I need to do? TIA for any
|> suggestions....Tom
|>
|> vmd > animatepdbs 0 2 "%d.pdb"
|> ./animatepdbs: command not found: proc [26]
|> ./animatepdbs: command not found: incr [28]
|> ./animatepdbs: command not found: puts [29]
|> ./animatepdbs: command not found: mol [30]
|> ./animatepdbs: command not found: puts [32]
|> ./animatepdbs: parse error near `{set' [33]
|> ./animatepdbs: command not found: animate [35]
|> ./animatepdbs: parse error near `}' [36]
|> ./animatepdbs: parse error near `}' [37]
|> child process exited abnormally
|> vmd >
|>
|
|

=====================================================
Raik Grünberg | Bioinformatique Structurale
                        | Institut Pasteur
                        | 25-28 rue du docteur Roux
raik_at_pasteur.fr | 75015 Paris
Tel: +33/1.45.68.87.37 | France
-----------------------------------------------------
        http://www.raiks.de/contact.html
=====================================================