Hi Ahmad, Unfortunately there is no proper API for this. But I can think of two approaches. Note that the results can differ because the two method do slightly different h-bond detection!
1) Use "cmd.find_pairs" with mode=1 on "donors" and "acceptors" selection. Example: sele1 = "chain A & (donors | acceptors)" sele2 = "chain B & (donors | acceptors)" radius = 3.5 D = cmd.find_pairs(sele1, sele2, mode=1, cutoff=radius) print("number of h-bonds:", len(D)) 1) Use "cmd.distance" and the "get_raw_distances" script. Example: run https://raw.githubusercontent.com/Pymol-Scripts/Pymol-script-repo/master/get_raw_distances.py sele1 = "chain A" sele2 = "chain B" radius = 3.5 cmd.distance("distname", sele1, sele2, mode=2, cutoff=radius) D = get_raw_distances("distname") print("number of h-bonds:", len(D)) See also: https://pymolwiki.org/index.php/Get_raw_distances https://pymolwiki.org/index.php/Distance https://pymolwiki.org/index.php/Find_pairs Hope that helps. Cheers, Thomas > On May 5, 2017, at 5:08 AM, Ahmad Abdelzaher <underoath...@gmail.com> wrote: > > I know I can can find the hydrogen bond interactions between a > selection and surrounding residues within a certain radius. I would > like to find a way to retrieve the actual count of those interactions > per residue. How can I do it in the API? > > Regards. -- Thomas Holder PyMOL Principal Developer Schrödinger, Inc. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net