Umbrella Sampling of Na+ in an Ion Channel
As described in
ref. 22, a total of 153 umbrella windows with a uniform spacing of 0.5 Å were employed to determine the free energy for passage of a Na
+ ion through the transmembrane pore of the GLIC channel.
22 In each window an umbrella potential with a spring constant of 10 kcal/mol/Å
2 was applied on the
z -coordinate of the Na
+ ion along the membrane normal direction, and a lateral restraint on the
xy plane was applied to confine the ion in the bulk region.
22 For the present study, we performed new calculations in which we implemented Hamiltonian replica exchange
20 between neighboring windows. Here we analyze data from a set of trial MD simulations of 1 ns in each window. We construct histograms with a uniform bin width of 0.02 Å for each of the 1-ns trajectories as the input for the WHAM calculation. We note that the resulting free energy has a considerable entropic component, due to a significant variation in the lateral area accessible to the ion at different
z positions. The mean squared deviation of the ion in the
xy plane from the axis varies from ~0.6 Å
2 at the narrowest portion of the pore to ~28 Å
2 in the bulk region.
We first compare the performance of the superlinear (trust region and BFGS) algorithms and the traditional direct iteration method in solving the WHAM equations. In all methods the iterations start with given initial values of the probabilities {
pl} or the normalization factors {
fi}. Although it is common practice to assign a constant initial value to all {
pl} or {
fi}, it was shown that using more accurate estimates of the free energy as initial values can significantly speed up the convergence in the direct iteration method.
23 In fact, approximate {
fi} or {
gi} can be calculated by integrating the gradients, or the mean restraining forces (
Eqs. 24,
31). Here we test each method, first for constant initial values, and then by using the coarse-grained profile determined from the mean forces. In our implementation of the direct iteration method, the convergence is deemed achieved when the relative change in {
pl} for any
l by a WHAM iteration is smaller than a given threshold δ. We test each case with a larger (10
−3) and a smaller (10
−6) δ value.
As shown in , the trust region and BFGS numerical algorithms yield more accurate results than the traditional direct iteration method, indicated by smaller values of the target function A. In fact, the direct iteration method with a convergence threshold of δ = 10−3 leads to a rather inaccurate free energy profile (, blue dashed curve), with an error of more than 2 kBT, when starting with uniform initial values. When the gradient-based estimates of the {fi} are used as initial values, the direct iteration method indeed converges faster, with the threshold of δ = 10−3 almost satisfied already at the start of the iterations. To achieve better accuracy with a more stringent threshold of δ = 10−6, however, a large number of iterations is still required, taking a computational time at least an order of magnitude longer than the trust region and BFGS methods. The example also demonstrates that apparently small variations between WHAM iterations, on the order of δ, do not necessarily mean that convergence at that level of accuracy has been achieved. At the end of the WHAM iterations in our test, the free energies change by less than 10−6 kBT in a single iteration, although their absolute errors are still on the order of 0.01 kBT, implying that to gain one more significant digit in the result, one needs to perform thousands of iterations. In contrast, the convergence rate of superlinear algorithms increases when approaching the final solution; in our case only ~500 more equivalent iterations are required in the trust region method when the termination tolerance is decreased from 10−6 to ~2×10−16 (the minimum relative change that can be represented by a double-precision floating-point number).
| Table 1Performance benchmarks for the direct iteration, trust region, and BFGS numerical algorithms. Each algorithm was tested with two sets of initial values, from a uniform assignment or from a gradient-based estimation of the free energy (Eqs. 24 and 31), (more ...) |
The results of the free energy calculation are shown in . The coarse-grained free energy profile (
red curve, ) obtained by integrating the mean forces (
Eq. 31) indeed closely overlaps with that (
blue solid curve, ) obtained by solving the WHAM equations. The statistical uncertainties in the average position

() are largest in the region between
x =−20 Å and
x =0 Å, which is actually the narrow part of the channel where the ion is coupled to the motions of the protein side chains. The flat baselines at the two ends of the free energy curves () represent the bulk water regions at the two sides of the channel, respectively. Although the MD simulations were performed under 3D periodic boundary conditions, the umbrella windows do not span the entire length of the unit cell and the windows at the two ends are still too far from each other to have an overlap across the periodic boundary. Nonetheless, in the absence of a membrane potential, the two levels at both ends of the ideal PMF should match, although in a calculated PMF they may not match exactly due to the statistical errors in the finite sampling. Overall, the calculated statistical errors of the free energy shown in appear to be reasonable, and offer a faithful estimate of the uncertainty in the baseline difference. However, as the true free energy profile is not known in this case, we could not thoroughly calibrate the errors. To systematically examine the validity of our error estimation method, in the following we design a model potential that allows us to obtain the absolute errors of the calculation.
Umbrella Sampling of a Model Potential with Hysteresis
As illustrated in and discussed earlier, when the reaction coordinate
x is fixed at a given value, a multidimensional system may still populate different metastable states separated by high barriers in directions orthogonal to
x. Insufficient sampling of the relevant orthogonal coordinates (or “solvent degrees of freedom”) may give rise to systematic errors in the obtained free energy and result in hysteresis. Here, we reduce the problem further and assume fast relaxation in the orthogonal degrees of freedom (
y) in each well of , but slow transitions between the wells. Analogous to the Marcus theory of electron transfer, we can then collapse motion in
y and treat the problem as a transition between two one-dimensional surfaces, as shown in . In addition to the continuous dimensionless reaction coordinate
x, our model includes an orthogonal
y coordinate, which takes discrete values of 1 or 2, representing two metastable states with different potentials
Ei(
x):
For simplicity, we use harmonic potentials
in which
a1 =−4 and
a2 =4. The free energy as a function of
x is then
as shown in .
To sample the free energy, we carried out MC simulations in a total of 21 umbrella windows, covering the range from r0 =−5 to r20 =5 with a uniform spacing of Δr=0.5. In each simulation, an umbrella potential with a spring constant of K =17 kBT was applied. At every MC step we made a random choice for either a y -move with a probability of 10−4, or otherwise an x -move. In an attempted y -move, the y -coordinate is switched to the alternative value (i.e., from 1 to 2 or vice versa). In an attempted x -move, the x -coordinate is moved by a random displacement from a uniform distribution in [−0.24, 0.24]. In either case the energy at the new coordinates is calculated, and the move is accepted or rejected according to the Metropolis criterion. The center, or reference position, of each window was used as the initial x -coordinate for the corresponding simulation. The initial y -coordinate was set to 1 for the first 12 windows (at r0 =−5 to r11 =0.5), and to 2 for the remaining 9 windows (at r12 =1 to r20 =5).
In , we examine the WHAM results and the error estimation from simulation data of various lengths measured by the number of MC steps. We construct histograms with a uniform bin width of 0.05 for the individual simulations, and then solve the WHAM equations by the minimization technique described in Methods. The resulting coarse-grained free energy profiles
Gr(
x) (
red curves, ), calculated by integrating the local gradients (
Eq. 31), closely match the WHAM results
G(
x) (
blue curves, ). Therefore, we expect that the errors in
G(
x) can be determined from the errors in the mean
x -coordinate

