🔄 Accessing Interaction Hint Information

You want to perceive protein-ligand interaction hints and retrieve interaction information.

See specific examples in the following sections:

Ingredients

  • OEChem TK - cheminformatics toolkit (including OEBio TK)

Difficulty Level

🌶️ 🌶️

Solution

This recipe discusses several examples that show how to perceive and access interaction information.

Hint

If you would like to learn about interaction API before diving into the examples, please see the Overview of OEChem TK Interaction API subsection first.

Perceiving Interaction Hints

The example below shows how to initialize an interaction container (OEInteractionHintContainer) with a ligand and a protein and then perceive interaction hints between them by calling the OEPerceiveInteractionHints function. If the container can not be initialized with the given molecules, the OEIsValidActiveSite function returns False.

def perceive_interaction_hints(
    protein: oechem.OEMolBase,
    ligand: oechem.OEMolBase,
) -> oechem.OEInteractionHintContainer:
    """
    Perceive interaction hint between the protein and ligand.

    Parameters
    ----------
    protein: oechem.OEMolBase
       The molecule of the protein.
    ligand: oechem.OEMolBase
       The molecule of the ligand.

    Raises
    ------
    ValueError
      If the interaction hint container can not be initialized or not interaction perceived.

    Returns
    -------
    oechem.OEInteractionHintContainers
        Container storing the inter and intra-molecular interaction at the active site.

    """
    active_site = oechem.OEInteractionHintContainer()
    active_site.AddMolecule(protein, oechem.OEProteinInteractionHintComponent())
    active_site.AddMolecule(ligand, oechem.OELigandInteractionHintComponent())

    if not oechem.OEIsValidActiveSite(active_site):
        msg = "Cannot initialize active site!"
        raise ValueError(msg)

    if not oechem.OEPerceiveInteractionHints(active_site):
        msg = "No interaction is perceived!"
        raise ValueError(msg)

    return active_site

See also

See Table 1 for a list of interaction types that are currently perceived in OEChem TK.

The previous example shows how to perceive protein-ligand interaction hints using the default geometric constraints. These parameters can be customized by using the OEPerceiveInteractionOptions class. The example below illustrates how to reduce the default distance constraints used to determine Pi and T stacking by 0.5 Ångströms.

def perceive_interaction_hints_user_def_params(
    protein: oechem.OEMolBase,
    ligand: oechem.OEMolBase,
) -> oechem.OEInteractionHintContainer:
    """
    Perceive interaction hint between the protein and ligand.

    Parameters
    ----------
    protein: oechem.OEMolBase
       The molecule of the protein.
    ligand: oechem.OEMolBase
       The molecule of the ligand.

    Raises
    ------
    ValueError
      If the interaction hint container can not be initialized or not interaction perceived.

    Returns
    -------
    oechem.OEInteractionHintContainers
        Container storing the inter and intra-molecular interaction at the active site.

    """
    active_site = oechem.OEInteractionHintContainer()
    active_site.AddMolecule(protein, oechem.OEProteinInteractionHintComponent())
    active_site.AddMolecule(ligand, oechem.OELigandInteractionHintComponent())
    if not oechem.OEIsValidActiveSite(active_site):
        msg = "Cannot initialize active site!"
        raise ValueError(msg)

    # set user defined parameters for interaction perception
    opts = oechem.OEPerceiveInteractionOptions()
    opts.SetMaxPiStackDistance(opts.GetMaxPiStackDistance() - 0.5)
    opts.SetMaxTStackDistance(opts.GetMaxTStackDistance() - 0.5)

    if not oechem.OEPerceiveInteractionHints(active_site, opts):
        msg = "No interaction is perceived!"
        raise ValueError(msg)

    return active_site

The next example shows how to initialize an interaction container (OEInteractionHintContainer) from a design unit (OEDesignUnit)

def perceive_interaction_hints_from_design_unit(
    design_unit: oechem.OEDesignUnit,
) -> oechem.OEInteractionHintContainer:
    """
    Perceive interaction hint from design unit.

    Raises
    ------
    ValueError
      If the interaction hint container can not be initialized or not interaction perceived.

    Returns
    -------
    oechem.OEInteractionHintContainers
        Container storing the inter and intra-molecular interaction at the active site.

    """
    active_site = oechem.OEInteractionHintContainer(design_unit)

    if not oechem.OEIsValidActiveSite(active_site):
        msg = "Cannot initialize active site!"
        raise ValueError(msg)

    if not oechem.OEPerceiveInteractionHints(active_site):
        msg = "No interaction is perceived!"
        raise ValueError(msg)

    return active_site

