Visualizing Protein-Ligand B-factor Map new¶
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
- Visualizing Protein-Ligand B-factor recipe that shows an alternative visualization of the same information
The depict_bfactormap 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. In this example the interactions are used only to position the nearby residues around the depicted ligand.
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 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)
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>
prompt > wget https://files.rcsb.org/download/1ywr.pdb prompt > python3 bfactormap2img.py -complex 1ywr.pdb -out 1ywr.svg -interactivelegend
See also in OEChem TK manual¶
See also in OEDepict TK manual¶
- OEImage class