2D Coordinate Generation

The OEGenerate2DCoordinates function OEChem TK‘s depiction algorithm is capable of assigning 2D coordinates to molecules and reactions. See Figure: Schematic representation of the steps of the 2D coordinate generation. The algorithm uses a built-in ring template dictionary to provide aesthetically pleasing 2D layouts for complex macro-cycles. In case when no built-in template exists, the 2D coordinates of the ring system are generated on-the-fly. After laying out the ring system(s), the algorithm assigns coordinates for acyclic chains and functional groups. In the last step, the algorithm attempts to resolve atom clashes using a variety of heuristics.


Schematic representation of the steps of the 2D coordinate generation in OEChem TK

This built-in dictionary currently contains about 3000 ring-systems that frequently occur in drug-like databases. New ring templates are continuously being added with each release.


To improve the depiction of the ring systems, please run the Extract ring templates script on a 2D molecule file and send the results to support@eyesopen.com. OpenEye will be happy to incorporate the new ring systems in the built-in dictionary in the next release of the toolkits.


OEGenerate2DCoordinates is a low-level function that only assigns 2D coordinates to the given molecule. It is highly recommended to use the OEPrepareDepiction function of OEDepict TK when generating 2D coordinates for molecular depiction. The OEPrepareDepiction function, apart from assigning 2D coordinates also does the following:

  • suppresses or adds explicit hydrogens
  • perceives atom and bond stereo information
  • optimizes the 2D coordinates for horizontal or vertical rendering

User-Defined Ring Dictionary

OEChem TK also allows the customization of the 2D coordinate generation process by providing functionality to extract ring templates from 2D molecule files, build user-defined ring dictionaries, and then plug them into the 2D coordinate generation engine.

The following are the steps to define your own ring dictionaries:

  1. Building a ring dictionary from scratch

    See also

    Example code : Create 2D ring dictionary

  2. Adding new ring templates to an existing ring dictionary

    See also

    Example code : Append to 2D ring dictionary

  3. Generating 2D coordinates with custom ring templates