How graylab/igfold works
Project Type and Purpose
• IgFold is a Python deep-learning library and command-line tool for fast, accurate antibody and nanobody structure prediction.
• It provides a reusable “runner” interface (IgFoldRunner) that orchestrates: sequence embedding, structure prediction via graph-transformer modules, optional refinement (PyRosetta or OpenMM), renumbering (AbNumber), and PDB output.
High-Level Components
a. IgFoldRunner (igfold/IgFoldRunner.py)
• Orchestrates the end-to-end pipeline: takes input sequences, calls the model, triggers refinement and renumbering, writes PDB.
b. Core Model (igfold/model)
• IgFold (GraphTransformer-based) pipeline:
– AntiBERTy embedding (igfold/utils/embed.py)
– GraphTransformer module (GraphTransformer.py)
– IPA attention blocks (IPABlock.py, IPATransformer.py)
– Triangle updates (TriangleGraphTransformer.py, TriangleMultiplicativeModule.py)
– Final structure head in IgFold.py
c. Refinement Modules (igfold/refine)
• PyRosetta backend (pyrosetta_ref.py)
• OpenMM backend (openmm_ref.py)
– Pluggable: Runner picks one based on environment and flags.
d. Supporting Utilities (igfold/utils)
• Sequence parsing, coordinate transforms, PDB I/O, visualization, renumbering interface, metrics.
e. Training Utilities (igfold/training)
• Data loaders and helper functions for model development—not part of the inference pipeline.
External Dependencies and Data Sources
• Deep-learning framework: PyTorch
• Pretrained language model: AntiBERTy
• Refinement engines: PyRosetta or OpenMM (with pdbfixer)
• Renumbering: AbNumber
• Optional: Colab notebook and large antibody sequence archives (OAS, Jaffe2022)
Data Flow and Interactions
1) Input: Antibody chain sequences (H and L or single chain)
2) Embedding: AntiBERTy → per-residue features
3) Graph Construction: build residue graph and pair features
4) Iterative Structure Prediction: GraphTransformer → IPA → Triangle modules → coordinate head
5) Output: initial 3D coordinates
6) Optional Refinement: PyRosetta or OpenMM → energy minimization → improved geometry
7) Renumbering: Chothia scheme via AbNumber
8) Final Output: PDB file with predicted B-factors (RMSD estimates) in B-column
Architectural Patterns and Design Principles
• Modular Pipeline: distinct stages (embed → predict → refine → renum)
• Pluggable Backends: refinement step selects implementation by availability
• Separation of Concerns: model code under igfold/model, orchestration in Runner, I/O and utilities decoupled
• Reusable Components: graph and attention blocks can be extended or replaced