2
$\begingroup$

I have a sdf file for around 50 small-molecules for which I am doing structure-activity study. I would like to draw 2d graphs of all the molecules such that the image would fit into a single journal page. For example, in this paper, page number 3, they have listed 2d molecular structure. I have attached the image file from the same paper. I have software tools like MarvinSketch which give me 2d or 3d graph for a given sdf file. But I want the integrated image like shown below suitable for publication. List of 2d molecular graphs

$\endgroup$
3
$\begingroup$

An SDF file is just a bunch of MOL entries in a single file; $$$$ serves as the separator for the individual entries.

Splitting into individual files AND simultaneous conversion to graphic file formats (PNG, SVG) is possible with Open Babel, either directly on the command line or through scripts/programmes using the bindings available for various programming languages, such as Pybel for Python.

To my knowledge, the direct generation of PostScript files - probably the nicest option when using $\LaTeX$ - is not possible, so you might want to used SVG as an alternate vector-based format.

obabel -isdf lotsofstructures.sdf -m -osvg -xC -xu -xd -O basename.svg

will do the job.

-isdf specifies the input file format, -m does the splitting, -osvg specifies the output file format, and -O basename.svg specifies the prefix and extension for the individual numbered output files that are generated. -xC prevents that terminal carbon atoms are printed explicitly with attached hydrogen atoms. Surely a matter of taste, but I wouldn't want to have lots of $\ce{-CH3}$ in the drawings. -xu prevents the use of colour for heteroatoms and generates a black and white drawing. -xd suppressed the name of the compound to be written and displayed in the SVG file.

This should work for SDF files with 2D and 3D coordinates, but in the latter case I'd suggest to check it carefully; I've seen 3D -> 2D transformations on some molecules that went wrong.

$\endgroup$
  • $\begingroup$ I don't think we have any interest in adding PDF or PS output, although there are a few svg2pdf utilities out there. $\endgroup$ – Geoff Hutchison Sep 15 '14 at 17:51
  • 2
    $\begingroup$ Incidentally, if you find cases where 3D -> 2D does not work, please send an e-mail to the list or file a bug report. I'd like to see these and fix them. Thanks! $\endgroup$ – Geoff Hutchison Sep 15 '14 at 17:51
2
$\begingroup$

Check out this Wikipedia page which lists molecule editors, many of which are licensed under GNU GPL.

An inexpensive (50-60 USD) program for drawing chemical structures is Chemdoodle. Despite not being free, you get some user friendliness and features (like reaction building) for the cost.

$\endgroup$
2
$\begingroup$

This looks like a combination of individual SDF images and some sort of Table editor. A program that can take your PNGs rendered from SDF files and create this table layout is $\LaTeX$, or perhaps plain $\TeX$ or (my favorite) ConTeXt.

You have a number of constraints: a) a free program that b) makes intricate tables and c) handles SDF images. You probably want it to be easy to use, as well.

I don't know of any single open source program that will simultaneously satisfy these conditions. There probably isn't one.

I know for sure that Mathematica can take care of b) and c). You can get it for $100 if you are academic. But then you have to learn it.

The easiest way to make this is probably to render all of your images as graphics, and then lay everything out in Microsoft Excel or Word Table Editor, changing the column widths and grid lines to suit you. (But this is Microsoft Office, and is not open source, so again, b) and c) )

$\endgroup$
  • $\begingroup$ Perhaps LibreOffice will work, and then you have a) b) and c). $\endgroup$ – Eric Brown May 30 '13 at 21:00
  • $\begingroup$ given that you have each separate images, can you give me a brief outline how would you do this in LaTex? $\endgroup$ – DurgaDatta May 31 '13 at 5:39
  • $\begingroup$ I would look into the makecell package and \includegraphics command. $\endgroup$ – Eric Brown May 31 '13 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.