# sokrypton/colabfold architecture

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

- Interactive diagram: https://gitdiagram.com/sokrypton/colabfold
- Repository: https://github.com/sokrypton/colabfold

## Overview

ColabFold provides notebook and command-line workflows for protein sequence and complex structure prediction. The main batch path parses FASTA/CSV or supplied A3M input, obtains MSAs, runs prediction, and writes structure, confidence, and visualization outputs; optional relaxation and restraint-guided inference extend that path. The README also documents alternative model notebooks and local MMseqs2 search. Connections below follow the README or sampled call/import references; several model-specific notebook internals are not represented because they were not sampled.

Main entry points: [`colabfold/batch.py`](https://github.com/sokrypton/colabfold/blob/main/colabfold/batch.py) (Batch runner), [`AlphaFold2.ipynb`](https://github.com/sokrypton/colabfold/blob/main/AlphaFold2.ipynb) (AlphaFold2 notebook), [`Boltz1.ipynb`](https://github.com/sokrypton/colabfold/blob/main/Boltz1.ipynb) (Alternative model notebooks), [`colabfold/colabfold.py`](https://github.com/sokrypton/colabfold/blob/main/colabfold/colabfold.py) (Server MSA client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_batch["Batch runner<br/>[batch.py]"]
  node_input["Input parsing<br/>[input.py]"]
  node_notebook["AlphaFold2 notebook<br/>[AlphaFold2.ipynb]"]
  node_alt_notebooks["Alternative model notebooks<br/>[Boltz1.ipynb]"]
end

subgraph group_msa["Sequence and MSA"]
  node_msa_server["Public MSA server"]
  node_server_client["Server MSA client<br/>[colabfold.py]"]
  node_local_search["Local MMseqs2 search<br/>[search.py]"]
end

subgraph group_prediction["Structure prediction"]
  node_af_model["AlphaFold inference<br/>[colabfold.py]"]
  node_model_config["Model selection<br/>[models.py]"]
  node_rgi_runtime["Restraint-guided runtime<br/>[runtime.py]"]
  node_rgi_sampler["Guided sampler<br/>[sampler.py]"]
  node_relax["Amber relaxation<br/>[relax.py]"]
end

subgraph group_results["Results and analysis"]
  node_structures["Structure output<br/>[pdb.py]"]
  node_plots["Confidence plots<br/>[plot.py]"]
  node_interface_scores["Interface metrics<br/>[extra_ptm.py]"]
  node_ipae_scores["ipSAE metrics<br/>[ipsae.py]"]
  node_citations["Citation output<br/>[citations.py]"]
end

subgraph group_extensions["Model extensions"]
  node_beta_runner["Experimental AF runner"]
  node_pairing["MSA pairing<br/>[pairmsa.py]"]
end

node_user(("Sequence submitter"))

node_user -->|"submits sequences"| node_batch
node_batch -->|"parses input"| node_input
node_batch -->|"requests MSAs"| node_server_client
node_server_client -->|"queries"| node_msa_server
node_batch -.->|"supports local search"| node_local_search
node_user -->|"opens notebook"| node_notebook
node_user -->|"opens model notebook"| node_alt_notebooks
node_notebook -->|"uses MMseqs2"| node_msa_server
node_alt_notebooks -->|"some use MMseqs2"| node_msa_server
node_batch -->|"selects model"| node_model_config
node_batch -->|"runs prediction"| node_af_model
node_batch -->|"supports guided runs"| node_rgi_runtime
node_rgi_runtime -->|"hooks sampler"| node_rgi_sampler
node_batch -->|"relaxes structure"| node_relax
node_batch -.->|"writes structures"| node_structures
node_batch -->|"generates plots"| node_plots
node_batch -->|"computes interface scores"| node_interface_scores
node_batch -->|"computes ipSAE"| node_ipae_scores
node_batch -->|"writes citations"| node_citations
node_beta_runner -->|"uses pairing"| node_pairing

click node_batch "https://github.com/sokrypton/colabfold/blob/main/colabfold/batch.py"
click node_input "https://github.com/sokrypton/colabfold/blob/main/colabfold/input.py"
click node_notebook "https://github.com/sokrypton/colabfold/blob/main/AlphaFold2.ipynb"
click node_alt_notebooks "https://github.com/sokrypton/colabfold/blob/main/Boltz1.ipynb"
click node_server_client "https://github.com/sokrypton/colabfold/blob/main/colabfold/colabfold.py"
click node_local_search "https://github.com/sokrypton/colabfold/blob/main/colabfold/mmseqs/search.py"
click node_af_model "https://github.com/sokrypton/colabfold/blob/main/colabfold/colabfold.py"
click node_model_config "https://github.com/sokrypton/colabfold/blob/main/colabfold/alphafold/models.py"
click node_rgi_runtime "https://github.com/sokrypton/colabfold/blob/main/colabfold/rgi/runtime.py"
click node_rgi_sampler "https://github.com/sokrypton/colabfold/blob/main/colabfold/rgi/sampler.py"
click node_relax "https://github.com/sokrypton/colabfold/blob/main/colabfold/relax.py"
click node_structures "https://github.com/sokrypton/colabfold/blob/main/colabfold/pdb.py"
click node_plots "https://github.com/sokrypton/colabfold/blob/main/colabfold/plot.py"
click node_interface_scores "https://github.com/sokrypton/colabfold/blob/main/colabfold/alphafold/extra_ptm.py"
click node_ipae_scores "https://github.com/sokrypton/colabfold/blob/main/colabfold/alphafold/ipsae.py"
click node_citations "https://github.com/sokrypton/colabfold/blob/main/colabfold/citations.py"
click node_beta_runner "https://github.com/sokrypton/colabfold/blob/main/beta/colabfold_alphafold.py"
click node_pairing "https://github.com/sokrypton/colabfold/blob/main/beta/pairmsa.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_batch,node_input,node_notebook,node_alt_notebooks toneBlue
class node_msa_server,node_server_client,node_local_search toneAmber
class node_af_model,node_model_config,node_rgi_runtime,node_rgi_sampler,node_relax toneMint
class node_structures,node_plots,node_interface_scores,node_ipae_scores,node_citations toneRose
class node_beta_runner,node_pairing,node_user toneIndigo
```

## Components

### User entry points

- [Batch runner](https://github.com/sokrypton/colabfold/blob/main/colabfold/batch.py): `colabfold/batch.py`
- [Input parsing](https://github.com/sokrypton/colabfold/blob/main/colabfold/input.py): `colabfold/input.py`
- [AlphaFold2 notebook](https://github.com/sokrypton/colabfold/blob/main/AlphaFold2.ipynb): `AlphaFold2.ipynb`
- [Alternative model notebooks](https://github.com/sokrypton/colabfold/blob/main/Boltz1.ipynb): `Boltz1.ipynb`

### Sequence and MSA

- **Public MSA server**
- [Server MSA client](https://github.com/sokrypton/colabfold/blob/main/colabfold/colabfold.py): `colabfold/colabfold.py`
- [Local MMseqs2 search](https://github.com/sokrypton/colabfold/blob/main/colabfold/mmseqs/search.py): `colabfold/mmseqs/search.py`

### Structure prediction

- [AlphaFold inference](https://github.com/sokrypton/colabfold/blob/main/colabfold/colabfold.py): `colabfold/colabfold.py`
- [Model selection](https://github.com/sokrypton/colabfold/blob/main/colabfold/alphafold/models.py): `colabfold/alphafold/models.py`
- [Restraint-guided runtime](https://github.com/sokrypton/colabfold/blob/main/colabfold/rgi/runtime.py): `colabfold/rgi/runtime.py`
- [Guided sampler](https://github.com/sokrypton/colabfold/blob/main/colabfold/rgi/sampler.py): `colabfold/rgi/sampler.py`
- [Amber relaxation](https://github.com/sokrypton/colabfold/blob/main/colabfold/relax.py): `colabfold/relax.py`

### Results and analysis

- [Structure output](https://github.com/sokrypton/colabfold/blob/main/colabfold/pdb.py): `colabfold/pdb.py`
- [Confidence plots](https://github.com/sokrypton/colabfold/blob/main/colabfold/plot.py): `colabfold/plot.py`
- [Interface metrics](https://github.com/sokrypton/colabfold/blob/main/colabfold/alphafold/extra_ptm.py): `colabfold/alphafold/extra_ptm.py`
- [ipSAE metrics](https://github.com/sokrypton/colabfold/blob/main/colabfold/alphafold/ipsae.py): `colabfold/alphafold/ipsae.py`
- [Citation output](https://github.com/sokrypton/colabfold/blob/main/colabfold/citations.py): `colabfold/citations.py`

### Model extensions

- [Experimental AF runner](https://github.com/sokrypton/colabfold/blob/main/beta/colabfold_alphafold.py): `beta/colabfold_alphafold.py`
- [MSA pairing](https://github.com/sokrypton/colabfold/blob/main/beta/pairmsa.py): `beta/pairmsa.py`

### Other components

- **Sequence submitter**

## Connections

- Sequence submitter → Batch runner: submits sequences (evidence: `README.md`)
- Batch runner → Input parsing: parses input (evidence: `colabfold/batch.py`)
- Batch runner → Server MSA client: requests MSAs (evidence: `colabfold/batch.py`)
- Server MSA client → Public MSA server: queries (evidence: `colabfold/colabfold.py`)
- Batch runner → Local MMseqs2 search: supports local search
- Sequence submitter → AlphaFold2 notebook: opens notebook (evidence: `README.md`)
- Sequence submitter → Alternative model notebooks: opens model notebook (evidence: `README.md`)
- AlphaFold2 notebook → Public MSA server: uses MMseqs2 (evidence: `README.md`)
- Alternative model notebooks → Public MSA server: some use MMseqs2 (evidence: `README.md`)
- Batch runner → Model selection: selects model (evidence: `colabfold/batch.py`)
- Batch runner → AlphaFold inference: runs prediction (evidence: `colabfold/batch.py`)
- Batch runner → Restraint-guided runtime: supports guided runs (evidence: `colabfold/batch.py`)
- Restraint-guided runtime → Guided sampler: hooks sampler (evidence: `colabfold/rgi/runtime.py`)
- Batch runner → Amber relaxation: relaxes structure (evidence: `colabfold/batch.py`)
- Batch runner → Structure output: writes structures
- Batch runner → Confidence plots: generates plots (evidence: `colabfold/batch.py`)
- Batch runner → Interface metrics: computes interface scores (evidence: `colabfold/batch.py`)
- Batch runner → ipSAE metrics: computes ipSAE (evidence: `colabfold/batch.py`)
- Batch runner → Citation output: writes citations (evidence: `colabfold/batch.py`)
- Experimental AF runner → MSA pairing: uses pairing (evidence: `beta/colabfold_alphafold.py`)
