<?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: Tag swf</title>
    <link>http://depth-first.com/articles/tag/swf</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Walking the Web of Chemical Informatics</description>
    <item>
      <title>Smarter Cheminformatics: From SD File to Image Collection with ChemPhoto</title>
      <description>&lt;p&gt;&lt;a href="http://metamolecular.com/chemphoto"&gt;&lt;img src="http://depth-first.com/demo/20080908/chemphoto.png" align="right"&gt;&lt;/img&gt;&lt;/a&gt;The old adage says time is money. Unfortunately, working chemists are often forced to spend a remarkable amount of valuable time and mental effort on menial chemical information processing tasks. These are things that could be done faster and with better quality by the right software, if it were available. Most importantly, these tasks take resources away from much more valuable work that &lt;em&gt;can't&lt;/em&gt; be automated.&lt;/p&gt;

&lt;h4&gt;The Problem in a Nutshell&lt;/h4&gt;

&lt;p&gt;As a case in point, consider the creation of 2D chemical structure images. If you maintain a compound collection of any kind, sooner or later you may end up asking yourself how you can create a set of images depicting the chemical structures in your collection.&lt;/p&gt;

&lt;h4&gt;A Specific Example: Chemical Suppliers&lt;/h4&gt;

&lt;p&gt;For example, you might work for a chemical supplier that maintains a Web-based eCommerce site, one or more PDF catalogs, or printed brochures. Your customers are chemists and they expect to see chemical structures in your product listings. How can you make this happen?&lt;/p&gt;

&lt;p&gt;If you look around for software that automates this job, you'll more likely than not come up empty-handed. The software that solves this problem well simply doesn't exist yet.&lt;/p&gt;

&lt;h4&gt;Doing it the Hard Way&lt;/h4&gt;

&lt;p&gt;In the absence of software to solve the problem, the only way to get the job done is to buckle down and do it manually. Most chemical structure editors allow you to save output as a raster image. Provided that this output matches your requirements, your system might consist of the following steps:&lt;/p&gt;

&lt;p&gt;(1) For every product in your catalog, create a single molfile or its machine-readable equivalent.&lt;/p&gt;

&lt;p&gt;(2) Load one file into your editor.&lt;/p&gt;

&lt;p&gt;(3) Save the file as a raster image, being careful to make sure all of the drawing settings and image size parameters are identical to the rest of your images.&lt;/p&gt;

&lt;p&gt;(4) Repeat Steps (2)-(3) until you have all of your images.&lt;/p&gt;

&lt;p&gt;There are many problems with this approach. For example, if your images ever need to be made larger (or smaller), you'll have to create all of your images over again (which can easily number in the thousands). Similarly, if for some reason you want to change the appearance of the images such as background, atom label coloring, or line thicknesses, you'll be forced into a lot of manual work. Finally, this system requires you to keep track of structures that have been imaged and those that haven't, which can in itself be nontrivial and error-prone, especially for thousands of products.&lt;/p&gt;

&lt;p&gt;With the right software, this problem would disappear.&lt;/p&gt;

&lt;h4&gt;One Solution: Customized Imaging Service&lt;/h4&gt;

&lt;p&gt;My company, &lt;a href="http://metamolecular.com"&gt;Metamolecular&lt;/a&gt;, has recently provided custom imaging services to a few chemical suppliers wanting thousands of good-looking structure images rendered automatically. The service made use of the versatile &lt;a href="http://metamolecular.com/chemwriter"&gt;ChemWriter&lt;/a&gt; rendering engine together with some custom code written in &lt;a href="http://depth-first.com/articles/tag/ruby"&gt;Ruby&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Although the imaging service works very well as a one-off solution, it's less than optimal in the longer term. Any changes to the image collection must be processed by Metamolecular, and then sent back to the client. A cheaper and faster solution would be to offer software that implements the functionality of the service.&lt;/p&gt;

&lt;h4&gt;A Better Solution: Chemical Structure Imaging Software&lt;/h4&gt;

&lt;p&gt;Wouldn't it be great if easy-to-use software existed that could automatically generate thousands of chemical structure images with the press of a button?&lt;/p&gt;

