<?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 octet</title>
    <link>http://depth-first.com/articles/tag/octet</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Walking the Web of Chemical Informatics</description>
    <item>
      <title>Can Your Cheminformatics Tool Do This?</title>
      <description>&lt;p&gt;&lt;center&gt;&lt;a href="http://dx.doi.org/10.1021/ol070936d"&gt;&lt;img src="http://depth-first.com/demo/20070613/allenes.gif" border="0"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 13 Jun 2007 08:36:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:6e600510-2b9a-46f1-8267-227cffedac99</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2007/06/13/can-your-cheminformatics-tool-do-this</link>
      <category>Web</category>
      <category>flexmol</category>
      <category>octet</category>
      <category>axialchirality</category>
      <category>dietz</category>
    </item>
    <item>
      <title>Can Your Cheminformatics Tool Do This?</title>
      <description>&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20070405/abstract.gif"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;Axial chirality isn't the first thing most chemists come up with when they think of indole. Yet a &lt;a href="http://dx.doi.org/10.1021/jo0700427"&gt;recent &lt;em&gt;J. Org. Chem.&lt;/em&gt; article&lt;/a&gt; by Kamikawa et al. describes not only axially chiral indoles, but an enantioselective method for their synthesis.&lt;/p&gt;

&lt;p&gt;Axial chirality has been largely ignored by the cheminformatics community. There was once a time when the phenomenon was esoteric enough that it could be reasonably ignored. However, that time has long since passed, as the Kamikawa study, &lt;a href="http://depth-first.com/articles/tag/axialchirality"&gt;and many others&lt;/a&gt; demonstrate.&lt;/p&gt;

&lt;p&gt;Several years ago, Andreas Dietz proposed a &lt;a href="http://dx.doi.org/10.1021/ci00027a001"&gt;conceptual framework&lt;/a&gt; for solving this problem. More recently, it was put into practice in the &lt;a href="http://depth-first.com/articles/tag/flexmol"&gt;FlexMol&lt;/a&gt; language and the &lt;a href="http://depth-first.com/articles/tag/octet"&gt;Octet&lt;/a&gt; framework. These may not represent the best solutions to the &lt;a href="http://depth-first.com/articles/2007/01/08/the-axial-chirality-problem"&gt;axial chirality problem&lt;/a&gt;, but they clearly demonstrate that a practical solution, fully compatible with modern information technologies, does exists.&lt;/p&gt;

&lt;p&gt;Axially chiral molecules like those in the Kamikawa study  will increasingly find their way into chemical databases as they continue to become more synthetically accessible. When this happens, users will want to be able to distinguish stereoisomers, just as they wanted (and got) this capability for tetrahedral chirality ten to twenty years ago. When the inevitable request to distinguish axially-chiral stereoisomers in your database comes, how will you respond?&lt;/p&gt;</description>
      <pubDate>Thu, 05 Apr 2007 12:46:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:6d8afaef-1fcb-4b7d-90bd-ca06e766fe31</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2007/04/05/can-your-cheminformatics-tool-do-this</link>
      <category>Tools</category>
      <category>flexmol</category>
      <category>octet</category>
      <category>axialchirality</category>
      <category>dietz</category>
    </item>
    <item>
      <title>Octet Fundamentals: Immutable Molecules</title>
      <description>&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0471258393?ie=UTF8&amp;amp;tag=depthfirst-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0471258393"&gt;&lt;img border="0" align="right" src="http://depth-first.com/demo/20070220/patterns_in_java.gif"&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=depthfirst-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0471258393" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;The Immutable pattern increases the robustness of objects that share references to the same object and reduces the overhead of concurrent access to an object. It accomplishes this by forbidding any of an object's state information to change after the object is constructed. The Immutable pattern also avoids the need to synchronize multiple threads of execution that share an object.&lt;/p&gt;
    
    &lt;p&gt;-&lt;cite&gt;Mark Grand, &lt;a href="http://www.amazon.com/gp/product/0471258393?ie=UTF8&amp;amp;tag=depthfirst-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0471258393"&gt;Patterns in Java, Volume 1&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=depthfirst-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0471258393" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Peruse the &lt;a href="http://depth-first.com/doc/octet/index.html"&gt;Octet API Documentation&lt;/a&gt; and you may find something surprising about the &lt;a href="http://depth-first.com/doc/octet/net/sf/octet/model/Molecule.html"&gt;Molecule&lt;/a&gt; interface: it lacks mutator methods. Given that mutators enable the state of an object to change, how can a Molecule ever be created in the first place? Why would anyone even need immutable Molecules?&lt;/p&gt;

&lt;h4&gt;Mutable Molecules are Unnecessary&lt;/h4&gt;

&lt;p&gt;Most cheminformatics tools permit the unfettered modification of molecules after their creation. Octet takes a completely different approach. The Molecule contract says that the state of every Molecule will remain constant over its lifetime. Octet then backs up this promise by deliberately defining only accessor methods in the Molecule interface.&lt;/p&gt;

&lt;p&gt;Perhaps the best reason for an immutable Molecule interface is that there are vanishingly few situations in which a Molecule needs to be changed after it's created. The creative use of Design Patterns obviates 80-90% of the perceived need for Molecule mutability.&lt;/p&gt;

&lt;h4&gt;The Virtues of Immutability&lt;/h4&gt;

&lt;p&gt;When clients &lt;em&gt;know&lt;/em&gt; that a Molecule can never be changed, programming becomes a lot easier and less bug-prone. For example, consider that when a Molecule is immutable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;defensive copying of Molecules is unnecessary;&lt;/li&gt;
&lt;li&gt;a mechanism that reports changes to internal Molecule state (listeners) is unnecessary;&lt;/li&gt;
&lt;li&gt;memory leaks resulting from failure to disconnect a Molecule listener are eliminated;&lt;/li&gt;
&lt;li&gt;the &lt;tt&gt;clone&lt;/tt&gt; method, and all of its complexities, are unnecessary;&lt;/li&gt;
&lt;li&gt;no special precautions need to be taken to achieve robust, thread-safe code;&lt;/li&gt;
&lt;li&gt;Molecules can safely be used as keys in &lt;tt&gt;Hashtables&lt;/tt&gt;;&lt;/li&gt;
&lt;li&gt;the Molecule API is greatly simplified because all mutators have been removed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Octet fully embraces the productivity gains made possible by immutable Molecules. In fact, many of Octet's key interfaces are immutable for precisely the reasons cited above.&lt;/p&gt;

&lt;h4&gt;How to Build Immutable Molecules&lt;/h4&gt;

&lt;p&gt;Immutable Molecules may be a good idea, but how can they get created in the first place? After all, there are no methods such as &lt;tt&gt;addAtom&lt;/tt&gt; though which a Molecule can be built up!&lt;/p&gt;

