Monday, May 29, 2006

Jmol and CML

Jmol is now up and running on showme.physics.drexel.edu. For a demonstration of (just some of) Jmol's features, click on the malaria37 demonstration page here. This demo was created using jmol.js, a javascript library which allows jmol to be controlled from your browser via LiveConnect and javascript commands. All in all, a very powerful package.

Jmol can handle molecules in a variety of formats, including, in this case, CML. The individual CML files (e.g., malaria37.066.xml), were generated from an updated version of ConvertFile.xls (strictly speaking, from babel), available as a zip file from showme.physics.drexel.edu (check my 5/12/2006 blog for more information on ConvertFile.xls).

In addition to now generating individual CML files for the entries in a mol or sdf file such as malaria37, ConvertFile.xls will now also generate an xml file for the entire batch when you press the "Save Results" button. This xml file has the structure (I've omitted the actual data):


<?xml version="1.0"?>
<Molecules Source="">
<Molecule Entry="">
<SMILES></SMILES>
<UCNumber></UCNumber>
<MolecularWeight></MolecularWeight>
<MoleculeData>
<atomArray />
<bondArray />
</MoleculeData>
<Suppliers>
<SupplierInfo></SupplierInfo>
</Suppliers>
</Molecule>
etc.

This schema for this file can easily be used in programming languages such as, for example, .NET, as the basis for a typed dataset, but a more interesting possibility would be to transform it into an RSS feed. This could be done fairly easily with Excel VBA or any other programming language, or an XSLT.

The next step here would seem to be to read the usefulchem-molecules blog, extract the SMILES, and convert to CML in a similar manner. Unfortunately, babel does not yet have the ability to generate molecular coordinates from SMILEs (or InChIs), and while other software can do this (e.g., ChemSketch, JChemPaint), they cannot be automated. The CDK Web Services sports a service to generate coordinates from SMILES, but it is not particularly usable in its current form -- it does, however, show how this can be accomplished with the CDK.

2 Comments:

At 6:10 AM, Blogger Egon Willighagen said...

Hi David,

good to see CML support is getting along. The XML example you show, is not CML. Is it supposed to? Much of the information you have in that example you could easily represent in CML too. I can send a CML equivalent by email if you like.

You also mention you had trouble with Rajarshi's web service for creating 2D coordinates from SMILES. Setting up a small Java program which does this locally is easy, and I can send some example code for this by email too.

Just let me know.

 
At 6:42 AM, Blogger Jean-Claude Bradley said...

Egon - indeed we would appreciate your help!

 

Post a Comment

<< Home

Creative Commons Attribution Share-Alike 2.5 License