Next: Alchemical Free Energy Methods1 Up: Collective Variable-based Calculations1 Previous: Declaring and using collective   Contents   Index

Subsections

Biasing and analysis methods

All of the biasing and analysis methods implemented (abf, harmonic, histogram and metadynamics) recognize the following options:

• name (colvar bias) Identifier for the bias
Acceptable Values: string
Default Value: type of biasbias index
Description: This string is used to identify the bias or analysis method in output messages and to name some output files.

• colvars (colvar bias) Collective variables involved
Acceptable Values: space-separated list of colvar names
Description: This option selects by name all the colvars to which this bias or analysis will be applied.

Adaptive Biasing Force calculations

For a full description of the Adaptive Biasing Force method, see reference [18]. For details about this implementation, see references [28] and [29]. When publishing research that makes use of this functionality, please cite references [18] and [29].

An alternate usage of this feature is the application of custom tabulated biasing potentials to one or more colvars. See inputPrefix and updateBias below.

ABF is based on the thermodynamic integration (TI) scheme for computing free energy profiles. The free energy as a function of a set of collective variables is defined from the canonical distribution of , :

 (43)

In the TI formalism, the free energy is obtained from its gradient, which is generally calculated in the form of the average of a force exerted on , taken over an iso- surface:

 (44)

