mythos.simulators.gromacs.utils =============================== .. py:module:: mythos.simulators.gromacs.utils .. autoapi-nested-parse:: Utilities for the GROMACS simulator. Attributes ---------- .. autoapisummary:: mythos.simulators.gromacs.utils.ANGSTROMS_TO_NM mythos.simulators.gromacs.utils.logger Functions --------- .. autoapisummary:: mythos.simulators.gromacs.utils.read_trajectory_mdanalysis mythos.simulators.gromacs.utils.preprocess_topology Module Contents --------------- .. py:data:: ANGSTROMS_TO_NM :value: 0.1 .. py:data:: logger .. py:function:: read_trajectory_mdanalysis(topology_file: pathlib.Path, trajectory_file: pathlib.Path) -> mythos.simulators.io.SimulatorTrajectory Read a GROMACS trajectory using MDAnalysis. :param topology_file: Path to the topology file (e.g., output.tpr). :param trajectory_file: Path to the trajectory file (e.g., output.trr). :returns: SimulatorTrajectory containing the rigid body trajectory data. .. py:function:: 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 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. :param input_dir: Directory containing the GROMACS input files. :param params: Optional dictionary of parameters to update in the .mdp file. :param copy_to: Optional directory to copy input files to before preprocessing. If the directory exists, an exception is raised. :param output_prefix: Prefix for the preprocessed topology (.top extension) and tpr files (.tpr extension). :param output_mdp_name: Name of the output .mdp file after replacements. :param gromacs_binary: Optional path to the GROMACS binary (defaults to 'gmx' in PATH). :param mdp_name: Name of the .mdp file in the input directory. :param topology_name: Name of the topology file in the input directory. :param structure_name: Name of the structure file in the input directory. :param index_name: Name of the index file in the input directory. :param log_prefix: Prefix for log messages.