The current version of ptraj (previously called rdparm) is
really two programs:
rdparm: a program to read, print (and modify) AMBER prmtop files
usage: rdparm prmtop
ptraj: a program to process coordinates/trajectories
usage: ptraj prmtop script
Which code is used at runtime depends on the name of the executable
(note that both rdparm and ptraj are created by default
from the same source code when the programs are compiled with the
supplied Makefile). If the executable name contains the string
"rdparm", then the rdparm functionality is
obtained. rdparm is semi-interactive (type ? or help
for a list of commands) and requires specification of an AMBER prmtop
file (this prmtop is specified as a filename typed on the
command line; note that if no filename is specified you will be
prompted for a filename). For more information about rdparm,
see either the supplied HTML file "rdparm.html" or the section on
rdparm that follows the discussion of the ptraj commands.
If the executable name does not contain the string "rdparm",
ptraj is run instead. ptraj also requires specification of
parameter/topology information, however it currently supports both the
AMBER prmtop format and (I know, sacrilege!) CHARMM psf files.
Note that the ptraj program can also be accessed from
rdparm by typing ptraj.
The commands to ptraj can either be piped in through standard
input or supplied in a file, where the filename (script) is
passed in as the second command line argument. Note that if the
prmtop filename is absent, the user will be prompted for a
filename.
The code is written in ANSI compliant C and it fairly extensively documented. Along with this code is distributed public domain C code from the Computer Graphics Lab at UCSF for reading and writing PDB files.
Usage: ptraj prmtop script
ptraj is a program to process and
analyze sets of 3-D coordinates read in from a series of input
coordinate files (in various formats as discussed below). For each
coordinate set read in, a sequence of events or ACTIONS is
performed (in the order specified) on each of the configurations (set
of coordinates) read in. After processing all the configurations, a
trajectory file and other supplementary data can be optionally written
out.
To use the program it is necessary to (1) read in a parameter/topology file, (2) set up a list of input coordinate files, (3) optionally specify an output file and (4) specify a series of actions to be performed on each coordinate set read in.
(1) reading in a parameter/topology file:
This is done at startup and currently either an AMBER prmtop or CHARMM psf file can be read
in. The type of the file is autodetected. The information in these files is used
to setup the global STATE (ptrajState *) which gives
information about the number of atoms, residues, atom names, residue names,
residue boundaries, etc. This information is used to guide the reading
of input coordinates which MUST match the order specified by the
state, otherwise garbage may be obtained (although this may be detected by
the program for some file formats, leading to a warning to the user). In other
words, when reading a pdb file, the atom order must correspond exactly
to that of the parameter/topology information; in the pdb the
names/residues are ignored and only the coordinates are read in based.
(2) set up a list of input coordinate files:
This is done with the trajin command (described in more
detail below) which specifies the name of a coordinate file and
optionally the start, stop and offset for reading coordinates. The
type of coordinate file is detected automatically and currently the
following input coordinate types are supported:
- AMBER trajectory
- AMBER restart (or inpcrd)
- PDB
- CHARMM (binary) trajectory
- Scripps "binpos" binary trajectory
(3) optionally specify an output trajectory file:
This is done with the trajout command (discussed
in more detail below). Trajectories can currently be written in AMBER
trajectory (default), AMBER restrt, Scripps binpos, PDB or CHARMM
trajectory (in little or big endian binary format).
(4) specify a list of actions:
There are a variety of coordinate analysis/manipulation actions
provided and each of these specified-- note that each action can be
repeated-- is applied sequentially to the coordinates in the order
listed by the user in the input file.
As mentioned above, input to ptraj is in the form of commands
listed in a script (or if absent, from text on standard input).
An example input file to ptraj follows: