Posts Tagged ‘e-books’
Saturday, May 19th, 2012
Many reaction mechanisms involve a combination of bond formation/cleavage between two non-hydrogen atoms and those involving reorganisation of proximate hydrogens. The Baeyer-Villiger discussed previously illustrated a complex dance between the two types. Here I take a look at another such mechanism, the methylation of a carboxylic acid by diazomethane.

Text-books (or e-books) invariably show path (a). But the Baeyer-Villiger showed us that involvement of an additional acid as a proton transfer agent via a cyclic (7 or 11-membered) transition state was possible. So how about path (b, R=H), calculated using wB97XD/6-311G(d,p)/SCRF=dichloromethane?

Path (b) in the diazomethane alkylation of a carboxylic acid. Click for 3D animation.
The IRC (intrinsic reaction coordinate) shows us the more detailed steps in the mechanistic dance. This tells us that the transition state shown above corresponds to the final stage of the reaction, path (c) in fact. The requisite reorganisation of the protons has already happened, and the reaction is happening from the zwitterionic intermediate shown in (c), with a barrier of only ~ 4 kcal/mol from that species.
The transition state for the formation of the zwitterionic intermediate is itself shown below. One proton is clearly moving (to the carbon), but is the other? Again, an IRC is needed to tell us.
It seems that the two acid molecules do not co-operate with each other. The mechanism really does simply involve a protonation of the diazomethane by a molecule of acid to form a zwitterionic intermediate, following by attack by the anion of the acid on the diazonium cation to displace the nitrogen, path (a).
Tags:e-books, Tutorial material
Posted in General | 1 Comment »
Sunday, December 11th, 2011
My very first post on this blog, in 2008, was to describe how Jmol could be used to illustrate chemical themes by adding 3D models to posts. Many of my subsequent efforts have indeed invoked Jmol. I thought I might review progress since then, with a particular focus on using the new generations of mobile device that have subsequently emerged.
- Jmol is based on Java, which has been adopted by Google’s Android mobile operating system, but not by Apple’s IOS.
- An Android version of Jmol was recently released, to rave reviews! I do not know however whether the Jmol on these posts can be viewed via Android. Perhaps someone can post a comment here on that aspect?
- HP has just announced it will open source WebOS, but it seems Java will not be supported so probably no Jmol there then.
- Windows 8 Mobile (Metro) also seems unlikely to support it either.
- Apple has been prominent in touting HTML5 as a Java replacement. In practice, this means that any molecular viewer would be based on a combination of Javascript and WebGL technologies. Whereas Java is a compiled language, Javascript is interpreted on-the-fly by the browser. Its viability has been greatly increased by very large improvements in the speeds that browsers interpret Javascript nowadays, but this speed is unlikely to ever match that of Java. The real issue is whether that matters. The other difference is that whereas a signed Java applet allows data to escape from the security Sandbox (and into eg a file system), Javascript is likely to be much more restrictive. These two properties mean that Javascript/HTML5 implementations make a lot of use of server-side functionality; in other words a lot of bytes may have to flow between server and mobile device to achieve a desired effect (and the user may have to pay for these bytes via their data plan).
- One early adopter of the Javascript/WebGL HTML5 model has been ChemDoodle, which I illustrated on this blog about a year ago. I have tidied up the recipe for invoking it since then, and this is given below for anyone interested in implementing it. As of this moment, one essential component, WebGL, is only available to developers of Apple’s IOS system, but I expect this to become generally available soon. When that happens, ChemDoodle components on this blog will start working.
- A new entrant is GLmol, an open source molecular viewer for Apple’s IOS. A version is also available for Android. I may give a try at embedding this into the blog.
It seems that the 3D molecular viewing options are certainly increasing, but at the moment there is some uncertainty in performance, compatibility and the ability to extract molecular data from the “
sandboxes“. This last comment relates to the
re-usability of data, which I particularly value.
Although this post has focussed on embedding and rendering molecular data into a blog post, the same principle in fact applies to other expressions. Perhaps the most interesting is the epub3 e-book format, which also supports Javascript/HTML5, and which seems likely to be adopted for future interactive e-books. Indeed, it should be possible to fully convert an interactive blog created using this technology to a e-book with relatively little effort. I have also illustrated here how lecture notes can be so converted.
If you get the impression that the task of a modern communicator of science and chemistry is not merely that of penning well chosen words to describe their topic, but of having to program their effort, then you may not be mistaken.
Procedure for creating a 3D model in a WordPress blog post using ChemDoodle.
- As administrator, go to
wp-content/themes/default
(or whatever theme you use) and in the file header.php, paste the following
<link rel="stylesheet" href="../ChemDoodle/ChemDoodleWeb.css" type="text/css">
<script type="text/javascript" src="../ChemDoodle/ChemDoodleWeb-libs.js"></script>
<script type="text/javascript" src="../ChemDoodle/ChemDoodleWeb.js"></script>
<script type="text/javascript" language="JavaScript">
function httpGet(theUrl)
{var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send( );
return xmlHttp.responseText;}
</script>
- From here, get the ChemDoodle components and put them into the directory immediately above the WordPress installation. They are there referenced by the path ../ChemDoodle as in the script above. You can put the folder elsewhere if you modify the path in the script accordingly.
- Invoke an instance of a molecule thus;
<script type="text/javascript">// <![CDATA[
var transformBallAndStick2 = new ChemDoodle.TransformCanvas3D('transformBallAndStick2', 190, 190);transformBallAndStick2.specs.set3DRepresentation('Ball and Stick'); transformBallAndStick2.specs.backgroundColor = 'white';var molFile = httpGet( 'wp-content/uploads/2011/12/85-trans.mol' );var molecule = ChemDoodle.readMOL(molFile, 2); transformBallAndStick2.loadMolecule(molecule);
// ]]></script>
- The key requirement is that the body of the script (starting with var) must not contain any line breaks; it must be a single wide line. So that you can see the whole line here, I show it in wrapped form (which you must not use);
var transformBallAndStick2 = new
ChemDoodle.TransformCanvas3D('
transformBallAndStick2', 190,
190);transformBallAndStick2.specs.
set3DRepresentation('Ball and Stick');
transformBallAndStick2.specs.
backgroundColor = 'white';var molFile =
httpGet('wp-content/uploads/2011/12/85-trans.mol');
var molecule =ChemDoodle.readMOL(molFile, 2);
transformBallAndStick2.loadMolecule(molecule);
- The key data will be located in the path wp-content/uploads/2011/12/85-trans.mol which you should upload. Note that only the MDL molfile is supported in this mode (which makes no server-side requests). One can use eg CML, but this must be as a server request.
- If you want multiple instances, then you must change each occurrence of the name of the variable, e.g. transformBallAndStick2 to be unique for each.
- If you want to annotate the resulting display, server-side requests are again needed. I do not illustrate these here, but there is an excellent tutorial.
Tags:administrator, Android, Android mobile operating system, Ball, chemical themes, e-book, e-books, Google, HP, Java, JavaScript, Microsoft Windows, mobile device, operating system, php, Skolnik, Tutorial material, WebGL technologies
Posted in Chemical IT | 11 Comments »
Monday, October 31st, 2011
Most of the chemical structure diagrams in this blog originate from Chemdraw, which seems to have been around since the dawn of personal computers! I have tended to use this program to produce JPG bitmaps for the blog, writing them out in 4x magnification, so that they can be scaled down for display whilst retaining some measure of higher resolution if needed for other purposes. These other purposes might be for e.g. the production of e-books (using Calibre), the interesting Blog(e)book format offered as a service by Feedfabrik, or display on mobile tablets where the touch-zoom metaphor to magnify works particularly well. But bitmap images are not really well future proofed for such new uses. Here I explore one solution to this issue.

