Macs in Chemistry

Insanely great science

 

ibabel-icon

iBabel 3.6

iBabel started out as an AppleScript Studio application designed as a front-end to OpenBabel DOI, this was updated several times and is now an ApplescriptObjC application built with Xcode. As well as acting as a front-end to OpenBabel it also provided a front-end to tools built on OpenBabel and a molecule viewer using a selection of java applets and plugins via an embedded web view.

There is a detailed explanation describing the installation of OpenBabel and other cheminformatics tools here.

This all worked perfectly for a while but various security issues mean that java applets and plugins via an embedded web view no longer function, in addition calls to remote web servers to provide javascript viewers also cause security issues. In addition OpenBabel has been substantially rewritten so that many of the small programs built on OpenBabel are no longer supported. This functionality has not been lost however, they have now been incorporated into the main OpenBabel program. Security updates, Sandboxing and changes within El Capitan also meant I had to update a number of features.

Download

You can download iBabel here iBabel, , but remember you also need to install OpenBabel.

What has Changed

Now things have settled down a bit I've restarted work on iBabel, I've transitioned most of the calls to babel over to obabel the differences are highlighted here and replaced the calls to the tools based built on OpenBabel with the new corresponding calls to obabel.

Updating the viewers however has taken more time than I expected with new security features in Mac OSX updates causing unexpected issues. Whilst not yet complete, I have removed all the java or plugin-based molecular viewers and I am in the process of replacing them with javascript versions.

Preferences

In addition to the SVG output provided by OpenBabel itself there are also a selection of 2D and 3D viewers.

3dviewers

The javascript viewers/editors are not quite as fully featured as the java versions they replace but as they become more sophisticated I'll continue to update them. The developers of the avascript viewers/editors have made tremendous strides over the last year or so.

The older iBabel give details of the capabilities but I thought it might be useful to summarise them here. The "Convert" tab provides access to the file conversion capabilities of OpenBabel supporting over 175 different chemical file formats. There are also a number of file manipulation tools that are part of the OpenBabel toolkit including generation of 2D and 3D representations. On each of the tabs there is a "Use Terminal" checkbox in the bottom left hand corner, this runs the common in a Terminal window, this is useful for troubleshooting but users often use iBabel to set up commands that they then copy, edit and manipulate in the Terminal window afterwards. The (*) check box allows the use of wild cards when doing file conversions, you will need to ensure all file paths support unix conventions however.

convert

Search Tab

The "Search" tab gives access to substructure searching, this makes use of queries based on SMARTS a language that allows you to specify substructures using rules that are an extension of SMILES representation. You can use the inbuilt JSME editor kindly provided by Peter Ertl and Bruno Bienfait to generate the queries. Or the Classes and Groups provide readymade SMARTS.

sss

The results of the search can be output to a new file or if you have already imported the structures into the Viewer you can use the Search facility to highlight matching structures, and if you use the OpenBabel SVG for display the matching atoms are highlighted in green as shown below. The download includes a folder called TestFiles, this includes a file called "200HERGactives.sdf" these are a selection of around 200 actives taken from the HERG target in ChEMBL.

HERG (Humann Ether-a-go-go-related gene potassium channel 1) this ion channel is best known for its contribution to the electrical activity of the heart that coordinates the heart's beating.

If you set this file as the input file then click import the structures will be imported into the "Viewer". If you then go to the "Search" tab and set the same file as the input file and use piperidine as the search string in SMILES format C1NCCCC1. From the options choose "-s Matching", click the "Show in Viewer" checkbox and the "select" option. If you then click "Search" you should get the results shown below (if using SVG viewer).

viewersss

Similar Tab

OpenBabel is a chemical toolbox designed to speak the many languages of chemical data. It's an open, collaborative project allowing anyone to search, convert, analyse, or store data from molecular modelling, chemistry, solid-state materials, biochemistry, or related areas. One of the ready made applications is the fastsearch utility. This uses molecular fingerprints to prepare and search an index of a multi-molecule datafile. It allows very fast substructure and structural similarity searching. The indexing is a relatively slow process but the subsequent searching is much, much faster, a few seconds on 10-100,000 structure files, and so can be done interactively.

The "Similar" tab gives access to the fast search capabilities, you can use this GUI to create the fast search file and then run substructure or similarity searches against the fast search index, several different fingerprints are available with FP2 being the default.

PROMPT$ obabel -L fingerprints
FP2    Indexes linear fragments up to 7 atoms.
FP3    SMARTS patterns specified in the file patterns.txt
FP4    SMARTS patterns specified in the file SMARTS_InteLigand.txt
MACCS    SMARTS patterns specified in the file MACCS.txt

fastsearch

Even with large files you can import the structures into the viewer, run the search and have them selected, but bear in mind whilst the search may be quick flagging all the hits in the Viewer may take a little while. Running the search on a 12641 structure file using fast search took seconds but the process of selecting 3033 hits in the viewer took a minute.

fsresults-2

Tools Tab

The "Tools" tab contains an increasing number of tools.

screeshot

When you select a tool the panel below changes to give a brief explanation and a listing of the input parameters required.

tools

Viewer tab

To import structures first select the input file and then click on the "Import" button, you will get a prompt telling you how many structures are to be imported and then the table will be populated. You can use this view to search, select, amend selections or delete structures. You can export the results. The Search box provides live interactive searching of the Name field.

fsresults-2

The "CIR" button pops up a panel that allows you to type of paste in a single molecular identifier or chose a file of molecular identifiers it then uses the Chemical Identifier Resolver web service to get the corresponding structures

The Chemical Identifier Resolver (CIR) by the CADD Group at the NCI/NIH is 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, CAS Number, IUPAC name, drug name or code.

cir

The TestFiles folder provides a text file you can use to try this feature out "CIRtest.txt" contains a selection of different compound identifiers.

Benzene
JunkJunkJunk
Iodobenzene
emend
aspirin
CN1C2=C(C(C3=CC=CC=C3)=NCC1=O)C=C(Cl)C=C2
2,15-dimethyl-14-(1,5-dimethylhexyl)tetracyclo[8.7.0.02,7.011,15]heptadec-7-en-5-ol
118-96-7
UK-92480
Clozapine

After clicking on the "CIR" button first Choose the file in the dropdown panel and then click "Get List". Two files are created on the desktop "output.smi" contains SMILES strings for all structures found using CIR, and "no_structure.txt" contains the identifiers not found. Importing "output.smi" into the viewer allows the user to see the structures.

CIRresults

The new version of iBabel can be downloaded from here iBabel, it contains all the viewers etc. within the bundle so it is a larger download but this should also make it less susceptible external changes. The download also includes test files so you can try it out.

ChemLook

This version of iBabel also includes ChemLook a Quick Look plugin for chemistry files. Currently this only displays the contents of the file on the thumbnail as shown below, however it will soon also support previews.

chemlook

There are still a few cosmetic things to tidy up but everything should now work as expected (i hope!). As ever comments and suggestions welcome.

Page Updated 4 January 2016