OEDrawPeptideΒΆ

bool OEDrawPeptide(OEDepict::OEImageBase& image,
                   const OEChem::OEMolBase& mol)

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.

The following code snippet shows how to use the OEDrawPeptide function. The image created is shown in Figure: Example of using the OEDrawPeptide function.

oemolistream ifs;

unsigned int flavor = OEIFlavor::Generic::Default |
                      OEIFlavor::FASTA::EmbeddedSMILES;

ifs.SetFlavor(OEFormat::FASTA, flavor);
ifs.SetFormat(OEFormat::FASTA);

const char fasta[] = 
  ">Custom FASTA\n" 
  "FAVS[[R4]COCC(C(=O)O)Cc1ccccc1]";
ifs.openstring(fasta);

OEGraphMol mol;
OEReadMolecule(ifs, mol);

OEImage image(400, 250);
OEDrawPeptide(image, mol);
OEWriteImage("DrawPeptide.png", image);
../../_images/DrawPeptide.png

Example of using the OEDrawPeptide function

Note

The OEDrawPeptide implementation does not support visualizing large proteins. The number of heavy atoms is limited to 250.