The following example shows how to initialize an interaction container (OEInteractionHintContainer) from a complex molecule by splitting it into protein, ligand using the OESplitMolComplex function.

def perceive_interaction_hints_from_complex(
    complex_mol: oechem.OEMolBase,
    water_part_of_protein: bool,
) -> oechem.OEInteractionHintContainer:
    """
    Perceive interaction hint from complex molecule.

    Parameters
    ----------
    complex_mol: oechem.OEMolBase
        The complex molecule containing both protein and ligand.
    water_part_of_protein: bool
        Whether water should be considered part of the protein.

    Raises
    ------
    ValueError
        If the complex cannot be separated or no interaction is perceived.

    Returns
    -------
    oechem.OEInteractionHintContainer
        Container storing the inter and intra-molecular interaction at the active site.

    """
    ligand = oechem.OEGraphMol()
    protein = oechem.OEGraphMol()
    water = oechem.OEGraphMol()
    other = oechem.OEGraphMol()

    split_opts = oechem.OESplitMolComplexOptions()
    if water_part_of_protein:
        split_opts.SetProteinFilter(
            oechem.OEOrRoleSet(
                split_opts.GetProteinFilter(), split_opts.GetWaterFilter()
            )
        )
        split_opts.SetWaterFilter(
            oechem.OEMolComplexFilterFactory(oechem.OEMolComplexFilterCategory_Nothing)
        )

    oechem.OESplitMolComplex(ligand, protein, water, other, complex_mol, split_opts)

    if ligand.NumAtoms() == 0:
        msg = "Cannot separate complex!!"
        raise ValueError(msg)

    active_site = oechem.OEInteractionHintContainer()
    active_site.AddMolecule(protein, oechem.OEProteinInteractionHintComponent())
    active_site.AddMolecule(ligand, oechem.OELigandInteractionHintComponent())

    if not oechem.OEIsValidActiveSite(active_site):
        msg = "Cannot initialize active site!"
        raise ValueError(msg)

    if not oechem.OEPerceiveInteractionHints(active_site):
        msg = "No interaction is perceived!"
        raise ValueError(msg)

    return active_site

Accessing Interactions

This subsection shows several examples about how to iterate over interactions and access information from them.

The first simple code snippet shows how to loop over the interactions and count them. The OEInteractionHintContainer.GetInteractions method returns an iterator over all the OEInteractionHint object stored in the container.

def num_interactions(active_site: oechem.OEInteractionHintContainer) -> int:
    """Return the number of interactions."""
    return len(list(active_site.GetInteractions()))

The next code snippet shows how to count only the intra-molecular interactions by utilizing the OEInteractionHint.IsIntra method.

def num_intra_interactions(active_site: oechem.OEInteractionHintContainer) -> int:
    """Return the number of intra-molecular interactions."""
    num_inters = 0
    for i in active_site.GetInteractions():
        if i.IsIntra():
            num_inters += 1
    return num_inters

Alternatively, you can use the OEIsIntraInteractionHint interaction predicates to do the same. If a predicate is passed to the OEInteractionHintContainer.GetInteractions method, it only returns interactions which satisfy the given predicate.

def num_intra_interactions_predicate(
    active_site: oechem.OEInteractionHintContainer,
) -> int:
    """Return the number of intra-molecular interactions (using predicate)."""
    return len(
        list(active_site.GetInteractions(oechem.OEIsIntraInteractionHint())),
    )

See also

See the Interaction predicates subsection for the list of interaction predicates available in OEChem TK,

Even though OEChem TK provides a wide selection of built-in interaction predicates, a need might arise to write user-defined predicates. The following two examples show how to implement and utilize your own predicates.

In the first example, the IsCarbonContactInteraction predicate returns True for contact interaction type between two carbon atoms. It uses the OEInteractionHint.GetBgnFragment and OEInteractionHint.GetEndFragment methods to retrieve the two interacting fragments (OEInteractionHintFragment) stored in the OEInteractionHint object.

