[Chimera-users] time counter

Elaine Meng meng at cgl.ucsf.edu
Wed Jun 26 11:22:39 PDT 2019

Hi Clara,
I had a test system of model #3 trajectory with 81 frames and this script worked:

2dlabels create timer text "time = 0 ns" size 30 xpos .05 ypos .05 color black
alias ^actions 2dlabels change timer text "time = $1 ns"
wait 20
perframe actions; coordset #3 1,81,2; wait 40; ~perframe
wait 40
2dlabels delete timer

Even though I had 81 *trajectory* frames, since coordset only showed 40 *graphics* frames, the count only goes up to 40, which is what you wanted anyway, in your situation of showing one snapshot per nanosecond.   You just need to change your alias line to something like in my example.  “<FRAME>” is something you can only use in the MD Movie dialog, not command scripts.

if you are showing protein ribbon and the secondary structure is changing, you may want to include ksdssp in your alias, e.g.

 alias ^actions 2dlabels change timer text "time = $1 ns”; ksdssp

I think that answers your question, but I was also wondering if I could show numbering with a different start value, e.g. 41-80.  This is more troublesome… although this worked to show numbering 41-80

perframe actions range 41,80; coordset #3 1,81,2; wait 40; ~perframe

...it also generated an error message that stopped the script (and thus would mess up movie recording).  I guess a python script is needed to do something fancier like that.

I hope this helps,
Elaine C. Meng, Ph.D.
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco

> On Jun 26, 2019, at 6:02 AM, CLARA BLANES MIRA <c.blanes at goumh.umh.es> wrote:
> Dear chimera users,
> I have two doubts regarding per-frame actions:
> 1) I am trying to add a counter in my script (commands script, no python script). 
> It works when I do it as a per-frame action in the MD Movie window (just as Elaine does in the’Trajectory and ensemble Analysis Tutorial’)  but I am not able to do insert it in my command script: 
> Something like this:
> movie record
> 2dlabels create timer text “frame 0" size 40 color white
> alias ^actions 2dlabels change timer text "frame <FRAME>"
> perframe actions; coordset #0 1,216000,1000 load false; wait 216; ~perframe  
> movie encode movie.mp4
> 2) What I really want is to show nanoseconds, not frames. In my case 1000 frames = 1 ns. When I write frame <FRAME>/1000 in MD Movie window, obviously, it does not work. Any suggestion to make it work and insert it in the commands script?
> Thank you very much!,
> Clara
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

More information about the Chimera-users mailing list