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.
oemolistream ifs = new oemolistream();
uint flavor = OEIFlavor.Generic.Default |
OEIFlavor.FASTA.EmbeddedSMILES;
ifs.SetFlavor(OEFormat.FASTA, flavor);
ifs.SetFormat(OEFormat.FASTA);
string fasta = ">Custom FASTA\nFAVS[[R4]COCC(C(=O)O)Cc1ccccc1]";
byte[] fastaBytes = Encoding.ASCII.GetBytes(fasta);
ifs.OpenByteArray(fastaBytes, (uint)fastaBytes.Length);
OEGraphMol mol = new OEGraphMol();
OEChem.OEReadMolecule(ifs, mol);
ifs.close();
OEImage image = new OEImage(400, 250);
OEPeptideDisplayOptions opts = new 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