<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Hi Shivam, </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Just building on Elaine's suggestion, another easy way to loop through the pdb structures is using glob. Something like</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
import glob</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
from chimerax.core.commands import run<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
for pdb in glob.glob("your_path/*.pdb"):</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
run(session, "open " + pdb)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
# whatever ChimeraX commands</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Best,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Harper</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> ChimeraX-users <chimerax-users-bounces@cgl.ucsf.edu> on behalf of Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu><br>
<b>Sent:</b> Friday, July 1, 2022 10:30 AM<br>
<b>To:</b> Shivam Gupta <shivam-gupta@pharmafoods.co.jp><br>
<b>Cc:</b> ChimeraX Users Help <chimerax-users@cgl.ucsf.edu><br>
<b>Subject:</b> [chimerax-users] scripting to check H-bonds in multiple structures</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
Hi Shivam,<br>
I don't know Python so I can't answer about that part. However, you might be able to do without python, at least if each docked structure is a separate input file.
<br>
<br>
(1) first figure out what ChimeraX command(s) you want to run on each structure. You would do this by interactively using ChimeraX on one or two example structures, before you try to put commands into a script. Either you can try using the "hbonds" command
directly by typing it into the command line, or you can use the H-Bonds GUI interface to choose the options that you want, and then click Apply -- this will show the resulting command in the Log. See:<br>
<<a href=""></a>https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/commands/hbonds.html__;!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO49j8cpQ$ ><br>
<<a href=""></a>https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/tools/hbonds.html__;!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO_wz-gV4$ ><br>
<br>
If each docked structure is a separate input file (e.g. each one is a separate PDB file) then you can try the following two additional steps:<br>
<br>
(2) put the ChimeraX command(s) from step (1) above into a plain text file named something.cxc<br>
<<a href=""></a>https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/commands/usageconventions.html*cxc-files__;Iw!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosOYOFuYC0$ ><br>
<br>
(3) use the "open" command to run the .cxc file and its "forEachFile" option to specify looping through all the PDB files. For an example, see:<br>
<<a href=""></a>https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html*forEachFile__;Iw!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO3bQNjp4$ ><br>
<br>
However, if all the dockings are together in a single big file you may instead need to use python to loop through them as models (e.g. #2.1, 2.2, 2.3, etc.) and run the command(s) from step (1) above. Somebody else would have to advise on that.<br>
<br>
I hope this helps,<br>
Elaine<br>
-----<br>
Elaine C. Meng, Ph.D. <br>
UCSF Chimera(X) team<br>
Department of Pharmaceutical Chemistry<br>
University of California, San Francisco<br>
<br>
<br>
> On Jun 30, 2022, at 10:31 PM, Shivam Gupta via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:<br>
> <br>
> Hello Chimera Team,<br>
> <br>
> I want to explore the possibility of checking the protein-protein interaction (hydrogen bond) in the docked structure using python script.<br>
> <br>
> Is it possible to check hydrogen bonds for high throughput data (docked protein structures) using Python?<br>
> <br>
> Please guide me over this.<br>
> <br>
> Thanks<br>
> <br>
<br>
<br>
_______________________________________________<br>
ChimeraX-users mailing list<br>
ChimeraX-users@cgl.ucsf.edu<br>
Manage subscription:<br>
<a href="https://urldefense.com/v3/__https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users__;!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO2347UwE$">https://urldefense.com/v3/__https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users__;!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO2347UwE$</a>
<br>
</div>
</span></font></div>
</body>
</html>