class IsCarbonContactInteraction(oechem.OEUnaryInteractionHintPred):
    """Predicate to identify carbon contact interactions."""

    def __call__(self, inter: oechem.OEInteractionHint) -> bool:
        """Evaluate interaction."""
        # check the type if the interactions
        if inter.GetInteractionType() != oechem.OEContactInteractionHint():
            return False

        # check that the interaction is between two carbon atoms
        return all(
            frag.GetAtom(oechem.OEIsCarbon()) is not None
            for frag in [inter.GetBgnFragment(), inter.GetEndFragment()]
        )

A user-defined predicate can be used exactly the same way as the built-in ones:

def num_carbon_contact_interactions(
    active_site: oechem.OEInteractionHintContainer,
) -> int:
    """Return the number of carbon contact interactions."""
    return len(list(active_site.GetInteractions(IsCarbonContactInteraction())))

The predicate of the second example is a bit more complicated and shows how the OEHasResidueInteractionHint built-in predicate has been implemented in OEChem TK. The HasResidueInteraction predicate returns True if the OEInteractionHint object stores interaction for the given residue (OEResidue).

class HasResidueInteraction(oechem.OEUnaryInteractionHintPred):
    """Predicate to identify interaction with given residue."""

    def __init__(self, residue: oechem.OEResidue) -> None:
        """Initialize predicate."""
        oechem.OEUnaryInteractionHintPred.__init__(self)
        self._residue = residue
        self._atom_pred = oechem.OEAtomIsInResidue(residue)

    def __call__(self, inter: oechem.OEInteractionHint) -> bool:
        """Evaluate interaction."""
        for frag in [inter.GetBgnFragment(), inter.GetEndFragment()]:
            for _ in frag.GetAtoms(self._atom_pred):
                return True
        return False

    def CreateCopy(self):  # noqa: ANN201, N802
        """Copy constructor."""
        return HasResidueInteraction(self.residue).__disown__()

The following code snippet counts the number of interactions for the ‘TRP-275-A’ residue.

def num_residue_interactions(active_site: oechem.OEInteractionHintContainer) -> int:
    """Return the number of interaction for a specific residue."""
    res = oechem.OEResidue()
    res.SetName("TRP")
    res.SetChainID("A")
    res.SetResidueNumber(275)

    return len(list(active_site.GetInteractions(HasResidueInteraction(res))))

OEChem TK predicates can be combined with logical operations. The example below counts the number of stacking interaction for the ‘TRP-275-A’ residue.

def num_stacking_residue_interactions(
    active_site: oechem.OEInteractionHintContainer,
) -> int:
    """Return the number of stacking interactions."""
    res = oechem.OEResidue()
    res.SetName("TRP")
    res.SetChainID("A")
    res.SetResidueNumber(275)

    residue_pred = HasResidueInteraction(res)
    stacking_pred = oechem.OEIsStackingInteractionHint()

    return len(
        list(
            active_site.GetInteractions(
                oechem.OEAndInteractionHint(residue_pred, stacking_pred),
            ),
        ),
    )

Similarly you can use the OEOrInteractionHint and OENotInteractionHint logical operations combine built-in and user-defined predicates to express complex conditions.

Accessing Interaction Atoms

This subsection shows several examples about how to access the atom of an interaction. The first two code snippets show how to retrieve ligand atoms that belong to any interactions stored in the given interaction container.

In the first code snippet, the ligand component of an interaction container is retrieved, then the atoms of the ligand molecule are being looped over and checked whether they belong to any of the interactions stored in the container by calling the OEInteractionHintContainer.HasInteraction method. This method returns True if there is at least one interaction that matches the given predicate. In this example the predicate is OEHasInteractionHint that identifies interactions with the given atom. You can find out more about interaction predicates in the Accessing Interactions subsection.

def get_ligand_atoms(
    active_site: oechem.OEInteractionHintContainer,
) -> list[oechem.OEAtomBase]:
    """Return a list of ligand atoms."""
    ligand = active_site.GetMolecule(oechem.OELigandInteractionHintComponent())
    return [
        atom
        for atom in ligand.GetAtoms()
        if active_site.HasInteraction(oechem.OEHasInteractionHint(atom))
    ]

In the second example, the interactions of the container are looped over. Each interaction stores two fragments (OEInteractionHintFragment). If a fragment belongs to the ligand component then its atoms are added to ligand atom set.

