For convenience we provide the modifications in a single archive file (AmberTools 13). Extract the files in the AmberTools/src directory and the files will be written to a new subdirectory ptraj.mod. Configure the build of AmberTools as usual, change into this subdirectory and do a make. Alternatively, carry out the modifications by hand as described below.

The following three files contain the routines and header information.

  1. actions.c contains the main routines
    1. transformDiffusion (modified diffusion code)
    2. transformMRT (mean residence time correlation functions)
    3. transformDensity (density along coordinate)
    4. transformOrderParameter (order parameters)
    5. transformPairDist (pair-distance distribution function P(r))
    6. transformImgDist (distances to neighbour images)
    and the helper functions calculateMSD, inout_MRT, increaseMem plus some basic vector routines. These functions need to be copied and pasted to the original actions.c from the distribution (simply appending the contents of the file provided here should be fine). The original function transformDiffusion should be commented out if the new one is to be used.
  2. actions.h contains the header information for the routines above and needs to be copied and pasted to the original actions.h. Please note that the contents of the file provided here goes before the final #endif /* ACTION_MODULE */ (delete this final line from the original action.h and append).
  3. version.h contains version information.

The following modifications to the code are also required in addition to copying and pasting the contents of the files as described above to compile the code.

  1. Prototypes for the new functions and new enumeration types have to be added to action.h.
    typedef enum _actionType {
    .
    .
    TRANSFORM_MRT,
    TRANSFORM_DENSITY,
    TRANSFORM_PAIRDIST,
    TRANSFORM_IMGDIST,
    TRANSFORM_ORDERPARAMETER
    } actionType;
    .
    .
    extern int transform2dRMS(actionInformation *,
    double *, double *, double *, double *, int);
    /* the next four prototypes are new */
    extern int transformMRT(actionInformation *, double *, double *, double *,
    double *, int);
    extern int transformDensity(actionInformation *,
    double *, double *, double *, double *, int);
    extern int transformPairDist(actionInformation *, double *, double *, double *,
    double *, int);
    extern int transformImgDist(actionInformation *, double *, double *, double *,
    double *, int);
    extern int transformOrderParameter(actionInformation *, double *, double *, double *,
    double *, int);
    extern actionInformation* ptrajCopyAction(actionInformation**);
    .
    .
  2. The new commands have to be added to dispatch.c.
    Token ptrajTokenlist[] = {
    .
    .
    {"2drms", 5, -1, TRANSFORM_2DRMS, ptrajSetup},
    {"mrt", 3, -1, TRANSFORM_MRT, ptrajSetup},
    {"density", 4, -1, TRANSFORM_DENSITY, ptrajSetup},
    {"order", 5, -1, TRANSFORM_ORDERPARAMETER, ptrajSetup},
    {"pairdist", 5, -1, TRANSFORM_PAIRDIST, ptrajSetup},
    {"imgdist", 4, -1, TRANSFORM_IMGDIST, ptrajSetup},
    {"go", 2, -1, TRANSFORM_TRANSFORM, ptrajSetup},
    .
    .
  3. Also ptraj.c must be updated.
     switch ( type ) {
    .
    .
    case TRANSFORM_2DRMS:
    action->type = TRANSFORM_2DRMS;
    action->fxn = (actionFunction) transform2dRMS;

    break;
    case TRANSFORM_MRT: /* new */
    action->type = TRANSFORM_MRT;
    action->fxn = (actionFunction) transformMRT;
    break;
    case TRANSFORM_DENSITY: /* new */
    action->type = TRANSFORM_DENSITY;
    action->fxn = (actionFunction) transformDensity;
    break;
    case TRANSFORM_ORDERPARAMETER: /* new */
    action->type = TRANSFORM_ORDERPARAMETER;
    action->fxn = (actionFunction) transformOrderParameter;
    break;
    case TRANSFORM_PAIRDIST: /* new */
    action->type = TRANSFORM_PAIRDIST;
    action->fxn = (actionFunction) transformPairDist;
    break;
    case TRANSFORM_IMGDIST: /* new */
    action->type = TRANSFORM_IMGDIST;
    action->fxn = (actionFunction) transformImgDist;
    break;
    case TRANSFORM_TRANSFORM:
    case TRANSFORM_NOOP:
    .
    .
  4. Finally, compile as usual.

Contact

If you have any questions regarding the code, installation/compilation, ideas for further development, contributions, etc. feel free to contact This email address is being protected from spambots. You need JavaScript enabled to view it..

References: