Hi Thomas,
I am also interesting in getting bond distances between two pairs of molecule. 
I tried running the commands to suggested but I get an error message e.g
When I tried the following (see below) the fist command was well executed but 
the second gave an error message “ SyntaxError: invalid syntax”

I got a similar error message when I tried to execute  this command D = 
get_raw_distances("distname”)  as well


Sincerely,
Celestine

Example

fetch 2xwu, async=0

# interface polar contacts
distance iface_hbonds, chain A, chain B, mode=2

# dump (model,index) information
get_raw_distances iface_hbonds


-------------------------------------------------
Celestine Chi, PhD
ETH Zürich
Laboratory for Physical Chemistry
Vladimir-Prelog-Weg 2 HCI F 222
CH-8093 Zürich
Email: chi.celest...@phys.chem.ethz.ch<mailto:chi.celest...@phys.chem.ethz.ch>
tele: 004144 63 37510

On May 19, 2017, at 1:16 PM, Thomas Holder 
<thomas.hol...@schrodinger.com<mailto:thomas.hol...@schrodinger.com>> wrote:

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

------------------------------------------------------------------------------
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

Reply via email to