GMX-GENRESTR(1)

✨ gmx-genrestr ✨

okay bestie, so this is a page from the GROMACS manual β€” it lives in section 1 of the man pages, and it's literally all about the tool gmx-genrestr. buckle up πŸŽ€


πŸ’– NAME πŸ’–

gmx-genrestr β€” generate position restraints or distance restraints for index groups 🫢


🌸 SYNOPSIS 🌸

gmx genrestr [-f [<.gro/.g96/...>]] [-n [<.ndx>]] [-o [<.itp>]]
             [-of [<.ndx>]] [-fc <vector>] [-freeze <real>]
             [-[no]disre] [-disre_dist <real>] [-disre_frac <real>]
             [-disre_up2 <real>] [-cutoff <real>] [-[no]constr]

πŸ¦‹ DESCRIPTION πŸ¦‹

so gmx genrestr produces an #include file for a topology, and inside it is a list of atom numbers plus three force constants β€” one each for the x-, y-, and z-direction β€” all built from whatever is in the -f file. and if you don't wanna hand over three components? no biggie, you can just give a single isotropic force constant on the command line instead. slay. ✨

WARNING ⚠️ position restraints are interactions within molecules, so they absolutely must be included inside the correct [ moleculetype ] block in the topology. the atom indices in the [ position_restraints ] block have to fall within the range of atom indices for that molecule type. and here's the tricky part β€” since the atom numbers in every moleculetype in the topology start at 1, but the numbers in the input file for gmx genrestr just go consecutively from 1, gmx genrestr will only produce a useful file for the first molecule. 😭 you might wanna edit the resulting index file to remove the lines for later atoms, or build a suitable index group to feed into gmx genrestr as input. your call, babe.

the -of option produces an index file that can be used for freezing atoms 🧊 β€” in that case, the input file must be a .pdb file, lowkey non-negotiable.

with the -disre option, it's a whole different vibe: instead of position restraints you get half a matrix of distance restraints. with this matrix β€” which you'd typically apply to Calpha atoms in a protein β€” you can maintain the overall conformation of a protein without tieing it to a specific position (which is what position restraints do). it's giving freedom with structure, fr fr. πŸ‘‘


πŸ’… OPTIONS πŸ’…

πŸ“ Options to specify input files:

  • -f [<.gro/.g96/...>] (conf.gro) β€” the structure file. formats it knows: gro g96 pdb brk ent esp tpr
  • -n [<.ndx>] (index.ndx) (Optional) β€” index file

🌈 Options to specify output files:

  • -o [<.itp>] (posre.itp) β€” the include file for topology
  • -of [<.ndx>] (freeze.ndx) (Optional) β€” index file

⭐ Other options:

  • -fc <vector> (1000 1000 1000) β€” force constants, in kJ/mol nm^2
  • -freeze <real> (0) β€” if you give the -of option, or this one, an index file gets written containing the atom numbers of all atoms that have a B-factor less than the level you give here
  • -[no]disre (no) β€” generate a distance restraint matrix for all the atoms in index
  • -disre_dist <real> (0.1) β€” distance range around the actual distance, for generating distance restraints
  • -disre_frac <real> (0) β€” fraction of distance to be used as interval rather than a fixed distance. and heads up: if the fraction of the distance you specify here is less than the distance given in the previous option, then that one gets used instead. πŸ™ˆ
  • -disre_up2 <real> (1) β€” distance between the upper bound for distance restraints, and the distance at which the force becomes constant (peep the manual for this one πŸ‘€)
  • -cutoff <real> (-1) β€” only generate distance restraints for atom pairs within the cutoff, in nm
  • -[no]constr (no) β€” generate a constraint matrix rather than distance restraints. constraints of type 2 will be generated, and those do generate exclusions. 🫣

πŸ”₯ SEE ALSO πŸ”₯

more tea about GROMACS is available at <http://www.gromacs.org/>. 🫢


2026, GROMACS development team


and that's the whole thing, bestie!! πŸŽ€ this page was version 2026.4, dated Oct 02, 2026, straight from the GROMACS girlies themselves β€” go forth and restrain some atoms, you absolute icon πŸ’–βœ¨πŸŒΈπŸ’…

πŸ“¦ where this page comes from