Action Commands

Commands to perform analysis on frames and topology.

Actions in CPPTRAJ operate on frames read in by the trajin or ensemble commands one at a time and extract derived data, modify the coordinates/topology in some way, or both. Most Actions in CPPTRAJ function exactly the way they do in ptraj and are backwards-compatible. Some Action commands in CPPTRAJ have extra functionality compared to ptraj (such as the per-residue RMSD function of the rmsd Action, or the ability to write out stripped topologies for visualization in the strip Action), while other Actions produce slightly different output (like the hbond/secstruct Actions).

Unlike some other command types, when an Action command is issued it is by default added to the Action queue and is not executed until trajectory processing is started (e.g. by a run or go command). However, Actions can be executed immediately on COORDS data sets via the crdaction command.

When a frame is modified by an Action, it is modified for every Action that follows them during trajectory processing. For example, given a solvated system with water residues  named WAT and the following Action commands:

rmsd R1 first :WAT out water-rmsd.dat
 strip :WAT
 rmsd R2 first :WAT out water-rmsd-2.dat

the first rms command will be valid, but the second rms command will not since all residues named WAT are removed from the state by the strip command. Note that for commands which can use a reference mask as well as a target mask (e.g. rms, drmsd, symmrmsd, etc.) there must be a 1 to 1 correspondence between the atoms in each mask, i.e. the number of atoms and the ordering of selected atoms must be the same.

The following Actions are available. If an Action may modify coordinate/topology information for subsequent Actions it is denoted with an X in the Mod column.

Command Description Mod
addatom Add a dummy atom.
align Align structure to a reference.
angle Calculate the angle between three points.
areapermol Calculate area per molecule for molecules in a specified plane.
atomiccorr Calculate average correlation between motions of specified atoms.
atomicfluct, rmsf Calculate root mean square fluctuation of specified atoms/residues.
atommap Attempt to create a map between atoms in molecules with different atom ordering. X
autoimage Automatically re-image coordinates. X
average Calculate average structure.
avgbox Calculate average unit cell (box), primarily for unwrapping NPT trajectories.
avgcoord This command is deprecated. Use vector center (optionally with keyword magnitude) instead.
bounds Calculate the min/max coordinates for specified atoms. Can be used to create grid data sets.
box Set or overwrite box information for frames.
center Center specified coordinates to box center or onto reference structure. X
check, checkoverlap, checkstructure Check for bad atomic overlaps or bond lengths. Can be used to skip corrupted frames.
checkchirality Report chirality around alpha carbons in amino acids (L, D).
closest, closestwaters Retain only the specified number of solvent molecules closest to specified solute. X
clusterdihedral Assign frames into clusters based on binning of backbone dihedral angles in amino acids.
contacts Older version of nativecontacts, retained for backwards compatibility.
createcrd Create a COORDS data set from input frames.
createreservoir Create a structure reservoir for use with reservoir REMD simulations.
density Calculate density along a coordinate.
diffusion Calculate translational diffusion of molecules.
dihedral Calculate the dihedral angle using four points.
dihrms, dihedralrms Calculate the RMSD of dihedrals to dihedrals in a reference structure.
dipole Bin dipoles of solvent molecules in 3D grid. Not well tested, may be obsolete.
distance Calculate the distance between two points.
drms, drmsd Calculate the RMSD of distance pairs within selected atoms.
dssp, secstruct Calculate secondary structure content using the DSSP algorithm.
enedecomp Perform per-atom energy decomposition.
energy Calculate simple bond, angle, dihedral, and non-bonded energy terms (no PME).
esander Calculate energies using via SANDER; requires compilation with the SANDER API.
filter Filter frames for subsequent Actions using data sets and user defined criteria.
fixatomorder Fix atom ordering so that all atoms in molecules are sequential. X
fiximagedbonds Fix bonds which have been split across periodic boundaries by imaging.
gist Perform grid inhomogenous solvation theory.
grid Bin selected atoms on a 3D grid.
hbond Calculate hydrogen bonds using geometric criteria.
image Re-image coordinates. The autoimage command typically provides better results. X
jcoupling Calculate J-coupling values from specified dihedral angles.
keep Keep specied atoms in system. X
lessplit Split/average frames from LES trajectories.
lie Calculate linear interaction energy between user-specified ligand and surroundings.
lipidorder Calculate order parameters for lipids in planar membranes.
lipidscd Calculate lipid order parameters SCD(|<P2>|) for lipid chains. Automatically identifies lipids.
makestructure Modify structure by applying dihedral values to specified residues.  X
mask Print the results of selection by specified atom mask. Good for distance-based masks.
matrix Calculate a matrix of the specified type from input coordinates.
mindist/maxdist Calculate the minimum or maximum distance between pairs of atoms/residues/molecules.
minimage Calculate minimum non-self imaged distance between atoms in specified masks.
molsurf Calculate Connolly surface area of specified atoms. Cannot do partial surface areas.
multidihedral Calculate multiple dihedral angles of specified/given types.
multipucker Calculate specified pucker types for residues in given range..
multivector Calculate multiple vectors between specified atoms.
nastruct Perform nucelic acid structure analysis.
nativecontacts Calculate native contacts within a region or between two regions using a given reference. Can also be used to get min/max distances between groups of atoms.
outtraj Write frames to a trajectory file within a list of Actions.
pairdist Calculate pair distribution function.
pairwise Calculate pair-wise non-bonded energies.
principal Calculate and optionally align system along principal axes. X
projection Project coordinates along given eigenvectors.
pucker Calculate ring pucker using five or six points.
radgyr, rog Calculate radius of gyration (and optionally tensor) for specified atoms.
radial, rdf Calculate radial distribution function.
randomizeions Swap specified ions with randomly selected solvent molecules. X
remap Re-map atoms according to a given data set.
replicatecell Replicate unit cell in specified (or all) directions for specfied atoms and write to trajectory.
rms, rmsd Perform best fit of coordinates to reference and calculate coordinate RMSD. X Fitting can be disabled. X
rotate Rotate the system around X/Y/Z axes, a specified axis, or via given rotation matrices. X
runavg, runningaverage Calculate the running average of coordinates over specified window size. X
scale Scale coordinates in X/Y/Z directions by specified factors.  X
setvelocity Set velocities for specified atoms using Maxwellian distribution based on given temperature.
spam SPAM method for estimating relative free energies of waters in hydration shell around proteins.  X
stfcdiffusion Alternative translational diffusion calculation which can calculate diffusion in specified regions.
strip Remove specified atoms from the system.
surf Calculate the LCPO surface area of specified atoms. Can do partial surface areas.
symmrmsd Calculate symmetry-corrected RMSD.  X
temperature Calculate system temperature using velocities of specified atoms.
time Add/remove/modify time information in frames.
trans, translate Translate specified atoms by specified amounts in X/Y/Z directions.  X
unstrip Undo all previous strip Action commands.
unwrap Reverse of image; unwrap selected atoms so they have continuous trajectories.  X
vector Calculate various types of vector quantities.
velocityautocorr Calculate velocity autocorrelation function.
volmap Create volumetric map for specified coordinates; similar to grid but takes into account atomic radii. Similar to VMD volmap.
volume Calculate unit cell volume.
watershell Calculate the number of waters in the first and second solvation shells based on distance criteria.
xtalsymm Re-image coordinates based on crystal space group symmetry operations and asymmetric unit volume. X