utils

utils

Utilities for building plugins, shell convenience functions and GROMACS related functions

Attributes

Name Description
TopologyAtomAddress Address to an atom in the topology.

Functions

Name Description
check_gmx_version Check for an existing gromacs installation.
get_gmx_dir Returns the path to the gromacs installation
get_shell_stdout Run command in shell and capture stdout.
get_task_directories create list of subdirectories that match the tasks.
run_gmx Run GROMACS command in shell.
run_shell_cmd Run command in shell.
write_gro_at_reaction_time Write out a gro file from the trajectory (xtc or trr) at the reaction time.
write_reaction_time_marker Write out a file as marker for the reaction time.

check_gmx_version

utils.check_gmx_version(config)

Check for an existing gromacs installation.

If PLUMED is meant to be used it additionally checks for the keyword ‘MODIFIED’ or ‘plumed’ in the version name.

If slow growth pairs are used, it checks for gromacs version >= 2023.2

get_gmx_dir

utils.get_gmx_dir(gromacs_alias='gmx', grompp_prefix=None)

Returns the path to the gromacs installation

get_shell_stdout

utils.get_shell_stdout(s)

Run command in shell and capture stdout.

get_task_directories

utils.get_task_directories(dir, tasks='all')

create list of subdirectories that match the tasks. If tasks is “all”, all subdirectories are returned.

Parameters

Name Type Description Default
dir Path Directory to search for subdirectories required
tasks Union[list[str], str] List of steps e.g. [“equilibrium”, “production”]. Or a string “all” to return all subdirectories 'all'

run_gmx

utils.run_gmx(cmd, cwd=None)

Run GROMACS command in shell.

Adds a ‘-quiet’ flag to the command and checks the return code.

run_shell_cmd

utils.run_shell_cmd(s, cwd=None)

Run command in shell.

write_gro_at_reaction_time

utils.write_gro_at_reaction_time(files, time)

Write out a gro file from the trajectory (xtc or trr) at the reaction time.

write_reaction_time_marker

utils.write_reaction_time_marker(dir, time)

Write out a file as marker for the reaction time.

Back to top