&lt;p&gt;Java inner classes and the &lt;a href="http://c2.com/cgi/wiki?BuilderPattern"&gt;Builder Pattern&lt;/a&gt; provide one solution to this problem. Consider the following Java snippet, which is adapted from the Octet source code:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_java "&gt;public class BasicMoleculeBuilder implements MoleculeBuilder
{
  private MoleculeImpl molecule;

  public BasicMoleculeBuilder()
  {
    molecule = new MoleculeImpl();

    // implement the rest
  }

  public void addAtom(IsotopicDistribution distribution)
  {
    AtomImpl atom = new AtomImpl(distribution);

    // changing the molecule!
    molecule.atoms.add(atom);
  }

  public Molecule releaseMolecule()
  {
    Molecule result = molecule;
    molecule = new MoleculeImpl();

    return result;
  }

  // implement the remaining MoleculeBuilder methods

  private class MoleculeImpl implements Molecule
  {
    private List atoms;

    private MoleculeImpl()
    {
      atoms = new ArrayList();
    }

    // implement the remaining Molecule methods
  }

  private class AtomImpl implements Atom
  {
    private IsotopicDistribution dist;

    private AtomImpl(IsotopicDistribution dist)
    {
      this.dist = dist;
    }

    // implement the remaining Atom methods
  }
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Notice that the &lt;tt&gt;addAtom&lt;/tt&gt; method changes the state of the Molecule under construction. Strictly speaking, this does violate immutability. In practice, it makes no difference because the changes occur only in the context of &lt;tt&gt;BasicMoleculeBuilder&lt;/tt&gt;, which keeps these changes from propagating to the outside world. Once a client invokes &lt;tt&gt;releaseMolecule&lt;/tt&gt;, &lt;tt&gt;BasicMoleculeBuilder&lt;/tt&gt; loses all contact with the &lt;tt&gt;Molecule&lt;/tt&gt; it created, and so is incapable of further modification.&lt;/p&gt;

&lt;p&gt;Although it may not be immediately apparent, Alan Holub's &lt;a href="http://www.javaworld.com/javaworld/jw-07-1999/jw-07-toolbox.html"&gt;brilliant series of articles&lt;/a&gt; in &lt;a href="http://javaworld.com"&gt;JavaWorld&lt;/a&gt; on user interface design are directly applicable here. If you've never been exposed to rigorous object-oriented design, Holub's claims can seem rather bizarre ("get and set functions are evil"). But if you stick with it, you'll be rewarded with a valuable new appreciation for object-oriented programming in Java.&lt;/p&gt;

&lt;p&gt;Although a discussion of the role of the Builder Pattern in the above code is beyond the scope of this article, look to future installments of the "Octet Fundamentals" series for more details.&lt;/p&gt;

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

&lt;p&gt;Molecule immutability is a core Octet principle that results in cleaner, simpler, and more robust client code. Situations that might appear to require the ability to edit Molecules can usually be handled through the creative application of Design Patterns.&lt;/p&gt;</description>
      <pubDate>Tue, 20 Feb 2007 00:44:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:04777b07-5594-4f6b-95a8-71709ce53977</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2007/02/20/octet-fundamentals-immutable-molecules</link>
      <category>Tools</category>
      <category>octet</category>
      <category>immutability</category>
      <category>holub</category>
      <category>java</category>
      <category>designpatterns</category>
    </item>
    <item>
      <title>Octet Fundamentals: A Documented System of Atomic Masses</title>
      <description>&lt;p&gt;&lt;a href="http://flickr.com/photos/stinkypeter/136646214/"&gt;&lt;img src="http://depth-first.com/demo/20070202/scale.jpg" border="0" align="right"&gt;&lt;/img&gt;&lt;/a&gt;The way that atoms, and particularly their masses, are modeled sets the stage for the kinds of problems a cheminformatics environment can solve. Many systems are currently in use, a reflection of the many different ways there are to think about this problem. This article will introduce the atomic mass system used by Octet, which provides atomic mass values and uncertainties cross-referenced to the primary literature.&lt;/p&gt;

&lt;h4&gt;A Documented System of Atomic Masses&lt;/h4&gt;

&lt;p&gt;Mass and isotopic composition are fundamental atomic properties. In addition to the mass values themselves, the errors of these determinations are also important. Because these quantities are sometimes in dispute, it is essential that they be cross-referenced to the primary literature. Fortunately, a landmark work titled &lt;a href="http://www.iupac.org/publications/pac/2003/7506/7506x0683.html"&gt;"Atomic weights of the elements"&lt;/a&gt; (AWOTE) accomplishing exactly this objective was published in 2000 by a team led by J. K. B&amp;#246;hlke from the U.S. Geological survey.&lt;/p&gt;

&lt;p&gt;Octet uses an XML representation of the data contained in AWOTE. To view the entire document, &lt;a href="http://depth-first.com/demo/20070202/mass.xml"&gt;click here&lt;/a&gt;. To illustrate the kind of data included in this document, consider this entry for the element carbon:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_xml "&gt;&lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;entry&lt;/span&gt; &lt;span class="attribute"&gt;symbol&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;C&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;atomic-number&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;6&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&lt;/span&gt;
  &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;natural-abundance&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;mass&lt;/span&gt; &lt;span class="attribute"&gt;value&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;12.0107&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;error&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;0.0008&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="punct"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;isotope&lt;/span&gt; &lt;span class="attribute"&gt;mass-number&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;12&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&lt;/span&gt;
      &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;mass&lt;/span&gt; &lt;span class="attribute"&gt;value&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;12&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;error&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;0&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="punct"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;abundance&lt;/span&gt; &lt;span class="attribute"&gt;value&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;0.9893&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;error&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;0.0008&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="punct"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;isotope&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;isotope&lt;/span&gt; &lt;span class="attribute"&gt;mass-number&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;13&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&lt;/span&gt;
      &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;mass&lt;/span&gt; &lt;span class="attribute"&gt;value&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;13.003354838&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;error&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;0.000000005&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="punct"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;abundance&lt;/span&gt; &lt;span class="attribute"&gt;value&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;0.0107&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;error&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;0.0008&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="punct"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;isotope&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;natural-abundance&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;entry&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Carbon has two naturally-occurring stable isotopes, &lt;sup&gt;12&lt;/sup&gt;C and &lt;sup&gt;13&lt;/sup&gt;C. They have relative abundances of 98.93% and 1.07%, and masses of 12 (exactly) and 13.003354838&amp;plusmn;0.000000005 unified mass units (u), respectively. Every element from hydrogen to uranium is included, excluding technitium. By reference to AWOTE, the determination of every value in the XML file can be found in the primary literature.&lt;/p&gt;

&lt;h4&gt;Using the Atomic Mass System&lt;/h4&gt;

&lt;p&gt;As a demonstration of Octet's system of atomic masses, consider the following Ruby code:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;rubygems&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;require_gem&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;rjb&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;

&lt;span class="ident"&gt;atomic_system&lt;/span&gt;&lt;span class="punct"&gt;=&lt;/span&gt;&lt;span class="constant"&gt;Rjb&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="ident"&gt;import&lt;/span&gt;&lt;span class="punct"&gt;('&lt;/span&gt;&lt;span class="string"&gt;net.sf.octet.model.BasicAtomicSystem&lt;/span&gt;&lt;span class="punct"&gt;').&lt;/span&gt;&lt;span class="ident"&gt;getInstance&lt;/span&gt;
&lt;span class="ident"&gt;carbon_distribution&lt;/span&gt;&lt;span class="punct"&gt;=&lt;/span&gt;&lt;span class="ident"&gt;atomic_system&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;getNaturalAbundance&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;atomic_system&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;getAtomicSymbol&lt;/span&gt;&lt;span class="punct"&gt;(&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;C&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;))&lt;/span&gt;