&lt;p&gt;In particular, the software should:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Run on any modern platform (Windows, Mac OS X, Linux).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Read industry-standard Structure Data Files (SD Files).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be capable of working with tens of thousands of chemical structures at a time even on older machines.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Store fully-customizable drawing settings in a format that could be used over and over again for a consistent and professional look.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Allow the output to be previewed exactly as it will appear in the generated images ("what you see is what you get").&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Output to a variety of image formats, including: Portable Network Graphics (PNG image); JPG image; &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;Flash&lt;/a&gt; (SWF file); &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); and &lt;a href="http://depth-first.com/articles/2008/08/07/encapsulated-postscript-for-cheminformatics"&gt;Encapsulated PostScript&lt;/a&gt; (EPS file).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Introducing ChemPhoto&lt;/h4&gt;

&lt;p&gt;ChemPhoto is designed to solve the problem of consistently creating large numbers of high-quality 2D chemical structure images. Currently in development, the first versions of ChemPhoto will be available for review within the next two weeks.&lt;/p&gt;

&lt;p&gt;ChemPhoto consists of a lightweight and intuitive user interface layer built on top of the ChemWriter rendering engine. ChemPhoto focuses on doing one thing very well, so it wouldn't be useful for creating or editing SD Files (a task for which many tools already exist). The software is specifically designed to work well with large SD Files, such as the 25,000-structure sets that can be obtained from &lt;a href="http://pubchem.ncbi.nlm.nih.gov/"&gt;PubChem&lt;/a&gt;. Written in Java, ChemPhoto runs on Windows, Mac OS X, and Linux. Future articles will discuss ChemPhoto's design and implementation.&lt;/p&gt;

&lt;p&gt;If you're interested in evaluating ChemPhoto, feel free to &lt;a href="http://mailhide.recaptcha.net/d?k=01R9bxyP6XNdc0duoUCzBBHA==&amp;amp;c=vZ7R0VDctRzIRzbSs1-LZwDzjTjAnfCS4KONqGHxY9I=" onclick="window.open('http://mailhide.recaptcha.net/d?k=01R9bxyP6XNdc0duoUCzBBHA==&amp;amp;c=vZ7R0VDctRzIRzbSs1-LZwDzjTjAnfCS4KONqGHxY9I=', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;" title="Reveal this e-mail address"&gt;drop me a line&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Mon, 08 Sep 2008 19:04:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:e69d3005-c83f-463b-9826-e08b4339f91a</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/09/08/smarter-cheminformatics-from-sd-file-to-image-collection-with-chemphoto</link>
      <category>Tools</category>
      <category>chemphoto</category>
      <category>image</category>
      <category>png</category>
      <category>jpg</category>
      <category>swf</category>
      <category>svg</category>
      <category>eps</category>
      <category>sdfile</category>
      <category>automation</category>
    </item>
    <item>
      <title>Adobe Flash for Cheminformatics: Chemul, a 3D Structure Viewer</title>
      <description>&lt;p&gt;&lt;center&gt;&lt;object width="400" height="420"&gt;&lt;param name="movie" value="http://hossy.net/chemul/swf/?mol=zFg07CUMvyunY7UM&amp;amp;config=0KSnRaUMdt"&gt;&lt;/param&gt;&lt;embed src="http://hossy.net/chemul/swf/?mol=zFg07CUMvyunY7UM&amp;amp;config=0KSnRaUMdt" type="application/x-shockwave-flash" width="400" height="420"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://depth-first.com/articles/tag/flash"&gt;Previous articles&lt;/a&gt; have discussed the use of Adobe Flash for cheminformatics. &lt;a href="http://www.javac.jp/"&gt;Tetsuya Hoshi&lt;/a&gt; has created a 3D structure viewer (embedded above) called &lt;a href="http://hossy.net/chemul/"&gt;Chemul&lt;/a&gt; that can be used with the Flash Player and which is written in &lt;a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/"&gt;ActionScript 3.0&lt;/a&gt;. Although the documentation is written in Japanese, it appears that Chemul supports multiple display options, as evidenced &lt;a href="http://www.javac.jp/flash/molecular/moleculardraw003/index.html"&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Thu, 14 Aug 2008 16:27:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0b203cb6-4117-4a64-a06a-23d9a14c2f53</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/08/14/adobe-flash-for-cheminformatics-chemul-a-3d-structure-viewer</link>
      <category>Tools</category>
      <category>chemul</category>
      <category>flash</category>
      <category>swf</category>
      <category>3d</category>
    </item>
    <item>
      <title>Chemistry, The Web, and Netflix</title>
      <description>&lt;p&gt;&lt;img src="http://depth-first.com/demo/20080611/python.png" align="right"&gt;&lt;/img&gt;If you've ever rented movies from &lt;a href="http://netflix.com"&gt;Netflix&lt;/a&gt;, you've probably noticed the information box that pops up when you hover over a movie image. If you just want a quick peek at what a movie is all about, this simple feature can save a great deal of time and effort in mousing around, clicking, and general navigation annoyance. It turns out that chemical compounds have a lot in common with movies in that they both can be referred to through one or more identifiers and they both have a lot of interesting metadata linked to them. This article shows that what works for Netflix can also work for chemistry.&lt;/p&gt;

