Action: ARRANGE_POINTS
| Module | dimred |
|---|---|
| Description | Usage |
| Arrange points in a low dimensional space so that the (transformed) distances between points in the low dimensional space match the dissimilarities provided in an input matrix. |
Details and examples
Arrange points in a low dimensional space so that the (transformed) distances between points in the low dimensional space match the dissimilarities provided in an input matrix.
This action and PROJECT_POINTS are the workhorses for the implementation of SKETCHMAP that is provided within PLUMED. ARRANGE_POINTS allows you to find a set of low dimenionsional coordinates, , for a set of high-dimensional coordinates, , by minimising this stress function:
The here indicates that we are calculating the dissimilarity between the point and , while the indicates that we are calculating the distance between the projections of points and . In minimising the expression above we are thus finding a set of low-dimensional projections for the high dimensional points that were input. The is a weight that determines how important reproducing the distance between atom and
The example input below illustrates how you can use ARRANGE_POINTS to project a high-dimensional representational of a trajectory in a low-dimensional space.
# Calcuate the instantaneous values of the three distances d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 d2: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4 d3: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=5,6 # Collect the calulated distances for later analysis ff: COLLECT_FRAMESCollect atomic positions or argument values from the trajectory for later analysis This action is a shortcut and it has hidden defaults. More details STRIDE the frequency with which data should be stored for analysis=1 ARGthe labels of the values whose time series you would like to collect for later analysis=d1,d2,d3 ff_weights: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=ff_logweights FUNCthe function you wish to evaluate=exp(x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Generate an initial projection of the high dimensional points using MDS mds: CLASSICAL_MDSCreate a low-dimensional projection of a trajectory using the classical multidimensional This action is a shortcut. More details ARGthe arguments that you would like to make the histogram for=ff NLOW_DIMnumber of low-dimensional coordinates required=2
# Generate a matrix of w_ij values weights: OUTER_PRODUCTCalculate the outer product matrix of two vectors This action has hidden defaults. More details ARGthe labels of the two vectors from which the outer product is being computed=ff_weights,ff_weights
# And produce the projections proj: ARRANGE_POINTSArrange points in a low dimensional space so that the (transformed) distances between points in the low dimensional space match the dissimilarities provided in an input matrix. This action has hidden defaults. More details ARGthe initial positions for the projections=mds-1,mds-2 TARGET1the matrix of target quantities that you would like to match=mds_mat WEIGHTS1the matrix with the weights of the target quantities=weights
# And print the projections to a file DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=proj.* FILE the file on which to write the vetors=colvar
Here projections are generated once at the end of the trajectory and are output to a file called colvar. Initial projections of all the points are generated using CLASSICAL_MDS.
A better optimisation of the stress function above is then obtained by using the conjugate gradient algorithm. The MINTYPE option in ARRANGE_POINTS allows you to specify whether
conjugate gradient, the smacof algorithm or
the pointwise global optimisation algorithm that was discussed in the original paper on sketch-map that is referenced below are used to optimise the stress function.
Using RMSD distances
If you wish to use the coordinates of the atoms directly when computing the dissimilarities in the high dimensional space you use an input similar to the one shown below:
# Collect the positions of the atoms for later analysis ff: COLLECT_FRAMESCollect atomic positions or argument values from the trajectory for later analysis This action is a shortcut and it has hidden defaults. More details STRIDE the frequency with which data should be stored for analysis=1 ATOMSlist of atomic positions that you would like to collect and store for later analysis=1-10
# Generate an initial projection of the high dimensional points using MDS mds: CLASSICAL_MDSCreate a low-dimensional projection of a trajectory using the classical multidimensional This action is a shortcut. More details ARGthe arguments that you would like to make the histogram for=ff NLOW_DIMnumber of low-dimensional coordinates required=2 ff_weights: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=ff_logweights FUNCthe function you wish to evaluate=exp(x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Generate a matrix of w_ij values weights: OUTER_PRODUCTCalculate the outer product matrix of two vectors This action has hidden defaults. More details ARGthe labels of the two vectors from which the outer product is being computed=ff_weights,ff_weights
# And produce the projections proj: ARRANGE_POINTSArrange points in a low dimensional space so that the (transformed) distances between points in the low dimensional space match the dissimilarities provided in an input matrix. This action has hidden defaults. More details ARGthe initial positions for the projections=mds-1,mds-2 TARGET1the matrix of target quantities that you would like to match=mds_mat WEIGHTS1the matrix with the weights of the target quantities=weights
# And print the projections to a file DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=proj.* FILE the file on which to write the vetors=colvar
The dissimilarities between the atomic configurations here are computed as RMSD distances between atomic configurations.
Using transformed distances
In SKETCHMAP the stress function that is minimised is not the one given above. Instead of seeking to generate a projection, in which the distances between the projections are the same as the dissimilarities between the high-dimensional coordinates, the dissimilarities and distances are transformed by functions as illustrated below:
The two functions and in this expression are usually different as you can see in the input below:
# Calcuate the instantaneous values of the three distances d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 d2: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4 d3: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=5,6 # Collect the calulated distances for later analysis ff: COLLECT_FRAMESCollect atomic positions or argument values from the trajectory for later analysis This action is a shortcut and it has hidden defaults. More details STRIDE the frequency with which data should be stored for analysis=1 ARGthe labels of the values whose time series you would like to collect for later analysis=d1,d2,d3 ff_weights: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=ff_logweights FUNCthe function you wish to evaluate=exp(x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Generate an initial projection of the high dimensional points using MDS mds: CLASSICAL_MDSCreate a low-dimensional projection of a trajectory using the classical multidimensional This action is a shortcut. More details ARGthe arguments that you would like to make the histogram for=ff NLOW_DIMnumber of low-dimensional coordinates required=2
# Generate a matrix of w_ij values weights: OUTER_PRODUCTCalculate the outer product matrix of two vectors This action has hidden defaults. More details ARGthe labels of the two vectors from which the outer product is being computed=ff_weights,ff_weights
# Transform the dissimilarities with the function F fed: MORE_THANUse a switching function to determine how many of the input variables are more than a certain cutoff. More details ARGthe values input to this function=mds_mat SQUARED is the input quantity the square of the value that you would like to apply the switching function to SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={SMAP R_0=4 A=3 B=2}
# And produce the projections proj: ARRANGE_POINTSArrange points in a low dimensional space so that the (transformed) distances between points in the low dimensional space match the dissimilarities provided in an input matrix. This action has hidden defaults. More details ARGthe initial positions for the projections=mds-1,mds-2 TARGET1the matrix of target quantities that you would like to match=fed WEIGHTS1the matrix with the weights of the target quantities=weights FUNC1a function that is applied on the distances between the points in the low dimensional space={SMAP R_0=4 A=1 B=2}
# And print the projections to a file DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=proj.* FILE the file on which to write the vetors=colvar
In the input above the function, , that is applied on the dissimilarities is implemented using a MORE_THAN action. The function, ,
that is applied on the distances in the low-dimensional space is specified using the FUNC keyword that is input to ARRANGE_POINTS.
Using multiple targets
At its most complex this action allows you to minimise a stress function such as the one below:
The input below shows how this can be implemted within PLUMED:
# Calcuate the instantaneous values of the three distances d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 d2: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4 d3: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=5,6 # Collect the calulated distances for later analysis ff: COLLECT_FRAMESCollect atomic positions or argument values from the trajectory for later analysis This action is a shortcut and it has hidden defaults. More details STRIDE the frequency with which data should be stored for analysis=1 ARGthe labels of the values whose time series you would like to collect for later analysis=d1,d2,d3 ff_weights: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=ff_logweights FUNCthe function you wish to evaluate=exp(x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Generate an initial projection of the high dimensional points using MDS mds: CLASSICAL_MDSCreate a low-dimensional projection of a trajectory using the classical multidimensional This action is a shortcut. More details ARGthe arguments that you would like to make the histogram for=ff NLOW_DIMnumber of low-dimensional coordinates required=2
# Generate a matrix of w_ij values weights: OUTER_PRODUCTCalculate the outer product matrix of two vectors This action has hidden defaults. More details ARGthe labels of the two vectors from which the outer product is being computed=ff_weights,ff_weights w1: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=weights FUNCthe function you wish to evaluate=0.3*x PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO w2: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=weights FUNCthe function you wish to evaluate=(1-0.3)*x PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Transform the dissimilarities with the function F fed: MORE_THANUse a switching function to determine how many of the input variables are more than a certain cutoff. More details ARGthe values input to this function=mds_mat SQUARED is the input quantity the square of the value that you would like to apply the switching function to SWITCHThis keyword is used if you want to employ an alternative to the continuous swiching function defined above={SMAP R_0=4 A=3 B=2}
# And produce the projections proj: ARRANGE_POINTSArrange points in a low dimensional space so that the (transformed) distances between points in the low dimensional space match the dissimilarities provided in an input matrix. This action has hidden defaults. More details ... ARGthe initial positions for the projections=mds-1,mds-2 TARGET1the matrix of target quantities that you would like to match=mds_mat WEIGHTS1the matrix with the weights of the target quantities=w1 FUNC1a function that is applied on the distances between the points in the low dimensional space={CUSTOM FUNC=1-sqrt(x2) R_0=1.0} TARGET2the matrix of target quantities that you would like to match=fed WEIGHTS2the matrix with the weights of the target quantities=w2 FUNC2a function that is applied on the distances between the points in the low dimensional space={SMAP R_0=4 A=1 B=2} ...
# And print the projections to a file DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=proj.* FILE the file on which to write the vetors=colvar
Here the sum over in the expression above has two terms. In the first of these terms is the identity so the
input for TARGET1 is the output from EUCLIDEAN_DISTANCE. is similarly the identity. To
implement the identity here we use the input to FUNC1 shown above. The input to this function is the input for one of
the switching functions described in the documentation for LESS_THAN. What we compute for the transformed
distance is where is the switching function that is specified in input. Consequently, applying the
function 1-sqrt(x2) returns the distance.
The second term in our sum over in the input above has the dissimilarities and distances transformed by the functions that we introduced in the previous section.
Choosing an optimization algorithm
The inputs above use conjugate gradients to optimize the stress function and to find the low dimensional projection. If you wish you can change the algorithm used to optimize the sketch-map function. For example, in the input below the smacof algorithm is used in place of conjugate gradients.
# Calcuate the instantaneous values of the three distances d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 d2: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4 d3: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=5,6 # Collect the calulated distances for later analysis ff: COLLECT_FRAMESCollect atomic positions or argument values from the trajectory for later analysis This action is a shortcut and it has hidden defaults. More details STRIDE the frequency with which data should be stored for analysis=1 ARGthe labels of the values whose time series you would like to collect for later analysis=d1,d2,d3 ff_weights: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=ff_logweights FUNCthe function you wish to evaluate=exp(x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Generate an initial projection of the high dimensional points using MDS mds: CLASSICAL_MDSCreate a low-dimensional projection of a trajectory using the classical multidimensional This action is a shortcut. More details ARGthe arguments that you would like to make the histogram for=ff NLOW_DIMnumber of low-dimensional coordinates required=2
# Generate a matrix of w_ij values weights: OUTER_PRODUCTCalculate the outer product matrix of two vectors This action has hidden defaults. More details ARGthe labels of the two vectors from which the outer product is being computed=ff_weights,ff_weights
# And produce the projections proj: ARRANGE_POINTSArrange points in a low dimensional space so that the (transformed) distances between points in the low dimensional space match the dissimilarities provided in an input matrix. This action has hidden defaults. More details ... ARGthe initial positions for the projections=mds-1,mds-2 TARGET1the matrix of target quantities that you would like to match=mds_mat WEIGHTS1the matrix with the weights of the target quantities=weights MINTYPE the method to use for the minimisation=smacof ...
# And print the projections to a file DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=proj.* FILE the file on which to write the vetors=colvar
Alternatively, the following example uses a combination of conjugate gradients and a pointwise global optimisation to optimize the stress function
# Calcuate the instantaneous values of the three distances d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 d2: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4 d3: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=5,6 # Collect the calulated distances for later analysis ff: COLLECT_FRAMESCollect atomic positions or argument values from the trajectory for later analysis This action is a shortcut and it has hidden defaults. More details STRIDE the frequency with which data should be stored for analysis=1 ARGthe labels of the values whose time series you would like to collect for later analysis=d1,d2,d3 ff_weights: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=ff_logweights FUNCthe function you wish to evaluate=exp(x) PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO # Generate an initial projection of the high dimensional points using MDS mds: CLASSICAL_MDSCreate a low-dimensional projection of a trajectory using the classical multidimensional This action is a shortcut. More details ARGthe arguments that you would like to make the histogram for=ff NLOW_DIMnumber of low-dimensional coordinates required=2
# Generate a matrix of w_ij values weights: OUTER_PRODUCTCalculate the outer product matrix of two vectors This action has hidden defaults. More details ARGthe labels of the two vectors from which the outer product is being computed=ff_weights,ff_weights
# And produce the projections proj: ARRANGE_POINTSArrange points in a low dimensional space so that the (transformed) distances between points in the low dimensional space match the dissimilarities provided in an input matrix. This action has hidden defaults. More details ... ARGthe initial positions for the projections=mds-1,mds-2 TARGET1the matrix of target quantities that you would like to match=mds_mat WEIGHTS1the matrix with the weights of the target quantities=weights MINTYPE the method to use for the minimisation=pointwise ...
# And print the projections to a file DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=proj.* FILE the file on which to write the vetors=colvar
This is the algorithm that is to optimize the stress function within SKETCHMAP.
Input
The arguments that serve as the input for this action are specified using one or more of the keywords in the following table.
| Keyword | Type | Description |
|---|---|---|
| ARG | vector | the initial positions for the projections |
| TARGET | matrix | the matrix of target quantities that you would like to match |
| WEIGHTS | matrix | the matrix with the weights of the target quantities |
Full list of keywords
The following table describes the keywords and options that can be used with this action
| Keyword | Type | Default | Description |
|---|---|---|---|
| ARG | input | none | the initial positions for the projections |
| TARGET | input | none | the matrix of target quantities that you would like to match |
| WEIGHTS | input | none | the matrix with the weights of the target quantities |
| MINTYPE | compulsory | conjgrad | the method to use for the minimisation |
| MAXITER | compulsory | 1000 | maximum number of optimization cycles for optimisation algorithms |
| CGTOL | compulsory | 1E-6 | the tolerance for the conjugate gradient minimization |
| NCYCLES | compulsory | 5 | the number of cycles of global optimization to attempt |
| BUFFER | compulsory | 1.1 | grid extent for search is (max projection - minimum projection) multiplied by this value |
| CGRID_SIZE | compulsory | 10 | number of points to use in each grid direction |
| FGRID_SIZE | compulsory | 0 | interpolate the grid onto this number of points -- only works in 2D |
| SMACTOL | compulsory | 1E-4 | the tolerance for the smacof algorithm |
| SMACREG | compulsory | 0.001 | this is used to ensure that we don't divide by zero when updating weights for SMACOF algorithm |
| FUNC | optional | not used | a function that is applied on the distances between the points in the low dimensional space |
References
More information about how this action can be used is available in the following articles: