OEAnnotateValenceProblems

bool OEAnnotateValenceProblems(OE2DMolDisplay &disp)

Annotates potential valence problems on the molecule.

disp

The OE2DMolDisplay object being annotated.

The following code snippet show how to use the OEAnnotateValenceProblems function. See the generated image in Figure: Example of molecule with incorrect valences.

OEGraphMol mol = new OEGraphMol();
OEChem.OESmilesToMol(mol, "C[N+](=C)(C)C1CCCCl1");
OEDepict.OEPrepareDepiction(mol);

int width  = 200;
int height = 200;
double scale  = OEScale.AutoScale;
OE2DMolDisplayOptions opts = new OE2DMolDisplayOptions(width, height, scale);

OE2DMolDisplay disp = new OE2DMolDisplay(mol, opts);
OEDepict.OEAnnotateValenceProblems(disp);

OEDepict.OERenderMolecule("OEAnnotateValenceProblems.png", disp);
../../_images/OEAnnotateValenceProblems.png

Example of molecule with incorrect valences

Note

The OEAnnotateValenceProblems function uses the MDL Valence Model.