Huntsville Simulation Conference 2003 October 29 – 31, Huntsville, AL ZINCv: A Chemical and Molecular Construction System Ramkrishna Chakrabarty, Douglas H. Ross Ralph Noack, and Alan M. Shih

Enabling Technology Laboratory Mechanical Engineering, University of Alabama at Birmingham

Mark Zottola High Performance Technologies, Inc.

Abstract This research effort aims to develop a chemical modeling tool that integrates the functionality of chemical visualization and molecular builder into one. ZINCv, which stands for “ZINCv Is Not just a Chemical visualizer”, is developed using Visualization Toolkit and FLTK, which makes it a cross-platform tool. Using ZINCv one can build and visualize from simple molecules to complex protein structures.

ZINCv Visualizer supports nearly 45 different chemical file formats including PDB. Babel chemical file converter is integrated into ZINCv so that this can visualize datasets in numerous chemical file formats. Currently ZINCv supports both -and-stick and space-filling visualization paradigms for molecules. ZINCv allows bond types to be represented in an intuitive manner by color -coding the same for single, double and triple bonds. ZINCv Builder is tightly integrated with Visualizer and with the integration of Babel as a built -in module, it can import and export molecules data in numerous chemical formats. The builder has several user-friendly features such as adding, modifying and deleting of atoms and bonds using simple mouse clicks. ZINCv has an internal database containing atomic radii, Van der Waals radii and bond numbers of all the elements. Using this database, the Visualizer can automatically create bonds between atoms using the Van der Waals radii as the threshold distance between two atoms in case of visualizing data with formats like XYZ, which does not have any connectivity information. Also, the database is used by the ZINCv Builder to automatically create bonds for an atom based on its bond number. Using ZINCv, molecules can be visualized on large stereoscopic displays as well as high resolution, tiled displays to get a better understanding of complex molecular structures in 3D.

Keywords: and Materials Science (CCM), Molecular Visualization

Introduction functional requirements which constitute the design focus of this tool. These requirements are: ZINCv stands for ZINCv Is Not just a Chemical visualizer. This is a graphics -driven software tool 1. Visualize molecules by reading a chemical data file. developed for Computational Chemistry and Materials Science (CCM) applications. True to its name, ZINCv 2. Build complex molecules. combines the two important functionalities of 3. Output a chemical data file after a molecule is built. chemical visualization and molecular construction 4. Support for all the major chemical data file formats into one package. The former feature involves including PDB and formats. reading in chemical data files of complex molecules 5. Modify an existing molecular structure to a more and visualization of the same, whereas the latter stable structure based on factors such as atomic radius feature involves construction of molecules and writing and bond length, etc. out its molecular structure in a chemical data file. 6. User -friendly environment to improve usability. ZINCv seamlessly integrates both these functionalities 7. Should be portable across different platforms. and provides the user with an intuitive, user-friendly Based on above requirements, the main visualization environment that facilitates both of these tasks. module of ZINCv has following functional

components, as shown in Figure 1: Development of ZINCv is sponsored by Department of Defense’s MSRC PET Program and has been File Reader: This component reads in the chemical integrated into the Integrated Simulation Environment data file. This also filters and stores the data required (ISE) project [1]. ZINCv is the standalone version of for rendering the molecules. the Computational Chemistry and Materials Science Chemical Database: This database contains (CCM) component of ISE. information required for rendering the molecule. This

includes tables of atom types supported, and their radii, Design and Implementation representative color, valences and threshold radii. ZINCv was developed under several fundamental

1

Huntsville Simulation Conference 2003 October 29 – 31, Huntsville, AL Molecule Renderer: This is the graphics component For rending large molecular structures, rendering each that takes in the molecule information and other atom as a sphere (Figure 6) can be a CPU -intensive required data from the database and finally renders the process that will reduce the frame rate dramatically. molecule. ZINCv allows the user to select texture rendering mode (Figure 7), which renders each atom with on The ZINCv has two main windows, namely, the polygon with an image of sphere mapped onto this Control Panel Window and the Rendering Window. polygon. This reduced the rendering time significantly, The ZINCv Control Panel contains four tabs. The if the graphics card on the machine supports texture Visualization Tab handles various visualization mapping well. options. Atoms Tab provides the access to the widgets for all the operations concerning with atoms like Molecule Builder addition and deletion. Bonds Tab allows all the Molecule Builder in ZINCv provides many basic operations concerning with bonds, such as the addition functions for the task. A user can add, delete, and and deletion of a bond. Modify Tab provides the modify an atom or a bond in this Builder. A user can access to all the molecule modification tools. The add atoms in one of the following two ways -- ZINCv Rendering Window is the graphics window · By mouse clicks on the screen, or, where all the visualizations are rendered. Figure 2 · Through the GUI, by specifying the coordinates shows the graphical user interface (GUI) of ZINCv of the atom. with these two windows. The user can also modify the atom type by selecting ZINCv is written in ++ Programming Language the atom and changing its type attribute on the GUI. using object -oriented methodology. Graphics and Selecting and dragging the selected atom with mouse rendering in ZINCv is implemented using VTK [2-4] can alter the position of the atoms interactively. On (Visualization Toolkit) version 4.0. For graphical user the other hand, a user can delete the atoms interface, FLTK [5] (Fast and Light Toolkit) 1.1.3 is · By selecting the atom using the mouse and used. Use of VTK and FLTK makes ZINCv fully delete it, or, portable across Windows and platforms. · Through the GUI, by selecting the atom from atom browser and delete it. File Format Support Open Babel [6] chemical file converter is integrated Atoms browser provides a user the details of each into ZINCv so that this can visualize numerous atom of the molecule, such as type and position. chemical data file formats. Open Babel is a project designed to pick up where Babel left off, as a Similarly, a user can add or delete bonds in similar cross -platform program and library designed to fashion . The user can modify the bond type (single, interconvert between many file formats used in double or triple). T he details of each bond for the molecular modeling and computational chemistry. molecule, such type and the end point atoms, are listed Babel supports a huge variety of common chemical in the bond browser. file formats. Thus, ZINCv can open files of 47 different formats and can save the file in 42 different Molecule Modification Tools formats due to the integration with Babel. These Three geometric relat ionships between atoms can be formats includes PDB (Protein Data Bank), modified interactively or automatically. These CHARMm and XYZ. relationships are bond length, the angle between three

