GMX-TRJCONV(1)
π¦ GMX-TRJCONV(1) π¦
okay bestie, buckle up β this is the GROMACS manual page for gmx-trjconv, aka the trajectory glow-up machine π
. It is long. It is iconic. We are doing this together, one section at a time, and I am holding your hand the whole way π«Ά
β¨ NAME β¨
gmx-trjconv β convert and manipulates trajectory files π
β¨ SYNOPSIS β¨
gmx trjconv [-f [<.xtc/.trr/...>]] [-s [<.tpr/.gro/...>]] [-n [<.ndx>]]
[-fr [<.ndx>]] [-sub [<.ndx>]] [-drop [<.xvg>]]
[-o [<.xtc/.trr/...>]] [-b <time>] [-e <time>]
[-tu <enum>] [-[no]w] [-xvg <enum>] [-skip <int>]
[-dt <time>] [-[no]round] [-dump <time>] [-t0 <time>]
[-timestep <time>] [-pbc <enum>] [-ur <enum>]
[-[no]center] [-boxcenter <enum>] [-box <vector>]
[-trans <vector>] [-shift <vector>] [-fit <enum>]
[-ndec <int>] [-[no]vel] [-[no]force] [-trunc <time>]
[-exec <string>] [-split <time>] [-[no]sep]
[-nzero <int>] [-dropunder <real>] [-dropover <real>]
[-[no]conect]
πΈ DESCRIPTION πΈ
okay so gmx trjconv converts trajectory files in so many ways, it's genuinely giving swiss army knife energy πͺβ¨. Here's the list of everything it does:
- go from one format to another π
- select a subset of atoms π
- change the periodicity representation π
- keep multimeric molecules together π«
- center atoms in the box π¦
- fit atoms to reference structure π
- reduce the number of frames βοΈ
- change the timestamps of the frames (
-t0and-timestep) β° - select frames within a certain range of a quantity given in an
.xvgfile π
heads up bestie: the option to write subtrajectories (-sub) based on the information obtained from cluster analysis has been removed fromgmx trjconvand is now part of[gmx extract-cluster]. it said "I'm moving out" and honestly, respect π
and also, no cap: gmx trjcat is better suited for concatenating multiple trajectory files. like, that's its whole thing, let it have it π
The following formats are supported for input and output: .xtc, .trr, .gro, .g96, .pdb and .tng. The file formats are detected from the file extension π. The precision of the .xtc 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 output can be single or double precision, depending on the precision of the gmx trjconv binary. Note that velocities are only supported in .trr, .tng, .gro and .g96 files πββοΈπ¨
Option -sep can be used to write every frame to a separate .gro, .g96 or .pdb file. By 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. When writing .tng output the file will contain one molecule type of the correct count if the selection name matches the molecule name and the selected atoms match all atoms of that molecule. Otherwise the whole selection will be treated as one single molecule containing all the selected atoms π§¬
There are two options for fitting the trajectory to a reference either for essential dynamics analysis, etc. 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:
- mol puts the center of mass of molecules in the box, and requires a run input file to be supplied with
-sπ₯ - res puts the center of mass of residues in the box π§ͺ
- atom 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 π. Note also that if your molecules are broken this will not work either π
- whole only makes broken molecules whole π©Ή
Option -ur sets the unit cell representation for options mol, res and atom of -pbc. All three options give different results for triclinic 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 octahedra or rhombic dodecahedra π·. The center for options tric and compact is tric (see below), unless the option -boxcenter is set differently π―
Option -center centers the system in the box. The user can select the group which is used to determine the geometrical center. Option -boxcenter sets the location of the center of the box for options -pbc and -center. The center options are: tric: half of the sum of the box vectors, rect: half of the box diagonal, zero: zero. Use option -pbc mol in addition to -center when you want all molecules in the box after the centering π¦β¨
Option -box sets the size of the new box. This option only works for leading dimensions and is thus generally only useful for rectangular boxes. If you want to modify only some of the dimensions, e.g. when reading from a trajectory, you can use -1 for those dimensions that should stay the same. It is not always possible to use combinations of -pbc, -fit, -ur and -center to do exactly what you want in one call to gmx trjconv. Consider using multiple calls, and check out the GROMACS website for suggestions π‘
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 gmx filter can reduce the number of frames while using low-pass frequency filtering, this reduces aliasing of high frequency motions π¬
Using -trunc gmx trjconv can truncate .trr in place, i.e. without copying the file. This is useful when a run has crashed during disk I/O (i.e. full disk), or when two contiguous trajectories must be concatenated without having double frames πΎπͺ
Option -dump can be used to extract a frame at or near one specific time from your trajectory. If the frames in the trajectory are not in temporal order, the result is unspecified β οΈ
Option -drop reads an .xvg file with times and values. When options -dropunder and/or -dropover are set, frames with a value below and above the value of the respective options will not be written ποΈ
π OPTIONS π
π Options to specify input files π
-f [<.xtc/.trr/...>](traj.xtc) β Trajectory:xtctrrcptgrog96pdbtngh5md-s [<.tpr/.gro/...>](topol.tpr) (Optional) β Structure+mass(db):tprgrog96pdbbrkent-n [<.ndx>](index.ndx) (Optional) β Index file-fr [<.ndx>](frames.ndx) (Optional) β Index file-sub [<.ndx>](cluster.ndx) (Optional) β Index file-drop [<.xvg>](drop.xvg) (Optional) β xvgr/xmgr file
π Options to specify output files π
-o [<.xtc/.trr/...>](trajout.xtc) β Trajectory:xtctrrgrog96pdbtngh5md
π Other options π
-b <time>(0) β Time of first frame to read from trajectory (default unit ps)-e <time>(0) β Time of last frame to read from trajectory (default unit ps)-tu <enum>(ps) β Unit for time values:fs,ps,ns,us,ms,s-[no]w(no) β View output.xvg,.xpm,.epsand.pdbfiles-xvg <enum>(xmgrace) β xvg plot formatting:xmgrace,xmgr,none-skip <int>(1) β Only write every nr-th frame-dt <time>(0) β Only write frame whent MOD dt = first time(ps)-[no]round(no) β Round measurements to nearest picosecond-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,mol,res,atom,nojump,cluster,whole-ur <enum>(rect) β Unit-cell representation:rect,tric,compact-[no]center(no) β Center atoms in box-boxcenter <enum>(tric) β Center for-pbcand-center:tric,rect,zero-box <vector>(0 0 0) β Size for new cubic box (default: read from input)-trans <vector>(0 0 0) β All coordinates will be translated by trans. This can advantageously be combined with-pbc mol -ur compact.-shift <vector>(0 0 0) β All coordinates will be shifted byframenr*shift-fit <enum>(none) β Fit molecule to ref structure in the structure file:none,rot+trans,rotxy+transxy,translation,transxy,progressive-ndec <int>(3) β Number of decimal places to write to.xtcoutput-[no]vel(yes) β Read and write velocities if possible-[no]force(no) β Read and write forces if possible-trunc <time>(-1) β Truncate input trajectory file after this time (ps)-exec <string>β Execute command for every output frame with the frame number as argument-split <time>(0) β Start writing new file whent MOD split = first time(ps)-[no]sep(no) β Write each frame to a separate.gro,.g96or.pdbfile-nzero <int>(0) β If the-sepflag is set, use these many digits for the file numbers and prepend zeros as needed-dropunder <real>(0) β Drop all frames below this value-dropover <real>(0) β Drop all frames above this value-[no]conect(no) β Add CONECT PDB records when writing.pdbfiles. Useful for visualization of non-standard molecules, e.g. coarse grained ones. Can only be done when a topology (tpr) file is present
π SEE ALSO (aka go read these too bestie)
gmx(1)β the main character herself π the top-level GROMACS command, go say hi
Wanna go deeper? Like, way deeper? π¦ There's a whole world of GROMACS lore waiting for you at:
http://www.gromacs.org/
no cap, the website is where all the extra info lives. it's giving "documentation hub" and honestly? iconic. πβ¨
Β©οΈ COPYRIGHT
2026, GROMACS development team π
that's it, that's the line. the devs made it, they own it, we love them for it fr fr π«Ά
okay bestie that's a wrap on gmx-trjconv(1) β you now know more about trajectory conversion than 99% of the group chat πβ¨
and for the record book π: this beauty is GROMACS 2026.4, fresh from Oct 02, 2026, filed under GMX-TRJCONV(1) in the man pages of legend π
go forth and convert some trajectories, you absolute genius π§ββοΈπ mwah π
π¦ where this page comes from
- nixpkgs unstable: gromacs 2026.4
- ubuntu stonking: gromacs-data 2026.4-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms