Science and software development

Never cease to marvel at the mysteries of the universe uncovered through natural science...

 

I am currently working in Randy Read's group at Cambridge Institute for Medical Research where we write the crystallographic software, Phaser, for predicting the molecular structure of proteins. The software interpretes diffraction patterns of protein crystals recorded under X-ray beam exposure. This is an area of natural science where there is a clear line drawn from mathematics through physics, chemistry, biochemistry all the way to biology.


Software

The free programs you will find below are for Windows PCs and are:

Santorini and Patmos use the 3D graphics API, OpenGL. I have so far tested the programs successfully on Windows 7, Vista and XP. They are still undergoing development so suggestions or bug reports are very welcome. Alternatively, post your comments to the newsgroup

Google Groups Beta Patmos Molecular Screensaver / Santorini Molecular Viewer.

Rob Oeffner

Go to the OpenGL website


MtzExtInfoTip - a shell extension library for Windows Explorer

This library is mostly for the benefit of scientists working in macromolecular crystallography. The file format MTZ as defined by the CCP4 community contains header information about the data contained in each file such as unit cell dimensions, space group, name of columns etc. These can be displayed with command line programs such as MTZDUMP which works fine but is somewhat is cumbersome. The current library exploits the rich API present in Microsoft Windows. When you install this library you can display the header information simply by hovering your mouse over an MTZ file in Windows Explorer as depicted below. Unpack the zip file somewhere on your PC and run the install.cmd file from a command line supplied with the location of the library MtzExt.dll and you're done. The script will prompt you for admin privileges if you are not an adminstrator. Current version is for 64 bit Windows. If you want a 32 bit version, ask me or build it yourself. Source code compiles on Visual Studio 2005 (and probably later versions). But you will have to specify the location of external dependencies such as CCP4 source files on your own system. Get the shell extension library and source code from here.

Santorini - a Molecular Viewer

Click to view large screenshot

This program is a molecule viewer useful for visualising crystals, molecules or proteins.

Features

Download Santorini from this link.

History

9 Ocober 2010 Version 1,5,2144,3013. Various bugfixes. Improved smoothness of isosurfaces. Allowed for reloading file periodically or if the file changes.
24 April 2007 Version 1.5.1962.2778. Improved responsiveness when closing a file that's in the middle of being loaded.
22 February 2007 Version 1.5.1953.6363 beta. Fixed excessive memory usage when drawing surfaces of XYZ or PDB files.
20 February 2007 Version 1.5.1953.3589 beta. Fixed crash when closing program. Fixed spurious double surface drawing when showing XYZ or PDB files.
18 February 2007 Version 1.5.1953.503 beta. Made reading of XYZ files less picky. Fixed incorrect positioning of model when rotating with mouse. Fixed unpredictable positioning of XYZ axes when animating. Added support for Gaussian cube files, displaying multiple iso-surface levels. Comments in file headers can now be displayed when loading file or animating.
17 October 2006 Version 1.4.6288.8436.  Change of UI layout of Rendering page. Further improvement to algorithm for reducing CPU usage. Speeded up assigning bonds to pairs of atoms. Now persisting the state of the toolbar, statusbar and treeview panel between sessions.
Improved framerate during animation. Fixed potential deadlocks and crashes due to problems with thread synchronisation and usage of handles to kernel objects. Fixed incorrect amplitude of oscillation for clipping planes, eye coordinates and aim. Improved responsiveness of program when loading large files.
31 August 2006 Version 1.3.6241.8196. Improved algorithm for reducing CPU usage. Fixed problem persisting settings for clipping planes. Fixed problem reading numbers in countries with comma as a decimal separator.
19 August 2006 Version 1.3.6229.8323. Clipping planes have now been added which can be animated. A better algorithm has now been introduced for monitoring CPU usage when optimising complexity of OpenGL scene. Fixed bug that prevented some bonds from being displayed.
29 June 2006 1.2.6179.2817. Fixed bug when attempting to read corrupted files. Improved colouring of isosurface.
13 May 2006 Version 1.2.6131.8215. Fixed incorrect colour and drawing of cylindrical bonds.
11 May 2006 Version 1.2.6130.8059. Implemented molecular surface calculations based on Cory Bloyd's version of the Marching Cubes algorithm. For the sake of performance bonds can now optionally be illustrated as simple lines rather than cylindrical tubes.
25 March 2006 Version 1.1.664.7860. Yet another fix removing some more references to msxml4 in the TrackbarScroller control. Santorini should now definitely be able to run both on Win2K and WinXP.
6 March 2006 Version 1.1.664.7860. Fixed incorrect drawing of bonds for special cases of atomic coordinates. Fixed bug in TrackbarScroller ActiveX control allowing Santorini to run on Windows 2000 again. Credit goes to Brian Ward for giving feedback on this problem.
21 February 2006 Version 1.1.651.7659. Changed the UI of the animation tab so that it is more versatile and hopefully less quirky. Installing this version of Santorini will regrettably break previous versions of Santorini and Patmos (before version 1.1.651.7657), due to improvements made to TrackbarScroller ActiveX control.
10 February 2006 Version  1.1.640.6979, Compiled against msxml3 rather than msxml4 which is not always present on every PC. Fixed bug in TrackbarScroller ActiveX control that often prevented Santorini from running. Credit goes to Laurent Belanger for helping identifying this problem.
18 December 2005 Version 1.1.5351.8279. Fixed incorrect parent/child window relationship with tab control in the treepanel. Changed all resources to neutral localisation as to avoid potential crash on operating systems set to a non-english locale.
27 October 2005 Version 1.1.5299.8077, Changed animation tab to allow for a different type of animations. Allowed for drag and drop when opening files. Allowed for registering coordinate files with the system so that files may be opened via double clicking them. Adjustment of 3D view now also possible from Overview panel.
17 July 2005 Version 1.1.5197.7627, including adjustment of ambient light, fog, and background colour in OpenGL view. Allowing copying correlation function to Windows clipboard. Reduced memory usage of OpenGL graphics. Fixed misaligned correlation function graphs when saving to metafile or printing.
26 June 2005 Version 1.1.5176.6700, fixed incorrect value of near clipping plane in OpenGL, massively
improving depth buffer accuracy. Included drag-and-drop opening of files. Fixed bug in parsing PDB files. Fixed bug in openfile dialog not displaying files with extensions other than "*.xyz". Added background colour dialog.
16 May 2005 Version 1.1.5135.357, improved OpenGL graphics optimisation. Fixed incorrect normalisation in RDF. Added calculation of isotropic neutron scattering structure factor. Export results to text files. Support for loading PDB files.
23 February 2005 Version 1.0.553.8469 containing minor bug fixes
17 Jan 2005 Version 1.0.516.6747 contains fixes for misreading text files created on UNIX platforms as well as fixes for improper application of OpenGL lighting.
23 December 2004 Launch of version 1.0.0.1

 


