OEKekulize

bool OEKekulize(OEMolBase &)

Determine a valid Kekulé form for a molecule. On input, the integer bond types of each bond should be set to 1 for single, 2 for double, 3 for triple, 4 for quadruple and 5 for an aromatic (or resonant bond). On output, the bond order property of each bond is set to the integer bond types, except for bonds marked type 5, which are assigned as either single or double as required. The formal charges and implicit hydrogen counts of each atom must be correctly specified prior to calling this function. The OEKekulize function returns false and throws a warning if the integer bond types are not set correctly. Newly created bonds will have their integer types set to 0 by default. These will need to be set to the appropriate values before calling OEKekulize; see the Kekulé Assignment of New Bonds section for examples.

Note that this function will not clear the aromatic flags associated with atoms and bonds. These flags may affect resulting output (e.g. SMILES) or downstream processing. So, if these effects are not desired, the function OEClearAromaticFlags should be used.

See also