Thank you! I thought it must be some stupid mistake. It works now.

Visvaldas


On Monday, November 28, 2022 at 10:19:19 PM GMT, Tom Goddard <goddard@sonic.net> wrote:


The "--script" option in ChimeraX 1.4 only takes Python scripts, not ChimeraX command scripts.  The clue to this is in the error message where is says it is in function "open_python_script".  ChimeraX 1.5 accepts either Python or ChimeraX (.cxc) scripts with the --script option.

For ChimeraX 1.4 just use

chimerax --nogui myscript.cxc

The --script option is mostly intended to pass arguments to a script.

Tom


On Nov 28, 2022, at 2:00 PM, Visvaldas K. via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:

Dear ChimeraX wizards,

I was trying to generate hbond analysis via nogui, by issuing "chimerax --nogui --script "myscript.cxc",

where in the script I put the following commands:

open /Users/visvaldas/temp0000.pdb
select /B
hbonds sel saveFile /Users/visvaldas/temp00.hbonds restrict cross batch true
quit

However, something is wrong with hbonds line since I am getting this error:
Executing: runscript myscript.cxc
Traceback (most recent call last):
  File "/Applications/ChimeraX-1.4.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/core/scripting.py", line 83, in open_python_script
    code = compile(data, stream.name, 'exec')
  File "myscript.cxc", line 4
    hbonds sel saveFile /Users/visvaldas/temp00.hbonds restrict cross batch true
           ^
SyntaxError: invalid syntax

What I am doing wrong?
(Also, when using GUI, the hbonds line was much longer, so I deleted those reveal, color, etc entities to make it more relevant to batch. (The "long" line
hbonds sel saveFile /Users/visvaldas/temp00.hbonds color #fffb00 dashes 5 restrict cross reveal true retainCurrent true
from the GUI  does not work either)

Best wishes,

Visvaldas
_______________________________________________
ChimeraX-users mailing list
ChimeraX-users@cgl.ucsf.edu
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users