Posts Tagged ‘iPad’

Cyclopentadiene: a hydrocarbon at the crossroads of …

Sunday, July 29th, 2012

organic chemistry. It does not look like much, but this small little molecule brought us ferrocene, fluxional NMR, aromatic anions and valley-ridge inflexion points. You might not have heard of this last one, but in fact I mentioned the phenomenon in my post on nitrosobenzene. As for being at a crossroads, more like a Y-junction. Let me explain why.

Cyclopentadiene is made by thermal cracking of its dimer, and on standing it slowly reverts to this species. At its simplest, this dimerisation can be described as a π2s + π4s pericyclic cycloaddition, one of the monomers being the π2s and the other the π4s. Two new bonds are formed; one of these is shown in black, but the other can be either the one in red (which makes the π4s the monomer on the right) or the one in blue (in which case the π4s comes from the molecule on the left). How do these two partners decide which role each is to play? Well, the short answer is that, initially at least, they do not! The reaction proceeds very asynchronously, forming at first only the black bond. Eventually, they cannot take the suspense any longer, and when the point indicated with a green dot is reached, they finally have to take a decision. Up to the green dot, the potential energy surface has followed along a valley ridge, and the green decision point is known as the bifurcation point; one with an equal probability of the reaction giving either the top dimer or the bottom dimer.

If you are sharp-eyed you may notice a methyl group has been added to one of the monomers; this was done to balance the decision very slightly in favour of one route down from the green point over the other. Otherwise, the IRC pathway often just stops at the green point, unable to decide which way to take.

You can see this oddity reflected in the gradient norm of the IRC, which at IRC -1.5 suddenly acquires a new feature, the formation of the second bond. The lesson here is to remember that bonds do not have to form at the same time, they can instead follow, one after the other.

The two different dimers that result from the bifurcation are not in fact identical, they are mirror images (diastereomers because of the methyl group) of each other. They can in turn be inter-converted by a Cope rearrangement, a [3,3] sigmatropic reaction. The transition state for this process is none other than the green point reached earlier. It is indeed a transition state at a crossroads, connecting two quite different reactions, the Diels-Alder cycloaddition and the [3,3] Cope enantiomerisation of the dimer product. Such a reaction has been christened a bispericyclic reaction, one truly at a Y-junction.

Who would have thought that such an un-pretentious molecule could teach us so much. You can see this and many other examples of pericylic reactions in my course on the topic, available on an iPad by clicking here.

Postscript: I have managed to run a full IRC on the system without the methyl perturbation.

The bifurcation point (green dot) is clearly seen in the following two plots at a value of  IRC +1.0

QR codes and InChI strings.

Sunday, July 22nd, 2012

A month or so ago at a workshop I was attending, a speaker included in his introductory slide a QR (Quick Response) Code. It is a feature of most digital eco-systems that there is probably already “an app for it”. So I thought I would jump on the band wagon by coding an InChI string. Here it is below:

QRCode for an InChI string. Point your smart device at it, and see the InChI appear!

You then invoke an appropriate app (I used QR Reader for iPhone, but there are many), point it at the screen (a fair bit of wobble seems tolerated) and you get the InChI. Are there any hackers out there that could process the resulting InChI and display not so much it, but the molecule it corresponds to? A Quick mash-up I should imagine (its probably already been done!).

Here is another QR Code, this time for another post on this blog (more serious than this one!). 

QR URL code for using on a mobile device.

