Source code for mordred.HydrogenBond
from rdkit.Chem import rdMolDescriptors
from ._base import Descriptor
__all__ = (
'HBondAcceptor', 'HBondDonor',
)
class HBondBase(Descriptor):
__slots__ = ()
explicit_hydrogens = False
@classmethod
def preset(cls):
yield cls()
rtype = int
[docs]class HBondAcceptor(HBondBase):
r"""hydrogen bond acceptor descriptor(rdkit wrapper)."""
__slots__ = ()
def __str__(self):
return 'nHBAcc'
def parameters(self):
return ()
def calculate(self):
return rdMolDescriptors.CalcNumHBA(self.mol)
[docs]class HBondDonor(HBondBase):
r"""hydrogen bond donor descriptor(rdkit wrapper)."""
__slots__ = ()
def __str__(self):
return 'nHBDon'
def parameters(self):
return ()
def calculate(self):
return rdMolDescriptors.CalcNumHBD(self.mol)