I have previously mentioned scalable vector graphics (SVG) as an alternative, and fortunately the production of such has become routine.3 The diagram above2 is indeed SVG (and if you cannot see it, then try a modern SVG-capable browser1). It was produced thus:
- Drawn in Chemdraw
- Exported as Encapsulated postscript
- Imported into Scribus, an Open Source desktop publishing program (where it can be annotated/edited if need be)
- This program will also need Ghostscript installed to handle the EPS
- and exported from Scribus to SVG.
- Notice how the diagram above automatically scales to fill the width of the page. If you click on it, you get the diagram on its own. If you zoom the browser window, it should scale perfectly.
- I note that these SVG diagrams work well in e-books or blogbooks.
There seem to be many other (open) programs out there which support SVG, so the above combination is not necessary the only one, or indeed the best. There is one other aspect which might be mentioned. The old GIF or JPG bitmap formats do have good meta-data support, such as
EXIF,
GPS or
XMP. These invisible data have often been used to embed a molecular connection table into a GIF or JPG file, such that the original molecular data can be reconstituted from the image file. Unfortunately, there are no real standards for doing this, and so round-tripping the data is probably a closed process within a specific software environment. However, because SVG is an XML format, it can be readily made to carry such information in a fully inter-operable manner. For example, one could easily embed a CML description of the molecule into its own container (namespace) in the SVG file. For the purposes of rendering an on-screen image, this extra information is of course ignored.
1 I notice that Internet Explorer 9 (both 32- and 64-bit versions) will display (and save) the above diagram if you click on it, but it cannot (yet) be inlined into the post, although the documentation implies it should.
2 The version below is the conventional JPG form (click on it to see the original 4x version).

Diagram displayed using JPG.
3. Historical note. Peter Murray-Rust and I have been promoting SVG for use in chemistry for 11+ years now. For one ancient page, see here. The syntax has decayed somewhat, but some of the diagrams still work!
Tags:chemical diagrams, chemical structure diagrams, desktop publishing, e-books, Feedfabrik, GIF, GPS, Internet Explorer, Peter Murray-Rust, software environment, Vector Graphics
Posted in Chemical IT, General | 13 Comments »
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.
Tags:Acrobat, Amazon, Android, chemical structure drawing packages, e-books, HTML, HTML5, iPad, iPads, Java, KF8, Kindle, mobile devices, opendata, Peter Murray-Rust, printing costs, SVG, Vector Graphics
Posted in Chemical IT, General | 3 Comments »
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.
- 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).
- 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.
- The latest company to change the way books are both read and authored is Pushpoppress, the heart of which is also an interactive app.
- 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?
- 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.
- 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)?
- 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?
Tags:aspiring author, aspiring book author, e-books, Imperial College, intent on creating interactive content do, iPad, King, Matt Macinnis, mobile devices, social network, Tutorial material
Posted in Chemical IT, General | 8 Comments »