uniaf3 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uniaf3-0.2.0/PKG-INFO +478 -0
- uniaf3-0.2.0/README.md +456 -0
- uniaf3-0.2.0/pyproject.toml +40 -0
- uniaf3-0.2.0/src/uniaf3/__init__.py +5 -0
- uniaf3-0.2.0/src/uniaf3/adapters/__init__.py +119 -0
- uniaf3-0.2.0/src/uniaf3/adapters/_helpers.py +23 -0
- uniaf3-0.2.0/src/uniaf3/adapters/alphafold3.py +356 -0
- uniaf3-0.2.0/src/uniaf3/adapters/alphafold3_server.py +341 -0
- uniaf3-0.2.0/src/uniaf3/adapters/boltz.py +675 -0
- uniaf3-0.2.0/src/uniaf3/adapters/chai.py +754 -0
- uniaf3-0.2.0/src/uniaf3/adapters/protenix.py +707 -0
- uniaf3-0.2.0/src/uniaf3/cli.py +363 -0
- uniaf3-0.2.0/src/uniaf3/constant.py +344 -0
- uniaf3-0.2.0/src/uniaf3/msa.py +420 -0
- uniaf3-0.2.0/src/uniaf3/schema/__init__.py +31 -0
- uniaf3-0.2.0/src/uniaf3/schema/alphafold3.py +281 -0
- uniaf3-0.2.0/src/uniaf3/schema/alphafold3_server.py +265 -0
- uniaf3-0.2.0/src/uniaf3/schema/base.py +611 -0
- uniaf3-0.2.0/src/uniaf3/schema/boltz.py +407 -0
- uniaf3-0.2.0/src/uniaf3/schema/chai.py +359 -0
- uniaf3-0.2.0/src/uniaf3/schema/protenix.py +391 -0
- uniaf3-0.2.0/src/uniaf3/utils.py +141 -0
- uniaf3-0.2.0/src/uniaf3/vendor/Components-smiles-stereo-oe.smi.parquet +0 -0
- uniaf3-0.2.0/src/uniaf3/vendor/__init__.py +1 -0
- uniaf3-0.2.0/src/uniaf3/vendor/ccd.py +15 -0
- uniaf3-0.2.0/src/uniaf3/vendor/chai1_fasta.py +75 -0
- uniaf3-0.2.0/src/uniaf3/vendor/chai1_glycans.py +99 -0
- uniaf3-0.2.0/src/uniaf3/vendor/chai1_msa.py +294 -0
- uniaf3-0.2.0/src/uniaf3/vendor/colabfold_msa.py +289 -0
- uniaf3-0.2.0/src/uniaf3/vendor/protenix_template.py +212 -0
uniaf3-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: uniaf3
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Unified data processing for AlphaFold3-like models
|
|
5
|
+
Author: Yi Zhou
|
|
6
|
+
Author-email: Yi Zhou <me@y1zhou.com>
|
|
7
|
+
Requires-Dist: aiofiles>=25.1.0
|
|
8
|
+
Requires-Dist: gemmi>=0.7.4
|
|
9
|
+
Requires-Dist: niquests[speedups]>=3.18.2
|
|
10
|
+
Requires-Dist: orjson>=3.11.7
|
|
11
|
+
Requires-Dist: platformdirs>=4.5.1
|
|
12
|
+
Requires-Dist: polars[calamine,numpy,pandas,pydantic]>=1.38.1
|
|
13
|
+
Requires-Dist: pydantic>=2.12.5
|
|
14
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
15
|
+
Requires-Dist: rich>=14.3.2
|
|
16
|
+
Requires-Dist: tqdm>=4.67.3
|
|
17
|
+
Requires-Dist: typer>=0.21.1
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Project-URL: homepage, https://github.com/y1zhou/uniaf3
|
|
20
|
+
Project-URL: issues, https://github.com/y1zhou/uniaf3/issues
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# UniAF3
|
|
24
|
+
|
|
25
|
+
Prepare inputs and process outputs for AlphaFold3-like models, including
|
|
26
|
+
[AlphaFold3](https://github.com/google-deepmind/alphafold3/),
|
|
27
|
+
[Boltz](https://github.com/jwohlwend/boltz),
|
|
28
|
+
[Chai-1](https://github.com/chaidiscovery/chai-lab/),
|
|
29
|
+
and [Protenix-v1](https://github.com/bytedance/Protenix/).
|
|
30
|
+
|
|
31
|
+
UniAF3 provides a unified YAML-based input format that serves as a common intermediate representation for converting between different AlphaFold3-family structure prediction models. The format supports specifying molecular sequences, restraints, and inference parameters in a single configuration file.
|
|
32
|
+
|
|
33
|
+
## Feature Support
|
|
34
|
+
|
|
35
|
+
The following table summarizes feature support across all models:
|
|
36
|
+
|
|
37
|
+
| Feature | UniAF3 | AlphaFold3 | AF3 Server | Boltz | Chai-1 | Protenix |
|
|
38
|
+
| ------------------------ | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ---------------------- | ------------------------ | ------------------------ |
|
|
39
|
+
| **Sequences** | | | | | | |
|
|
40
|
+
| Protein chains | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
41
|
+
| DNA chains | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
42
|
+
| RNA chains | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
43
|
+
| Ligands (CCD) | ✅ | ✅ | ✅ (limited set) | ✅ (single CCD only) | ⚠️ (converted to SMILES) | ✅ (multi-CCD supported) |
|
|
44
|
+
| Ligands (SMILES) | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
|
|
45
|
+
| Ligands (file path) | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
|
|
46
|
+
| Ligands (user CCD) | ❌ | ✅ ([user-provided CCD](https://github.com/google-deepmind/alphafold3/blob/main/docs/input.md#user-provided-ccd)) | ❌ | ❌ | ❌ | ❌ |
|
|
47
|
+
| Multi-CCD ligands | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
|
|
48
|
+
| Glycans | ✅ ([Chai notation](https://github.com/chaidiscovery/chai-lab/tree/main/examples/covalent_bonds#glycans)) | ⚠️ ([as multi-CCD ligands with bonds](https://github.com/google-deepmind/alphafold3/blob/main/docs/input.md#defining-glycans)) | ❌ | ⚠️ (single sugar only) | ✅ | ⚠️ (as multi-CCD ligand) |
|
|
49
|
+
| Ions | ✅ (as CCD ligand) | ✅ (as CCD ligand) | ✅ (dedicated type) | ✅ (as CCD ligand) | ❌ | ✅ (dedicated type) |
|
|
50
|
+
| Homomeric copies | ✅ (via id list) | ✅ (via id list) | ✅ (via count) | ✅ (via id list) | ❌ (separate entities) | ✅ (via count) |
|
|
51
|
+
| **Modifications** | | | | | | |
|
|
52
|
+
| Protein PTMs | ✅ | ✅ | ✅ (limited CCD set) | ✅ | ✅ (inline CCD) | ✅ |
|
|
53
|
+
| DNA modifications | ✅ | ✅ | ✅ (limited CCD set) | ✅ | ✅ (inline CCD) | ✅ |
|
|
54
|
+
| RNA modifications | ✅ | ✅ | ✅ (limited CCD set) | ✅ | ✅ (inline CCD) | ✅ |
|
|
55
|
+
| Cyclic polymers | ✅ (Boltz-specific) | ❌ | ❌ | ✅ | ❌ | ❌ |
|
|
56
|
+
| **MSA & Templates** | | | | | | |
|
|
57
|
+
| Custom MSA | ✅ (via msa_dir) | ✅ (inline or path) | ❌ | ✅ (CSV or A3M) | ✅ (via msa_directory) | ✅ (path) |
|
|
58
|
+
| Paired MSA | ✅ | ✅ | ❌ | ✅ (CSV key column) | ✅ | ✅ |
|
|
59
|
+
| Structural templates | ✅ | ✅ (mmCIF) | ❌ | ✅ (CIF/PDB) | ✅ (via server) | ✅ (A3M/HHR) |
|
|
60
|
+
| **Restraints** | | | | | | |
|
|
61
|
+
| Covalent bonds | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
|
|
62
|
+
| Contact restraints | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ |
|
|
63
|
+
| Pocket restraints | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ |
|
|
64
|
+
| **Inference Parameters** | | | | | | |
|
|
65
|
+
| Random seeds | ✅ | ✅ | ✅ (can be empty) | ❌ (CLI arg) | ✅ (single seed) | ❌ (CLI arg) |
|
|
66
|
+
| Recycling steps | ✅ | ❌ (CLI arg) | ❌ | ❌ (CLI arg) | ✅ | ❌ (CLI arg) |
|
|
67
|
+
| Diffusion steps | ✅ | ❌ (CLI arg) | ❌ | ❌ (CLI arg) | ✅ | ❌ (CLI arg) |
|
|
68
|
+
| Diffusion samples | ✅ | ❌ (CLI arg) | ❌ | ❌ (CLI arg) | ✅ | ❌ (CLI arg) |
|
|
69
|
+
| Affinity prediction | ✅ (Boltz-specific) | ❌ | ❌ | ✅ | ❌ | ❌ |
|
|
70
|
+
|
|
71
|
+
Legend: ✅ = fully supported, ⚠️ = partially supported / lossy conversion, ❌ = not supported
|
|
72
|
+
|
|
73
|
+
## CLI Usage
|
|
74
|
+
|
|
75
|
+
### Validate a config
|
|
76
|
+
|
|
77
|
+
Validate an input config file and print its contents:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
uniaf3 validate INPUT_CONFIG_FILE [--format FORMAT]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Arguments:**
|
|
84
|
+
|
|
85
|
+
- `INPUT_CONFIG_FILE` — Path to the config file to validate (required).
|
|
86
|
+
|
|
87
|
+
**Options:**
|
|
88
|
+
|
|
89
|
+
- `--format`, `-f` — Format of the input config file (default: `uniaf3`). Supported values: `uniaf3`, `alphafold3`, `alphafold3server`, `boltz`, `chai`, `protenix`.
|
|
90
|
+
|
|
91
|
+
**Examples:**
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Validate a UniAF3 config
|
|
95
|
+
uniaf3 validate input.yaml
|
|
96
|
+
|
|
97
|
+
# Validate a Boltz config
|
|
98
|
+
uniaf3 validate boltz_input.yaml --format boltz
|
|
99
|
+
|
|
100
|
+
# Validate an AlphaFold3 JSON
|
|
101
|
+
uniaf3 validate af3_input.json -f alphafold3
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
For Chai-1 configs, if a `.restraints` or `.csv` file with the same stem exists alongside the FASTA file, it will be loaded automatically.
|
|
105
|
+
|
|
106
|
+
### Convert between formats
|
|
107
|
+
|
|
108
|
+
Convert an input config file from one format to another:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
uniaf3 convert INPUT_CONFIG_FILE OUTPUT_DIR [PREFIX] [--from-format FORMAT] [--to-format FORMAT]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Arguments:**
|
|
115
|
+
|
|
116
|
+
- `INPUT_CONFIG_FILE` — Path to the input config file (required).
|
|
117
|
+
- `OUTPUT_DIR` — Directory for the output config file(s) (required).
|
|
118
|
+
- `PREFIX` — Prefix for output file name(s). Defaults to the input file name without extension.
|
|
119
|
+
|
|
120
|
+
**Options:**
|
|
121
|
+
|
|
122
|
+
- `--from-format`, `-f` — Source format (default: `uniaf3`).
|
|
123
|
+
- `--to-format`, `-t` — Target format (default: `alphafold3`).
|
|
124
|
+
|
|
125
|
+
**Examples:**
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# UniAF3 → AlphaFold3
|
|
129
|
+
uniaf3 convert input.yaml output_dir/ --from-format uniaf3 --to-format alphafold3
|
|
130
|
+
|
|
131
|
+
# Boltz → Chai-1
|
|
132
|
+
uniaf3 convert boltz_input.yaml output_dir/ --from-format boltz --to-format chai
|
|
133
|
+
|
|
134
|
+
# AF3 → Protenix
|
|
135
|
+
uniaf3 convert af3_input.json output_dir/ --from-format alphafold3 --to-format protenix
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Input Format
|
|
139
|
+
|
|
140
|
+
UniAF3 configs are written in YAML. The top-level structure is:
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
sequences:
|
|
144
|
+
- # Polymer, Ligand, or Glycan entries
|
|
145
|
+
covalent_bonds: # Optional
|
|
146
|
+
- # CovalentBond entries
|
|
147
|
+
contact_restraints: # Optional
|
|
148
|
+
- # ContactRestraint entries
|
|
149
|
+
pocket_restraints: # Optional
|
|
150
|
+
- # PocketRestraint entries
|
|
151
|
+
aux: # Optional, inference parameters
|
|
152
|
+
seeds:
|
|
153
|
+
- 42
|
|
154
|
+
num_trunk_recycles: 3
|
|
155
|
+
num_diffn_timesteps: 200
|
|
156
|
+
num_diffn_samples: 5
|
|
157
|
+
num_trunk_samples: 1
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Sequences
|
|
161
|
+
|
|
162
|
+
Each entry in the `sequences` list must be one of four types:
|
|
163
|
+
|
|
164
|
+
#### Protein
|
|
165
|
+
|
|
166
|
+
Proteins use the `ProteinSeq` schema (which extends `Polymer`) and support MSA directories and structural templates.
|
|
167
|
+
|
|
168
|
+
```yaml
|
|
169
|
+
- polymer_type: protein
|
|
170
|
+
id: A # or [A, B] for homomeric copies
|
|
171
|
+
sequence: MVLSPADKTNVK # Standard 1-letter amino acid codes
|
|
172
|
+
description: "My protein" # Optional description
|
|
173
|
+
modifications: # Optional PTMs
|
|
174
|
+
- ccd: HY3 # CCD code of modification
|
|
175
|
+
position: 1 # 1-based residue index
|
|
176
|
+
msa_dir: path/to/msa/ # Optional, directory containing MSA files
|
|
177
|
+
templates: # Optional structural templates
|
|
178
|
+
- path: template.cif # Path to mmCIF or PDB file
|
|
179
|
+
query_idx: [0, 1, 2] # 0-based query residue indices
|
|
180
|
+
template_idx: [0, 1, 2] # 0-based template residue indices
|
|
181
|
+
query_chains: [A] # Optional, chain IDs in query
|
|
182
|
+
template_chains: [A] # Optional, chain IDs in template
|
|
183
|
+
boltz_enable_force: false # Boltz-specific: enforce template
|
|
184
|
+
boltz_template_threshold: null # Boltz-specific: deviation threshold (Å)
|
|
185
|
+
boltz_cyclic: false # Boltz-specific: cyclic polymer flag
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**MSA Directory Structure:**
|
|
189
|
+
|
|
190
|
+
The `msa_dir` field points to a directory with the following expected structure:
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
msa_dir/
|
|
194
|
+
a3ms/
|
|
195
|
+
{seq_hash}.single.a3m # Unpaired MSA
|
|
196
|
+
{seq_hash}.pair.a3m # Paired MSA (optional)
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Where `{seq_hash}` is the SHA-256 hex digest of the protein sequence. This follows the Chai-1 MSA search output convention.
|
|
200
|
+
|
|
201
|
+
#### DNA
|
|
202
|
+
|
|
203
|
+
```yaml
|
|
204
|
+
- polymer_type: dna
|
|
205
|
+
id: C
|
|
206
|
+
sequence: GATTACA # Only A, T, G, C allowed
|
|
207
|
+
modifications: # Optional
|
|
208
|
+
- ccd: 6OG
|
|
209
|
+
position: 1
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### RNA
|
|
213
|
+
|
|
214
|
+
```yaml
|
|
215
|
+
- polymer_type: rna
|
|
216
|
+
id: D
|
|
217
|
+
sequence: AGCU # Only A, U, G, C allowed
|
|
218
|
+
modifications: # Optional
|
|
219
|
+
- ccd: 2MG
|
|
220
|
+
position: 1
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
#### Ligand
|
|
224
|
+
|
|
225
|
+
Ligands must specify exactly one of `ccd` (a list of CCD codes) or `smiles`:
|
|
226
|
+
|
|
227
|
+
```yaml
|
|
228
|
+
# CCD ligand (single or multi-CCD)
|
|
229
|
+
- id: E
|
|
230
|
+
ccd:
|
|
231
|
+
- ATP
|
|
232
|
+
|
|
233
|
+
# Multi-CCD ligand (e.g., glycan as ligand)
|
|
234
|
+
- id: F
|
|
235
|
+
ccd:
|
|
236
|
+
- NAG
|
|
237
|
+
- BMA
|
|
238
|
+
|
|
239
|
+
# SMILES ligand
|
|
240
|
+
- id: G
|
|
241
|
+
smiles: "CC(=O)OC1C[NH+]2CCC1CC2"
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
#### Glycan
|
|
245
|
+
|
|
246
|
+
Glycans use [Chai-1's glycan notation](https://github.com/chaidiscovery/chai-lab/tree/main/examples/covalent_bonds#glycans) (modified CCD codes with bond information):
|
|
247
|
+
|
|
248
|
+
```yaml
|
|
249
|
+
- id: H
|
|
250
|
+
chai_str: "NAG(4-1 NAG(4-1 BMA(3-1 MAN)(6-1 MAN)))"
|
|
251
|
+
description: "Branched glycan"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
For single sugars without bonds: `chai_str: NAG`
|
|
255
|
+
|
|
256
|
+
### Chain IDs
|
|
257
|
+
|
|
258
|
+
Chain IDs (`id` field) serve as unique identifiers for each entity. They can be:
|
|
259
|
+
|
|
260
|
+
- A single string: `id: A`
|
|
261
|
+
- A list of strings for homomeric copies: `id: [A, B, C]`
|
|
262
|
+
|
|
263
|
+
Chain IDs are used to reference entities in restraints. When converting to models that use count-based copies (AF3 Server, Protenix), the number of IDs in the list determines the copy count.
|
|
264
|
+
|
|
265
|
+
The chain ID naming convention follows standard spreadsheet-style ordering:
|
|
266
|
+
`A, B, ..., Z, AA, AB, AC, ..., AZ, BA, BB, ...`
|
|
267
|
+
|
|
268
|
+
This is generated by the `int_to_letters()` function (1-indexed): `int_to_letters(1)` → `A`, `int_to_letters(27)` → `AA`, `int_to_letters(28)` → `AB`.
|
|
269
|
+
|
|
270
|
+
> **Note:** The open-source AlphaFold3 documentation uses a "reverse spreadsheet style" ordering (`AA, BA, CA, ...`). UniAF3 standardizes on the conventional spreadsheet ordering for internal consistency across all adapters.
|
|
271
|
+
|
|
272
|
+
### Restraints
|
|
273
|
+
|
|
274
|
+
#### Covalent Bonds
|
|
275
|
+
|
|
276
|
+
Specify covalent bonds between atoms from different entities:
|
|
277
|
+
|
|
278
|
+
```yaml
|
|
279
|
+
covalent_bonds:
|
|
280
|
+
- atom1:
|
|
281
|
+
chain_id: A # Entity ID
|
|
282
|
+
residue_idx: 5 # 1-based residue index (0 for ligands)
|
|
283
|
+
atom_name: CG # Atom name (e.g., CA, N, SG)
|
|
284
|
+
residue_name: P # Optional, for validation
|
|
285
|
+
atom2:
|
|
286
|
+
chain_id: E # Entity ID
|
|
287
|
+
residue_idx: 1 # 1-based position within ligand
|
|
288
|
+
atom_name: C04 # Atom name in the ligand
|
|
289
|
+
residue_name: null # Not required for ligands
|
|
290
|
+
description: "Optional description"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Notes:**
|
|
294
|
+
|
|
295
|
+
- `atom_name` is required for both atoms.
|
|
296
|
+
- `residue_name` is used by Chai-1 for validation and restraint formatting.
|
|
297
|
+
- For ligands, `residue_idx` is typically 1 for single-CCD or SMILES ligands.
|
|
298
|
+
- Ligand atom names follow RDKit naming conventions.
|
|
299
|
+
|
|
300
|
+
#### Contact Restraints
|
|
301
|
+
|
|
302
|
+
Distance restraints between two atoms/residues:
|
|
303
|
+
|
|
304
|
+
```yaml
|
|
305
|
+
contact_restraints:
|
|
306
|
+
- token1:
|
|
307
|
+
chain_id: A
|
|
308
|
+
residue_idx: 10 # 1-based, or 0 if atom_name is used for ligands
|
|
309
|
+
atom_name: null # Optional for polymers, required for ligands
|
|
310
|
+
residue_name: K # Optional, for validation
|
|
311
|
+
token2:
|
|
312
|
+
chain_id: C
|
|
313
|
+
residue_idx: 5
|
|
314
|
+
atom_name: null
|
|
315
|
+
residue_name: null
|
|
316
|
+
max_distance: 8.0 # Maximum distance in Å (must be 4-20 Å)
|
|
317
|
+
min_distance: 0.0 # Minimum distance in Å (Protenix only)
|
|
318
|
+
boltz_enable_force: true # Boltz-specific: enforce with potential
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**Notes:**
|
|
322
|
+
|
|
323
|
+
- `max_distance` must be between 4.0 and 20.0 Å (Boltz requirement, applied universally).
|
|
324
|
+
- `min_distance` is only used by Protenix.
|
|
325
|
+
- AF3 and AF3 Server do **not** support contact restraints.
|
|
326
|
+
|
|
327
|
+
#### Pocket Restraints
|
|
328
|
+
|
|
329
|
+
Specify a binding pocket where a binder chain interacts with specific contact residues:
|
|
330
|
+
|
|
331
|
+
```yaml
|
|
332
|
+
pocket_restraints:
|
|
333
|
+
- binder_chain: E # ID of the chain binding to the pocket
|
|
334
|
+
contact_tokens: # List of residues forming the pocket
|
|
335
|
+
- chain_id: A
|
|
336
|
+
residue_idx: 10
|
|
337
|
+
atom_name: null # For polymers; use atom_name for ligands
|
|
338
|
+
residue_name: K
|
|
339
|
+
- chain_id: A
|
|
340
|
+
residue_idx: 15
|
|
341
|
+
atom_name: null
|
|
342
|
+
residue_name: G
|
|
343
|
+
max_distance: 6.0 # Maximum distance in Å (4-20 Å)
|
|
344
|
+
min_distance: 0.0 # Protenix only
|
|
345
|
+
boltz_enable_force: false # Boltz-specific: enforce with potential
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**Notes:**
|
|
349
|
+
|
|
350
|
+
- Contact tokens must NOT be on the same chain as `binder_chain`.
|
|
351
|
+
- Protenix supports only a single pocket constraint per job.
|
|
352
|
+
- AF3 and AF3 Server do **not** support pocket restraints.
|
|
353
|
+
|
|
354
|
+
### Inference Parameters
|
|
355
|
+
|
|
356
|
+
The `aux` field contains optional inference parameters:
|
|
357
|
+
|
|
358
|
+
```yaml
|
|
359
|
+
aux:
|
|
360
|
+
num_trunk_recycles: 3 # Default: 3
|
|
361
|
+
num_diffn_timesteps: 200 # Default: 200
|
|
362
|
+
num_diffn_samples: 5 # Default: 5
|
|
363
|
+
num_trunk_samples: 1 # Default: 1
|
|
364
|
+
name: "job_name" # Optional, used in AF3 Server
|
|
365
|
+
boltz_affinity_binder_chain: D # Boltz-specific: affinity binder chain ID
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### Seeds
|
|
369
|
+
|
|
370
|
+
Seeds are stored in `aux.seeds` as a list of integer random seeds:
|
|
371
|
+
|
|
372
|
+
```yaml
|
|
373
|
+
aux:
|
|
374
|
+
seeds:
|
|
375
|
+
- 42
|
|
376
|
+
- 123
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
- AF3 uses all seeds directly.
|
|
380
|
+
- Chai-1 uses only the first seed; additional seeds are applied via `num_trunk_samples`.
|
|
381
|
+
- Boltz and Protenix do not store seeds in their config format; default `[42]` is used on import.
|
|
382
|
+
|
|
383
|
+
### Validation Rules
|
|
384
|
+
|
|
385
|
+
The UniAF3 schema enforces these validation rules:
|
|
386
|
+
|
|
387
|
+
1. **At least one sequence** must be provided.
|
|
388
|
+
2. **Modification positions** must be within the sequence length.
|
|
389
|
+
3. **Ligands** must specify exactly one of `ccd` or `smiles`.
|
|
390
|
+
4. **Covalent bond atoms** must have non-null `atom_name`.
|
|
391
|
+
5. **Contact restraints** require `max_distance` between 4.0 and 20.0 Å, and `max_distance > min_distance`.
|
|
392
|
+
6. **Pocket restraint** contact tokens must not be on the same chain as `binder_chain`.
|
|
393
|
+
7. **Restraint atoms** must reference valid chain IDs, and residue indices must be within the sequence length.
|
|
394
|
+
8. **Residue names** in restraints (when provided) are validated against the sequence.
|
|
395
|
+
|
|
396
|
+
## Complete Example
|
|
397
|
+
|
|
398
|
+
```yaml
|
|
399
|
+
sequences:
|
|
400
|
+
- polymer_type: protein
|
|
401
|
+
id: [A, B]
|
|
402
|
+
sequence: MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLS
|
|
403
|
+
msa_dir: dummy_msa/
|
|
404
|
+
modifications:
|
|
405
|
+
- ccd: HY3
|
|
406
|
+
position: 1
|
|
407
|
+
description: Hemoglobin subunit
|
|
408
|
+
- polymer_type: dna
|
|
409
|
+
id: C
|
|
410
|
+
sequence: GATTACA
|
|
411
|
+
- id: D
|
|
412
|
+
ccd:
|
|
413
|
+
- ATP
|
|
414
|
+
- id: E
|
|
415
|
+
smiles: "CC(=O)OC1C[NH+]2CCC1CC2"
|
|
416
|
+
- id: F
|
|
417
|
+
chai_str: NAG
|
|
418
|
+
description: Example glycan
|
|
419
|
+
|
|
420
|
+
covalent_bonds:
|
|
421
|
+
- atom1:
|
|
422
|
+
chain_id: B
|
|
423
|
+
residue_idx: 2
|
|
424
|
+
atom_name: CA
|
|
425
|
+
residue_name: V
|
|
426
|
+
atom2:
|
|
427
|
+
chain_id: D
|
|
428
|
+
residue_idx: 1
|
|
429
|
+
atom_name: C04
|
|
430
|
+
residue_name: null
|
|
431
|
+
|
|
432
|
+
contact_restraints:
|
|
433
|
+
- token1:
|
|
434
|
+
chain_id: A
|
|
435
|
+
residue_idx: 5
|
|
436
|
+
atom_name: CG
|
|
437
|
+
residue_name: P
|
|
438
|
+
token2:
|
|
439
|
+
chain_id: B
|
|
440
|
+
residue_idx: 5
|
|
441
|
+
atom_name: null
|
|
442
|
+
residue_name: P
|
|
443
|
+
max_distance: 8.0
|
|
444
|
+
boltz_enable_force: true
|
|
445
|
+
|
|
446
|
+
pocket_restraints:
|
|
447
|
+
- binder_chain: D
|
|
448
|
+
max_distance: 6.0
|
|
449
|
+
contact_tokens:
|
|
450
|
+
- chain_id: A
|
|
451
|
+
residue_idx: 10
|
|
452
|
+
atom_name: null
|
|
453
|
+
residue_name: N
|
|
454
|
+
- chain_id: B
|
|
455
|
+
residue_idx: 3
|
|
456
|
+
atom_name: null
|
|
457
|
+
residue_name: L
|
|
458
|
+
|
|
459
|
+
aux:
|
|
460
|
+
seeds:
|
|
461
|
+
- 42
|
|
462
|
+
- 123
|
|
463
|
+
num_trunk_recycles: 3
|
|
464
|
+
num_diffn_timesteps: 200
|
|
465
|
+
num_diffn_samples: 5
|
|
466
|
+
num_trunk_samples: 1
|
|
467
|
+
boltz_affinity_binder_chain: D
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
## Model-specific Documentation
|
|
471
|
+
|
|
472
|
+
For detailed documentation on each model's native input format, see:
|
|
473
|
+
|
|
474
|
+
- [AlphaFold3 Input Format](docs/alphafold3-input-format.md)
|
|
475
|
+
- [AlphaFold3 Server Input Format](docs/alphafold3-server-input-format.md)
|
|
476
|
+
- [Boltz Input Format](docs/boltz-input-format.md)
|
|
477
|
+
- [Chai-1 Input Format](docs/chai1-input-format.md)
|
|
478
|
+
- [Protenix Input Format](docs/protenix-input-format.md)
|