# d4sky/biomex architecture

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

- Interactive diagram: https://gitdiagram.com/d4sky/biomex
- Repository: https://github.com/d4sky/biomex

## Overview

biomex is a Python structural-bioinformatics toolkit. Its principal workflow is to load protein or DNA structures, inspect and select atoms or residues, then analyze or compare structures; separate capabilities cover sequence analysis and linker construction. Geometry primitives provide another major user-facing branch, while core supplies shared math, tables, configuration, and I/O. The README documents the capabilities and examples; sampled source confirms key module responsibilities, but many implementation paths and cross-module calls were not excerpted, so those links are omitted.

Main entry points: [`biology/biosystems.py`](https://github.com/d4sky/biomex/blob/main/biology/biosystems.py) (Ensemble), [`geometry/base.py`](https://github.com/d4sky/biomex/blob/main/geometry/base.py) (Rigid Bodies), [`biology/butils.py`](https://github.com/d4sky/biomex/blob/main/biology/butils.py) (Alignment and BLAST), [`biology/bmex.py`](https://github.com/d4sky/biomex/blob/main/biology/bmex.py) (Find Linker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_structure["Structure Analysis"]
  node_ensemble["Ensemble<br/>[biosystems.py]"]
  node_selection["Atom Selection<br/>[biosystems.py]"]
  node_structure_compare["Structure Comparison<br/>[biosystems.py]"]
end

subgraph group_sequence["Sequence Tools"]
  node_sequence["Sequence Utilities<br/>[butils.py]"]
  node_rama["Rama Classification<br/>[butils.py]"]
  node_alignment["Alignment and BLAST<br/>[butils.py]"]
  node_seq_services["MUSCLE / NCBI"]
end

subgraph group_linker["Linker Modeling"]
  node_linker_find["Find Linker<br/>[bmex.py]"]
  node_linker_build["Build Linker<br/>[bmex.py]"]
  node_linker_scan["Conformational Scan<br/>[bmex.py]"]
end

subgraph group_geometry["3-D Geometry"]
  node_body["Rigid Bodies<br/>[base.py]"]
  node_curves["Curves and Helices<br/>[curves.py]"]
  node_shapes["Geometric Shapes<br/>[shapes.py]"]
  node_geometry_algorithms["Geometry Algorithms<br/>[gutils.py]"]
end

subgraph group_shared["Shared Core"]
  node_core_math["Math Utilities<br/>[utils.py]"]
  node_core_tables["Data Tables<br/>[tables.py]"]
  node_core_config["Configuration and Data<br/>[config.py]"]
  node_force_params["Force Parameters<br/>[ff.py]"]
  node_libraries["Bundled Bio Data"]
end

node_user(("Python User"))

node_user -->|"loads structure"| node_ensemble
node_ensemble -->|"selects atoms"| node_selection
node_user -->|"uses sequence tools"| node_sequence
node_user -->|"classifies angles"| node_rama
node_user -->|"aligns sequences"| node_alignment
node_alignment -->|"runs alignment"| node_seq_services
node_user -->|"compares structures"| node_structure_compare
node_user -->|"requests path"| node_linker_find
node_linker_find -->|"builds segment"| node_linker_build
node_user -->|"scans conformations"| node_linker_scan
node_user -->|"creates geometry"| node_body
node_user -->|"creates curves"| node_curves
node_user -->|"creates shapes"| node_shapes
node_user -->|"orders points"| node_geometry_algorithms
node_ensemble -.->|"computes properties"| node_core_math
node_shapes -->|"extends body"| node_body
node_body -->|"uses curves"| node_curves
node_core_tables -->|"reads settings"| node_core_config
node_ensemble -.->|"uses bundled data"| node_libraries

click node_ensemble "https://github.com/d4sky/biomex/blob/main/biology/biosystems.py"
click node_selection "https://github.com/d4sky/biomex/blob/main/biology/biosystems.py"
click node_structure_compare "https://github.com/d4sky/biomex/blob/main/biology/biosystems.py"
click node_sequence "https://github.com/d4sky/biomex/blob/main/biology/butils.py"
click node_rama "https://github.com/d4sky/biomex/blob/main/biology/butils.py"
click node_alignment "https://github.com/d4sky/biomex/blob/main/biology/butils.py"
click node_linker_find "https://github.com/d4sky/biomex/blob/main/biology/bmex.py"
click node_linker_build "https://github.com/d4sky/biomex/blob/main/biology/bmex.py"
click node_linker_scan "https://github.com/d4sky/biomex/blob/main/biology/bmex.py"
click node_body "https://github.com/d4sky/biomex/blob/main/geometry/base.py"
click node_curves "https://github.com/d4sky/biomex/blob/main/geometry/curves.py"
click node_shapes "https://github.com/d4sky/biomex/blob/main/geometry/shapes.py"
click node_geometry_algorithms "https://github.com/d4sky/biomex/blob/main/geometry/gutils.py"
click node_core_math "https://github.com/d4sky/biomex/blob/main/core/utils.py"
click node_core_tables "https://github.com/d4sky/biomex/blob/main/core/tables.py"
click node_core_config "https://github.com/d4sky/biomex/blob/main/core/config.py"
click node_force_params "https://github.com/d4sky/biomex/blob/main/core/ff.py"
click node_libraries "https://github.com/d4sky/biomex/tree/main/libraries"

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_ensemble,node_selection,node_structure_compare,node_user toneBlue
class node_sequence,node_rama,node_alignment,node_seq_services toneAmber
class node_linker_find,node_linker_build,node_linker_scan toneMint
class node_body,node_curves,node_shapes,node_geometry_algorithms toneRose
class node_core_math,node_core_tables,node_core_config,node_force_params,node_libraries toneIndigo
```

## Components

### Structure Analysis

- [Ensemble](https://github.com/d4sky/biomex/blob/main/biology/biosystems.py): `biology/biosystems.py`
- [Atom Selection](https://github.com/d4sky/biomex/blob/main/biology/biosystems.py): `biology/biosystems.py`
- [Structure Comparison](https://github.com/d4sky/biomex/blob/main/biology/biosystems.py): `biology/biosystems.py`

### Sequence Tools

- [Sequence Utilities](https://github.com/d4sky/biomex/blob/main/biology/butils.py): `biology/butils.py`
- [Rama Classification](https://github.com/d4sky/biomex/blob/main/biology/butils.py): `biology/butils.py`
- [Alignment and BLAST](https://github.com/d4sky/biomex/blob/main/biology/butils.py): `biology/butils.py`
- **MUSCLE / NCBI**

### Linker Modeling

- [Find Linker](https://github.com/d4sky/biomex/blob/main/biology/bmex.py): `biology/bmex.py`
- [Build Linker](https://github.com/d4sky/biomex/blob/main/biology/bmex.py): `biology/bmex.py`
- [Conformational Scan](https://github.com/d4sky/biomex/blob/main/biology/bmex.py): `biology/bmex.py`

### 3-D Geometry

- [Rigid Bodies](https://github.com/d4sky/biomex/blob/main/geometry/base.py): `geometry/base.py`
- [Curves and Helices](https://github.com/d4sky/biomex/blob/main/geometry/curves.py): `geometry/curves.py`
- [Geometric Shapes](https://github.com/d4sky/biomex/blob/main/geometry/shapes.py): `geometry/shapes.py`
- [Geometry Algorithms](https://github.com/d4sky/biomex/blob/main/geometry/gutils.py): `geometry/gutils.py`

### Shared Core

- [Math Utilities](https://github.com/d4sky/biomex/blob/main/core/utils.py): `core/utils.py`
- [Data Tables](https://github.com/d4sky/biomex/blob/main/core/tables.py): `core/tables.py`
- [Configuration and Data](https://github.com/d4sky/biomex/blob/main/core/config.py): `core/config.py`
- [Force Parameters](https://github.com/d4sky/biomex/blob/main/core/ff.py): `core/ff.py`
- [Bundled Bio Data](https://github.com/d4sky/biomex/tree/main/libraries): `libraries`

### Other components

- **Python User**

## Connections

- Python User → Ensemble: loads structure (evidence: `README.md`)
- Ensemble → Atom Selection: selects atoms (evidence: `README.md`)
- Python User → Sequence Utilities: uses sequence tools (evidence: `README.md`)
- Python User → Rama Classification: classifies angles (evidence: `README.md`)
- Python User → Alignment and BLAST: aligns sequences (evidence: `README.md`)
- Alignment and BLAST → MUSCLE / NCBI: runs alignment (evidence: `README.md`)
- Python User → Structure Comparison: compares structures (evidence: `README.md`)
- Python User → Find Linker: requests path (evidence: `README.md`)
- Find Linker → Build Linker: builds segment (evidence: `README.md`)
- Python User → Conformational Scan: scans conformations (evidence: `README.md`)
- Python User → Rigid Bodies: creates geometry (evidence: `README.md`)
- Python User → Curves and Helices: creates curves (evidence: `README.md`)
- Python User → Geometric Shapes: creates shapes (evidence: `README.md`)
- Python User → Geometry Algorithms: orders points (evidence: `README.md`)
- Ensemble → Math Utilities: computes properties
- Geometric Shapes → Rigid Bodies: extends body (evidence: `geometry/shapes.py`)
- Rigid Bodies → Curves and Helices: uses curves (evidence: `geometry/base.py`)
- Data Tables → Configuration and Data: reads settings (evidence: `core/tables.py`)
- Ensemble → Bundled Bio Data: uses bundled data
