Scripted registration of a perframe python script

Hi, I have been 'opening' a python script file from within Chimera to start a session and in that script I open the MovieDialog manager (mdm) and read in a pdb with a series of models to be viewed as a trajectory. That part is working thanks to help from other responses in chimera-users. To modify the molecule (color, etc) it seems like the mdm.ensemble.molecule is giving me the access, though that may not be the right approach for my needs, because it seems to act on all frames. What I would like to do, from within this same initial python script, is to apply/register a perframe (also in python) script to control things like color on a frame by frame basis. I would like to do this as a way of keeping all of the setup in a single script file such that then I just need to record the movie manually, or perhaps there is a way to do this also from the script. Thanks much for any help and/or direction to documentation on the python api to the MovieDialog that allows control of these functions. Kersey

Hi Kersey, I can’t advise on the python, but seems to me that it would be much easier to develop your movie content as a Chimera command script instead. Chimera commands are thoroughly documented, and there are several examples of Chimera command scripts for movie content. After you’ve scripted out the content, you can add the “movie” command to do the actual recording and encoding into a movie file. <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/movies.html> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/movies.html#content> <http://plato.cgl.ucsf.edu/pipermail/chimera-users/2015-June/011113.html> 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 Jun 17, 2015, at 8:54 AM, Kersey Black <kblack@kecksci.claremont.edu> wrote:
Hi, I have been 'opening' a python script file from within Chimera to start a session and in that script I open the MovieDialog manager (mdm) and read in a pdb with a series of models to be viewed as a trajectory. That part is working thanks to help from other responses in chimera-users. To modify the molecule (color, etc) it seems like the mdm.ensemble.molecule is giving me the access, though that may not be the right approach for my needs, because it seems to act on all frames. What I would like to do, from within this same initial python script, is to apply/register a perframe (also in python) script to control things like color on a frame by frame basis. I would like to do this as a way of keeping all of the setup in a single script file such that then I just need to record the movie manually, or perhaps there is a way to do this also from the script.
Thanks much for any help and/or direction to documentation on the python api to the MovieDialog that allows control of these functions.
Kersey

Hi Kersey, Even though you are using a Python script, you can still "mix in" regular Chimera commands with the runCommand function, e.g.: from chimera import runCommand runCommand("color red :TYR") This would allow you to put movie recording commands at appropriate places in your script, as well as advancing the trajectory one frame at a time with calls to the "coordset" command. This way you don't have to muck with the Movie dialog to try to get it to execute a per-frame script. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Jun 17, 2015, at 8:54 AM, Kersey Black <kblack@kecksci.claremont.edu> wrote:
Hi, I have been 'opening' a python script file from within Chimera to start a session and in that script I open the MovieDialog manager (mdm) and read in a pdb with a series of models to be viewed as a trajectory. That part is working thanks to help from other responses in chimera-users. To modify the molecule (color, etc) it seems like the mdm.ensemble.molecule is giving me the access, though that may not be the right approach for my needs, because it seems to act on all frames. What I would like to do, from within this same initial python script, is to apply/register a perframe (also in python) script to control things like color on a frame by frame basis. I would like to do this as a way of keeping all of the setup in a single script file such that then I just need to record the movie manually, or perhaps there is a way to do this also from the script.
Thanks much for any help and/or direction to documentation on the python api to the MovieDialog that allows control of these functions.
Kersey _______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (3)
-
Elaine Meng
-
Eric Pettersen
-
Kersey Black