spectroscopy.py: Calculation of Boltzmann-Averaged Properties
VCD, ECD, NMR, NOE, Vibrational, Electronic, Circular Dichroism, Chemical Shift
- Overview
- Examples
Experimental measurements are often obtained from a mixture of conformers. To accurately predict the experimental values, a series of calculations over a set of conformers must be performed, and the Boltzmann-weighted average of the quantity of interest obtained. The spectroscopy.py script automates such calculations, which include conformational searching of the input structure (with MacroModel, using the OPLS4 or OPLS_2005 force field), quantum mechanical refinement of the conformers (using Jaguar), elimination of redundant conformers (again using MacroModel), calculation of the property of interest for the remaining conformers (using Jaguar), and computation of Boltzmann weighting factors for the conformers (using Jaguar). This information can then be used to generate Boltzmann-averaged quantities. This script currently supports computation of VCD or ECD spectra, optical rotation calculations, NMR chemical shifts of carbon and hydrogen atoms, and NMR spin-spin couplings between atom pairs. IR spectra can be computed separately or as part of a VCD computation. UV-Vis can be computed separately or as part of an ECD computation. NOE distances can also be computed, either separately or as part of an NMR computation.
The command syntax is as follows:
jaguar run spectroscopy.py [options] name.in
The Jaguar Spectroscopy input file (name.in) contains keyword-value pairs that define the parameters of the calculation. The input structure is specified with the infile keyword, whose value is a Maestro structure file. If this file contains multiple structures, all of the structures must be conformers of each other, and conformational searching is skipped. If it contains a single structure, a conformational search is run on it by default, unless you set skip_csearch. The available keywords are described in the table at the end of this topic, and can also be listed by running the command with the -h option or found in spectroscopy.py Command Help.
The Jaguar Spectroscopy keywords are separate from Jaguar keywords (such as basis and dftname), which are specified in the &JaguarKeywords section. This section is structured like the sections in a Jaguar input file, beginning with §ion and ending with &. For information on these keywords, see The gen Section of the Jaguar Input File.
The following is an example of the contents of a simple input file, which computes a VCD spectrum (including an IR spectrum) in water using the PBE0/6-31+G* level of theory:
infile = 'molecule.mae' vcd = True solvent = 'water' &JaguarKeywords basis = '6-31+g*' dftname = 'pbe0' &
Calculation parameters were previously specified as command-line options. That form is deprecated: it continues to work, and running it generates a jobname.in input file in the launch directory, but specifying parameters on the command line is expected to be removed in a future release.
The script offers several choices of solvent. Only water and chloroform are available in MacroModel, so the conformational search for the other solvents is performed with either water or chloroform, depending on whether the chosen solvent is polar or nonpolar. The geometry optimization of the conformers is then done with the chosen solvent by Jaguar. When a solvent is requested, the geometry optimizations and spectroscopy property calculations are done using the PCM solvation model. The Boltzmann weights used to average properties are improved by recomputing the electronic energy using the PBF solvation model.
For a more complete conformational search, you can set conf_search_acc = high.
You can set the temperature at which the Boltzmann weighting is calculated for the generated conformers with the temperature keyword.
Below are details of important output files and quantities for CD, NMR, and NOE calculations.
VCD/ECD spectra calculations:
Boltzmann-Averaged VCD/ECD .spm and .csv files are generated and found in the jobname folder in the directory the script is executed in. They are named jobname + a descriptive suffix. The contents of the files are described in Vibrational and Electronic Circular Dichroism Spectra.
The computation of IR spectra is included in a VCD calculation (setting vcd also sets ir), but you can compute it on its own by setting the ir keyword. The computation of UV/Visible spectra is included in an ECD calculation (setting ecd also sets uv_vis), but you can compute it on its own by setting the uv_vis keyword.
Note that while the vcd/ir keywords can be used together with ecd/uv_vis, none can be used in conjunction with any NMR or NOE keywords (nmr/chem_shifts/ssc/noe).
Optical Rotation calculations:
A jobname_optrot.csv file is generated after the calculation has finished, which lists the name, weight, specific optical rotation, and data type. The data type is "raw" for conformers and "averaged" for the Boltzmann-averaged structure. optrot cannot be set in conjunction with the nmr, vcd, or ecd keywords.
Calculate all NMR properties:
Set the nmr keyword to calculate NMR chemical shifts, spin-spin couplings, and H-H/H-F vector distances for NOE analysis. This is equivalent to setting all three of the NMR keywords: chem_shifts, ssc, and noe. nmr cannot be set in conjunction with the vcd or ecd keywords. For each NMR spectrum jobname_nmr.csv file generated in the calculation, a jobname_nmr_peaks.csv file reporting peak positions and heights is also generated.
NMR chemical shift calculations:
These calculations are currently supported for hydrogen, boron, carbon, nitrogen, fluorine, and phosphorus atoms in the gas phase or in chloroform.
The Boltzmann-averaged chemical shifts are reported for each atom, as well as further averaged over 3D equivalent atoms. The shifts are written as atom-level Maestro properties in a copy of the minimum-energy conformer, as Boltzmann-Avg NMR Chemical Shift and Boltzmann-Avg NMR Chemical Shift 3D Avg. The Boltzmann-averaged chemical shifts are reported in csv files that start with jobname_avg_.
Note that chem_shifts cannot be used in conjunction with the vcd or ecd keywords.
NMR spin-spin coupling calculations:
The Boltzmann-averaged isotropic spin-spin couplings are reported for each atom pair, as well as further averaged over 3D equivalent pairs of atoms. By default, pairs whose members are 3D-equivalent to one another are not computed since their couplings have no physical meaning. To compute couplings for all pairs, set the compute_all_ssc keyword. The couplings are written as structure-level Maestro properties in a copy of the minimum-energy conformer as, for example, Boltzmann-Avg F2 H2 Total SpinSpin Coupling iso and Boltzmann-Avg F2 H2 Total SpinSpin Coupling iso 3D Avg.
The Boltzmann- and 3D-averaged spin-spin couplings are printed in both the .out file and a csv file named jobname_SpinSpin_Couplings.csv.
Note that ssc cannot be used in conjunction with the vcd or ecd keywords.
NOE distance calculations:
For Nuclear Overhauser Effect (NOE) analysis, we also calculate the Boltzmann-averaged distances of all H-H and H-F vectors.
H-H and H-F distances are written to a CSV file and as a table in the .out file, for the nuclear Overhauser effect (NOE). The distance values include Boltzmann-averaged, minimum, and maximum values, and values for each conformer.
The Boltzmann-averaged distances are printed in both the .out file and a csv file named jobname_HH_HF_distances.csv.
Note that noe cannot be used in conjunction with the vcd or ecd keywords. NOE distances will still be calculated if any NMR keyword (nmr/chem_shifts/ssc) is specified. Setting noe alone will skip calculation of other NMR properties.
Atropisomerism
Compounds exhibiting two atropisomers around one dihedral can be accounted for with the check_for_atropisomers keyword. Setting this keyword alone will task the workflow with searching all dihedrals in the input compound for atropisomerism. If the structure of the atropisomers is known, searching around a specific dihedral can be set with the target_dihedral keyword. The search involves rotating each dihedral of interest and constructing potential energy surfaces (PES) to look for barriers. If high enough barriers around a dihedral are found, atropisomers are recognized. The PES is constructed using QRNN or xTB by default, depending on the elements present in the input compound. One can specify a DFT method/basis to construct the PES with the pes_method and pes_basis keywords.
The following example shows how a check for atropisomers can be included in the input file:
check_for_atropisomers = True target_dihedral = [1,4,5,8] pes_method = 'b3lyp-d3' pes_basis = '6-31G*'
Input file keywords
| Keyword | Type | Allowed Values | Default Values | Description |
|---|---|---|---|---|
| check_for_atropisomers | boolean | Any | False | Account for atropisomers. Can automatically try to determine the relevant dihedral, or one can specify a dihedral to inspect via `target_dihedral`. Currently only supports atropisomerism consisting of two atropisomers around one dihedral. |
| chem_shifts | boolean | Any | False | Calculate NMR chemical shifts. Has no additional effect if `nmr` is also set. |
| compute_all_ssc | boolean | Any | False | If set, compute spin-spin couplings for all pair of atoms. Default is to only compute relevant spin-spin couplings for the requested type of NMR spectra. |
| conf_search_acc | string | quick high std |
std | Accuracy level of MacroModel's conformer search. It sets the number of conformational search steps. Available options: - quick: 100 steps - std: 1000 steps - high: 3000 steps Choices = {'quick', 'high', 'std'} |
| conf_search_method | string | Any | mixed | Conformational search method used by Macromodel to generate conformers. Available options: - mcmm: global PES searching via the Monte Carlo Multiple Minimum (MCMM) method - lowmode: local PES searching via the Low-Mode Conformational Search (LMCS) method - mixed: hybrid MCMM/LMCS method - confgen: fast conformational search for ligands via Macromodel's ConfGen technology See Macromodel documentation for further references. Choices = {'mixed', 'mcmm', 'confgen', 'lowmode'} |
| conf_search_steps | real number | Any | None | Number of conformational search steps. If set, overrides number of steps as set by `conf_search_acc`. |
| coupling_threshold | real number | Any | 1.0 | The threshold (in Hz) below which J-couplings will be omitted from the spectrum simulation as their effects are below the resolution of most spectrometers. Lowering this may give additional splitting detail for conjugated systems at the cost of *significantly* increased runtime and memory use. Note that smaller couplings may still be pruned during subgraph generation if their inclusion would make the calculation intractable, see `max_subgraph_size`. |
| discrimination | real number | Any | 0.025 | When parsing the experimental spectrum this controls how large a gap of low signal is required to consider further different peaks as separate proton signals. Too low will result in split peaks being incorrectly broken apart. Too high and assignment detail may be lost. |
| ecd | boolean | Any | False | Calculate ECD spectra. Note that a UV-Vis spectrum is generated as part of the ECD calculation. |
| ecd_skip_thermo | boolean | Any | False | Applies to jobs that calculate only ECD. Skips explicit calculation of free energies and uses electronic energies of final set of conformers instead. |
| exclude_regions | list | Any | None | Regions of the experimental spectrum to ignore as a comma separated list of start:stop pairs, e.g. -0.1:0.1,0.5:0.75 |
| experimental | string | Any | None | Path to a file containing experimental NMR data. This can be either: a) CSV file containing (ppm, intensity) experimental NMR spectrum data. b) A text file containing an NMR spectrum blurb in ACS format https://pubsapp.acs.org/paragonplus/submission/acs_nmr_guidelines.pdf |
| final_dft_geopt | boolean | Any | False | Ensures final step of conformer refinement is geometry optimization at the DFT level. Since this is the default behavior, this option only affects runs using `mlff_geopt` |
| forcefield | string | Any | OPLS4 | Forcefield to use in conformational search. Default is OPLS4 if license found; otherwise OPLS_2005. Choices = {'OPLS_2005', 'OPLS4'} |
| ignore_protons_for_assignment | list | Any | None | Atom names from that should be ignored when matching theoretical NMR spectra to an experimental spectrum. |
| infile | string | Any | None | Input .mae file containing either one structure or a set of conformers. If it contains conformers, conformer search and atropisomer generation are skipped. |
| ir | boolean | Any | False | Calculate IR spectra. |
| keep_zero_ppm_peak | boolean | Any | False | Flag that peaks in the experimental spectrum between 0.1 ppm and -0.1 ppm should not be considerd the TMS reference peak. |
| max_atom_dev | real number | Any | 0.5 | Maximum allowed atom deviation in conf. elimination |
| max_subgraph_size | integer | Any | 14 | Maximum allowable size for subgraphs to control memory explosion in NMR spectrum simulations. In the worst case memory requirements grow as ~ O[N*4^N] with this parameter. Any subgraphs generated that have more spins than this (default 14) will have their smallest magnitude couplings (edges) iteratively pruned until they are manageable. |
| mc_search_temperature | real number | Any | 0.5 | The temperature (arbitrary units) for the Monte Carlo search if linear sum assignment fails. Must be a positive non-zero integer. Temperature scale depends on how closely the theoretical and experimental spectra match. Too low temperature and we may miss good combinations, too high and search will be essentially random. |
| mlff_conf_energy | boolean | Any | False | Use energies from the model specified by `mlff_method` to order conformers generated by Macromodel. Replaces the deprecated `nn_conf_energy` option. |
| mlff_geopt | boolean | Any | False | Use the model specified by `mlff_method` for conformer refinement. Replaces the deprecated `nn_geopt` option. |
| mlff_method | string | mlff qrnn |
qrnn | Method to use for conformer refinement if `mlff_geopt` or `mlff_conf_energy` is set. Choices = {'mlff', 'qrnn'} |
| mm_energy_window | real number | Any | 5.0 | Energy window (kcal/mol) for retaining conformers from conf. search |
| n_trials | integer | Any | 1000 | Number of trials that should be run when performing a Monte Carlo search because linear sum assignment has failed. More trials increase search coverage. |
| nmr | boolean | Any | False | Calculate NMR chemical shifts, spin-spin couplings, and H-H/H-F vector distances for NOE analysis. Equivalent to setting all three of the nmr properties: `chem_shifts`, `ssc`, and `noe`. |
| nmr_distinct_nuclei | list | Any | None | Index of atom(s) to consider as NMR inequivalent when performing chemical shifts and spin-spin couplings averaging. Atoms not in this list will be automatically checked for NMR equivalence and averaged accordingly. |
| nmr_field | real number | Any | 500.0 | Strength of NMR magnetic field in 1H frequency (MHz) for spectrum simulation. |
| nmr_resolution_ppm | real number | Any | 0.002 | The resolution in ppm of the NMR spectrum. It automatically sets the number of points used in the NMR spectrum simulation. |
| nmr_types | Any | [15N, 11B, 31P, 13C, 1H, 19F] | The types of NMR experiment to simulate. Adding this option without specify any types will disable spectrum simulation. Choices = ['15N', '11B', '31P', '13C', '1H', '19F'] | |
| noe | boolean | Any | False | Calculate H-H and H-F vector distances for NOE analysis. This option allows one to skip costly NMR calculations if used in the absence of `nmr`/`ssc`/`chem_shifts`. Note that vector distances are also computed when any of the above-mentioned options are set. |
| only_average_nmr | boolean | Any | False | Skip calculation of individual conformer spectra, just compute Boltzmann averaged NMR spectrum. |
| optrot | boolean | Any | False | Calculate optical rotation (ORD). |
| outconfs | integer | Any | 100 | Maximum number of conformers to retain |
| peak_height_factor | real number | Any | 0.02 | Scale factor used to automatically set minimum height for identifying peaks in the theoretical NMR spectrum. E.g.: 0.01 = one percent of maximum signal height. Note that this value has no effect in the NMR spectrum simulation; only affects the spectrum post-processing. |
| pes_basis | string | Any | 6-31G** | Basis set to use if `pes_method` is a DFT functional. |
| pes_method | real number | Any | None | Method used to optimize rotamers to fit the rotational PES. If not set, uses QRNN/xTB. May set to any valid DFT functional. |
| qm_energy_window | real number | Any | 5.0 | QM energy window (kcal/mol) for retaining structures for CD/NMR calculations |
| skip_celim | boolean | Any | False | Skip redundant conformer elimination via max atom deviation |
| skip_crefine | boolean | Any | False | Skip conformational refinement (QM Geometry Optimization) and thus redundant conformer elimination via QM energy |
| skip_csearch | boolean | Any | False | Skip conformational search |
| solvent | real number | Any | None | Solvent to use in all calculations |
| spectra_nm_interval | real number | Any | 0.1 | Interval between x-axis points in generated csv files of spectra with x-axis units of nm (UV-Vis/ECD). If <= 0, csv files will have constant energy intervals (10 cm-1) instead of constant nm intervals. |
| ssc | boolean | Any | False | Calculate spin-spin couplings. Has no additional effect if `nmr` is also set. |
| target_dihedral | real number | Any | None | Dihedral to inspect for atropisomerism. Passed in as list of atom indices or atom names, e.g. `[3,6,5,7]` or `[C3,C6,N5,C7]`. Only has an effect if `check_for_atropisomers` is also set. |
| temperature | real number | Any | 298.15 | Temperature at which to calculate thermodynamic quantities used in computing Boltzmann weights. This takes precedence over specifying `tmpini` in the &JaguarKeywords section. |
| threshold | real number | Any | 0.03 | The scale factor used to automatically determine thresholding value for identifying peaks in the experimental spectrum. e.g. 0.03 sets the threshold at 3% between signal minimum and maximum. |
| uv_vis | boolean | Any | False | Calculate UV-Vis spectra. |
| vcd | boolean | Any | False | Calculate VCD spectra. Note that an IR spectrum is generated as part of the VCD calculation. |
| prepare_input_structures | boolean | Any | False | Preprocess input structures, converting coordinates from 2D to 3D and adding any missing hydrogens. |