OEDrawResidues
bool OEDrawResidues(OEDepict::OEImageBase& image,
const OEChem::OEMolBase& mol,
const bool interactive = false)
The OEDrawResidues function depicts the residue graph of a molecule
with up to 300 heavy atoms.
It is recommended to use when a molecule is imported from a PDB file that automatically assigns
residues (OEResidue) to each atom.
- image
The image on which the molecule is drawn.
- mol
The molecule being depicted.
- interactive
The parameter that determines whether the generated image will be interactive (only available for
SVG`images) revealing the residue on mouse hover.
Note
The OEDrawResidues does not support
visualizing large proteins. The number of heavy atoms is limited to 250.
Example:
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 OEHasResidues
function returns false, then a warning will be throw and no image will be generated.
OEImage image(400, 250);
const auto interactive = true;
OEDrawResidues(image, mol, interactive);
OEWriteImage("DrawResidues.svg", image);
The OEDrawResidues function allows the visualization of nonstandard
amino acids. Nonstandard 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
Note
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>
See also
OEDrawPeptidefunction to depict a peptide with standard amino acidsOEDrawMonomerGraphandOEHighlightMonomersfunctions to depict molecules initialized from HELMGenerating Interactive SVG Images chapter in OEDepict TK manual