Several formulae that take the form of (45) have been proposed. This implementation relies partly on the classic formulation [12], and partly on a more versatile scheme originating in a work by Ruiz-Montero et al. [50], generalized by den Otter [19] and extended to multiple variables by Ciccotti et al. [15]. Consider a system subject to constraints of the form . Let ( be arbitrarily chosen vector fields ( ) verifying, for all , , and :

 (45) 0 (46)

then the following holds [15]:

 (47)

where is the potential energy function. can be interpreted as the direction along which the force acting on variable is measured, whereas the second term in the average corresponds to the geometric entropy contribution that appears as a Jacobian correction in the classic formalism [12]. Condition (46) states that the direction along which the system force on is measured is orthogonal to the gradient of , which means that the force measured on does not act on .

Equation (47) implies that constraint forces are orthogonal to the directions along which the free energy gradient is measured, so that the measurement is effectively performed on unconstrained degrees of freedom. In NAMD, constraints are typically applied to the lengths of bonds involving hydrogen atoms, for example in TIP3P water molecules (parameter rigidBonds, section 5.5.1).

In the framework of ABF, is accumulated in bins of finite size, , thereby providing an estimate of the free energy gradient according to equation (45). The biasing force applied along the colective variables to overcome free energy barriers is calculated as:

 (48)

where denotes the current estimate of the free energy gradient at the current point in the collective variable subspace.

As sampling of the phase space proceeds, the estimate is progressively refined. The biasing force introduced in the equations of motion guarantees that in the bin centered around , the forces acting along the selected collective variables average to zero over time. Eventually, as the undelying free energy surface is canceled by the adaptive bias, evolution of the system along is governed mainly by diffusion. Although this implementation of ABF can in principle be used in arbitrary dimension, a higher-dimension collective variable space is likely to result in sampling difficulties. Most commonly, the number of variables is one or two.

ABF requirements on collective variables

1. Only linear combinations of colvar components can be used in ABF calculations.
2. Availability of system forces is necessary. The following colvar components can be used in ABF calculations: distance, distance_xy, distance_z, dihedral, gyration, rmsd and eigenvector.
3. Mutual orthogonality of colvars. In a multidimensional ABF calculation, equation (46) must be satisfied for any two colvars and . Various cases fulfill this orthogonality condition:
• and are based on non-overlapping sets of atoms.
• atoms involved in the force measurement on do not participate in the definition of . This can be obtained using the option oneSiteSystemForce of the distance and dihedral components (example: Ramachandran angles , ).
• and are orthogonal by construction. Useful cases are the sum and difference of two components, or distance_z and distance_xy using the same axis.
4. Mutual orthogonality of components: when several components are combined into a colvar, it is assumed that their vectors (equation (48)) are mutually orthogonal. The cases described for colvars in the previous paragraph apply.
5. Orthogonality of colvars and constraints: equation 47 can be satisfied in two simple ways, if either no constrained atoms are involved in the force measurement (see point 3 above) or pairs of atoms joined by a constraint bond are part of an atom group which only intervenes through its center (center of mass or geometric center) in the force measurement. In the latter case, the contributions of the two atoms to the left-hand side of equation 47 cancel out. For example, all atoms of a rigid TIP3P water molecule can safely be included in an atom group used in a distance component.

Parameters for ABF

The following parameters can be set in the ABF configuration block (in addition to generic bias parameters such as colvars):

• fullSamples (ABF) Number of samples in a bin prior to application of the ABF
Acceptable Values: positive integer
Default Value: 200
Description: To avoid nonequilibrium effects in the dynamics of the system, due to large fluctuations of the force exerted along the reaction coordinate, , it is recommended to apply the biasing force only after a reasonable estimate of the latter has been obtained.

• hideJacobian (ABF) Remove geometric entropy term from calculated free energy gradient?
Acceptable Values: boolean
Default Value: no
Description: In a few special cases, most notably distance-based variables, an alternate definition of the potential of mean force is traditionally used, which excludes the Jacobian term describing the effect of geometric entropy on the distribution of the variable. This results, for example, in particle-particle potentials of mean force being flat at large separations. Setting this parameter to yes causes the output data to follow that convention, by removing this contribution from the output gradients while applying internally the corresponding correction to ensure uniform sampling. It is not allowed for colvars with multiple components.

• outputFreq (ABF) Frequency (in timesteps) at which ABF data files are refreshed
Acceptable Values: positive integer
Default Value: Colvar module restart frequency
Description: The files containing the free energy gradient estimate and sampling histogram (and the PMF in one-dimensional calculations) are written on disk at the given time interval.

• historyFreq (ABF) Frequency (in timesteps) at which ABF history files are accumulated
Acceptable Values: positive integer
Default Value: 0
Description: If this number is non-zero, the free energy gradient estimate and sampling histogram (and the PMF in one-dimensional calculations) are appended to files on disk at the given time interval. History file names use the same prefix as output files, with .hist'' appended.

• inputPrefix (ABF) Filename prefix for reading ABF data
Acceptable Values: list of strings
Description: If this parameter is set, for each item in the list, ABF tries to read a gradient and a sampling files named inputPrefix.grad and inputPrefix.count. This is done at startup and sets the initial state of the ABF algorithm. The data from all provided files is combined appropriately. Also, the grid definition (min and max values, width) need not be the same that for the current run. This command is useful to piece together data from simulations in different regions of collective variable space, or change the colvar boundary values and widths. Note that it is not recommended to use it to switch to a smaller width, as that will leave some bins empty in the finer data grid. This option is NOT compatible with reading the data from a restart file (colvarsInput option of the NAMD config file).

• applyBias (ABF) Apply the ABF bias?
Acceptable Values: boolean
Default Value: yes
Description: If this is set to no, the calculation proceeds normally but the adaptive biasing force is not applied. Data is still collected to compute the free energy gradient. This is mostly intended for testing purposes, and should not be used in routine simulations.

• updateBias (ABF) Update the ABF bias?
Acceptable Values: boolean
Default Value: yes
Description: If this is set to no, the initial biasing force (e.g. read from a restart file or through inputPrefix) is not updated during the simulation. As a result, a constant bias is applied. This can be used to apply a custom, tabulated biasing potential to any combination of colvars. To that effect, one should prepare a gradient file containing the biasing force to be applied (negative gradient of the potential), and a count file containing only values greater than fullSamples. These files must match the grid parameters of the colvars.

ABF also depends on parameters from collective variables to define the grid on which free energy gradients are computed. In the direction of each colvar, the grid ranges from lowerBoundary to upperBoundary, and the bin width (grid spacing) is set by the width parameter.

Output files

The ABF bias produces the following files, all in multicolumn ASCII format:

• outputName.grad: current estimate of the free energy gradient (grid), in multicolumn;
• outputName.count: total number of samples collected, on the same grid;
• outputName.pmf: only for one-dimensional calculations, integrated free energy profile or PMF.

If several ABF biases are defined concurrently, their name is inserted to produce unique filenames for output, as in outputName.abf1.grad. This should not be done routinely and could lead to meaningless results: only do it if you know what you are doing!

If the colvar space has been partitioned into sections (windows) in which independent ABF simulations have been run, the resulting data can be merged using the inputPrefix option described above (a NAMD run of 0 steps is enough).

Reconstructing a multidimensional free energy surface

If a one-dimensional calculation is performed, the estimated free energy gradient is automatically integrated and a potential of mean force is written under the file name <outputName>.pmf, in a plain text format that can be read by most data plotting and analysis programs (e.g. gnuplot).

In dimension 2 or greater, integrating the discretized gradient becomes non-trivial. The standalone utility abf_integrate is provided to perform that task. abf_integrate reads the gradient data and uses it to perform a Monte-Carlo (M-C) simulation in discretized collective variable space (specifically, on the same grid used by ABF to discretize the free energy gradient). By default, a history-dependent bias (similar in spirit to metadynamics) is used: at each M-C step, the bias at the current position is incremented by a preset amount (the hill height). Upon convergence, this bias counteracts optimally the underlying gradient; it is negated to obtain the estimate of the free energy surface.

abf_integrate is invoked using the command-line:

integrate <gradient_file> [-n <nsteps>] [-t <temp>] [-m (0|1)]
[-h <hill_height>] [-f <factor>]


The gradient file name is provided first, followed by other parameters in any order. They are described below, with their default value in square brackets:

• -n: number of M-C steps to be performed; by default, a minimal number of steps is chosen based on the size of the grid, and the integration runs until a convergence criterion is satisfied (based on the RMSD between the target gradient and the real PMF gradient)
• -t: temperature for M-C sampling (unrelated to the simulation temperature) [500 K]
• -m: use metadynamics-like biased sampling? (0 = false) [1]
• -h: increment for the history-dependent bias (hill height'') [0.01 kcal/mol]
• -f: if non-zero, this factor is used to scale the increment stepwise in the second half of the M-C sampling to refine the free energy estimate [0.5]

Using the default values of all parameters should give reasonable results in most cases.

abf_integrate produces the following output files:

• <gradient_file>.pmf: computed free energy surface
• <gradient_file>.histo: histogram of M-C sampling (not usable in a straightforward way if the history-dependent bias has been applied)
• <gradient_file>.est: estimated gradient of the calculated free energy surface (from finite differences)
• <gradient_file>.dev: deviation between the user-provided numerical gradient and the actual gradient of the calculated free energy surface. The RMS norm of this vector field is used as a convergence criteria and displayed periodically during the integration.

Note: Typically, the deviation'' vector field does not vanish as the integration converges. This happens because the numerical estimate of the gradient does not exactly derive from a potential, due to numerical approximations used to obtain it (finite sampling and discretization on a grid).

Many methods have been introduced in the past that make use of an artificial energy term, that changes and adapts over time, to reconstruct a potential of mean force from a conventional molecular dynamics simulation [30,24,61,17,37,31]. One of the most recent, metadynamics, was first designed as a stepwise algorithm, which may be roughly described as an adaptive umbrella sampling'' [37], and was later made continuous over time [32]. This implementation provides only he latter version, which is the most commonly used.

In metadynamics, the external potential on the colvars is:

 (49)

that is, is a history-dependent potential, which acts on the current values of the colvars and depends parametrically on the previous values of the colvars. It is constructed as a sum of -dimensional repulsive Gaussian hills'' with a height : their centers are located at the previously explored configurations , and they extend by approximately in the direction of the -th colvar.

As the system evolves according to the underlying potential of mean force incremented by the metadynamics potential , new hills will tend to accumulate in the regions with a lower effective free energy . That is, the probability of having a given system configuration being explored (and thus, a hill being added there) is proportional to , which tends to a nearly flat histogram when the simulation is continued until the system has deposited hills across the whole free energy landscape. In this situation, is a good approximant of the free energy , and the only dependence on the specific conformational history is by an irrelevant additive constant:

 (50)

Provided that the set of collective variables fully describes the relevant degrees of freedom, the accuracy of the reconstructed profile is a function of the ratio between and [11]. For the optimal choice of and , the diffusion constant of the variable , see reference [11]. As a rule of thumb, the very upper limit for the ratio is given by , where is the longest among 's correlation times. In the most typical conditions, to achieve a good statistical convergence the user would prefer to keep much smaller than .

Given the extension of the free energy profile along the colvar , and the highest free energy that needs to be sampled (e.g. that of a transition state), the upper bound for the required simulation time is of the order of multiples of . When several colvars are used, the upper bound amounts to .

In metadynamics runs performed with this module, the parameter for each hill (eq. 50) is chosen as half the width of the corresponding colvar , while all the other parameters must be provided within the metadynamics {...} block. In addition to the colvars option to list the variable to which this bias is applied, the block accepts the following options:

• name (metadynamics) Name of this metadynamics instance
Acceptable Values: string
Default Value: meta'' + rank number
Description: This option sets the name for this metadynamics instance. While in general it is not advisable to use more than one metadynamics bias, this allows to distinguish each bias from the others in the output.

• hillWeight (metadynamics) Height of each hill (kcal/mol)
Acceptable Values: positive decimal
Default Value: 0.01
Description: This option sets the height of the hills that are added during this run. Note: in most applications, this and each colvar's width are the only parameters that the user needs to choose carefully: the following options are meant for the more specific cases.

• newHillFrequency (metadynamics) Frequency of hill creation
Acceptable Values: positive integer
Default Value: 100
Description: This option sets the number of steps (proportional to ) after which a new hill is added to the history-dependent potential. Each new hill acts on the colvars immediately after being added.

• hillWidth (metadynamics) Relative width of the hills
Acceptable Values: positive decimal
Default Value:
Description: Along each colvar, the width of each Gaussian hill ( ) is given by the product between this number and the colvar's width. To get a smoother free energy profile for a given metadynamics configuration, decrease width and increase hillWidth in proportion. Note: when useGrids is on (default in most cases), values smaller than 1 should be avoided to avoid discretization errors.

• useGrids (metadynamics) Interpolate the hills with grids
Acceptable Values: boolean
Default Value: on
Description: This option discretizes all hills on two grids (storing their total energy and gradients, respectively). These grids are defined by lowerBoundary, upperBoundary and width for each colvar, and the aggregated forces are used (as opposed to summing over all the individual hills). Such grids are written to the state file. Currently, this is not implemented for non-scalar variables (distanceDir or orientation).

• gridsUpdateFrequency (metadynamics) Frequency of update of the grids
Acceptable Values: positive integer
Default Value: newHillFrequency
Description: When useGrids is on, all the newly created hills are projected onto the two grids every gridsUpdateFrequency steps.

• dumpFreeEnergyFile (metadynamics) Periodically save the PMF
Acceptable Values: boolean
Default Value: on
Description: When useGrids and this option are on, the PMF is written every colvarsRestartFrequency steps to the file outputName.pmf. If there is more than one metadynamics bias active, the name of this bias is included in the file name. Note: multidimensional PMFs can only be obtained with one metadynamics instance applied to all the colvars, and not with multiple instances each applied to a single colvar.

• saveFreeEnergyFile (metadynamics) Keep all the PMF files
Acceptable Values: boolean
Default Value: off
Description: When dumpFreeEnergyFile and this option are on, the step number is included in the file name. Activating this option can be useful to follow more closely the convergence of the simulation, by comparing PMFs separated by short times.

• rebinGrids (metadynamics) Recompute the grids when reading a state file
Acceptable Values: boolean
Default Value: off
Description: By default, the grid's boundaries and widths are saved in the state file, and override those in the configuration file. To force a manual change of the grid's parameters, this option can be used to project the grids read from a state file onto new grids, and use them in the following. See instead expandBoundaries in the colvars to have the grid boundaries be automatically expanded for certain colvars.

• keepHills (metadynamics) Write each individual hill to the state file
Acceptable Values: boolean
Default Value: off
Description: When useGrids and this option are on, newly created hills are also saved to the state file in their analytical form, in addition to the grids. This makes it possible to use later the analytical Gaussians for rebinGrids. If only the time history of the hills is of interest, but the grid won't be changed, writeHillsTrajectory gives a much more compact output.

Acceptable Values: boolean
Default Value: off
Description: If this option is on, multiple (independent) replica of the same system can be simulated at the same time, and share the same hills [48]. This is achieved by letting each replica save its newly created hills to the file outputName.colvars.name.replicaID.hills'': its path is communicated to the other replicas through the file replicaFilesRegistry, shared by all replicas. Every replicaUpdateFrequency steps, each replica reads the new hills created by the other replicas and adds them to its own. Note: This option cannot be used in conjunction with useGrids.

• replicaID (metadynamics) Set the identifier for this replica
Acceptable Values: string
Description: If multipleReplicas is on, this option sets a unique identifier for this replica. Hence, when simulating with more than one replica, different colvars configuration files with different values for this option should be used.

• replicaFilesRegistry (metadynamics) Multiple replicas database file
Acceptable Values: UNIX filename
Default Value: name.replica_files.txt''
Description: If multipleReplicas is on, this option sets the path to a replica index file. The paths to files containing another replica's new hills are appended to this file. Every replicaUpdateFrequency steps during a simulation, each replica reads the hills stored in each of those files (except those saved by this replica).

• replicaUpdateFrequency (metadynamics) Multiple replicas update frequency
Acceptable Values: positive integer
Default Value: newHillFrequency
Description: If multipleReplicas is on, this option sets the number of steps between updates of the list of hills created by other replicas.

• writeHillsTrajectory (metadynamics) Write a log of new hills
Acceptable Values: boolean
Default Value: on
Description: If this option is on, a logfile is written by the metadynamics bias, with the name outputName.colvars.name.hills.traj'', which can be useful to follow the time series of the hills. When multipleReplicas is on, its name changes to
outputName.colvars.name.replicaID.hills.traj''.

Harmonic restraints and Steered Molecular Dynamics

The harmonic biasing method may be used to enforce fixed or moving restraints, including variants of Steered and Targeted MD. Within energy minimization runs, it allows for restrained minimization, e.g. to calculate relaxed potential energy surfaces. In the context of the colvars module, harmonic potentials are meant according to their textbook definition: . Note that this differs from harmonic bond and angle potentials in common force fields, where the factor of one half is typically omitted, resulting in a non-standard definition of the force constant. The restraint energy is reported by NAMD under the MISC title. A harmonic restraint is set up by a harmonic {...} block, which may contain (in addition to the standard option colvars) the following keywords:

• forceConstant (harmonic) Scaled force constant (kcal/mol)
Acceptable Values: positive decimal
Default Value: 1.0
Description: This defines a scaled force constant for the harmonic potential. To ensure consistency for multidimensional restraints, it is multiplied internally by the square of the specific width for each colvar involved (which is 1 by default), so that all colvars are effectively dimensionless and of commensurate size. For instance, setting a scaled force constant of 10 kcal/mol acting on two colvars, an angle with a width of 5 degrees and a distance with a width of 0.5 Å will apply actual force constants of 0.4 kcal/moldegree for the angle and 40 kcal/mol/Å for the distance.

• centers (harmonic) Initial harmonic restraint centers
Acceptable Values: space-separated list of colvar values
Description: The centers (equilibrium values) of the restraint are entered here. The number of values must be the number of requested colvars. Each value is a decimal number if the corresponding colvar returns a scalar, a (x, y, z)'' triplet if it returns a unit vector or a vector, and a (q0, q1, q2, q3)'' quadruplet if it returns a rotational quaternion. If a colvar has periodicities or symmetries, its closest image to the restraint center is considered when calculating the harmonic potential.

• targetCenters (harmonic) Steer the restraint centers towards these targets
Acceptable Values: space-separated list of colvar values
Description: When defined, the current centers will be moved towards these values during the simulation. By default, the centers are moved over a total of targetNumSteps steps by a linear interpolation, in the spirit of Steered MD. If targetNumStages is set to a nonzero value, the change is performed in discrete stages, lasting targetNumSteps steps each. This second mode may be used to sample successive windows in the context of an Umbrella Sampling simulation. When continuing a simulation run, the centers specified in the configuration file colvarsConfig will be overridden by those saved in the restart file colvarsInput. To perform Steered MD in an arbitrary space of colvars, it is sufficient to use this option and enable outputAppliedForce within each of the colvars involved.

• targetForceConstant (harmonic) Change the force constant towards this value
Acceptable Values: positive decimal
Description: When defined, the current forceConstant will be moved towards this value during the simulation. Time evolution of the force constant is dictated by the targetForceExponent parameter (see below). By default, the force constant is changed smoothly over a total of targetNumSteps steps. This is useful to introduce or remove restraints in a progressive manner. If targetNumStages is set to a nonzero value, the change is performed in discrete stages, lasting targetNumSteps steps each. This second mode may be used to compute the conformational free energy change associated with the restraint, within the FEP or TI formalisms. For convenience, the code provides an estimate of the free energy derivative for use in TI. A more complete free energy calculation (particularly with regard to convergence analysis), while not handled by the colvars module, can be performed by post-processing the colvars trajectory, if colvarsTrajFrequency is set to a suitably small value. It should be noted, however, that restraint free energy calculations may be handled more efficiently by an indirectly route, through the determination of a PMF for the restrained coordinate.[20]

• targetForceExponent Exponent in the time-dependence of the force constant
Acceptable Values: decimal equal to or greater than 1.0
Default Value: 1.0
Description: Sets the exponent, , in the function used to vary the force constant as a function of time. The force is varied according to a coupling parameter , raised to the power : , where , , and are the initial, current, and final values of the force constant. The parameter evolves linearly from 0 to 1, either smoothly or in targetNumStages discrete stages. When the initial value of the force constant is zero, an exponent greater than 1.0 distributes the effects of introducing the restraint more smoothly over time than a linear dependence.

• targetNumSteps (harmonic) Number of steps for steering
Acceptable Values: positive integer
Description: Defines the number of steps required to move the restraint centers (or force constant) towards the values specified with targetCenters or targetForceConstant. After the target values have been reached, the centers (resp. force constant) are kept fixed.

• targetNumStages (harmonic) Number of stages for steering
Acceptable Values: non-negative integer
Default Value: 0
Description: If non-zero, sets the number of stages in which the restraint centers or force constant are changed to their target values. If zero, the change is continuous.

Tip: A complex set of restraints can be applied to a system, by defining several colvars, and applying one or more harmonic restraints to different groups of colvars. In some cases, dozens of colvars can be defined, but their value may not be relevant: to limit the size of the colvars trajectory file, it may be wise to disable outputValue for such ancillary'' variables, and leave it enabled only for relevant'' ones.

Multidimensional histograms

The histogram feature is used to record the distribution of a set of collective variables in the form of a N-dimensional histogram. It functions as a collective variable bias'', and is invoked by adding a histogram block to the colvars configuration file.

In addition to the common parameters name and colvars described above, a histogram block may define the following parameter:

• outputFreq (histogram) Frequency (in timesteps) at which the histogram file is refreshed
Acceptable Values: positive integer
Default Value: Colvar module restart frequency
Description: The file containing histogram data is written on disk at the given time interval.

Like the ABF and metadynamics biases, histogram uses parameters from the colvars to define its grid. The grid ranges from lowerBoundary to upperBoundary, and the bin width is set by the width parameter.

Next: Alchemical Free Energy Methods1 Up: Collective Variable-based Calculations1 Previous: Declaring and using collective   Contents   Index
namd@ks.uiuc.edu