&lt;span class="ident"&gt;puts&lt;/span&gt; &lt;span class="ident"&gt;carbon_distribution&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;countNuclei&lt;/span&gt; &lt;span class="comment"&gt;# =&amp;gt;2&lt;/span&gt;
&lt;span class="ident"&gt;puts&lt;/span&gt; &lt;span class="ident"&gt;carbon_distribution&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;getNucleus&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="number"&gt;0&lt;/span&gt;&lt;span class="punct"&gt;).&lt;/span&gt;&lt;span class="ident"&gt;getMassNumber&lt;/span&gt; &lt;span class="comment"&gt;# =&amp;gt;12&lt;/span&gt;
&lt;span class="ident"&gt;puts&lt;/span&gt; &lt;span class="ident"&gt;carbon_distribution&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;getNucleus&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="number"&gt;1&lt;/span&gt;&lt;span class="punct"&gt;).&lt;/span&gt;&lt;span class="ident"&gt;getMassNumber&lt;/span&gt; &lt;span class="comment"&gt;# =&amp;gt;13&lt;/span&gt;
&lt;span class="ident"&gt;puts&lt;/span&gt; &lt;span class="ident"&gt;atomic_system&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;getAtomicMass&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;carbon_distribution&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;getNucleus&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="number"&gt;0&lt;/span&gt;&lt;span class="punct"&gt;)).&lt;/span&gt;&lt;span class="ident"&gt;getValue&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;toString&lt;/span&gt; &lt;span class="comment"&gt;# =&amp;gt; 12.0&lt;/span&gt;
&lt;span class="ident"&gt;puts&lt;/span&gt; &lt;span class="ident"&gt;atomic_system&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;getAtomicMass&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;carbon_distribution&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;getNucleus&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="number"&gt;1&lt;/span&gt;&lt;span class="punct"&gt;)).&lt;/span&gt;&lt;span class="ident"&gt;getValue&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;toString&lt;/span&gt; &lt;span class="comment"&gt;# =&amp;gt; 13.003354838&lt;/span&gt;
&lt;span class="ident"&gt;puts&lt;/span&gt; &lt;span class="ident"&gt;atomic_system&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;getAtomicMass&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;carbon_distribution&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;getNucleus&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="number"&gt;1&lt;/span&gt;&lt;span class="punct"&gt;)).&lt;/span&gt;&lt;span class="ident"&gt;getUncertainty&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;toString&lt;/span&gt; &lt;span class="comment"&gt;# =&amp;gt; 5.0E-9&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The &lt;a href="http://depth-first.com/articles/2007/01/31/a-molecular-language-for-modern-chemistry-reading-flexmol-documents-with-octet"&gt;previous article in this series&lt;/a&gt; described the small number of steps needed to execute Ruby code such as that shown above on Windows and Linux systems. For more information on the &lt;tt&gt;AtomicSystem&lt;/tt&gt; API, consult the &lt;a href="http://depth-first.com/doc/octet/"&gt;Octet Javadoc&lt;/a&gt;.&lt;/p&gt;

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

&lt;p&gt;Octet provides a comprehensive system of atomic masses containing both measurements and uncertainties. This system is furthermore cross-referenced to the primary literature. As a result, the mass of every Octet Molecule can be determined to high precision and with error analysis. Not every application will require this level of detail and documentation, but for those that do the capability exists.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.numly.com/numly/verify.asp?id=34181-070204-258949-40"&gt;&lt;img alt="numly esn" src="http://numly.com/numly/icon.asp?id=3418107020425894940" border="0"&gt; 34181-070204-258949-40&lt;/a&gt; Rate content: &lt;a href="http://numly.com/numly/verify.asp?id=3418107020425894940&amp;rate=yes"&gt;&lt;img src="http://numly.com/numly/thumbup.gif" border="0"&gt;&lt;/a&gt;&lt;a href="http://numly.com/numly/verify.asp?id=3418107020425894940&amp;rate=no"&gt;&lt;img src="http://numly.com/numly/thumbdown.gif" border="0"&gt;&lt;/a&gt;&lt;br&gt;&lt;img src="http://numly.com/numly/barcode.asp?code=3418107020425894940&amp;height=20&amp;width=1&amp;mode=code39"&gt;&lt;br&gt;&lt;br&gt;&lt;!--Creative Commons License--&gt;&lt;a rel="license" href="http://creativecommons.org/licenses/by/2.5/"&gt;&lt;img alt="Creative Commons License" style="border-width: 0" src="http://i.creativecommons.org/l/by/2.5/88x31.png"/&gt;&lt;/a&gt;&lt;br/&gt;This work is licensed under a &lt;a rel="license" href="http://creativecommons.org/licenses/by/2.5/"&gt;Creative Commons Attribution 2.5  License&lt;/a&gt;.&lt;!--/Creative Commons License--&gt;&lt;!-- &lt;rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"&gt;&lt;Work rdf:about=""&gt;&lt;license rdf:resource="http://creativecommons.org/licenses/by/2.5/"/&gt;&lt;/Work&gt;&lt;License rdf:about="http://creativecommons.org/licenses/by/2.5/"&gt;&lt;permits rdf:resource="http://web.resource.org/cc/Reproduction"/&gt;&lt;permits rdf:resource="http://web.resource.org/cc/Distribution"/&gt;&lt;requires rdf:resource="http://web.resource.org/cc/Notice"/&gt;&lt;requires rdf:resource="http://web.resource.org/cc/Attribution"/&gt;&lt;permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/&gt;&lt;/License&gt;&lt;/rdf:RDF&gt; --&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 02 Feb 2007 15:10:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:3cd8acc0-eb27-44fc-b238-f14536238e5d</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2007/02/02/octet-fundamentals-a-documented-system-of-atomic-masses</link>
      <category>Tools</category>
      <category>octet</category>
      <category>xml</category>
      <category>atomicmass</category>
      <category>awote</category>
    </item>
    <item>
      <title>A Molecular Language for Modern Chemistry: Reading FlexMol Documents with Octet</title>
      <description>&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0596004206?ie=UTF8&amp;amp;tag=depthfirst-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596004206"&gt;&lt;img border="0" src="http://depth-first.com/files/learning_xml.jpg" align="right"&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=depthfirst-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0596004206" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;An XML language is only as useful as the software tools that take advantage of it. &lt;a href="http://depth-first.com/articles/tag/flexmol"&gt;Previous articles&lt;/a&gt; have discussed how the XML language FlexMol can solve a variety of molecular representation problems ranging from the &lt;a href="http://depth-first.com/articles/2006/12/20/a-molecular-language-for-modern-chemistry-getting-started-with-flexmol"&gt;multiatom bonding of metallocenes&lt;/a&gt; to the &lt;a href="http://depth-first.com/articles/2006/12/20/a-molecular-language-for-modern-chemistry-getting-started-with-flexmol"&gt;axial chirality of biaryls&lt;/a&gt;. &lt;a href="http://depth-first.com/articles/2007/01/30/an-object-oriented-framework-for-molecular-representation-getting-started-with-octet"&gt;Octet&lt;/a&gt; is a framework written in Java that speaks FlexMol natively. In this article, I'll show how Octet can be used to read a sample FlexMol document.&lt;/p&gt;

