Mod:Hunt Research Group/Some G09 Parsers
Introduction
This page has some parsers i've made for some different types of gaussian calculation. Meaning they are scripts which essentially pull important information from output files and store them in convenient objects. They can be useful for using as part of other scripts, for example the TDDFT matlab class is a really good starting point for writing code to generate UV-Vis spectra from gaussian 09 TD-DFT calculations. If you have no interest in coding then these parsers are totally useless to you.
Also since this is a page about parsers, i should probably mention cclib - this provides python parsers for log files from a range of computational chemistry software (including gaussian 09)[link: https://github.com/cclib/cclib]
Links To Files
python molecule class parser Media:Mol Class Parser Jul2017 V0pt5.zip
matlab NBO file parser Media:G09 NBO Parser Matlab.zip
matlab AIM .sumviz file parser Media:AIM sumviz parser matlab.zip
matlab TDDFT file parser Media:TDDFT Classes.zip
Rough description of Matlab Parsers
All the matlab parsers are called in the same way, by calling the relevant function with a full filepath as the argument. Assuming you set the variable "fname" to the full path of the desired file:
NBO parser: "NBO_test = NBO_E2_Class_V2(fname) "
AIM parser: "AIM_test = Sumviz_File_Obj_V2(fname)"
TDDFT parser: "TDDFT_test = TDDFT_Output_Class_V1_2014a(fname)"
Both NBO and AIM parsers also have static methods which allow you to create an object/instance for each relevant file in a given folder (these objects get stored in an array). All the parsers have various (possibly) useful methods which are documented within the code. For example, the AIM parser has a method which returns the sum of bond critical point densities for all BCPS between two user defined fragments.
Rough description of molecule_class (Python parser)
This code is written in python3.5 (3.4 should work, not sure about anything earlier) and uses numpy. It pulls some basic information from *.com/*.log/*.fchk files, and is meant to be used on frequency files with a single structure (not sure if there are any issues with using it on an optimisation, ive never tried). The information it extracts depends on the type of file it reads, but in all cases a geometry is extracted. Documentation is mainly within the code, though some of its capabilities can be seen by testing the simple scripts i bundled with it (see below).
As well as Molecule_Class_V0pt5 the zip folder contains a couple of simple scripts utilising the parser, and some example files. To test the simple scripts make sure they have executable permissions ("chmod u+x filename"), are in the same folder as Molecule_Class_V0pt5 and are in your system path ("PATH=$PATH:<dir>", replace the word <dir> with the path for the folder containing the scripts.
Then navigate to the example_files directory. In terminal type:
"get_rel_energies.py ."
A file called "Rel_Energies.txt" will have been written in the current folder. This is a comma-delimited file with conformer names + there relative energies (in kJ mol).
To run the second script type:
"Min_Distances_Two_Frags.py . 1-3 4-18"
The first argument is the folder to look for .log files. The second two arguments define sub-fragments for your geometry. "1-3" corresponds to atoms 1,2,3. The script (with these arguments) finds the shortest distance between the two fragments "atoms 1-3" and "atoms 4-18", and outputs the distance in angstroms and also the identity of atoms involved.