• Docs »
  • Visualizing Contact Map new

Visualizing Contact Map new

Problem

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.

Table 1. Example of visualizing active sites
PDB: 1YWR PDB: 1A1B

click on any residues

../_images/contactmap2img-pdb1ywr1.svg

click on any residues

../_images/contactmap2img-pdb1a1b1.svg

Ingredients

  • OEChem TK - cheminformatics toolkit (including OEBio TK)
  • OEDepict TK - molecule depiction toolkit
  • Grapheme TK - molecule and property visualization toolkit

Note

Requires OpenEye toolkits version 2017.Jun or later.

Difficulty level

../_images/chilly6.png ../_images/chilly6.png

Solution

The DepictContactMap illustrates how simple it is to generate these images.

  1. OEInteractionHintContainer object is constructed that stores information about possible interactions between the ligand and the protein.
  2. The interactions are perceived by calling the OEPerceiveInteractionHints function.
  3. The active site is then prepared for 2D depiction by invoking the OEPrepareActiveSiteDepiction function.
  4. When the OE2DActiveSiteDisplay object is constructed, residues are positioned around the ligand close to those atoms which they are interacting with.
  5. 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 svg image file format that supports interactive elements.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
def DepictContactMap(image, protein, ligand, opts):

    # perceive interactions

    asite = OEInteractionHintContainer(protein, ligand)
    if not asite.IsValid():
        OEThrow.Fatal("Cannot initialize active site!")
    asite.SetTitle(ligand.GetTitle())

    OEPerceiveInteractionHints(asite)

    # depiction

    OEPrepareActiveSiteDepiction(asite)
    adisp = OE2DActiveSiteDisplay(asite, opts)

    OERenderContactMap(image, adisp)

Note

The generated svg image be inserted into HTML files with the SVG MIME type:

<object data="<imagename>.svg" type="image/svg+xml"></object>

Download code

contactmap2img.py

Usage:

prompt > wget https://files.rcsb.org/download/1ywr.pdb
prompt > python3 contactmap2img.py -complex 1ywr.pdb -out 1ywr.svg

Discussion

Currently the OEPerceiveInteractionHints function perceives the following interaction types:

All of these interaction types are considered when positioning the residues around the ligand.

See also in OEChem TK manual

Theory

API

See also in OEDepict TK manual

Theory

See also in Grapheme TK manual

API