&lt;h4&gt;Prerequisites&lt;/h4&gt;

&lt;p&gt;For this tutorial, you'll need &lt;a href="http://rubyforge.org/projects/rjb/"&gt;Ruby Java Bridge&lt;/a&gt; (RJB). Previous articles have discussed the installation and use of RJB on &lt;a href="http://depth-first.com/articles/2006/10/12/running-ruby-java-bridge-on-windows"&gt;Windows&lt;/a&gt; and &lt;a href="http://depth-first.com/articles/2006/08/26/scripting-java-libraries-with-ruby-java-bridge"&gt;Linux&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;A Sample Molecule&lt;/h4&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20070131/s_monolaterol.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;A &lt;a href="http://depth-first.com/articles/2007/01/25/a-molecular-language-for-modern-chemistry-flexmol-tetrahedral-chirality-and-monolaterol"&gt;recent article&lt;/a&gt; disused a FlexMol representation of the chiral natural product monolaterol. Using a slightly modified numbering system for this molecule (shown above), we can construct a &lt;a href="http://depth-first.com/demo/20070131/s_monolaterol.xml"&gt;complete FlexMol representation&lt;/a&gt;. In this case, we simply start numbering at index zero, subtracting one from every index in the previous example to match the zero-based indices used in Octet.&lt;/p&gt;

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

&lt;p&gt;To illustrate the process of reading a FlexMol document, I've prepared a small package (&lt;strong&gt;demo-20070131.tar.gz&lt;/strong&gt;) that can be &lt;a href="https://sourceforge.net/project/showfiles.php?group_id=96108&amp;amp;package_id=220177&amp;amp;release_id=482855"&gt;downloaded from SourceForge&lt;/a&gt;. In it, you'll find an Octet jarfile (&lt;strong&gt;octet-0.8.2.jar&lt;/strong&gt;), a FlexMol representation of monolaterol (&lt;strong&gt;s_monolaterol.xml&lt;/strong&gt;), a Ruby library (&lt;strong&gt;reader.rb&lt;/strong&gt;), and some Ruby test code (&lt;strong&gt;test.rb&lt;/strong&gt;). Inflate this archive and make it your working directory.&lt;/p&gt;

&lt;h4&gt;A Simple Test&lt;/h4&gt;

&lt;p&gt;The following sequence of commands will run the test included with the demonstration package:&lt;/p&gt;

&lt;div class="console"&gt;
&lt;pre&gt;
$ export CLASSPATH=./octet-0.8.2.jar
$ ruby test.rb
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You should see several lines of output terminated with the line:&lt;/p&gt;

&lt;div class="console"&gt;
&lt;pre&gt;
The exact mass of monolaterol is 276.115029755.
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You can get more hands-on experience with loading and processing the monolaterol FlexMol document using interactive Ruby (irb). For example:&lt;/p&gt;

&lt;div class="console"&gt;
&lt;pre&gt;
$ irb
irb(main):001:0&gt; require 'reader'
=&gt; true
irb(main):002:0&gt; r=Reader.new
=&gt; #&lt;Reader:0x2b9ab173a1f0 @xml_reader=#&lt;#&lt;Class:0x2b9ab1741680&gt;:0x2b9ab1736690&gt;, @handler=#&lt;#&lt;Class:0x2b9ab1741680&gt;:0x2b9ab1736e10&gt;, @builder=#&lt;#&lt;Class:0x2b9ab1741680&gt;:0x2b9ab1736b90&gt;&gt;
irb(main):003:0&gt; mol=r.read_file 's_monolaterol.xml'
=&gt; #&lt;#&lt;Class:0x2b9ab1741680&gt;:0x2b9ab172cd48&gt;
irb(main):004:0&gt; mol.countAtoms
=&gt; 21
irb(main):005:0&gt; mol.countBondingSystems
=&gt; 24
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Of course, this is just scratching the surface of what can be done once a FlexMol document has been loaded by Octet.&lt;/p&gt;

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

&lt;p&gt;Octet makes it possible to convert FlexMol documents into Java object representations that can be accessed through Ruby. With an object representation, the possibilities are limitless. Some simple examples have been provided here. Future articles will illustrate more advanced uses.&lt;/p&gt;</description>
      <pubDate>Wed, 31 Jan 2007 14:56:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ab1f670a-3c7e-407d-af0e-c4343d7082d2</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2007/01/31/a-molecular-language-for-modern-chemistry-reading-flexmol-documents-with-octet</link>
      <category>Tools</category>
      <category>flexmol</category>
      <category>octet</category>
      <category>ruby</category>
      <category>java</category>
      <category>rjb</category>
      <category>monolaterol</category>
      <category>xml</category>
    </item>
    <item>
      <title>An Object-Oriented Framework for Molecular Representation: Getting Started with Octet</title>
      <description>&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0201633612?ie=UTF8&amp;amp;tag=depthfirst-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0201633612"&gt;&lt;img border="0" src="http://depth-first.com/files/design_patterns.jpg" align="right"&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=depthfirst-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0201633612" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;If applications are hard to design and toolkits are harder, then frameworks are hardest of all. A framework designer gambles that one architecture will work for all applications in the domain. Any substantive change to the framework's design would reduce its benefits considerably, since the framework's main contribution to an application is the architecture it defines. Therefore it's imperative to design the framework to be as flexible and extensible as possible.&lt;/p&gt;

    &lt;p&gt;-&lt;cite&gt;Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides- &lt;em&gt;&lt;a href="http://www.amazon.com/gp/product/0201633612?ie=UTF8&amp;amp;tag=depthfirst-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0201633612"&gt;Design Patterns&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=depthfirst-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0201633612" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;&lt;/em&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One of the most important considerations when building an application is the choice of framework. As the quote from the &lt;a href="http://en.wikipedia.org/wiki/Design_patterns"&gt;Gang of Four&lt;/a&gt; implies, there's much more to frameworks than just a collection of re-usable code. At their best, frameworks provide a foundation for thinking about a problem domain and a language for communicating with other developers about it. In this article, I'll introduce &lt;a href="http://sf.net/projects/octet"&gt;Octet&lt;/a&gt;, an object-oriented framework for molecular representation.&lt;/p&gt;

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

