User:Njm08
Nicholas Mason
MSci chemistry graduate
Interactive tables
The mediawiki Jmol extension comes with several useful widgets (GUI elements) that can be used to send scripts to an embedded Jmol applet. These widgets include push buttons, checkboxes, radio buttons and drop-down menus. Used creatively, these allow for the construction of interactive tables. Using interactive tables avoids the clutter and confusion of countless individual Jmol applets, Jmol applet links/buttons or static 2D images, making them a great way to concisely display computational results.
Below is an interactive table for visualising vibrational modes. The Jmol applet loads the log file for a caculation performed in Gaussian. The buttons send scripts to the applet which load the appropriate models for the corresponding frequencies. Animation can be turned on or off via the labelled checkbox.
Mode | Description | Frequency | lit. [1] | Intensity | Symmetry (D3h point group) | Form of vibration | ||
---|---|---|---|---|---|---|---|---|
|
1144 | 1125 | 93 | A" |
| |||
|
1204 | 1604 | 12 | E' | ||||
|
1204 | 1604 | 12 | E' | ||||
|
2598 | (2693 [2]) | 0 | A' | ||||
|
2737 | 2808 | 100 | E' | ||||
|
2737 | 2808 | 100 | E' |
Here is an interactive table for visualising molecular orbitals in the style of the Gaussview MO editor dialog. The isosurface for each orbital (.jvxl file) is loaded via the push buttons. A further push button clears the applet of isosurfaces. Alternatively, the isosurfaces could be toggled between using a radio button group or even a drop down menu.
Molecular Orbitals:
|
![]() |
View the page source to see how each table has been constructed. Documentation for the Jmol extension, including handy code snippets and a useful reference, can be found at http://wiki.jmol.org/index.php/MediaWiki.
Loading Jmol files from the D-Space repository
As well as loading files that have been uploaded to the wiki, Jmol can be used to load files from other URLs. This means that if you have published your calculation through the HPC web portal, it is possible to load your file directly from the digital repository.
URLs for files on the Imperial D-Space repository have the following structure:
https://spectradspace.lib.imperial.ac.uk:8443/dspace/bitstream/handle/handle-prefix/handle-suffix/filename
To load a file from a URL you must use the <urlContents>
tag instead of the <uploadedFileContents>
tag.
For example, the following code will produce a Jmol link that will load the log file from the D-Space calculation archive resolved by DOI:10042/24956 :
<jmol> <jmolAppletLink> <urlContents>https://spectradspace.lib.imperial.ac.uk:8443/dspace/bitstream/handle/10042/24956/logfile.log</urlContents> <text>Load Jmol from D-Space</text> </jmolAppletLink> </jmol>
Loading files from DSpace into Jmol using their Handle
A better way of loading the file is to use a URL derived from the file-set's Handle (a type of persistent identifier). This helps to avoid future "link rot", which is where the URL of a webpage changes resulting in a dead link (404 File not found!).
Handles are resolved using the http://hdl.handle.net/ or http://doi.org/ proxy servers.
http://doi.org/10042/24956
The DSpace Handles can resolve directly to a specific file by appending a locatt query string:
http://doi.org/10042/24956?locatt=filename:logfile.log
http://doi.org/10042/24956?locatt=mimetype:chemical/x-gaussian-log
http://doi.org/10042/24956?locatt=mimetype:chemical/x-cml
Thus, the following code will create a Jmol link for the log file archived at DOI:10042/24956 :
<jmol> <jmolAppletLink> <urlContents>http://doi.org/10042/24956?locatt=filename:logfile.log</urlContents> <text>Load Jmol from D-Space</text> </jmolAppletLink> </jmol>
Loading files from DSpace into Jmol using their DOI
Imperial's SPECTRa DSpace repository also assigns file-sets a DOI. DOIs are based on the Handle system and have a Handle-prefix that always start with "10.".
The DOIs do not have the locatt functionality described above. However, one can use DataCite services to link directly to a file.
URLs must be constructed as follows:
http://data.datacite.org/MIME_media_type/MIME_subtype/DOI-prefix/DOI-suffix
Currently only the CML file (MIME = chemical/x-cml) can be loaded in this way.
Thus, the following code will create a Jmol link for the CML file archived at DOI:10.14469/CH/18917 :
<jmol> <jmolAppletLink> <urlContents>http://data.datacite.org/chemical/x-cml/10.14469/CH/18917</urlContents> <text>Load Jmol from D-Space</text> </jmolAppletLink> </jmol>