GMX-EDITCONF(1)

πŸ’– GMX-EDITCONF(1) πŸ’–

okay bestie, welcome to GROMACS, and welcome to the glo-up station πŸŽ€ this is gmx-editconf, the little command that turns your raggedy structure files into something cute and actually usable. she converts, she manipulates, she boxes, she rotates, she does it ALL. no cap. πŸ¦‹


✨ NAME ✨

gmx-editconf β€” convert and manipulates structure files πŸ’…


✨ SYNOPSIS ✨

gmx editconf [-f [<.gro/.g96/...>]] [-n [<.ndx>]] [-bf [<.dat>]]
             [-o [<.gro/.g96/...>]] [-mead [<.pqr>]] [-[no]w]
             [-[no]ndef] [-bt <enum>] [-box <vector>]
             [-angles <vector>] [-d <real>] [-[no]c]
             [-center <vector>] [-aligncenter <vector>]
             [-align <vector>] [-translate <vector>]
             [-rotate <vector>] [-[no]princ] [-scale <vector>]
             [-density <real>] [-[no]pbc] [-resnr <int>] [-[no]grasp]
             [-rvdw <real>] [-[no]sig56] [-[no]vdwread] [-[no]atom]
             [-[no]legend] [-label <string>] [-[no]conect]

✨ DESCRIPTION ✨

gmx editconf converts generic structure format to .gro, .g96 or .pdb. that's her whole thing fr fr πŸ’–


the box can be modified with options -box, -d and -angles. both -box and -d will center the system in the box, unless -noc is used. and the -center option? that one shifts the geometric center of the system away from the default of (x/2, y/2, z/2) β€” which is what -c implies β€” over to some other value you pick. slay πŸ’«


option -bt decides the box type:

  • triclinic β€” a triclinic box
  • cubic β€” a rectangular box with all sides equal
  • dodecahedron β€” represents a rhombic dodecahedron
  • octahedron β€” a truncated octahedron

the last two are special cases of a triclinic box, iykyk. 🌈

the length of the three box vectors of the truncated octahedron is the shortest distance between two opposite hexagons. and relative to a cubic box with some periodic image distance: the volume of a dodecahedron with that same periodic distance is 0.71 times that of the cube, and the volume of a truncated octahedron is 0.77 times that of the cube. math girlies rise 🧚


option -box only needs one value for a cubic, rhombic dodecahedral, or truncated octahedral box. obsessed with the efficiency.

with -d and a triclinic box, the size of the system in the x-, y-, and z-directions is used. but with -d and cubic, dodecahedron or octahedron boxes, the dimensions get set to the diameter of the system β€” that's the largest distance between atoms, bestie β€” plus twice the specified distance. πŸ”₯

option -angles is only meaningful with option -box and a triclinic box, and she cannot be used with option -d. they do not coexist. periodt.


when -n or -ndef is set, a group can be selected for calculating the size and the geometric center. otherwise the whole system is used. the whole thing. every atom. no filter πŸ’€


-rotate rotates the coordinates and the velocities. both. she's thorough. πŸ‘‘

-princ aligns the principal axes of the system along the coordinate axes, with the longest axis aligned with the x-axis. this may let you decrease the box volume β€” but beware ⚠️ molecules can rotate significantly in a nanosecond. like, a whole lot. do not play with this and then act surprised.


scaling is applied before any of the other operations are performed. boxes and coordinates can be scaled to give a certain density (option -density). note that this may be inaccurate in case a .gro file is given as input πŸ‘€

and a special feature of the scaling option, because she's extra: when the factor -1 is given in one dimension, you obtain a mirror image, mirrored in one of the planes. when you use -1 in three dimensions, you get a point-mirror image. iconic behaviour honestly πŸͺžπŸ’…


groups are selected after all operations have been applied. order matters, bestie 🫢


periodicity can be removed in a crude manner. and it is important that the box vectors at the bottom of your input file are correct when the periodicity is to be removed. like, check them. for real. πŸ™ˆ


when writing .pdb files, B-factors can be added with the -bf option. B-factors are read from a file with with following format: first line states number of entries in the file, next lines state an index followed by a B-factor. the B-factors will be attached per residue unless the number of B-factors is larger than the number of the residues, or unless the -atom option is set. obviously, any type of numeric data can be added instead of B-factors. and -legend will produce a row of CA atoms with B-factors ranging from the minimum to the maximum value found β€” effectively making a legend for viewing. cute AND practical πŸŽ€