&lt;p&gt;Isn't molecular representation a solved problem? After all, don't SMILES, Molfile, InChI, and CML adequately represent any molecule the average software developer is likely to see?&lt;/p&gt;

&lt;p&gt;As &lt;a href="http://depth-first.com/articles/2006/12/19/ferrocene-and-beyond-a-solution-to-the-molecular-representation-problem"&gt;previously discussed&lt;/a&gt;, molecular representation technologies have stagnated while the molecules chemists themselves now routinely make and use have continued to become more and more "exotic." Developers are now faced with the thorny problem that a variety of common structural motifs in chemistry can't be adequately represented with industry-standard cheminformatics tools.&lt;/p&gt;

&lt;p&gt;This point is so important, I'll repeat it: cheminformatics has fallen behind chemistry in the kinds of molecules it can work with. Quick fixes only allow the problem to fester; what's needed is a comprehensive solution. This is Octet's problem domain.&lt;/p&gt;

&lt;p&gt;Every framework is bounded by a specific problem domain. Although the size of the domain can vary, a framework provides a comprehensive solution within it. For complex and poorly standardized domains (such as molecular representation), a good framework can greatly accelerate application development.&lt;/p&gt;

&lt;p&gt;A good frameworks stays within its problem domain. One of the most important reasons is to prevent &lt;a href="http://headrush.typepad.com/creating_passionate_users/2005/06/featuritis_vs_t.html"&gt;featuritis&lt;/a&gt;, the root of much software evil. Keeping a framework focused on its core mission makes it much more likely that it can remain documented, tested, extensible, and efficient.&lt;/p&gt;

&lt;p&gt;By intention, a variety of features fall outside Octet's problem domain and so will never be directly supported. For example, rendering 2-D structure diagrams is a common problem in cheminformatics that has nothing to do with solving the molecular representation problem. Similarly, reading and writing SMILES strings and Molfiles are supported by many toolkits, but not by Octet directly. After all, it's the inherent limitations of these languages that Octet is trying to overcome.&lt;/p&gt;

&lt;p&gt;Higher-level functionality such as legacy language support and 2-D rendering, although not part of Octet itself, can be developed with Octet as a foundation. For example, two Octet add-on frameworks specifically address these problems. They are called &lt;a href="http://sf.net/projects/rxf/"&gt;Rosetta&lt;/a&gt; and &lt;a href="http://sf.net/proejects/structure/"&gt;Structure&lt;/a&gt;, respectively.&lt;/p&gt;

&lt;h4&gt;About This Series&lt;/h4&gt;

&lt;p&gt;This article is the first in a series discussing Octet. Future articles will describe in detail Octet's design, implementation, and use. Although Octet has come a long way, it's far from finished. My motivation for writing these articles is to hear what you have to say about Octet, so please feel free to &lt;a href="http://sourceforge.net/users/r_apodaca/"&gt;contact me&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Although Octet is written in Java, code examples discussed here will be written in Ruby. I've taken the same approach in discussing the &lt;a href="http://cdk.sf.net"&gt;Chemistry Development Kit&lt;/a&gt; (CDK) and &lt;a href="http://depth-first.com/articles/2006/08/28/drawing-2-d-structures-with-structure-cdk"&gt;Structure-CDK&lt;/a&gt;. Ruby's brevity and comfortable syntax make it ideal for both writing and discussing code.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://rubyforge.org/projects/rjb/"&gt;Ruby Java Bridge&lt;/a&gt; (RJB) is the magic technology that makes this possible. Previous articles have discussed the installation and use of RJB on &lt;a href="http://depth-first.com/articles/2006/10/12/running-ruby-java-bridge-on-windows"&gt;Windows&lt;/a&gt; and &lt;a href="http://depth-first.com/articles/2006/08/26/scripting-java-libraries-with-ruby-java-bridge"&gt;Linux&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;A Simple Test&lt;/h4&gt;

&lt;p&gt;Assuming you've installed Ruby, RubyGems and Ruby Java Bridge, you can perform a simple demonstration of Octet in Ruby:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;rubygems&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;require_gem&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;rjb&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;rjb&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;

&lt;span class="constant"&gt;BasicMoleculeBuilder&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Rjb&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="ident"&gt;import&lt;/span&gt;&lt;span class="punct"&gt;('&lt;/span&gt;&lt;span class="string"&gt;net.sf.octet.builder.BasicMoleculeBuilder&lt;/span&gt;&lt;span class="punct"&gt;')&lt;/span&gt;
&lt;span class="constant"&gt;RepresentationKit&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Rjb&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="ident"&gt;import&lt;/span&gt;&lt;span class="punct"&gt;('&lt;/span&gt;&lt;span class="string"&gt;net.sf.octet.util.RepresentationKit&lt;/span&gt;&lt;span class="punct"&gt;')&lt;/span&gt;
&lt;span class="constant"&gt;MoleculeKit&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Rjb&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="ident"&gt;import&lt;/span&gt;&lt;span class="punct"&gt;('&lt;/span&gt;&lt;span class="string"&gt;net.sf.octet.util.MoleculeKit&lt;/span&gt;&lt;span class="punct"&gt;')&lt;/span&gt;
&lt;span class="constant"&gt;System&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Rjb&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="ident"&gt;import&lt;/span&gt;&lt;span class="punct"&gt;('&lt;/span&gt;&lt;span class="string"&gt;java.lang.System&lt;/span&gt;&lt;span class="punct"&gt;')&lt;/span&gt;

&lt;span class="ident"&gt;builder&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;BasicMoleculeBuilder&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;new&lt;/span&gt;

&lt;span class="constant"&gt;RepresentationKit&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;buildHexane&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;builder&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt;

&lt;span class="ident"&gt;molecule&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="ident"&gt;builder&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;releaseMolecule&lt;/span&gt;

&lt;span class="constant"&gt;MoleculeKit&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;printMolecule&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;molecule&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="constant"&gt;System&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;out&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

The above code generates an Octet representation for n-hexane, and prints the representation to the console. To run this example, save the above code to a file called &lt;strong&gt;test.rb&lt;/strong&gt; in your working directory. Then add &lt;strong&gt;octet-0.8.2.jar&lt;/strong&gt;, which can be found in the &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=96108&amp;package_id=102647&amp;release_id=378955"&gt;Octet-0.8.2 source distribution&lt;/a&gt;, to the same directory. The test can then be run with the following sequence of commands:

