GMX-RDF(1)
β¨ NAME β¨
gmx-rdf β bestie, it calculates radial distribution functions π
(also this whole thing lives in the GROMACS manual, just so u know π«Ά)
π SYNOPSIS π
gmx rdf [-f [<.xtc/.trr/...>]] [-s [<.tpr/.gro/...>]] [-n [<.ndx>]]
[-o [<.xvg>]] [-cn [<.xvg>]] [-b <time>] [-e <time>]
[-dt <time>] [-tu <enum>] [-fgroup <selection>] [-xvg <enum>]
[-[no]rmpbc] [-[no]pbc] [-sf <file>] [-selrpos <enum>]
[-seltype <enum>] [-bin <real>] [-norm <enum>] [-[no]xy]
[-[no]excl] [-cut <real>] [-rmax <real>] [-surf <enum>]
[-ref <selection>] [-sel <selection>]
π¦ DESCRIPTION π¦
okay so gmx rdf computes radial distribution functions, going from one reference set of positions (that's the one u set with -ref) out to one or more sets of positions (those are the ones u set with -sel). iconic behaviour fr fr.
But wait π
β if u wanna compute the RDF with respect to the closest position in a set from -ref instead, use -surf: when it's set, -ref gets partitioned into sets based on the value of -surf, and the closest position in each set is what gets used. and if u want the RDF around axes parallel to the z-axis, meaning only in the x-y plane, that's what -xy is for β¨.
To pick your bin width and your max distance for the RDF, u use -bin and -rmax. no cap, -rmax is also the move when u wanna limit computational cost β like if the RDF just isn't interesting to u all the way out to the default. and what is the default, u ask? it's half of the box size with PBC, or three times the box size without PBC π
Wanna use exclusions from the topology (-s)? Set -excl, and make sure both -ref and -sel only select atoms. A rougher alternative for excluding intra-molecular peaks is setting -cut to a non-zero value so the RDF gets cleared at small distances. it's giving "quick and dirty" but it works π«Ά
Now, the RDFs are normalized by three things:
- average number of positions in
-ref(and it's the number of groups when u use-surf) - volume of the bin
- average particle density of
-selpositions for that selection
and to switch up the normalization, u use -norm:
rdfβ uses all the factors for normalization. this produces a normal RDF πnumber_densityβ uses the first two factors only. this produces a number density as a function of distance πΈnoneβ uses only the first factor. in this case the RDF is only scaled with the bin width, so that the integral of the curve represents the number of pairs within a range β¨
β οΈ heads up bestie: exclusions do NOT affect the normalization. even if-exclis set, or-refand-selcontain the same selection, the normalization factor is stillN*M, notN*(M-excluded). π
For -surf, the selection u hand to -ref must select atoms β centers of mass are not supported, sorry babe π. And further, -nonorm is implied, because the bins have irregular shapes and the volume of a bin is not easily computable. geometry said "not today" π
Option -cn produces the cumulative number RDF, i.e. the average number of particles within a distance r. cute lil running total, obsessed π
π OPTIONS π
π Options to specify input files
-f [<.xtc/.trr/...>]β (traj.xtc) (Optional) β Input trajectory or single configuration:xtc trr cpt gro g96 pdb tng h5mdπ-s [<.tpr/.gro/...>]β (topol.tpr) (Optional) β Input structure:tpr gro g96 pdb brk entπ¦-n [<.ndx>]β (index.ndx) (Optional) β Extra index groups β¨
πΈ Options to specify output files
-o [<.xvg>]β (rdf.xvg) β Computed RDFs π-cn [<.xvg>]β (rdf_cn.xvg) (Optional) β Cumulative RDFs π
π Other options
-b <time>β (0) β First frame (ps) to read from trajectory π-e <time>β (0) β Last frame (ps) to read from trajectory π-dt <time>β (0) β Only use frame ift MOD dt == first time(ps) β³-tu <enum>β (ps) β Unit for time values:fs, ps, ns, us, ms, sπ-fgroup <selection>β Atoms stored in the trajectory file (if not set, assume firstNatoms) π§-xvg <enum>β (xmgrace) β Plot formatting:xmgrace, xmgr, noneπ-[no]rmpbcβ (yes) β Make molecules whole for each frame π«Ά-[no]pbcβ (yes) β Use periodic boundary conditions for distance calculation π-sf <file>β Provide selections from files π-selrpos <enum>β (atom) β 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>β (atom) β 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π«-bin <real>β (0.002) β Bin width (nm) π-norm <enum>β (rdf) β Normalization:rdf, number_density, noneβοΈ-[no]xyβ (no) β Use only the x and y components of the distance β¨-[no]exclβ (no) β Use exclusions from topology π«-cut <real>β (0) β Shortest distance (nm) to be considered βοΈ-rmax <real>β (0) β Largest distance (nm) to calculate π-surf <enum>β (no) β RDF with respect to the surface of the reference:no, mol, resπ-ref <selection>β Reference selection for RDF computation π―-sel <selection>β Selections to compute RDFs for from the reference π―
π§ SEE ALSO π§
gmx(1)π
More information about GROMACS is available at http://www.gromacs.org/ π
π COPYRIGHT π
2026, GROMACS development team β thank u for ur service, legends π«Ά
version 2026.4, dated Oct 02, 2026 β that's the whole page bestie, go compute some RDFs and slay π
β¨π no cap, u ate π
π¦ 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