# mauriciocafiero/umadock architecture

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

- Interactive diagram: https://gitdiagram.com/mauriciocafiero/umadock
- Repository: https://github.com/mauriciocafiero/umadock

## Overview

UMA-Dock prepares protein binding-site clusters, docks RDKit ligand conformers, scores and optimizes poses with selectable MLIP models, and reports binding-energy components. The README also documents a Modal runner, cached preparation inputs, and optional post-docking molecular dynamics. Source excerpts show the core docking implementation and binding-site preparation, but not the Modal runner or result-writing path; those relationships are therefore limited to documented links.

Main entry points: [`code/UMADock/prep_binding_site.py`](https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/prep_binding_site.py) (Prepare binding site), [`code/UMADock/UMADock.py`](https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py) (Pose placement), [`CLI_version/3np_umadock.py`](https://github.com/mauriciocafiero/umadock/blob/main/CLI_version/3np_umadock.py) (Legacy CLI runner), [`code/modal_test.py`](https://github.com/mauriciocafiero/umadock/blob/main/code/modal_test.py) (Modal runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Site preparation"]
  node_prep_site["Prepare binding site"]
end

subgraph group_dock["Docking and scoring"]
  node_conformers["Ligand conformers<br/>[UMADock.py]"]
  node_model["MLIP selection<br/>[UMADock.py]"]
  node_placement["Pose placement<br/>[UMADock.py]"]
  node_pose_score["Interaction scoring<br/>[UMADock.py]"]
  node_pose_opt["Pose optimization<br/>[UMADock.py]"]
  node_energy_analysis["Binding energy analysis<br/>[UMADock.py]"]
  node_md["Optional dynamics<br/>[UMADock.py]"]
end

subgraph group_run["Run interfaces"]
  node_modal["Modal runner<br/>[modal_test.py]"]
  node_cli["Legacy CLI runner<br/>[3np_umadock.py]"]
  node_results["Pose and energy results"]
end

subgraph group_state["Cached structures"]
  node_site_cache[("Prepared site cache")]
  node_pdb_cache[("PDB cache")]
end

node_user(("Researcher"))
node_pdb["PDB input"]

node_user -->|"requests prep"| node_prep_site
node_pdb -->|"provides structure"| node_prep_site
node_prep_site -->|"writes XYZ and metadata"| node_site_cache
node_pdb_cache -->|"reuses cached PDB"| node_prep_site
node_user -->|"starts run"| node_modal
node_modal -.->|"runs docking pipeline"| node_conformers
node_prep_site -->|"supplies site"| node_placement
node_cli -->|"generates conformers"| node_conformers
node_cli -->|"starts docking"| node_placement
node_conformers -->|"provides conformers"| node_placement
node_model -->|"scores poses"| node_pose_score
node_placement -->|"evaluates placements"| node_pose_score
node_pose_score -->|"optimizes selected poses"| node_pose_opt
node_pose_opt -->|"provides optimized poses"| node_energy_analysis
node_energy_analysis -->|"reports energies"| node_results
node_pose_opt -->|"supports follow-up dynamics"| node_md
node_md -.->|"writes trajectory"| node_results

click node_prep_site "https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/prep_binding_site.py"
click node_site_cache "https://github.com/mauriciocafiero/umadock/tree/main/data/sites"
click node_pdb_cache "https://github.com/mauriciocafiero/umadock/tree/main/data/pdbs"
click node_conformers "https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py"
click node_model "https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py"
click node_placement "https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py"
click node_pose_score "https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py"
click node_pose_opt "https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py"
click node_energy_analysis "https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py"
click node_md "https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py"
click node_modal "https://github.com/mauriciocafiero/umadock/blob/main/code/modal_test.py"
click node_cli "https://github.com/mauriciocafiero/umadock/blob/main/CLI_version/3np_umadock.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_prep_site toneBlue
class node_conformers,node_model,node_placement,node_pose_score,node_pose_opt,node_energy_analysis,node_md toneAmber
class node_modal,node_cli,node_results toneMint
class node_site_cache,node_pdb_cache toneRose
class node_user,node_pdb toneIndigo
```

## Components

### Site preparation

- [Prepare binding site](https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/prep_binding_site.py): `code/UMADock/prep_binding_site.py`

### Docking and scoring

- [Ligand conformers](https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py): `code/UMADock/UMADock.py`
- [MLIP selection](https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py): `code/UMADock/UMADock.py`
- [Pose placement](https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py): `code/UMADock/UMADock.py`
- [Interaction scoring](https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py): `code/UMADock/UMADock.py`
- [Pose optimization](https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py): `code/UMADock/UMADock.py`
- [Binding energy analysis](https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py): `code/UMADock/UMADock.py`
- [Optional dynamics](https://github.com/mauriciocafiero/umadock/blob/main/code/UMADock/UMADock.py): `code/UMADock/UMADock.py`

### Run interfaces

- [Modal runner](https://github.com/mauriciocafiero/umadock/blob/main/code/modal_test.py): `code/modal_test.py`
- [Legacy CLI runner](https://github.com/mauriciocafiero/umadock/blob/main/CLI_version/3np_umadock.py): `CLI_version/3np_umadock.py`
- **Pose and energy results**

### Cached structures

- [Prepared site cache](https://github.com/mauriciocafiero/umadock/tree/main/data/sites): `data/sites`
- [PDB cache](https://github.com/mauriciocafiero/umadock/tree/main/data/pdbs): `data/pdbs`

### Other components

- **Researcher**
- **PDB input**

## Connections

- Researcher → Prepare binding site: requests prep (evidence: `README.md`)
- PDB input → Prepare binding site: provides structure (evidence: `README.md`)
- Prepare binding site → Prepared site cache: writes XYZ and metadata (evidence: `README.md`)
- PDB cache → Prepare binding site: reuses cached PDB (evidence: `README.md`)
- Researcher → Modal runner: starts run (evidence: `README.md`)
- Modal runner → Ligand conformers: runs docking pipeline
- Prepare binding site → Pose placement: supplies site (evidence: `README.md`)
- Legacy CLI runner → Ligand conformers: generates conformers (evidence: `CLI_version/3np_umadock.py`)
- Legacy CLI runner → Pose placement: starts docking (evidence: `CLI_version/3np_umadock.py`)
- Ligand conformers → Pose placement: provides conformers (evidence: `code/UMADock/UMADock.py`)
- MLIP selection → Interaction scoring: scores poses (evidence: `code/UMADock/UMADock.py`)
- Pose placement → Interaction scoring: evaluates placements (evidence: `code/UMADock/UMADock.py`)
- Interaction scoring → Pose optimization: optimizes selected poses (evidence: `code/UMADock/UMADock.py`)
- Pose optimization → Binding energy analysis: provides optimized poses (evidence: `code/UMADock/UMADock.py`)
- Binding energy analysis → Pose and energy results: reports energies (evidence: `README.md`)
- Pose optimization → Optional dynamics: supports follow-up dynamics (evidence: `README.md`)
- Optional dynamics → Pose and energy results: writes trajectory
