# ssenci97/bio-utils-2 architecture

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

- Interactive diagram: https://gitdiagram.com/ssenci97/bio-utils-2
- Repository: https://github.com/ssenci97/bio-utils-2

## Overview

This is a Python toolkit for loading biomolecular structures and analyzing their chains, residue mappings, contacts, interfaces, and ensembles, with table, figure, and interactive visualization outputs. The principal workflow is to load a structure into SyncedStructure, which combines the domain mixins, then inspect or export the resulting analyses. The README is empty; the map uses the source excerpts and index, so links between analysis capabilities not shown as calls are omitted.

Main entry points: [`synced_structure.py`](https://github.com/ssenci97/bio-utils-2/blob/main/synced_structure.py) (SyncedStructure API), [`loaders.py`](https://github.com/ssenci97/bio-utils-2/blob/main/loaders.py) (Structure loaders), [`ensemble.py`](https://github.com/ssenci97/bio-utils-2/blob/main/ensemble.py) (Ensemble analysis), [`chains.py`](https://github.com/ssenci97/bio-utils-2/blob/main/chains.py) (Chain lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Structure loading"]
  node_loaders["Structure loaders<br/>[loaders.py]"]
end

subgraph group_model["Structure model"]
  node_entry["SyncedStructure API"]
  node_chains["Chain lifecycle<br/>[chains.py]"]
  node_metadata["Structure metadata<br/>[metadata.py]"]
  node_helpers["Shared helpers<br/>[helpers.py]"]
end

subgraph group_analysis["Analysis"]
  node_alignment["Sequence alignment<br/>[alignment.py]"]
  node_residues["Residue mapping<br/>[residues.py]"]
  node_contacts["Contact detection<br/>[contacts.py]"]
  node_interfaces["Interface metrics"]
  node_ensemble["Ensemble analysis<br/>[ensemble.py]"]
end

subgraph group_outputs["Results and views"]
  node_contact_map["Contact maps<br/>[contact_map.py]"]
  node_exporter["Data and figure export<br/>[exporter.py]"]
  node_viz["3D visualization<br/>[viz3d.py]"]
end

node_user(("Researcher"))
node_rcsb["RCSB structure files"]

node_user -->|"uses API"| node_entry
node_loaders -->|"downloads structure"| node_rcsb
node_loaders -->|"constructs"| node_entry
node_entry -->|"composes"| node_loaders
node_entry -->|"composes"| node_chains
node_entry -->|"composes"| node_metadata
node_entry -->|"composes"| node_alignment
node_entry -->|"composes"| node_residues
node_entry -->|"composes"| node_contacts
node_entry -->|"composes"| node_contact_map
node_entry -->|"composes"| node_interfaces
node_entry -->|"composes"| node_ensemble
node_entry -->|"composes"| node_exporter
node_entry -->|"composes"| node_viz
node_entry -->|"uses"| node_helpers
node_ensemble -->|"imports"| node_loaders
node_ensemble -->|"constructs"| node_entry

click node_entry "https://github.com/ssenci97/bio-utils-2/blob/main/synced_structure.py"
click node_loaders "https://github.com/ssenci97/bio-utils-2/blob/main/loaders.py"
click node_chains "https://github.com/ssenci97/bio-utils-2/blob/main/chains.py"
click node_metadata "https://github.com/ssenci97/bio-utils-2/blob/main/metadata.py"
click node_alignment "https://github.com/ssenci97/bio-utils-2/blob/main/alignment.py"
click node_residues "https://github.com/ssenci97/bio-utils-2/blob/main/residues.py"
click node_contacts "https://github.com/ssenci97/bio-utils-2/blob/main/contacts.py"
click node_contact_map "https://github.com/ssenci97/bio-utils-2/blob/main/contact_map.py"
click node_interfaces "https://github.com/ssenci97/bio-utils-2/blob/main/interface_metrics.py"
click node_ensemble "https://github.com/ssenci97/bio-utils-2/blob/main/ensemble.py"
click node_exporter "https://github.com/ssenci97/bio-utils-2/blob/main/exporter.py"
click node_viz "https://github.com/ssenci97/bio-utils-2/blob/main/viz3d.py"
click node_helpers "https://github.com/ssenci97/bio-utils-2/blob/main/helpers.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_loaders toneBlue
class node_entry,node_chains,node_metadata,node_helpers toneAmber
class node_alignment,node_residues,node_contacts,node_interfaces,node_ensemble toneMint
class node_contact_map,node_exporter,node_viz toneRose
class node_user,node_rcsb toneIndigo
```

## Components

### Structure loading

- [Structure loaders](https://github.com/ssenci97/bio-utils-2/blob/main/loaders.py): `loaders.py`

### Structure model

- [SyncedStructure API](https://github.com/ssenci97/bio-utils-2/blob/main/synced_structure.py): `synced_structure.py`
- [Chain lifecycle](https://github.com/ssenci97/bio-utils-2/blob/main/chains.py): `chains.py`
- [Structure metadata](https://github.com/ssenci97/bio-utils-2/blob/main/metadata.py): `metadata.py`
- [Shared helpers](https://github.com/ssenci97/bio-utils-2/blob/main/helpers.py): `helpers.py`

### Analysis

- [Sequence alignment](https://github.com/ssenci97/bio-utils-2/blob/main/alignment.py): `alignment.py`
- [Residue mapping](https://github.com/ssenci97/bio-utils-2/blob/main/residues.py): `residues.py`
- [Contact detection](https://github.com/ssenci97/bio-utils-2/blob/main/contacts.py): `contacts.py`
- [Interface metrics](https://github.com/ssenci97/bio-utils-2/blob/main/interface_metrics.py): `interface_metrics.py`
- [Ensemble analysis](https://github.com/ssenci97/bio-utils-2/blob/main/ensemble.py): `ensemble.py`

### Results and views

- [Contact maps](https://github.com/ssenci97/bio-utils-2/blob/main/contact_map.py): `contact_map.py`
- [Data and figure export](https://github.com/ssenci97/bio-utils-2/blob/main/exporter.py): `exporter.py`
- [3D visualization](https://github.com/ssenci97/bio-utils-2/blob/main/viz3d.py): `viz3d.py`

### Other components

- **Researcher**
- **RCSB structure files**

## Connections

- Researcher → SyncedStructure API: uses API (evidence: `synced_structure.py`)
- Structure loaders → RCSB structure files: downloads structure (evidence: `loaders.py`)
- Structure loaders → SyncedStructure API: constructs (evidence: `loaders.py`)
- SyncedStructure API → Structure loaders: composes (evidence: `synced_structure.py`)
- SyncedStructure API → Chain lifecycle: composes (evidence: `synced_structure.py`)
- SyncedStructure API → Structure metadata: composes (evidence: `synced_structure.py`)
- SyncedStructure API → Sequence alignment: composes (evidence: `synced_structure.py`)
- SyncedStructure API → Residue mapping: composes (evidence: `synced_structure.py`)
- SyncedStructure API → Contact detection: composes (evidence: `synced_structure.py`)
- SyncedStructure API → Contact maps: composes (evidence: `synced_structure.py`)
- SyncedStructure API → Interface metrics: composes (evidence: `synced_structure.py`)
- SyncedStructure API → Ensemble analysis: composes (evidence: `synced_structure.py`)
- SyncedStructure API → Data and figure export: composes (evidence: `synced_structure.py`)
- SyncedStructure API → 3D visualization: composes (evidence: `synced_structure.py`)
- SyncedStructure API → Shared helpers: uses (evidence: `synced_structure.py`)
- Ensemble analysis → Structure loaders: imports (evidence: `ensemble.py`)
- Ensemble analysis → SyncedStructure API: constructs (evidence: `ensemble.py`)
