Visualizing Protein-Ligand B-factor Map new

Problem

You want to visualize the B-factor of an active site in order to reveal regions with high flexibility. See example in Figure 1. Atoms with high B-factor (i.e. high flexibility) are colored red, while blue color indicates low B-factors.

hover the mouse over any residue circle to display its B-factor

Figure 1. Example of depicting the B-factor map of 2A1B complex

../_images/bfactormap2img-pdb1a1b.svg

See also

Ingredients

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

Difficulty level

../_images/chilly6.png

Solution

The depict_bfactormap 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. In this example the interactions are used only to position the nearby residues around the depicted ligand.

  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 OERenderBFactorMap function generates an image in which the B-factor is projected into the ligand using a color gradient (red indicates atoms with high B-factor while blue color indicates low B-factors)

    The residue cycles in the image act as hover buttons that reveal the atomic representation of the residue color coded buy the B-factor. The color of the residue cycle indicates the average B-factor of the residue.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
def depict_bfactormap(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.OERenderBFactorMap(image, adisp)

Note

The generated interactive svg images should be included into and HTML page with the SVG MIME type.

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

Download code

bfactormap2img.py

Usage:

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

Discussion

See Discussion subsection of the Visualizing Protein-Ligand B-factor recipe.

See also in OEChem TK manual

Theory

API

See also in OEDepict TK manual

Theory

API

See also in GraphemeTM TK manual

API