It is important to collect the ligand atoms in a set (rather than in a list as in the previous example). While in the previous example, atom can be added to a list only once, in the second example, when looping over interactions, a ligand atom can be encountered more than once since an atom can belong to more than one interaction.

def get_ligand_frag_atoms(
    active_site: oechem.OEInteractionHintContainer,
) -> list[oechem.OEAtomBase]:
    """Return a list of unique ligand fragment atoms."""
    atoms: set[oechem.OEAtomBase] = set()
    for inter in active_site.GetInteractions():
        for frag in [inter.GetBgnFragment(), inter.GetEndFragment()]:
            if frag.GetComponentType() == oechem.OELigandInteractionHintComponent():
                for atom in frag.GetAtoms():
                    atoms.add(atom)
    return list(atoms)

If you want to access protein atoms, you have to replace the OELigandInteractionHintComponent type with OEProteinInteractionHintComponent in the previous two examples. For example:

def get_protein_atoms(
    active_site: oechem.OEInteractionHintContainer,
) -> list[oechem.OEAtomBase]:
    """Return a list of protein atoms."""
    protein = active_site.GetMolecule(oechem.OEProteinInteractionHintComponent())
    return [
        atom
        for atom in protein.GetAtoms()
        if active_site.HasInteraction(oechem.OEHasInteractionHint(atom))
    ]

In the following examples, atom predicates are used to collect only the subset of the ligand atoms. The code snippet below demonstrates how to retrieve only nitrogen ligand atoms. It uses the OEIsNitrogen atom predicate which is one of built-in predicate available in OEChem TK.

def get_ligand_nitrogen_atoms(
    active_site: oechem.OEInteractionHintContainer,
) -> list[oechem.OEAtomBase]:
    """Return a list of ligand nitrogen atoms."""
    ligand = active_site.GetMolecule(oechem.OELigandInteractionHintComponent())
    return [
        atom
        for atom in ligand.GetAtoms(oechem.OEIsNitrogen())
        if active_site.HasInteraction(oechem.OEHasInteractionHint(atom))
    ]

See also

See the Atom predicates subsection for the list of atom predicates available in OEChem TK

Even though OEChem TK provides a wide selection of built-in atom predicates, a need might arise to write a user-defined predicate. The following example shows how to implement and utilize such a predicate.

class HasAtomicNumber(oechem.OEUnaryAtomPred):
    """Predicate to identify atoms with given atomic numbers."""

    def __init__(self, atom_list: list[int]) -> None:
        """Initialize predicate."""
        oechem.OEUnaryAtomPred.__init__(self)
        self.atomic_list = atom_list

    def __call__(self, atom: oechem.OEAtomBase) -> bool:
        """Evaluate atom."""
        return atom.GetAtomicNum() in self.atomic_list

    def CreateCopy(self):  # noqa: ANN201, N802
        """Copy constructor."""
        return HasAtomicNumber(self.atomic_list).__disown__()
def get_ligand_oxygen_nitrogen_atoms(
    active_site: oechem.OEInteractionHintContainer,
) -> list[oechem.OEAtomBase]:
    """Return a list of ligand atoms that are either nitrogen or oxygen."""
    ligand = active_site.GetMolecule(oechem.OELigandInteractionHintComponent())
    atom_pred = HasAtomicNumber([oechem.OEElemNo_O, oechem.OEElemNo_N])
    return [
        atom
        for atom in ligand.GetAtoms(atom_pred)
        if active_site.HasInteraction(oechem.OEHasInteractionHint(atom))
    ]

OEChem TK predicates can be combined with logical operations. In the example below, only chain nitrogen atoms that belong to interactions are collected.

def get_ligand_chain_nitrogen_atoms(
    active_site: oechem.OEInteractionHintContainer,
) -> list[oechem.OEAtomBase]:
    """Return a list of ligand nitrogen atoms that are in a chain."""
    ligand = active_site.GetMolecule(oechem.OELigandInteractionHintComponent())
    return [
        atom
        for atom in ligand.GetAtoms(
            oechem.OEAndAtom(oechem.OEIsNitrogen(), oechem.OEAtomIsInChain())
        )
        if active_site.HasInteraction(oechem.OEHasInteractionHint(atom))
    ]

Similarly, you can use the OEOrAtom and OENotAtom logical operations to combine built-in predicates and express complex conditions.