in each simulation window, as described in Methods.
For short simulations (
N =10,000), we find large systematic deviations in the free energy, and significantly underestimated statistical errors. The reason for the deviations is that in these short simulations the
y -coordinate typically remains unchanged and undergoes no transition to the alternative state during the entire simulation. This lack of equilibration gives rise to particularly large errors in the windows at
r10 =0, with equal expected probabilities of the two states with
y =1 and 2, and at
r11=0.5, which sampled a different state (
y =1) than the expected most probable state (
y =2) because of the biased initial condition. Consequently both the barrier height and the relative difference between the two local minima deviate considerably from those in the true free energy profile (
green curve, ). As a result of the inadequate statistics in
y, the errors

in

are significantly underestimated for the two windows, which in turn leads to an underestimation of the errors in the free energy (,
N =10,000).
In principle, the discontinuity in y can be identified by a direct examination of the y -coordinate in neighboring windows. In practice, however, this is not always possible in simulations of complex biomolecular systems with an enormous number of degrees of freedom, in which the states with slow transitions in the orthogonal subspace can probably only be described by collective order parameters. In such cases, the inconsistency coefficient, obtained from the reaction coordinate x, can still be readily used to detect the problem. For example, in (N =10,000), the inconsistency coefficient θ for the two problematic windows at r11 =0.5 and r12 =1 is found to be abnormally high, indicating that the two corresponding simulations were not sampling a common unbiased distribution of x. Indeed, the y -coordinate in these two simulations stays at 1 and 2, respectively, thus resulting in the sampling of different potential surfaces.
As the simulations were extended to
N =100,000 and
N =1,000,000, multiple transitions of the
y -coordinate occur in the windows near
r10 =0. As a result, the autocorrelation functions of
x decay slowly, and the block averaging method properly reports the large statistical uncertainty of

in these windows, as shown in . Consequently, the estimated statistical error in the calculated free energy () is now consistent with the actual absolute errors. The large variances in

for the windows near
r10 =0 result in small and more reasonable values of
Ni, the effective numbers of independent samples (
Eq. 37) in these simulations. When these proper
Ni values are used, the inconsistency coefficient θ (
Eq. 40) for the two windows
r11 =0.5 and
r12 =1 is no longer high (), indicating that the discrepancy between the two histograms is not abnormally large in comparison to expectations. Indeed, the infrequent transitions in the
y -coordinate are already reflected in the estimated variances of

, and are thus accounted for in the error estimation of the free energy.
As shown in , the errors in the observed histograms are also reflected in the consistency with respect to the consensus histograms. Insufficient sampling of the orthogonal coordinate in an umbrella window usually results in higher values of the relative entropy (η) in this window and in its neighboring windows. For example, for N =10,000, as mentioned earlier, major inconsistencies occur near r11 =0.5 and r12 =1, and the η values are indeed higher in the corresponding windows. For N =100,000 and N =1,000,000, relatively large η values occur near the central window at r10 =0 which bears the largest uncertainty. Overall, the η values decrease with longer simulation length N, indicating improved consistency with more extensive sampling. We note that for a system characterized by two local minima on the energy surface that are partially overlapping in projection, the resulting free energy will typically feature a barrier at an intermediate location. In this barrier region, the sampling is more challenging because this intermediate region tends to be of high energy relative to the minima even within one well and, more seriously, both minima need to be visited with the correct proportionality. Consequently, for such systems the barrier region generally bears larger uncertainty in the free energy calculation, consistent with the results for our model system here.
To further test the quality of the error estimation, we repeated the simulations 100 times with identical initial coordinates as described above and different random seeds. When the sampling size
N is relatively small, the results are biased by the particular initial condition and the systematic error in the free energy is significant due to hysteresis. As shown in , in this case the estimated errors are smaller than the absolute errors with respect to the exact free energy. When
N becomes larger, however, the systematic error arising from a particular initial condition becomes insignificant in comparison to the statistical error, and the latter becomes the main contributor to the actual error. When
N is large enough so that all umbrella windows get well equilibrated, the statistical errors obtained from
Eq. (32) indeed offer a faithful estimate for the absolute errors, as shown in . The results here further confirm that an accurate estimate of the errors is only possible after sufficient equilibrations (i.e., in the asymptotic limit, where statistical errors dominate).