Abstract
The computation of tautomer ratios of druglike molecules is enormously important in computer-aided drug discovery, as over a quarter of all approved drugs can populate multiple tautomeric species in solution. Unfortunately, accurate calculations of aqueous tautomer ratios—the degree to which these species must be penalized in order to correctly account for tautomers in modeling binding for computer-aided drug discovery—is surprisingly difficult. While quantum chemical approaches to computing aqueous tautomer ratios using continuum solvent models and rigid-rotor harmonic-oscillator thermochemistry are currently state of the art, these methods are still surprisingly inaccurate despite their enormous computational expense. Here, we show that a major source of this inaccuracy lies in the breakdown of the standard approach to accounting for quantum chemical thermochemistry using rigid rotor harmonic oscillator (RRHO) approximations, which are frustrated by the complex conformational landscape introduced by the migration of double bonds, creation of stereocenters, and introduction of multiple conformations separated by low energetic barriers induced by migration of a single proton. Using quantum machine learning (QML) methods that allow us to compute potential energies with quantum chemical accuracy at a fraction of the cost, we show how rigorous relative alchemical free energy calculations can be used to compute tautomer ratios in vacuum free from the limitations introduced by RRHO approximations. Furthermore, since the parameters of QML methods are tunable, we show how we can train these models to correct limitations in the underlying learned quantum chemical potential energy surface using free energies, enabling these methods to learn to generalize tautomer free energies across a broader range of predictions.
We show how alchemical free energies can be calculated with QML potentials to identify deficiencies in RRHO approximations for computing tautomeric free energies, and how these potentials can be learned from experiment to improve prediction accuracy.
Introduction
The most common form of tautomerism, prototropic tautomerism describes the reversible structural isomerism involving the sequential processes of bond cleavage, skeletal bond migration and bond reformation in which a hydrogen is transferred.1 Numerous chemical groups can show prototropic tautomerism. Common examples include keto–enol (shown in Fig. 2), amide/imidic acid, lactam/lactim, and amine/imine tautomerism.2
Tautomerism influences many aspects of chemistry and biology
Tautomerism adds a level of mutability to the static picture of chemical compounds. The change in the chemical structure between different tautomeric forms of a molecule is accompanied by changes in physico-chemical properties. By virtue of the movement of a single proton and the rearrangement of double bonds, tautomerism can significantly alter a molecule's polarity, hydrogen bonding pattern, its role in nucleophilic/electrophilic reactions, and a wide variety of physical properties such as partition coefficients, solubilities, and pKa.3,4
Tautomerism can also alter molecular recognition, making it an important consideration for supramolecular chemistry. To optimizing hydrogen bond patterns between a ligand and a binding site tautomerism has to be considered. In a theoretical study of all synthetic, oral drugs approved and/or marketed since 1937, it has been found that 26% exist as an average of three tautomers.5 While tautomerism remains an important phenomena in organic chemistry, it has not gained much appreciation in other scientific fields.
The typical small free energy difference between tautomers poses additional challenges for protein-ligand recognition. Local charged or polar groups in the protein binding pocket can shift the tautomer ratio and result in dominant tautomers in complex otherwise not present in solution.6 For this reason the elucidation of the dominant tautomer in each environment is not enough—without the knowledge about the ratio (i.e. the free energy difference) between tautomeric forms in the corresponding phase a correct description of the experimental (i.e. macroscopic) binding affinity might not be possible. To illustrate this, one might think about two extreme cases: one in which the tautomeric free energy difference in solution is 10 kcal mol−1 and one in which it is 1.0 kcal mol−1. It seems unlikely that the free energy difference of 10 kcal mol−1 will be compensated by the protein binding event (therefore one could ignore the unlikely other tautomer form), but a tautomeric free energy difference of 1 kcal mol−1 could easily be compensated. Examples for this effect—changing tautomer ratios between environments—are numerous for vacuum and solvent phase. One example is the neutral 2-hydroxypyridine (2-HPY)/2-pyridone (2-PY) tautomer. The gas phase internal energy difference between the two tautomers is ∼0.7 kcal mol−1 in favor of the enol form (2-HPY), while in water an internal energy difference of 2.8 kcal mol−1 was reported in favour of 2-PY. In cyclohexane, both tautomer coexist in comparable concentration while the 2-PY is dominant in solid state and polar solvents.7
The example above assumed two tautomeric forms—if there were multiple tautomeric forms, each with small free energy differences, using a single dominant tautomer in solvent and complex may still represent only a minor fraction of the true equilibrium tautomer distribution.
The study of tautomer ratios requires sophisticated experimental and computational approaches
The experimental study of tautomer ratios is highly challenging.8 The small free energy difference and low reaction barrier between tautomers—as well as their short interconversion time—can make it nearly impossible to study specific tautomers in isolation. Recently, efforts have been made to collect some of the experimental data and curate these in publicly available databases, specifically Wahl and Sander9 and Dhaked et al.10
In the absence of a reliable, cheap, and fast experimental protocol to characterize tautomeric ratios for molecules, there is a need for computational methods to fill the gap. And—even if such a method exists—predicting tautomer ratios of molecules that are not yet synthesized motivates the development of theoretical models. Computational methods themselves have a great need for defined tautomer ratios. Most computational methods use data structures in which bond types and/or hydrogen positions have to be assigned a priori and remain static during the calculation, introducing significant errors if an incorrect dominant tautomer is chosen.11
The third round of the Statistical Assessment of the Modeling of Proteins and Ligands (SAMPL2) challenge included the blind prediction of tautomer ratios and provided an interesting comparison between different computational methods.12 Most of the 20 submissions were using implicit solvent models and ab initio or DFT methods in combination with a thermodynamic cycle (as shown in Fig. 1) to evaluate tautomeric free energy difference.12 However, as stated in Martin,13 “In summary, although quantum chemical calculations provide much insight into the relative energies of tautomers, there appears to be no consensus on the optimal method”. For the 20 tautomer pairs investigated in the SAMPL2 challenge (this includes 13 tautomer pairs for which tautomer ratios were provided beforehand) the three best performing methods reported an root mean squared error (RMSE) of 2.0,14 2.5 (ref. 15) and 2.9 kcal mol−1.16 While these results are impressive it also shows that there is clearly room for improvement. And, maybe even more importantly, the SAMPL2 challenge showed the need for investigating a wider variety of tautomer transitions to draw general conclusions about best practices and methods for tautomer predictions.12 The excellent review of Nagy concluded that tautomer relative free energies are sensitive to “the applied level of theory, the basis set used both in geometry optimization and […] single point calculations, consideration of the thermal corrections […] and the way of calculating the relative solvation free energy”.17 We'd like to add “quality of 3D coordinates” to these issues and discuss them in the following.
Standard approaches to quantum chemical calculations of tautomer ratios introduce significant errors
The tautomeric free energy difference in solution can be calculated from the standard-state Gibbs free energy in aqueous phase of the product and educt of the corresponding tautomer reaction, which itself is calculated as the sum of the gas-phase standard-state free energy and the standard-state transfer free energy , shown as a thermodynamic cycle in Fig. 1.
The standard-state Gibbs free energy is calculated using a quantum chemistry estimate for the electronic energy and, based on its potential energy surface, a statistical mechanics approximation to estimate its thermodynamic properties. While the accuracy of the electronic energy and the transfer free energy ΔGS is dependent on the chosen method and can introduce significant errors in the following we want to concentrate on the approximations made by the thermochemical correction to obtain the gas phase free energy: the rigid rotor harmonic oscillator (RRHO) approximation and the use of single or multiple minimum conformations to generate a discrete partition function (as written in eqn (1)). In the following the standard-state of all the thermodynamic properties should be implied and will not be added to the notation.
A commonly used approach for the zero point energy (ZPE) and thermal contributions is based on the ideal gas RRHO, assuming that the molecule is basically rigid and its internal motions comprise only vibrations of small amplitude where the potential energy surface can be approximated as harmonic around a local energy minimum. This assumption leads to an analytical approximation that describes the local configuration space around a single minimum based on the local curvature of the potential energy surface (Fig. 2).18
Errors are introduced because the harmonic oscillator approximation assumes that, for each normal mode, the potential energy associated with the molecule's distortion from the equilibrium geometry has a harmonic form. Especially low-frequency torsional modes would be more appropriately treated as hindered internal rotations at higher temperatures. This can lead to a significant underestimate of the configurational entropy, ignoring the contributions of multiple energy wells.19 The correct treatment of such low-frequency modes in the analytical rotational entropy part of the RRHO partition function can add considerable computational cost, since the numerical solution requires the calculation of the full torsion potential (periodicity and barrier heights).20
Another, related shortcoming of the RRHO approach is the focus on a single minimum conformation. Assuming that the correct global minimum has been identified this approach ignores the configurational entropy of all other conformations to the partition function. Methods like the ‘mining minima’ approach can help to mitigate this problem and construct a partition function using local configurational integrals from multiple minimum energy wells.19 The standard state free energy G° of a molecule can then be calculated for each of the minimum conformations k separately and combined as follows
1 |
to obtain a weighted free energy.21,22 The free energy obtained in eqn (1) mitigates the shortcomings of the RRHO approach to model torsions with periodicity of 1 since—as long as the different minima of the torsion are generated as conformations—these are included in the sum over all conformations. But the configurational integral is still restricted to the minimum conformation and the contribution of its energy well, ignoring anharmonicity in the bonded terms and contributions from conformations outside the minimum energy wells.
Alchemical relative free energy calculations with machine learning potentials can compute true tautomeric free energy differences, including all classical statistical mechanical effects
Limitations of the ideal gas RRHO approximation to the free energy and ZPE correction, challenges in enumeration of local minimum conformations, and the consistent treatment of internal/external rotational symmetry, as well as approximations in the continuum solvent model can lead to errors in the free energy that are difficult to detect and correct. The use of molecular dynamics (MD) simulations, explicit solvent molecules, and a rigorous classical treatment of nuclear motion to sample independent conformations from an equilibrium distribution can overcome the above mentioned challenges. To describe tautomer free energies in solution this would require computationally prohibitive MM/QM calculations in which the molecule of interest is treated quantum mechanically (QM) and the solute treated using a molecular mechanics (MM) description.
One of the most exciting developments in recent years has been the introduction of fast, efficient, accurate and transferable quantum machine learning (QML) potentials (e.g. ANI,23 PhysNet,24 and SchNet25) to model organic molecules. QML potentials can be used to compute QM-based Hamiltonians and—given sufficient and appropriate training data—are able to reproduce electronic energies and forces without loss of accuracy but with orders of magnitude less computational cost than the QM methods they aim to reproduce. QML potentials have been successfully applied to molecular dynamics and Monte Carlo (MC) simulations.26 Here, we present the application of a machine learning potential for the calculation of alchemical free energies for tautomer pairs in the gas phase (Fig. 3).
We begin by investigating the accuracy of a current, state of the art approach to calculate tautomer ratios on a set of 468 tautomer pairs selected from the publicly available Tautobase dataset9 spanning different tautomer reactions, number of atoms and functional groups. We are using a popular DFT functional (B3LYP) and basis sets (aug-cc-pVTZ and 6-31G(d))27–31 for the calculation of the electronic energy and a continuum solvation model (SMD32) to model the transfer free energy.
Furthermore we are investigating the effect of a more rigorous statistical mechanics treatment of the gas phase free energies. To investigate this effect we calculate tautomeric free energy difference in vacuum ΔtGcalcvac using (1) alchemical relative free energy calculations and (2) multiple minimum conformations in combination with the RRHO approximation (as used in the quantum chemistry approach). To enable a direct comparison between the two approaches we are using a QML potential in both calculations.
Since we are interested in tautomeric free energy differences in solution we investigate the possibility to optimize the QML parameters to include crucial solvent effects. The framework we have developed to perform alchemical relative free energy calculations enables us to obtain a relative free energy estimate that can be optimized with respect to the QML parameters. We are using a small training set of experimentally obtained tautomer free energies in solution ΔtGexpsolv and importance sampling to obtain reweighted with the optimized parameters.
Here we report the first large scale investigation of tautomer ratios using quantum chemical calculations and machine learning potentials in combination with alchemical relative free energy calculations spanning a large chemical space and ΔtGexpsolv values.
Standard quantum chemistry methods predict tautomer ratios with an RMSE of 3.1 kcal mol−1 for a large set of tautomer pairs
Calculating tautomeric free energy differences in solution ΔtGcalcsolv is a challenging task since its success depends on a highly accurate estimate of both the intrinsic free energy difference between tautomer pairs as well as the transfer free energy.
We calculated the tautomeric free energy difference ΔtGcalcsolv for 468 tautomer pairs (460 if the basis set 6-31G(d) was used) and compared the results with the experimentally obtained tautomer ratios in solution (expressed as free energy difference in solution ΔtGexpsolv) in Fig. 4.
Three quantum chemistry approaches were used to calculate these values:
• B3LYP/aug-cc-pVTZ/B3LYP/aug-cc-pVTZ/SMD
Multiple conformations were generated for each tautomer, geometry optimization and energy calculations were performed with B3LYP/aug-cc-pVTZ in gas phase and solution (using the SMD continuum solvation model) and ΔtGcalcsolv was calculated as the difference between the free energies in aqueous phase for the individual tautomers. Transfer free energy was calculated using B3LYP/aug-cc-pVTZ/SMD on the optimized geometries in solution. This approach will be abbreviated as B3LYP/aug-cc-pVTZ/B3LYP/aug-cc-pVTZ/SMD in the following. The RMSE between ΔtGexpsolv and ΔtGcalcsolv for the dataset is 3.4 [3.0;3.7] kcal mol−1 (the quantities [X;Y] denote a 95% confidence interval).
• B3LYP/aug-cc-pVTZ/B3LYP/6-31G(d)/SMD
Multiple conformations were generated for each tautomer, conformations were optimizing with B3LYP/aug-cc-pVTZ in gas phase and solution (using the SMD continuum solvation model). Transfer free energy was calculated using B3LYP/6-31G(d)/SMD on the optimized geometries in solution. ΔtGcalcsolv was calculated as the difference between the free energy in aqueous phase for the individual tautomers and conformations. The RMSE between ΔtGexpsolv and ΔtGcalcsolv for the QM dataset is 3.1 [2.7; 3.4] kcal mol−1. This approach will be subsequently called B3LYP/aug-cc-pVTZ/B3LYP/6-31G(d)/SMD.
• B3LYP/aug-cc-pVTZ/SMD
Generating multiple conformations, optimizing with B3LYP/aug-cc-pVTZ in solution phase (using the SMD solvation model) and calculating relative solvation free energy ΔtGcalcsolv directly as the difference between the free energy in aqueous phase (on the solution phase geometry). In this case, the free energy in aqueous phase is not obtained through a thermodynamic cycle, but the frequency calculation and thermochemistry calculations are performed with the continuum solvation model.33 The individual free energy in aqueous phase Gcalcsolv,k for conformation k are averaged to obtain the final Gcalcsolv. The RMSE between ΔtGexpsolv and ΔtGcalcsolv is 3.3 [3.0;3.7] kcal mol−1. This approach will be subsequently called B3LYP/aug-cc-pVTZ/SMD.
The protocol used to obtain the results described above did not explicitly account for changes in internal rotors (only changes in the point group were considered). The results including changes in internal rotors are shown in Fig. S.I.5.† Including internal symmetry numbers did not improve the results.
The following discussion will concentrate on the results obtained with the best performing method (B3LYP/aug-cc-pVTZ/B3LYP/6-31G(d)/SMD). The results for all other methods are shown in the ESI Section in Fig. S.I.4.†
The tautomeric free energy difference in solution ΔtGcalcsolv calculated with B3LYP/aug-cc-pVTZ/B3LYP/6-31G(d)/SMD are shown in Fig. 4. The RMSE for the calculated values is 3.1 [2.7;3.4] kcal mol−1. Overall, the method tends to overestimate the tautomeric free energy difference in solution, as can be seen from Fig. 4B (lower panel). For 59 tautomer pairs (13% of the dataset) the method was not able to correctly determine the dominant tautomer species. For these 59 tautomer pairs the mean absolute error (MAE) between predicted and experimental value was 2.9 kcal mol−1.
5 out of the 6 tautomer pairs with highest absolute error (above 10 kcal mol−1) between experimental and calculated free energy difference have common scaffolds (values and molecules shown in the ESI Table S.I.1†). tp_1668, 1669, 1670 are all based on 5-iminopyrrolidin-2-one with either nitrogen, oxygen or sulfur on position 4 of the ring. tp_1559 and tp_853 both have methoxyethylpiperidine as a common substructure.
For the three analogues based on 5-iminopyrrolidin-2-one, we note that the experimental values are estimated results based on a three-way tautomeric reaction.34 While this might point to the unreliability of ΔtGexpsolv, we can not draw any definitive conclusions here without repeating the underlying experiment.
The best performing quantum chemistry method shows very good retrospective performance on the SAMPL2 tautomer set
Some of the tautomer pairs deposited in the Tautobase dataset were also part of the SAMPL2 challenge, specifically 6 out of 8 tautomer pairs of the obscure dataset (using the notation of the SAMPL2 challenge: 1A_1B, 2A_2B, 3A_3B, 4A_4B, 5A_5B, 6A_6B) and 8 out of 12 tautomer pairs of the explanatory dataset (7A_7B, 10B_10C, 10D_10C, 12D_12C, 14D_14C, 15A_15B, 15A_15C, 15B_15C).12 Comparing these molecules with the results of the SAMPL2 challenge—specifically with the results of the 4 participants with the best overall performance (ref. 16, 35, 15 and 14)—helps to assess the quality of the used approach. Arguably, the selection of the best performing method in the section above introduces a bias since the methods described subsequently have only seen the tautomer data described in the SAMPL2 challenge. This bias is difficult to quantify and correct, especially since some of the methods described below have been modified to reproduce the SAMPL2 explanatory tautomer set, but nevertheless we want to point it out to the reader at this point.
Since all four mentioned participants employed different methods, we will briefly describe the best performing methods of these publications for which results are shown in Table 1. The references to the methods used below are not cited explicitly, these can be found in the publications cited at the beginning of the following paragraphs.
Comparison between the results of this work and the SAMPL2 challenge. All values are given in kcal mol−1. The first part of the names in the ‘name’ column refers to the tautomer pair naming convention from the SAMPL2 challenge and in brackets is the name as used in this work. The calculations for Klamt and Diedenhofen16 were performed with MP2+vib-CT-BP-TZVP, for Ribeiro et al.15 with M06-2X/MG3S/M06-2X/6-31G(d)/SM8AD, Kast et al.14 with MP2/aug-cc-pVDZ/EC-RISM/PSE-3, and Soteras et al.35 with MP2/CBS+[CCSD-MP2/6-31+G(d)](d)/IEF-MST/HF/6-31G). On this subset the presented approach was the second best method based on the total RMSE. Bracketed quantities [X,Y] denote 95% confidence intervals.
Name | ΔtGexpsolv [kcal mol−1] | ΔtGcalcsolv [kcal mol−1] | ΔtGcalcsolv [kcal mol−1] | ΔtGcalcsolv [kcal mol−1] | ΔtGcalcsolv [kcal mol−1] | ΔtGcalcsolv [kcal mol−1] |
---|---|---|---|---|---|---|
This work | 16 | 15 | 14 | 35 | ||
1A_1B (tp_982) | −4.8 | −4.7 | −4.0 | −3.0 | −7.7 | −4.6 |
2A_2B | −6.1 | −6.8 | −5.7 | −5.7 | −9.7 | −6.3 |
3A_3B (tp_999) | −7.2 | −8.4 | −7.7 | −6.7 | −11.2 | −7.7 |
4A_4B | −4.8 | −0.4 | 0.5 | 0.8 | −4.6 | 0.6 |
5A_5B (tp_1614) | −4.8 | −4.7 | −3.9 | −4.4 | −6.2 | −5.6 |
6A_6B (tp_1005) | −9.3 | −11.4 | −7.6 | −9.7 | −11.2 | −10.0 |
RMSE | 1.3 [0.7,1.7] | 1.4 [0.6,2.1] | 1.5 [0.4,2.3] | 2.8 [2.0,3.5] | 1.3 [0.3,2.1] | |
7A_7B (tp_141) | 6.6 | 4.9 | 5.3 | 6.5 | 5.1 | 5.5 |
10B_10C (tp_1058) | −2.9 | −5.3 | 1.7 | 0.0 | −2.8 | 2.2 |
10D_10C (tp_1059) | −1.2 | −1.7 | 3.8 | 2.6 | −0.6 | 5.0 |
12D_12C (tp_1514) | −1.8 | −2.1 | 3.3 | 3.1 | −0.8 | 3.0 |
14D_14C (tp_1072) | 0.3 | −1.6 | 1.9 | 0.8 | 0.2 | 4.0 |
15A_15B (tp_504) | 0.9 | 6.1 | −3.0 | 3.6 | 0.0 | 0.9 |
15A_15C (tp_505) | −1.2 | 0.7 | −0.8 | 2.3 | −1.9 | 1.4 |
15B_15C (tp_506) | −2.2 | −5.0 | 1.8 | −1.2 | −1.9 | 0.5 |
RMSE | 2.5 [1.5,3.6] | 3.6 [2.5,4.5] | 2.9 [1.8,3.8] | 0.8 [0.5,1.1] | 3.8 [2.5,4.9] | |
Total RMSE | 2.2 [1.4,2.9] | 2.9 [2.0,3.6] | 2.4 [1.6,3.1] | 1.9 [1.2,2.6] | 3.0 [1.9,4.0] |
Klamt and Diedenhofen16 used BP86/TZVP DFT geometry optimization in vacuum and the COSMO solvation model. Free energy in solution was calculated from COSMO-BP86/TZVP solvation energies and MP2/QZVPP gas-phase energies. Thermal corrections (including ZPE) were obtained using BP86/TZVP gas phase frequencies.
Ribeiro et al.15 calculated the free energy in solution as the sum of the gas-phase free energy and the transfer free energy. The gas phase free energy was calculated using M06-2X/MG3S level of theory and the molecular geometries optimized with the same method. The corresponding transfer free energy were computed at the M06-2X/6-31G(d) level of theory with the M06-2X/MG3S gas-phase geometries using the SM8, SM8AD, and SMD continuum solvation models (Table 1 shows only the results with SM8AD, which performed best).
Kast et al.14 optimized geometries in gas and solution phase (using the polarizable continuum solvation model PCM) using B3LYP/6-311++G(d,p). Energies were calculated with EC-RISM-MP2/aug-cc-pVDZ on the optimized geometries in the corresponding phase. The Lennard-Jones parameters of the general Amber force field (GAFF) were used.
Soteras et al.35 used the IEF-MST solvation model parameterized for HF/6-31G(G) to obtain transfer free energy values. Gas phase free energy differences were obtained by MP2 basis set extrapolation using the aug-cc-pVTZ basis set at MP2/6-31+G(d) optimized geometries. Correlation effects were computed from the CCSD-MP2/6-31+G(d) energy difference.
The approach used in this work (B3LYP/aug-cc-pVTZ/B3LYP/6-31G(d)/SMD) performs well compared to the four approaches described above. For the total set of investigated tautomer pairs our approach has a RMSE of 2.2 [1.4,2.9] kcal mol−1, making it the second best performing approach only outperformed by Kast et al.14
The difference in RMSE between the explanatory and blind dataset is noteworthy. Approaches that perform well on the blind data set perform worse on the explanatory set and vice versa. This is to a lesser extent also true for our chosen approach—B3LYP/aug-cc-pVTZ/B3LYP/6-31G(d)/SMD performs worse for the explanatory tautomer set (RMSE of 2.5 [1.5,3.6] kcal mol−1) than on the blind tautomer set (RMSE of 1.3 [0.7,1.7]), but in comparison with the other four approaches, it is consistently the second best approach.
Interesting to note are the three tautomer pairs 15A_15B, 15A_15C and 15B_15C from the explanatory data set. The absolute error for these three pairs are 5.24, 1.9, and 2.8 kcal mol−1, respectively. It appears that the used approach has difficulty to model 15B correctly, showing larger than average absolute errors whenever 15B is part of the tautomer reaction. Most likely the hydroxyl group in 15B is critically positioned and sensitive to partial solvent shielding by the phenyl ring, something that has been noted before.14
The discrepancy between the different approaches (ours included) for the tautomer set shows that it seems highly difficult to propose a single method for different tautomer pairs that performs consistently with a RMSE below 2.0 kcal mol−1. This issue is made substantially worse by the many different ways methods can be used/combined and errors can be propagated/compensated during tautomeric free energy difference ΔtGcalcsolv calculations. While we believe that a RMSE of 3.1 kcal mol−1 is a good value for the chosen approach, especially when compared to the results of the SAMPL2 challenge, it is by far not a satisfying result. The accuracy, compared to the cost of the approach, is not justifiable and there is still a dire need for more accurate and cheaper methods to obtain relative solvation free energies for tautomer pairs.
With this we close the investigation of the state of the art QM free energy calculations and will investigate some of the shortcomings of the RRHO thermochemistry calculations. Some of the insight gained above could have been concluded from the work of Kast et al.,14 Ribeiro et al.,15 Klamt and Diedenhofen,16 Soteras et al.,35 but the small number of chemical species investigated there and the often contradicting results reported elsewhere (e.g. ref. 36 and 37) made a closer investigation of QM free energy calculations for a large dataset necessary. The reported results will be of importance for further method development for tautomeric free energies.
Including multiple minimum conformations seems to have little effect on the accuracy of tautomer free energies
The three approaches described above consider multiple conformations to obtain the tautomeric free energy difference ΔtGcalcsolv. Obtaining the global minimum conformation is an important and well established task in quantum chemistry calculations. Fig. S.I.6† shows the difference between the highest and lowest free energy for an optimized minimum conformation for the individual tautomers of the dataset generated with B3LYP/aug-cc-pVTZ. While many of the tautomers have only a single minimum conformation (278 out of 936 tautomers), for molecules with multiple minimum conformations the difference in the free energy emphasizes the need and justifies the cost for a global minimum conformation search. Molecules with more than 10 kcal mol−1 difference between highest and lowest energy minimum are shown in Fig. S.I.6.†
While the scientific community agrees on the importance of the global minimum for property calculations, the importance of considering multiple conformations for quantum chemistry free energy calculations has not been well established (e.g. ref. 38). Using multiple minimum energy conformations can add substantial computational cost to the free energy calculations. Often, the global minimum conformation search can be performed with a lower level of theory than the single point energy calculation, making only a single high level electronic energy calculation necessary. Frequency calculations can also add considerably to the computational cost of the free energy calculation. If a single, minimum energy conformation is sufficient to obtain a good estimate for the free energy in gas phase substantial amount of computational time could be saved.
Fig. 6 compares the tautomeric free energy difference obtained using the weighted average over multiple minimum conformations and the single global minimum conformation. The results indicate that using multiple minimum conformations does not significantly improve the final result compared to using a single, global minimum structure. Only 12 tautomer pairs show an absolute deviation larger than 1 kcal mol−1 in the tautomeric free energy difference ΔtGcalcsolv between the two approaches. Much more relevant than including multiple conformations is locating the global minimum conformation (as clearly shown by Fig. 5).
Alchemical relative free energy calculations with quantum machine learning potentials can rigorously capture classical statistical mechanical effects
Previous work using QML potential for free energy calculations have focused on hybrid QML/MM simulations wherein ligand interactions are treated with ML and the environment and ligand–environment interactions with MM.39,40 To our knowledge, this is the first time alchemical free energy calculations have been performed using purely a QML potential for drug-like molecules.
Alchemical relative free energy calculations were performed for 354 tautomer pairs using 11 alchemical λ states in vacuum. In the following, we will compare the tautomeric free energy difference obtained using alchemical relative free energy calculations to the multiple minima, RRHO approximation using the same potential energy function (ANI-1ccx) to assess potential errors in the thermochemistry corrections. We will also show how a small number of experimentally obtained tautomer ratios in solution can be used to incorporate crucial solvent effects and recover tautomer free energies in solution by QML parameter optimization and importance weighting.
While ANI-1x was trained on energies/forces calculated with ωB97x/6-31G*(d), ANI-1ccx was retrained from the same level of theory to include energies recalculated with coupled cluster considering single, double, and perturbative triple excitations (CCSD(T)) with an extrapolation to the complete basis set limit (CBS).41 CCSD(T)/CBS is the gold standard for electronic energy prediction and calculates thermochemical properties to within the limit of chemical accuracy (e.g. ref. 42).
RRHO ANI-1ccx calculations show significant deviations from the alchemical relative free energy calculations
In the limit of infinite sampling alchemical relative free energy calculations approach the exact free energy difference. Alchemical relative free energy calculations can be used to quantify the error introduced by a discrete partition function in the form of multiple minimum conformations and harmonic treatment of all bonded terms (including torsions and internal rotors)—if the same potential energy function is used for both calculations. Such a comparison is especially useful for quantum mechanics potentials which typically do not include explicitly defined harmonic terms in their functional form (as is the case with most classical force fields). It is important to emphasize that what is quantified here is not the error that the RRHO introduces for free energy calculations, but for relative free energy calculations: the difference in the partition function that results from the tautomerization. Typically, only a small region of the molecule is affected by the tautomerization and there is potential for error compensation.
Since the simulation time of the individual lambda states for the alchemical relative free energy calculations were relatively short (200 ps) we repeated the calculations multiple times (5) with randomly seeded starting conformations and velocities to detect systems for which the simulation time was clearly insufficient. In the following we will only use systems that had a standard deviation of less than 0.3 kcal mol−1 for 5 independent alchemical free energy calculations. Applying this filter resulted in the removal of 65 tautomer pairs for which the free energy calculation had not converged.
Results shown in Fig. 7 indicate the average deviation that every relative free energy calculation based on the RRHO approximation introduces, regardless of the accuracy of the actual potential to model electronic energies. The mean absolute deviation of 0.9 kcal mol−1 should not be underestimated. Results shown in Table 1 would be significantly improved if an error of 0.9 kcal mol−1 could be compensated by running a protocol that samples the relevant conformational degrees of freedom to obtain an exact partition function.
For 12 (out of 289) tautomer pairs the multiple minima RRHO approximation deviated by more than 3 kcal mol−1 (molecules are shown in Fig. S.I.1†). Most of these molecules have high conformational degrees of freedom and it seems unlikely that a naive enumeration of relevant conformations (e.g. with a conformer generator) will detect all of them—this might contribute to the observed error. That is certainly true for tp_113, 116, 565, 554, 403, 1674.
QML potentials can be optimized to reproduce experimental tautomer ratios in solution
Since the alchemical free energy calculations were performed in vacuum, a comparison with the experimental tautomeric free energy difference ΔtGexpsolv showed a high RMSE of 6.4 [5.9,6.8] kcal mol−1, as expected from the well-known impact of solvation effects on tautomer ratios.37
In the following we want to investigate if thermodynamic observable—in this specific case tautomer ratios—can be used to retrain a neural net potential derived from QM calculations. Further, we want to test how such an optimized parameter set would perform on the original dataset used to train the neural net potential and if it is possible to use the difference between the energies of the original and optimized parameter set for regularization.
Defining a loss function L as the error between the calculated ΔtG(θ)calcvac and experimental ΔtGexpsolv free energies it is possible to optimize the loss with respect to the neural net parameters θ defining the ANI potential. Using importance weighting, a new free energy estimate can be calculated with the optimized QML parameters (θ*) using the modified potential energy function without resampling the equilibrium distributions. To ensure that the quality of the neural net parameters does not deteriorate beyond a reasonable threshold a regularization term was added that acts on the energy difference for each snapshot calculated with the endstate potential energy functions with the original and optimized parameter set (ΔE(θ, θ*)). The regularization term was included in the molecular loss function acting on the snapshots used for the free energy calculation for the 212 tautomer pairs in the training set—in the course of a single epoch ΔE(θ, θ*) is evaluated on a total of 699 600 snapshots (212 tautomer pairs × 11 lambda states × 300 conformations).
Initial results led to the introduction of scaling factors that allows to slowly increase the contribution of the tautomeric free energy difference in the loss function (and/or the regularization term) during the training. The protocol is described in more details in the Methods section.
It was possible to overfit the parameters on the training set within 50 epochs if no regularization term was used (training/validation performance shown in Fig. S.I.7I and M†). Without a regularization term the RMSE for ΔE(θ, θ*) on the training/validation/test snapshots rises to 40–100 kcal mol−1. While the training set performance improves the validation set performance reaches a plateau around 2.2–2.6 kcal mol−1. The red dotted line in Fig. S.I.7† top panels indicates the performance of the reported results in Fig. 8, indicating that even without regularization this performance can not be improved significantly.
The results shown in Fig. 8 and S.I.7† indicate that there is a trade off between the accuracy of the ANI-1ccx parameters on its original training set (either directly shown in Fig. S.I.7† or indirectly through ΔE(θ, θ*) in Fig. 8) and the improvement for the prediction of tautomeric free energy differences. This is best exemplified in the training/validation set performance shown in Fig. S.I.7F and X.† For both training runs the scaling factor of the regularization term was increased throughout the epochs, shifting the focus from optimizing the free energy to keeping ΔE(θ, θ*) as small as possible. In Fig. S.I.7X† the ΔE(θ, θ*) term in the loss was kept constant throughout the first 100 epochs and then raised approximately tenfold during the next 50 epochs. Looking at the training/validation set performance it becomes evident that starting with epoch 100 the initial trend towards improved performance starts to reverse while the MAE for ΔE(θ, θ*) decreases. After 400 epochs the MAE for ΔE(θ, θ*) is near zero and there is no improvement in the free energy estimate for the training/validation set. This indicates that the parameter set approaches the same minimum that was occupied before training started.
Whenever both weights and biases are trained for the QML potential it often takes a few hundred epochs before ΔE(θ, θ*) approaches reasonable values (∼2 kcal mol−1), shown e.g. in Fig. S.I.7L, J, G, and A.† Similar behavior was observed even if the learning rate for the biases was reduced to 1 × 10−6 as shown in Fig. S.I.7T.† In some instances it was not possible to converge and successfully minimize both terms of the loss function in 400 epochs. One such case is shown in Fig. S.I.7E.†
In Fig. 8A the training/validation set performance of a training run with 400 epochs is shown. Only weights were optimized with a learning rate of 1 × 10−4, regularization was used (the scaling factors are plotted in Fig. S.I.9†). Fig. 8B shows the obtained free energy estimates with the best performing parameter set (calculated on the validation set) on an independent test set (71 tautomer pairs). The optimized parameter set (θ*) was able to improve the prediction of tautomeric free energies on the test set from initial 6.7 [5.7,7.7] kcal mol−1 with the original parameter set (θ) to 2.8 [2.2,3.3] kcal mol−1, comparable to the performance of B3LYP/aug-cc-pVTZ/B3LYP/6-31G(d)/SMD. Fig. 8B shows the distribution of . The Kullback–Leibler divergence (KL) value for indicates that the optimized parameter set is able to reproduce the distribution of the experimental free energies better than the initial parameter set.
Fig. 8A shows the performance of the parameter set on the ANI-1ccx training dataset.§ The RMSE of the parameter set for the ∼500 000 data points of the dataset increases from initial 1.7 kcal mol−1 to 5.5 kcal mol−1. This increase in RMSE can be partially explained by the target of the retraining: tautomeric free energies in solution. Including solvation effects necessarily decreases the performance on a gas phase dataset.
There is a limit to the reweighting workflow, as indicated in Fig. S.I.8,† that requires to re-sample the equilibrium distributions with the perturbed parameter set. The uncertainty of the perturbed free energy estimate increases as the weights become more concentrated on fewer observations and the effective sample size shrinks.43 Using an arbitrary cutoff of 1 kT as acceptable for the perturbed free energy uncertainty Fig. S.I.8† indicates that conformations should be resampled after around 400 epochs with the perturbed parameter set.
Coming back to the question posed in the beginning of this section: yes, it appears to be possible to use experimental values of a thermodynamic observable to retrain an already optimised QML potential to improve its performance for predicting free energies. This is astonishing, considering the small set of experimental measurements used to retrain the potential (≈250 data points) that provides an unambiguous and substantial improvement in performance on the held-out test set. The learning curve shown in Fig. S.I.12† indicates that using 5% of the training data already improves the MAE by 2 kcal mol−1.
The regularization term restraining the QML parameter set so that it is still able to reproduce single point energies with comparable quality than the original parameter set (with an increase in RMSE of ∼3 kcal mol−1) offers an interesting trade off between high quality QM single point energies and highly improved tautomeric free energy differences. It appears as if the regularization term is not necessary to improve the tautomeric free energy difference estimate, but introducing such a regularization term in the loss function does also not significantly hinder the parameter set optimization (if the scaling factors for the two terms in the loss function are chosen reasonably). These results highlight the incredible potential of QML energy functions that are differentiable with respect to its parameters in addition to coordinates, enabling model tuning based on experimental and quantum chemical data to be both facile and incredibly powerful.
Discussion & conclusion
In this work we use a state of the art density functional theory protocol and continuum solvation model to calculate tautomer ratios for 460 tautomer pairs using three different approaches to model the solvent contributions. The best performing method uses B3LYP/aug-cc-pVTZ and the RRHO approximation for the gas phase free energies (calculated on B3LYP/aug-cc-pVTZ optimized geometries). The transfer free energy was calculated using B3LYP/6-31G(d)/SMD on geometries optimized in their respective phase (with B3LYP/aug-cc-pVTZ). This approach performs with an RMSE of 3.1 kcal mol−1.
One possible source of error—independent of the method used to calculate the electronic energy and model the continuum electrostatics—are the thermochemical corrections used to obtain the standard state free energy. Typically, an analytic expression is used to approximate the partition function which is based on the rigid rotor harmonic oscillator approximation. To obtain the correct and unbiased partition function and compute rigorous free energy estimates we implemented an alchemical relative free energy workflow using the ANI family of quantum machine learning (QML) potentials.23 The method was implemented as a python package and is available here: https://github.com/choderalab/neutromeratio.
Using the same potential for the calculations based on the RRHO and performing alchemical relative free energy calculations we are able to show that the RRHO approximation introduces a mean absolute error of ∼1 kcal mol−1 in the calculation of the investigated relative free energies. These errors can be attributed to anharmonicity in bonded terms, difficulties to enumerate relevant minimum conformations and in combining shallow local energy wells as well as the inconsistent treatment of internal and external symmetry numbers.
The ANI family of QML and comparable QML potentials have opened the possibility to investigate tautomer ratios using relative free energy calculations without prohibitive expensive MM/QM schemes or ab initio simulations. The calculated alchemical free energies obtained using the methods implemented in the “Neutromeratio” package can be used to optimized the parameters of the QML potential. Using a small set of experimentally obtained tautomer ratios we were able to optimize the QML parameters on a training set and significantly improve the accuracy of the calculated free energies on an independent test set. The tautomeric free energies obtained with the optimized parameter set improved the RMSE from initial 6.7 kcal mol−1 to 2.8 kcal mol−1 on a hold-out test set of 71 tautomer pairs.
What should be noted here: the experimental values are relative solvation free energies, while we calculate relative gas phase free energies. To calculate correct tautomeric free energies in solution, solvent effects need to be included. In this work solvent effects are modeled by fitting the ANI QML parameters to experimental relative solvation free energies. The use of explicit solvent molecules is the preferable and recommended solution. The optimization of QML parameters on a small set of experimental free energies can be extended easily for explicit solvent simulations (in Table S.I.2† we show results for alchemical free energy calculations for 6 of the previously investigated tautomer systems in a water droplet).
Obtaining accurate free energy differences between tautomer pairs in solvent remains an elusive task. The subtle changes and typically small difference in internal energies between tautomer pairs require an accurate description of electronic structures. Furthermore, solvent effects have a substantial effect on tautomer ratios; consequently, a proper descriptor of solvation is essential. The change in double bond pattern typically also induce a change in the conformational degrees of freedom and, related, in the conformation and rotational entropy. But—despite all of these challenges—we remain optimistic that further developments in fast and accurate neural net potentials will enable improved and more robust protocols to use relative free energy calculations to address these issues.
Detailed methods
Experimental data
The full dataset considered for this study was obtained from the DataWarrior File deposited in https://github.com/WahlOya/Tautobase (commit of Jul 23, 2019), described in detail in ref. 9. The dataset was sourced from the tautomer codex authored by P. W. Kenny.34
From the dataset a subset of tautomer pairs were considered that
(1) were measured/calculated/estimated in aqueous solution
(2) had a numeric log K value between ±10
(3) had no charged species
(4) did not contain iodine
(5) only a single hydrogen and double bond change its position.
476 of the 1680 deposited tautomer pairs had these properties. We added two tautomer pairs from the SAMPL2 challenge (tautomer pair 2A_2B and 4A_4B).12 478 unique tautomer pairs were considered for further analysis. The term ‘unique’ tautomer pair was defined in the following as containing a unique combination of two molecules. We only consider tautomer pairs, not tautomer equilibria with multiple tautomer forms. In the following we will use an identifier containing the row number entry from the DataWarrier file to identify tautomer pairs in the dataset, e.g. tp_200 describing the tautomer pair (tp) at row number 200 in the original DataWarrior file.
The log K value was converted to free energies with ΔtGexpsolv = −RT ln K. The free energy difference of the tautomer pairs obtained from the Tautobase are subsequently referenced as ΔtGexpsolv in contrast to the calculated values which are called ΔtGcalc. While we call all values deposited in the Tautobase ΔtGexpsolv we want to point out that some of these values are estimated or calculated.
Unfortunately, experimental error estimates are not deposited in the Tautobase and subsequently also not modeled in this manuscript. This highlights the need for further experimental measurements of tautomer ratios.
A closer inspection of some of the outliers from preliminary calculations identified molecules with incorrect structures in the database (row entry: 1260, 1261, 1262, 1263, 1264, 514, 515, 516, 517, 1587)—these 10 tautomer pairs were subsequently removed from all QM calculations (simulations using ANI included the corrected tp_1260, tp_1261 and tp_1587). These structures are corrected in the current version of the Tautobase. Additionally, 8 tautomer pairs containing bromide (row entry: 989, 581, 582, 617, 618, 83, 952, 988) were removed from calculations performed with the basis set 6-31G(d) due to the lack of adequate parameters.
ANI-1 is parameterized on molecules containing only carbon, nitrogen, hydrogen and oxygen, making a further removal of tautomer pairs containing elements beside the aforementioned necessary.23 This resulted in 369 tautomer pairs.
The tautomer pair set used for relative alchemical free energy calculations needed one additional filter. Molecules with a stereobond that changes its position between tautomers had to be removed (this affected 15 tautomer pairs: tp_1637, tp_510, tp_513, tp_515, tp_517, tp_518, tp_787, tp_788, tp_789, tp_810, tp_811, tp_812, tp_865, tp_866, tp_867). Such stereobonds introduce additional complexity since it would be necessary to introduce restraints to define the stereochemistry during the lambda protocol.
The subset of the Tautobase used for the QM calculations can be obtained here as list of SMILES (468 tautomer pairs): https://github.com/choderalab/neutromeratio/blob/master/data/b3lyp_tautobase_subset.txt. The subset of the Tautobase used for the QML calculations can be found here as list of SMILES (354 tautomer pairs): https://github.com/choderalab/neutromeratio/blob/master/data/ani_tautobase_subset.txt. The distribution of the experimental tautomer free energies for both datasets is shown in Fig. 9.
Generating molecular conformations
The input tautomer pairs were specified as SMILES strings. 3D conformations were generated with the chemoinformatics toolkit RDKit (version 2019.09.2) which uses the distance geometry approach to generate conformations while enforcing chirality/stereochemistry44,45 For each molecule 20 conformations were initially generated. The number of conformations was reduced to 10 if the average root mean square deviation (RMSD) of atom coordinates of the 20 conformations was below 0.5 Å, and further reduced to 5 conformations if below 0.2 Å.
RMSD calculations and filtering of conformations
For each molecule, pairwise RMSD between conformations were calculated using RDKit. Starting with a random conformation, if the RMSD to any other conformation of the molecule was below 0.1 the conformation is discarded, otherwise added to the list of unique conformations. The RMSD was calculated between heavy atoms and the hydrogen of selected chemical moieties including primary alcohols, imines, primary/secondary amines, cyanamides and thiols.
Combining energies of conformations
Energies of different minimum conformations of the same molecule were weighted and combined using the following scheme
2 |
with N as the number of minimum conformations and G the free energy at the minimum conformation k. The obtained free energies will be called weighted free energies in the following.
Quantum mechanical calculations
The following quantum mechanical (QM) calculations were performed using the quantum chemical software orca 4.0.1.2.46 The universal solvation model based on solute electron density (SMD) was used as continuum solvation model.32
Geometric optimization, single point energy and frequency calculation
Geometric optimization was performed with the standard options of orca, redundant internal coordinates and the BFGS optimizer.27–29 Frequency calculations were performed with the numerical Hessian computed using the central differences approach. If a conformation had negative frequencies (imaginary modes) after the geometry optimization it was excluded from further analysis. Single point calculations were performed on the optimized geometries using B3LYP and the basis set aug-cc-pVTZ or 6-31G(d).30,31 A damping dispersion correction was applied (orca keyword D3BJ).47
Continuum solvation model
The continuum solvation model SMD was used to model the molecules in aqueous environment.32 Since there is a volume change in the standard state from the gas phase (1 atm) to the solvent phase the gas phase standard state is indicated by ‘*’ and the solvation standard state by ‘°’. The standard-state transfer free energy is then defined as
3 |
with ΔG*→° as standard-state adjustments (specifically, the correction of changing the volume from the gas phase to the solute phase with a constant value of 1.89 kcal mol−1), ΔGENP describes the electronic (E), nuclear (N) and polarization (P) components of the free energy and ΔGCDS free energy changes associated with solvent cavitation (C), changes in dispersion (D) and changes in local solvent structure (S).32
Free energy and free energy in solution calculations
Thermal corrections were computed at standard state (298.15 K and 1 atm pressure) using the ideal gas molecular partition function and the rigid-rotor harmonic oscillator (RRHO) approximation. Low-lying vibrational frequencies (below 15 cm−1) were treated by a free-rotor approximation48—this method is also sometimes called rigid-rotor quasi harmonic oscillator. The external (rotational) symmetry number was obtained from the point group of the tautomer using the point group module of Jmol and visual inspection and used to correct the rotational entropy calculated by orca.49
The Gibbs free energy in gas phase for a given coordinate set (k) was obtained by adding thermal corrections for conformer k at temperature T and zero point energy (ZPE) contributions εZPE,K to the electronic energy Ek.22 The degeneracy D describes the entropy contribution of internal rotors and is not added for the calculations shown in the main text (results including degeneracy D are shown in the ESI†).
4 |
The degeneracy D was estimated by calculating the graph automorphism of the molecule. The implementation of the VF2 algorithm for graph isomorphism of networkx was used.50 Nodes were defined to match if element and hybridization matched, edges were identical if bond order matched.
The tautomeric free energy difference in solution ΔtGcalcsolv can be calculated from the standard-state Gibbs free energy in aqueous phase of the product and educt of the corresponding tautomer reaction, which itself is calculated as the sum of the gas-phase standard-state free energy and the standard-state transfer free energy expressed as
5 |
for a given conformation k and shown as a thermodynamic cycle in Fig. 1.
An alternative way to calculate the free energy in aqueous phase used in the manuscript is
6 |
where ψsol is the polarized wave function in solution, Hg the gas phase Hamiltonian, and V the potential energy operator associated with the reaction field. The bracket term describes the electronic energy, while GNES is associated with non-electrostatic contributions (dispersion–repulsion and solvent structural terms) to the solvation energy and GT,K are the thermal correction calculated directly in the continuum solvation model.51
ASE thermochemistry corrections
ANI-1ccx was used to calculate the electronic energy. The conformations were minimized using the BFGS optimizer as implemented in scipy.52 Frequency and thermochemistry calculations were performed using the optimized geometry. Thermal corrections were calculated at 300 K and 1 atm using the IG-RRHO approximation as implemented in the atomic simulation environment (ase).53 The tautomeric free energy difference in gas phase ΔtGvac was then calculated as the difference between of the tautomer pair.
Relative alchemical free energy calculations
Relative alchemical free energies were calculated using a single topology approach. The topology of each tautomer pair only differed in the position of a single hydrogen (atom types and bonds were not specified). The hybrid topology (the superset of the two topologies) differed therefore by one hydrogen from each of the physical endstates.
By default, the coordinates of the hybrid topology were generated by using the coordinates of ‘Tautomer1’ (as defined in the Tautobase database). If a tautomer isomerism created or removed a cis/trans stereobond, the initial coordinates were taken from the topology with the stereobond present (therefore sometimes changing the direction of the tautomer reaction).
The coordinates of the added, non-interacting hydrogen were obtained by randomly sampling 100 positions on the surface of a sphere (with radius of 1.02 Å) defined around its new bonded heavy atom and subsequently using the lowest energy position as the starting conformation for each lambda window for the free energy calculation. The physical endstates (representing the two tautomer states, each with an additional non-interacting (dummy) hydrogen) were connected via 11 equidistant intermediate (lambda) states.
Energy and forces were calculated using ANI1-ccx as implemented in torchani https://github.com/aiqm/torchani). The energy and force was linearly scaled along the alchemical path as a function of lambda with
E = (1 − λ)E1 + λE2 | 7 |
with E1 and E2 representing the potential energy at the physcial endstates. Before each simulation, initial coordinates were minimized using a BFGS optimizer as implemented in scipy.52 Coordinates were sampled using Langevin dynamics at 300 K with a collision rate of 10 ps−1 and a 0.5 fs time step using the BAOAB integrator.54 Initial velocities were obtained from a Maxwell–Boltzmann distribution at the simulation temperature.
Because nuclei can rearrange to form distinct chemical species in highly perturbed simulations, we applied a flat-bottom harmonic restraint to covalent bonds to ensure we sampled the desired chemical species in initial and final states of the free energy calculation. The restraint was defined as
8 |
with H as the Heaviside step function, Δ(ri,j,r0i,j) as the difference between the reference bond length r0i,j and the current bond length ri,j and rfb as half of the well radius. For all heavy atom pairs r0i,j was set to 1.3 Å and rfb to 0.3 Å with ki,j set to kBT/0.1 Å. For C–H/O–H/N–H bond pairs r0i,j was set to 1.02 Å (the average of the three different equilibrium bond length of C–H/O–H/N–H bond pairs) and rfb to 0.4 Å with ki,j set to kBT/0.2 Å. The restraint well was chosen so that the restraint does not interfere with normal bond stretching but will activate once a bond is broken.
Samples were obtained from 200 ps simulations for each lambda state. For each tautomer pair calculations were repeated 5 times with randomly seeded initial velocities (and coordinates). Relative alchemical free energies ΔGcalcvac were calculated using MBAR as implemented in the pymbar package.43 300 uncorrelated snapshots were considered for the MBAR analysis from each lambda state.
Neural net parameter optimization based on experimental relative solvation free energies
The tautomer data set was randomly split (20 : 20 : 60) into a test set (71), validation set (71) and training set (212 tautomer pairs). Neural net parameters were optimized using a routine modified from the TorchANI tutorial.¶ To limit the capacity to overfit, only the weights and biases of the final layer of each of the 8 pretrained ANI-1ccx models were optimized for each of the atom nets (one net per element), resulting in roughly 8 × 4 × 97 tunable parameters (8 neural nets, each with 4 atom nets containing 97 weights and bias) for ANI-1ccx. As in the TorchANI tutorial, the weight matrices were updated using the Adam optimizer with decoupled weight decay (AdamW), and the bias vectors were updated using Stochastic Gradient Descent (SGD). The training data was randomly partitioned in each epoch in mini-batches of 10 tautomer pairs and gradient updates were performed for each mini-batch. Training was performed for 400 epochs. The best model was chosen based on the RMSE on the validation set and model performance reported on the test set.
The model was trained by minimizing the mean squared error (MSE) loss between calculated and experimental relative free energies. If regularization was used, the mean absolute error (MAE) between the energy for the parameter set θ* and the original parameter set θ was calculated on the individual snapshots used for the free energy calculation (11 × 300 snapshots) with the potential energy function at λ = 0 and λ = 1. The regularization term was normalized using the number of atoms of the tautomer system. The per molecule pair (m) loss function l is defined as
9 |
with ΔGexpsolv,m as the experimental and as the calculated tautomeric free energy differences for tautomer pair m using parameters θ*. The two scaling factors f(epoch) and g(epoch) were used to control the contribution of the two terms as a function of training epoch. For the final results the values for g (labeled ‘scaling dG’) and f (labeled ‘scaling dE’) is shown in Fig. S.I.9.†
The overall loss is then
10 |
The perturbed relative free energy ΔG(θ*)calcvac,m required for computing l(m; θ*) is calculated by importance sampling, or “reweighting” the original MBAR estimate from the original pre-trained parameters θ to the current parameters θ*. To compute this estimate efficiently at arbitrary θ*, we first collect configuration samples at a reference value θ (corresponding to the original parameters of the pretrained ANI-1ccx model) for each intermediate value λ. For each configuration sample x, we compute the reduced potential u(x, λ; θ), to form the N × M matrix of inputs to MBAR (where N is the total number of snapshots, M is number of λ windows). MBAR equations are solved to yield a vector of reduced free energies , where m indexes the intermediate λ values. The relative free energy prediction implied by the model parameters θ* is then .
To compute relative free energies at a new value of the parameters θ*, we need to compute u(x, λ = 1; θ*) and u(x, λ = 0; θ*) for all configurations x. The optimization routine evaluates the gradient of the loss function L w.r.t. θ* by automatic differentiation and updates the parameters.
300 uncorrelated snapshots per λ state were used for the MBAR estimate and importance sampling for the vacuum simulations.
Disclosures
JDC is a current member of the Scientific Advisory Board of OpenEye Scientific Software, Redesign Science, and Interline Therapeutics, and holds equity interests in Redesign Science and Interline Therapeutics. The Chodera laboratory receives or has received funding from multiple sources, including the National Institutes of Health, the National Science Foundation, the Parker Institute for Cancer Immunotherapy, Relay Therapeutics, Entasis Therapeutics, Silicon Therapeutics, EMD Serono (Merck KGaA), AstraZeneca, Vir Biotechnology, Bayer, XtalPi, Foresite Laboratories, the Molecular Sciences Software Institute, the Starr Cancer Consortium, the Open Force Field Consortium, Cycle for Survival, a Louis V. Gerstner Young Investigator Award, and the Sloan Kettering Institute. A complete funding history for the Chodera lab can be found at http://choderalab.org/funding.
Funding
JF acknowledges support from NSF CHE-1738979 and the Sloan Kettering Institute. MW acknowledges support from a FWF Erwin Schrödinger Postdoctoral Fellowship J 4245-N28. JDC acknowledges support from NIH grant P30 CA008748, NIH grant R01 GM121505, NIH grant R01 GM132386, and the Sloan Kettering Institute.
Data availability
• Python package used in this work (release v0.2): https://github.com/choderalab/neutromeratio
• Data and notebooks to reproduce the plots/figures (release v0.2): https://zenodo.org/record/4562426
Author contributions
Conceptualization: JDC, JF, and MW; methodology: JDC, JF, and MW; software: JF, and MW; investigation: JF, and MW; writing – original draft: JDC, JF, and MW; writing – review & editing: JDC, JF, and MW; funding acquisition: JDC and MW; resources: JDC and MW; supervision: JDC and MW.
Conflicts of interest
There are no conflicts to declare.
Supplementary Material
Acknowledgments
MW, JF and JDC are grateful for discussions from the Tautomer Consortium, specifically Paul Czodrowski, Brian Radak, Woody Sherman, David Mobley, Christopher Bayly and Stefan Kast as well as input from Adrian Roitberg and Olexandr Isayev. This work was only possible through the time and effort Thomas Sander and Oya Wahl invested in curating the open tautomer database (Tautobase). Further, MW is grateful for the support of Thierry Langer, who donated significant computational resources to perform much of the calculations/simulations and Oliver Wieder, for helpful discussions.
Electronic supplementary information (ESI) available. See DOI: 10.1039/d1sc01185e
Footnotes
References
- Kapetanović I., Drug Discovery and Development: Present and Future, IntechOpen, 2011 [Google Scholar]
- Bax B. Chung C. W. Edge C. Getting the chemistry right: protonation, tautomers and the importance of H atoms in biological chemistry. Acta Crystallogr., Sect. D: Struct. Biol. 2017;73(2):131–140. doi: 10.1107/S2059798316020283. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Sitzmann M. Ihlenfeldt W. D. Nicklaus M. C. Tautomerism in large databases. J. Comput.-Aided Mol. Des. 2010;24(6–7):521–551. doi: 10.1007/s10822-010-9346-4. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Katritzky A. R. Dennis Hall C. El-Gendy B. E. D. M. Draghici B. Tautomerism in drug discovery. J. Comput.-Aided Mol. Des. 2010;24(6–7):475–484. doi: 10.1007/s10822-010-9359-z. [DOI] [PubMed] [Google Scholar]
- Martin Y. C. Let's not forget tautomers. J. Comput.-Aided Mol. Des. 2009;23(10):693–704. doi: 10.1007/s10822-009-9303-2. doi: 10.1007/s10822-009-9303-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Sayle R. A. So you think you understand tautomerism? J. Comput.-Aided Mol. Des. 2010;24(6–7):485–496. doi: 10.1007/s10822-010-9329-5. [DOI] [PubMed] [Google Scholar]
- Hejazi S. Osman O. Alyoubi A. Aziz S. Hilal R. The Thermodynamic and Kinetic Properties of 2-Hydroxypyridine/2-Pyridone Tautomerization: A Theoretical and Computational Revisit. Int. J. Mol. Sci. 2016;17(11):1893. doi: 10.3390/ijms17111893. doi: 10.3390/ijms17111893. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Taylor P. J. and Antonov L., “Triage” for Tautomers: The Choice between Experiment and Computation, in Tautomerism, Wiley-VCH Verlag GmbH & Co. KGaA, Weinheim, Germany, 2016, pp. 11–34, http://doi.wiley.com/10.1002/9783527695713.ch2, 10.1002/9783527695713.ch2 [DOI] [Google Scholar]
- Wahl O. Sander T. Tautobase: An Open Tautomer Database. J. Chem. Inf. Model. 2020;60(3):1085–1089. doi: 10.1021/acs.jcim.0c00035. doi: 10.1021/acs.jcim.0c00035. [DOI] [PubMed] [Google Scholar]
- Dhaked D. K. Guasch L. Nicklaus M. C. Tautomer Database: A Comprehensive Resource for Tautomerism Analyses. J. Chem. Inf. Model. 2020;60(3):1090–1100. doi: 10.1021/acs.jcim.9b01156. doi: 10.1021/acs.jcim.9b01156. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Pospisil P. Ballmer P. Scapozza L. Folkers G. Tautomerism in Computer-Aided Drug Design. J. Recept. Signal Transduction. 2003;23(4):361–371. doi: 10.1081/RRS-120026975. doi: 10.1081/RRS-120026975. [DOI] [PubMed] [Google Scholar]
- Geballe M. T. Geoffrey Skillman A. Nicholls A. Peter Guthrie J. Taylor P. J. The SAMPL2 blind prediction challenge: introduction and overview. J. Comput.-Aided Mol. Des. 2010;24(4):259–279. doi: 10.1007/s10822-010-9350-8. [DOI] [PubMed] [Google Scholar]
- Martin Y. C. Overview of the perspectives devoted to tautomerism in molecular design. J. Comput.-Aided Mol. Des. 2010;24(6–7):473–474. doi: 10.1007/s10822-010-9357-1. [DOI] [PubMed] [Google Scholar]
- Kast S. M. Heil J. Güssregen S. Schmidt K. F. Prediction of tautomer ratios by embedded-cluster integral equation theory. J. Comput.-Aided Mol. Des. 2010;24(4):343–353. doi: 10.1007/s10822-010-9340-x. doi: 10.1007/s10822-010-9340-x. [DOI] [PubMed] [Google Scholar]
- Ribeiro R. F. Marenich A. V. Cramer C. J. Truhlar D. G. Prediction of SAMPL2 aqueous solvation free energies and tautomeric ratios using the SM8, SM8AD, and SMD solvation models. J. Comput.-Aided Mol. Des. 2010;24(4):317–333. doi: 10.1007/s10822-010-9333-9. [DOI] [PubMed] [Google Scholar]
- Klamt A. Diedenhofen M. Some conclusions regarding the predictions of tautomeric equilibria in solution based on the SAMPL2 challenge. J. Comput.-Aided Mol. Des. 2010;24(6–7):621–625. doi: 10.1007/s10822-010-9332-x. [DOI] [PubMed] [Google Scholar]
- Nagy P. Theoretical Calculations on the Conformational/Tautomeric Equilibria for Small Molecules in Solution. Biochem. Pharmacol.: Open Access. 2014;03(02):1–23. doi: 10.4172/2167-0501.s4-001. [DOI] [Google Scholar]; , http://www.omicsgroup.org/journals/theoretical-calculations-on-the-conformationaltautomeric-equilibria-for-small-molecules-in-solution-2167-0501.S4-001.php?aid=12401
- Irikura K. K.. Computational Thermochemistry, ed. K. K. Irikura and D. J. Frurip, American Chemical Society, Washington, DC, 1998, vol. 677 of ACS Symposium Series, https://pubs.acs.org/doi/book/10.1021/bk-1998-0677, 10.1021/bk-1998-0677 [DOI] [Google Scholar]
- Zhou H. X. Gilson M. K. Theory of Free Energy and Entropy in Noncovalent Binding. Chem. Rev. 2009;109(9):4092–4107. doi: 10.1021/cr800551w. doi: 10.1021/cr800551w. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Lin C. Y. Izgorodina E. I. Coote M. L. How Accurate Are Approximate Methods for Evaluating Partition Functions for Hindered Internal Rotations? J. Phys. Chem. A. 2008;112(9):1956–1964. doi: 10.1021/jp710341h. [DOI] [PubMed] [Google Scholar]
- Chang C. E. A. Chen W. Gilson M. K. Ligand configurational entropy and protein binding. Proc. Natl. Acad. Sci. U. S. A. 2007;104(5):1534–1539. doi: 10.1073/pnas.0610494104. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Marenich A. V. Ho J. Coote M. L. Cramer C. J. Truhlar D. G. Computational electrochemistry: prediction of liquid-phase reduction potentials. Phys. Chem. Chem. Phys. 2014;16(29):15068–15106. doi: 10.1039/C4CP01572J. [DOI] [PubMed] [Google Scholar]
- Smith J. S. Isayev O. Roitberg A. E. ANI-1: an extensible neural network potential with DFT accuracy at force field computational cost. Chem. Sci. 2017;8(4):3192–3203. doi: 10.1039/C6SC05720A. doi: 10.1039/C6SC05720A. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Unke O. T. Meuwly M. PhysNet: A Neural Network for Predicting Energies, Forces, Dipole Moments, and Partial Charges. J. Chem. Theory Comput. 2019;15(6):3678–3693. doi: 10.1021/acs.jctc.9b00181. [DOI] [PubMed] [Google Scholar]
- Schütt K. T. Sauceda H. E. Kindermans P. J. Tkatchenko A. Müller K. R. SchNet - A deep learning architecture for molecules and materials. J. Chem. Phys. 2018;148(24):241722. doi: 10.1063/1.5019779. doi: 10.1063/1.5019779. [DOI] [PubMed] [Google Scholar]
- Dral P. O. Quantum Chemistry in the Age of Machine Learning. J. Phys. Chem. Lett. 2020 mar;11(6):2336–2347. doi: 10.1021/acs.jpclett.9b03664. [DOI] [PubMed] [Google Scholar]
- Becke A. D. Density-functional exchange-energy approximation with correct asymptotic behavior. Phys. Rev. A: At., Mol., Opt. Phys. 1988 sep;38(6):3098–3100. doi: 10.1103/PhysRevA.38.3098. [DOI] [PubMed] [Google Scholar]
- Lee C. Yang W. Parr R. G. Development of the Colle-Salvetti correlation-energy formula into a functional of the electron density. Phys. Rev. B: Condens. Matter Mater. Phys. 1988;37(2):785–789. doi: 10.1103/PhysRevB.37.785. doi: 10.1103/PhysRevB.37.785. [DOI] [PubMed] [Google Scholar]
- Kendall R. A. Dunning T. H. Harrison R. J. Electron affinities of the first-row atoms revisited. Systematic basis sets and wave functions. J. Chem. Phys. 1992;96(9):6796–6806. doi: 10.1063/1.462569. doi: 10.1063/1.462569. [DOI] [Google Scholar]
- Hehre W. J. Ditchfield R. Pople J. A. Self—Consistent Molecular Orbital Methods. XII. Further Extensions of Gaussian—Type Basis Sets for Use in Molecular Orbital Studies of Organic Molecules Published by the AIP Publishing Articles you may be interested in Self - consistent molecular or. J. Chem. Phys. 1972;56(5):2257–2261. doi: 10.1063/1.1677527. [DOI] [Google Scholar]
- Francl M. M. Pietro W. J. Hehre W. J. Binkley J. S. Gordon M. S. DeFrees D. J. Pople J. A. Self-consistent molecular orbital methods. XXIII. A polarization-type basis set for second-row elements. J. Chem. Phys. 1982;77(7):3654–3665. doi: 10.1063/1.444267. doi: 10.1063/1.444267. [DOI] [Google Scholar]
- Marenich A. V. Cramer C. J. Truhlar D. G. Universal Solvation Model Based on Solute Electron Density and on a Continuum Model of the Solvent Defined by the Bulk Dielectric Constant and Atomic Surface Tensions. J. Phys. Chem. B. 2009;113(18):6378–6396. doi: 10.1021/jp810292n. [DOI] [PubMed] [Google Scholar]
- Ho J. Are thermodynamic cycles necessary for continuum solvent calculation of pKas and reduction potentials? Phys. Chem. Chem. Phys. 2015;17(4):2859–2868. doi: 10.1039/C4CP04538F. [DOI] [PubMed] [Google Scholar]
- Kenny P., The Prediction of Tautomer Preference in Aqueous Solution (Version 1.0), 2019, 7, https://figshare.com/articles/preprint/The_Prediction_of_Tautomer_Preference_in_Aqueous_Solution_Version_1_0_/8966276, 10.6084/m9.figshare.8966276.v1 [DOI] [Google Scholar]
- Soteras I. Orozco M. Luque F. J. Performance of the IEF-MST solvation continuum model in the SAMPL2 blind test prediction of hydration and tautomerization free energies. J. Comput.-Aided Mol. Des. 2010;24(4):281–291. doi: 10.1007/s10822-010-9331-y. doi: 10.1007/s10822-010-9331-y. [DOI] [PubMed] [Google Scholar]
- Tielker N. Eberlein L. Hessler G. Schmidt K. F. Güssregen S. Kast S. M. Quantum–mechanical property prediction of solvated drug molecules: what have we learned from a decade of SAMPL blind prediction challenges? J. Comput.-Aided Mol. Des. 2020:0123456789. doi: 10.1007/s10822-020-00347-5. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Schlund S. Basílio Janke E. M. Weisz K. Engels B. Predicting the tautomeric equilibrium of acetylacetone in solution. I. The right answer for the wrong reason? J. Comput. Chem. 2010;31(4):665–670. doi: 10.1002/jcc.21354. [DOI] [PubMed] [Google Scholar]
- Nicholls A. Wlodek S. Grant J. A. The SAMP1 Solvation Challenge: Further Lessons Regarding the Pitfalls of Parametrization. J. Phys. Chem. B. 2009 Apr;113(14):4521–4532. doi: 10.1021/jp806855q. [DOI] [PubMed] [Google Scholar]
- Rufa D. A. Bruce Macdonald H. E. Fass J. Wieder M. Grinaway P. B. Roitberg A. E. Isayev O. Chodera J. D. Towards chemical accuracy for alchemical free energy calculations with hybrid physics-based machine learning/molecular mechanics potentials. bioRxiv. 2020 doi: 10.1101/2020.07.29.227959. [DOI] [Google Scholar]
- Lahey S. L. J. Rowley C. N. Simulating protein-ligand binding with neural network potentials. Chem. Sci. 2020;11(9):2362–2368. doi: 10.1039/c9sc06017k. doi: 10.1039/c9sc06017k. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Smith J. S. Nebgen B. T. Zubatyuk R. Lubbers N. Devereux C. Barros K. Tretiak S. Isayev O. Roitberg A. E. Approaching coupled cluster accuracy with a general-purpose neural network potential through transfer learning. Nat. Commun. 2019;10(1):1–8. doi: 10.1038/s41467-019-10827-4. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Karton A. Thermochemistry of Guanine Tautomers Re-Examined by Means of High-Level CCSD(T) Composite Ab Initio Methods. Aust. J. Chem. 2019;72(8):607–613. doi: 10.1071/CH19276. doi: 10.1071/CH19276. [DOI] [Google Scholar]
- Shirts M. R. Chodera J. D. Statistically optimal analysis of samples from multiple equilibrium states. J. Chem. Phys. 2008;129(12):124105. doi: 10.1063/1.2978177. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Ebejer J. P. Morris G. M. Deane C. M. Freely available conformer generation methods: How good are they? J. Chem. Inf. Model. 2012;52(5):1146–1158. doi: 10.1021/ci2004658. doi: 10.1021/ci2004658. [DOI] [PubMed] [Google Scholar]
- Havel T. F., Distance Geometry: Theory, Algorithms, and Chemical Applications, Encyclopedia of Computational Chemistry, 2002 [Google Scholar]
- Neese F. The ORCA program system. Wiley Interdiscip. Rev.: Comput. Mol. Sci. 2012;2(1):73–78. [Google Scholar]
- Grimme S. Antony J. Ehrlich S. Krieg H. A consistent and accurate ab initio parametrization of density functional dispersion correction (DFT-D) for the 94 elements H-Pu. J. Chem. Phys. 2010;132(15) doi: 10.1063/1.3382344. doi: 10.1063/1.3382344. [DOI] [PubMed] [Google Scholar]
- Grimme S. Supramolecular binding thermodynamics by dispersion-corrected density functional theory. Chem.–Eur. J. 2012;18(32):9955–9964. doi: 10.1002/chem.201200497. doi: 10.1002/chem.201200497. [DOI] [PubMed] [Google Scholar]
- Jmol: an open-source Java viewer for chemical structures in 3D, accessed 10-10-2020, http://www.jmol.org/
- Hagberg A., Swart P., and Chult D. S., Exploring Network Structure, Dynamics, and Function using NetworkX, in Proceedings of the 7th Python in Science Conference, ed. G. Varoquaux, T. Vaught and J. Millman, Pasadena, CA, USA, 2008, pp. 11–15 [Google Scholar]
- Ho J. Ertem M. Z. Calculating Free Energy Changes in Continuum Solvation Models. J. Phys. Chem. B. 2016;120(7):1319–1329. doi: 10.1021/acs.jpcb.6b00164. doi: 10.1021/acs.jpcb.6b00164. [DOI] [PubMed] [Google Scholar]
- Virtanen P. Gommers R. Oliphant T. E. Haberland M. Reddy T. Cournapeau D. Burovski E. Peterson P. Weckesser W. Bright J. van der Walt S. J. Brett M. Wilson J. Millman K. J. Mayorov N. Nelson A. R. J. Jones E. Kern R. Larson E. Carey C. J. et al., SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nat. Methods. 2020;17:261–272. doi: 10.1038/s41592-019-0686-2. doi: 10.1038/s41592-019-0686-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Larsen A. H. Mortensen J. J. Blomqvist J. Castelli I. E. Christensen R. Dułak M. Friis J. Groves M. N. Hammer B. Hargus C. Hermes E. D. Jennings P. C. Jensen P. B. Kermode J. Kitchin J. R. Kolsbjerg E. L. Kubal J. Kaasbjerg K. Lysgaard S. Maronsson J. B. et al., The atomic simulation environment—a Python library for working with atoms. J. Phys.: Condens. Matter. 2017;29(27):273002. doi: 10.1088/1361-648X/aa680e. [DOI] [PubMed] [Google Scholar]
- Leimkuhler B. and Matthews C., Molecular Dynamics: With Deterministic and Stochastic Numerical Methods, Springer, 2015 [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
• Python package used in this work (release v0.2): https://github.com/choderalab/neutromeratio
• Data and notebooks to reproduce the plots/figures (release v0.2): https://zenodo.org/record/4562426