## trjconv

Main Table of Contents

VERSION 3.2.0
Sun 25 Jan 2004

### Description

trjconv can convert trajectory files in many ways:
1. from one format to another
2. select a subset of atoms
3. remove periodicity from molecules
4. keep multimeric molecules together
5. center atoms in the box
6. fit atoms to reference structure
7. reduce the number of frames
8. change the timestamps of the frames (`-t0` and `-timestep`)

The program `trjcat` can concatenate multiple trajectory files.

Currently seven formats are supported for input and output: `.xtc`, `.trr`, `.trj`, `.gro`, `.g96`, `.pdb` and `.g87`. The file formats are detected from the file extension. The precision of `.xtc` and `.gro` output is taken from the input file for `.xtc`, `.gro` and `.pdb`, and from the `-ndec` option for other input formats. The precision is always taken from `-ndec`, when this option is set. All other formats have fixed precision. `.trr` and `.trj` output can be single or double precision, depending on the precision of the trjconv binary. Note that velocities are only supported in `.trr`, `.trj`, `.gro` and `.g96` files.

Option `-app` can be used to append output to an existing trajectory file. No checks are performed to ensure integrity of the resulting combined trajectory file.

Option `-sep` can be used to write every frame to a seperate .gro, .g96 or .pdb file, default all frames all written to one file. `.pdb` files with all frames concatenated can be viewed with `rasmol -nmrpdb`.

It is possible to select part of your trajectory and write it out to a new trajectory file in order to save disk space, e.g. for leaving out the water from a trajectory of a protein in water. ALWAYS put the original trajectory on tape! We recommend to use the portable `.xtc` format for your analysis to save disk space and to have portable files.

There are two options for fitting the trajectory to a reference either for essential dynamics analysis or for whatever. The first option is just plain fitting to a reference structure in the structure file, the second option is a progressive fit in which the first timeframe is fitted to the reference structure in the structure file to obtain and each subsequent timeframe is fitted to the previously fitted structure. This way a continuous trajectory is generated, which might not be the case when using the regular fit method, e.g. when your protein undergoes large conformational transitions.

Option `-pbc` sets the type of periodic boundary condition treatment:
* `whole` puts the atoms in the box and then makes broken molecules whole (a run input file is required). Atom number 1 of each molecule will be inside the box.
* `com` puts the center of mass of all <it>residues</it> in the box. Not that this can break molecules that consist of more than one residue (e.g. proteins).
* `inbox` puts all the atoms in the box.
* `nojump` checks if atoms jump across the box and then puts them back. This has the effect that all molecules will remain whole (provided they were whole in the initial conformation), note that this ensures a continuous trajectory but molecules may diffuse out of the box. The starting configuration for this procedure is taken from the structure file, if one is supplied, otherwise it is the first frame.
* `cluster` clusters all the atoms in the selected index such that they are all closest to the center of mass of the cluster which is iteratively updated. Note that this will only give meaningful results if you in fact have a cluster. Luckily that can be checked afterwards using a trajectory viewer.
`-pbc` is ignored when `-fit` or `-pfit` is set, in that case molecules will be made whole.

Option `-ur` sets the unit cell representation for options `whole` and `inbox` of `-pbc`. All three options give different results for triclinc boxes and identical results for rectangular boxes. `rect` is the ordinary brick shape. `tric` is the triclinic unit cell. `compact` puts all atoms at the closest distance from the center of the box. This can be useful for visualizing e.g. truncated octahedrons.

Option `-center` centers the system in the box. The user can select the group which is used to determine the geometrical center. Use option `-pbc whole` in addition to `-center` when you want all molecules in the box after the centering.

With `-dt` it is possible to reduce the number of frames in the output. This option relies on the accuracy of the times in your input trajectory, so if these are inaccurate use the `-timestep` option to modify the time (this can be done simultaneously). For making smooth movies the program `g_filter` can reduce the number of frames while using low-pass frequency filtering, this reduces aliasing of high frequency motions.

Using `-trunc` trjconv can truncate `.trj` in place, i.e. without copying the file. This is useful when a run has crashed during disk I/O (one more disk full), or when two contiguous trajectories must be concatenated without have double frames.

`trjcat` is more suitable for concatenating trajectory files.

Option `-dump` can be used to extract a frame at or near one specific time from your trajectory.

### Files

option | filename | type | description
--- | --- | --- | ---
`-f` | `traj.xtc` | Input | Generic trajectory: xtc trr trj gro g96 pdb
`-o` | `trajout.xtc` | Output | Generic trajectory: xtc trr trj gro g96 pdb
`-s` | `topol.tpr` | Input, Opt. | Structure+mass(db): tpr tpb tpa gro g96 pdb xml
`-n` | `index.ndx` | Input, Opt. | Index file
`-fr` | `frames.ndx` | Input, Opt. | Index file

### Other options

option | type | default | description
--- | --- | --- | ---
`-[no]h` | bool | `no` | Print help info and quit
`-nice` | int | `19` | Set the nicelevel
`-b` | time | `-1` | First frame (ps) to read from trajectory
`-e` | time | `-1` | Last frame (ps) to read from trajectory
`-tu` | enum | `ps` | Time unit: `ps`, `fs`, `ns`, `us`, `ms`, `s`, `m` or `h`
`-[no]w` | bool | `no` | View output xvg, xpm, eps and pdb files
`-skip` | int | `1` | Only write every nr-th frame
`-dt` | time | `0` | Only write frame when t MOD dt = first time (ps)
`-dump` | time | `-1` | Dump frame nearest specified time (ps)
`-t0` | time | `0` | Starting time (ps) (default: don't change)
`-timestep` | time | `0` | Change time step between input frames (ps)
`-pbc` | enum | `none` | PBC treatment (see help text for full description): `none`, `whole`, `inbox`, `nojump`, `cluster` or `com`
`-ur` | enum | `rect` | Unit-cell representation: `rect`, `tric` or `compact`
`-[no]center` | bool | `no` | Center atoms in box
`-box` | vector | `0 0 0` | Size for new cubic box (default: read from input)
`-shift` | vector | `0 0 0` | All coordinates will be shifted by framenr*shift
`-fit` | enum | `none` | Fit molecule to ref structure in the structure file: `none`, `rot+trans`, `translation` or `progressive`
`-ndec` | int | `3` | Precision for .xtc and .gro writing in number of decimal places
`-[no]vel` | bool | `yes` | Read and write velocities if possible
`-[no]force` | bool | `no` | Read and write forces if possible
`-trunc` | time | `-1` | Truncate input trj file after this time (ps)
`-exec` | string | `` | Execute command for every output frame with the frame number as argument
`-[no]app` | bool | `no` | Append output
`-split` | time | `0` | Start writing new file when t MOD split = first time (ps)
`-[no]sep` | bool | `no` | Write each frame to a separate .gro, .g96 or .pdb file
`-[no]ter` | bool | `no` | Use 'TER' in pdb file as end of frame in stead of default 'ENDMDL'

http://www.gromacs.org
gromacs@gromacs.org