&lt;div class="console"&gt;
&lt;pre&gt;
$ export CLASSPATH=./octet-0.8.2.jar
$ ruby test.rb
**Molecule Properties**

Atom Count: 6, Bonding System Count: 5

Atoms:
atom: C[0] (2nu 0e, 0or, 0.0fc, 1bs, 1n, 4.0val, 3ih )
atom: C[1] (2nu 0e, 0or, 0.0fc, 2bs, 2n, 4.0val, 2ih )
atom: C[2] (2nu 0e, 0or, 0.0fc, 2bs, 2n, 4.0val, 2ih )
atom: C[3] (2nu 0e, 0or, 0.0fc, 2bs, 2n, 4.0val, 2ih )
atom: C[4] (2nu 0e, 0or, 0.0fc, 2bs, 2n, 4.0val, 2ih )
atom: C[5] (2nu 0e, 0or, 0.0fc, 1bs, 1n, 4.0val, 3ih )

No non-natural isotopic distributions specified.

No Orbitals specified.

Bonding Systems:
bonding system:  ( 2be, 0abe, 2a, 1ap ) [ (0, 1) ]
bonding system:  ( 2be, 0abe, 2a, 1ap ) [ (1, 2) ]
bonding system:  ( 2be, 0abe, 2a, 1ap ) [ (2, 3) ]
bonding system:  ( 2be, 0abe, 2a, 1ap ) [ (3, 4) ]
bonding system:  ( 2be, 0abe, 2a, 1ap ) [ (4, 5) ]

Atom Pairs:
atom pair: (0, 1) (1.0 bo)
atom pair: (1, 2) (1.0 bo)
atom pair: (2, 3) (1.0 bo)
atom pair: (3, 4) (1.0 bo)
atom pair: (4, 5) (1.0 bo)

No Atomic Configurations specified.
No Conformation specified.
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;As you can see, Octet shares the same concepts and vocabulary as &lt;a href="http://depth-first.com/articles/tag/flexmol"&gt;FlexMol&lt;/a&gt;. We'll drill down into the meaning of the output in later articles. The important thing to remember is that we can print out a report like the one above for any &lt;tt&gt;Molecule&lt;/tt&gt;, no matter how complex.&lt;/p&gt;

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

&lt;p&gt;Octet is an object-oriented framework designed to solve the molecular representation problem and serve as a solid foundation for a variety of cheminformatics applications. Of course, there's much more to Octet than the simple example shown here. Future articles will describe in greater detail the design and use of Octet through illustrative examples.&lt;/p&gt;</description>
      <pubDate>Tue, 30 Jan 2007 14:45:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:a53f05f2-aafb-4d26-a345-fdbfc6e9d724</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2007/01/30/an-object-oriented-framework-for-molecular-representation-getting-started-with-octet</link>
      <category>Tools</category>
      <category>octet</category>
      <category>flexmol</category>
      <category>representation</category>
      <category>java</category>
      <category>ruby</category>
      <category>inchi</category>
      <category>cml</category>
      <category>molfile</category>
      <category>smiles</category>
      <category>framework</category>
    </item>
    <item>
      <title>A Molecular Language for Modern Chemistry: FlexMol, Tetrahedral Chirality, and Monolaterol</title>
      <description>&lt;p&gt;Models of structure and bonding play a critical role in guiding chemical research. These models also define the scope and limitations of any cheminformatics system. Within the last several years, the gap between the structure and bonding models used by chemical information systems and by the chemists who use them has been widening. On this front, chemistry is moving much faster than cheminformatics. Sooner or later the difference must be reconciled.&lt;/p&gt;

&lt;h4&gt;A Looming Problem&lt;/h4&gt;

&lt;p&gt;Models of structure and bonding in cheminformatics, although adequate for organic chemistry in the 1970s, are outdated today. As &lt;a href="http://depth-first.com/articles/2006/12/19/ferrocene-and-beyond-a-solution-to-the-molecular-representation-problem"&gt;recently discussed&lt;/a&gt;, some of the most interesting molecules in organic chemistry can't be adequately represented by 99% of the available cheminformatics tools. This may not be a problem if your clients never work with these molecules (but they probably are already). It may not be a problem if your system never interacts with the outside world where these molecules are prevalent (but it will eventually). A quick fix is likely to produce even bigger problems down the road. What's needed is a comprehensive solution.&lt;/p&gt;

&lt;p&gt;FlexMol is a molecular language designed to solve this problem. For example, recent articles have demonstrated how FlexMol is capable of representing some of today's most difficult structural motifs: &lt;a href="http://depth-first.com/articles/2006/12/20/a-molecular-language-for-modern-chemistry-getting-started-with-flexmol"&gt;metallocenes&lt;/a&gt;; &lt;a href="http://depth-first.com/articles/2007/01/09/a-molecular-language-for-modern-chemistry-flexmol-and-axial-chirality"&gt;biaryl axial chirality&lt;/a&gt;; &lt;a href="http://depth-first.com/articles/2007/01/12/flexmol-and-axial-chirality-n-arylacrylanilides"&gt;non-biaryl axial chirality&lt;/a&gt;; &lt;a href="http://depth-first.com/articles/2007/01/22/a-molecular-language-for-modern-chemistry-flexmol-and-planar-chiral-metacyclophanes"&gt;planar chirality&lt;/a&gt;; and &lt;a href="http://depth-first.com/articles/2007/01/17/a-molecular-language-for-modern-chemistry-cisplatin-transplatin-and-molecular-configuration"&gt;non-tetrahedral stereochemical configuration&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Although FlexMol handles these tough cases, it's not merely a specialty language for "weird" molecules. Rather, FlexMol provides a basic set of elements and principles that can be applied to any molecule, regardless of its peculiarities or lack thereof. For example, FlexMol defines a clean system for the representation for &lt;a href="http://depth-first.com/articles/2007/01/02/a-molecular-language-for-modern-chemistry-flexmol-and-alkene-geometrical-isomerism"&gt;alkene geometry&lt;/a&gt;. This basic level of functionality is not even provided by the industry-standard Molfile format, which requires 2-D atom coordinates.&lt;/p&gt;

&lt;p&gt;In this demonstration, we'll turn our attention to one of the most basic problems in cheminformatics - the representation of tetrahedral chirality. Using an example molecule from the recent literature, we'll see how the principles outlined in previous FlexMol examples also apply to stereogenic carbons.&lt;/p&gt;

&lt;h4&gt;Conformation or Configuration?&lt;/h4&gt;

