bool OEDrawResidues(OEDepict::OEImageBase& image, const OEChem::OEMolBase& mol, const bool interactive = false)
Draws a molecule after performing substitutions in which standard amino acids components identified in the molecule are replaced by corresponding circular glyphs.
- The image on which the molecule is drawn.
- The molecule being draw.
- The parameter that determines whether the generated image will be interactive (only available for SVG images) revealing the residue on mouse hover.
The OEDrawResidues does not support visualizing large proteins. The number of heavy atoms is limited to 250.
The following code snippet shows how to use the OEDrawResidues function to generate an interactive SVG image. The image created is shown in Figure: Example of using the OEDrawResidues function. If the molecule has no residue information, if the OEHasResiduese function returns false, then a warning will be throw and no image will be generated.
The OEDrawResidues function allows the visualization of non-standard amino acids. Non-standard amino acid residues are represented with a black jagged circle with the residue labels shown at the center.
hover mouse over any residue circles
Example of using the OEDrawResidues function to generate an interactive SVG image
This interactive functionality is only available for .svg image format.
The generated svg image should be included into and HTML page with the SVG MIME type.
<object data="<imagename>.svg" type="image/svg+xml"></object>