Macs in Chemistry

Insanely great science

 

Updated

The latest version of iBabel can be found here

This is an old page please use the link above.

iBabel 3.0

Not Just File Conversion

The status of iBabel

Feb 22

It seems there is a problem with Mac OS X 10.7.x

I've asked a few people and we can find no obvious issues.

So I've used XCode to build a version specifically for Mac OS 10.7. As far as I can tell there are no differences and no issues reported but lets see.

It can be downloaded from here.

http://macinchem.org/ibabel/iBabel107/iBabel.zip

The version for Mac OS X 10.8.x can be download from here iBabel3

February 2013

As you might have imagined the issues with Java security have made it impossible to support the use of Java Applets as the molecule viewer so I’ve been busy trying out various options. I’ve decided to abandon the use of Java applets and the use of plugins; sorting out which version of a plugin works with which version of browser and/or operating system was becoming a nightmare. So I’m moving to a variety of Javascript based molecule viewers.

The options are shown in the image below. Elemental is 2D molecule viewer/editor from Dotmatics, which I have working but not released yet, JSmol is a javascript version of the very popular Jmol. SVG are the images that are generated by OpenBabel itself, ChemDoodle is a javascript 2/3D molecule viewer and editor. ChemBioDraw may or may not work depending on the factors mentioned above.

viewers

SMARTCyp is a new addition and allows you to view the most likely sites for oxidative metabolism developed by Patrik Rydberg as shown below.

Patrik Rydberg, David E. Gloriam, Jed Zaretzki, Curt Breneman, Lars Olsen, SMARTCyp: A 2D Method for Prediction of Cytochrome P450-Mediated Drug Metabolism, ACS Med. Chem. Lett., 2010, 1 (3), pp 96-100.

Patrik Rydberg, David Gloriam and Lars Olsen, The SMARTCyp cytochrome P450 metabolism prediction server, Bioinformatics, 2010, 26, 2988-2989

smartcyp

Another change is that instead of using Pubchem to get structures from identifiers iBabel now uses the Chemical Identifier Resolver(CIR) by the CADD Group at the NCI/NIH a web service that performs various chemical name to structure conversions. The service works as a resolver for different chemical structure identifiers and allows one to convert a given structure identifier into another representation or structure identifier. It can help you identify and find the chemical structure if you have an identifier such as an InChIKey or CAS Number. The input identifier can be a chemical name, SMILES, CAS Number, InChi etc and the returned representation can be SMILES, sdf, png etc. this is achieved by using a combination of OPSIN, ChemSpider and CIR's own database.

The tools section has been updated and includes several excellent tools from silicos-it

ibabelTools

The latest version can be downloaded from here iBabel

Remember this version is designed to support Mac OSX 10.8 and requires OpenBabel 2.3. Whilst the javascript libraries for ChemDoodle are included to use JSmol you will need to download from here, I may bundle it in the future but whilst it is still under active development it sees easier for the user to decide on updates. iBabel assumes that the folder containing JSmol is in Macintosh HD:Public:jsmol.

The silicos tools need to be downloaded and compiled, and installed in usr/local/bin with the openbabel tools.

A brief installation guide

Download iBabel and add to the applications folder Install OpenBabel, you can compile from source but the easiest way to get going is to install ChemSpotlight which includes OpenBabel, a Spotlight metadata importer and a Quicklook plugin.

By default Gatekeeper will prevent opening since this was not downloaded from the App store, more info here at the moment you will need to :

  1. In Finder, Control-click or right click the icon of the app.
  2. Select Open from the top of contextual menu that appears

menu

Once any bugs have been sorted I’ll arrange to the app to be signed.

If you want to use JSmol you need to download from here download from here, the the folder jsmol needs to be put in Macintosh HD:Public:jsmol. In the jsmol folder you will also find a series of test pages that allow you to explore the capabilities

The silicos-it tools can be downloaded from here silicos-it they need to be compiled, and installed in usr/local/bin with the openbabel tools (I think this is the default install).

Legal Stuff

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License.

September 2012

The latest changes to Java seem to have broken the ability to use java plugins in a web view. Until I can find a fix I’m afraid you will have to use SVG or ChemDoodle as the viewer/

March 2012 Update to iBabel

I’ve been doing a little work to update iBabel, I’ve updated all the tools developed by Silicos-it to use the new names and options.

tools

