Question: What Are The Best Solutions For 2D Generation Of Small Molecules ?
gravatar for Qud
8.0 years ago by
Qud60 wrote:

I'm searching for a solution to automatically generate 2D molecule representation from different sources (SDF for example).

No graphical interface, library would be a plus.

chemoinformatics library • 4.3k views
ADD COMMENTlink modified 5.3 years ago by Abdul Rafay Khan1.1k • written 8.0 years ago by Qud60

2D coordinate generation or depiction or both?

ADD REPLYlink written 8.0 years ago by Noel O'Boyle40

Yeah, I originally assumed generation of 2D coordinates was meant, but lost confidence in that... clarification most welcome.

ADD REPLYlink written 8.0 years ago by Egon Willighagen5.2k

ADD REPLYlink written 5.3 years ago by Abdul Rafay Khan1.1k
gravatar for Wolf Ihlenfeldt
8.0 years ago by
Wolf Ihlenfeldt150 wrote:

Arguably the best depiction software available is the 2D layouter integrated in the Cactvs toolkit (see for free academic/educational versions). It is used for example in PubChem and by various 3rd-party software vendors (IDBS, Optibrium, etc.).

It provides both coordinate generation and depiction (via multiple renderers, including pixel images [GIF,PNG,bitmaps], SVG, WMF, EMF, PICT, EPS, PDF, MIF, SWF). Full stereochemistry support, including stereo-centers with free electrons, odd and even allenes, square planar stereochemistry - and proper trans double bonds in macrocycles - as far as I know, it is the only layouter which can do that. It knows about standard ring system orientations - so a steroid will always have its well-known appearance, regardless of the order of the input atoms, and pyridine etc. come out with the hetero atom at the bottom, not somewhere random, etc.. Aligned layout on a common substructure fragment is supported, and DNA/RNA/Peptide polymers are automatically recognized and laid out in a proper chain sequence. There is also a basic reaction layouter.

The toolkit has an easily programmed script interpreter, so setting up a batch script with custom parameters is simple. Over 50 structure file formats are automatically recognized and supported, including SDF.

All major platforms (Windows, OSX, Linux, Solaris, FreeBSD) are supported. We sell turnkey solutions for these problems, too, but these are limited to commercial customers. Link libraries for integration into custom software may be licensed.

Neutral comparisons:

ADD COMMENTlink written 8.0 years ago by Wolf Ihlenfeldt150
gravatar for Egon Willighagen
8.0 years ago by
Egon Willighagen5.2k wrote:

The Chemistry Development Kit can do this with the StructureDiagramGenerator. A full code example can be found in this blog post. The basic use looks like:

StructureDiagramGenerator sdg = new StructureDiagramGenerator();
Molecule layedOutMol = sdg.getMolecule();

If your input already has 2D coordinates, then the problem is much simpler, and you only need depiction. Then, you can use the rendering functionality from the CDK. Several tutorial posts can be found as links in this README. This will graphics like:

alt text

ADD COMMENTlink modified 8.0 years ago • written 8.0 years ago by Egon Willighagen5.2k

Except, of course that Molecule has been removed from recent versions? :)

ADD REPLYlink written 8.0 years ago by Gilleain30

Not in the stable release, only in the development release...

ADD REPLYlink written 8.0 years ago by Egon Willighagen5.2k
gravatar for Pierre Lindenbaum
8.0 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum125k wrote:

I wrote a XSLT stylesheet to transform PC-Compound/XML to SVG. See my blog at

xsltproc --stringparam scale 30 --stringparam xradius 2 \
         --stringparam show-bounds false \
         src/xsl/pubchem2svg.xsl \
         CID_16204538.xml > file.svg

alt text

ADD COMMENTlink modified 4 months ago by RamRS25k • written 8.0 years ago by Pierre Lindenbaum125k
gravatar for Michael Kuhn
8.0 years ago by
Michael Kuhn5.0k
EMBL Heidelberg
Michael Kuhn5.0k wrote:

There's a simple tool called mol2ps / mol2png which you can call from the command line.

ADD COMMENTlink written 8.0 years ago by Michael Kuhn5.0k
gravatar for Fredrik
8.0 years ago by
Fredrik30 wrote:

You can also use OpenBabel, either through the command line command obabel or through the API, in c++ or any of the script bindings (e.g. pybel for Python, easiest accessed through Cinfony)

ADD COMMENTlink written 8.0 years ago by Fredrik30
gravatar for Joe Corkery
8.0 years ago by
Joe Corkery10
Cambridge, MA
Joe Corkery10 wrote:

OpenEye's OEDepict library would be a perfect solution for this problem. OEDepict offers rapid 2D coordinate generation and artful rendering of chemical structures. 2D coordinates can be generated from SMILES or from 3D structures. Multiple image file formats are supported including but not limited to: PNG, SVG, PS, EPS, and PDF.

In addition to handling molecule 2D coordinate generation and depiction routines, OEDepict provides a powerful engine that supports:

  • basic shape drawing
  • multiple molecular display options
  • a variety of highlighting styles
  • customizable layout options (including grids and multi-page formatting)
  • depictions aligned by MCS or substructure
  • MDL query and MDL reaction depictions.

The library is written in C++ but has bindings for Python, Java, and .NET. Most standard platforms are supported including Microsoft Windows, Mac OS X, and a wide variety of Linux flavors.

OEDepict is free for non-commercial use and is used widely throughout the pharmaceutical industry and embedded in many third-party applications.

OEDepict also has a companion library, Grapheme TK that provides additional mechanisms to enhance standard 2D depictions based on 3D properties. I've included a few example images below.

alt text

alt text

ADD COMMENTlink written 8.0 years ago by Joe Corkery10
gravatar for Abdul Rafay Khan
5.3 years ago by
Karachi, PK
Abdul Rafay Khan1.1k wrote:

ADD COMMENTlink modified 3 months ago by RamRS25k • written 5.3 years ago by Abdul Rafay Khan1.1k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 934 users visited in the last hour