Patmos - a Molecular Screensaver

This scientific screen saver rotates and bounces your favourite molecules, proteins or crystals. It has almost similar features as Santorini above. If your file contains several frames of atomic coordinates or molecular models then Patmos plays each frame sequentially as an animation.
Features
  • Clipping planes, Tessellation-CPU optimisation algorithm.
  • Molecular surface calculation.
  • Supported fileformats: Gaussian cube files, XYZ and protein data bank files PDB (restricted to only interpreting ATOM and HETATM records).
  • Show multiple frames in a single file as an animation.
click to view large screenshot

Download Patmos from this link.

More Screenshots:

 

History

9 October 2010 Version 1,5,2144,3013. Various bugfixes. Improved smoothness of isosurfaces. Allowed for reloading file periodically or if the file changes. Can now flip through coordinate files with the arrow keys when the screensaver is running.
24 April 2007 Version 1.5.1962.2778. Improved responsiveness when leaving screensaver in the middle of loading a file.
22 February 2007 Version 1.5.1953.6363 beta. Fixed excessive memory usage when drawing surfaces of XYZ or PDB files.
20 February 2007 Version 1.5.1953.3589 beta. Fixed spurious double surface drawing when showing XYZ or PDB files.
18 February 2007 Version 1.5.1953.503 beta. Made reading of XYZ files less picky. Fixed incorrect positioning of model when rotating with mouse. Allowed for random shuffling of list of file names. Fixed unpredictable positioning of XYZ axes when animating. Added support for Gaussian cube files, displaying multiple iso-surface levels. Comments in file headers can now be displayed when loading file or animating.
17 October 2006 Version 1.4.6288.8470. Change of UI layout of Rendering page. Further improvement to algorithm for reducing CPU usage. Speeded up assigning bonds to pairs of atoms.
Improved framerate during animation. Fixed potential deadlocks and crashes due to problems with thread synchronisation and usage of handles to kernel objects. Fixed incorrect amplitude of oscillation for clipping planes, eye coordinates and aim. Improved responsiveness of program when loading large files.
31 August 2006 Version 1.3.6241.8197. Improved algorithm for reducing CPU usage. Fixed problem persisting settings for clipping planes. Fixed problem reading numbers in countries with comma as a decimal separator.
19 August 2006 Version 1.3.6229.8378. Clipping planes have now been added which can be animated. A better algorithm has now been introduced for monitoring CPU usage when optimising complexity of OpenGL scene. Fixed bug that prevented some bonds from being displayed.
29 June 2006 Version 1.2.6179.2826.  Fixed bug when attempting to read corrupted files. Improved colouring of isosurface.
13 May 2006 Version 1.2.6131.8217. Fixed incorrect colour and drawing of cylindrical bonds.
11 May 2006 Version 1.2.6130.8134. Implemented molecular surface calculations based on Cory Bloyd's version of the Marching Cubes algorithm. For the sake of performance bonds can now optionally be illustrated as simple lines rather than cylindrical tubes.
25 March 2006 Version 1.1.651.7866. Yet another fix removing some more references to msxml4 in the TrackbarScroller control. Patmos should now definitely be able to run both on Win2K and WinXP.
6 March 2006 Version 1.1.651.7866. Fixed incorrect drawing of bonds for special cases of atomic coordinates. Fixed bug in TrackbarScroller ActiveX control allowing Patmos to run on Windows 2000 again. Credit goes to Brian Ward for giving feedback on this problem.
21 February 2006 Version 1.1.651.7657 Changed the UI of the animation tab so that it is more versatile and hopefully less quirky. Patmos can now switch between more coordinate files and display them sequentially after a user defined time interval. Installing this version of Patmos will regrettably break previous versions of Santorini (before version 1.1.651.7659) and Patmos, due to improvements made to TrackbarScroller ActiveX control.
10 February 2006 Version 1.1.640.6978. Compiled against msxml3 rather than msxml4 which is not always present on every PC. Fixed bug in TrackbarScroller ActiveX control that often prevented Patmos from running. Credit goes to Laurent Belanger for helping identifying this problem.
18 December 2005 Version 1.1.5351.8218. Changed all resources to neutral localisation as to avoid potential crash on operating systems set to a non-english locale.
27 October 2005 Version 1.1.5299.8064, Changed animation tab to allow for a different type of animations.
17 July 2005 Version 1.1.5197.7816, including adjustment of ambient light, fog, and background colour in OpenGL view. Reduced memory usage of OpenGL graphics.
26 June 2005 Version 1.1.5176.6145, fixed incorrect value of near clipping plane in OpenGL, massively improving depth buffer accuracy. Added background colour dialog.
16 May 2005 Version 1.1.5135.372, improved OpenGL graphics optimisation. Support for loading PDB files.
23 February 2005 Version 1.0.553.8480, initial launch

