[Chimera-users] time counter

Elaine Meng meng at cgl.ucsf.edu
Wed Jun 26 13:27:35 PDT 2019


P.S. The error on my second example with the “range” option added to shift the numbering was because I did not remove the “~perframe”  at the end of the line.  The ~perframe was redundant because perframe automatically stops when the end of the range is reached. 

> On Jun 26, 2019, at 11:22 AM, Elaine Meng <meng at cgl.ucsf.edu> wrote:
> 
> 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

Should be:

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

> 
> ...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
> -----
> 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!,





More information about the Chimera-users mailing list