transition_sampling.engines.gromacs package

Submodules

transition_sampling.engines.gromacs.mdp module

class transition_sampling.engines.gromacs.mdp.MDPHandler(filename)

Bases: object

Handles reading and modifying a GROMACS .mdp file

This class is used to read a template .mdp file into memory and read its dt (simulation time step value). It then allows the trajectory print frequency (nstxout) to be modified, and the modified version written to disk at a new location

Will not modify the original file. The original file is read once at init and no modifications to it after this object is constructed will carry over.

Parameters

filename – path to the .mdp file. This file will not be modified.

raw_string

The raw contents of the original .mdp stored in a string

Type

str

print_freq

The print frequency that has been set in # of MD frames. None if it has not be set with set_traj_print_freq

Type

str

Raises

ValueError – If filename is not a file.

set_traj_print_freq(step)

Set how often the trajectory should be printed

Parameters

step (int) – The number of MD steps between each print. Must be an integer and must be greater than 0

Raises

ValueError – if step is not an integer or greater than 0

Return type

None

property timestep

Returns the timestep of the .mdp in fs (note GROMACS uses ps)

write_mdp(filename)

Write the MDP to the passed file with new print frequency, if any.

Overwrites anything present. Also turns off GROMACS velocity generation.

Parameters

filename – The file to write the input to

Module contents