There exist several powerful 3D viewing programs for chemists wishing to interactively manipulate molecular structures. These interactive viewers, however, tend to sacrifice detail in exchange for increased speed. On the other hand, there are similarly powerful software packages which produce high-resolution images, but do not offer an interactive interface because the rendering processes involved are time intensive. Some attempts have been made to mate the two, producing an interactive viewer which can output screen images, but these images do not match the quality of the non-interactive renderers. This project has centered around creating an interactive viewer which can create high-resolution still pictures, and eventually, high-resolution video through the use of an external renderer.
The primary purpose of scientific visualization is to provide a human-readable analogue for the reams of data which can be generated by supercomputer applications. Molecular dynamics simulations are good examples, often generating hundreds of megabytes to several gigabytes of data over the course of several months. The simulation used by this project is a piece of a triple helix (or triplex) of DNA which consists of 681 atoms. It is immersed in a saltwater box containing 2,564 atoms. Each atom in the database consists of three coordinates, a type, and a group name and id number. The simulation itself consists of several thousand frames where the coordinates of each atom are subject to change. To help scientists work with this much data, a separate application for visualization is required.
Visualization applications for such simulations can be broken down into two types by their degree of interactivity. Interactive viewers provide the ability to perform real-time transformations of large data sets which help mesh three-dimensional structures in the user's mind. Non-interactive visualization tools, on the other hand, must convey any three-dimensional information by clever two-dimensional projections, or by animating rotations. Since non-interactive visualization tools do not require real-time updates, they can use advanced, yet costly, rendering techniques such as raytracing to dramatically increase the realism of output images.
The interactive visualization application created for this project, called PDBvid, has been developed in C on the IMD's Silicon Graphics workstations and utilizes the OpenGL extension libraries for all graphics manipulation. PDBvid reads Brookhaven's Protien Databank (PDB) files for a set of atomic coordinates and atom descriptors which it renders to the screen using an OpenGL interface. PDBvid provides a simple interface which provides basic manipulations, including global rotations, translations, and scalings. PDBvid is able to export these structures, with transformations, to a third-party renderer called Raster3D (Merritt & Bacon 1997). For a simpler, quicker image, support for writing screenshots in the SGI image format is also included.
Some attempt has been made to keep PDBvid as modular and extensible as possible, so future developments can easily be included with a minimum impact on performance and reliability. PDBvid's internal data structures are primarily dynamic, with as much encapsulation as possible to prevent memory leaks and overruns. Two key data structures, the transformation matrix and the atomic array, are statically defined to allow the fast random access that is just not possible with dynamic structures such as linked lists. The transformation matrix is continually updated by the user's mouse movements, while the atomic array is used to hold the definitions of the atoms which comprise the view model. Both of these structures are used for output to Raster3D.
Raster3D is a free-source pseudo-raytracing renderer that has been around for some time. It is capable of producing photorealistic high-resolution images from scenes consisting of a certain set of simple primitives. Because Raster3D was primarily designed for rendering molecular models, it includes a number of optimizations and shortcuts which dramatically increase its speed over more general raytracing utilities like the free-source Persistance of Vision Ray-Tracer (POVRAY).
Originally published as an optimized sphere renderer (for space-filling molecular models), Raster3D has evolved into a powerful tool for molecular visualization. Its geometric primitives have been expanded, allowing it to handle not only spheres, but "rods" and triangular polygons as well. The Raster3D package contains a set of filters for converting PDB files into its native format (R3D), using a set of different molecular representations, including the original space-filling, licorice, and ribbon cartoons.
Although there are example scripts for producing images from PDBs, anything more than a basic image requires an intimate knowledge of the R3D file format and 3D graphics models. This is where a front-end like PDBvid comes in. PDBvid already runs a powerful 3D graphics engine provided by OpenGL, and it reads PDB files. It is a simple matter to output PDBvid's 3D parameters to a R3D file and run Raster3D's renderer.
This project was facilitated by a generous grant from the National Science Foundation, through the Keck Center for Computational Biology, resources from the Institute for Molecular Design at the University of Houston, and many patient answers from the various members of the IMD.
Additional thanks to Ethan Merritt from the University of Washington.