This is part of the mapping module |
Path collective variables with a more flexible framework for the distance metric being used.
The Path Collective Variables developed by Branduardi and co-workers [21] allow one to compute the progress along a high-dimensional path and the distance from the high-dimensional path. The progress along the path (s) is computed using:
\[ s = \frac{ \sum_{i=1}^N i \exp( -\lambda R[X - X_i] ) }{ \sum_{i=1}^N \exp( -\lambda R[X - X_i] ) } \]
while the distance from the path (z) is measured using:
\[ z = -\frac{1}{\lambda} \ln\left[ \sum_{i=1}^N \exp( -\lambda R[X - X_i] ) \right] \]
In these expressions \(N\) high-dimensional frames ( \(X_i\)) are used to describe the path in the high-dimensional space. The two expressions above are then functions of the distances from each of the high-dimensional frames \(R[X - X_i]\). Within PLUMED there are multiple ways to define the distance from a high-dimensional configuration. You could calculate the RMSD distance or you could calculate the ammount by which a set of collective variables change. As such this implementation of the path cv allows one to use all the difference distance metrics that are discussed in Distances from reference configurations. This is as opposed to the alternative implementation of path (PATHMSD) which is a bit faster but which only allows one to use the RMSD distance.
The \(s\) and \(z\) variables are calculated using the above formulas by default. However, there is an alternative method of calculating these collective variables, which is detailed in [39]. This alternative method uses the tools of geometry (as opposed to algebra, which is used in the equations above). In this alternative formula the progress along the path \(s\) is calculated using:
\[ s = i_2 + \textrm{sign}(i_2-i_1) \frac{ \sqrt{( \mathbf{v}_1\cdot\mathbf{v}_2 )^2 - |\mathbf{v}_3|^2(|\mathbf{v}_1|^2 - |\mathbf{v}_2|^2) } }{2|\mathbf{v}_3|^2} - \frac{\mathbf{v}_1\cdot\mathbf{v}_3 - |\mathbf{v}_3|^2}{2|\mathbf{v}_3|^2} \]
where \(\mathbf{v}_1\) and \(\mathbf{v}_3\) are the vectors connecting the current position to the closest and second closest node of the path, respectfully and \(i_1\) and \(i_2\) are the projections of the closest and second closest frames of the path. \(\mathbf{v}_2\), meanwhile, is the vector connecting the closest frame to the second closest frame. The distance from the path, \(z\) is calculated using:
\[ z = \sqrt{ \left[ |\mathbf{v}_1|^2 - |\mathbf{v}_2| \left( \frac{ \sqrt{( \mathbf{v}_1\cdot\mathbf{v}_2 )^2 - |\mathbf{v}_3|^2(|\mathbf{v}_1|^2 - |\mathbf{v}_2|^2) } }{2|\mathbf{v}_3|^2} - \frac{\mathbf{v}_1\cdot\mathbf{v}_3 - |\mathbf{v}_3|^2}{2|\mathbf{v}_3|^2} \right) \right]^2 } \]
The symbols here are as they were for \(s\). If you would like to use these equations to calculate \(s\) and \(z\) then you should use the GPATH flag. The values of \(s\) and \(z\) can then be referenced using the gspath and gzpath labels.
By default the value of the calculated quantity can be referenced elsewhere in the input file by using the label of the action. Alternatively this Action can be used to calculate the following quantities by employing the keywords listed below. These quanties can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the quantity required from the list below.
Quantity | Keyword | Description |
gspath | GPATH | the position on the path calculated using trigonometry |
gzpath | GPATH | the distance from the path calculated using trigonometry |
REFERENCE | a pdb file containing the set of reference configurations |
TYPE | ( default=OPTIMAL-FAST ) the manner in which distances are calculated. More information on the different metrics that are available in PLUMED can be found in the section of the manual on Distances from reference configurations |
LAMBDA | ( default=0 ) the value of the lambda parameter for paths |
NUMERICAL_DERIVATIVES | ( default=off ) calculate the derivatives for these quantities numerically |
SERIAL | ( default=off ) do the calculation in serial. Do not parallelize |
TIMINGS | ( default=off ) output information on the timings of the various parts of the calculation |
DISABLE_CHECKS | ( default=off ) disable checks on reference input structures. |
NOZPATH | ( default=off ) do not calculate the zpath position |
NOSPATH | ( default=off ) do not calculate the spath position |
GPATH | calculate the position on the path using trigonometry The final value can be referenced using label.gpath. You can use multiple instances of this keyword i.e. GPATH1, GPATH2, GPATH3... The corresponding values are then referenced using label.gpath-1, label.gpath-2, label.gpath-3... |
In the example below the path is defined using RMSD distance from frames. The reference frames in the path are defined in the pdb file. In this frame each configuration in the path is separated by a line containing just the word END.
p1: PATH REFERENCE=file.pdb TYPE=OPTIMAL LAMBDA=500.0 PRINT ARG=p1.sss,p1.zzz STRIDE=1 FILE=colvar FMT=%8.4f
In the example below the path is defined using the values of two torsional angles (t1 and t2). In addition, the \(s\) and \(z\) are calculated using the geometric expressions described above rather than the alegebraic expressions that are used by default.
t1: TORSION ATOMS=5,7,9,15 t2: TORSION ATOMS=7,9,15,17 pp: PATH TYPE=EUCLIDEAN REFERENCE=epath.pdb GPATH NOSPATH NOZPATH PRINT ARG=pp.* FILE=colvar
Notice that the LAMBDA parameter is not required here as we are not calculating \(s\) and \(s\) using the algebraic formulae defined earlier. The positions of the frames in the path are defined in the file epath.pdb. An extract from this file looks as shown below.
REMARK ARG=t1,t2 t1=-4.25053 t2=3.88053 END REMARK ARG=t1,t2 t1=-4.11 t2=3.75 END REMARK ARG=t1,t2 t1=-3.96947 t2=3.61947 END
The remarks in this pdb file tell PLUMED the labels that are being used to define the position in the high dimensional space and the values that these arguments have at each point on the path.
The following input instructs PLUMED to calculate the values of the path collective variables. The frames that make up this path are defined in the file all.pdb and all distances are measured using the OPTIMAL metric that is discussed in the manual page on RMSD.
p2: PATH REFERENCE=all.pdb LAMBDA=69087 PRINT ARG=p2.spath,p2.zpath STRIDE=1 FILE=colvar
If you wish to use collective variable values in the definition of your path you would use an input file with something like this:
d1: DISTANCE ATOMS=1,2 d2: DISTANCE ATOMS=3,4a p2: PATH REFERENCE=mypath.pdb LAMBDA=2 TYPE=EUCLIDEAN PRINT ARG=p2.spath,p2.zpath STRIDE=1 FILE=colvar
The corresponding pdb file containing the definitions of the frames in the path would then look like this:
DESCRIPTION: a defintiion of a PATH REMARK TYPE=EUCLIDEAN REMARK ARG=d1,d2 REMARK d1=1.0 d2=1.0 END REMARK TYPE=EUCLIDEAN REMARK ARG=d1,d2 REMARK d1=2.0 d2=2.0 END
For each frame in the path you must specify the arguments that should be used to calculate the distance between the instantaneous configuration of the system and the reference configurations together with the values that these arguments take in each of the reference configurations.