I’ve also been looking at the Molecule Viewers, I’ve disabled the ChemDraw plugin because it does not support the now standard 64-bit mode Safari :-(

On the other hand SVG support in Openbabel has undergone significant improvements due to the brilliant efforts of Noel O’Boyle and Chris Morley in particular the ability to colour a substructure within a molecule. This requires installation of the development version of OpenBabel at present.

ChrisMacbookPro:~ prompt$ obabel -L highlight
One of the ops
highlight    Highlight substructures in 2D depictions
Usage: --highlight "SMARTS1 color1 [SMARTS2 color2 ...]"

Valid colors are black, gray, white, red, green, blue, yellow, cyan, purple, teal and olive.
Additional colors may be specified as hexadecimal RGB values preceded by #.

The following will color the phenyl group green, and the carboxyl group orange:

 obabel -:"c1ccccc1CCC(=O)O" -O mol.svg --highlight "c1ccccc1 green C(=O)O #FFA500"

sss

You can see it in action in the movie below.

The new beta can be downloaded from here. (30 MB)

As I mentioned a little while ago I’m in the process of rewriting iBabel using AppleScriptObjC, and thanks to the invaluable help of AppleScriptObjC Explored by Shane Stanley and the contributors to the MacScripter website I now have the first beta available.

It can be downloaded from here (24MB), this version requires Mac OS X 10.6 or higher and OpenBabel 2.3

Much will seem familiar to previous users of iBabel and the screenshots of the old version give a good overview of the capabilities, whilst the images below highlight a few of the new features.

Update: 13 March 2011

Here is the latest version of iBabel (3beta3), the big changes are I've written the on the fly conversion of SMILES to 2D structures so ChemDoodle will now render SMILES in the Viewer panel. I've also rewritten the PubChem search since the they changed some of the field names, there is now a movie of this facility in action here.

Update: 21 Feb 2011

I’ve just uploaded a new beta (3beta2), there are a couple of minor bug fixes and I’ve added the ability to use wild cards in the input file for file conversions.

ibabel_wildcard2 If you include a wild card in the input string then normally you get this error if you look at the Terminal.

/usr/local/bin/babel  -ismiles   '/Users/swain/Desktop/tes*.smiles'  -osdf   '/Users/swain/Desktop/output.sdf'        --gen3D   
==============================
*** Open Babel Error  in OpenAndSetFormat
  Cannot open /Users/swain/Desktop/tes*.smiles
0 molecules converted
1 errors

This is because the input file path is in single quotes, if you click the check box then the file path is not in single quotes and you can use wild cards. A word of caution, if you are going to use wild cards then you must ensure that the entire file path does not include any unacceptable characters (* & % etc.).

 /usr/local/bin/babel  -ismiles   /Users/swain/Desktop/tes*.smiles   -osdf   '/Users/swain/Desktop/output.sdf'        --gen3D 
4 molecules converted
308 audit log messages

Update: 14 Feb 2011

The “Add title and index” option appends a title (default is Mol, but you can edit this in the adjacent text box) and an index number to multi-molecular files, e.g. Mol 1, Mol 2, Mol 3 etc. This is essential if you want to search files displayed in the “Viewer” since you need a unique identifier for each structure. In many cases the molecules will already have a molecule id.

Another new feature with OpenBabel 2.3 is the ability to generate 2D and 3D coordinates, so that is now available in the “Convert” pane. Perhaps the biggest changes have come with the “Viewer”, by storing the table data in an array we can use some of the cool ObjC functions such as the continuously updating selection count and the live searching of the “Name” text field. To import records identify the input file using the input button and then click the “Import” button.

The buttons highlighted in green allow the user to delete the highlighted row, delete all the “Selected” rows or clear all records completely. The selection can be modified using the buttons highlighted in pale blue. Once you have made your selection there are buttons for clearing all records, deleting the selected records or just the currently highlighted record. There are a selection of supported viewers chosen using the iBabel Preferences. ChemDoodle is an included lightweight javascript library that works very well for most file formats but does not at present support SMILES (you can of course use iBabel to convert SMILES to sdf using the generate 2D option). I’m looking at doing this on the fly but I need to see what the performance hit will be. For the other viewers, JMOL/JChemPaint are in the application bundle. ChemBioDraw needs to be in the Application folder but only works on some machines (something to do with only supporting 32-bit which I think we will have to wait for CambridgeSoft to address). Because of Java security issues Marvin has to be in the same file structure as the htm page, I think you only need to put an alias to Marvin in the “Macintosh HD:Public” folder or” User:Public folder”. The 2D and 3D radio buttons allow you to choose an appropriate display.

It also support JME as the editor but you need to get a copy from Peter Ertl directly and put it in the “Macintosh HD:Public” folder or” User:Public folder”.

The PChem button pulls structures from PubChem, this can either be a single structure of a list (here is an example caslist.txt you can download to try). As you can see the list contains a mixture of systematic names, trivial names, drug names and CAS numbers but the smart people at PubChem sort all that out nicely.

64318-79-2
iodobenzene
trinitrotoluene
anisaldehyde
170729-80-3
nonsense
Clomipramine
Loratidine
108-86-1
63-75-2
Promethazine
Chlorpromazine

The result is two files on desktop your output.smi which contains the successful searches and NoStructure.txt which contains cases where no structure was found. You can then import the file to view the structures.

The “Tools” tab has been extensively modified now giving access to the many tools that have been built on top of the OpenBabel library.

obprobe

Since each of the tools needs a different set of input parameters the “Options” box is updated each time you choose another tool, the advantage of doing this is that I can easily add further tools as they become available.

tools

I’d be delighted to hear of any bugs (honest) and any suggestions for how iBabel might be improved.