&lt;h4&gt;The Problem&lt;/h4&gt;

&lt;p&gt;Interpreting IUPAC nomenclature and references to compound numbers is a major chore when working with chemistry experimental sections. When paper documents are used, this typically involves flipping pages back and forth many times between the narrative and the experimental section. With Web documents, this is usually either impossible or very inconvenient, and so the PDF is printed to paper.&lt;/p&gt;

&lt;h4&gt;A Demonstration&lt;/h4&gt;

&lt;p&gt;The following text is an edited and re-formatted passage taken from &lt;a href="http://www.beilstein-journals.org/bjoc/content/supplementary/1860-5397-4-5-S1.doc"&gt;the experimental section&lt;/a&gt; of &lt;a href="http://dx.doi.org/10.1186/1860-5397-4-5"&gt;a paper&lt;/a&gt; published in &lt;a href="http://www.beilstein-journals.org/bjoc/home/home.htm"&gt;&lt;em&gt;Beilstein Journal of Organic Chemistry&lt;/em&gt;&lt;/a&gt;. If you hover over any hyperlink for half a second or more, a balloon will pop up showing you the chemical structure of the substance being referred to. Mousing away from the link hides the balloon.&lt;/p&gt;

&lt;script type="text/javascript" src="http://depth-first.com/demo/20080611/js/balloon.js"&gt;&lt;/script&gt;

&lt;script type="text/javascript" src="http://depth-first.com/demo/20080611/js/yahoo-dom-event.js"&gt;&lt;/script&gt; 

&lt;script&gt; var balloon = new Balloon;&lt;/script&gt;