&lt;p&gt;We need to answer a basic question before we can represent tetrahedral chirality: should we use configuration or conformation? Following the simple principle that isomers interconvertible by bond rotation are conformational isomers and all others are configurational isomers, it's clear that we'll be using configuration. More rigorous definitions are offered by &lt;a href="http://dx.doi.org/10.1021/ci00027a001"&gt;Dietz&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;An Example&lt;/h4&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20070125/molecule.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;A &lt;a href="http://dx.doi.org/10.1021/np060192x"&gt;recent paper&lt;/a&gt; describes the isolation of the plant natural product Monolaterol and the assignment of its absolute configuration. Using the structure and atom numbering system shown above, we can construct a &lt;a href="http://depth-first.com/demo/20070125/molecule.xml"&gt;complete FlexMol representation&lt;/a&gt; of Monolaterol. Rather than reproduce it here, let's just consider the stereochemically-relevant part:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_xml "&gt;&lt;span class="comment"&gt;&amp;lt;!-- snip --&amp;gt;&lt;/span&gt;
&lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;configuration&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;configurationWheel&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;atomPair&lt;/span&gt; &lt;span class="attribute"&gt;source&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;15&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;target&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;16&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;atomPair&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt; &lt;span class="attribute"&gt;atom&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;14&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt; &lt;span class="attribute"&gt;atom&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;12&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;configurationWheel&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;configurationWheel&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;atomPair&lt;/span&gt; &lt;span class="attribute"&gt;source&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;15&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;target&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;12&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;atomPair&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt; &lt;span class="attribute"&gt;atom&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;16&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt; &lt;span class="attribute"&gt;atom&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;14&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;configurationWheel&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;configurationWheel&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;atomPair&lt;/span&gt; &lt;span class="attribute"&gt;source&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;15&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;target&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;14&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;atomPair&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt; &lt;span class="attribute"&gt;atom&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;12&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt; &lt;span class="attribute"&gt;atom&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;16&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;lower&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;halfPlane&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;configurationWheel&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;configuration&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="comment"&gt;&amp;lt;!-- snip --&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Notice that three &lt;tt&gt;configurationWheels&lt;/tt&gt; are defined. As in the case of representing the &lt;a href="http://depth-first.com/articles/2007/01/17/a-molecular-language-for-modern-chemistry-cisplatin-transplatin-and-molecular-configuration"&gt;configuration of square-planar species&lt;/a&gt;, each substituent of the chiral center is in turn placed along a wheel's axis, giving three wheels in total for Monolaterol. The relationships among atoms, planes, and axes is represented in the following cartoon:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20070125/configuration.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;Notice also that there are two empty half-planes in each &lt;tt&gt;conformationWheel&lt;/tt&gt;. Half-planes occur in pairs spaced 180 degrees apart. Given that there are two neighboring atoms to place into half-planes, two half-planes will be empty. We nevertheless must include them as placeholders. Notice that virtual hydrogens (those hydrogens not explicitly defined as part of the &lt;tt&gt;atoms&lt;/tt&gt; element) are not placed into half-planes.&lt;/p&gt;

&lt;p&gt;It should be clear that the FlexMol representation of Monolaterol's (&lt;em&gt;R&lt;/em&gt;)-enantiomer is distinguishable by visual inspection or by software. Each &lt;tt&gt;configurationWheel&lt;/tt&gt; would be enantiomeric. As a result, the ordering of half-planes about their respective axes would be inverted.&lt;/p&gt;

&lt;h4&gt;So What?&lt;/h4&gt;

&lt;p&gt;Most cheminformatics tools can represent tetrahedral chirality. In nearly every case, this is accomplished with stereodescriptors, atom parities, or chiral flags. Extending these systems to non-tetrahedral chirality requires more templates - a difficult, if not impossible, task in most cases. Worse still, such systems are often based on poorly-documented conventions, resulting in a great deal of confusion when writing software implementations.&lt;/p&gt;

&lt;p&gt;FlexMol takes a completely different approach by actually describing the chiral environment around an atom in terms of a simple system of axes and planes. The rules governing these elements are applied regardless of the kind of chirality being represented. This results in a system that works consistently for known forms of chirality, and which can be extended as new forms of chirality are encountered.&lt;/p&gt;

&lt;h4&gt;A Software Implementation&lt;/h4&gt;

&lt;p&gt;Any new molecular language requires a software implementation. For FlexMol, that implementation is provided by the &lt;a href="http://sf.net/projects/octet"&gt;Octet Framework&lt;/a&gt;. Octet is open source software written in Java that provides a FlexMol reader, a FlexMol writer, and many tools for working with molecular representations.&lt;/p&gt;

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

&lt;p&gt;Although not often discussed, models of bonding and structure figure prominently in the ability of cheminformatics software to solve relevant problems. This is especially true in the increasingly important area of molecular chirality. In this area, FlexMol offers a system with unprecedented flexibility; it works just as well with stereogenic carbon as with numerous, less common forms of chirality.&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jan 2007 15:16:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:b317fd9d-dfa7-4a49-8a46-d3aae3ce70f5</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2007/01/25/a-molecular-language-for-modern-chemistry-flexmol-tetrahedral-chirality-and-monolaterol</link>
      <category>Tools</category>
      <category>flexmol</category>
      <category>configuration</category>
      <category>monolaterol</category>
      <category>tetrahedralchirality</category>
      <category>octet</category>
    </item>
    <item>
      <title>Ferrocene and Beyond: A Solution to the Molecular Representation Problem</title>
      <description>&lt;blockquote&gt;
    &lt;p&gt;The representation of molecular structure decisively determines the scope of a chemical computer program. Our goal is to provide a versatile computer-oriented molecular structure representation for chemical information storage and retrieval as well as for computer-assisted synthesis design. Structural formulas describe molecular structure on the proper level of abstraction for these applications. ... It is therefore desirable that the computer-oriented representation of molecular structure be as expressive as the structural formulas.&lt;/p&gt;

    &lt;p&gt;-&lt;cite&gt;Andreas Dietz, &lt;a href="http://dx.doi.org/10.1021/ci00027a001"&gt;J. Chem. Inf. Comput. Sci. 1995, 35, 787-802&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="http://depth-first.com/articles/2006/12/12/the-problem-with-ferrocene"&gt;A recent Depth-First article&lt;/a&gt; highlighted the difficulty that existing molecular languages have in communicating the generalized, multi-atom bonding present in metallocenes such a ferrocene. For software and Web services that do not interact with the outside world, the Ferrocene Problem may not be a big deal. But for the growing number that do, the Ferrocene Problem is but the tip of a very large iceberg.&lt;/p&gt;

&lt;h4&gt;Today's Weird-Looking Molecule is Tomorrow's Molecule of the Month&lt;/h4&gt;

