GMX-TRAJ(1)

🌸 NAME 🌸

gmx-traj β€” the little GROMACS icon that plots x, v, f, box, temperature and rotational energy straight out of your trajectories πŸ’–βœ¨


πŸŽ€ SYNOPSIS πŸŽ€

          gmx traj [-f [<.xtc/.trr/...>]] [-s [<.tpr/.gro/...>]] [-n [<.ndx>]]
                   [-ox [<.xvg>]] [-oxt [<.xtc/.trr/...>]] [-ov [<.xvg>]]
                   [-of [<.xvg>]] [-ob [<.xvg>]] [-ot [<.xvg>]] [-ekt [<.xvg>]]
                   [-ekr [<.xvg>]] [-vd [<.xvg>]] [-cv [<.pdb>]] [-cf [<.pdb>]]
                   [-av [<.xvg>]] [-af [<.xvg>]] [-b <time>] [-e <time>]
                   [-dt <time>] [-tu <enum>] [-[no]w] [-xvg <enum>] [-[no]com]
                   [-[no]pbc] [-[no]mol] [-[no]nojump] [-[no]x] [-[no]y]
                   [-[no]z] [-ng <int>] [-[no]len] [-[no]fp] [-bin <real>]
                   [-ctime <real>] [-scale <real>]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so gmx traj is literally that girl when it comes to plotting. She plots coordinates, velocities, forces and/or the box. that's her whole thing. no cap. 🫢

pop -com and the coordinates, velocities and forces all get calculated for the center of mass of each group instead of per-atom vibes. and the moment you set -mol, the numbers in your index file get read as molecule numbers instead of atom numbers, and then the exact same procedure as -com runs for each molecule. bestie said "molecules, not atoms, periodt." πŸ’…

-ot plots the temperature of each group β€” but only if velocities are actually present in the trajectory file. and heads up, there is no corrections made for constrained degrees of freedom! 😭 dramatic but true. also, -ot implies -com. so it's giving group-temperature-energy fr fr.

-ekt and -ekr plot the translational and rotational kinetic energy of each group, again only if velocities are present in the trajectory file. and yep β€” both of them imply -com too. πŸ‘‘

-cv and -cf write the average velocities and average forces as temperature factors into a .pdb file, using either the average coordinates or the coordinates at whatever time you gave -ctime. the temperature factors are scaled so the maximum is 10, and if you want a different scaling you change it with -scale. πŸŽ€

to get the velocities or forces of one single frame, set both -b and -e to the time of the frame you want. and when you're averaging over frames you might need -nojump to actually get the correct average coordinates β€” lowkey important, don't skip it. πŸ™ˆ if you select either of these options, the average force and average velocity for each atom are written to an .xvg file as well (that's the one you name with -av or -af).

-vd computes a velocity distribution β€” meaning the norm of the vector is what gets plotted. and on top of that, the kinetic energy distribution is given in the same graph. two-for-one, ate. ✨

also: check out gmx trajectory if you want to plot similar data but for selections. iykyk πŸ’–

✨ OPTIONS ✨

πŸ’– Options to specify input files πŸ’–

  • -f [<.xtc/.trr/...>] (traj.xtc) β€” your trajectory file, serving formats: xtc trr cpt gro g96 pdb tng h5md
  • -s [<.tpr/.gro/...>] (topol.tpr) β€” structure + mass(db), main character formats: tpr gro g96 pdb brk ent
  • -n [<.ndx>] (index.ndx) (Optional) β€” the index file, if you have one

πŸ’– Options to specify output files πŸ’–

  • -ox [<.xvg>] (coord.xvg) (Optional) β€” an xvgr/xmgr file πŸŽ€
  • -oxt [<.xtc/.trr/...>] (coord.xtc) (Optional) β€” trajectory output, formats: xtc trr cpt gro g96 pdb tng h5md
  • -ov [<.xvg>] (veloc.xvg) (Optional) β€” an xvgr/xmgr file
  • -of [<.xvg>] (force.xvg) (Optional) β€” an xvgr/xmgr file
  • -ob [<.xvg>] (box.xvg) (Optional) β€” an xvgr/xmgr file
  • -ot [<.xvg>] (temp.xvg) (Optional) β€” an xvgr/xmgr file
  • -ekt [<.xvg>] (ektrans.xvg) (Optional) β€” an xvgr/xmgr file
  • -ekr [<.xvg>] (ekrot.xvg) (Optional) β€” an xvgr/xmgr file
  • -vd [<.xvg>] (veldist.xvg) (Optional) β€” an xvgr/xmgr file
  • -cv [<.pdb>] (veloc.pdb) (Optional) β€” a Protein data bank file 🧬
  • -cf [<.pdb>] (force.pdb) (Optional) β€” a Protein data bank file 🧬
  • -av [<.xvg>] (all_veloc.xvg) (Optional) β€” an xvgr/xmgr file
  • -af [<.xvg>] (all_force.xvg) (Optional) β€” an xvgr/xmgr file

🌈 Other options 🌈

  • -b <time> (0) β€” time of the first frame to read from the trajectory (default unit is ps)
  • -e <time> (0) β€” time of the last frame to read from the trajectory (default unit is ps)
  • -dt <time> (0) β€” only use a frame when t MOD dt = first time (default unit is ps)
  • -tu <enum> (ps) β€” unit for time values, pick your fave: fs, ps, ns, us, ms, s
  • -[no]w (no) β€” view the output .xvg, .xpm, .eps and .pdb files πŸ‘€
  • -xvg <enum> (xmgrace) β€” xvg plot formatting options: xmgrace, xmgr, none
  • -[no]com (no) β€” plot data for the com (center of mass) of each group
  • -[no]pbc (yes) β€” make molecules whole for COM
  • -[no]mol (no) β€” the index contains molecule numbers instead of atom numbers
  • -[no]nojump (no) β€” remove the jumps of atoms across the box
  • -[no]x (yes) β€” plot the X-component
  • -[no]y (yes) β€” plot the Y-component
  • -[no]z (yes) β€” plot the Z-component
  • -ng <int> (1) β€” number of groups to consider
  • -[no]len (no) β€” plot the vector length
  • -[no]fp (no) β€” full precision output
  • -bin <real> (1) β€” binwidth for the velocity histogram, in nm/ps
  • -ctime <real> (-1) β€” use the frame at this time for x in -cv and -cf instead of the average x
  • -scale <real> (0) β€” scale factor for .pdb output; 0 means autoscale ✨

πŸ‘‘ SEE ALSO πŸ‘‘


2026, GROMACS development team 🫢


and that's the whole page bestie, tysm for reading πŸ’– this was the GROMACS 2026.4 gmx-traj(1) page, dated Oct 02, 2026. go plot something iconic. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from