Inquiry Regarding Feasibility of Implementing Protein Operations in Python

Sorry. The earlier email by ms04000106@gmail.com was not sent using a university email address. It has been resent using the university email address. Dear UCSF ChimeraX, I hope this email finds you well. My name is Mayu Shibuya, and I am a student at Iwate University, currently affiliated with the wet biology laboratory. I am reaching out to seek guidance on the feasibility of utilizing the software for a specific task. Specifically, I am interested in performing addh and addcharge operations and automating these processes using a Python script. However, I do not know whether the addh and addcharge operations can be executed in Python. Could you kindly provide guidance on the possibility of achieving this with the software? If it is indeed feasible, I would greatly appreciate any instructions or methods you recommend for implementing these operations in a Python script. Thank you for taking the time to consider my inquiry. I greatly appreciate your assistance and look forward to hearing from you soon. Best regards, Mayu Shibuya Iwate University g0423019@iwate-u.ac.jp

Dear Mayu Shibuya, You don't have to use a university email address, but if you signed up to this list it will work best if you use the same address you gave when you signed up. I can't answer about Python specifically (somebody else may help with that), but if you have the input structures as separate PDB files, there is a way to automate running several commands on each of them without using Python: In ChimeraX, you can run a command script (.cxc) file on each structure, if you have a set of input files for those structures. It does it one by one instead of having all the structures open at the same time. (1) First you figure out the commands to run on each structure. It is OK if you want a different output file name for each structure, there is a way to do it, more about this below. (2) then using your favorite text-editor, just create a plain text file containing the same commands you would have typed into the command line. This is a command script or command file; you should name the file something that ends with .cxc Command files: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/usageconventions.html#cxc-...> (3) then use the "open" command to open and run this .cxc file, including the "forEachFile" option to specify what set of structure files you want to apply it to. The description of "forEachFile" includes examples and also explains how you would get a different output file for each input file by including "$" in the save command inside the file: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#forEachFile> It will automatically close each structure before going on to the next one. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Nov 28, 2023, at 1:56 AM, g0423019 g0423019 via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Sorry. The earlier email by ms04000106@gmail.com was not sent using a university email address. It has been resent using the university email address.
Dear UCSF ChimeraX,
I hope this email finds you well. My name is Mayu Shibuya, and I am a student at Iwate University, currently affiliated with the wet biology laboratory.
I am reaching out to seek guidance on the feasibility of utilizing the software for a specific task. Specifically, I am interested in performing addh and addcharge operations and automating these processes using a Python script.
However, I do not know whether the addh and addcharge operations can be executed in Python.
Could you kindly provide guidance on the possibility of achieving this with the software? If it is indeed feasible, I would greatly appreciate any instructions or methods you recommend for implementing these operations in a Python script.
Thank you for taking the time to consider my inquiry. I greatly appreciate your assistance and look forward to hearing from you soon.
Best regards, Mayu Shibuya Iwate University g0423019@iwate-u.ac.jp

Hi Mayu, I don't know if Elaine's suggestions cover your needs or not, but here's more info about using Python directly. It's unclear from your mail if you want to write a Python script that runs within ChimeraX, or in some outside Python interpreter. For the former, the easiest way is to just run the command equivalents from within your script. Let's say you had a structure in a variable named 's'. You could add hydrogens and charges with: from chimerax.core.commands import run run(session, "addh " + s.atomspec) run(session, "addcharge " + s.atomspec) If for some reason you don't want to use command equivalents, the function to add hydrogens is chimerax.addh.cmd.cmd_addh (so not really designed for public use, but still useable) and to add charges is chimerax.add_charge.add_charges. If you need this script to run in an outside interpreter, there is a ChimeraX · PyPI <https://pypi.org/project/ChimeraX/> package, that does not include any UI code and currently does not have the command-execution machinery, so you would definitely have to use the APIs I just mentioned. The package will undoubtedly be challenging to use since it has almost no documentation about getting started. In particular you have to create your own Session object, and have to get the data into the form ChimeraX uses, usually by using the pdb or mmcif modules to read it in. --Eric Eric Pettersen UCSF Computer Graphics Lab
On Nov 28, 2023, at 8:32 AM, Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Dear Mayu Shibuya, You don't have to use a university email address, but if you signed up to this list it will work best if you use the same address you gave when you signed up.
I can't answer about Python specifically (somebody else may help with that), but if you have the input structures as separate PDB files, there is a way to automate running several commands on each of them without using Python:
In ChimeraX, you can run a command script (.cxc) file on each structure, if you have a set of input files for those structures. It does it one by one instead of having all the structures open at the same time.
(1) First you figure out the commands to run on each structure. It is OK if you want a different output file name for each structure, there is a way to do it, more about this below.
(2) then using your favorite text-editor, just create a plain text file containing the same commands you would have typed into the command line. This is a command script or command file; you should name the file something that ends with .cxc
Command files: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/usageconventions.html#cxc-...>
(3) then use the "open" command to open and run this .cxc file, including the "forEachFile" option to specify what set of structure files you want to apply it to. The description of "forEachFile" includes examples and also explains how you would get a different output file for each input file by including "$" in the save command inside the file:
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#forEachFile>
It will automatically close each structure before going on to the next one.
I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Nov 28, 2023, at 1:56 AM, g0423019 g0423019 via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Sorry. The earlier email by ms04000106@gmail.com was not sent using a university email address. It has been resent using the university email address.
Dear UCSF ChimeraX,
I hope this email finds you well. My name is Mayu Shibuya, and I am a student at Iwate University, currently affiliated with the wet biology laboratory.
I am reaching out to seek guidance on the feasibility of utilizing the software for a specific task. Specifically, I am interested in performing addh and addcharge operations and automating these processes using a Python script.
However, I do not know whether the addh and addcharge operations can be executed in Python.
Could you kindly provide guidance on the possibility of achieving this with the software? If it is indeed feasible, I would greatly appreciate any instructions or methods you recommend for implementing these operations in a Python script.
Thank you for taking the time to consider my inquiry. I greatly appreciate your assistance and look forward to hearing from you soon.
Best regards, Mayu Shibuya Iwate University g0423019@iwate-u.ac.jp
_______________________________________________ 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 (3)
-
Elaine Meng
-
Eric Pettersen
-
g0423019 g0423019