# lafluceth/af3io architecture

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

- Interactive diagram: https://gitdiagram.com/lafluceth/af3io
- Repository: https://github.com/lafluceth/af3io

## Overview

af3io is a small collection of AlphaFold 3 file utilities. The main workflow accepts input JSON and existing data-pipeline outputs, matches sequences, and copies MSA/template fields into completed inputs; missing sequences can be emitted for pipeline processing. Separate capabilities summarize and compare inputs, compress and inspect confidence JSON, and read prediction archives and their confidence summaries. The CLI-to-data-fill calls are in omitted CLI excerpts, so those links are shown as unverified; other links follow shown calls or documented capabilities.

Main entry points: [`src/af3io/cli.py`](https://github.com/lafluceth/af3io/blob/main/src/af3io/cli.py) (Utility CLI), [`src/af3io/data.py`](https://github.com/lafluceth/af3io/blob/main/src/af3io/data.py) (Sequence data operations), [`src/af3io/predictions.py`](https://github.com/lafluceth/af3io/blob/main/src/af3io/predictions.py) (Archive reader), [`src/af3io/input.py`](https://github.com/lafluceth/af3io/blob/main/src/af3io/input.py) (Input handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input JSON"]
  node_cli["Utility CLI<br/>[cli.py]"]
  node_inputjson["Input handling<br/>[input.py]"]
  node_core["File helpers<br/>[core.py]"]
  node_inputfiles["Input JSON files"]
end

subgraph group_data["Data pipeline fill"]
  node_dataops["Sequence data operations<br/>[data.py]"]
  node_datafiles["Pipeline output files"]
end

subgraph group_confidence["Confidence utilities"]
  node_confops["Confidence encoding<br/>[confidences.py]"]
  node_confdecode["Confidence decoding"]
  node_confarchive["Compressed confidence"]
end

subgraph group_predictions["Prediction archives"]
  node_predictions["Archive reader<br/>[predictions.py]"]
  node_archives["Prediction ZIP"]
  node_summaries["Confidence summaries"]
end

node_user(("Researcher"))
node_af3pipeline(("AlphaFold 3 pipeline"))

node_user -->|"runs commands"| node_cli
node_cli -->|"reads and writes"| node_inputjson
node_inputjson -->|"opens files"| node_core
node_cli -->|"summarizes inputs"| node_inputfiles
node_cli -.->|"fills inputs"| node_dataops
node_dataops -->|"reads sequences"| node_inputjson
node_dataops -->|"indexes and reads"| node_datafiles
node_af3pipeline -->|"produces outputs"| node_datafiles
node_dataops -->|"writes filled inputs"| node_inputfiles
node_cli -->|"encodes confidence"| node_confops
node_confops -->|"compresses values"| node_confarchive
node_cli -->|"reads and formats"| node_confops
node_confdecode -.->|"decodes expressions"| node_confarchive
node_user -->|"uses reader"| node_predictions
node_predictions -->|"reads ZIP entries"| node_archives
node_predictions -->|"extracts scores"| node_summaries

click node_cli "https://github.com/lafluceth/af3io/blob/main/src/af3io/cli.py"
click node_inputjson "https://github.com/lafluceth/af3io/blob/main/src/af3io/input.py"
click node_core "https://github.com/lafluceth/af3io/blob/main/src/af3io/core.py"
click node_dataops "https://github.com/lafluceth/af3io/blob/main/src/af3io/data.py"
click node_confops "https://github.com/lafluceth/af3io/blob/main/src/af3io/confidences.py"
click node_confdecode "https://github.com/lafluceth/af3io/blob/main/src/af3io/confidences_eval.py"
click node_predictions "https://github.com/lafluceth/af3io/blob/main/src/af3io/predictions.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_cli,node_inputjson,node_core,node_inputfiles toneBlue
class node_dataops,node_datafiles toneAmber
class node_confops,node_confdecode,node_confarchive toneMint
class node_predictions,node_archives,node_summaries toneRose
class node_user,node_af3pipeline toneIndigo
```

## Components

### Input JSON

- [Utility CLI](https://github.com/lafluceth/af3io/blob/main/src/af3io/cli.py): `src/af3io/cli.py`
- [Input handling](https://github.com/lafluceth/af3io/blob/main/src/af3io/input.py): `src/af3io/input.py`
- [File helpers](https://github.com/lafluceth/af3io/blob/main/src/af3io/core.py): `src/af3io/core.py`
- **Input JSON files**

### Data pipeline fill

- [Sequence data operations](https://github.com/lafluceth/af3io/blob/main/src/af3io/data.py): `src/af3io/data.py`
- **Pipeline output files**

### Confidence utilities

- [Confidence encoding](https://github.com/lafluceth/af3io/blob/main/src/af3io/confidences.py): `src/af3io/confidences.py`
- [Confidence decoding](https://github.com/lafluceth/af3io/blob/main/src/af3io/confidences_eval.py): `src/af3io/confidences_eval.py`
- **Compressed confidence**

### Prediction archives

- [Archive reader](https://github.com/lafluceth/af3io/blob/main/src/af3io/predictions.py): `src/af3io/predictions.py`
- **Prediction ZIP**
- **Confidence summaries**

### Other components

- **Researcher**
- **AlphaFold 3 pipeline**

## Connections

- Researcher → Utility CLI: runs commands (evidence: `src/af3io/cli.py`)
- Utility CLI → Input handling: reads and writes (evidence: `src/af3io/cli.py`)
- Input handling → File helpers: opens files (evidence: `src/af3io/input.py`)
- Utility CLI → Input JSON files: summarizes inputs (evidence: `src/af3io/cli.py`)
- Utility CLI → Sequence data operations: fills inputs
- Sequence data operations → Input handling: reads sequences (evidence: `src/af3io/data.py`)
- Sequence data operations → Pipeline output files: indexes and reads (evidence: `src/af3io/data.py`)
- AlphaFold 3 pipeline → Pipeline output files: produces outputs (evidence: `README.md`)
- Sequence data operations → Input JSON files: writes filled inputs (evidence: `README.md`)
- Utility CLI → Confidence encoding: encodes confidence (evidence: `src/af3io/cli.py`)
- Confidence encoding → Compressed confidence: compresses values
- Utility CLI → Confidence encoding: reads and formats (evidence: `src/af3io/cli.py`)
- Confidence decoding → Compressed confidence: decodes expressions
- Researcher → Archive reader: uses reader (evidence: `src/af3io/predictions.py`)
- Archive reader → Prediction ZIP: reads ZIP entries (evidence: `src/af3io/predictions.py`)
- Archive reader → Confidence summaries: extracts scores (evidence: `src/af3io/predictions.py`)
