<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Also, if you want to call the Python function for finding H-bonds, it’s find_hbonds() in chimerax.hbonds. I’ve appended the function’s doc string. Note that with default parameters it is going to use strict angle/distance criteria, <i class="">i.e.</i> no additional “slop” added. You can get the recommended slop values from chimerax.hbonds as rec_dist_slop and rec_angle_slop.<div class=""><br class=""></div><div class=""><div class="">--Eric</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Eric Pettersen</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>UCSF Computer Graphics Lab</div><div class=""><br class=""></div><div class=""><div class="">def find_hbonds(session, structures, *, inter_model=True, intra_model=True, donors=None, acceptors=None,</div><div class=""> dist_slop=0.0, angle_slop=0.0, inter_submodel=False, cache_da=False, status=True):</div><div class=""> """Hydrogen bond detection based on criteria in "Three-dimensional</div><div class=""> hydrogen-bond geometry and probability information from a</div><div class=""> crystal survey", J. Computer-Aided Molecular Design, 10 (1996),</div><div class=""> 607-622</div><div class=""><br class=""></div><div class=""> If donors and/or acceptors are specified (as :py:class:`~chimerax.atomic.Atoms` collections</div><div class=""> or anything an Atoms collection can be constructued from), then H-bond donors/acceptors</div><div class=""> are restricted to being from those atoms.</div><div class=""><br class=""></div><div class=""> Dist/angle slop are the amount that distances/angles are allowed to exceed</div><div class=""> the values given in the above reference and still be considered hydrogen bonds.</div><div class=""><br class=""></div><div class=""> 'cache_da' allows donors/acceptors in molecules to be cached if it is anticipated that</div><div class=""> the same structures will be examined for H-bonds repeatedly (e.g. a dynamics trajectory).</div><div class=""><br class=""></div><div class=""> If 'per_coordset' is True and 'structures' contains a single structure with multiple coordinate</div><div class=""> sets, then hydrogen bonds will be computed for each coordset.</div><div class=""><br class=""></div><div class=""> If 'status' is True, progress will be logged to the status line.</div><div class=""><br class=""></div><div class=""> Returns a list of donor/acceptor pairs, unless the conditions for 'per_coordset' are</div><div class=""> satisfied, in which case a list of such lists will be returned, one per coordset.</div><div class=""> """</div></div><div class=""><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 1, 2022, at 7:40 AM, Smith, Harper E. via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">Hi Shivam, </div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><br class=""></div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">Just building on Elaine's suggestion, another easy way to loop through the pdb structures is using glob. Something like</div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><br class=""></div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">import glob</div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">from chimerax.core.commands import run<br class=""></div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">for pdb in glob.glob("your_path/*.pdb"):</div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"> run(session, "open " + pdb)</div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"> # whatever ChimeraX commands</div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><br class=""></div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">Best,</div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">Harper</div><div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);"><br class=""></div><div id="appendonsend" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div><hr tabindex="-1" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline-block; width: 505.671875px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span><div id="divRplyFwdMsg" dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>ChimeraX-users <<a href="mailto:chimerax-users-bounces@cgl.ucsf.edu" class="">chimerax-users-bounces@cgl.ucsf.edu</a>> on behalf of Elaine Meng via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Friday, July 1, 2022 10:30 AM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Shivam Gupta <<a href="mailto:shivam-gupta@pharmafoods.co.jp" class="">shivam-gupta@pharmafoods.co.jp</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>ChimeraX Users Help <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[chimerax-users] scripting to check H-bonds in multiple structures</font><div class=""> </div></div><div class="BodyFragment" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><font size="2" class=""><span style="font-size: 11pt;" class=""><div class="PlainText"><br class=""><br class="">Hi Shivam,<br class="">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. <span class="Apple-converted-space"> </span><br class=""><br class="">(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 class=""><<a href="" class=""></a><a href="https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/commands/hbonds.html__;!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO49j8cpQ$" class="">https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/commands/hbonds.html__;!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO49j8cpQ$</a><span class="Apple-converted-space"> </span>><br class=""><<a href="" class=""></a><a href="https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/tools/hbonds.html__;!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO_wz-gV4$" class="">https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/tools/hbonds.html__;!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO_wz-gV4$</a><span class="Apple-converted-space"> </span>><br class=""><br class="">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 class=""><br class="">(2) put the ChimeraX command(s) from step (1) above into a plain text file named something.cxc<br class=""><<a href="" class=""></a><a href="https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/commands/usageconventions.html*cxc-files__;Iw!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosOYOFuYC0$" class="">https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/commands/usageconventions.html*cxc-files__;Iw!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosOYOFuYC0$</a><span class="Apple-converted-space"> </span>><br class=""><br class="">(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 class=""><<a href="" class=""></a><a href="https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html*forEachFile__;Iw!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO3bQNjp4$" class="">https://urldefense.com/v3/__https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html*forEachFile__;Iw!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO3bQNjp4$</a><span class="Apple-converted-space"> </span>><br class=""><br class="">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 class=""><br class="">I hope this helps,<br class="">Elaine<br class="">-----<br class="">Elaine C. Meng, Ph.D. <span class="Apple-converted-space"> </span><br class="">UCSF Chimera(X) team<br class="">Department of Pharmaceutical Chemistry<br class="">University of California, San Francisco<br class=""><br class=""><br class="">> On Jun 30, 2022, at 10:31 PM, Shivam Gupta via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>> wrote:<br class="">><span class="Apple-converted-space"> </span><br class="">> Hello Chimera Team,<br class="">><span class="Apple-converted-space"> </span><br class="">> I want to explore the possibility of checking the protein-protein interaction (hydrogen bond) in the docked structure using python script.<br class="">><span class="Apple-converted-space"> </span><br class="">> Is it possible to check hydrogen bonds for high throughput data (docked protein structures) using Python?<br class="">><span class="Apple-converted-space"> </span><br class="">> Please guide me over this.<br class="">><span class="Apple-converted-space"> </span><br class="">> Thanks<br class="">><span class="Apple-converted-space"> </span><br class=""><br class=""><br class="">_______________________________________________<br class="">ChimeraX-users mailing list<br class=""><a href="mailto:ChimeraX-users@cgl.ucsf.edu" class="">ChimeraX-users@cgl.ucsf.edu</a><br class="">Manage subscription:<br class=""><a href="https://urldefense.com/v3/__https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users__;!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO2347UwE$" class="">https://urldefense.com/v3/__https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users__;!!KGKeukY!ywCOj9rScLmdHukt6hZ8NdcEHGq2DWt26v4lvUU-IKf0-0ytADpXYHQiDWrFYuwWlphfimVRCLAgdSQLxB7KhfANTosO2347UwE$</a><span class="Apple-converted-space"> </span><br class=""></div></span></font></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">ChimeraX-users mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="mailto:ChimeraX-users@cgl.ucsf.edu" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">ChimeraX-users@cgl.ucsf.edu</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Manage subscription:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote></div><br class=""></div></body></html>