# tencentai4s/iggm architecture

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

- Interactive diagram: https://gitdiagram.com/tencentai4s/iggm
- Repository: https://github.com/tencentai4s/iggm

## Overview

IgGM is a generative foundation model for antibody and nanobody design. The main workflow accepts antibody and antigen sequences/structure, prepares complex features, then samples designed sequences and structures and writes PDB output. README-described tasks also include inverse design, affinity maturation, structure prediction, and humanization. The sampled CLI, deployment, parsing, and model excerpts support the main path; several task-specific internals are unsampled, so their links are marked dashed where appropriate.

Main entry points: [`IgGM/deploy/ab_design.py`](https://github.com/tencentai4s/iggm/blob/master/IgGM/deploy/ab_design.py) (Antibody designer), [`design.py`](https://github.com/tencentai4s/iggm/blob/master/design.py) (Design CLI), [`IgGM/deploy/base_designer.py`](https://github.com/tencentai4s/iggm/blob/master/IgGM/deploy/base_designer.py) (Input assembly), [`IgGM/model/arch/design_model/model.py`](https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/design_model/model.py) (Design model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Inputs and preparation"]
  node_cli["Design CLI<br/>[design.py]"]
  node_fasta["FASTA parser<br/>[fasta_parser.py]"]
  node_pdb["PDB parser<br/>[pdb_parser.py]"]
end

subgraph group_inference["Design inference"]
  node_deployment["Antibody designer<br/>[ab_design.py]"]
  node_base["Input assembly<br/>[base_designer.py]"]
  node_ppi["PPI model<br/>[ppi_model.py]"]
  node_designmodel["Design model<br/>[model.py]"]
  node_diffuser["Structure diffuser<br/>[diffuser.py]"]
  node_structure["Structure module"]
  node_heads["Prediction heads"]
  node_esm["ESM-2 encoder<br/>[esm2.py]"]
end

subgraph group_protein["Protein representation"]
  node_proteinstruct["Structure representation<br/>[prot_struct.py]"]
  node_converter["Structure conversion<br/>[prot_converter.py]"]
  node_constants["Residue definitions<br/>[prot_constants.py]"]
end

subgraph group_geometry["Structural geometry"]
  node_transforms["Rotation transforms"]
  node_so3["SO&#40;3&#41; operations<br/>[so3.py]"]
  node_sampling["Diffusion utilities<br/>[diff_util.py]"]
end

node_user(("Researcher"))
node_output["Designed PDB"]

node_user -->|"runs task"| node_cli
node_cli -->|"parses sequences"| node_fasta
node_cli -->|"loads antigen"| node_pdb
node_cli -.->|"dispatches design"| node_deployment
node_deployment -->|"inherits assembly"| node_base
node_deployment -->|"restores featurizer"| node_ppi
node_deployment -->|"restores model"| node_designmodel
node_deployment -->|"perturbs structures"| node_diffuser
node_base -->|"builds structures"| node_proteinstruct
node_base -->|"converts structures"| node_converter
node_base -->|"loads and saves"| node_pdb
node_designmodel -->|"uses module"| node_structure
node_designmodel -.->|"uses heads"| node_heads
node_designmodel -.->|"encodes sequences"| node_esm
node_deployment -.->|"writes prediction"| node_output
node_pdb -->|"interprets residues"| node_constants
node_proteinstruct -->|"uses atom definitions"| node_constants
node_converter -->|"uses residue definitions"| node_constants
node_transforms -->|"supports rotations"| node_so3
node_sampling -->|"uses SO&#40;3&#41;"| node_so3
node_sampling -->|"converts rotations"| node_transforms
node_diffuser -->|"uses sampling utilities"| node_sampling

click node_cli "https://github.com/tencentai4s/iggm/blob/master/design.py"
click node_fasta "https://github.com/tencentai4s/iggm/blob/master/IgGM/protein/parser/fasta_parser.py"
click node_pdb "https://github.com/tencentai4s/iggm/blob/master/IgGM/protein/parser/pdb_parser.py"
click node_deployment "https://github.com/tencentai4s/iggm/blob/master/IgGM/deploy/ab_design.py"
click node_base "https://github.com/tencentai4s/iggm/blob/master/IgGM/deploy/base_designer.py"
click node_ppi "https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/core/ppi_model.py"
click node_designmodel "https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/design_model/model.py"
click node_diffuser "https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/core/diffuser.py"
click node_structure "https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/core/module/structure_module.py"
click node_heads "https://github.com/tencentai4s/iggm/tree/master/IgGM/model/arch/core/module/head"
click node_esm "https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/esm2/esm2.py"
click node_proteinstruct "https://github.com/tencentai4s/iggm/blob/master/IgGM/protein/prot_struct.py"
click node_converter "https://github.com/tencentai4s/iggm/blob/master/IgGM/protein/prot_converter.py"
click node_constants "https://github.com/tencentai4s/iggm/blob/master/IgGM/protein/prot_constants.py"
click node_transforms "https://github.com/tencentai4s/iggm/blob/master/IgGM/transform/rotation_conversions.py"
click node_so3 "https://github.com/tencentai4s/iggm/blob/master/IgGM/transform/so3.py"
click node_sampling "https://github.com/tencentai4s/iggm/blob/master/IgGM/utils/diff_util.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_fasta,node_pdb toneBlue
class node_deployment,node_base,node_ppi,node_designmodel,node_diffuser,node_structure,node_heads,node_esm toneAmber
class node_proteinstruct,node_converter,node_constants toneMint
class node_transforms,node_so3,node_sampling toneRose
class node_user,node_output toneIndigo
```

## Components

### Inputs and preparation

- [Design CLI](https://github.com/tencentai4s/iggm/blob/master/design.py): `design.py`
- [FASTA parser](https://github.com/tencentai4s/iggm/blob/master/IgGM/protein/parser/fasta_parser.py): `IgGM/protein/parser/fasta_parser.py`
- [PDB parser](https://github.com/tencentai4s/iggm/blob/master/IgGM/protein/parser/pdb_parser.py): `IgGM/protein/parser/pdb_parser.py`

### Design inference

- [Antibody designer](https://github.com/tencentai4s/iggm/blob/master/IgGM/deploy/ab_design.py): `IgGM/deploy/ab_design.py`
- [Input assembly](https://github.com/tencentai4s/iggm/blob/master/IgGM/deploy/base_designer.py): `IgGM/deploy/base_designer.py`
- [PPI model](https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/core/ppi_model.py): `IgGM/model/arch/core/ppi_model.py`
- [Design model](https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/design_model/model.py): `IgGM/model/arch/design_model/model.py`
- [Structure diffuser](https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/core/diffuser.py): `IgGM/model/arch/core/diffuser.py`
- [Structure module](https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/core/module/structure_module.py): `IgGM/model/arch/core/module/structure_module.py`
- [Prediction heads](https://github.com/tencentai4s/iggm/tree/master/IgGM/model/arch/core/module/head): `IgGM/model/arch/core/module/head`
- [ESM-2 encoder](https://github.com/tencentai4s/iggm/blob/master/IgGM/model/arch/esm2/esm2.py): `IgGM/model/arch/esm2/esm2.py`

### Protein representation

- [Structure representation](https://github.com/tencentai4s/iggm/blob/master/IgGM/protein/prot_struct.py): `IgGM/protein/prot_struct.py`
- [Structure conversion](https://github.com/tencentai4s/iggm/blob/master/IgGM/protein/prot_converter.py): `IgGM/protein/prot_converter.py`
- [Residue definitions](https://github.com/tencentai4s/iggm/blob/master/IgGM/protein/prot_constants.py): `IgGM/protein/prot_constants.py`

### Structural geometry

- [Rotation transforms](https://github.com/tencentai4s/iggm/blob/master/IgGM/transform/rotation_conversions.py): `IgGM/transform/rotation_conversions.py`
- [SO(3) operations](https://github.com/tencentai4s/iggm/blob/master/IgGM/transform/so3.py): `IgGM/transform/so3.py`
- [Diffusion utilities](https://github.com/tencentai4s/iggm/blob/master/IgGM/utils/diff_util.py): `IgGM/utils/diff_util.py`

### Other components

- **Researcher**
- **Designed PDB**

## Connections

- Researcher → Design CLI: runs task (evidence: `README.md`)
- Design CLI → FASTA parser: parses sequences (evidence: `design.py`)
- Design CLI → PDB parser: loads antigen (evidence: `design.py`)
- Design CLI → Antibody designer: dispatches design
- Antibody designer → Input assembly: inherits assembly (evidence: `IgGM/deploy/ab_design.py`)
- Antibody designer → PPI model: restores featurizer (evidence: `IgGM/deploy/ab_design.py`)
- Antibody designer → Design model: restores model (evidence: `IgGM/deploy/ab_design.py`)
- Antibody designer → Structure diffuser: perturbs structures (evidence: `IgGM/deploy/ab_design.py`)
- Input assembly → Structure representation: builds structures (evidence: `IgGM/deploy/base_designer.py`)
- Input assembly → Structure conversion: converts structures (evidence: `IgGM/deploy/base_designer.py`)
- Input assembly → PDB parser: loads and saves (evidence: `IgGM/deploy/base_designer.py`)
- Design model → Structure module: uses module (evidence: `IgGM/model/arch/design_model/model.py`)
- Design model → Prediction heads: uses heads
- Design model → ESM-2 encoder: encodes sequences
- Antibody designer → Designed PDB: writes prediction
- PDB parser → Residue definitions: interprets residues (evidence: `IgGM/protein/parser/pdb_parser.py`)
- Structure representation → Residue definitions: uses atom definitions (evidence: `IgGM/protein/prot_struct.py`)
- Structure conversion → Residue definitions: uses residue definitions (evidence: `IgGM/protein/prot_converter.py`)
- Rotation transforms → SO(3) operations: supports rotations (evidence: `IgGM/transform/so3.py`)
- Diffusion utilities → SO(3) operations: uses SO(3) (evidence: `IgGM/utils/diff_util.py`)
- Diffusion utilities → Rotation transforms: converts rotations (evidence: `IgGM/utils/diff_util.py`)
- Structure diffuser → Diffusion utilities: uses sampling utilities (evidence: `IgGM/model/arch/core/diffuser.py`)
