densmap

Compute a 2-dimensional number density map.

Project all selected compounds along a given spatial dimension on a plane and calculate the number density distribution of the compounds on the plane.

Options

-f

Trajectory file. See supported coordinate formats of MDAnalysis.

-s

Topology file. See supported topology formats of MDAnalysis.

-o

Output filename.

-b

First frame to read from the trajectory. Frame numbering starts at zero. Default: 0.

-e

Last frame to read from the trajectory. This is exclusive, i.e. the last frame read is actually END - 1. A value of -1 means to read the very last frame. Default: -1.

--every

Read every n-th frame from the trajectory. Default: 1.

--sel

Selection string to select a group of atoms for the analysis. See MDAnalysis’ selection syntax for possible choices.

--cmp

{‘group’, ‘segments’, ‘residues’, ‘fragments’, ‘atoms’}

The compounds of the selection group to use for the analysis. Compounds can be ‘group’ (the entire selection group), ‘segments’, ‘residues’, ‘fragments’, or ‘atoms’. Refer to the MDAnalysis’ user guide for an explanation of these terms. Note that in any case, even if CMP is e.g. ‘residues’, only the atoms belonging to the selection group are taken into account, even if the compound might comprise additional atoms that are not contained in the selection group. Default: 'atoms'.

--center

{‘cog’, ‘com’, ‘coc’}

The center of the compounds to use for the analysis.

  • 'cog': Center of geometry

  • 'com': Center of mass

  • 'coc': Center of charge

Note that MDAnalysis always guesses atom masses from the atom types, even if the input file contains the masses. Default: 'cog'.

--direction

{‘x’, ‘y’, ‘z’}

The spatial direction along which to project the selected compounds on a plane. By default, the density map is created in the xy plane and projection/averaging is done along the z axis. Default: 'z'.

--min

Minimum coordinate for averaging in Angstrom. Only compounds whose position in the projection direction is greater than or equal to the minimum coordinate are taken into account. Default: 0.

--max

Maximum coordinate for averaging in Angstrom. Only compounds whose position in the projection direction is less than the maximum coordinate are taken into account. If None, the maximum coordinate is set to the box length in the projection direction. Default: None.

--grid-spacing

Desired grid spacing in Angstrom for binning the compounds in the plane. Note that the grid spacing will be adjusted such that the grid fits within the simulation box. The final grid cells might not be squares. Default: 0.05.

--debug

Run in debug mode.

Notes

This script is similar to the Gromacs tool gmx densmap.

The binning is done in the box coordinate system to take into account potential box fluctuations.

See also

scripts.structure.plot_gmx_densmap

Read up to three matrices from text files and plot them as one RGB matrix