GMX-CONVERT-TRJ(1)

✨ NAME ✨

okay so this is gmx-convert-trj, from the GROMACS manual (section 1, bestie) β€” and it does exactly what it says on the tin: it converts between different trajectory types. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

gmx convert-trj [-f [<.xtc/.trr/...>]] [-s [<.tpr/.gro/...>]]
             [-n [<.ndx>]] [-o [<.xtc/.trr/...>]] [-b <time>]
             [-e <time>] [-dt <time>] [-tu <enum>]
             [-fgroup <selection>] [-xvg <enum>] [-[no]rmpbc]
             [-[no]pbc] [-sf <file>] [-selrpos <enum>]
             [-select <selection>] [-vel <enum>] [-force <enum>]
             [-atoms <enum>] [-precision <int>] [-starttime <time>]
             [-timestep <time>] [-box <vector>]

πŸ’– DESCRIPTION πŸ’–

so like. gmx convert-trj converts trajectory files between different formats. it literally writes every GROMACS-supported file format from the supported input formats. no cap, all of them. πŸ”₯

it also comes with a lil selection of options to modify individual trajectory frames, including options to produce slimmer output files (yes queen, smaller trajectories). and you can also straight-up replace the particle information stored in the input trajectory with the ones from a structure file. it's giving glow-up but for atoms. ✨

the module can also generate subsets of trajectories based on selections you supply. so you're the main character picking and choosing what stays. πŸ‘‘


🌸 OPTIONS 🌸

πŸŽ€ Options to specify input files

  • -f [<.xtc/.trr/...>] (traj.xtc) (Optional) β€” input trajectory or single configuration. she accepts: xtc trr cpt gro g96 pdb tng h5md πŸ¦‹
  • -s [<.tpr/.gro/...>] (topol.tpr) (Optional) β€” input structure. she accepts: tpr gro g96 pdb brk ent 🌸
  • -n [<.ndx>] (index.ndx) (Optional) β€” extra index groups, if you've got some πŸ’œ

πŸ’… Options to specify output files

  • -o [<.xtc/.trr/...>] (trajout.xtc) β€” output trajectory. options are: xtc trr cpt gro g96 pdb tng h5md ✨

🧚 Other options

  • -b <time> (0) β€” first frame (ps) to read from the trajectory πŸ•
  • -e <time> (0) β€” last frame (ps) to read from the trajectory πŸ•
  • -dt <time> (0) β€” only use a frame if t MOD dt == first time (ps). fr fr, that's the condition πŸ’€
  • -tu <enum> (ps) β€” unit for time values: fs, ps, ns, us, ms, s ⏳
  • -fgroup <selection> β€” atoms stored in the trajectory file (if not set, assume first N atoms) πŸ™ˆ
  • -xvg <enum> (xmgrace) β€” plot formatting: xmgrace, xmgr, none 🎨
  • -[no]rmpbc (yes) β€” make molecules whole for each frame 🫢
  • -[no]pbc (yes) β€” use periodic boundary conditions for distance calculation 🌈
  • -sf <file> β€” provide selections from files πŸ“‚
  • -selrpos <enum> (atom) β€” selection reference positions, and babes there are a LOT: atom, res_com, res_cog, mol_com, mol_cog, whole_res_com, whole_res_cog, whole_mol_com, whole_mol_cog, part_res_com, part_res_cog, part_mol_com, part_mol_cog, dyn_res_com, dyn_res_cog, dyn_mol_com, dyn_mol_cog πŸ‘‘
  • -select <selection> β€” selection of particles to write to the file ✍️
  • -vel <enum> (preserved-if-present) β€” save velocities from the frame if possible: preserved-if-present, always, never πŸ’¨
  • -force <enum> (preserved-if-present) β€” save forces from the frame if possible: preserved-if-present, always, never πŸ’ͺ
  • -atoms <enum> (preserved-if-present) β€” decide on providing new atom information from topology vs using the current frame atom information: preserved-if-present, always-from-structure, never, always 🧬
  • -precision <int> (3) β€” set output precision to a custom value πŸ”
  • -starttime <time> (0) β€” change start time for the first frame ⏰
  • -timestep <time> (0) β€” change the time between different frames ⏱️
  • -box <vector> β€” new diagonal box vector for the output frame πŸ“¦

πŸ”₯ SEE ALSO πŸ”₯

more info about GROMACS is available at <http://www.gromacs.org/>. go look, bestie, it's iconic 🌐


2026, GROMACS development team


and that's the whole vibe check 🫢 this page is GROMACS 2026.4, dated Oct 02, 2026 β€” so if you're reading this in the future, hiii, you're a time traveler, slay πŸ’…βœ¨

πŸ“¦ where this page comes from