MOLDA for Java - A Platform-independent Molecular Modeling and Molecular Graphics Program Written in the Java Language

Hiroshi YOSHIDA and Hiroatsu MATSUURA



Since the Java language was released in 1995, the style of the programming has been changed drastically. The Java language is an object-oriented programming language and has a platform-independent feature. In addition, the Java language has an excellent affinity for the Internet. In fact, the World Wide Web (WWW) has been changed dramatically since Java was born. The applets written in the Java language on the WWW servers can be transported to the WWW clients and execute the multi-media and interactive functions on the client machines. The integrating heterogeneous, autonomous and distributed computer systems/resources can be easily constructed by the combination of the distributed object computing techniques. Another evolution happened in 1996. The Virtual Reality Modeling Language (VRML), which presented the static three-dimensional (3D) graphics on the WWW in 1995, has been developed to VRML2.0 in order to perform moving 3D graphics. Although the 3D technique based on the VRML has been developed in molecular graphics, these system offer the static molecular models [1,2].
In the present work, we have developed a platform-independent molecular modeling and molecular graphics program, called MOLDA for Java, written in the Java language. The molecular coordinates in MOLDA [2,3], XMol [4] and Protein Data Bank [5] formats can be transferred to the VRML1.0/2.0 format file and can be viewed as a molecular model by using a VRML viewer on the WWW. This program can also be used as an interface to the semi-empirical molecular orbital program MOPAC [6] and the ab initio molecular orbital program GAUSSIAN 94 [7].


We used an IBM/AT compatible (DOS/V) machine, in which the Microsoft Windows 95/NT 4.0 or Linux operating system was installed, and an Indigo2 UNIX workstation for developing the program. We tested the MOLDA for Java by using Netscape Navigator which plugged-in WebSpace, Cosmo Player or VRWeb as a VRML viewer. The MOLDA for Java is created as a stand-alone program.


3.1. The Feature of Molecular Modeling

When MOLDA is running, all of the commands of MOLDA (summarized in Table 1) are allocated to the menu bar. Using the molecular modeling functions of MOLDA, the labor involved in preparing molecular structure data for molecular graphics using a VRML viewer is considerably reduced. Selection of a menu activates the corresponding subcommands. The menus are listed below.

1. File Menu

The 'File' menu deals with molecular coordinate file input and output. MOLDA [2,3], XMol XYZ [4] and Protein Data Bank [5] format files can be read. Molecular coordinates can be saved in VRML1.0/2.0 file formats (See section 3.2.).

2. View Menu

The 'View' menu deals with the change of the screen appearance (such as showing x- and y-axes and locating the number on each atom).

3. Model Menu

The 'Model' menu deals with the construction of molecular models. The all-trans conformation of an n-alkane molecule can be generated in a one-step operation by using the 'Input alkane' command (Fig. 1). A specified atom may be replaced by another element by using the 'Input a-No.' command. 'Internal rotation' can also be available (Fig. 2). The 'Merge subst' menu enables any molecules created by MOLDA to be connected with each other by mouse operation.

4. Analysis Menu

The 'Analysis' menu deals with the calculation of bond distances, bond angles and dihedral angles of a molecule.

5. Convert Menu

The 'Convert' menu deals with the conversion of the Cartesian coordinates obtained by using MOLDA into MOPAC and GAUSSIAN 94 input data formats. The details are described in section 3.3.

Table 1. Menus/submenus and commands in MOLDA for Java

