Saturday, October 25, 2008

Bioclipse2 Scripting #1: from SMILES to a UFF optimized structure in Jmol

After some difficulties this week with making an export of CDK plugins in the Bioclipse2 Cheminformatics feature of with the cdk-eclipse software, I got the following cute Bioclipse2 script up and running:
dimethylether = cdk.fromSMILES( "COC" );
cdk.addExplicitHydrogens( dimethylether );
cdk.generate3dCoordinates( dimethylether );

// save as CML
cdk.saveCML( dimethylether, "/Virtual/dimethylether.cml" ); "/Virtual/dimethylether.cml" ); // this should open a JmolEditor

You can see four of my favorite cheminformatics tools integrated: CDK is used to convert a SMILES into connection table with add explicit hydrogens, and to create initial 3D coordinates (with the code from Christian Hoppe, and thanx to Stefan for fixing that code in the CDK 1.1.x branch!). Then, CMLDOM is used to create and save a CML document, which is then opened into a Jmol editor in Bioclipse.

A variation of this script is visible in the following screenshot:

This and other Bioclipse2 scripts I will post in Gist, a sort of pastebin supporting version history, and I'll tag them with bioclipse gist on delicious, so that you can always browse them, comment on them, or add your own gists at