<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Depth-First: Encapsulated PostScript for Cheminformatics</title>
    <link>http://depth-first.com/articles/2008/08/07/encapsulated-postscript-for-cheminformatics</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Walking the Web of Chemical Informatics</description>
    <item>
      <title>Encapsulated PostScript for Cheminformatics</title>
      <description>&lt;p&gt;&lt;a href="http://flickr.com/photos/kellysmith/2477843609/"&gt;&lt;img src="http://depth-first.com/demo/20080807/vector.jpg" align="right"&gt;&lt;/img&gt;&lt;/a&gt;Previous articles have discussed ways to display chemical structures in a variety of vector graphics formats, including &lt;a href="http://depth-first.com/articles/2006/09/09/generating-and-serving-2-d-molecular-svgs"&gt;Scalable Vector Graphics&lt;/a&gt; (SVG), &lt;a href="http://depth-first.com/articles/2008/07/22/vector-markup-language-for-cheminformatics"&gt;Vector Markup Language&lt;/a&gt; (VML), and &lt;a href="http://depth-first.com/articles/2008/06/10/adobe-flash-for-cheminformatics-fast-scalable-and-attractive-2d-depiction-of-chemical-structures-with-vector-graphics"&gt;Shockwave Flash&lt;/a&gt; (SWF, or "Flash"). There is one other vector graphics format still in common use that has so far not been discussed: &lt;a href="http://en.wikipedia.org/wiki/Encapsulated_PostScript"&gt;Encapsulated PostScript&lt;/a&gt; (EPS).&lt;/p&gt;

&lt;p&gt;EPS is a vector graphics format developed by Adobe Systems specifically for desktop publishing. Apparently, the last revision to the EPS Specification, Version 3.0, was &lt;a href="http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf"&gt;published&lt;/a&gt; in 1992. Although ancient as technologies go, EPS can still be found in use today. Like the other vector graphics formats discussed here, EPS has all of the features necessary to create high-quality 2D images of chemical structures.&lt;/p&gt;

&lt;p&gt;To demonstrate, a development version of &lt;a href="http://metamolecular.com/chemwriter"&gt;ChemWriter&lt;/a&gt; was used to convert a molfile representing &lt;a href="http://chempedia.com/monographs/rosuvastatin"&gt;rosuvastatin&lt;/a&gt; (Crestor) into the corresponding color EPS file. The result can be &lt;a href="http://depth-first.com/demo/20080807/rosuvistatin.eps"&gt;downloaded here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;An open source library, &lt;a href="http://jlibeps.sourceforge.net/"&gt;jlibeps&lt;/a&gt;, can be used to encode EPS in Java. The business end of the library is an EPS encoding class that extends Graphics2D, enabling most Java2D rendering to be converted into EPS. If you've worked with the &lt;a href="http://xmlgraphics.apache.org/batik/"&gt;Batik&lt;/a&gt; SVG toolkit, the concept is similar.&lt;/p&gt;

&lt;p&gt;Although jlibeps is a good solution, EPS shares enough similarities to other vector graphics languages that directly encoding EPS output is also a viable option, and the one that was used in the rosuvastatin example above.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Image Credit: &lt;a href="http://flickr.com/photos/kellysmith/"&gt;Kelly Smith&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 07 Aug 2008 10:46:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:4548ca7b-8cca-4c1e-85a0-8243ad7e5412</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/08/07/encapsulated-postscript-for-cheminformatics</link>
      <category>Tools</category>
      <category>eps</category>
      <category>jlibeps</category>
      <category>java</category>
    </item>
    <item>
      <title>"Encapsulated PostScript for Cheminformatics" by Rich Apodaca</title>
      <description>&lt;p&gt;Gilbert,&lt;/p&gt;