OpenRead molecular structure data in MOLDA file format
Save AsSave molecular structure data in MOLDA file format as specified file name
Import XMolImport molecular structure data in XMol file format (*.xyz)
Import PDBImport molecular structure data in PDB file format (*.pdb)
Import MOPACRead the MOPAC output coordinates
Import GAUSSIANRead the “Standard Orientation” geometry from GAUSSIAN output file
VRML1.0 (Dreiding sticks)Save molecular structure data in VRML1.0 file format (Dreiding stick model)
VRML1.0 (Ball and stick)Save molecular structure data in VRML1.0 file format (Ball and stick model)
VRML1.0 (Space filling)Save molecular structure data in VRML1.0 file format (Space-filling model)
VRML2.0 (Dreiding sticks)Save molecular structure data in VRML2.0 file format (Dreiding stick model)
VRML2.0 (Ball and stick)Save molecular structure data in VRML2.0 file format (Ball and stick model)
VRML2.0 (Space filling)Save molecular structure data in VRML2.0 file format (Space-filling model)
AxesShow x- and y-axes
Atom numberLocate the number on each atom
Generate bonds automaticallyGenerate bonds automatically
Input bondGenerate a bond between two specified atoms
Input alkaneMake the all-trans conformation of an n-alkane molecule by input of the number of carbon atoms
Input a-No.Replace a specified atom by another element
Cancel atomDelete a specified atom
Cancel bondDelete a specified bond
Merge substSubstitute an atom or a group of atoms with a common substituent
Internal rotationDo an internal rotation around a specified bond by dragging a mouse
CoordinateGive coordinates of a specified atom
DistanceCalculate distance between two specified atoms
AngleCalculate bond angle
Dihedral AngleCalculate dihedral angle
MOLDA -> MOPACConvert MOLDA data into MOPAC input data
MOLDA -> GAUSSIANConvert MOLDA data into GAUSSIAN 94 input data
InfoShow information of this program

Fig. 1 A hexane molecule created by 'Input alkane' menu. Fig. 2 Do an internal rotation by 'Internal rotation' menu.

3.2. The Feature of Molecular Graphics

3D molecular structures in VRML1.0/2.0 formats can be generated by using MOLDA. These molecular structure data created by MOLDA or converted from GAUSSIAN 94 can be viewed in 3D by using a VRML viewer and demonstrated on the WWW. As shown in Figs. 3-5 by a WebSpace program on the Indigo2, Dreiding stick (Fig. 3), Space-filling (Fig. 4) and Ball and stick models (Fig. 5) are available. The molecular models written in VRML can be easily operated by the VRML viewer not only by local users but also by remote users, who can use terminal computers connected to the Internet. Moreover, the molecular models can be viewed platform-independently; in other words, they can be displayed on the DOS/V, Macintosh and UNIX machines.

Fig. 3 A Dreiding stick model of 18-crown-6.

Fig. 4 A Space-filling model of 18-crown-6.

Fig. 5 A Ball and stick model of 18-crown-6.

3.3. The Feature of an Interface to Molecular Science Programs

When the 'Convert' menu is selected, the data format for MOLDA is converted to GAUSSIAN 94 input data as shown in Fig. 6.

Fig. 6 Creating GAUSSIAN 94 input data.


MOLDA for Java provides molecular graphics on the WWW by using various format data. The program can work platform-independently if the Java virtual machine has been installed. This means that MOLDA can run not only on the well-known platforms such as Windows, Macintosh and UNIX, but also on new platforms which will appear in the future.


1) H. Vollhardt, G. Moeckel, C. Henn, M. Teschner and J. Brickmann, "VRML for the communication with 3D scenarios of biomolecules,"
2) H. Yoshida and H. Matsuura, J. Chem. Software, 3, 147 (1997).
3) K. Ogawa, H. Yoshida and H. Suzuki, J. Mol. Graphics, 2, 113 (1984).
4) Minnesota Supercomputer Center,Inc., "XMol (Version1.5) User Guide,"
5) Protein Data Bank, Brookhaven National Laboratory,
6) J. J. P. Stewart, MOPAC: A General Molecular Orbital Package (Version 6.0), QCPE #455.
7) M. J. Frisch, G. W. Trucks, H. B. Schlegel, P. M. W. Gill, B. G. Johnson, M. A. Robb, J. R. Cheeseman, T. Keith, G. A. Petersson, J. A. Montgomery, K. Raghavachari, M. A. Al-Laham, V. G. Zakrzewski, J. V. Ortiz, J. B. Foresman, J. Cioslowski, B. B. Stefanov, A. Nanayakkara, M. Challacombe, C. Y. Peng, P. Y. Ayala, W. Chen, M. W. Wong, J. L. Andres, E. S. Replogle, R. Gomperts, R. L. Martin, D. J. Fox, J. S. Binkley, D. J. Defrees, J. Baker, J. P. Stewart, M. Head-Gordon, C. Gonzalez and J. A. Pople, Gaussian 94, Revision D.3, Gaussian, Inc., Pittsburgh, PA, 1995.