Running ChimeraX in batch mode in the Ubuntu terminal
Dear ChimeraX users ! I have a quick technical question. Typically I run ChimeraX with a batch script in order to perform some manipulation with input pdb and print the output image / save chimera-X session. In my Ubuntu terminal I run it using: chimerax script.cxc where the script could be something like : ### open input.pdb # do some manipulation like view, orient etc save image.png exit ## It works OK but, while running from linux terminal I have a quickly open-closed Chimera-X window which is not very practical when I put this script in loop etc. Is there any possibility to fully suppress the Chimera-X gui when I run my script in batch mode from the terminal? Many thanks in advance Enrico
Lucky for you, you're on Linux, so you can use the ChimeraX "--nogui --offscreen" options to be able to do offscreen rendering in nogui mode. That uses a software implementation of OpenGL, so the graphics is much slower than when the GUI is used (that annoying window that pops up). The default image size is window size, and in nogui mode, the default simulated window size is 256x256. You can change the simulated window size with "windowsize 1920 1080". Many of the ChimeraX commands use the window's aspect ratio to scale the data. Or you can change the image size in the save command: "save image.png width 1920 height 1080". I would also recommend getting rid of the "exit" command at the end of your cxc script and instead give the "--exit" option to ChimeraX. That means your script can be used without terminating your ChimeraX session, for example from the command line with "open script.cxc". At some point in the future, we intend to support hardware accelerated offscreen rendering that would work on Linux, macOS, and Windows. But that depends on other projects we have not scheduled yet. HTH, Greg On 7/18/2023 8:30 AM, Enrico Martinez via ChimeraX-users wrote:
Dear ChimeraX users !
I have a quick technical question. Typically I run ChimeraX with a batch script in order to perform some manipulation with input pdb and print the output image / save chimera-X session.
In my Ubuntu terminal I run it using: chimerax script.cxc
where the script could be something like :
### open input.pdb
# do some manipulation like view, orient etc
save image.png exit ##
It works OK but, while running from linux terminal I have a quickly open-closed Chimera-X window which is not very practical when I put this script in loop etc. Is there any possibility to fully suppress the Chimera-X gui when I run my script in batch mode from the terminal?
Many thanks in advance
Enrico _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
Thank you very much Greg ! In fact it works very well on my Ubuntu system. The only one issue that I noticed is the lag with the production of the image in no-gui mode, which workes much faster in normal mode when I see a blink of the chimera-x GUI. In terminal I see Executing: save image_full_Paired-12.png supersample 9 width 1600 height 1600 and then it takes several minutes to complete the job while with the GUI it's only 5-10 sec Yours with thanks, Enrico Il giorno mar 18 lug 2023 alle ore 20:05 Greg Couch <gregc@cgl.ucsf.edu> ha scritto:
Lucky for you, you're on Linux, so you can use the ChimeraX "--nogui --offscreen" options to be able to do offscreen rendering in nogui mode. That uses a software implementation of OpenGL, so the graphics is much slower than when the GUI is used (that annoying window that pops up). The default image size is window size, and in nogui mode, the default simulated window size is 256x256. You can change the simulated window size with "windowsize 1920 1080". Many of the ChimeraX commands use the window's aspect ratio to scale the data. Or you can change the image size in the save command: "save image.png width 1920 height 1080".
I would also recommend getting rid of the "exit" command at the end of your cxc script and instead give the "--exit" option to ChimeraX. That means your script can be used without terminating your ChimeraX session, for example from the command line with "open script.cxc".
At some point in the future, we intend to support hardware accelerated offscreen rendering that would work on Linux, macOS, and Windows. But that depends on other projects we have not scheduled yet.
HTH,
Greg
On 7/18/2023 8:30 AM, Enrico Martinez via ChimeraX-users wrote:
Dear ChimeraX users !
I have a quick technical question. Typically I run ChimeraX with a batch script in order to perform some manipulation with input pdb and print the output image / save chimera-X session.
In my Ubuntu terminal I run it using: chimerax script.cxc
where the script could be something like :
### open input.pdb
# do some manipulation like view, orient etc
save image.png exit ##
It works OK but, while running from linux terminal I have a quickly open-closed Chimera-X window which is not very practical when I put this script in loop etc. Is there any possibility to fully suppress the Chimera-X gui when I run my script in batch mode from the terminal?
Many thanks in advance
Enrico _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
P.S. also I did not notice any differences between the --offscreen (which by itself suppresses any GUI) and additional of the --nogui in the same execution of ChimeraX. Il giorno mer 19 lug 2023 alle ore 14:15 Enrico Martinez <jmsstarlight@gmail.com> ha scritto:
Thank you very much Greg !
In fact it works very well on my Ubuntu system. The only one issue that I noticed is the lag with the production of the image in no-gui mode, which workes much faster in normal mode when I see a blink of the chimera-x GUI. In terminal I see
Executing: save image_full_Paired-12.png supersample 9 width 1600 height 1600
and then it takes several minutes to complete the job while with the GUI it's only 5-10 sec
Yours with thanks,
Enrico
Il giorno mar 18 lug 2023 alle ore 20:05 Greg Couch <gregc@cgl.ucsf.edu> ha scritto:
Lucky for you, you're on Linux, so you can use the ChimeraX "--nogui --offscreen" options to be able to do offscreen rendering in nogui mode. That uses a software implementation of OpenGL, so the graphics is much slower than when the GUI is used (that annoying window that pops up). The default image size is window size, and in nogui mode, the default simulated window size is 256x256. You can change the simulated window size with "windowsize 1920 1080". Many of the ChimeraX commands use the window's aspect ratio to scale the data. Or you can change the image size in the save command: "save image.png width 1920 height 1080".
I would also recommend getting rid of the "exit" command at the end of your cxc script and instead give the "--exit" option to ChimeraX. That means your script can be used without terminating your ChimeraX session, for example from the command line with "open script.cxc".
At some point in the future, we intend to support hardware accelerated offscreen rendering that would work on Linux, macOS, and Windows. But that depends on other projects we have not scheduled yet.
HTH,
Greg
On 7/18/2023 8:30 AM, Enrico Martinez via ChimeraX-users wrote:
Dear ChimeraX users !
I have a quick technical question. Typically I run ChimeraX with a batch script in order to perform some manipulation with input pdb and print the output image / save chimera-X session.
In my Ubuntu terminal I run it using: chimerax script.cxc
where the script could be something like :
### open input.pdb
# do some manipulation like view, orient etc
save image.png exit ##
It works OK but, while running from linux terminal I have a quickly open-closed Chimera-X window which is not very practical when I put this script in loop etc. Is there any possibility to fully suppress the Chimera-X gui when I run my script in batch mode from the terminal?
Many thanks in advance
Enrico _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
P.S.S. when I use only --nogui (without --offscreen) there is a following error with the creation of the PNG output (which works ok when --offscreen is added): Executing: save /home/novikov-g/Bureau/bak_build/a_kind_of_magic/BAK_full/BAK_full_Reds-5.png supersample 9 width 1600 height 1600 Traceback (most recent call last): File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/__main__.py", line 863, in init commands.run(sess, 'open %s' % StringArg.unparse(arg)) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/run.py", line 38, in run results = command.run(text, log=log, return_json=return_json) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 119, in cmd_open models = Command(session, registry=registry).run(provider_cmd_text, log=log)[0] File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 194, in provider_open models, status = collated_open(session, None, [data], data_format, _add_models, File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 447, in collated_open return remember_data_format() File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 435, in remember_data_format models, status = func(*func_args, **func_kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core_formats/__init__.py", line 37, in open return open_command_script(session, data, file_name, **kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/scripting.py", line 160, in open_command_script _run_commands(session, commands, directory = dirname(path), log = log) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/scripting.py", line 173, in _run_commands run(session, cmd, log=log) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/run.py", line 38, in run results = command.run(text, log=log, return_json=return_json) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/save_command/cmd.py", line 75, in cmd_save Command(session, registry=registry).run(provider_cmd_text, log=log) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/save_command/cmd.py", line 90, in provider_save saver_info.save(session, path, **provider_kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/image_formats/__init__.py", line 45, in save save_image(session, path, format_name, **kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/image_formats/save.py", line 23, in save_image raise LimitationError("Unable to save images because OpenGL rendering is not available") chimerax.core.errors.LimitationError: Unable to save images because OpenGL rendering is not available Il giorno mer 19 lug 2023 alle ore 14:18 Enrico Martinez <jmsstarlight@gmail.com> ha scritto:
P.S. also I did not notice any differences between the --offscreen (which by itself suppresses any GUI) and additional of the --nogui in the same execution of ChimeraX.
Il giorno mer 19 lug 2023 alle ore 14:15 Enrico Martinez <jmsstarlight@gmail.com> ha scritto:
Thank you very much Greg !
In fact it works very well on my Ubuntu system. The only one issue that I noticed is the lag with the production of the image in no-gui mode, which workes much faster in normal mode when I see a blink of the chimera-x GUI. In terminal I see
Executing: save image_full_Paired-12.png supersample 9 width 1600 height 1600
and then it takes several minutes to complete the job while with the GUI it's only 5-10 sec
Yours with thanks,
Enrico
Il giorno mar 18 lug 2023 alle ore 20:05 Greg Couch <gregc@cgl.ucsf.edu> ha scritto:
Lucky for you, you're on Linux, so you can use the ChimeraX "--nogui --offscreen" options to be able to do offscreen rendering in nogui mode. That uses a software implementation of OpenGL, so the graphics is much slower than when the GUI is used (that annoying window that pops up). The default image size is window size, and in nogui mode, the default simulated window size is 256x256. You can change the simulated window size with "windowsize 1920 1080". Many of the ChimeraX commands use the window's aspect ratio to scale the data. Or you can change the image size in the save command: "save image.png width 1920 height 1080".
I would also recommend getting rid of the "exit" command at the end of your cxc script and instead give the "--exit" option to ChimeraX. That means your script can be used without terminating your ChimeraX session, for example from the command line with "open script.cxc".
At some point in the future, we intend to support hardware accelerated offscreen rendering that would work on Linux, macOS, and Windows. But that depends on other projects we have not scheduled yet.
HTH,
Greg
On 7/18/2023 8:30 AM, Enrico Martinez via ChimeraX-users wrote:
Dear ChimeraX users !
I have a quick technical question. Typically I run ChimeraX with a batch script in order to perform some manipulation with input pdb and print the output image / save chimera-X session.
In my Ubuntu terminal I run it using: chimerax script.cxc
where the script could be something like :
### open input.pdb
# do some manipulation like view, orient etc
save image.png exit ##
It works OK but, while running from linux terminal I have a quickly open-closed Chimera-X window which is not very practical when I put this script in loop etc. Is there any possibility to fully suppress the Chimera-X gui when I run my script in batch mode from the terminal?
Many thanks in advance
Enrico _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
I forgot that we changed --offscreen to automatically set --nogui, so yes, that is redundant. -- Greg On 7/19/2023 5:18 AM, Enrico Martinez wrote:
P.S. also I did not notice any differences between the --offscreen (which by itself suppresses any GUI) and additional of the --nogui in the same execution of ChimeraX.
Il giorno mer 19 lug 2023 alle ore 14:15 Enrico Martinez <jmsstarlight@gmail.com> ha scritto:
Thank you very much Greg !
In fact it works very well on my Ubuntu system. The only one issue that I noticed is the lag with the production of the image in no-gui mode, which workes much faster in normal mode when I see a blink of the chimera-x GUI. In terminal I see
Executing: save image_full_Paired-12.png supersample 9 width 1600 height 1600
and then it takes several minutes to complete the job while with the GUI it's only 5-10 sec
Yours with thanks,
Enrico
Il giorno mar 18 lug 2023 alle ore 20:05 Greg Couch <gregc@cgl.ucsf.edu> ha scritto:
Lucky for you, you're on Linux, so you can use the ChimeraX "--nogui --offscreen" options to be able to do offscreen rendering in nogui mode. That uses a software implementation of OpenGL, so the graphics is much slower than when the GUI is used (that annoying window that pops up). The default image size is window size, and in nogui mode, the default simulated window size is 256x256. You can change the simulated window size with "windowsize 1920 1080". Many of the ChimeraX commands use the window's aspect ratio to scale the data. Or you can change the image size in the save command: "save image.png width 1920 height 1080".
I would also recommend getting rid of the "exit" command at the end of your cxc script and instead give the "--exit" option to ChimeraX. That means your script can be used without terminating your ChimeraX session, for example from the command line with "open script.cxc".
At some point in the future, we intend to support hardware accelerated offscreen rendering that would work on Linux, macOS, and Windows. But that depends on other projects we have not scheduled yet.
HTH,
Greg
On 7/18/2023 8:30 AM, Enrico Martinez via ChimeraX-users wrote:
Dear ChimeraX users !
I have a quick technical question. Typically I run ChimeraX with a batch script in order to perform some manipulation with input pdb and print the output image / save chimera-X session.
In my Ubuntu terminal I run it using: chimerax script.cxc
where the script could be something like :
### open input.pdb
# do some manipulation like view, orient etc
save image.png exit ##
It works OK but, while running from linux terminal I have a quickly open-closed Chimera-X window which is not very practical when I put this script in loop etc. Is there any possibility to fully suppress the Chimera-X gui when I run my script in batch mode from the terminal?
Many thanks in advance
Enrico _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
The fact that you got a traceback is a bug. The error in the traceback: "Unable to save images because OpenGL rendering is not available" is correct. You have use use --offscreen if you want to save images. -- Greg I forgot that we changed --offscreen to automatically set --nogui. On 7/19/2023 5:22 AM, Enrico Martinez wrote:
P.S.S. when I use only --nogui (without --offscreen) there is a following error with the creation of the PNG output (which works ok when --offscreen is added):
Executing: save /home/novikov-g/Bureau/bak_build/a_kind_of_magic/BAK_full/BAK_full_Reds-5.png supersample 9 width 1600 height 1600 Traceback (most recent call last): File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/__main__.py", line 863, in init commands.run(sess, 'open %s' % StringArg.unparse(arg)) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/run.py", line 38, in run results = command.run(text, log=log, return_json=return_json) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 119, in cmd_open models = Command(session, registry=registry).run(provider_cmd_text, log=log)[0] File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 194, in provider_open models, status = collated_open(session, None, [data], data_format, _add_models, File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 447, in collated_open return remember_data_format() File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 435, in remember_data_format models, status = func(*func_args, **func_kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core_formats/__init__.py", line 37, in open return open_command_script(session, data, file_name, **kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/scripting.py", line 160, in open_command_script _run_commands(session, commands, directory = dirname(path), log = log) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/scripting.py", line 173, in _run_commands run(session, cmd, log=log) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/run.py", line 38, in run results = command.run(text, log=log, return_json=return_json) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/save_command/cmd.py", line 75, in cmd_save Command(session, registry=registry).run(provider_cmd_text, log=log) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/save_command/cmd.py", line 90, in provider_save saver_info.save(session, path, **provider_kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/image_formats/__init__.py", line 45, in save save_image(session, path, format_name, **kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/image_formats/save.py", line 23, in save_image raise LimitationError("Unable to save images because OpenGL rendering is not available") chimerax.core.errors.LimitationError: Unable to save images because OpenGL rendering is not available
Il giorno mer 19 lug 2023 alle ore 14:18 Enrico Martinez <jmsstarlight@gmail.com> ha scritto:
P.S. also I did not notice any differences between the --offscreen (which by itself suppresses any GUI) and additional of the --nogui in the same execution of ChimeraX.
Il giorno mer 19 lug 2023 alle ore 14:15 Enrico Martinez <jmsstarlight@gmail.com> ha scritto:
Thank you very much Greg !
In fact it works very well on my Ubuntu system. The only one issue that I noticed is the lag with the production of the image in no-gui mode, which workes much faster in normal mode when I see a blink of the chimera-x GUI. In terminal I see
Executing: save image_full_Paired-12.png supersample 9 width 1600 height 1600
and then it takes several minutes to complete the job while with the GUI it's only 5-10 sec
Yours with thanks,
Enrico
Il giorno mar 18 lug 2023 alle ore 20:05 Greg Couch <gregc@cgl.ucsf.edu> ha scritto:
Lucky for you, you're on Linux, so you can use the ChimeraX "--nogui --offscreen" options to be able to do offscreen rendering in nogui mode. That uses a software implementation of OpenGL, so the graphics is much slower than when the GUI is used (that annoying window that pops up). The default image size is window size, and in nogui mode, the default simulated window size is 256x256. You can change the simulated window size with "windowsize 1920 1080". Many of the ChimeraX commands use the window's aspect ratio to scale the data. Or you can change the image size in the save command: "save image.png width 1920 height 1080".
I would also recommend getting rid of the "exit" command at the end of your cxc script and instead give the "--exit" option to ChimeraX. That means your script can be used without terminating your ChimeraX session, for example from the command line with "open script.cxc".
At some point in the future, we intend to support hardware accelerated offscreen rendering that would work on Linux, macOS, and Windows. But that depends on other projects we have not scheduled yet.
HTH,
Greg
On 7/18/2023 8:30 AM, Enrico Martinez via ChimeraX-users wrote:
Dear ChimeraX users !
I have a quick technical question. Typically I run ChimeraX with a batch script in order to perform some manipulation with input pdb and print the output image / save chimera-X session.
In my Ubuntu terminal I run it using: chimerax script.cxc
where the script could be something like :
### open input.pdb
# do some manipulation like view, orient etc
save image.png exit ##
It works OK but, while running from linux terminal I have a quickly open-closed Chimera-X window which is not very practical when I put this script in loop etc. Is there any possibility to fully suppress the Chimera-X gui when I run my script in batch mode from the terminal?
Many thanks in advance
Enrico _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
Okay, I gotcha, thank you very much Greg ! So basically when I use ChimeraX for some post-processing operations saving session / a session I run it with the --offscreen to suppress gui. Alternatively when I use it to save an image, I run it in normal mode since it produces images much faster .. :-) Yours sincerely Enrico Il giorno mer 19 lug 2023 alle ore 22:11 Greg Couch <gregc@cgl.ucsf.edu> ha scritto:
The fact that you got a traceback is a bug. The error in the traceback: "Unable to save images because OpenGL rendering is not available" is correct. You have use use --offscreen if you want to save images.
-- Greg
I forgot that we changed --offscreen to automatically set --nogui.
On 7/19/2023 5:22 AM, Enrico Martinez wrote:
P.S.S. when I use only --nogui (without --offscreen) there is a following error with the creation of the PNG output (which works ok when --offscreen is added):
Executing: save /home/novikov-g/Bureau/bak_build/a_kind_of_magic/BAK_full/BAK_full_Reds-5.png supersample 9 width 1600 height 1600 Traceback (most recent call last): File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/__main__.py", line 863, in init commands.run(sess, 'open %s' % StringArg.unparse(arg)) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/run.py", line 38, in run results = command.run(text, log=log, return_json=return_json) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 119, in cmd_open models = Command(session, registry=registry).run(provider_cmd_text, log=log)[0] File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 194, in provider_open models, status = collated_open(session, None, [data], data_format, _add_models, File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 447, in collated_open return remember_data_format() File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/open_command/cmd.py", line 435, in remember_data_format models, status = func(*func_args, **func_kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core_formats/__init__.py", line 37, in open return open_command_script(session, data, file_name, **kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/scripting.py", line 160, in open_command_script _run_commands(session, commands, directory = dirname(path), log = log) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/scripting.py", line 173, in _run_commands run(session, cmd, log=log) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/run.py", line 38, in run results = command.run(text, log=log, return_json=return_json) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/save_command/cmd.py", line 75, in cmd_save Command(session, registry=registry).run(provider_cmd_text, log=log) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/commands/cli.py", line 2897, in run result = ci.function(session, **kw_args) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/save_command/cmd.py", line 90, in provider_save saver_info.save(session, path, **provider_kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/image_formats/__init__.py", line 45, in save save_image(session, path, format_name, **kw) File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/image_formats/save.py", line 23, in save_image raise LimitationError("Unable to save images because OpenGL rendering is not available") chimerax.core.errors.LimitationError: Unable to save images because OpenGL rendering is not available
Il giorno mer 19 lug 2023 alle ore 14:18 Enrico Martinez <jmsstarlight@gmail.com> ha scritto:
P.S. also I did not notice any differences between the --offscreen (which by itself suppresses any GUI) and additional of the --nogui in the same execution of ChimeraX.
Il giorno mer 19 lug 2023 alle ore 14:15 Enrico Martinez <jmsstarlight@gmail.com> ha scritto:
Thank you very much Greg !
In fact it works very well on my Ubuntu system. The only one issue that I noticed is the lag with the production of the image in no-gui mode, which workes much faster in normal mode when I see a blink of the chimera-x GUI. In terminal I see
Executing: save image_full_Paired-12.png supersample 9 width 1600 height 1600
and then it takes several minutes to complete the job while with the GUI it's only 5-10 sec
Yours with thanks,
Enrico
Il giorno mar 18 lug 2023 alle ore 20:05 Greg Couch <gregc@cgl.ucsf.edu> ha scritto:
Lucky for you, you're on Linux, so you can use the ChimeraX "--nogui --offscreen" options to be able to do offscreen rendering in nogui mode. That uses a software implementation of OpenGL, so the graphics is much slower than when the GUI is used (that annoying window that pops up). The default image size is window size, and in nogui mode, the default simulated window size is 256x256. You can change the simulated window size with "windowsize 1920 1080". Many of the ChimeraX commands use the window's aspect ratio to scale the data. Or you can change the image size in the save command: "save image.png width 1920 height 1080".
I would also recommend getting rid of the "exit" command at the end of your cxc script and instead give the "--exit" option to ChimeraX. That means your script can be used without terminating your ChimeraX session, for example from the command line with "open script.cxc".
At some point in the future, we intend to support hardware accelerated offscreen rendering that would work on Linux, macOS, and Windows. But that depends on other projects we have not scheduled yet.
HTH,
Greg
On 7/18/2023 8:30 AM, Enrico Martinez via ChimeraX-users wrote:
Dear ChimeraX users !
I have a quick technical question. Typically I run ChimeraX with a batch script in order to perform some manipulation with input pdb and print the output image / save chimera-X session.
In my Ubuntu terminal I run it using: chimerax script.cxc
where the script could be something like :
### open input.pdb
# do some manipulation like view, orient etc
save image.png exit ##
It works OK but, while running from linux terminal I have a quickly open-closed Chimera-X window which is not very practical when I put this script in loop etc. Is there any possibility to fully suppress the Chimera-X gui when I run my script in batch mode from the terminal?
Many thanks in advance
Enrico _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
participants (2)
-
Enrico Martinez
-
Greg Couch