# becksteinlab/mdpow architecture

> Architecture diagram of the GitHub repository becksteinlab/mdpow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/becksteinlab/mdpow
- Repository: https://github.com/becksteinlab/mdpow

## Overview

MDPOW automates molecular-dynamics calculations of solvation free energies and water/organic-solvent partition coefficients. The principal workflow takes a small-molecule structure and parameterization, prepares and equilibrates solvated systems, then runs and analyzes free-energy calculations. It also provides ensemble-based trajectory analysis and automated dihedral workflows. The graph follows documented capabilities and source-index references; dashed, uncited links indicate likely orchestration where the sampled excerpts do not show the call itself.

Main entry points: [`mdpow/equil.py`](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/equil.py) (Equilibrium MD), [`mdpow/run.py`](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/run.py) (Simulation runner), [`mdpow/fep.py`](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/fep.py) (Free-energy setup), [`mdpow/config.py`](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/config.py) (Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Simulation setup"]
  node_run["Simulation runner<br/>[run.py]"]
  node_config["Configuration<br/>[config.py]"]
  node_forcefields["Force fields<br/>[forcefields.py]"]
  node_equil["Equilibrium MD<br/>[equil.py]"]
  node_templates["Gromacs templates"]
end

subgraph group_calculation["Free-energy calculation"]
  node_fep["Free-energy setup<br/>[fep.py]"]
end

subgraph group_analysis["Analysis"]
  node_ensemble["Trajectory ensemble<br/>[ensemble.py]"]
  node_solvation["Solvation analysis<br/>[solvation.py]"]
  node_dihedral["Dihedral analysis<br/>[dihedral.py]"]
  node_workflowbase["Project workflows<br/>[base.py]"]
  node_registry["Workflow registry<br/>[registry.py]"]
  node_dihedralflow["Automated dihedrals<br/>[dihedrals.py]"]
end

subgraph group_support["Shared runtime"]
  node_restart["Stage journal<br/>[restart.py]"]
  node_filelock["File locking<br/>[filelock.py]"]
  node_log["Logging<br/>[log.py]"]
  node_version["Version metadata<br/>[_version.py]"]
end

node_user(("Researcher"))
node_inputs["Structure and ITP"]
node_gromacs["Gromacs"]

node_user -->|"provides"| node_inputs
node_inputs -.->|"configures"| node_run
node_run -.->|"dispatches"| node_equil
node_run -.->|"dispatches"| node_fep
node_equil -->|"references"| node_config
node_equil -->|"selects"| node_forcefields
node_equil -->|"tracks stages"| node_restart
node_equil -->|"runs MD"| node_gromacs
node_forcefields -->|"reads settings"| node_config
node_equil -.->|"uses inputs"| node_templates
node_fep -->|"references"| node_config
node_fep -->|"tracks stages"| node_restart
node_fep -->|"prepares windows"| node_gromacs
node_run -.->|"references"| node_config
node_run -.->|"references"| node_restart
node_ensemble -.->|"supports analysis"| node_solvation
node_ensemble -->|"provides trajectories"| node_dihedral
node_workflowbase -->|"dispatches"| node_registry
node_registry -->|"registers"| node_dihedralflow
node_dihedralflow -->|"loads systems"| node_ensemble
node_dihedralflow -->|"calculates angles"| node_dihedral

click node_run "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/run.py"
click node_config "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/config.py"
click node_forcefields "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/forcefields.py"
click node_equil "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/equil.py"
click node_templates "https://github.com/becksteinlab/mdpow/tree/develop/mdpow/templates"
click node_fep "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/fep.py"
click node_restart "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/restart.py"
click node_filelock "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/filelock.py"
click node_log "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/log.py"
click node_version "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/_version.py"
click node_ensemble "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/analysis/ensemble.py"
click node_solvation "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/analysis/solvation.py"
click node_dihedral "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/analysis/dihedral.py"
click node_workflowbase "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/workflows/base.py"
click node_registry "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/workflows/registry.py"
click node_dihedralflow "https://github.com/becksteinlab/mdpow/blob/develop/mdpow/workflows/dihedrals.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_run,node_config,node_forcefields,node_equil,node_templates toneBlue
class node_fep toneAmber
class node_ensemble,node_solvation,node_dihedral,node_workflowbase,node_registry,node_dihedralflow toneMint
class node_restart,node_filelock,node_log,node_version toneRose
class node_user,node_inputs,node_gromacs toneIndigo
```

## Components

### Simulation setup

- [Simulation runner](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/run.py): `mdpow/run.py`
- [Configuration](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/config.py): `mdpow/config.py`
- [Force fields](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/forcefields.py): `mdpow/forcefields.py`
- [Equilibrium MD](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/equil.py): `mdpow/equil.py`
- [Gromacs templates](https://github.com/becksteinlab/mdpow/tree/develop/mdpow/templates): `mdpow/templates`

### Free-energy calculation

- [Free-energy setup](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/fep.py): `mdpow/fep.py`

### Analysis

- [Trajectory ensemble](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/analysis/ensemble.py): `mdpow/analysis/ensemble.py`
- [Solvation analysis](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/analysis/solvation.py): `mdpow/analysis/solvation.py`
- [Dihedral analysis](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/analysis/dihedral.py): `mdpow/analysis/dihedral.py`
- [Project workflows](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/workflows/base.py): `mdpow/workflows/base.py`
- [Workflow registry](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/workflows/registry.py): `mdpow/workflows/registry.py`
- [Automated dihedrals](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/workflows/dihedrals.py): `mdpow/workflows/dihedrals.py`

### Shared runtime

- [Stage journal](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/restart.py): `mdpow/restart.py`
- [File locking](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/filelock.py): `mdpow/filelock.py`
- [Logging](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/log.py): `mdpow/log.py`
- [Version metadata](https://github.com/becksteinlab/mdpow/blob/develop/mdpow/_version.py): `mdpow/_version.py`

### Other components

- **Researcher**
- **Structure and ITP**
- **Gromacs**

## Connections

- Researcher → Structure and ITP: provides (evidence: `README.rst`)
- Structure and ITP → Simulation runner: configures
- Simulation runner → Equilibrium MD: dispatches (evidence: `mdpow/run.py`)
- Simulation runner → Free-energy setup: dispatches (evidence: `mdpow/run.py`)
- Equilibrium MD → Configuration: references (evidence: `mdpow/equil.py`)
- Equilibrium MD → Force fields: selects (evidence: `mdpow/equil.py`)
- Equilibrium MD → Stage journal: tracks stages (evidence: `mdpow/equil.py`)
- Equilibrium MD → Gromacs: runs MD (evidence: `mdpow/equil.py`)
- Force fields → Configuration: reads settings (evidence: `mdpow/forcefields.py`)
- Equilibrium MD → Gromacs templates: uses inputs
- Free-energy setup → Configuration: references (evidence: `mdpow/fep.py`)
- Free-energy setup → Stage journal: tracks stages (evidence: `mdpow/fep.py`)
- Free-energy setup → Gromacs: prepares windows (evidence: `mdpow/fep.py`)
- Simulation runner → Configuration: references (evidence: `mdpow/run.py`)
- Simulation runner → Stage journal: references (evidence: `mdpow/run.py`)
- Trajectory ensemble → Solvation analysis: supports analysis (evidence: `mdpow/analysis/solvation.py`)
- Trajectory ensemble → Dihedral analysis: provides trajectories (evidence: `mdpow/analysis/dihedral.py`)
- Project workflows → Workflow registry: dispatches (evidence: `mdpow/workflows/base.py`)
- Workflow registry → Automated dihedrals: registers (evidence: `mdpow/workflows/registry.py`)
- Automated dihedrals → Trajectory ensemble: loads systems (evidence: `mdpow/workflows/dihedrals.py`)
- Automated dihedrals → Dihedral analysis: calculates angles (evidence: `mdpow/workflows/dihedrals.py`)
