Visualizing Protein-Ligand Contacts¶
You want to generate an interactive image (in
svg file format) that
depicts the active site i.e. the ligand and the nearby residues.
The interactive images allows to reveal or hide those atoms that are interacting
with a given residue. See example in Figure 1.
click on any residues to reveal which part of the ligand it interacts with
Figure 1. Example of depicting the contact map of 2A1B complex
The depict_contactmap illustrates how simple it is to generate these images.
- OEInteractionHintContainer object is constructed that stores information about possible interactions between the ligand and the protein.
- The interactions are perceived by calling the OEPerceiveInteractionHints function.
- The active site is then prepared for 2D depiction by invoking the OEPrepareActiveSiteDepiction function.
- When the OE2DActiveSiteDisplay object is constructed, residues are positioned around the ligand close to those atoms which they are interacting with.
- The OERenderContactMap function generates an image in which each residue
cycle behaves as a toggle button. By clicking on a residue cycle, the
ligand atoms with which the given residue interacts are revealed or hidden.
The generated images has to be written out in
svgimage file format that supports interactive elements.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
def depict_contactmap(image, protein, ligand, opts): # perceive interactions asite = oechem.OEInteractionHintContainer(protein, ligand) if not asite.IsValid(): oechem.OEThrow.Fatal("Cannot initialize active site!") asite.SetTitle(ligand.GetTitle()) oechem.OEPerceiveInteractionHints(asite) # depiction oegrapheme.OEPrepareActiveSiteDepiction(asite) adisp = oegrapheme.OE2DActiveSiteDisplay(asite, opts) oegrapheme.OERenderContactMap(image, adisp)
prompt > wget https://files.rcsb.org/download/1ywr.pdb prompt > python3 contactmap2img.py -complex 1ywr.pdb -out 1ywr.svg
Currently the OEPerceiveInteractionHints function perceives the following interaction types:
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
All of these interaction types are considered when positioning the residues around the ligand.
The default geometric parameters used by the OEPerceiveInteractionHints function have been set based on literature data ([Kumar-2002], [Cavallo-2016], [Bissantz-2010], and [Marcou-2007] ). The interaction parameters can be customized by using the OEPerceiveInteractionOptions class.
Since the interaction perception dependents on the position of hydrogens, it is highly recommended to optimize those positions prior to the perception. See more details in the Protein Preparation chapter of the OEChem TK manual.
See also in OEChem TK manual¶
See also in OEDepict TK manual¶
- OEImage class