Data processing, analysis, and visualization are routine tasks in sciences and humanities. The vast majority of data science today is conducted through
R, Python, Java, Matlab, and SAS. With a plethora of programming languages suited for the data processing and visualization,
Python seems the best general purpose functional programming language for such tasks. Indeed, being an interpreted, object-oriented language, Python has become an increasingly important programming language for data processing, analysis, and web development. Since you are reading this page, there is a very high chance that you are already very familiar with Python.
Python is open source software, freely available for a variety of platforms.
Gaussian PES scan and files for GENNBO
PESscan for GENNBO
NBO analysis of orbital interactions is a very powerful approach to understanding molecular properties. Subtle and often compensating interactions can be revealed by studying the NBO-derived properties at the potential energy surface (PES). By plotting potential energy traces that depict energy changes along the defined molecular coordinate (atom distance, angle, dihedral), one can get a better appreciation of different components of the total energy.
Gaussian provides several algorithms for PES evaluation. In a typical scenario, Scan keyword performs a series of single point calculations at various structures. While scanned coordinate changes depending on preset values, remaining part of the molecule stays rigid. Relaxed PES scan can be initiated with the keyword Opt=ModRedundant. At each increment of the scanned coordinate, remaining coordinates are optimized. Results of the either method are recorded in the job output file (*.out). Each PES output file contains the table of "Initial Parameters", which indicates the name and value of Scanned and Frozen coordinates. Atom coordinates together with the corresponding energy at each coordinate increment are all part of the output file. Efficient retrieval of all requested values is often challenging task, certainly not error proof. It is where the PESscan script comes handy.
PESscan Python script:
PESscan script loads the Gaussian PES output file and extracts scanned geometries and related energies into multiple files. Those files are formatted as Gaussian input files (.gjf) for the subsequent NBO analysis. In order to create proper route card and $NBO keylist, the script requests to enter the level of theory, basis set, and options to run NBO analysis. For each entry, there are multiple-choice selections as well as Custom entries. One can request generation of the archive file .47 or "direct" NBO calculations from compiled NBO or linked GENNBO modules. Successful extraction will provide summary of entered values, path of created .gjf files, and formatted Gaussian batch file (.bcf) for automated execution of calculations. Providing that the user has installed Python matplotlib library, plot of energy changes along the scanned coordinate will open. As an alternative, Energy/coordinate file is created.
- Unzip downloaded files (Python script and example input files) in directory of your choice.
- Depending on the setup of your environment, run the script:
>> python pes_nbo3.py output.out
- The script expects name of the PES output file as input.
- Choose preset options for each set of inputs or alternatively enter custom values at choice "other .."
- NBO OPTIONS allow straightforward calculation of NBO archive file .47 (option 1.), which later becomes input file for the GENNBO calculation. Use the above GenboHelper app to prepare .47 file for NBO analysis. Choosing options 2 or 3 will lead to prompt for NBO keywords. There are two preset options and also custom entry, should you need a different parameters. Again GennboHelper will provide formatted and correct NBO keylist.
- Upon answering all the input requests and depending on the Python setup, summary plot will open. The script was written in Python 2.7 as implemented in Anaconda from Continuum Analytics.
- All generated files are in the same directory as the original .out file
Point mouse over the image below to review the flow and logic of described steps. Contact me at the e-mail address below for suggestions or bugs.
VISSUALLY - PES scan for GENNBO:
Figure 2. Workflow of the PESnbo scan script.
Extracting dipole moment data from .nbo outputs
Read NBO Dipoles
Python script that parses .nbo output file to return information from the Natural Dipole Analysis section. Data is displayed in terminal and saved in generated .csv file.