[Chimera-users] hbonds and distances movie script questions

Elaine Meng meng at cgl.ucsf.edu
Fri May 5 09:43:21 PDT 2017


Hi Matthias,
Thanks for the kind words!  Sounds like an impressive movie, not to mention a very long script!

The “hbond” option “lineType” was added after the 1.11 release, so you’d need a 1.12 daily build to have it available.
<http://www.rbvi.ucsf.edu/chimera/docs/relnotes/snapshot.html>

In your current script, if you combine two commands on the same line with semicolon separator, that avoids showing the intermediate state.
<http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/indexcommand.html#cmdfile>

One way to show/hide pre-existing hbonds is with setattr, for example

setattr g display false
setattr g display true

However, that includes ALL pseudobonds, so you may need to experiment with including an atomspec at the end to get only the pseudobond group of interest.  You can also set the distance labels to nothing, but that loses their contents:

setattr g label “"

(that was two double quotation marks at the end… again may want to append some atomspec to limit scope).  Here’s a sneaky idea, you could make the labels 100% transparent to hide them and then recolor to show them again.

setattr p labelColor 0.9,0.9,0.0,0.0
setattr p labelColor 0.9,0.9,0.0,1.0

Although the label/rlabel commands have an offset, I don’t know of any command way to adjust offset of a pseudobond label, sorry.  You could control position in 2D exactly and fade in/out with a 2D label, but depends how many there are… could be a lot of work.

As for minimizing whitespace, I use “windowsize” to make sure I’m using a constant size, and  “scale” and “move x” and “move y” commands to make the molecules fill it to my satisfaction (or if you are starting with a session, you can use these until you get what want, then “savepos” and re-save session… later, as in after restoring the session to run the script, you can “reset” to that named position.  Often I have multiple saved positions and can use “reset” to glide from one to the other in a movie.)

I hope this helps,
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 4, 2017, at 2:52 PM, mfellner at msu.edu wrote:
> 
> Good day
> I am making a movie by writing a chimera command script and I searched through existing chimera topics but I could not find a solution for these issues:
> 
> Is there a command to display hbonds, I have made a script now to select residues and find the hbonds, even color + line width them and then I get rid of them later by ~hbonds.
> 
> What I would prefer is to have them premade (so I dont need to select residues during the movie) but not displayed, later I then displayed and undisplayed them with a scipt command.
> 
> Also I could not get the lineType command to work inside the hbond script (lineWidth worked fine), I had to use the setattribute command in a second script line, so for a splitsecond I have a different linetype displayed.
> 
> The second question is about distance labelling. I can set the options in the gui and then distances are displaed by a script with the distance in Angstrom shown. Is there a way to undisplay the distance label later but keep the dashed line, so change the gui option with a script?
> 
> Also I assume this is not possible, is there a script to change where the label will show up next to the line? I have not looked into displaying and undisplaying 2D labels with scripts, maybe that is a possibility?
> 
> Lastly which is not that important, is there any way to trim the corners easily? I think I am recording a lot of white space to the left and right throughout the movie, if I resize the window the molecule gets focused, so its no longer exactly where I had it related to the corners and I think I would have to adjust the script.
> 
> Thank you so much, I hope I made my questions clear, chimera is an awesome program, movie is 21 minutes at the moment.
> 
> Best wishes
> Matthias Fellner Michigan State University




More information about the Chimera-users mailing list