If you click on either QR image above, this will take you to one (of several) QR code generators. I found that selecting error correction code H seems to make recognition virtually instant. Suddenly an image popped into my mind, of a class of students in a lecture, pointing their device at my InChI codes on the projected screen, and twiddling with the molecules during my lecture (they probably never listen to me anyway 🙂 This may not be as unlikely as it seems. I am in fact compositing an iTunesU course at the moment. For a sneak β-style preview, open this page on an iPad and click on this link to load the course up (or use the QR code below). You probably need to also load up the iTunesU app first. 

QR Code for iTunesU course.

Comments welcome, QR code below!.

 

Science publishers (and authors) please take note.

Monday, October 24th, 2011

I have for perhaps the last 25 years been urging publishers to recognise how science publishing could and should change. My latest thoughts are published in an article entitled “The past, present and future of Scientific discourse” (DOI: 10.1186/1758-2946-3-46). Here I take two articles, one published 58 years ago and one published last year, and attempt to reinvent some aspects. You can see the result for yourself (since this journal is laudably open access, and you will not need a subscription). The article is part of a special issue, arising from a one day symposium held in January 2011 entitled “Visions of a Semantic Molecular Future” in celebration of Peter Murray-Rust’s contributions over that period (go read all 15 articles on that theme in fact!).

Here I want to note just two features, which I have also striven to incorporate into many of the posts this blog (which in one small regard I have attempted to formulate as an experimental test-bed for publishing innovations). Scalable-Vector-Graphics (SVG) emerged around the turn of the millennium as a sort of HTML for images. To my knowledge, no science publisher has yet made it an intrinsic part of their publishing process (although gratifyingly all modern browsers support at least a sub-set of the format). Until now (perhaps). Thus 10.1186/1758-2946-3-46 contains diagrams in SVG, but you will need to avoid the Acrobat version, and go straight to the HTML version to see them. However, what sparked my noting all of this here was the recent announcement by Amazon that they are adopting a new format for their e-books, which they call Kindle Format 8 or KF8 (the successor to their Mobi7 format). To quote: “Technical and engineering books are created more efficiently with Cascading Style Sheet 3 formatting, nested tables, boxed elements and Scalable Vector Graphics“. This is wrapped in HTML5 to be able to provide (inter alia) a rich interactive experience for the reader. In fairness, there is also the more open epub3 which strives for the same. Other features of HTML5 include embedded chemistry using WebGL and the same mechanisms are being used for the construction of modern chemical structure drawing packages.

It remains to be seen how much of all of this will be adopted by mainstream chemistry publishers. Here, we do get into something of a cyclic argument. I suspect the publishers will argue that few of the authors that contribute to their journals will send them copy in any of these new formats and that it would be too expensive for them to re-engineer these articles with little or no help from such authors. The chemistry researchers who do the writing (perhaps composition might be a better word?) might argue there is little point in adopting innovative formats if the publishers do not accept them (I will point out that my injection of SVG into the above article did have some teething problems). For example, you will not find SVG noted in any of the “instructions for authors” in most “high impact journals” (or, come to that, HTML5).

If one looks at the 25 year old period, in 1986 all chemistry journals were distributed exclusively on paper. My office shelves still show the scars of bearing the weight of all that paper. Move on 25 years, and all journals almost without exception are now distributed electronically. I suspect the outcome in many a reader’s hands is simply that they (rather than the publisher) now bear the printing costs themselves (despite or perhaps because of the introduction of electronic binders such as Mendeley). But it will only be when the article itself grows out of its printable constraints, and hops onto mobile devices such as Kindles and iPads in the promised (scientifically) interactive and data-rich form, that the true revolution will start taking place.

A final observation: you will not readily obtain the interactive features of 10.1186/1758-2946-3-46 on e.g. an iPad or Kindle because the Java-based Jmol is not supported on either. But Jmol has now been ported to Android, and its certainly one to watch.

The perception of stereochemistry. A challenging case.

Tuesday, October 18th, 2011

Most representational chemistry generated on a computer requires the viewer to achieve a remarkably subtle transformation in their mind from two to three dimensions (we are not quite yet in the era of the 3D iPad!). The Cahn-Ingold-Prelog convention was a masterwork (which won the Nobel prize). It is shown in action for the molecule on the left below. The CIP notation was actually generated by Chemdraw, and required a fair sprinkling of wedged and hashed bonds to (try to) remove stereoambiguity and generate the labels (try it for yourself). As part of a lecture course on pericyclic reactions, I tell the students that the reaction involves a [1,3] sigmatropic migration of the red carbon and that this migration proceeds with inversion of configuration at this migrating carbon (as the selection rules require). Perceiving what the correct CIP product label should be (with inferred stereochemical labels, resolving ? into either R or S) is IMHO one of the most difficult conceptual experiences in all of organic chemistry. I have over the years struggled to find a way of revealing this in lecture notes (these struggles with the “lecture notes” will be the topic of a future post here). However, I think I may have finally cracked it; my solution is set out below!

A 1,3 sigmatropic methyl migration.

A short-cut to the answer might be to reason that if the CIP label for the reactant is (S), and we are told that the carbon migrates with inversion, we should label the product (R). Unfortunately, CIP does not work like that. Because the key carbon in the product is not connected to exactly the same four surrounding ligands as the reactant, all bets are off! Having got that one out of the way, I now uncover my new diagram.

Intrinsic reaction coordinate (IRC) for the 1,3 carbon migration. Click for transition state mode.

Keep an eye out for the CIP labels, which are generated dynamically as the IRC proceeds. It starts (S), but then the label goes as the bond to the atom gets disconnected (formally), and reappears as (R) when the atom is reconnected to its new home. If you look carefully at the breaking and forming bond, you will perceive in effect an SN2 reaction taking place, with the required inversion at the carbon. The hydrogen on that carbon conveniently swings around to reinforce the perception of an inversion.

It is worth considering how the IRC representation might improve upon the perception compared with the imaginary (transition state) vibrational mode. The latter in effect represents only a small part of that IRC, the so-called harmonic part. Most reactions deviate from such a harmonic oscillator, and the IRC captures that deviation. The stereochemical perception can be enhanced by showing the full (anharmonic) motion of the atoms during the reaction.

Finally, a bonus. Below you can see a [1,9] sigmatropic methyl migration. It proceeds both with inversion at the methyl, and from top to bottom faces  (antarafacially) of the nonatetraene. A double-twist Möbius transition state.

1,9 methyl migration with double antarafaciality.

What is the future of books?

Friday, April 29th, 2011

At a recent conference, I talked about what books might look like in the near future, with the focus on mobile devices such as the iPad. I ended by asserting that it is a very exciting time to be an aspiring book author, with one’s hands on (what matters), the content. Ways of expressing that content are currently undergoing an explosion of new metaphors, and we might even expect some of them to succeed! But content is king, as they say.

Here I list only some innovative solutions which have emerged in the last year or so, but which also raise important issues which we ignore at our peril.

  1. TouchPress were one of the first publishers to get off the mark with their living books. Their first offering was The Elements, deriving from an earlier interactive display of the periodic table (an example of which can be seen in the entrance to the chemistry building at Imperial College). It is a programmed book, in the sense that the content is expressed using code written by the publisher (very much in the manner of interactive games).
  2. Next to appear were Inkling, who describe their offering as interactive. Their approach is described in a blog written by their founder, Matt Macinnis. There he talks about The Art of Content Engineering, which again makes it sound as if authoring a book is in effect programming it! (I know what he means; if you follow the link to the talk I allude to above, you may spot that it too is, at least in part, programmed, and not simply written). Inkling also promote the book as part of a social network, with readers able to annotate the content, and share that annotation with others.
  3. The latest company to change the way books are both read and authored is Pushpoppress, the heart of which is also an interactive app.
  4. Then there is the epub3 format. This is a free and open standard for e-books. This third revision in particular is meant to enhance interactivity.

Something of a common theme so far. Books are going to be interactive! But what about these issues?

  1. Each of the first three (commercial) publishers above has adopted their own programming format. Although HTML5 may be at the heart of some of this, programming may also mean control (in the sense that the creative industries must put control of their content at the heart of what they do). Each of the first three above sound like a closed system, and extracting re-usable content is, I argue, an essential part of doing science. I am just a tad worried that the approaches exemplified above may not allow this to happen.
  2. Suppose you manage to acquire a chemistry textbook in any of the four approaches listed above. Will they inter-operate, in the sense of being able to extract data from one and perhaps inject it into another? Or will each be a data- or information silo, rigidly controlled by the creative content generator (whoever that is)?
  3. What might an aspiring author, intent on creating interactive content do? Should they go closed/proprietary or open? They will clearly need to retrain themselves. We have indeed come a long way along the road: hand-written manuscript → typed manuscript → word-processed manuscript → interactive app! Like computer games, is the day of the single-authored book rapidly fading, to be replaced by a large team, each with their own tasks to perform?

I end with this question. Is the era of books, just like the Web itself, going to be the app? And who will be able to (find the time) to participate?

Embedding molecules in blogs: ChemDoodle, WebGL and SVG

Friday, December 24th, 2010

If you get a small rotatable molecule below, then ChemDoodle/HTML5/WebGL is working. Why might this be important? Well, the future is mobile, in other words, devices that rely on batteries or other sources of built-in power. This means the power guzzling GPU cards of the past (some reach ~400 Watts!) cannot be used. Rather than using e.g. a full power OpenGL library, one will use Web-based graphics libraries, which (to quote Wikipedia) extends the capability of the JavaScript programming language to allow it to generate interactive 3D graphics within any compatible web browser. A typical target device might be for example Apple’s iPad (for which the redoubtable Jmol, which is based on Java, is unlikely to ever work).

To find out if your device and its browser can support this type of graphical display, go to either this test page or this more general one (which at the time of writing actually gets the WebGL test wrong!).

I have deployed an earlier graphical methodology in other posts (SVG), which many browsers now support. This combination of HTML5, SVG and WebGL is the future! For its use on another blog, see here.

Data-round-tripping: wherein the future?

Tuesday, December 7th, 2010

Moving (chemical) data around in a manner which allows its (automated) use in whichever context it finds itself must be a holy grail for all scientists and chemists. I posted earlier on the fragile nature of molecular diagrams making the journey between the editing program used to create them (say ChemDraw) and the Word processor used to place them into a context (say Microsoft office), via an intermediate storage area known as the clipboard. The round trip between the Macintosh (OS X) versions of these programs had been broken a little while, but it is now fixed! A small victory. This blog reports what happened when such a Mac-created Word document is sent to someone using Microsoft Windows as an OS (or vice versa).

As you might have guessed, the molecular diagram arrives largely dead, and not re-usable. Opening the .docx archive (it is nothing more than a zip file) reveals only a JPEG file residing inside. Nothing that can be chemically repurposed. If the reverse process is undertaken, of creating a chemdraw diagram, and pasting it into Word on Windows, one finds in the .docx two components; a bit-mapped image linked to an active object containing the data. Only the first of these is recognised if the file makes its way to a Macintosh; i.e. the same story, the data is again lost. So the bottom line is that Mac users and Windows users cannot, after all, exchange repurposable molecular diagrams using Word documents using this combination of programs. This is not good.

But let me remind what happened around 1993. The word processor was joined by a program called the Web browser. In 1996, the underlying content carrier, HTML, became XHTML (an instance of XML). Right from day 1 almost, such XHTML could, and frequently was repurposed. A memorable example is that search engines could use it to index the Web. The XHTML easily survived trips to and from clipboards. In 1996, CML joined HTML as a way of carrying chemical information capable of round-tripping without loss (if need be). There are other chemical XML languages in use nowadays, including CDXML used by the ChemDraw program. Word itself now uses XML (the x in .docx). So, after 14 years, why am I still describing the difficulties above? I am frankly at a loss to explain why there is still a need to write this post.

All is not entirely lost. The CML4Word approach is designed to enable (chemical) data round tripping from the outset. Although I do not yet know if the CML created and stored in the Word document using this mechanism is recognised anywhere outside of Word 2007 on Windows?  If anyone can let me know of examples where such a CML-enabled Word document can be used in other environments, I would be very grateful (but not on  OS X, as I know already).

And as I might have mentioned in the previous post on this topic, things may not however be getting better in that other carrier of information and data, the mobile phone/iPad, as exemplified by operating systems such as iOS or Android. Watch this space, as they say.

Data-round-tripping: moving chemical data around.

Saturday, November 20th, 2010

For those of us who were around in 1985, an important chemical IT innovation occurred. We could acquire a computer which could be used to draw chemical structures in one application, and via a mysterious and mostly invisible entity called the clipboard, paste it into a word processor (it was called a Macintosh). Perchance even print the result on a laserprinter. Most students of the present age have no idea what we used to do before this innovation! Perhaps not in 1985, but at some stage shortly thereafter, and in effect without most people noticing, the return journey also started working, the so-called round trip. It seemed natural that a chemical structure diagram subjected to this treatment could still be chemically edited, and that it could make the round trip repeatedly. Little did we realise how fragile this round trip might be. Years later, the computer and its clipboard, the chemistry software, and the word processor had all moved on many generations (it is important to flag that three different vendors were involved, all using proprietary formats to weave their magic). And (on a Mac at least) the round-tripping no longer worked. Upon its return to (Chemdraw in this instance), it had been rendered inert, un-editable, and devoid of semantic meaning unless a human intervened. By the way, this process of data-loss is easily demonstrated even on this blog. The chemical diagrams you see here are similarly devoid of data, being merely bit-mapped JPG images. Which is why, on many of these posts, I put in the caption Click for 3D, which gives you access to the chemical data proper (in CML or other formats). And I throw in a digital repository identifier for good measure should you want a full dataset.

It is only now that we (more specifically, this user) understand what had happened under-the-hood to break this round-tripping. In 1984, when Apple produced the Mac, they also produced a most interesting data format called PICT. A human saw the PICT as a PICTure, but the computer saw more. It (could) see additional data embedded in the PICT. The clipboard supported the PICT format, which meant that both picture and data could be transferred between programs. And ChemDraw and Word also understood this. Hence the ability to round-trip noted above (it has to be said between specifically these programs).

Times moved on and the limitations of PICT set in. Apple refocussed on the PDF format. Related, notice, to the Postscript format that Adobe had introduced in order to allow high quality laserprinting. PICT support was abandoned, and the various components no longer carried recognisable data (specifically the clipboard or the ability of Word to recognise the data). Round-tripping broke. Does this matter? Well, one colleague where I work had accumulated more than 1000 chemical diagrams, which he decided to store in Powerpoint (and yes, he threw the original Chemdraw files away). The day came when he wanted to round trip one of them. And of course he could not. He was rather upset I have to say!

PDF was not really a format designed to carry data (see DOI: 10.1021/ci9003688). But, bless their hearts, the three vendors involved in this story all agreed to support data embedded in the PDF hamburger (and Abobe to tolerate it) and now once again, a structure diagram can move into an Office program (on Mac) and out again and retain its chemical integrity. What lessons can be learnt?

  1. Firstly, out of side, out of mind. The clipboard is truly mostly out of sight, and it was not really designed from the outset to preserve data properly. Nowadays I wonder whether clipboards in general recognise XML (and hence CML) and preserve it. I truly do not know. But they should.
  2. Secondly, any system which relies on three or four commercial vendors, who at least in the past, devised proprietary formats which they could change without warning, is bound to be fragile.
  3. We have learnt that data is valuable. More so than the representation of it (i.e. a 2D or 3D structure diagram). But when its lost, the users should care! And tell the vendors.
  4. Peter Murray-Rust and his team have produced CML4Word (or as Microsoft call it, Chemistry add-in for Word). At its heart is data integrity. Fantastic! But I wonder if it survives on Microsoft’s clipboard (I know it does not on Apple’s, since CML4Word is not available on that OS. And is unlikely to ever become so).
  5. And I can see history about to repeat itself. The same seems about to happen on new devices such as the Apple iPad. It too has copy/paste via a clipboard. I bet this will not round trip chemistry (or much other) data! Want to bet that the lessons of this story have not yet been learnt?

Oh, for those who wish to round-trip chemistry on a Mac, you will have to acquire ChemDraw 12.0.2 and Word 2011 (version 14.01), as well as OS X 10.6 for it to work.