Skip to content

Shortcut: SKETCHMAP

Module dimred
Description Usage
Construct a sketch map projection of the input data used in 1 tutorialsused in 1 eggs
output value type
the sketch-map projection of the input points matrix

Details and examples

Construct a sketch map projection of the input data

This shortcut allows you to construct a sketch-map projection from a trajectory. The sketch-map algorithm is introduced and examples of how it is used are given in the papers cited below.

The following input illustrates how to run a sketch-map calculation with PLUMED:

Click on the labels of the actions for more information on what each action computes
tested on2.11
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

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
lwe: 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
smap: SKETCHMAPConstruct a sketch map projection of the input data This action is a shortcut and it has hidden defaults. More details ...
   ARGthe matrix of high dimensional coordinates that you want to project in the low dimensional space=ff NLOW_DIMnumber of low-dimensional coordinates required=2
   HIGH_DIM_FUNCTIONthe parameters of the switching function in the high dimensional space={SMAP R_0=2 A=3 B=9}
   LOW_DIM_FUNCTIONthe parameters of the switching function in the low dimensional space={SMAP R_0=2 A=2 B=2}
   WEIGHTSa vector containing the weights of the points=lwe NCYCLES The number of cycles of pointwise global optimisation that are required=3 FGRID_SIZE interpolate the grid onto this number of points -- only works in 2D=50,50
...

DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=smap.*,lwe FILE the file on which to write the vetors=smap

The sketch-map projection is constructed from all the data in the input trajectory here and is output at the end of the simulation. Dissimilarities between the trajectory frames are calculated based on how much the three distances that are used in the input to the COLLECT_FRAMES object here have changed. However, if you want to use RMSD distances to compute these dissimilarities instead you can use an input like the one shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
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-256
lwe: 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
smap: SKETCHMAPConstruct a sketch map projection of the input data This action is a shortcut and it has hidden defaults. More details ...
   ARGthe matrix of high dimensional coordinates that you want to project in the low dimensional space=ff NLOW_DIMnumber of low-dimensional coordinates required=2
   HIGH_DIM_FUNCTIONthe parameters of the switching function in the high dimensional space={SMAP R_0=2 A=3 B=9}
   LOW_DIM_FUNCTIONthe parameters of the switching function in the low dimensional space={SMAP R_0=2 A=2 B=2}
   WEIGHTSa vector containing the weights of the points=lwe NCYCLES The number of cycles of pointwise global optimisation that are required=3 FGRID_SIZE interpolate the grid onto this number of points -- only works in 2D=50,50
...

DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=smap.*,lwe FILE the file on which to write the vetors=smap

Information on how we optimise the sketch-map stress function can be found by expanding the SKETCHMAP shortcut in the above input and reading the documentation for ARRANGE_POINTS.

Using landmarks

Optimising the sketch-map stress function is computationally expensive and so the usual practise with this method is to pick a subset of landmark points. Projections for these points are found by optimising the sketch-map stress function using ARRANGE_POINTS. Projections for non-landmark points are then found by using PROJECT_POINTS. The following example input illustrates how you can perform such a calculation with PLUMED

Click on the labels of the actions for more information on what each action computes
tested on2.11
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

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 ARGthe labels of the values whose time series you would like to collect for later analysis=d1,d2,d3
ff_dataT: TRANSPOSECalculate the transpose of a matrix More details ARGthe label of the vector or matrix that should be transposed=ff_data
ll: LANDMARK_SELECT_STRIDESelect every ith frame from the stored set of configurations This action is a shortcut. More details ARGthe COLLECT_FRAMES action that you used to get the data=ff NLANDMARKSthe numbe rof landmarks you would like to create=250

# Calculate the weights voro: VORONOIDo a voronoi analysis This action is a shortcut. More details ARGthe distance/adjacency matrix that should be used to perform the voronoi analysis=ll_rectdissims 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 weightsT: TRANSPOSECalculate the transpose of a matrix More details ARGthe label of the vector or matrix that should be transposed=weights lweT: MATRIX_PRODUCTCalculate the product of two matrices More details ARGthe label of the two matrices from which the product is calculated=weightsT,voro lwe: TRANSPOSECalculate the transpose of a matrix More details ARGthe label of the vector or matrix that should be transposed=lweT smap: SKETCHMAPConstruct a sketch map projection of the input data This action is a shortcut and it has hidden defaults. More details ... ARGthe matrix of high dimensional coordinates that you want to project in the low dimensional space=ll NLOW_DIMnumber of low-dimensional coordinates required=2 PROJECT_ALL if the input are landmark coordinates then project the out of sample configurations HIGH_DIM_FUNCTIONthe parameters of the switching function in the high dimensional space={SMAP R_0=4 A=3 B=2} LOW_DIM_FUNCTIONthe parameters of the switching function in the low dimensional space={SMAP R_0=4 A=1 B=2} ...
DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=smap,lwe FILE the file on which to write the vetors=smap DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=smap_osample,weights FILE the file on which to write the vetors=projections

Using SMACOF

By default we PLUMED uses the method described in the paper cited below to optimise the sketch-map stress function. In other words, we use a combination of conjugate gradients and a pointwise global optimisation algorithm. Within the code there is also an experimental implementation of optimisation using a variant on the smacof algorithm. If you would like to experiment with this option you use the USE_SMACOF flag as illustrated below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
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

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
lwe: 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
smap: SKETCHMAPConstruct a sketch map projection of the input data This action is a shortcut and it has hidden defaults. More details ...
   ARGthe matrix of high dimensional coordinates that you want to project in the low dimensional space=ff NLOW_DIMnumber of low-dimensional coordinates required=2 USE_SMACOF find the projection in the low dimensional space using the SMACOF algorithm
   HIGH_DIM_FUNCTIONthe parameters of the switching function in the high dimensional space={SMAP R_0=2 A=3 B=9}
   LOW_DIM_FUNCTIONthe parameters of the switching function in the low dimensional space={SMAP R_0=2 A=2 B=2}
   WEIGHTSa vector containing the weights of the points=lwe
...

DUMPVECTORPrint a vector to a file More details ARGthe labels of vectors/matrices that should be output in the file=smap.*,lwe FILE the file on which to write the vetors=smap

Output components

This action can calculate the values in the following table when the associated keyword is included in the input for the action. These values can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the value required from the list below.

Name Type Keyword Description
osample matrix PROJECT_ALL the out-of-sample projections

Full list of keywords

The following table describes the keywords and options that can be used with this action

Keyword Type Default Description
NLOW_DIM compulsory none number of low-dimensional coordinates required
ARG compulsory none the matrix of high dimensional coordinates that you want to project in the low dimensional space
HIGH_DIM_FUNCTION compulsory none the parameters of the switching function in the high dimensional space
LOW_DIM_FUNCTION compulsory none the parameters of the switching function in the low dimensional space
CGTOL compulsory 1E-6 The tolerance for the conjugate gradient minimization that finds the projection of the landmarks
MAXITER compulsory 1000 maximum number of optimization cycles for optimisation algorithms
NCYCLES compulsory 0 The number of cycles of pointwise global optimisation that are required
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
OS_CGTOL compulsory 1E-6 The tolerance for the conjugate gradient minimization that finds the out of sample projections
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
WEIGHTS optional not used a vector containing the weights of the points
PROJECT_ALL optional false if the input are landmark coordinates then project the out of sample configurations
USE_SMACOF optional false find the projection in the low dimensional space using the SMACOF algorithm

References

More information about how this action can be used is available in the following articles: