I am picking up an old code that used chimera and updating it to use ChimeraX.
from chimera import runCommand
runCommand("open ../4ZKC_H_reduce.pdb")
runCommand("swapaa LYS #0:11.B&:LYS lib dynameomics")
runCommand("swapaa TRP #0:51.B&:TRP lib dynameomics")
runCommand("write #0 ../4ZKC_H_reduce.pdb")
I installed ChimeraX on Ubuntu 22.01 with the .deb from your website and "sudo apt install chimerax.deb"
available bundle cache has not been initialized yet
Executing: runscript chim_4ZKC_H_reduce.py
Traceback (most recent call last):
File "chim_4ZKC_H_reduce.py", line 2, in <module>
from chimera import runCommand
ModuleNotFoundError: No module named 'chimera'
Traceback (most recent call last):
File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/scripting.py", line 84, in open_python_script
_exec_python(session, code, argv)
File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/scripting.py", line 61, in _exec_python
exec(code, sandbox.__dict__)
File "chim_4ZKC_H_reduce.py", line 2, in <module>
from chimera import runCommand
ModuleNotFoundError: No module named 'chimera'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/__main__.py", line 747, in init
run(sess, 'runscript %s' % script)
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/core/commands/runscript.py", line 38, in runscript
open_python_script(session, open(script_file, 'rb'), script_file, argv=argv)
File "/usr/lib/ucsf-chimerax/lib/python3.9/site-packages/chimerax/core/scripting.py", line 90, in open_python_script
raise UserError('Error opening python file %s' % stream.name)