Chimera commands to record MD movies
Dear Chimera, Since we run a lot of Amber MD simulation in remote clusters, we wonder if there is any Chimera command that can record the Amber MD trajectories remotely and save them as avi (or any other movie file formats)? If this is feasible, then we don't have to download all the trajectories to local and make the trajectory movies manually. We have searched the Chimera user manual but didn't see any command. If there are related commands which we didn't see, please forgive us : ) Thanks. * There is a way to activate X11 forwarding and use remote Chimera GUI to do this, but it's extremely slow and prone to freeze the computer. Cheers, Henry
Dear Henry, You would use the "movie" command to start/stop recording and assemble the movie file, and the "coordset" command to play the trajectory. I.e. in your Chimera command script, you'd have some setup commands, then "movie start" to start recording, then all the stuff you want in the movie (trajectory playback with "coordset" etc.), and then "movie stop" and "movie encode" (most likely with various command options such as file name, format, and location). <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/movie.html> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/coordset.html> List of movie-related commands: <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/movies.html#moviecommands> There are some examples of using coordset to play back trajectories from morphing, but trajectories from MD are handled the same way once they have been loaded. The only tricky thing is that some MD formats don't load all the coordinate sets until you have actually played the whole trajectory using the MD Movie dialog. Examples include: (1) video mini-example <http://www.cgl.ucsf.edu/chimera/data/movie-howto-mar2012/movie_examples.html#coordset> (2) "ball-and-socket motion" video in the Animation Gallery (about halfway down the page)... there is also a link to the corresponding Chimera script file, trmovie.com <http://www.rbvi.ucsf.edu/chimera/animations/animations.html> The above only addresses how it could be done in a Chimera command script. Others would have to respond if you have questions about using "headless" remote Chimera or something like that. 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 Sep 18, 2013, at 12:11 PM, psu4@uic.edu wrote:
Dear Chimera, Since we run a lot of Amber MD simulation in remote clusters, we wonder if there is any Chimera command that can record the Amber MD trajectories remotely and save them as avi (or any other movie file formats)? If this is feasible, then we don't have to download all the trajectories to local and make the trajectory movies manually. We have searched the Chimera user manual but didn't see any command. If there are related commands which we didn't see, please forgive us : ) Thanks.
* There is a way to activate X11 forwarding and use remote Chimera GUI to do this, but it's extremely slow and prone to freeze the computer. Cheers, Henry
On Sep 18, 2013, at 12:11 PM, psu4@uic.edu wrote:
Dear Chimera,
Since we run a lot of Amber MD simulation in remote clusters, we wonder if there is any Chimera command that can record the Amber MD trajectories remotely and save them as avi (or any other movie file formats)? If this is feasible, then we don't have to download all the trajectories to local and make the trajectory movies manually. We have searched the Chimera user manual but didn't see any command. If there are related commands which we didn't see, please forgive us : ) Thanks.
* There is a way to activate X11 forwarding and use remote Chimera GUI to do this, but it's extremely slow and prone to freeze the computer.
Hi Henry, The trick is to get the trajectory loaded without using the graphical user interface. When dinosaurs roamed the earth and the MD Movie tool was being designed, we didn't recognize the importance of providing command-line versions of all important functions and therefore the MD Movie is very much unfriendly to non-GUI usage like what you are trying to do. Nonetheless, in Python almost anything is possible and indeed non-GUI loading of trajectories is possible using a short Python script. I've attached such a script. You would need to edit the second line of the script to specify where the topology and coordinate files are. Then you can run it simply by opening it with the "open"command. The other trick is that you will need to get the "headless" version of Chimera from the download page in order to be able to save images/movies without using the GUI. Let me know if you run into any problems. --Eric
Dear Elaine and Eric, Really appreciate your kind help! Sorry for the late reply. We were busy on the other project. Our volunteer Kevin modified Eric's python script. Then we execute the remote headless Chimera <http://www.cgl.ucsf.edu/chimera/download.html> by the command "chimera", and "open recoding_movie_kevin.py" *The following error message will pop out* :
open /work/02444/drugsu/recoding_movie_kevin.py Executing /work/02444/drugsu/recoding_movie_kevin.py... Reading Amber prmtop Done reading Amber prmtop Creating interface Creating bonds Bonds created Assigning chain ID A to 259 residues, e.g. GLY Model 2 (AAA_with_AAA_91_12A_prod_v0_l1.mdcrd) appears to be a protein without secondary structure assignments. Automatically computing assignments using 'ksdssp' and parameter values: energy cutoff -0.5 minimum helix length 3 minimum strand length 3 Use command 'help ksdssp' for more information.
Computing secondary structure assignments... Computed secondary structure assignments (see reply log) Interface created Traceback (most recent call last): File "/work/02444/drugsu/chimera_headless/share/ReadStdin/__init__.py", line 79, in _runCommand chimera.runCommand(cmd) File "/work/02444/drugsu/chimera_headless/share/chimera/__init__.py", line 2608, in runCommand makeCommand(*args, **kw) File "/work/02444/drugsu/chimera_headless/share/Midas/midas_text.py", line 69, in makeCommand f(c, args) File "/work/02444/drugsu/chimera_headless/share/Midas/midas_text.py", line 1570, in doOpen modelArg, noprefs) File "<string>", line 1, in <module> File "/work/02444/drugsu/chimera_headless/share/Midas/__init__.py", line 2090, in open noprefs=noprefs) File "/work/02444/drugsu/chimera_headless/share/chimera/__init__.py", line 1817, in open models = func(filename, *args, **kw) File "/work/02444/drugsu/chimera_headless/share/chimera/__init__.py", line 1196, in _openPython loadFunc(sandboxName, fileName, f) File "recoding_movie_kevin.py", line 39, in <module> runCommand('preset apply pub 1') File "/work/02444/drugsu/chimera_headless/share/chimera/__init__.py", line 2608, in runCommand makeCommand(*args, **kw) File "/work/02444/drugsu/chimera_headless/share/Midas/midas_text.py", line 69, in makeCommand f(c, args) File "/work/02444/drugsu/chimera_headless/share/Midas/midas_text.py", line 1676, in doPreset mgr.applyPreset(type, vals[1]) File "/work/02444/drugsu/chimera_headless/share/chimera/preset.py", line 107, in applyPreset func() File "/work/02444/drugsu/chimera_headless/share/chimera/preset.py", line 36, in <lambda> lambda:preset(publication=True, depthCued=False), False) File "/work/02444/drugsu/chimera_headless/share/chimera/preset.py", line 183, in preset with nested(NA.blockUpdates(), chimera.update.blockFrameUpdates()): AttributeError: 'module' object has no attribute 'update' AttributeError: 'module' object has no attribute 'update' File "/work/02444/drugsu/chimera_headless/share/chimera/preset.py", line 183, in preset with nested(NA.blockUpdates(), chimera.update.blockFrameUpdates()): See reply log for Python traceback. If we use the GUI chimera and open this script, it will work properly. We have searched the mailing list but didn't see similar error messages. If not too much asking, could you kindly offer some solutions? Please forgive any ignorance, if any. Cheers, Pin-Chih On Wed, Sep 18, 2013 at 4:23 PM, Eric Pettersen <pett@cgl.ucsf.edu> wrote:
On Sep 18, 2013, at 12:11 PM, psu4@uic.edu wrote:
Dear Chimera,
Since we run a lot of Amber MD simulation in remote clusters, we wonder if there is any Chimera command that can record the Amber MD trajectories remotely and save them as avi (or any other movie file formats)? If this is feasible, then we don't have to download all the trajectories to local and make the trajectory movies manually. We have searched the Chimera user manual but didn't see any command. If there are related commands which we didn't see, please forgive us : ) Thanks.
* There is a way to activate X11 forwarding and use remote Chimera GUI to do this, but it's extremely slow and prone to freeze the computer.
Hi Henry, The trick is to get the trajectory loaded without using the graphical user interface. When dinosaurs roamed the earth and the MD Movie tool was being designed, we didn't recognize the importance of providing command-line versions of all important functions and therefore the MD Movie is very much unfriendly to non-GUI usage like what you are trying to do. Nonetheless, in Python almost anything is possible and indeed non-GUI loading of trajectories is possible using a short Python script. I've attached such a script. You would need to edit the second line of the script to specify where the topology and coordinate files are. Then you can run it simply by opening it with the "open"command. The other trick is that you will need to get the "headless" version of Chimera from the download page in order to be able to save images/movies without using the GUI. Let me know if you run into any problems.
--Eric
-- Pin-Chih Su (Henry Su) Ph.D. canditate Center for Pharmaceutical Biotechnology (MC 870) College of Pharmacy, University of Illinois at Chicago 900 South Ashland Avenue, Room 1052 Chicago, IL 60607-7173 office 312-996-5388 fax 312-413-9303
Hi Pin-Chih, You should really report bugs to chimera-bugs instead of chimera-users. I will open a ticket for this problem in our bug-tracking database so you'll know when a fix gets done (and will show up in the next daily build). That said, I'm pretty sure the fix is for you to edit the file /work/02444/drugsu/chimera_headless/share/chimera/preset.py and just above line 183 (which should start with "with nested(NA…") put "import chimera.update" with the same indentation that the "with nested(NA…" line has. --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Oct 10, 2013, at 5:41 PM, psu4@uic.edu wrote:
Dear Elaine and Eric,
Really appreciate your kind help! Sorry for the late reply. We were busy on the other project.
Our volunteer Kevin modified Eric's python script. Then we execute the remote headless Chimera by the command "chimera", and "open recoding_movie_kevin.py"
The following error message will pop out :
open /work/02444/drugsu/recoding_movie_kevin.py Executing /work/02444/drugsu/recoding_movie_kevin.py... Reading Amber prmtop Done reading Amber prmtop Creating interface Creating bonds Bonds created Assigning chain ID A to 259 residues, e.g. GLY Model 2 (AAA_with_AAA_91_12A_prod_v0_l1.mdcrd) appears to be a protein without secondary structure assignments. Automatically computing assignments using 'ksdssp' and parameter values: energy cutoff -0.5 minimum helix length 3 minimum strand length 3 Use command 'help ksdssp' for more information.
Computing secondary structure assignments... Computed secondary structure assignments (see reply log) Interface created
Traceback (most recent call last): File "/work/02444/drugsu/chimera_headless/share/ReadStdin/__init__.py", line 79, in _runCommand chimera.runCommand(cmd) File "/work/02444/drugsu/chimera_headless/share/chimera/__init__.py", line 2608, in runCommand makeCommand(*args, **kw) File "/work/02444/drugsu/chimera_headless/share/Midas/midas_text.py", line 69, in makeCommand f(c, args) File "/work/02444/drugsu/chimera_headless/share/Midas/midas_text.py", line 1570, in doOpen modelArg, noprefs) File "<string>", line 1, in <module> File "/work/02444/drugsu/chimera_headless/share/Midas/__init__.py", line 2090, in open noprefs=noprefs) File "/work/02444/drugsu/chimera_headless/share/chimera/__init__.py", line 1817, in open models = func(filename, *args, **kw) File "/work/02444/drugsu/chimera_headless/share/chimera/__init__.py", line 1196, in _openPython loadFunc(sandboxName, fileName, f) File "recoding_movie_kevin.py", line 39, in <module> runCommand('preset apply pub 1') File "/work/02444/drugsu/chimera_headless/share/chimera/__init__.py", line 2608, in runCommand makeCommand(*args, **kw) File "/work/02444/drugsu/chimera_headless/share/Midas/midas_text.py", line 69, in makeCommand f(c, args) File "/work/02444/drugsu/chimera_headless/share/Midas/midas_text.py", line 1676, in doPreset mgr.applyPreset(type, vals[1]) File "/work/02444/drugsu/chimera_headless/share/chimera/preset.py", line 107, in applyPreset func() File "/work/02444/drugsu/chimera_headless/share/chimera/preset.py", line 36, in <lambda> lambda:preset(publication=True, depthCued=False), False) File "/work/02444/drugsu/chimera_headless/share/chimera/preset.py", line 183, in preset with nested(NA.blockUpdates(), chimera.update.blockFrameUpdates()): AttributeError: 'module' object has no attribute 'update'
AttributeError: 'module' object has no attribute 'update'
File "/work/02444/drugsu/chimera_headless/share/chimera/preset.py", line 183, in preset with nested(NA.blockUpdates(), chimera.update.blockFrameUpdates()):
See reply log for Python traceback.
If we use the GUI chimera and open this script, it will work properly. We have searched the mailing list but didn't see similar error messages. If not too much asking, could you kindly offer some solutions? Please forgive any ignorance, if any.
Cheers, Pin-Chih
On Wed, Sep 18, 2013 at 4:23 PM, Eric Pettersen <pett@cgl.ucsf.edu> wrote: On Sep 18, 2013, at 12:11 PM, psu4@uic.edu wrote:
Dear Chimera,
Since we run a lot of Amber MD simulation in remote clusters, we wonder if there is any Chimera command that can record the Amber MD trajectories remotely and save them as avi (or any other movie file formats)? If this is feasible, then we don't have to download all the trajectories to local and make the trajectory movies manually. We have searched the Chimera user manual but didn't see any command. If there are related commands which we didn't see, please forgive us : ) Thanks.
* There is a way to activate X11 forwarding and use remote Chimera GUI to do this, but it's extremely slow and prone to freeze the computer.
Hi Henry, The trick is to get the trajectory loaded without using the graphical user interface. When dinosaurs roamed the earth and the MD Movie tool was being designed, we didn't recognize the importance of providing command-line versions of all important functions and therefore the MD Movie is very much unfriendly to non-GUI usage like what you are trying to do. Nonetheless, in Python almost anything is possible and indeed non-GUI loading of trajectories is possible using a short Python script. I've attached such a script. You would need to edit the second line of the script to specify where the topology and coordinate files are. Then you can run it simply by opening it with the "open"command. The other trick is that you will need to get the "headless" version of Chimera from the download page in order to be able to save images/movies without using the GUI. Let me know if you run into any problems.
--Eric
--
Pin-Chih Su (Henry Su)
Ph.D. canditate
Center for Pharmaceutical Biotechnology (MC 870)
College of Pharmacy, University of Illinois at Chicago
900 South Ashland Avenue, Room 1052
Chicago, IL 60607-7173
office 312-996-5388
fax 312-413-9303
<recording_movie_kevin.py>_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (3)
-
Elaine Meng
-
Eric Pettersen
-
psu4@uic.edu