Macs in Chemistry

Insanely Great Science

Scripting Openbabel

 

@MatToddChem recently tweeted

Chemdraw file containing lots of molecules --> separate png/jpg images of each molecule. Anyone got a script that automates that? #headache

Whilst it is possible to convert a ChemDraw file to an image the problem is you get a single png file containing all the structures. In order to get individual image files it is first necessary to separate the individual structures. The easiest way to this is to convert from cdx to SMILES format. We can then take each of the individual SMILES strings and generate an image using OpenBabel all controlled by an Applescript.

blog comments powered by Disqus