Wednesday, 27 May 2009

The RSC - Value for money?

I don't usually advertise for chemical societies, but in these recessionary times I thought the following might be of interest to some readers.

RSC members have:
  • free access to Wiley, Elsevier, and Springer chemistry journals
  • free access to 913 chemistry e-books from a variety of sources
  • 20% off Pearson Education Books, 30% off Wiley, 35% off Blackwell
  • and most importantly, £5 off Pizza Express Club membership
Sure, chemistry societies organise conferences, enable networking, provide travel grants, and lobby politicians; but any society that doesn't look after its most vulnerable members by providing discounted pizza is not a society I want to be a member of.

Thursday, 21 May 2009

Have your hamburger and eat it - Edit molecules in PDFs II

In Part I, I showed how to hack some code together that allowed you to paste images directly from the clipboard (e.g. from a PDF) into Beda's BKChem, a 2D drawing program. The magic conversion from image to chemical was done by Igor's OSRA.

Well, Igor has taken this idea and run with it. The latest version of OSRA now includes plugins for BKChem, Symyx Draw, MolSketch and Pipeline Pilot.

If you use the Windows installer, the Symyx Draw plugin is automatically installed and adds an "Import Structures from OSRA" option to the File menu. The first time you choose it, you will need to change the path to something like "C:\Program Files\osra\osra.exe" under "Settings...". Here's the plugin in action:
Note that the other plugins appear to be only available from the Windows .zip release.

Saturday, 16 May 2009

How do enzyme mechanisms evolve?

Evolution is a fascinating topic. Although the principal mechanism by which evolution occurs is quite simple to understand, namely the introduction of changes (mutations) into the DNA, the consequences that follow are enormous.

The term selective pressure is used to describe an imaginary operator that affects the incidence of particular mutations in a population. What makes evolution difficult for me to get my head around is that selection operates on many levels. In a population, a particular physical characteristic might be more advantageous (think of the famous finches) or more attractive. In your DNA, a particular mutation might preserve the amino acid coded for, or it may change to another amino acid that does not affect the protein's function. On the other hand, if the amino acid is involved in the catalytic action of the protein it's going to be conserved, right? But then how do new mechanisms evolve?

My former postdoc supervisor, Dr. John Mitchell, is currently advertising a PhD position on "Modelling the Evolution of Enzyme Catalysis" at the University of St. Andrews. I'm particularly interested in this project as it builds on earlier work I carried out in the Mitchell Group along with Gemma Holliday and Daniel Almonacid. Here's an excerpt from the project description:
We will create a simulation using a population of model enzyme-catalysed reactions, mimicking a state early in evolutionary history, and allow them to evolve in EC space. The reactions will consist of steps and be represented, in a manner familiar from genetic algorithms, by "chromosomes" describing the chemical properties of each step. Parameters will control the likelihood of different kinds of evolutionary event, such as a change of substrate with the same underlying chemical mechanism, taking place. The simulations will be calibrated, and then compared with the results from a study of real-world convergent and divergent evolution.
Cool. Closing date 31 July.

Image credit: Colin Purrington

Tuesday, 5 May 2009

Manipulating PDFs with Open Source Tools - Part II

Part I

There are a couple of journals that have rather generous margins around the text. I prefer to print out two pages per sheet to avoid wasting paper, so it would be nice to be able to remove those margins and increase the size of the text instead.

pdfcrop by Heiko Oberdiek allows you to do just that. It's included with Debian Linux, and "sudo apt-get install texlive-pdfetex" will install it. On other (lesser) Linux distributions you may have to check CPAN or CTAN. Once installed, a straightforward "pdfcrop withmargin.pdf nomargin.pdf" will do the conversion.

Update: A reader points out that Tex Live 2008 includes pdfcrop and is available for both Windows and Linux.

Note that pdfcrop should not be confused with PDFCrop. There's also a patch of pdfcrop called pdfcrop2, but I think that covers the current crop.

And spare a thought for Fermat.

Image credit: B.G. Johnson

ChemPad - Protecting you from chemical structure software

A colleague has just pointed me to ChemPad, an interesting piece of software that allows chemists to draw chemical diagrams directly into a computer on a Tablet PC. It was designed as a tool to enable undergraduate chemists to quickly enter chemical structures and generate 3D diagrams with which they could gain a deeper understanding of structures. Hash and wedge bonds are understood and are converted faithfully to 3D, for example.

From the point of view of teaching chemistry undergraduates, such software may be preferable to ChemDraw and friends as it allows them to develop the skill of drawing diagrams by hand. Of course, not everyone has a tablet PC but one could imagine similar software for the iPhone or just a regular PC driven by a mouse.

ChemPad is free but not open source, and Windows only. The ChemPad website has tutorials and videos of the software in use.

Friday, 24 April 2009

Broken symmetry - Can SMILES and InChI ensure canonicalisation?

I've been working on the SMILES code in OpenBabel over the last while. The longer I've spent on it, the more impressed I've been with how it has been handled in the code and also with what a great idea SMILES was in the first place. The same goes for InChI, which has a slightly different goal, but which goes the extra mile and solves normalisation problems which I didn't even know existed.

But do they work? Can their canonicalisation procedures ensure that two identical molecular graphs result in the same canonical SMILES or InChI?

The InChI canonicalisation procedure is summarised in Rich's post. The Daylight algorithm is in Weininger*3, JCICS, 1989, 29, 97. And the review of the field that throws both into question is Ivanciuc's review of Processing Constitutional Information in Gasteiger's Handbook of Cheminformatics.

The key question here is whether the SMILES and InChI algorithms are capable of identifying automorphisms. There is a brute force way to do this, but both SMILES and InChI try to avoid this by identifying symmetry classes using extended connectivity and various graph invariants. An explicit automorphism check is not described as part of either algorithm but yet Ivanciuc argues repeatedly (e.g. at the end of 5.1.4) that any canonicalisation algorithm that does not include an explicit automorphism check "is incomplete, and its use in a chemical database...is unreliable".

The funny thing is that although the SMILES paper came out several years prior to Gasteiger's handbook (1993 vs. 2003), it is not referenced. Furthermore, the InChI developers have followed the same route more recently.

I leave the following question as an exercise for the reader: if a counterexample to the SMILES or InChI algorithms existed, how would one find it?

Image credit: _Blaster_

Tuesday, 14 April 2009

Are you on my side or not? It's E/Z

Handling cis/trans stereochemistry with SMILES should be easy, right? You have the canonical examples for trans:
A. I/C=C/Cl
(I is down, Cl is up)
B. I\C=C\Cl
(I is up, Cl is down)
and cis:
C. I/C=C\Cl (both are down)
D. I\C=C/Cl (both are up)
The "/" or "\" symbols should be chosen based on whether the substituent occurs before or after the atom attached to the double-bond. Bearing this in mind, the following represents the same trans structure as A:
E. C(=C/Cl)\I
Note that the effect of moving the "I" from one side of the "C" to the other (that is, A vs E) causes the bond symbol to change.

When ring closures occur on the double bond, a further complication arises as the stereobond appears twice, once at each end of the ring closure. The symbol indicating the stereochemistry should only appear at the end on the double bond:
F. I/C=C\1/CCCN1
Of course, where two substituents are shown explicitly at one end of a double bond, it's not necessary to show the stereochemisty for both of the bonds (although it makes things clearer). That is, the following two representations are identical to F:
G. I/C=C1/CCCN1
H. I/C=C\1CCCN1

Image credit: suttonhoo