The interactions perceived by the OEPerceiveInteractionHints function are typed. See Table 1 for a list of interaction types that are currently perceived in OEChem TK. This means that it is quite easy to iterate over atoms and check whether they belong to a specific interaction type.

The code snippet below collects ligand atoms that are part of a stacking interaction, utilizing the OEIsStackingInteractionHint built-in predicate.

def get_ligand_stacking_atoms(
    active_site: oechem.OEInteractionHintContainer,
) -> list[oechem.OEAtomBase]:
    """Return a list of ligand atoms in any stacking interaction."""
    stacking_pred = oechem.OEIsStackingInteractionHint()
    ligand = active_site.GetMolecule(oechem.OELigandInteractionHintComponent())

    return [
        atom
        for atom in ligand.GetAtoms()
        if active_site.HasInteraction(
            oechem.OEAndInteractionHint(
                oechem.OEHasInteractionHint(atom), stacking_pred
            )
        )
    ]

See also

See the Interaction predicates subsection for the list of interaction predicates available in OEChem TK,

Some interaction types are also associated with a namespace that enables you to subtype the interaction. For example, the OEStackingInteractionHintType namespace corresponds to the OEStackingInteractionHint interaction type. The following example shows how to access ligand atoms that are in a Pi-stacking interaction.

def get_ligand_pi_stacking_atoms(
    active_site: oechem.OEInteractionHintContainer,
) -> list[oechem.OEAtomBase]:
    """Return the list if atoms in any pi stacking interaction."""
    stacking_subtype = oechem.OEStackingInteractionHint(
        oechem.OEStackingInteractionHintType_Pi,
    )
    stacking_pred = oechem.OEHasInteractionHintType(stacking_subtype)
    ligand = active_site.GetMolecule(oechem.OELigandInteractionHintComponent())

    return [
        atom
        for atom in ligand.GetAtoms()
        if active_site.HasInteraction(
            oechem.OEAndInteractionHint(
                oechem.OEHasInteractionHint(atom), stacking_pred
            )
        )
    ]

Retrieving Interacting Residues

The following example demonstrates how to retrieve protein residues that are involved in interactions with the ligand.

def get_ligand_interacting_residues(
    active_site: oechem.OEInteractionHintContainer,
    ignore_contact: bool,
    ignore_water: bool,
) -> Iterator[oechem.OEResidue]:
    """
    Return the residues that have interactions with the ligand.

    Parameters
    ----------
    active_site: oechem.OEInteractionHintContainer
        The active site containing the interaction hints.
    ignore_contact: bool
        Whether to ignore contact interactions.
    ignore_water: bool
        Whether to ignore water residues.

    Returns
    -------
    Iterator[oechem.OEResidue]
        An iterator of residues that have interactions with the ligand, excluding those that are filtered out by
        the ignore_contact and ignore_water parameters.

    """
    returned_residues: set[oechem.OEResidue] = set()

    water_pred = oechem.OEIsWater() if ignore_water else oechem.OEIsFalseAtom()
    for inter in active_site.GetInteractions():
        if (
            ignore_contact
            and inter.GetInteractionType() == oechem.OEContactInteractionHint()
        ):
            continue
        if inter.IsIntra():
            continue  # ignore intra-molecular interactions
        for frag in [inter.GetBgnFragment(), inter.GetEndFragment()]:
            if frag.GetComponentType() == oechem.OEProteinInteractionHintComponent():
                for atom in frag.GetAtoms():
                    if water_pred(atom):
                        continue
                    if not oechem.OEHasResidue(atom):
                        continue
                    res = oechem.OEAtomGetResidue(atom)
                    if res not in returned_residues:
                        returned_residues.add(res)
                        yield res

Accessing Calculated Interaction Hint Geometries

When interaction hints are perceived using the OEPerceiveInteractionHints function, various geometries (such as distances and angles) are calculated that are checked against the geometric constraints stored in the given OEPerceiveInteractionOptions class.

def print_calculated_geometries(active_site: oechem.OEInteractionHintContainer) -> None:
    """Print calculated geometries for all interactions present in the active site."""
    for interaction_type in oechem.OEGetActiveSiteInteractionHintTypes():
        for inter in active_site.GetInteractions(
            oechem.OEHasInteractionHintType(interaction_type)
        ):
            print(  # noqa: T201
                f"Calculated geometries for '{interaction_type.GetName()}' interaction type:",
            )
            for geom in inter.GetCalculatedGeometries():
                print(f"\t {geom}")  # noqa: T201
            break  # print geometries for only one interaction of each type