Correlation Functions

As of version 1.1 the ability to calculate the radial distribution function of atoms as well as the isotropic neutron scattering structure factor has been added. These correlation functions are particularly interesting for people simulating amorphous or glassy bulk materials. The scattering lenghts needed for such calculations are defined in the elements.dat file.

Molecular Surface

As of version 1.2, Santorini can now display a "surface" of the system being considered. One can probably debate until the cows come home exactly which is the proper definition of a molecular surface, let alone its physical significance. The definition employed here is the iso-level contour map satisfying the requirement that the distance to the closest atom equals its van der Waal's radius plus a constant D, which the user can vary but typically is around 1Å. To generate the iso-level contour map I have used Cory Bloyd's version of the Marching Cubes algorithm as detailed here by Paul Bourke.

Tessellation-CPU optimisation algorithm

This algorithm is mostly useful when animating a large molecule, protein or crystal. The problem is that hardware can vary considerably and that there is no prior knowledge of how many atoms the coordinate file contains. Both conditions affect how CPU intensive the screen rendering will be. The algorithm therefore measures the CPU usage during animation and then adjusts the qualilty of the rendering as to avoid hogging the CPU which otherwise could slow down your PC or make it unresponsive. With the algorithm enabled you'd typically see atoms and bonds in small molecules being rendered with quite smooth balls and tubes whereas atoms and bonds in large proteins may only be rendered just with points and lines.

 

Other molecules and crystals

In addition to the supplied coordinate files you can of course get your own favourite protein molecules from sites such as the Protein Data Bank at RCSB or EBI and mineral crystals from http://rruff.geo.arizona.edu/AMS/amcsd.php to mention but a few.

Drivers

Please note that in order to achieve the best performance for these programs you are advised to install drivers for your graphics card written by your graphics card vendor. The drivers Microsoft supply for PC graphics card with Windows may not be properly optimised for OpenGL unlike the genuine drivers provided by your graphics card vendor. Un-optimised drivers can be the cause of severe reduction in performance of these programs and you should therefore check your graphics card vendor's website for the availability of the latest driver.


XCPTLib

thmbBuggyApp1.jpg (9922 bytes)

thmbBuggyApp2.jpg (9689 bytes)

XCPTLib is an exceptionhandler library for deployed software that assists the developer with producing a stack trace as well as a crash dump file which can be analysed in WinDbg or Visual Studio for examining where a program failed. It basically overrides Windows default exception handler and presents the user with the choice of emailing a bug report back to the developer. The library can be invoked either statically or dynamically from the faulty application. Once the application crashes the library will catch the exception and ask the user for permission to email crash dump file and stack trace to the developer as shown in the two images above. The source code for the library as well as a test program using it, is hosted at SourceForge.net Logo. XCPTLib is partly based on examples by Matt Pietrek and Paul DiLascia found in the MSDN as well as the ZLIB compression algorithm by Jean-loup Gailly and Mark Adler all of whom are due for credit.

 

Bugs & Comments

Feel free to submit comments and bug reports to


Ph.D thesis

My Ph.D. degree from 1999 was done in theoretical chemistry and the dissertation was titled A Computational Study of Germanium Dioxide.