Usage | Code Modifications (ptraj)

We have extended the functionality of the ptraj utility (part of the AmberTools (link opens in a new window) which are freely downloadable from the Amber web page (link opens in a new window)) to include some useful routines. One key feature of the new diffusion and mean residence time codes is that it allows dynamic selection of regions (at the moment based on fixed distances between sets of atoms). The functions in detail are:

  1. A mostly rewritten diffusion code.
  2. Mean residence time calculations based on a) the survival function and b) the "standard" autocorrelation function [1–3]. (Alternative method (link opens in a new window) described in selected responses (link opens in a new window) from the Amber mail reflector).
  3. Calculation of the density along a coordinate useful e.g. for membrane simulations. (Alternatively, the output of the grid command can be post-processed to get similar results.)
  4. Calculation of order parameters for lipids in planar membranes.
  5. Calculation of the pair-distance distribution function P(r).
  6. A simple routine to calculate distances to nearest neighbour boxes.


  • May 24, 2013: first snapshot of cpptraj containing diffusion, density, order parameter and pair distance code. Note: this is is still early code so bugs may still exist. Use this new code with care and double check all results!
  • Apr 29, 2013: modified radgyr to output all tensor components of Rg. New archive file.
  • Apr 24, 2013: updated to AmberTools 13.
  • Mar 6, 2013: header in diffusion output explaining the columns.
  • Feb 25, 2013: Fixed a memory allocation bug in transformDensity.
  • Jan 24, 2013: Fixes in transformMRT. Updated usage instructions.
  • Jan 23, 2013: Fixed more 64bit bugs.


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..


  1. R. W. Impey, P. A. Madden and I. R. McDonald, J. Phys. Chem. 87(1983), 5071.
  2. A. E. Garcia and L. Stiller, J. Comput. Chem. 14(1993), 1396.
  3. C. Schröder, T. Rudas, S. Boresch, O. Steinhauser, J. Chem. Phys. 124(2006), 234907.