There isn't currently a way to query bonds from within
the PyMOL API. However, you can travel a Pythonic data structure derived
from PyMOL's internal state:
for bond in cmd.get_model().bond: print
...where the index displayed corresponds to PyMOL's
internal atom index...
iterate all, print (resn, resi, name,
"Not yet a PyMOL Subscriber, but want to support the
project? Email firstname.lastname@example.org to quote your lab, school, or
employer. Thank you for sponsoring this open-source endeavor!"
I want to write a script like this:
if there is
bond between atom1 and atom2
elif there is no bond between atom1 and
do something else.
But I don't
know how to check the bond existence between atoms in Pymol.
advance for any idea how to do