
So far, we have worked out preparation of files for NBO visualization in the Jmol viewer. At some point, one would like to visually inspect specific NBOs or interacting NBO-NBO* pairs. Jmol offers two approaches to "loading" molecules and their properties. One is via Jmol Console (File → Console, Fig. 2), the other one is to load a macro script from Macros menu. To make either approach more easy, I wrote a simple java application that generates both the script and macro for single NBO or pair of interacting NBO-NBO* orbitals.
In brief, we browse for the specific NBO "PLOT" (.37 - .46) file, choose or leave default logical file name (LFN) and then proceed to input of molecular orbitals (field NBO). To visualize interacting orbitals, we check the "NBO Interactions" check box and enter interacting pair of orbitals into "NBO" and "NBO*" fields. After clicking "Create" button, the corresponding script will appear in the blank text field at the bottom.
From there, we can copy it to clipboard, save the macro file, or clear the text field. Detailed how-to can be found in each downloaded zip file.
- Platform independent
- Preferably standalone on desktops, possibly servers
- Simple, yet scalable
All discussed applications use Java SE 7 and JDK 1.7. To ensure that all apps work fine with older JAVA editions, JDK 1.6 versions (JAVA 6) are also included. Both versions were tested under Windows 7 and Ubuntu 11.04 virtual machine (VMware Workstation 7.0) hosted by Windows 7.
Java Application:
Let's begin with the Console input. I usually open Console window next to the main JmolViewer window for more interactive navigation. Typical example of Console script commands is shown in Fig. 1. For more scripting commands, see this scripting documentation. Specifics around molecular surfaces are described here.
![]() |
Fig. 1 Jmol Console. |
As outlined above and shown in Fig. 2, we fill in the file path (Browse for and click the particular plot file), check the filename and enter LFN type (37 for NBO), and proceed to field "NBO". Here, we enter orbital number or just type "homo, homo-1, etc.). After clicking "Create", the corresponding script will appear in the empty text field.
![]() |
Fig. 2 Create Jmol Script for NBO Visualization. |
To visualize interacting pairs of orbitals, check the box "NBO Interactions?" and provide the pair of interacting orbitals into "NBO" and "NBO*" fields, respectively. (Fig. 3).
![]() |
Fig. 3 Create Jmol Script for NBO Visualization - I. |
![]() |
Fig. 4 Interacting orbitals of formamide. |
Pasting the script into Console or saving it as macro file will result in visualization shown in Fig. 4. Save the above created macro file in the "macro" folder located at "%USERPROFILE%/.jmol/macros" (Windows 7). Hint - type the above path (without quotation marks) to Windows Explorer address bar and hit enter.
As the project evolved, I built two versions of the application. One is called "light" and does exactly what is described above. The other version, called "extended", has a few additional features - it will remember the previous state of file path, file name, and LFN type as data is stored (and retrieved) from dynamically created nbo_settings.xml file. This latter version also features link to any updates on this blog.
Download the files:
App/JAVA SE
|
JAVA 6
|
JAVA 7
|
nbo_macro_light
| ||
nbo_macro
| nbo_macro6.zip |
As table headers indicate, the same java classes (and application) are compiled for JDK 1.6 and JDK 1.7 environment. Any updates to the files will have revision suffix added to the filename (rev1) .
Contact me with any bugs or if there is a problem with the download (I'll e-mail you the files).
Future Work:
While both light and "extended" versions provide quick access to the script and macro files for use in JmolViewer, generation of custom set of macro files is clearly the next step. I'll post the blog update when new custom macro "generator" will be available. Another enhancements may include web access to java applet or Java Web Start deployment.
How-to Video:
References:
- Dr. Joaquin Barroso's Blog NBO thread.
- Natural Bond Orbitals (NBO) visualization at Dr. Joaquin Barroso's blog.
- Natural Bond Orbital 6.0 homepage.
- Molecular Modeling Basics - Jmol and more ...
No comments:
Post a Comment