GMX-TRJCAT(1)

πŸ’– gmx-trjcat β€” bestie edition πŸ’–

okay so this is the gmx-trjcat(1) page from the GROMACS manual, and we're gonna get you fluent fr fr πŸ¦‹


✨ NAME ✨

gmx-trjcat β€” concatenate trajectory files πŸŽ€


✨ SYNOPSIS ✨

gmx trjcat [-f [<.xtc/.trr/...> [...]]] [-n [<.ndx>]] [-demux [<.xvg>]]
           [-o [<.xtc/.trr/...> [...]]] [-tu <enum>] [-xvg <enum>]
           [-b <time>] [-e <time>] [-dt <time>] [-[no]settime]
           [-[no]sort] [-[no]keeplast] [-[no]overwrite] [-[no]cat]

✨ DESCRIPTION ✨

So gmx trjcat 🫢 does one iconic thing: it takes a bunch of input trajectory files and glues them together in sorted order. That's the whole vibe. ✨

And bestie, when you get double time frames β€” like two frames sitting at the exact same time β€” the one that lives in the later file is the one that wins. Sorry to the other one πŸ’€

If you pass -settime, it's gonna ask you for the start time of each file, one by one. Interactive era πŸ’…

The input files come straight off the command line, so a command like:

gmx trjcat -f *.trr -o fixed.trr

should totally do the trick fr fr.

And if you use -cat? Then you're just pasting several files together β€” no removal of frames with identical time stamps. Zero merging, zero filtering, pure stacking. no cap. 🧚


One thing that's lowkey important: if the output file is also one of the input files, that option gets inferred automatically πŸ‘‘ β€” in that case that particular file gets appended to, which means you do NOT need to store double the amount of data (we love an efficient queen πŸ’–).

But obviously, the file you're appending to has to be the one with the lowest starting time, since you can only ever append at the end of a file. Physics said no exceptions. 😭


Now, if you give the -demux option 🌈, the N trajectories that get read are written out in a different order, as specified in the .xvg file. That .xvg file should contain something like:

0  0  1  2  3  4  5
2  1  0  2  3  5  4

The first number is the time, and the numbers after it point to trajectory indices. The frames corresponding to the numbers present at the first line get collected into the output trajectory. 🌸

And if the number of frames in the trajectory doesn't match the number in the .xvg file, the program tries to be smart. Beware. πŸ‘€

lowkey a warning, highkey a threat. beware bestie, that's all I'm saying πŸ™ˆ

✨ OPTIONS ✨

πŸ’– Options to specify input files:

  • -f [<.xtc/.trr/...> [...]] (traj.xtc) β€” the trajectory files! accepts: xtc trr cpt gro g96 pdb tng h5md
  • -n [<.ndx>] (index.ndx) (Optional) β€” index file
  • -demux [<.xvg>] (remd.xvg) (Optional) β€” xvgr/xmgr file

πŸ¦‹ Options to specify output files:

  • -o [<.xtc/.trr/...> [...]] (trajout.xtc) β€” the trajectory you're writing out! accepts: xtc trr gro g96 pdb tng h5md

🌟 Other options:

  • -tu <enum> (ps) β€” unit for time values: fs ps ns us ms s
  • -xvg <enum> (xmgrace) β€” xvg plot formatting: xmgrace xmgr none
  • -b <time> (-1) β€” first time to use (ps)
  • -e <time> (-1) β€” last time to use (ps)
  • -dt <time> (0) β€” only write a frame when t MOD dt = first time (ps) πŸ•°οΈ
  • -[no]settime (no) β€” change starting time interactively
  • -[no]sort (yes) β€” sort trajectory files (not frames!! games, don't get it twisted πŸ’…)
  • -[no]keeplast (no) β€” keep overlapping frames at the end of the trajectory
  • -[no]overwrite (no) β€” overwrite overlapping frames during appending
  • -[no]cat (no) β€” do not discard double time frames

✨ SEE ALSO ✨

More info about GROMACS is available at <http://www.gromacs.org/>. 🫢


2026, GROMACS development team


okay that's the whole page, you ATE that read bestie, no crumbs left πŸ“βœ¨ this was 2026.4, dated Oct 02, 2026 β€” go concatenate something iconic, mwah πŸ’œπŸŽ€

πŸ“¦ where this page comes from