# martini-force-field-initiative/shaker architecture

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

- Interactive diagram: https://gitdiagram.com/martini-force-field-initiative/shaker
- Repository: https://github.com/martini-force-field-initiative/shaker

## Overview

Shaker is a notebook-oriented toolkit for Martini coarse-grained force-field parameterization and validation. The main workflow maps atomistic trajectories to CG beads, measures or estimates bonded terms, prepares and runs a GROMACS system, then compares and visualizes CG results. The graph also preserves the README’s independent capabilities, including topology generation, SASA, virtual sites, and 2D/3D rendering. Some subsystem implementations were not sampled; their nodes reflect documented features, and their uncertain internal connections are omitted.

Main entry points: [`shaker/measurer.py`](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/measurer.py) (Bonded measurement), [`shaker/estimator.py`](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/estimator.py) (Bonded estimation), [`shaker/plot.py`](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/plot.py) (Distribution and SASA plots), [`shaker/helper.py`](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/helper.py) (Shared analysis helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mapping["Mapping and topology"]
  node_mapper["AA-to-CG mapping<br/>[mapper.py]"]
  node_topology["Topology writer<br/>[itp.py]"]
end

subgraph group_analysis["Bonded analysis"]
  node_measure["Bonded measurement<br/>[measurer.py]"]
  node_estimate["Bonded estimation<br/>[estimator.py]"]
  node_dihedral["Dihedral fitting"]
  node_helpers["Shared analysis helpers<br/>[helper.py]"]
end

subgraph group_simulation["Simulation and quality"]
  node_system["System setup and runs<br/>[system_builders.py]"]
  node_overlap["Overlap assessment<br/>[overlap.py]"]
end

subgraph group_geometry["Virtual sites and SASA"]
  node_sasa["SASA analysis<br/>[sasa.py]"]
  node_vsites["Virtual sites<br/>[vsites.py]"]
end

subgraph group_visualization["Visualization and controls"]
  node_plot["Distribution and SASA plots<br/>[plot.py]"]
  node_render3d["3D rendering<br/>[render.py]"]
  node_render2d["2D mapping render<br/>[render_2d.py]"]
  node_options["Session display options<br/>[options.py]"]
end

node_notebook_user(("Notebook user"))
node_gromacs["GROMACS"]

node_notebook_user -->|"maps trajectory"| node_mapper
node_mapper -->|"provides mapped data"| node_estimate
node_notebook_user -->|"measures distributions"| node_measure
node_estimate -->|"measures terms"| node_measure
node_estimate -->|"fits dihedrals"| node_dihedral
node_notebook_user -->|"writes topology"| node_topology
node_notebook_user -->|"prepares and runs"| node_system
node_system -->|"runs commands"| node_gromacs
node_notebook_user -->|"assesses quality"| node_overlap
node_notebook_user -->|"computes SASA"| node_sasa
node_notebook_user -->|"generates sites"| node_vsites
node_notebook_user -->|"plots distributions"| node_plot
node_notebook_user -->|"renders ensemble"| node_render3d
node_notebook_user -->|"renders mapping"| node_render2d
node_overlap -->|"uses plotting"| node_plot
node_dihedral -->|"uses figure helper"| node_plot
node_mapper -->|"uses helpers"| node_helpers
node_measure -->|"uses helpers"| node_helpers
node_estimate -->|"imports measurement"| node_measure
node_vsites -->|"uses helpers"| node_helpers
node_render2d -->|"uses helpers"| node_helpers
node_measure -->|"uses defaults"| node_options
node_dihedral -->|"uses defaults"| node_options
node_plot -->|"uses defaults"| node_options
node_overlap -->|"uses defaults"| node_options

click node_mapper "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/mapper.py"
click node_topology "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/itp.py"
click node_measure "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/measurer.py"
click node_estimate "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/estimator.py"
click node_dihedral "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/dihedral_fitting.py"
click node_system "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/system_builders.py"
click node_overlap "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/overlap.py"
click node_sasa "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/sasa.py"
click node_vsites "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/vsites.py"
click node_plot "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/plot.py"
click node_render3d "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/render.py"
click node_render2d "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/render_2d.py"
click node_options "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/options.py"
click node_helpers "https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/helper.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_mapper,node_topology,node_notebook_user toneBlue
class node_measure,node_estimate,node_dihedral,node_helpers toneAmber
class node_system,node_overlap toneMint
class node_sasa,node_vsites toneRose
class node_plot,node_render3d,node_render2d,node_options,node_gromacs toneIndigo
```

## Components

### Mapping and topology

- [AA-to-CG mapping](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/mapper.py): `shaker/mapper.py`
- [Topology writer](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/itp.py): `shaker/itp.py`

### Bonded analysis

- [Bonded measurement](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/measurer.py): `shaker/measurer.py`
- [Bonded estimation](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/estimator.py): `shaker/estimator.py`
- [Dihedral fitting](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/dihedral_fitting.py): `shaker/dihedral_fitting.py`
- [Shared analysis helpers](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/helper.py): `shaker/helper.py`

### Simulation and quality

- [System setup and runs](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/system_builders.py): `shaker/system_builders.py`
- [Overlap assessment](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/overlap.py): `shaker/overlap.py`

### Virtual sites and SASA

- [SASA analysis](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/sasa.py): `shaker/sasa.py`
- [Virtual sites](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/vsites.py): `shaker/vsites.py`

### Visualization and controls

- [Distribution and SASA plots](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/plot.py): `shaker/plot.py`
- [3D rendering](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/render.py): `shaker/render.py`
- [2D mapping render](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/render_2d.py): `shaker/render_2d.py`
- [Session display options](https://github.com/martini-force-field-initiative/shaker/blob/main/shaker/options.py): `shaker/options.py`

### Other components

- **Notebook user**
- **GROMACS**

## Connections

- Notebook user → AA-to-CG mapping: maps trajectory (evidence: `README.md`)
- AA-to-CG mapping → Bonded estimation: provides mapped data (evidence: `README.md`)
- Notebook user → Bonded measurement: measures distributions (evidence: `README.md`)
- Bonded estimation → Bonded measurement: measures terms (evidence: `shaker/estimator.py`)
- Bonded estimation → Dihedral fitting: fits dihedrals (evidence: `shaker/estimator.py`)
- Notebook user → Topology writer: writes topology (evidence: `README.md`)
- Notebook user → System setup and runs: prepares and runs (evidence: `README.md`)
- System setup and runs → GROMACS: runs commands (evidence: `shaker/system_builders.py`)
- Notebook user → Overlap assessment: assesses quality (evidence: `README.md`)
- Notebook user → SASA analysis: computes SASA (evidence: `README.md`)
- Notebook user → Virtual sites: generates sites (evidence: `README.md`)
- Notebook user → Distribution and SASA plots: plots distributions (evidence: `README.md`)
- Notebook user → 3D rendering: renders ensemble (evidence: `README.md`)
- Notebook user → 2D mapping render: renders mapping (evidence: `README.md`)
- Overlap assessment → Distribution and SASA plots: uses plotting (evidence: `shaker/overlap.py`)
- Dihedral fitting → Distribution and SASA plots: uses figure helper (evidence: `shaker/dihedral_fitting.py`)
- AA-to-CG mapping → Shared analysis helpers: uses helpers (evidence: `shaker/mapper.py`)
- Bonded measurement → Shared analysis helpers: uses helpers (evidence: `shaker/measurer.py`)
- Bonded estimation → Bonded measurement: imports measurement (evidence: `shaker/estimator.py`)
- Virtual sites → Shared analysis helpers: uses helpers (evidence: `shaker/vsites.py`)
- 2D mapping render → Shared analysis helpers: uses helpers (evidence: `shaker/render_2d.py`)
- Bonded measurement → Session display options: uses defaults (evidence: `shaker/measurer.py`)
- Dihedral fitting → Session display options: uses defaults (evidence: `shaker/dihedral_fitting.py`)
- Distribution and SASA plots → Session display options: uses defaults (evidence: `shaker/plot.py`)
- Overlap assessment → Session display options: uses defaults (evidence: `shaker/overlap.py`)
