Skip to main content

Providing Custom Structural Templates

Structural templates can be provided for protein chains to guide the structure prediction. Templates are specified as mmCIF files with explicit mappings between query and template residues.
Structural templates are only supported for protein chains. RNA and DNA chains do not support templates.

Overview

A structural template consists of:
  1. An mmCIF file containing a single protein chain
  2. A mapping from query residue indices to template residue indices

Template Structure

Required Fields

Provide the mmCIF content directly in the JSON:
The mmcif and mmcifPath fields are mutually exclusive. You must use one or the other, not both.

Query and Template Indices

The mapping between query and template residues is defined using two parallel lists:
  • queryIndices: 0-based indices in the query sequence
  • templateIndices: 0-based indices in the template sequence
1

Understanding the Mapping

Each position in queryIndices corresponds to the same position in templateIndices.
This creates the mapping:
  • Query residue 0 → Template residue 0
  • Query residue 1 → Template residue 2
  • Query residue 2 → Template residue 5
  • Query residue 3 → Template residue 6
2

Handling Unresolved Residues

mmCIF files can have residues present in residue tables but missing atom coordinates (unresolved residues). These must be counted when specifying template indices.For example, PDB 8UXY has unresolved residues 1–20.To align query residues 0–3 with template residues 21–24 (which are residues 4–7 in the mmCIF with 0-based indexing after accounting for unresolved residues 1–20):
3

Multiple Templates

You can provide up to 20 templates per protein chain:

Template Modes

AlphaFold 3 supports several template usage modes:
Leave templates unset. AlphaFold 3 will search for templates automatically:
The data pipeline will run Hmmsearch to find structural templates.

mmCIF Requirements

The mmCIF file must contain exactly one protein chain. Multi-chain mmCIFs will cause an error.

Valid Single-Chain mmCIF

Complete Examples

Example 1: Single Custom Template

Example 2: Template-Free with Custom MSA

Example 3: Multiple Templates with Gaps

Advanced: Explicitly Setting Templates to Null

Both approaches are equivalent and will trigger automatic template search.

Code Reference

From folding_input.py:86-121:
From folding_input.py:165-167: