Posts Tagged ‘chemical diagram’

Refactoring my lecture notes on pericyclic reactions.

Sunday, December 29th, 2013

When I first started giving lectures to students, it was the students themselves that acted as human photocopiers, faithfully trying to duplicate what I was embossing on the lecture theatre blackboard with chalk. How times have changed! Here I thought I might summarise my latest efforts to refactor the material I deliver in one lecture course on pericyclic reactions (and because my notes have always been open, you can view them yourself if you wish).

When I first started this course, I created notes using a typewriter, and used stencils to draw the chemical diagram (with a french curve for smooth lines). Now of course, for most (organic chemistry) lecturers, it’s a combination of a chemical drawing software tool (which we first saw around 1985) and a visual presentation package such as Powerpoint (although we do still have one lecture theatre with a real chalk board which many lecturers still use, albeit probably to slow their presentation down and avoid “death by Powerpoint” for the students). I never endorsed this combination, having avoided PPT for many years. Instead, I do it this way, and here I will list some of the aspects of my newly refactored notes.

  1. I am at ease writing HTML(5). Because it is native markup, it has stood me in good stead for many years, since it adapts to new technologies very well and is not dependent on proprietary software. One example might be when I first refactored such notes into an e-book format (EPUB) using Calibre. It converts HTML delightfully easily. I should say that one does have to use HTML “properly”. By this I mean ensuring that style is implemented using CSS, that meta-data is appropriately entered into the document header, and that the resulting document is checked using the HTML syntax checker Tidy. This latter is actually built into the software editor I have used for many years (BBedit), but the same validation can be achieved via sites such as http://www.dirtymarkup.com/
  2. The diagrams can be created using the usual tools (ChemDraw, ChemDoodle), but I convert the end product to the SVG format. Chemdoodle saves as this natively; Chemdraw can save as EPS, and then I convert this without issue to SVG using Scribus.  I adopted this approach quite a few years ago (in 2000 in fact), since I felt that scalable graphics (which is what SVG is) had a sounder future than raster graphics. So it has proved, since SVG is now natively supported in most new Web browsers (IE being the prominent exception). 
  3. I decided about six years ago to augment my pericyclic lectures with properly computed transition states. After all, the essence of this topic is the properties of the reaction transition state (my approach is to consider its aromaticity), and so a quantitative model for this seems desirable. Mine have all been computed using the ωB97XD/6-311G(d,p) method (also extensively employed on this blog).
  4. About three years ago, starting from these transition states, I computed intrinsic reaction coordinates for all the reactions. These are now deployed as animations in my notes. I use animated GIFs for this, since it is widely supported. A bonus was to discover that conversion of such diagrams into EPUB format preserves the animation, and many e-book readers that support this format honour the animation (but not all). 
  5. When my transition state library (now including around 100 in number) was expanding, I put some thought into how to express these models in my notes. Initially, I used Jmol to do so, and wrote some Javascript for the notes that would “pop-up” a separate window to display the Jmol model. Not surprisingly, this feature does not condense down into an EPUB book at all. Nor does it work if the notes are displayed on a tablet browser (most such devices do not support the Java that Jmol requires). There is some prospect on the horizon that the EPUB3 format might be capable of supporting such interactivity, but not quite yet. In refactoring my notes for the next lecture delivery, I pondered how to handle this aspect. A natural was JSmol, a recent evolution of Jmol which does not depend on Java, instead using the very different technology Javascript (implemented natively in the Web browser, just like SVG). If you are interested, some of the early evolution of this new approach can be seen in an article I wrote about 18 months ago, and which contains very early working examples.[1] The pop-up window approach does not work very well on tablets, and so a hideable insert into the main window was adopted. The reader can show/hide this display readily, and its position stays fixed whilst the notes scroll around it.toolbarMaking this window come and go itself requires a control toolbar and my current design (which may change!) is shown above. It clearly indicates to the reader that the notes they are reading have interactive components. I cannot resist also directing you to chemagic.com/ochem/ochem.htm which is a particularly good example of how to create interactive teaching notes. Into this inset window, all my transition states, molecular orbitals and other relevant surfaces can appear on demand.
  6. Notice that the notes are indexed (by Google) and so are text-searchable (I cannot help but note that my institution uses a commercial content-management system for most lectures except mine, and where text-search of materials is not possible for obscure reasons). The transition state models can be indexed using InChI key generated when the molecule is deposited into a repository (see below), but sub-structure searching is a trickier issue!
  7. If any student wants to follow-up on any one entry in my transition state library, I have helped them do so by linking each one to a digital repository. This is addressed by a persistent digital object identifier (DOI), and from there anyone interested can branch off and start doing their own modelling. 
  8. On the subject of the DOI, I decided to allocate the notes themselves with such a handle. It is http://doi.org/10042/a3uxp[2] You might imagine that allocating such persistent identifiers is something only publishers can do (and that it costs money). In fact, a so-called handle server comes with our digital repository, and a clever programmer (thanks Matt!) was able to extract the relevant code and make it a stand-alone resource. I will not list the URL here, since we really only want handles allocated using it to be associated with my department!
  9. The transition states are also allocated handles, and it is perfectly possible to combine JSmol with handles to create interactive windows that retrieve the relevant files using the data DOI and render them. We are writing an article on how to do this, so look out for it.
  10. I pondered printing long and hard! Having sweated to get interactive components and animations into the notes, I felt that destroying this feature by what I will call 2D printing was an oxymoron. But students like printing (about 20 million print copies are made at my institution each year). In fact, some more Javascript resulted in a small link in my toolbar above, which first hides all the interactive boxes (including the toolbar itself!) before printing the page, and then returning the screen back to normal. I feel bad in a sense about doing this, but printed notes do have one nice feature, one can write notes in the margin!
  11. So can one replicate note taking electronically, using say a tablet? This it has to be said remains a somewhat unsolved problem, especially in chemistry. One has vexed issues to confront such as whether to use a stylus for the purpose (either passive, or palm-rejecting active) and whether the stylus is compatible with whatever note taking software one wants to use. And how should any notes take be stored? One chemical solution is www.cambridgesoft.com/land/flick-to-share.aspx where a ChemDraw diagram can be “flicked” to another student, or indeed an instructor, and also stored in the cloud. But I think I am going to have to work hard to convince most students that e-notes are better than just printing the notes onto paper and using a ball-point pen. I do however, expect interesting things to happen in this regard in the next year or two, so a space to watch most certainly.
  12. I have added 3D printing to my list. It is not yet on demand from the models built into the notes, but our small library of 3D-printable molecular orbitals and transition states is growing, and perhaps in the near future, a student can simply press another link entitled “3D print” to produce a model for themselves. If you have never held a 3D-printed molecular orbital in your hands, try it! You might discover something new.
  13. Templates? I have tried to package the distracting “behind-the-scenes” stuff into scripts and stylesheets, so that an author need only write the fairly simple HTML. Perhaps there are excellent commercial packages out there that might make the task easier. But just like convincing students to abandon using paper to carry notes is a tough nut to crack, so too I suspect will be convincing my colleagues to adopt this format. Most are very wedded indeed to the traditional word processor and the traditional presentation package.

Well, the refactored lecture materials described above will be exposed to real students (and real tutors) in a few weeks time, and feedback will no doubt be received. But if anyone reading this blog wishes to comment on any aspect, I most certainly welcome it. 


In what I initially regarded as an unusual 15th birthday present, my father gave me a mechanical typewriter, along with a small booklet on how to learn to touch-type. In retrospect, this gift was very far-sighted. Rather than just playing football with my friends, I also learned to touch-type. This blog has just been written employing this skill.

Internet Explorer for Microsoft Windows 8.0 and 8.1 displays these components well.

References

  1. H.S. Rzepa, "Chemical datuments as scientific enablers", Journal of Cheminformatics, vol. 5, 2013. https://doi.org/10.1186/1758-2946-5-6
  2. "Organic Pericyclic Reactions", 2014. http://doi.org/10042/a3uxp

Breakdowns in communication: the two cultures

Tuesday, August 2nd, 2011

In his famous lecture in 1959, C. P. Snow wrote about the breakdown in communications between the “two cultures” of modern society — the sciences and the humanities (arts). That was then. This is now, and the occasion of my visit to a spectacular “city of arts and sciences complex” in Europe. An un-missable exhibit representing science and life was the 15m high model of DNA. Now to be fair this is styled an artist’s impression, and one presumes that an artist is allowed license. But how much license? And at how much expense to the science? And is there a counterbalance to the art where the science is fastidiously (but artistically) preserved?

Artistic impression of DNA.

Let us start from the scientific end of this story, and try a mapping between the two representations. Below is a chemical diagram of one strand of the DNA duplex, showing two cytosines (the single 6-ring base) and two guanines (the 5+6 ring base) joined by a 5-ring ribofuranose to phosphates.

A scientific interpretation of DNA. Click for 3D model (of left handed duplex DNA!)

The artist has mapped the phosphates to the blue spheres and is clearly taking the license of not showing all the atoms (and in particular the other heteroatoms, such as O and N). That is schematic and designed not to overwhelm. I am more or less still happy (although the missing carbonyls are strange). Next, the phosphates are linked to the ribose. If you look carefully you might spot that the link is built to the centre of a C-C bond (I am starting to get slightly worried now). You can also clearly see that the links to the guanines are via the 8-position of that ring, rather than the 9-position. Is this due to artistic license or the thought that it does not much matter? The pairs of bases, famously hydrogen bonded in a complementary manner, are now joined by a single “bond”, one end of which is now again attached at a bond mid-point. Little of the science of hydrogen bonding is preserved with this representation!

 

One more detail. These “rungs” joining the duplex have been rotated by 90° so that the planes of the bases are parallel to the helical axis, rather than perpendicular. How did the artist manage to construct his model in this orientation? Well, probably because he had been given a template similar to the (2D) structure diagram I showed above. A chemist would immediately “see” what is implicit in that diagram, which is all the C-H bonds. Chemists tend to miss these out, because they can be cluttered. But the hydrogen atoms are there, and they do occupy space. In the 3D model, they are still missing. If you imagine their positions in that model, you will immediately spot a number of locations where two hydrogen atoms are trying to occupy almost the same position in space! Of course, were you to rotate the sugar-base-base-sugar rungs by 90° this would create space for these invisible hydrogens.

So what about this breakdown in communication between the scientist and the artist? The latter has attempted two effects. One is to remove unnecessary detail so that one can directly go to the essentials. The other is to “move” the various components around so that they achieve greater “artistic effect”, but with a resulting substantial loss of scientific accuracy. I happen to believe that the model would have looked equally attractive if these scientific liberties had not been taken (perhaps even better!). Perhaps, as I suggest above, the artistic interpretation should be accompanied by a scientific one, to allow the visitor to the museum to see both? Or the communication between sculptor and scientist improved?

Well, I console myself with the observation that at least the artist represents a right rather than a left handed helix!