[Chimera-users] Pseudobonds disappearing during morphing movie

Elaine Meng meng at cgl.ucsf.edu
Fri May 13 12:34:44 PDT 2011

Hi Alan,
Sorry, there isn't currently a command to apply residue class, only scaling (ribscale) and style (ribrepr):

Some possibilities:
- save session with morph already calculated and residue class applied.  Your script would then restore the session, play the trajectory, and record the movie.  I agree this is not as nice, since then you are saving two files instead of one, and the session file is large.  You wouldn't have to wait for the morph to recalculate, however.

- use a small python script to apply the residue class.  Your Chimera script could open that python file, which automatically executes it.  One of the other developers would have to supply the python (beyond my skill set, sorry), and that also requires having two files, albeit much smaller than a session file.

In general when playing a morph with ribbons that show secondary structure, consider whether you need to recalculate the secondary structure assignments with "ksdssp" at each frame. To execute a set of commands at each frame, one would use the "perframe" command in combination with "alias":

For example, your script could contain something like:

alias ^redefine ksdssp #2
perframe redefine
movie record
coordset #2 1,21; wait 21; ~perframe

I hadn't used ksdssp/perframe in my examples since (perhaps fortuitously) the secondary structure didn't change that much.  If you are just displaying a tube or licorice which doesn't show secondary structure with different widths, it doesn't matter, however.  

You're right that the shape tube surface will not automatically morph along with the structures, but it might work to destroy/recreate it at each coordinate frame using "perframe".  Interesting idea... I haven't tried it, though!

I hope this helps,

On May 13, 2011, at 6:10 AM, Alan Cheung wrote:

> Thanks Elaine!  Yes, the reported thickness was 3.333 (pixels?) and that seems to match the width of the pseudobond i see on the video.  The width isn't too bad, and i can live with it.
> Thanks for the explanations and tip too.
> One last question : can I apply a saved residue class (from the ribbon style editor) via a command?  I'm morphing a mixture of ribbon and side chain atoms and (for a leucine residue) the CA-CB bond is unrealistically long, but seems ok if i remove the orientation atom (O) from the residue class.  I saw the "shape tube" feature in the documentation that draws a tube through CA atoms, but i guessed it's not morphable (and might also not include my precious pseudobond ;) )
> Many thanks again for the quick replies!
> Alan
> On 12/05/2011 19:22, Elaine Meng wrote:
>> Hi Alan,
>> Never mind about the PDBs,  I made up my own by deleting parts of the structures in my favorite morph test case.
>> I think I answered all of your issues except for the pseudobonds completely disappearing with "morph movie nogui true"  -- I did reproduce that problem, and it seems like a bug, albeit mysterious. I'll file a report about that one, but in the meanwhile I hope you will be able to manage without using that option.
>> One minor thing is that I generally recommend adding a few more wait frames to the recording after the morph plays, to avoid any "motion blur" effect at the end you might get as a result of encoding.  I didn't see much of that effect in my test case proteins using your script, however.  It may be because the morph is spread out over 50 frames so there is less differences between adjacent frames, but I was also using different PDBs than you.
>> Best,
>> Elaine
>> On May 12, 2011, at 9:25 AM, Elaine Meng wrote:
>>> Hi Alan,
>>> I haven't tried the whole script yet (can you send me the PDB files?  I'll keep them private, i.e. only for the development group here if you send them just to me) but will try to address the low-hanging fruit in your set of questions:
>>> (A) lines thinner in saved movie.  In general, lines such as silhouette edges and pseudobonds may turn out thinner in saved images and movies when you are doing "supersampling," which initially saves a larger image and samples it down to the final requested size.  You can check if this is the issue by using File... Save Image to save a single image -- the dialog should report the maximum achievable linewidth given the requested size and amount of supersampling.  The reason is that there is an upper limit to how fat your computer can draw the lines (at least via the method used by Chimera).  If you have 2x2 supersampling, for example, Chimera will try to make the lines twice as fat in the initial larger image, but may run into this upper limit.  Then when the image is sampled down to the final size, the lines may not be as thick as they appear in the interactive display.  You could try using lower supersampling.  Also make sure you are using a recent version (1.5.3 candida
> te !
>>> or 1.6) because there was a lines-too-thin-in-images bug a couple of months ago.
>>> (B) setattr "p" vs. "g" -- this is because some attributes are for individual pseudobonds (p) and some attributes are defined for whole pseudobond groups (g).   Individual pseudobonds don't have a linewidth attribute, it is set at the group level.  All the pseudobonds in that group (for example, hydrogen bonds) would get the same linewidth and it is not possible to make different ones in the same group have different widths.  If you are looking at the Selection Inspector or some other attributes inspector, it will show you which attributes are for individual pseudobonds and which are for groups.  The balloon help will give the attribute name and allowed values.
>>> <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/modelattrib.html>
>>> I will try to look at your other issues and get back to you,
>>> Elaine
>>> ----------
>>> Elaine C. Meng, Ph.D.
>>> UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
>>> Department of Pharmaceutical Chemistry
>>> University of California, San Francisco
>>> On May 12, 2011, at 8:54 AM, Alan Cheung wrote:
>>>> Hi there - i'm scripting a complex movie and am having problems with
>>>> pseudobonds during morphing.  Script is pasted at the end.
>>>> Part of the movie contains a morph between two structures, both of
>>>> which are missing the same amino acid segment.  Loading the two
>>>> structures show the pseudobond for the missing residues and the
>>>> resulting morph also contains the same pseudobond.
>>>> I've been changing the thickness of the pseudobond with :
>>>> setattr g lineWidth 8
>>>> and while the two static structures and the morph in the chimera
>>>> window have a thicker pseudobond, the resulting movie (encoded to
>>>> .mov) does not.  Am i doing something wrong?
>>>> Alan
>>>> p.s. incidentally, when morphing by script, if one includes "nogui
>>>> true" with the "morph movie" command, pseudobonds aren't kept in the
>>>> morph at all.  A bug?
>>>> p.p.s. can someone explain to me the difference between "setattr g"
>>>> and "setattr p"?  I've read the manual but i don't understand why only
>>>> the former seems to work for me.
>>>> ## movie script
>>>> open model1.pdb
>>>> open model2.pdb
>>>> morph start #0 frames 50 name morph1 method linear
>>>> morph interpolate #1 name morph1
>>>> morph movie name morph1
>>>> coordset #2 1,1
>>>> setattr g lineWidth 8
>>>> ~modeldisplay #
>>>> movie record supersample 3 directory ~/TEMP/
>>>> modeldisplay #2
>>>> coordset #2 1,51 ; wait 51
>>>> movie stop
>>>> movie encode output morph1.mov
>>> _______________________________________________
>>> Chimera-users mailing list
>>> Chimera-users at cgl.ucsf.edu
>>> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
> -- 
> Alan Cheung
> Gene Center
> Ludwig-Maximilians-University
> Feodor-Lynen-Str. 25
> 81377 Munich
> Germany
> Phone:  +49-89-2180-76845
> Fax:  +49-89-2180-76999
> E-mail: cheung at lmb.uni-muenchen.de

More information about the Chimera-users mailing list