GMX-MDMAT(1)

πŸ’– GMX-MDMAT πŸ’–

okay bestie, welcome to gmx-mdmat from the GROMACS manual (that's the GMX-MDMAT(1) page, in case you were wondering which one you opened) β€” it's the little tool that makes residue contact maps. and it devours. let's go 🫢


✨ NAME ✨

gmx-mdmat β€” calculate residue contact maps πŸ’…

🌸 SYNOPSIS 🌸

gmx mdmat [-f [<.xtc/.trr/...>]] [-s [<.tpr/.gro/...>]] [-n [<.ndx>]]
          [-mean [<.xpm>]] [-frames [<.xpm>]] [-no [<.xvg>]]
          [-b <time>] [-e <time>] [-dt <time>] [-xvg <enum>]
          [-t <real>] [-nlevels <int>]

like yes it's a lot of brackets, no we are not scared of them 😌

πŸ¦‹ DESCRIPTION πŸ¦‹

so gmx mdmat builds distance matrices out of the smallest distance between residue pairs. that's the whole vibe. the nearest-atom distance between each residue pair, laid out in a grid. iconic.

and then β€” here's the fun part β€” with -frames, those distance matrices can be stored so you can watch how the tertiary structure changes as a function of time. it's giving "movie of your protein's whole personality shifting" 😭

⚠️ but bestie, listen: if you choose your options unwisely, this may generate a large output file. that is not a drill. that is the manpage literally warning you. frames mode = many matrices = chonky file. be mindful 🫢

by default though? just the averaged matrix over the whole trajectory gets output. nice and chill. no notes. πŸ’–

oh and also β€” you can get a count of the number of different atomic contacts between residues over the whole trajectory. so instead of just "how close", it's "how often were these two residues in contact", which is honestly the tea β˜•

and then you can feed the output into gmx xpm2ps to make a PostScript (tm) plot. pretty picture time πŸŽ€


🌈 OPTIONS 🌈

πŸ’œ Options to specify input files

  • -f [<.xtc/.trr/...>] (default traj.xtc) β€” the trajectory. formats it'll eat: xtc trr cpt gro g96 pdb tng h5md πŸ”₯
  • -s [<.tpr/.gro/...>] (default topol.tpr) β€” structure + mass(db). formats: tpr gro g96 pdb brk ent
  • -n [<.ndx>] (default index.ndx) (optional) β€” your index file, if you want to be picky about groups πŸ’…

πŸ’– Options to specify output files

  • -mean [<.xpm>] (default dm.xpm) β€” X PixMap compatible matrix file. this is the averaged one, the default star of the show πŸ‘‘
  • -frames [<.xpm>] (default dmf.xpm) (optional) β€” X PixMap compatible matrix file. one per frame, so heads up about file size 😭
  • -no [<.xvg>] (default num.xvg) (optional) β€” xvgr/xmgr file. this is where that contact-count business goes.

✨ Other options

  • -b <time> (default 0) β€” time of first frame to read from trajectory, default unit ps ⏰
  • -e <time> (default 0) β€” time of last frame to read from trajectory, default unit ps ⏰
  • -dt <time> (default 0) β€” only use a frame when t MOD dt = first time, default unit ps (yes, that exact condition, iykyk)
  • -xvg <enum> (default xmgrace) β€” xvg plot formatting. your choices are literally: xmgrace, xmgr, none 🎨
  • -t <real> (default 1.5) β€” trunc distance. that's it, that's the description βœ‚οΈ
  • -nlevels <int> (default 40) β€” discretize distance in this number of levels πŸͺœ

πŸ‘‘ SEE ALSO πŸ‘‘

more info about GROMACS lives at <http://www.gromacs.org/> β€” go peek, it's giving lore πŸ“š

2026, GROMACS development team


and that's the whole page, bestie!! this was GROMACS version 2026.4, dated Oct 02, 2026 β€” go make some gorgeous little contact maps, drink water, and remember: -frames responsibly πŸ§šπŸ’–βœ¨

πŸ“¦ where this page comes from