&lt;p&gt;Consider the problem of axial chirality, such as that present in certain biaryls. None of the molecular languages currently in widespread use (InChI, SMILES, Molfile, or CML) provide a mechanism to faithfully represent and communicate this structural motif. In the 1980s, axial chirality was a novelty. Today it is ubiquitous. Consider &lt;a href="http://dx.doi.org/10.1021/ol062499t"&gt;this graphical abstract&lt;/a&gt; from the current issue of &lt;em&gt;Organic Letters&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;a href="http://dx.doi.org/10.1021/ol062499t"&gt;&lt;img src="http://depth-first.com/demo/20061219/binol_ga.gif" border="0"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;If you were asked to create an application capable of distinguishing substituted (R) and (S) binol enantiomers, could you do it? If your system needed to reliably interact with the outside world, could it do so? If you're working with any of the cheminformatics tools currently in widespread use, chances are good that the answers to these questions would be "no".&lt;/p&gt;

&lt;p&gt;Do you still think of metallocenes as curiosities studied by a handful of organometallic chemists? Consider &lt;a href="http://dx.doi.org/10.1021/ol062806v"&gt;this &lt;em&gt;J. Org. Chem.&lt;/em&gt; ASAP contents article&lt;/a&gt; describing one of the most fundamental transformations in organic chemistry:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;a href="http://dx.doi.org/10.1021/ol062806v"&gt;&lt;img src="http://depth-first.com/demo/20061219/irridium_matallocene_ga.gif" border="0"&gt;&lt;/center&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;The problem only gets worse as concepts like axial and planar chirality are increasingly co-mingled with multi-atom bonding. For example, consider &lt;a href="http://dx.doi.org/10.1021/jo061360t"&gt;the following graphical abstract&lt;/a&gt;, taken from &lt;em&gt;J. Org. Chem.&lt;/em&gt; ASAP contents:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;a href="http://dx.doi.org/10.1021/jo061360t"&gt;&lt;img src="http://depth-first.com/demo/20061219/ferrocene_ga.gif" border="0"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;These molecules, and many others like them, were used in the context of &lt;em&gt;organic chemistry&lt;/em&gt;. Moreover, the papers describing their use were published in widely-respected journals specializing in &lt;em&gt;organic chemistry&lt;/em&gt;. Yet dozens of popular cheminformatics tools specifically designed for use with &lt;em&gt;organic chemisty&lt;/em&gt; are incapable of faithfully representing the most interesting features of these molecules. In other words, the problem is both real and immediate.&lt;/p&gt;

&lt;p&gt;Chemistry relentlessly marches forward, revealing even greater molecular information problems on the horizon. For software to remain relevant, it must be based on tools that are up to the challenge.&lt;/p&gt;

&lt;h4&gt;A Solution&lt;/h4&gt;

&lt;p&gt;&lt;a href="http://dx.doi.org/10.1021/ci00027a001"&gt;The system proposed by Dietz &lt;/a&gt; offers a solution to nearly all of the bonding and stereochemistry problems of existing molecular languages. As a tradeoff, Dietz's system is significantly more complicated to implement. This places an increased burden on software to make the system as simple and understandable as possible.&lt;/p&gt;

&lt;h4&gt;Java and XML Implementations&lt;/h4&gt;

&lt;p&gt;Any specification, if it is to become more than just an academic exercise, requires a software implementation. Fortunately, for Dietz's system both a software implementation and an XML Schema have been developed and are freely-available.&lt;/p&gt;

&lt;p&gt;The software implementation can be found in the Java framework &lt;a href="http://sf.net/projects/octet"&gt;Octet&lt;/a&gt;. In addition to fully-implementing Dietz's specification, Octet enables ring perception, substructure and query structure matching, breadth-first traversal, and of course, depth-first traversal. Add-on libraries are available for &lt;a href="http://sf.net/projects/structure"&gt;2-D structure depiction&lt;/a&gt;, and &lt;a href="http://sf.net/projects/rxf"&gt;Molfile and SMILES input and output&lt;/a&gt;. &lt;a href="http://almost.cubic.uni-koeln.de/cdk/cdk_top/cdk_news/archive/cdknews2.2.article18.pdf"&gt;A CDK News article&lt;/a&gt; discusses &lt;a href="http://sf.net/projects/cdktools"&gt;CDKTools&lt;/a&gt;, a bridge to the &lt;a href="http://cdk.sf.net"&gt;Chemistry Development Kit&lt;/a&gt;. Octet remains, to my knowledge, the first and only implementation of the Dietz system.&lt;/p&gt;

&lt;p&gt;The first, and to my knowledge only, XML implementation of the Dietz molecular representation system is FlexMol (Flexible Molecular Object Language). A commented W3C schema is distributed with Octet. Browser-ready HTML documentation can be found &lt;a href="http://depth-first.com/doc/flexmol"&gt;here&lt;/a&gt;, or from the sidebar links under "APIs and Schema Documentation." Octet is able to read and write FlexMol documents, providing an open, end-to-end solution to the problem of representing and transmitting molecules containing "nonstandard" bonding and stereochemistry.&lt;/p&gt;

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

&lt;p&gt;Both FlexMol and Octet are convenient tools for working with the Dietz molecular representation system. Future articles in this series will show how they can be used to solve current, real-world molecular representation problems.&lt;/p&gt;</description>
      <pubDate>Tue, 19 Dec 2006 14:45:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:108aea78-8aa2-40cd-be5d-3f19b06f0aeb</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2006/12/19/ferrocene-and-beyond-a-solution-to-the-molecular-representation-problem</link>
      <category>Meta</category>
      <category>binol</category>
      <category>ferroceneproblem</category>
      <category>ferrocene</category>
      <category>flexmol</category>
      <category>octet</category>
      <category>representation</category>
      <category>dietz</category>
    </item>
    <item>
      <title>Scripting Octet with JRuby</title>
      <description>&lt;p&gt;&lt;img src="http://depth-first.com/files/jruby.png" align="right"&gt;&lt;/img&gt;&lt;a href="http://jruby.codehaus.org/"&gt;JRuby&lt;/a&gt; is a Java implementation of the Ruby language. It lets developers manipulate Java classes and objects using Ruby syntax. Why would anybody want to do this? One reason is to enable Ruby developers to work with &#8220;legacy&#8221; Java code. Another less obvious reason it that Java classes and objects can manipulated interactively with the JRuby version of &lt;a href="http://tryruby.hobix.com/"&gt;Interactive Ruby&lt;/a&gt;, or irb. Still another is to provide new avenues for application development and deployment. In this article, I'll show how &lt;a href="http://sf.net/projects/octet"&gt;Octet&lt;/a&gt; can be scripted with JRuby.&lt;/p&gt;</description>
      <pubDate>Wed, 23 Aug 2006 23:21:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0a2b3ac1-9392-4bc4-93c7-eabe3b96945b</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2006/08/23/scripting-octet-with-jruby</link>
      <category>Tools</category>
      <category>octet</category>
      <category>jruby</category>
      <category>rails</category>
    </item>
  </channel>
</rss>
