Solute generation¶
SoluteGenFlow
¶
Bases: MartiniFlowProject
Manages the workflow for generating, minimizing, and equilibrating solute systems for molecular dynamics simulations.
This class extends MartiniFlowProject
to provide specific functionalities for solute system preparation in the
context of molecular dynamics simulations using GROMACS. It includes operations for generating the initial molecular
structure, topology, and parameter files, minimizing the system's energy, and equilibrating the system under desired
conditions.
Attributes:
Name | Type | Description |
---|---|---|
workspace_path |
str
|
Path to the workspace directory where simulation files are stored. |
mdp_path |
str
|
Path to the directory containing MDP files for GROMACS simulations. |
itp_files |
dict
|
Dictionary mapping solute names to their respective ITP file paths. |
mdp_files |
dict
|
Dictionary mapping simulation types (e.g., 'minimize', 'equilibrate') to their MDP file paths. |
simulation_settings |
dict
|
Settings for the simulation, such as the number of threads. |
system_name |
str
|
The name of the system being simulated. |
nomad_workflow |
str
|
The name of the NOMAD workflow associated with this project. |
state_names |
dict
|
Dictionary mapping state names to their string representations. |
ff_parameters |
dict
|
Force field parameters used in generating the molecular structure. |
The class provides methods for each step of the solute preparation process, including build
, minimize
, and
equilibrate
, as well as methods for managing the workflow's integration with the NOMAD database, such as
upload_to_nomad
.
Source code in martignac/workflows/solute_generation.py
build(job)
¶
Generate the initial structure, topology, and parameter files for a solute.
This function is responsible for generating the initial molecular structure (GRO file),
topology (TOP file), and parameter (ITP file) files for the solute specified in the job.
It utilizes the get_molecule_from_name
function to fetch the molecular data based on the
solute name provided in the job's state point. The generated files are essential for
conducting molecular dynamics simulations using GROMACS.
The function updates the job document with paths to the generated files, marking the solute's initial system generation as complete. This step is crucial for preparing the system for subsequent energy minimization, equilibration, and production simulations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job |
Job
|
The job object representing the solute system for which the initial structure, topology, and parameter files are to be generated. |
required |
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
This function does not return a value but updates the job document with the paths to the generated files. |
Source code in martignac/workflows/solute_generation.py
equilibrate(job)
¶
Perform the equilibration process for the solute in the simulation.
This function runs the GROMACS equilibration simulation using the parameters defined in the
mdp_files["equilibrate"]
file. It sets up the simulation with the minimized structure from the previous step as
the input configuration and uses the topology file generated during the solute generation step. The number of
threads for the simulation is determined by the simulation_settings["n_threads"]
configuration.
The equilibration process is crucial for stabilizing the system at the desired temperature and pressure before the main production run. It helps in relaxing the system and achieving a more realistic distribution of velocities and positions.
Upon successful completion, the function updates the job document with the path to the generated GRO file, marking the state of the system as equilibrated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job |
Job
|
The job object for which the equilibration simulation is to be performed. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The command to execute the GROMACS equilibration simulation. |
Source code in martignac/workflows/solute_generation.py
minimize(job)
¶
Minimize the energy of the solute system.
This function executes the energy minimization step for the solute using GROMACS. It utilizes the parameters
specified in the mdp_files["minimize"]
file for the minimization process. The minimized structure serves as a
more stable starting point for subsequent equilibration and production simulations.
The minimization process reduces the potential energy of the system, resolving any steric clashes or unrealistic geometries that may have arisen during the solute generation phase. This step is crucial for preparing the system for a stable simulation environment.
Upon completion, the function updates the job document with the path to the minimized structure, indicating that the system has been successfully minimized.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job |
Job
|
The job object representing the solute system to be minimized. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The command to execute the GROMACS energy minimization. |