Martini flow projects¶
MartiniFlowProject
¶
Bases: FlowProject
A specialized FlowProject for managing and executing Martini-based molecular dynamics simulations.
This class extends the FlowProject class from the signac framework, providing functionalities specific to the setup, execution, and analysis of simulations using the Martini force field. It includes methods for registering simulation input files, uploading results to the NOMAD repository, and managing the simulation workflow states.
Attributes:
Name | Type | Description |
---|---|---|
workspaces_path |
str
|
Absolute path to the directory where simulation workspaces are stored. |
input_files_path |
str
|
Absolute path to the directory containing input files for simulations. |
itp_path |
str
|
Absolute path to the directory containing ITP (GROMACS topology) files. |
nomad_use_prod_database |
bool
|
Flag indicating whether to use the production NOMAD database. |
nomad_dataset_id |
str
|
Identifier for the dataset within the NOMAD repository. |
nomad_coauthors |
list[str]
|
List of co-authors to be included in the NOMAD metadata. |
workspace_path |
str
|
Path to the current job's workspace directory. |
itp_files |
Dict[str, str]
|
Dictionary mapping ITP file names to their paths. |
mdp_path |
str
|
Path to the directory containing MDP (GROMACS parameters) files. |
mdp_files |
Dict[str, str]
|
Dictionary mapping MDP file names to their paths. |
simulation_settings |
Dict[str, Any]
|
Dictionary containing settings for the simulation. |
system_name |
str
|
Name of the simulation system. |
output_names |
Dict[str, str]
|
Dictionary mapping output file types to their names. |
nomad_workflow |
str
|
Identifier for the workflow within the NOMAD repository. |
nomad_top_level_workflow |
str
|
Identifier for the top-level workflow within NOMAD. |
ff_parameters |
Dict[str, Any]
|
Dictionary containing force field parameters. |
operation_to_workflow |
Dict[str, str]
|
Mapping of operation names to workflow identifiers. |
Source code in martignac/utils/martini_flow_projects.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
|
fetch_from_nomad(*jobs)
¶
Fetches data for a given set of jobs from the NOMAD repository.
This operation attempts to download raw data associated with each job from the NOMAD repository. It logs the success or failure of data retrieval for each job. If data is successfully fetched, it updates the job's document to reflect this. This function is useful for synchronizing local job data with data stored in NOMAD, ensuring that the local project state accurately reflects the data stored in the repository.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*jobs |
Job
|
A variable number of signac job instances for which data is being fetched from NOMAD. |
()
|
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
This function does not return a value but updates each job's document with the fetch status. |
Source code in martignac/utils/martini_flow_projects.py
import_job_from_other_flow(job, child_project, child_job, keys_for_files_to_copy, run_child_job=True)
¶
Imports data from a job in a child project into the current job's context.
This function is designed to facilitate the transfer of data between jobs across different projects within the MartiniFlow framework. It optionally runs the child job before copying specified files from the child job's directory to the current job's directory. This is particularly useful for workflows that require data generated in one project to be used in another.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job |
Job
|
The current signac job instance into which data is being imported. |
required |
child_project |
MartiniTypeFlow
|
The child project instance from which data is being imported. |
required |
child_job |
Job
|
The child project's signac job instance from which data is being imported. |
required |
keys_for_files_to_copy |
list[str]
|
A list of keys identifying the files in the child job's document that should be copied to the current job's directory. |
required |
run_child_job |
bool
|
A flag indicating whether the child job should be executed before data is imported. Defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
This function does not return a value but updates the current job's directory with the imported files and updates the job's document with information from the child job's document. |
Source code in martignac/utils/martini_flow_projects.py
store_gromacs_log_to_doc(operation_name, job)
¶
Stores the GROMACS log file information in the job document without state point differentiation.
This function is a simplified wrapper around _store_gromacs_log_to_doc_flexible
, specifically designed
for cases where differentiation based on state points is not required. It logs the GROMACS simulation
details into the job's document, using only the operation name for identification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
The name of the operation being logged. This typically corresponds to the GROMACS command being executed. |
required |
job |
Job
|
The signac job instance for which the log is being stored. This job contains the document where the log information is stored. |
required |
Returns:
Name | Type | Description |
---|---|---|
None |
This function does not return a value but updates the job's document with the log file information. |
Source code in martignac/utils/martini_flow_projects.py
store_gromacs_log_to_doc_with_depth_from_bilayer_core(operation_name, job)
¶
Stores the GROMACS log file information in the job document, including differentiation based on the depth from the bilayer core.
This function is specifically designed for simulations where the depth from the bilayer core is a relevant parameter. It utilizes
_store_gromacs_log_to_doc_flexible
with the with_state_point
flag set to True and specifies "depth_from_bilayer_core" as the
state point key for differentiation. This allows for the inclusion of depth-related details in the log file's identification,
facilitating more granular analysis of simulation results based on their proximity to the bilayer core.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
The name of the operation being logged. This typically corresponds to the GROMACS command being executed. |
required |
job |
Job
|
The signac job instance for which the log is being stored. This job contains the document where the log information is stored. |
required |
Returns:
Name | Type | Description |
---|---|---|
None |
This function does not return a value but updates the job's document with the log file information, including differentiation based on the depth from the bilayer core. |
Source code in martignac/utils/martini_flow_projects.py
store_gromacs_log_to_doc_with_state_point(operation_name, job)
¶
Stores the GROMACS log file information in the job document with state point differentiation.
This function is designed to log GROMACS simulation details into the job's document, incorporating
state point information for differentiation. It utilizes _store_gromacs_log_to_doc_flexible
with
the with_state_point
flag set to True, allowing for the inclusion of state point details in the
log file's identification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
The name of the operation being logged. This typically corresponds to the GROMACS command being executed. |
required |
job |
Job
|
The signac job instance for which the log is being stored. This job contains the document where the log information is stored. |
required |
Returns:
Name | Type | Description |
---|---|---|
None |
This function does not return a value but updates the job's document with the log file information, including state point differentiation. |
Source code in martignac/utils/martini_flow_projects.py
store_task(operation_name, job)
¶
Logs a workflow task for a given job in the project's documentation.
This function updates the job's document to log the execution of a specific task within the workflow. It is part of the project's utilities for tracking the progress and state of jobs, specifically by recording which tasks have been run. This aids in the management and review of the job's lifecycle within the workflow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
The name of the operation or task being logged. This name should correspond to a defined operation within the workflow. |
required |
job |
Job
|
The signac job instance for which the task is being logged. This job's document is updated with the task information. |
required |
Returns:
Name | Type | Description |
---|---|---|
None |
This function does not return a value but updates the job's document with the task information. |
Source code in martignac/utils/martini_flow_projects.py
store_task_for_many_jobs(operation_name, *jobs)
¶
Logs a workflow task for multiple jobs in the project's documentation.
This function iterates over a collection of jobs, logging the execution of a specified task within the workflow
for each job. It leverages the store_task
function to individually update each job's document. This is useful
for batch processing or when the same task is executed across multiple jobs, ensuring consistent documentation
and tracking of workflow tasks across the project.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
The name of the operation or task being logged. This name should correspond to a defined operation within the workflow. |
required |
*jobs |
Job
|
A variable number of signac job instances for which the task is being logged. Each job's document is updated with the task information. |
()
|
Returns:
Name | Type | Description |
---|---|---|
None |
This function does not return a value but updates each job's document with the task information. |
Source code in martignac/utils/martini_flow_projects.py
store_workflow(operation_name, job)
¶
Logs the association of a workflow with a given job in the project's documentation.
This function updates the job's document to log the association of a specific workflow, identified by the operation name, with the job. It is part of the project's utilities for tracking the progress and state of jobs, specifically by recording which workflows have been associated with them. This aids in the management and review of the job's lifecycle within the workflow system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
The name of the operation or workflow being logged. This name should correspond to a defined operation within the project's workflow system. |
required |
job |
Job
|
The signac job instance for which the workflow association is being logged. This job's document is updated with the workflow association information. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the operation name is not registered within the project's operation to workflow mapping, indicating that the operation is not recognized by the project. |
Returns:
Name | Type | Description |
---|---|---|
None |
This function does not return a value but updates the job's document with the workflow association information. |
Source code in martignac/utils/martini_flow_projects.py
store_workflow_for_many_jobs(operation_name, *jobs)
¶
Logs the association of a specified workflow with multiple jobs in the project's documentation.
This function iterates over a collection of jobs, logging the association of a specified workflow, identified by the
operation name, with each job. It leverages the store_workflow
function to individually update each job's document.
This is useful for batch processing or when the same workflow is associated across multiple jobs, ensuring consistent
documentation and tracking of workflow associations across the project.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation_name |
str
|
The name of the operation or workflow being logged. This name should correspond to a defined operation within the project's workflow system. |
required |
*jobs |
Job
|
A variable number of signac job instances for which the workflow association is being logged. Each job's document is updated with the workflow association information. |
()
|
Returns:
Name | Type | Description |
---|---|---|
None |
This function does not return a value but updates each job's document with the workflow association information. |
Source code in martignac/utils/martini_flow_projects.py
symlink_itp_and_mdp_files(job)
¶
Creates symbolic links for ITP and MDP files in the job's directory.
This function generates symbolic links for each ITP (GROMACS topology) and MDP (GROMACS parameters) file within the job's directory, facilitating their use in simulation workflows. It ensures that the necessary simulation input files are accessible in the job's working directory without duplicating data. If a file already exists in the job's directory, it will not create a duplicate symlink.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job |
Job
|
The signac job instance for which the symbolic links are being created. |
required |
Returns:
Name | Type | Description |
---|---|---|
None |
None
|
This function does not return a value but updates the job's directory with symbolic links. |