Science and software development

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

 

Scientific publications on ORCID

LinkedIn profile


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.

Go to the OpenGL website


SQLiteHistograms

An SQLite extension library for creating histogram tables, tables of ratio between histograms and interpolation tables of scatter point tables.

This SQLite extension library is based on the 'ext/misc/series.c example from the SQLite source files. It uses the virtual table feature of SQLite to generate tables on the fly.

The library contains three extensions: HISTO for calculating histograms of data, RATIOHISTO for calculating ratios of two histograms and MEANHISTO for calculating interpolated values of 2D scatter data.

HISTO

A histogram of a table named AllProteins and with the column NumberofResiduesInModel can be computed using the HISTO function like this:
SELECT * FROM HISTO("AllProteins", "NumberofResiduesInModel", 15, 0, 1500);
This produces a histogram with 15 bins between 0 and 1500.

RATIOHISTO

The ratio of two histograms of a table AllProteins with the columns LLGvrms and CCglobal where the LLGvrms values can be grouped into two different subsets depending on whether  CCglobal values is bigger or smaller than 0.2 can be computed with the SQL statement:

SELECT * FROM RATIOHISTO("AllProteins", "LLGvrms", 20, 0, 90, "CCglobal", 0.2);

This produces two histograms of LLGvrms with 20 bins from 0 to 90, one where CCglobal is smaller than 0.2 and one where it is greater than 0.2 as well as a histogram of the total count. In addition the ratio of the first histogram divided by the total count is computed.

MEANHISTO

The interpolated data of a 2-dimensional scatter data can be computed for a table AllProteins with the two columns FracvarVRMS1 and LLGrefl_vrms can be computed with the SQL statement:

SELECT * FROM MEANHISTO("AllProteins", "FracvarVRMS1", "LLGrefl_vrms", 30, 0, 0.6);

This produces a table with 30 bins of FracvarVRMS1 between 0 to 0.6 where each bin contains the average value of LLGrefl_vrms for the corresponding FracvarVRMS value.

Source code

and more information available from GitHub.


 

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.  

Source code

and the shell extension library available from GitHub.

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.