Thursday, June 15, 2006

CML, a powerful chemical file type

CML (Chemical Markup Language) is a chemistry-oriented file format, based on a markup language. It's capable of holding many informations, like chemical structures, chemical properties or reactions.

By using the right style sheet, it's possible to transform or to render easily the information. For example, it's used in the chemical-structures project to generate html datasheet of each compound.

Some papers relevant to this topic have been published.

Here is an example of molecule (D-Alanine) in cml format:
<?xml version="1.0"?>
<molecule xmlns=""
<name convention="IUPAC">(2R)-2-Aminopropanoic acid</name>
<atom id="a1" elementType="H" x3="-3.496" y3="1.763" z3="-2.499"/>
<atom id="a2" elementType="C" x3="-3.687" y3="0.754" z3="-2.120"/>
<atom id="a3" elementType="N" x3="-2.411" y3="0.067" z3="-1.892"/>
<atom id="a4" elementType="H" x3="-1.649" y3="0.745" z3="-1.865"/>
<atom id="a5" elementType="H" x3="-2.208" y3="-0.558" z3="-2.672"/>
<atom id="a6" elementType="C" x3="-4.450" y3="0.847" z3="-0.803"/>
<atom id="a7" elementType="H" x3="-5.398" y3="1.380" z3="-0.932"/>
<atom id="a8" elementType="H" x3="-3.872" y3="1.391" z3="-0.048"/>
<atom id="a9" elementType="H" x3="-4.682" y3="-0.144" z3="-0.401"/>
<atom id="a10" elementType="C" x3="-4.453" y3="-0.004" z3="-3.198"/>
<atom id="a11" elementType="O" x3="-4.044" y3="-0.991" z3="-3.791"/>
<atom id="a12" elementType="O" x3="-5.639" y3="0.577" z3="-3.501"/>
<atom id="a13" elementType="H" x3="-6.093" y3="0.057" z3="-4.197"/>
<bond atomRefs2="a1 a2" order="1"/>
<bond atomRefs2="a2 a3" order="1"/>
<bond atomRefs2="a2 a6" order="1"/>
<bond atomRefs2="a2 a10" order="1"/>
<bond atomRefs2="a3 a4" order="1"/>
<bond atomRefs2="a3 a5" order="1"/>
<bond atomRefs2="a6 a7" order="1"/>
<bond atomRefs2="a6 a8" order="1"/>
<bond atomRefs2="a6 a9" order="1"/>
<bond atomRefs2="a10 a11" order="2"/>
<bond atomRefs2="a10 a12" order="1"/>
<bond atomRefs2="a12 a13" order="1"/>