GMX-MSD(1)
π¦ GMX-MSD(1) β the GROMACS girlie's guide to gmx-msd
okay so bestie, you're holding the manual page for gmx-msd from GROMACS, and it's literally the tool for "how far did all my atoms wander off, and how fast." no cap, it's a good one. let's get into it π
β¨ NAME β¨
gmx-msd β compute mean squared displacements. that's it. that's the vibe. π«Ά
β¨ SYNOPSIS β¨
gmx msd [-f [<.xtc/.trr/...>]] [-s [<.tpr/.gro/...>]] [-n [<.ndx>]]
[-o [<.xvg>]] [-mol [<.xvg>]] [-b <time>] [-e <time>]
[-dt <time>] [-tu <enum>] [-fgroup <selection>] [-xvg <enum>]
[-[no]rmpbc] [-[no]pbc] [-sf <file>] [-selrpos <enum>]
[-seltype <enum>] [-sel <selection>] [-type <enum>]
[-lateral <enum>] [-trestart <real>] [-maxtau <real>]
[-beginfit <real>] [-endfit <real>]
like. look at all those flags. so many little knobs. we love options in this house π
β¨ DESCRIPTION β¨
so gmx msd computes the mean square displacement (MSD) of atoms starting from a set of initial positions. it's giving "where did you go bestie, and how fast." and the reason we care is lowkey iconic: it's an easy way to compute the diffusion constant using the Einstein relation.
the time between the reference points for the MSD calculation is set with -trestart. π
the diffusion constant gets calculated by least squares fitting a straight line (D*t + c) through the MSD(t) from -beginfit to -endfit. and heads up β t here is time from the reference positions, not simulation time, okay, pls don't get confused π« . an error estimate is also given, and it's the difference of the diffusion coefficients obtained from fits over the two halves of the fit interval. cute, right? symmetric queen.
there are three, mutually exclusive, options to determine different types of mean square displacement: -type, -lateral, and -ten. option -ten writes the full MSD tensor for each group, and the order in the output is literally:
trace xx yy zz yx zx zy
remember that order. it will be on the test. π€
if -mol is set, gmx msd plots the MSD for individual molecules (and yes, including making molecules whole across periodic boundaries π§). for each individual molecule, a diffusion constant is computed for its center of mass. the chosen index group will be split into molecules. and with -mol, only one index group can be selected. one. singular. don't push it.
the diffusion coefficient is determined by linear regression of the MSD. when -beginfit is -1, fitting starts at 10%, and when -endfit is -1, fitting goes to 90%. using this option you also get an accurate error estimate based on the statistics between individual molecules. π but β and this part matters β note that this diffusion coefficient and error estimate are only accurate when the MSD is completely linear between -beginfit and -endfit. so like, if your line is wobbling, that's on you bestie, not the tool.
by default, gmx msd compares all trajectory frames against every frame stored at -trestart intervals, so the number of frames stored scales linearly with the number of frames processed. π that means: long analysis times and possible out-of-memory errors for long/large trajectories. and often the data at higher time deltas lacks sufficient sampling, which typically manifests as a wobbly line on the MSD plot after a straighter region at lower time deltas (we've all been there, wobbling after being straight, relatable fr fr).
the -maxtau option can cap the maximum time delta for frame comparison, which may improve performance and can be used to avoid out-of-memory issues. slay. π
β¨ OPTIONS β¨
πΈ Options to specify input files:
-f [<.xtc/.trr/...>](defaulttraj.xtc) (Optional) β input trajectory or single configuration. formats it fw:xtc trr cpt gro g96 pdb tng h5md-s [<.tpr/.gro/...>](defaulttopol.tpr) (Optional) β input structure. formats:tpr gro g96 pdb brk ent-n [<.ndx>](defaultindex.ndx) (Optional) β extra index groups, for when you want to be extra β¨
π Options to specify output files:
-o [<.xvg>](defaultmsdout.xvg) (Optional) β MSD output. the main character file.-mol [<.xvg>](defaultdiff_mol.xvg) (Optional) β reports diffusion coefficients for each molecule in selection π§¬
π Other options:
-b <time>(default0) β first frame (ps) to read from trajectory-e <time>(default0) β last frame (ps) to read from trajectory-dt <time>(default0) β only use frame ift MOD dt == first time(ps)-tu <enum>(defaultps) β 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>(defaultxmgrace) β plot formatting:xmgrace,xmgr,none-[no]rmpbc(defaultyes) β make molecules whole for each frame π«Ά-[no]pbc(defaultyes) β use periodic boundary conditions for distance calculation-sf <file>β provide selections from files π-selrpos <enum>(defaultatom) β selection reference positions: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-seltype <enum>(defaultatom) β default selection output positions: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-sel <selection>β selections to compute MSDs for from the reference-type <enum>(defaultunused) β: x, y, z, unused-lateral <enum>(defaultunused) β: x, y, z, unused-trestart <real>(default10) β time between restarting points in trajectory (ps)-maxtau <real>(default1.79769e+308) β maximum time delta between frames to calculate MSDs for (ps)-beginfit <real>(default-1) β time point at which to start fitting.-endfit <real>(default-1) β end time for fitting.
and remember,-type,-lateraland-tenare mutually exclusive β pick one, bestie, you cannot have all three, this is not a buffet π
β¨ SEE ALSO β¨
more info about GROMACS is available at http://www.gromacs.org/ π (yes go click it, the docs are right there)
β¨ COPYRIGHT β¨
2026, GROMACS development team β protect them at all costs π
and that's the whole page, bestie!! π this version of GMX-MSD(1) shipped with GROMACS 2026.4, dated Oct 02, 2026 β so if you're reading this in the future, hi, hope your MSD is nice and linear, 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