CPPTRAJ one-liners


Detailed description for most of these examples is available in the Running CPPTRAJ page.

Create a PDB file from a topology and a coordinate file. cpptraj -p topology-file.prmtop -y coordinate-file.coords -x output-file.pdb
Review how many frames are in a trajectory file cpptraj -p topology-file.prmtop -y coordinate-file.coords -tl
To read a file that contains CPPTRAJ commands cpptraj -i INPUTFILE
To inspect residue number one from a topology. This also works for atoms using @1 instead of :1 cpptraj -p topology-file.prmtop --mask :1
To view more information (#Res, Name, First atom, Last atom, number of atoms, #Orig and #Mol) for residues one through ten. cpptraj -p topology-file.prmtop --resmask :1-10
To extract a single frame from a trajectory file, use the -ya keyword to send arguments to trajin cpptraj -p topology-file.prmtop -y trajectory-file.nc -ya 'lastframe' -x output-file.pdb