atoms and rotation around a bond. To complete the set Visualization Features of modification tools, a dihedral modification tool Two different models for molecule visualization are needs to be implemented. supported in ZINCv, namely, the Ball-and-Stick (Figure 3) and the Space-Filling Models (Figure 4). Interactive modifications As for the bonds, the three bond types (single, double Bond length between any two atoms can be modified & triple) are color-coded (Figure 5). That is, green is interactively by selecting a fixed and moving atom, used for single bond, blue for double and red is used and then changing the length (Figure 8) with a slider for triple bond. The user at runtime can modify these widget on the GUI (Figure 9). The angle formed color bindings. The relative atomic and bond radii can between any two bonds joined by an atom can be be changed interactively. The molecule can be viewed modified interactively by selecting a fixed, pivot and with only its atoms or bonds. The Visualizer can the moving atom with mouse, and the angle is changed automatically create bonds between atoms using the using a slider widget on the GUI. An atom can be Van der Waals radii as the threshold distance between rotated around a bond connecting it to another atom. two atoms in case of visualizing dataset with the This is achieved by selecting a fixed, pivot and the formats like XYZ, which does not have any moving atom with mouse and the angle is changed connectivity information. 2

Huntsville Simulation Conference 2003 October 29 – 31, Huntsville, AL with a slider. These interactive tools allow the user to Reference modify the molecular visually and interactively. [1] Ralph Noack, David O'Gwynn, and Niranjana Doddomani, “Development of an Integrated Automatic modifications Simulation Environment”. Sometimes it is necessary for the user to modify the [2] W. J. Schroeder, K. M. Martin and W. E. Lorensen, molecular structure in a more general and systematic “The Visualization Toolkit, An Object-Oriented fashion, instead of manual manipulations. Therefore, Approach To 3D Graphics, 2nd edition”, ISBN ZINCv provides the following automatic modification 0-13-954694-4, Prentice-Hall. tools to “clean up” the molecular structure in terms of [3] Stein, R., Shih, A.M., Baker, M.P., Cerco, C.F., bond length, bond angle, bond rotation, and adding Noel, M.R., “Scientific Visualization of Water hydrogen atoms to empty bonds. Quality in the Chesapeake Bay,” IEEE Visualization 2000, October 8 - October 13, 2000, Bond Length: cleans up all the bond lengths to Salt Lake City, Utah, USA appropriate lengths based on tabular data. [4] Yu, T.Y and Shih, A.M., “Advanced Scientific Visualization Using VTK,” The 7th National Bond Angle: cleans up all the bond angles to Computational Fluid Dynamics Conference, appropriate angles based on the number of atoms Kenting, Taiwan, August 2000. attached to an atom. The current implementation is [5] B. Spitzak, “FLTK, Fast Light Toolkit”, limited to atoms with up to four attached atoms and http://www.fltk.org does not work properly if atoms are in rings. [6] http://openbabel.sourceforge.net/

Bond Rotations: allows the user to clean up the entire bond rotations to appropriate angles based he number and type of atoms attached to each of the atoms at each end of the bond. ChemicalChemical DataData Chemical

FileFile Database Add Hydrogen: will add hydrogen to empty bonds in a “nice” way by putting the atoms at close to their final position. The current implementation is limited to atoms with four bond sites. File Reader Molecule

Renderer Several sample datasets have been used to validate visualization capabilities in ZINCv. These datasets are fairly complex molecular structures, as shown in

Figures 10-13 .

Conclusion A GUI-driven framework for chemical data visualization and molecular builder system has been developed. This software tool provides high quality and highly versatile visualization capabilities to the desktop users, as well as users of stereoscopic and tiled display systems. It is highly portable across different platforms. ZINCv is designed in a modular way so Figure 1. ZINCv Functional Components that its features can be extended easily based on current framework, and it can be expanded to interface with other chemical applications such as Gaussian .

Acknowledgement This publication made possible through support provided by DoD High Performance Computing Modernization Program (HPCMP) Programming Environment and Training (PET) activities through Mississippi State University under the terms of Agreement No. N62306-01-D-7110.

Figure 2. ZINCv Graphical User Interface

3

Huntsville Simulation Conference 2003 October 29 – 31, Huntsville, AL

Figure 3. Ball-and-stick molecule model Figure 8. Example showing bond length modification of a simple molecule

Figure 4. Space-filling molecule model

Figure 5. Color-cod ing of bonds.

Figure 9. GUI for molecule modifications

Figure 6. Rendering atoms as spheres and bonds as tubes

Figure 10. Visualization of a complex protein molecule

Figure 7. Rendering atoms as texture map and bonds as lines

4

Huntsville Simulation Conference 2003 October 29 – 31, Huntsville, AL

Figure 11. Visualization of DNA structure

Figure 12. Visualization of a complex protein structure

Figure 13. Visualization of nano-tubes.

5