&lt;blockquote&gt;
&lt;p&gt;
&lt;strong&gt;&lt;a href="http://dx.doi.org/10.1186/1860-5397-4-5" onmouseover="balloon.showTooltip(event,'load:34')"&gt;1-[(1R)-1-(2- {[tert-Butyl(dimethyl)silyl]oxy}ethylhexyl] -2-piperidinone&lt;/a&gt; (34)&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://dx.doi.org/10.1186/1860-5397-4-5" onmouseover="balloon.showTooltip(event,'load:rbr')"&gt;5-Bromopentanoyl chloride&lt;/a&gt; (1.84&amp;nbsp;g, 9.25&amp;nbsp;mmol) was added to a stirred solution of &lt;a href="http://dx.doi.org/10.1186/1860-5397-4-5" onmouseover="balloon.showTooltip(event,'load:32')"&gt;primary amine &lt;strong&gt;32&lt;/strong&gt;&lt;/a&gt; (2.00&amp;nbsp;g, 7.71 mmol) in dry 1,2-dichloroethane (30&amp;nbsp;cm&lt;sup&gt;3&lt;/sup&gt;), followed by anhydrous NaHCO&lt;sub&gt;3&lt;/sub&gt; (0.78&amp;nbsp;g, 9.25&amp;nbsp;mmol). The reaction mixture was left to stir at room temperature for 16&amp;nbsp;h. The resulting mixture was filtered through a pad of celite, which was then washed with CH&lt;sub&gt;2&lt;/sub&gt;Cl&lt;sub&gt;2&lt;/sub&gt;. The combined filtrate and washings were then evaporated in vacuo to yield a crude orange oil (4.06&amp;nbsp;g), which was purified by column chromatography on silica gel with hexane-EtOAc (7:3) as eluent to give the &lt;a href="http://dx.doi.org/10.1186/1860-5397-4-5" onmouseover="balloon.showTooltip(event,'load:33')"&gt;5-bromo-N-[(1R)-1- (2-{[tert-butyl(dimethyl)silyl]oxy}ethyl)hexyl pentanamide&lt;/a&gt; &lt;strong&gt;33&lt;/strong&gt; as an orange oil (2.92&amp;nbsp;g, 89%).
&lt;/p&gt;
&lt;p&gt;
A portion of the &lt;a href="http://dx.doi.org/10.1186/1860-5397-4-5" onmouseover="balloon.showTooltip(event,'load:33')"&gt;bromoamide&lt;/a&gt; &lt;strong&gt;33&lt;/strong&gt; (0.20&amp;nbsp;g, 0.47&amp;nbsp;mmol) was dissolved in dry THF (3&amp;nbsp;cm&lt;sup&gt;3&lt;/sup&gt;) containing a suspension of potassium tert-butoxide (587&amp;nbsp;mg, 0.52&amp;nbsp;mmol), and the mixture was stirred at room temperature for 25&amp;nbsp;min before being diluted with EtOAc (10&amp;nbsp;cm&lt;sup&gt;3&lt;/sup&gt;). The mixture was then washed with saturated aqueous sodium chloride solution (5 x 2&amp;nbsp;cm&lt;sup&gt;3&lt;/sup&gt;). The combined organic extracts were dried (MgSO&lt;sub&gt;4&lt;/sub&gt;), filtered and evaporated in vacuo to yield a crude yellow oil (0.16&amp;nbsp;g), which was purified by column chromatography on silica gel with hexane-EtOAc (85:15) as eluent to give &lt;a href="http://dx.doi.org/10.1186/1860-5397-4-5" onmouseover="balloon.showTooltip(event,'load:34')"&gt;1-[(1R)-1-(2-{[tert- butyl(dimethyl)silyl]oxy}ethylhexyl]-2-piperidinone&lt;/a&gt; &lt;strong&gt;34&lt;/strong&gt; as a pale yellow oil (0.13&amp;nbsp;g, 81%).
&lt;/p&gt;
&lt;cite&gt;-Michael, Accone, Koning, and Westhuyzen, &lt;a href="http://dx.doi.org/10.1186/1860-5397-4-5"&gt;Beilstein J. Org. Chem. &lt;strong&gt;2008&lt;/strong&gt;, 4, 5&lt;/a&gt;&lt;/cite&gt;
&lt;/blockquote&gt;

&lt;p&gt;This demo has been tested on Internet Explorer 6/7, Firefox 2, and Safari 3.&lt;/p&gt;

&lt;h4&gt;Technologies&lt;/h4&gt;

&lt;p&gt;Although this demonstration is built on numerous Web technologies, two are at the top of the stack: the vector graphics rendering engine of &lt;a href="http://metamolecular.com/chemwriter"&gt;ChemWriter&lt;/a&gt; and the open source Javascript library &lt;a href="http://www.gmod.org/wiki/index.php/Popup_Balloons"&gt;Balloon.js&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Chemical structures are displayed as lightweight Adobe Flash SWF files, as described in a &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;previous Depth-First article&lt;/a&gt;. Software based on ChemWriter converts a molecular connection table into vector graphics commands for the Flash runtime with the help of the open source &lt;a href="http://www.flagstonesoftware.com/transform/"&gt;Transform SWF&lt;/a&gt; library.&lt;/p&gt;

&lt;h4&gt;Playing to the Web's Strengths&lt;/h4&gt;

&lt;p&gt;The Web is a new medium with a completely different set of rules compared to print media. One of its biggest strengths is interactivity: the ability to see something of interest and to immediately be able to find out more about it. One of its biggest weaknesses, even today, is technology standards. It's not enough to create interactivity; that interactivity must also fit within the technical constraints imposed by a medium that is still a work in progress.&lt;/p&gt;

&lt;p&gt;As journal publishers and others grapple with &lt;a href="http://depth-first.com/articles/2008/05/08/building-a-unique-chemistry-journal-responses-to-questions-from-nature-chemistry"&gt;how to approach&lt;/a&gt; the inevitable transition to purely Web-based scientific communication, it's important to keep both the strengths and limitations of the Web in mind. To date, nearly all attempts to create Web-based versions of chemistry journals have simply tried to duplicate the form of the print medium. This has resulted, if anything, on an even greater reliance on paper, resulting in valuable information being used well below its full potential.&lt;/p&gt;

&lt;h4&gt;Conclusions&lt;/h4&gt;

&lt;p&gt;This article has demonstrated a simple labor-saving technique in which chemical structures can be visualized by hovering the cursor over specially-designated chemical identifiers. There's quite a bit more that can be done with chemical vector graphics, chemical information, and Web technologies commonly used in consumer services like Netflix. Future articles will discuss some possibilities.&lt;/p&gt;

&lt;div id="32" style="display:none"&gt;
&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="200" height="200"&gt;
&lt;param name="movie" value="http://depth-first.com/demo/20080611/flash/32.swf"&gt;
&lt;embed src="http://depth-first.com/demo/20080611/flash/32.swf" quality="high" width="200" height="200" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;

&lt;div id="33" style="display:none"&gt;
&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="200" height="200"&gt;
&lt;param name="movie" value="http://depth-first.com/demo/20080611/flash/33.swf"&gt;
&lt;embed src="http://depth-first.com/demo/20080611/flash/33.swf" quality="high" width="200" height="200" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;

&lt;div id="34" style="display:none"&gt;
&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="200" height="200"&gt;
&lt;param name="movie" value="http://depth-first.com/demo/20080611/flash/34.swf"&gt;
&lt;embed src="http://depth-first.com/demo/20080611/flash/34.swf" quality="high" width="200" height="200" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;

&lt;div id="rbr" style="display:none"&gt;
&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="150" height="150"&gt;
&lt;param name="movie" value="http://depth-first.com/demo/20080611/flash/rbr.swf"&gt;
&lt;embed src="http://depth-first.com/demo/20080611/flash/rbr.swf" quality="high" width="150" height="150" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;</description>
      <pubDate>Wed, 11 Jun 2008 21:03:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:7ef7cc4c-8dbe-42f3-b608-23d18c889efe</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/06/11/chemistry-the-web-and-netflix</link>
      <category>Tools</category>
      <category>netflix</category>
      <category>popup</category>
      <category>balloon</category>
      <category>tooltip</category>
      <category>chemwriter</category>
      <category>swf</category>
      <category>flash</category>
      <category>vectorgraphics</category>
      <category>2d</category>
      <category>balloonjs</category>
      <category>scientificpublication</category>
      <category>web</category>
    </item>
    <item>
      <title>Adobe Flash for Cheminformatics: Fast, Scalable, and Attractive 2D Depiction of Chemical Structures with Vector Graphics</title>
      <description>&lt;p&gt;&lt;a href="http://metamolecular.com/chemwriter"&gt;&lt;img src="http://depth-first.com/demo/20080610/chemwriter_small.png" align="right"&gt;&lt;/img&gt;&lt;/a&gt;The previous article in this series &lt;a href="http://depth-first.com/articles/2008/06/06/the-other-vector-graphics-markup-language"&gt;discussed the use of vector graphics markup languages for cheminformatics&lt;/a&gt;, in particular for the display of 2D chemical structures. Although vector graphics are well-suited for creating responsive and appealing cheminformatics Web applications, the lack of universal native browser support makes both &lt;a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics"&gt;Scalable Vector Graphics&lt;/a&gt; (SVG) and its cousin &lt;a href="http://www.w3.org/TR/1998/NOTE-VML-19980513"&gt;Vector Markup Language&lt;/a&gt; (VML) unattractive at this time. This article highlights Adobe Flash as a 2D chemical structure renderer for Web applications, and features a fully-functional proof of concept based on the &lt;a href="http://metamolecular.com/chemwriter"&gt;ChemWriter&lt;/a&gt; rendering engine.&lt;/p&gt;

&lt;h4&gt;About Adobe Flash&lt;/h4&gt;

&lt;p&gt;Although Adobe Flash is practically an industry unto itself today, at it's core, Flash is a lightweight vector graphics renderer. Introduced in 1996, the Flash Player can be found on millions of Internet-enable devices today. According to a &lt;a href="http://www.adobe.com/products/player_census/flashplayer/"&gt;study by Adobe&lt;/a&gt;, the Flash Player was running on nearly 99% of Internet-enabled desktops as of March 2008. The player has also found its way onto a host of handheld devices and phones.&lt;/p&gt;

&lt;p&gt;Many technologies have been layered on top of the Flash Player. One of the first was the &lt;a href="http://www.adobe.com/devnet/actionscript/articles/actionscript3_overview.html"&gt;ActionScript&lt;/a&gt; scripting language. More recently, Adobe has introduced &lt;a href="http://depth-first.com/articles/2007/05/25/flex-rich-internet-applications-and-cheminformatics"&gt;Flex&lt;/a&gt;, a full-fledged application development framework.&lt;/p&gt;

&lt;p&gt;Unlike SVG and other vector graphics systems, Flash is ready today, proven, and about as close to universal as is possible on the Web. If you want to do vector graphics on the Web with the most convenient user and developer experience, Flash is your tool.&lt;/p&gt;

&lt;p&gt;But what can Flash do for cheminformatics?&lt;/p&gt;

&lt;h4&gt;A Demonstration&lt;/h4&gt;

&lt;p&gt;The table below is composed of twelve cells, each of which display a chemical structure through the Flash Player.&lt;/p&gt;

&lt;p&gt;&lt;style type="text/css"&gt;
      .cells a {display: block; text-align: center;}
    &lt;/style&gt;
    &lt;table class="cells" cellpadding="3" border="2"&gt;
    &lt;tr&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/bicalutamide.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/bicalutamide.swf" quality="high"
             width="150" height="150" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt;
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/bicalutamide.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/budesonide.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/budesonide.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/budesonide.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/buproprion.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/buproprion.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/buproprion.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/clopidogrel.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/clopidogrel.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/clopidogrel.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/docetaxel.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/docetaxel.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/docetaxel.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/escitalopram.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/escitalopram.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/escitalopram.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/fluticasone.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/fluticasone.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/fluticasone.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/lopinavir.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/lopinavir.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/lopinavir.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/omega_conotoxin_gvia_16132374.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/omega_conotoxin_gvia_16132374.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/omega_conotoxin_gvia_16132374.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/oseltamivir.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/oseltamivir.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/oseltamivir.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/sertraline.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/sertraline.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/sertraline.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
            codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
            width="150" height="150"&gt;
      &lt;param name="movie" value="http://depth-first.com/demo/20080610/sildenafil.swf"&gt;
      &lt;embed src="http://depth-first.com/demo/20080610/sildenafil.swf" quality="high"
             width="150" height="150" name="movie" type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; 
    &lt;/object&gt;
    &lt;a href="http://depth-first.com/demo/20080610/sildenafil.swf"&gt;zoom&lt;/a&gt;
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt; &lt;/p&gt;

&lt;p&gt;Several points are worth mention:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Each of the structures can be zoomed by clicking on its 'zoom' link.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each cell contains a lightweight embedded "SWF" file, or "ShockWave File," and the zoomed view displays exactly the same file. No matter how the SWF file is resized, it will always be proportionally-scaled to its smallest dimension and centered.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The size of each SWF file ranges from a low of 563 bytes to a high of 8.5 KB, with an average of around 1.5KB. The larger the molecule, the more space is required. A comparable PNG with a resolution of 150x150 pixels would require on average for each structure about 6-8 KB.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each image was generated from a molfile using a development version of the &lt;a href="http://metamolecular.com/chemwriter"&gt;ChemWriter&lt;/a&gt; rendering engine via the open source &lt;a href="http://www.flagstonesoftware.com/transform/"&gt;Transform SWF&lt;/a&gt; Java toolkit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SWF Files, unlike applets, are highly optimized for multiple instance display on all major platforms and browsers. In every case, startup will be nearly instantaneous and scrolling will be smooth. The performance of Flash should be at least as good as, if not better than, raster images.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;The Right Tool for the Job (is Probably not a Raster Image)&lt;/h4&gt;

&lt;p&gt;One of the first challenges developers of cheminformatics Web applications are faced with is how to render 2D chemical structures. For an overview of the technologies now in use, see the &lt;a href="http://depth-first.com/articles/2008/06/06/the-other-vector-graphics-markup-language"&gt;previous article&lt;/a&gt; in this series. Each option has its own set of trade-offs.&lt;/p&gt;

&lt;p&gt;The most widely-used 2D structure rendering option, raster images, is both inflexible and inefficient. Unlike a vector image, a raster image by definition has only one resolution, which is fixed at creation time. If image dimensions need to change, then all structures must be re-imaged. Given the size of many of today's &lt;a href="http://depth-first.com/articles/2007/01/24/thirty-two-free-chemistry-databases"&gt;chemistry databases&lt;/a&gt;, such a system-wide re-imaging of structures can involve a non-trivial amount of processor power and bandwidth.&lt;/p&gt;

&lt;p&gt;To compensate, many sites store relatively large images, say 300x300 pixel, and then use the HTML &lt;tt&gt;&amp;lt;img&amp;gt;&lt;/tt&gt; tag to shrink it as needed. But this creates problems of its own: both storage and bandwidth requirements are far larger than they need to be, resulting in the need for more powerful server hardware and poorer application scalability. And then there are the application's users, who must wait through a 30KB or higher download for each 2D image.&lt;/p&gt;

&lt;p&gt;A significant number of structures in any compound collection will be so large that even a 300x300 pixel image will be insufficient to render the necessary detail. For example, &lt;a href="http://depth-first.com/articles/2008/05/19/building-chempedia-resizable-structures-with-chemwriter"&gt;a recent Depth-First article&lt;/a&gt; discussed a vector graphics solution this problem within the context of &lt;a href="http://chempedia.com"&gt;Chempedia&lt;/a&gt;, the free chemical encyclopedia. Vector graphics simply eliminate this issue.&lt;/p&gt;

&lt;p&gt;Many cheminformatics applications would benefit from being able to show 50 or more structures at a time, with each structure having a zoom view for closer inspection. To a non-chemist, this might seem unnecessary. But for today's chemists dealing with large chemical catalogs and high-throughput screens, it's not only possible, but a routine part of the practice of chemistry. The raster image approach makes it extremely difficult to meet this important need on the Web. Vector graphics, possibly delivered through the Flash Player, offer a much simpler and more efficient way to do it.&lt;/p&gt;

&lt;p&gt;2D chemical structures are vectorial in nature; using raster images to depict them is in most cases the more costly and lower quality option.&lt;/p&gt;

&lt;h4&gt;Summary&lt;/h4&gt;

&lt;p&gt;Vector graphics are a near-perfect match for the job of depicting 2D chemical structures on the Web. Although there are many vector graphics platforms to choose from, the Flash Player is by far the most universal option. This article has demonstrated a working example of multiple 2D chemical structures rendered as lightweight vector images via the Adobe Flash Player, the first and only such demonstration of which I'm aware.&lt;/p&gt;

&lt;p&gt;The key technologies behind this demonstration are the &lt;a href="http://metamolecular.com/chemwriter"&gt;ChemWriter&lt;/a&gt; rendering engine and the open source Flash developer toolkits available from &lt;a href="http://www.flagstonesoftware.com/transform/"&gt;Flagstone Software&lt;/a&gt;. If you're interested in learning more about how vector graphics and Flash can improve both the user and developer experience in your cheminformatics Web applications, I'd be happy to &lt;a href="http://mailhide.recaptcha.net/d?k=01_5KIPZyZx-bysSnY0HEqIw==&amp;amp;c=9ppCEFFs3OESfeieiRz1LAgTPkQmMhWOQm4RKDRkFI8=" onclick="window.open('http://mailhide.recaptcha.net/d?k=01_5KIPZyZx-bysSnY0HEqIw==&amp;amp;c=9ppCEFFs3OESfeieiRz1LAgTPkQmMhWOQm4RKDRkFI8=', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;" title="Reveal this e-mail address"&gt;hear from you&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Tue, 10 Jun 2008 11:05:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:9a0ab422-6515-446f-a0ef-a765519d8dd1</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/06/10/adobe-flash-for-cheminformatics-fast-scalable-and-attractive-2d-depiction-of-chemical-structures-with-vector-graphics</link>
      <category>Tools</category>
      <category>flash</category>
      <category>adobe</category>
      <category>svg</category>
      <category>vml</category>
      <category>chemwriter</category>
      <category>vectorgraphics</category>
      <category>2d</category>
      <category>chemicalstructure</category>
      <category>java</category>
      <category>swf</category>
    </item>
  </channel>
</rss>