See also

While the OEPerceiveInteractionHints function identifies protein-ligand interactions, it does not explicitly track the hydrogens involved. However, these hydrogens can be determined from the calculated geometric parameters stored with each interaction. The following example demonstrates how to identify hydrogens participating in intermolecular hydrogen bonding by using the calculated donor-angle geometry.

def get_hbond_interaction_hydrogen(
    inter: oechem.OEInteractionHint,
) -> oechem.OEAtomBase | None:
    """
    Get the hydrogen atom participating in the given intra-molecular hydrogen bond interaction.

    This function identifies the hydrogen atom involved in a hydrogen bond interaction
    based on the calculated geometry associated with the interaction, if available,
    otherwise returns None.
    """
    if inter.IsIntra():
        return None

    lig_comp = oechem.OELigandInteractionHintComponent()
    pro_comp = oechem.OEProteinInteractionHintComponent()

    accepts: oechem.OEAtomBase | None = None
    donates: oechem.OEAtomBase | None = None

    if any(
        inter.GetInteractionType() == oechem.OEHBondInteractionHint(a)
        for a in [
            oechem.OEHBondInteractionHintType_LigandAccepts,
            oechem.OEHBondInteractionHintType_NonIdealLigandAccepts,
        ]
    ):
        accepts = inter.GetFragment(lig_comp).GetAtom(oechem.OEIsTrueAtom())
        donates = inter.GetFragment(pro_comp).GetAtom(oechem.OEIsTrueAtom())

    if any(
        inter.GetInteractionType() == oechem.OEHBondInteractionHint(a)
        for a in [
            oechem.OEHBondInteractionHintType_LigandDonates,
            oechem.OEHBondInteractionHintType_NonIdealLigandDonates,
        ]
    ):
        accepts = inter.GetFragment(pro_comp).GetAtom(oechem.OEIsTrueAtom())
        donates = inter.GetFragment(lig_comp).GetAtom(oechem.OEIsTrueAtom())

    if not accepts or not donates or not inter.HasCalculatedGeometry("donor-angle"):
        return None

    if donates.GetExplicitHCount() == 1:
        # if there is only one hydrogen, return it directly
        for hydrogen in donates.GetAtoms(oechem.OEIsHydrogen()):
            return hydrogen

    a_coords = oechem.OEDoubleArray(3)
    accepts.GetParent().GetCoords(accepts, a_coords)
    d_coords = oechem.OEDoubleArray(3)
    donates.GetParent().GetCoords(donates, d_coords)

    stored_angle = inter.GetCalculatedGeometry("donor-angle")  # in radians
    h_coords = oechem.OEDoubleArray(3)
    for hydrogen in donates.GetAtoms(oechem.OEIsHydrogen()):
        hydrogen.GetParent().GetCoords(hydrogen, h_coords)

        angle = oechem.OEGeom3DAngle(h_coords, d_coords, a_coords)
        if math.isclose(
            angle, stored_angle, abs_tol=0.001
        ):  # allow for some deviation from calculated angle
            return hydrogen

    return None

Serializing Interaction

Interaction perceived by the OEPerceiveInteractionHints function can be serialized in either .oeb or .json file format. For more details see 🆕 Serialize Protein-Ligand Interactions.

Discussion

Overview of OEChem TK Interaction API

OEChem TK provides the following API to perceive protein-ligand interactions:

OEPerceiveInteractionHints

The function that perceives protein-ligand interactions.

OEPerceiveInteractionOptions

The class that stores the parameters that control the interaction perception.

The default geometric parameters have been set based on literature data ([Kumar-2002], [Cavallo-2016], [Bissantz-2010], and [Marcou-2007] ).

Code examples

../_images/interactionhint.svg

Figure 1. Schematic representation of interaction container

OEChem TK provides the following API to store and access protein-ligand interactions:

OEInteractionHintContainer

This is the main container that stores typed molecules (OEMolBase), fragments of those molecules (OEInteractionHintFragment) and typed interactions (OEInteractionHint) between the fragments.

OEInteractionHintComponentTypeBase

The abstract class that enables typing of molecules stored in the interaction container. Each molecule added to the container has to have a specific type. Currently, there are two built-in component types available:

OEInteractionHintFragment

