vermouth.gmx.gro module

Provides functionality to read and write GRO96 files.

vermouth.gmx.gro.read_gro(file_name, exclude=('SOL', ), ignh=False)[source]

Parse a gro file to create a molecule.

Parameters:
  • filename (str) – The file to read.
  • exclude (collections.abc.Container[str]) – Atoms that have one of these residue names will not be included.
  • ignh (bool) – Whether hydrogen atoms should be ignored.
Returns:

The parsed molecules. Will not contain edges.

Return type:

vermouth.molecule.Molecule

vermouth.gmx.gro.write_gro(system, file_name, precision=7, title='Martinized!', box=(0, 0, 0), defer_writing=True)[source]

Write system to file_name, which will be a GRO96 file.

Parameters:
  • system (vermouth.system.System) – The system to write.
  • file_name (str) – The file to write to.
  • precision (int) – The desired precision for coordinates and (optionally) velocities.
  • title (str) – Title for the gro file.
  • box (tuple[float]) – Box length and optionally angles.
  • defer_writing (bool) – Whether to use write() for writing data