mythos.simulators.gromacs.utils
Utilities for the GROMACS simulator.
Attributes
Functions
Read a GROMACS trajectory using MDAnalysis. |
|
|
Preprocess a GROMACS topology. |
Module Contents
- mythos.simulators.gromacs.utils.ANGSTROMS_TO_NM = 0.1
- mythos.simulators.gromacs.utils.logger
- mythos.simulators.gromacs.utils.read_trajectory_mdanalysis(topology_file: pathlib.Path, trajectory_file: pathlib.Path) mythos.simulators.io.SimulatorTrajectory[source]
Read a GROMACS trajectory using MDAnalysis.
- Parameters:
topology_file – Path to the topology file (e.g., output.tpr).
trajectory_file – Path to the trajectory file (e.g., output.trr).
- Returns:
SimulatorTrajectory containing the rigid body trajectory data.
- mythos.simulators.gromacs.utils.preprocess_topology(input_dir: str | pathlib.Path, params: dict | None = None, copy_to: pathlib.Path | None = None, output_prefix: str = 'preprocessed', output_mdp_name: str = 'preprocessed.mdp', gromacs_binary: str | pathlib.Path | None = None, mdp_name: str = 'md.mdp', topology_name: str = 'topol.top', structure_name: str = 'membrane.gro', index_name: str = 'index.ndx', log_prefix: str = 'topology_preprocess') None[source]
Preprocess a GROMACS topology.
This function runs gmx grompp to preprocess the GROMACS topology, applying any parameter updates to the .mdp file as needed. The preprocessed topology will be saved with the specified output prefix. Optionally copies input files to a new location to avoid modifying originals.
- Parameters:
input_dir – Directory containing the GROMACS input files.
params – Optional dictionary of parameters to update in the .mdp file.
copy_to – Optional directory to copy input files to before preprocessing. If the directory exists, an exception is raised.
output_prefix – Prefix for the preprocessed topology (.top extension) and tpr files (.tpr extension).
output_mdp_name – Name of the output .mdp file after replacements.
gromacs_binary – Optional path to the GROMACS binary (defaults to ‘gmx’ in PATH).
mdp_name – Name of the .mdp file in the input directory.
topology_name – Name of the topology file in the input directory.
structure_name – Name of the structure file in the input directory.
index_name – Name of the index file in the input directory.
log_prefix – Prefix for log messages.