with the option -mead a special .pdb (.pqr) file for the MEAD electrostatics program (Poisson-Boltzmann solver) can be made. a further prerequisite is that the input file is a run input file. the B-factor field is then filled with the Van der Waals radius of the atoms, while the occupancy field will hold the charge. two fields, two jobs, zero complaints ✨

the option -grasp is similar, but it puts the charges in the B-factor and the radius in the occupancy. yes, she swapped them. that's the whole difference. πŸ¦‹


option -align allows alignment of the principal axis of a specified group against the given vector, with an optional center of rotation specified by -aligncenter. main character energy, she picks her own axis AND her own pivot πŸ’œ

finally, with option -label, editconf can add a chain identifier to a .pdb file, which can be useful for analysis with e.g. Rasmol.


to convert a truncated octrahedron file produced by a package which uses a cubic box with the corners cut off (such as GROMOS), use:

gmx editconf -f in -rotate 0 45 35.264 -bt o -box veclen -o out

where veclen is the size of the cubic box times sqrt(3)/2. πŸ“ save this one, it's a classic.


✨ OPTIONS ✨

🌸 Options to specify input files:

  • -f [<.gro/.g96/...>] (conf.gro) β€” Structure file: gro g96 pdb brk ent esp tpr
  • -n [<.ndx>] (index.ndx) (Optional) β€” Index file
  • -bf [<.dat>] (bfact.dat) (Optional) β€” Generic data file

🌸 Options to specify output files:

  • -o [<.gro/.g96/...>] (out.gro) (Optional) β€” Structure file: gro g96 pdb brk ent esp
  • -mead [<.pqr>] (mead.pqr) (Optional) β€” Coordinate file for MEAD

🌸 Other options:

  • -[no]w (no) β€” View output .xvg, .xpm, .eps and .pdb files
  • -[no]ndef (no) β€” Choose output from default index groups
  • -bt <enum> (triclinic) β€” Box type for -box and -d: triclinic, cubic, dodecahedron, octahedron
  • -box <vector> (0 0 0) β€” Box vector lengths (a,b,c)
  • -angles <vector> (90 90 90) β€” Angles between the box vectors (bc,ac,ab)
  • -d <real> (0) β€” Distance between the solute and the box
  • -[no]c (no) β€” Center molecule in box (implied by -box and -d)
  • -center <vector> (0 0 0) β€” Shift the geometrical center to (x,y,z)
  • -aligncenter <vector> (0 0 0) β€” Center of rotation for alignment
  • -align <vector> (0 0 0) β€” Align to target vector
  • -translate <vector> (0 0 0) β€” Translation
  • -rotate <vector> (0 0 0) β€” Rotation around the X, Y and Z axes in degrees
  • -[no]princ (no) β€” Orient molecule(s) along their principal axes
  • -scale <vector> (1 1 1) β€” Scaling factor
  • -density <real> (1000) β€” Density (g/L) of the output box achieved by scaling
  • -[no]pbc (no) β€” Remove the periodicity (make molecule whole again)
  • -resnr <int> (-1) β€” Renumber residues starting from resnr
  • -[no]grasp (no) β€” Store the charge of the atom in the B-factor field and the radius of the atom in the occupancy field
  • -rvdw <real> (0.12) β€” Default Van der Waals radius (in nm) if one can not be found in the database or if no parameters are present in the topology file
  • -[no]sig56 (no) β€” Use rmin/2 (minimum in the Van der Waals potential) rather than sigma/2
  • -[no]vdwread (no) β€” Read the Van der Waals radii from the file vdwradii.dat rather than computing the radii based on the force field
  • -[no]atom (no) β€” Force B-factor attachment per atom
  • -[no]legend (no) β€” Make B-factor legend
  • -label <string> (A) β€” Add chain label for all residues
  • -[no]conect (no) β€” Add CONECT records to a .pdb file when written. Can only be done when a topology (tpr file) is present

πŸ’€ KNOWN ISSUES πŸ’€

  • For complex molecules, the periodicity removal routine may break down,
  • in that case you can use gmx trjconv.
ngl bestie, this is the "she's not mad she's just disappointed" section. if it breaks, gmx trjconv is right there. 🫢

✨ SEE ALSO ✨

gmx(1)

More information about GROMACS is available at <http://www.gromacs.org/>. 🌈


2026, GROMACS development team


and that's the whole page, babes πŸ’– this beauty shipped as 2026.4, dated Oct 02, 2026 β€” go make some boxes, align some principal axes, and stay hydrated. periodt. πŸ‘‘βœ¨πŸ¦‹

πŸ“¦ where this page comes from