CCP1 GUI Development: a Proto type Based on Python
Huub J. J. van Dam and Paul Sherwood
IntroductionThis project has arisen partly as a result of a long-standing requirement for a graphical interface for the GAMESS-UK quantum chemistry package and partly as a result of demand within the UK academic community (principally through CCP1) for a free, extensible GUI for community codes and teaching purposes. Software Development Approach Before starting development we considered a number of possible software approaches to the project, including a variety of languages and toolkits. Python[1] has a number of attractions at the present time, including
After considering the options we decided to start a prototype development based on PyMOL. It offers the advantages of Python as a development environment and there are already some model building and visualisation features which our project can exploit immediately. Since making this decision we have learnt that the team designing the CCP4 3D visualisation tool (aimed at protein crystallography) are also likely to base their developments on Python. This should provide a future opportunity to merge the tools and enable computational chemistry and crystallography codes to interoperate. Classes and Inheritance We make heavy use of the object-oriented nature of python with the intention that adapting and extending the GUI should be possible by creating new classes which can inherit much of the functionality of the existing code. A particular example of this philosophy is the successive inheritance from the classes as follows:
An example of the utility of this structure is provided by the requirement for all ab-initio codes to access libraries of basis sets and effective core potentials. Much of this code can be incorporated into the QMCalc object and only the code-specific details, for example how to translate the basis set into the required input format, needs to reside in the GAMESSUKCalc object. Because Python supports multiple inheritance it will be possible to define calculation interfaces contain both QM and MM control parameters, providing an efficient way to construct interfaces to the QM/MM packages such as ChemShell. Current Functionality and GUI Layout The interface is written using the TkInter toolkit and it is provided as an additional module which replaces the PyMOL TkInter interface module with an extended version. An additional menu provides access to the QM (and in future MM and QM/MM) calculation schemes. At present the GUI allows setup and visualisation of GAMESS-UK calculations using a variety of Hamiltonians and the generation of optimised structures, frequencies, molecular orbitals and charge densities. The control data for each calculation is managed using a notebook widget, which allows the control data associated with each area of GAMESS-UK functionality to be grouped together.
A screen shot of the PyMol molecular graphics system showing the notebook widget used to set the QM code options. The details of a QM calculation (including the results) can be saved to a file and restored for use in a new session. Future Work We are currently implementing a Z-matrix editor to allow the construction of internal coordinate definitions, and will provide an example of an extension to an addition QM code (probably a semi-empirical code, such as MOPAC). Availability The GUI is available on an open source basis from the CCP1 web page [5]. It is distributed on an open source basis and interested parties are invited to submit any developments back to the authors. References [1] Python http://www.python.org [2] PyMOL: http://www.pymol.org [3] MMTK: http://starship.python.net/crew/hinsen/MMTK/ [4] TkInter: http://www.python.org/topics/tkinter/ [5] CCP1 GUI development: http://www.cse.clrc.ac.uk/Activity/CCP1 |