OEDrawPeptide¶
bool OEDrawPeptide(OEDepict::OEImageBase& image, const OEChem::OEMolBase& mol)
bool OEDrawPeptide(OEDepict::OEImageBase &image, const OEChem::OEMolBase &mol,
const OEPeptideDisplayOptions &opts)
Draws a molecule after performing substitutions in which standard amino acids components identified in the molecule are replaced by corresponding circular glyphs.
- image
The image on which the molecule is drawn.
- mol
The molecule being draw.
- opts
The OEPeptideDisplayOptions object that stores properties that determine the styles of the peptide depiction.
Note
The OEDrawPeptide
implementation 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 OEDrawPeptide
function to generate an interactive SVG image. The image created is shown in
Figure: Example of using the OEDrawPeptide function.
ifs = oechem.oemolistream()
flavor = (oechem.OEIFlavor_Generic_Default | oechem.OEIFlavor_FASTA_EmbeddedSMILES)
ifs.SetFlavor(oechem.OEFormat_FASTA, flavor)
ifs.SetFormat(oechem.OEFormat_FASTA)
fasta = """>
FAVS[[R4]COCC(C(=O)O)Cc1ccccc1]"""
ifs.openstring(fasta)
mol = oechem.OEGraphMol()
oechem.OEReadMolecule(ifs, mol)
image = oedepict.OEImage(400, 250)
opts = oegrapheme.OEPeptideDisplayOptions()
opts.SetInteractive(True)
oegrapheme.OEDrawPeptide(image, mol, opts)
oedepict.OEWriteImage("DrawPeptide.svg", image)
hover mouse over any amino acid circles
Example of using the OEDrawPeptide 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
OEPeptideDisplayOptions class
OEDrawResidues
function to visualize nonstandard amino acidsGenerating Interactive SVG Images chapter in OEDepict TK manual
Code Example
Depicting Peptides OpenEye Python Cookbook recipe