OEDrawPeptide

OEDrawPeptide(image: OEImageBase, mol: Union[OEGraphMol,OEMol,OEQMol]) -> bool
OEDrawPeptide(image: OEImageBase, mol: Union[OEGraphMol,OEMol,OEQMol],
              opts: OEPeptideDisplayOptions) -> bool

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 depicted.

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.

  • The OEDrawPeptide only support standard L-amino acids and there D-amino acid enantiomers.

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)

Full listing.

hover mouse over any amino acid circles

Example of using the OEDrawPeptide function to generate an interactive SVG image

../../_images/DrawPeptide.svg

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