
Hi Mishra, Your open command is "openC:\Users\..." with no space between the "open" and the file path and that is why you get the error. A clearer way to write this code is path = r'C:\Users\anany\Downloads\Research\Test_PDB_Passenger\P35579_MYH9.pdb' run(session, f"open {path}" instead of run(session, "open" + r'C:\Users\anany\Downloads\Research\Test_PDB_Passenger\P35579_MYH9.pdb') Tom
On Mar 12, 2025, at 7:44 AM, mishra.ananya.163--- via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear Sir/Madam,
I am an undergraduate student working on a project and I am trying to generate values for the solvent accessible surface area, mean molecular lipophilicity potential and mean surface electrostatic potential for a dataset involving protein 3D structures (in pdb format). We also plan to introduce point mutations via ChimeraX using the swapaa command and measure the same values for the mutated proteins. As such, we were wondering if there is a way to automate this process of generating the values for each protein, without having to manually do it. We tried to test out some code to see if it is possible to run a python file in ChimeraX.
This was the code we wrote: import chimerax import csv import os from chimerax.core.commands import run run(session, "open" + r'C:\Users\anany\Downloads\Research\Test_PDB_Passenger\P35579_MYH9.pdb') run(session, "color red") run("surf")
However, we received this error message:
openC:\Users\anany\Downloads\Research\Test_PDB_Passenger\P35579_MYH9.pdb Traceback (most recent call last): File "C:\Users\anany\Downloads\Research\Test_PDB_Passenger\test_import.py", line 6, in <module> run(session, "open" + r'C:\Users\anany\Downloads\Research\Test_PDB_Passenger\P35579_MYH9.pdb') File "C:\Program Files\ChimeraX 1.8\bin\Lib\site-packages\chimerax\core\commands\run.py", line 49, in run results = command.run(text, log=log, return_json=return_json) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\ChimeraX 1.8\bin\Lib\site-packages\chimerax\core\commands\cli.py", line 3156, in run raise UserError(self._error) chimerax.core.errors.UserError: Unknown command: openC:\Users\anany\Downloads\Research\Test_PDB_Passenger\P35579_MYH9.pdb
Error opening python file C:\Users\anany\Downloads\Research\Test_PDB_Passenger\test_import.py
We would appreciate your kind assistance! Thank you! _______________________________________________ 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/