Set of atoms of a molecule that is stored in the interaction container. These are the atoms that contribute to an interaction (OEInteractionHint). Some interactions such as hydrogen bonds are between two atoms, other ones define interactions between set of atoms. For example a stacking interaction is between atoms of two aromatic ring systems.

OEInteractionHint

An interaction is defined between two fragments (OEInteractionHintFragment) stored in the container. An interaction can be either inter (OEInteractionHint.IsInter) or intra (OEInteractionHint.IsIntra) molecular. Each interaction has a specific type that is derived from the OEInteractionHintTypeBase class.

OEInteractionHintTypeBase

The abstract class that enables typing of interactions stored in the interaction container. The table below shows the specific interaction types currently available in OEChem TK. Some interaction classes are also associated with namespaces that enable subtype the main interaction types. For example, the stacking interaction has two subtypes:

Table 1. Interaction types currently available in OEChem TK

name

corresponding interaction class

corresponding interaction type namespace

cation-pi

OECationPiInteractionHint

OECationPiInteractionHintType

chelator

OEChelatorInteractionHint

OEChelatorInteractionHintType

clash

OEClashInteractionHint

None

contact

OEContactInteractionHint

None

covalent

OECovalentInteractionHint

None

halogen bond

OEHalogenBondInteractionHint

OEHalogenBondInteractionHintType

hydrogen bond

OEHBondInteractionHint

OEHBondInteractionHintType

salt-bridge

OESaltBridgeInteractionHint

OESaltBridgeInteractionHintType

stacking (T and Pi)

OEStackingInteractionHint

OEStackingInteractionHintType

Other related API:

OEIsValidActiveSite

The function that checks whether the interaction container initialized correctly as active site i.e. containing two molecules: one typed as ligand and one typed as protein.

OEGetActiveSiteInteractionHintTypes

The function that iterates over all interaction types (including subtypes) that are perceived by the OEPerceiveInteractionHints function.

Atom predicates

OEChem TK provides an extensive set of built-in atom predicates, the most common ones are listed in the following table.

Table 2. Common OEChem TK atom predicates

Access

Functor Name

aromatic atoms

OEIsAromaticAtom

ring atoms

OEAtomIsInRing

chain atoms

OEAtomIsInChain

atoms with specified residue

OEAtomIsInResidue

atoms with specified atomic number

OEHasAtomicNum

hetero atoms

OEIsHetero

The following logical operations allow to combine both the built-in and the user defined atom predicates.

Table 3. OEChem TK atom composition functors

Logical operation

Composite Functor Name

Logical and

OEAndAtom

Logical or

OEOrAtom

Logical not

OENotAtom

See also

For the full list of atom predicates, see the following sections in the OEChem TK manual:

Code examples

Interaction predicates

The table below lists all interaction predicates that are currently available in OEChem TK.

Table 4. OEChem TK interaction predicates

Access interactions

Functor Name

with given interaction type

OEHasInteractionHintType

with given atom

OEHasInteractionHint

with given residue

OEHasResidueInteractionHint

contact

OEIsContactInteractionHint

hydrogen bond

OEIsHBondInteractionHint

inter-molecular hydrogen bond

OEIsIntermolecularHBondInteractionHint

intra-molecular hydrogen bond

OEIsIntramolecularHBondInteractionHint

chelator

OEIsChelatorInteractionHint

inter-molecular chelator

OEIsIntermolecularChelatorInteractionHint

intra-molecular chelator

OEIsIntramolecularChelatorInteractionHint

covalent

OEIsCovalentInteractionHint

clash

OEIsClashInteractionHint

salt-bridge

OEIsSaltBridgeInteractionHint

T and Pi-stacking

OEIsStackingInteractionHint

cation-Pi

OEIsCationPiInteractionHint

halogen bond

OEIsHalogenBondInteractionHint

inter-molecular

OEIsInterInteractionHint

intra-molecular

OEIsIntraInteractionHint

unpaired ligand

OEIsUnpairedLigandInteractionHint

unpaired protein

OEIsUnpairedProteinInteractionHint

The following logical operations allow to combine both the built-in and the user defined interaction predicates.

Table 5. OEChem TK interactions composition functors

Logical operation

Composite Functor Name

Logical and

OEAndInteractionHint

Logical or

OEOrInteractionHint

Logical not

OENotInteractionHint

Code examples

See also in OEChem TK manual

API