&lt;p&gt;Thanks for bringing up &lt;a href="http://merian.pch.univie.ac.at/~nhaider/cheminf/mol2ps.html" rel="nofollow"&gt;mol2ps&lt;/a&gt;.  I remember &lt;a href="http://depth-first.com/articles/2007/04/13/roll-your-own-chemical-database-with-free-components" rel="nofollow"&gt;looking at it&lt;/a&gt; in the context of free chemical database components. I believe I even tried to compile it to Java bytecode using &lt;a href="http://depth-first.com/articles/2007/10/31/jinchi-run-inchi-anywhere-java-runs" rel="nofollow"&gt;NestedVM&lt;/a&gt; and the Pascal compiler at one point, but without success.&lt;/p&gt;

&lt;p&gt;I've depicted the rosuvistatin molfile using mol2ps and put the output &lt;a href="http://depth-first.com/demo/20080807/rosuvistatin_mol2ps.eps" rel="nofollow"&gt;here&lt;/a&gt; for comparison. Looks like PostScript 2.0 output. Although I can open it with &lt;a href="http://www.gnu.org/software/gv/" rel="nofollow"&gt;gv&lt;/a&gt;, it doesn't seem to open with Gimp like the output from ChemWriter does.&lt;/p&gt;</description>
      <pubDate>Tue, 12 Aug 2008 14:10:10 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:3455b81d-fd21-43af-95c5-173c7f8dd7d2</guid>
      <link>http://depth-first.com/articles/2008/08/07/encapsulated-postscript-for-cheminformatics#comment-675</link>
    </item>
    <item>
      <title>"Encapsulated PostScript for Cheminformatics" by gilbert.r.mueller atwebdotde</title>
      <description>&lt;p&gt;Prof N. Haider (university of vienna) has published a very nice solution for 2D depiction of molecular structures in ps format, using Ghostscript to convert ps-files to bitmaps: mol2ps
It is configurable, licensed under GNU, available for different systems (linux, FreeBSD, Win) and can be googled via "mol2ps haider".&lt;/p&gt;</description>
      <pubDate>Tue, 12 Aug 2008 11:03:09 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:5f898cd2-ea12-41c9-b8c3-6a256b0410e2</guid>
      <link>http://depth-first.com/articles/2008/08/07/encapsulated-postscript-for-cheminformatics#comment-674</link>
    </item>
    <item>
      <title>"Encapsulated PostScript for Cheminformatics" by Rajarshi Guha</title>
      <description>&lt;p&gt;I actually don't know how one would embed EPS into PDF - the iText library directly generates PDF. I used it in the draw2d example program (&lt;a href="http://tinyurl.com/6j2cr4" rel="nofollow"&gt;http://tinyurl.com/6j2cr4&lt;/a&gt;)&lt;/p&gt;</description>
      <pubDate>Mon, 11 Aug 2008 20:52:17 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:2a168274-ed77-4241-9e6d-48384c28f673</guid>
      <link>http://depth-first.com/articles/2008/08/07/encapsulated-postscript-for-cheminformatics#comment-673</link>
    </item>
    <item>
      <title>"Encapsulated PostScript for Cheminformatics" by Rich Apodaca</title>
      <description>&lt;p&gt;Rajarshi, interesting idea. The example does set a BoundingBox of 0 0 300 300.&lt;/p&gt;

&lt;p&gt;But I haven' tried to embed these EPSs into PDFs. What else would be necessary? &lt;/p&gt;</description>
      <pubDate>Mon, 11 Aug 2008 16:08:49 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:19f8af27-04ab-4fca-83ab-4ecd5a5b353d</guid>
      <link>http://depth-first.com/articles/2008/08/07/encapsulated-postscript-for-cheminformatics#comment-672</link>
    </item>
    <item>
      <title>"Encapsulated PostScript for Cheminformatics" by Rajarshi Guha</title>
      <description>&lt;p&gt;It should be relatively simple to provide PDF output as well (using somethinglike iText). One thing that would be very useful is to set the appropriate bounding box, so that rather than having an image on a whole page, the output size would simply be the size of the minimum bounding rectangle.&lt;/p&gt;</description>
      <pubDate>Mon, 11 Aug 2008 13:32:49 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:49fa38a6-dd19-49f3-aea4-412c8c77b5ce</guid>
      <link>http://depth-first.com/articles/2008/08/07/encapsulated-postscript-for-cheminformatics#comment-671</link>
    </item>
  </channel>
</rss>
