Jmol and WordPress: Loading 3D molecular models, molecular isosurfaces and molecular vibrations into a blog

Click on the static image to get an active model. The code used to obtain the above was:

  1. <script src="../Jmol/Jmol.js" type="text/javascript" />
  2. This line is best added to the theme header by editing the file /wp-content/themes/default/header.php to add the following line in the header:

    <script src="../Jmol/Jmol.js" type="text/javascript"></script>

  3. <img > jmolApplet([450,450],’load wp-content/uploads/2009/08/HV2-62.jvxl;isosurface translucent;zoom 5;moveto 4 0 2 0 90 70;’);”  alt=”A lemniscular molecular orbital” src=”http://www.ch.imperial.ac.uk/rzepa/blog/wp-content/uploads/2008/04/14-knot.jpg” />

    where of course the uploads directory needs to be modified to correspond to your own content, and the file and script following it also correspond to the effect you wish to achieve.

The path wp-content/uploads/2009/08/ is that created by the built-in editor using the Add media file upload mechanism. The Jmol directory is located at the level above that of the blog itself. The JVXL file is created from either the corresponding (Gaussian) output file, or a CUB file created using a program such as Gaussview. Any suitable surface can be displayed using JVXL. In addition to MOs, we have also displayed ELF (Electron localization function) isosurfaces and molecular vibrations. For the latter, use a script of the form

'load wp-content/uploads/2008/04/vibration.log; frame 9; vectors on;vectors 4;vectors scale 5.0; color vectors green; vibration 10;animation mode loop;'

where the vibration you want is contained in e.g. frame 9.

There does appear to be a display bug with the above; the Jmol model replaces the window rather than being inlined in it. Once the model is displayed, just refresh the page to return to the blog entry.

A recent addition is the display of non-covalent-interaction (NCI) surfaces, which are colour coded by using the values in one cube of points to colorize a second cube.

'load wp-content/uploads/2011/05/isobornyl1.xyz;isosurface wp-content/uploads/2011/05/isobornyl1.jvxl colorscheme translucent bgyor;'


Henry Rzepa

Henry Rzepa is Emeritus Professor of Computational Chemistry at Imperial College London.

View Comments

  • I suspect you might want to use jmolSetDocument(false); to turn off writing to the page, and store the code written by the various Jmol commands in a Javascript variable when the page is loaded.

    Then, you can put your image in a , and onclick, swap in the generated code for the contents of the div.

    (I've not tried this yet, though.)

  • In the above instructions, the line

    >
    

    appears. If it is instead replaced by

    >
    

    this will result in the signed applet being used. This in turn will enable the reader to download the data file to their local disk if they wish to do this. See for example this post.

  • Hello, Is this something I can simply add to a Wordpress website? I want users to be able to make custom molecules and send the rendering to us to see if we can make it.

    Regards,
    Allison Mustin

  • This is so important! Are there any resources you can recommend for learning more about biomolecular interactions?

Recent Posts

Internet Archeology: reviving a 2001 article published in the Internet Journal of Chemistry.

In the mid to late 1990s as the Web developed, it was becoming more obvious…

1 month ago

Detecting anomeric effects in tetrahedral carbon bearing four oxygen substituents.

I have written a few times about the so-called "anomeric effect", which relates to stereoelectronic…

1 month ago

Data Citation – a snapshot of the chemical landscape.

The recent release of the DataCite Data Citation corpus, which has the stated aim of…

2 months ago

Mechanistic templates computed for the Grubbs alkene-metathesis reaction.

Following on from my template exploration of the Wilkinson hydrogenation catalyst, I now repeat this…

2 months ago

3D Molecular model visualisation: 3 Million atoms +

In the late 1980s, as I recollected here the equipment needed for real time molecular…

3 months ago

The Macintosh computer at 40.

On 24th January 1984, the Macintosh computer was released, as all the media are informing…

3 months ago