Hi Jamie,
I guess that the first thing to understand is that Chimera and ChimeraX are separate programs with different APIs and are not interoperable.  The script you provided is clearly for the Chimera API and not ChimeraX.  The other thing is that the easiest way to execute a ChimeraX script is within the ChimeraX application itself, typically with the —nogui flag, and possibly with the —script flag and/or —exit flag.  It is possible to use ChimeraX calls in a external Python interpreter, but for that you would need to install the ChimeraX PyPI package, which currently is only available for Mac and also currently does not support executing commands, so you have to find and call the Python functions that those commands execute.
I’m going to guess that the PyPi package route isn’t going to meet your needs, since it looks like you are on Windows, so here is your example script rewritten for ChimeraX:

from chimerax.core.commands import run
file1 = 'C:/Users/jamie/Downloads/temppdb1.pdb'
file2 = 'C:/Users/jamie/Downloads/temppdb2.pdb’

run(f“open {file1} {file2}”)
match_info = run(“mmaker #1 to #2”)

The contents of match_info is described in the doc string of the chimerax.match_maker.match.match function (lines 201-213) and includes RMSD info.

--Eric

Eric Pettersen
UCSF Computer Graphics Lab


On Feb 10, 2024, at 8:04 AM, Dixson, Jamie via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:

Hello,

I would like to use the Matchmaker comparison in ChimeraX (specifically the 'across all' RMSD value given) to compare 10,000+ structures so I would like to incorporate it into a python script in a jupyter notebook.  I am very familiar with scripting with python in jupyter notebooks but I am not as familiar with getting two scripts to work together as appears to be needed to use matchmaker in an existing jupyter script. 

The script I am attempting to use is found below.  I wrote it following some of the guidance in your documentation.
```
#Chimera Command Line
import chimera
import os
from chimera import runCommand as rc # use 'rc' as shorthand for runCommand
from chimera import replyobj # for emitting status messages

file1='C:/Users/jamie/Downloads/temppdb1.pdb'
file2='C:/Users/jamie/Downloads/temppdb2.pdb'

structure1=rc("open " + file1)
structure2=rc("open " + file2)

rc("mmaker structure1 structure2")

```

I get the error 'No chimera module'

I try to install chimera using 'pip install chimera' and it won't install.

Can you offer any guidance on getting this to work?

Best,

Jamie Dixson
_______________________________________________
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/