File size: 11,033 Bytes
20aee6d
 
1b04e14
 
 
7d8a612
20aee6d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
---
tags:
- Biology
- Protein
- Structure Prediction
license: agpl-3.0
library_name: ofoldx
pipeline_tag: other
---

# AlphaFold 2

This repository contains **oteam/alphafold2-multimer-model-4**: `model_4_multimer_v3`, converted from the [official parameter archive](https://storage.googleapis.com/alphafold/alphafold_params_2022-12-06.tar).


Native PyTorch implementation of AlphaFold 2 monomer, monomer-pTM, and
AlphaFold-Multimer for OFoldX, including the released five-model CASP14
eight-ensemble protocol and the monomer/pTM initial-guess evaluator used by
PXDesign.

## Disclaimer

This is an unofficial OFoldX implementation of
[AlphaFold 2](https://doi.org/10.1038/s41586-021-03819-2) by John Jumper,
Richard Evans, Alexander Pritzel, Tim Green, Michael Figurnov, Olaf
Ronneberger, Kathryn Tunyasuvunakool, Russ Bates, Augustin Žídek, Anna
Potapenko, Alex Bridgland, Clemens Meyer, Simon A. A. Kohl, Andrew J. Ballard,
Andrew Cowie, Bernardino Romera-Paredes, Stanislav Nikolov, and Rishub Jain,
and [AlphaFold-Multimer](https://doi.org/10.1101/2021.10.04.463034). The
upstream authors did not write, review, or endorse this implementation or
model card. The official implementation is maintained by
[Google DeepMind](https://github.com/google-deepmind/alphafold).

## Model Details

AlphaFold 2 predicts protein three-dimensional structure from amino-acid
sequence, multiple-sequence alignments, and optional structural templates. Its
Evoformer jointly updates MSA and residue-pair representations before an
invariant-point-attention Structure Module produces backbone frames, side-chain
angles, atomic coordinates, and confidence estimates. AlphaFold-Multimer extends
the same design with paired MSAs and chain-relative features for protein
complexes.

### Variants

- **[oteam/alphafold2](https://huggingface.co/oteam/alphafold2)**: AlphaFold 2 monomer model with pLDDT confidence.
- **CASP14 five-model Pipeline**: The fixed released `model_1` through
  `model_5` monomer ensemble. Every checkpoint uses eight input ensembles; one
  shared processed input is evaluated sequentially, all samples are
  stable-ranked by mean pLDDT, and the concrete Pipeline owns optional Amber
  relaxation of none, the best prediction, or all predictions.
- **[oteam/alphafold2-ptm](https://huggingface.co/oteam/alphafold2-ptm)**: Monomer model with predicted aligned error and pTM confidence.
- **AF2 initial guess**: Distinct monomer/pTM Model--Processor--Pipeline pair
  using `model_1_ptm` weights. It seeds the first recycled atom37 `prev_pos`
  state from an in-memory target--binder structure without initializing
  Structure Module frames. Its all-GAP template retains backbone/CB geometry
  for every chain and masks target--binder template pair features.
- **[oteam/alphafold2-multimer](https://huggingface.co/oteam/alphafold2-multimer)**: AlphaFold-Multimer for multi-chain protein complexes.

### Model Specification

| Variant     | Evoformer Blocks | Extra-MSA Blocks | Structure Blocks | MSA Size | Pair Size | Single Size | Recycling Steps | Num Parameters (M) |
| ----------- | ---------------- | ---------------- | ---------------- | -------- | --------- | ----------- | --------------- | ------------------ |
| Monomer     | 48               | 4                | 8                | 256      | 128       | 384         | 4               | 93.229             |
| Monomer pTM | 48               | 4                | 8                | 256      | 128       | 384         | 4               | 93.237             |
| Multimer    | 48               | 4                | 8                | 256      | 128       | 384         | 21              | 93.224             |

### Links

- **Code**: [ofoldx.models.alphafold2](https://github.com/OTeam-AI4S/OFoldX/tree/main/ofoldx/models/alphafold2)
- **Paper**: [Highly accurate protein structure prediction with AlphaFold](https://doi.org/10.1038/s41586-021-03819-2)
- **Multimer Paper**: [Protein complex prediction with AlphaFold-Multimer](https://doi.org/10.1101/2021.10.04.463034)
- **Developed by**: John Jumper, Richard Evans, Alexander Pritzel, Tim Green,
  Michael Figurnov, Olaf Ronneberger, Kathryn Tunyasuvunakool, Russ Bates,
  Augustin Žídek, Anna Potapenko, Alex Bridgland, Clemens Meyer, Simon A. A.
  Kohl, Andrew J. Ballard, Andrew Cowie, Bernardino Romera-Paredes,
  Stanislav Nikolov, Rishub Jain, Jonas Adler, Trevor Back, Stig Petersen,
  David Reiman, Ellen Clancy, Michal Zielinski, Martin Steinegger,
  Michalina Pacholska, Tamas Berghammer, Sebastian Bodenstein, David
  Silver, Oriol Vinyals, Andrew W. Senior, Koray Kavukcuoglu, Pushmeet
  Kohli, and Demis Hassabis
- **Model type**: MSA- and template-conditioned protein structure predictor with an Evoformer trunk and invariant-point-attention structure module
- **Original Repository**: [google-deepmind/alphafold](https://github.com/google-deepmind/alphafold)

## Feature and geometry contract

All public model coordinate boundaries consume an explicit finite numerical projection. Unavailable values are selected out under the declared mask before arithmetic or dtype conversion and have zero coordinate derivatives. Active nonfinite values are invalid requests; finite values outside the model dtype range are an unsupported numeric range. Normalization returns the same input carrier type without changing canonical membership, source masks, or source precision. Decode uses prepared atom correspondences. APIs without an availability mask require complete finite model fields.

The model's atom37/atom14 slots and pseudo-beta convention belong to its residue vocabulary. Template observations and initial model coordinates have separate masks. Physical backbone frames additionally require available, noncollinear defining atoms. Relaxation and its linear-neighbor diagnostics admit only the actual closed standard linear protein graph; sequence labels alone do not certify this chemistry. The clash calculation exempts the admitted peptide C–N pair and has no blanket exemption for slot 5 or putative disulfides.

## Usage

The model depends on the [`ofoldx`](https://github.com/OTeam-AI4S/OFoldX)
library. Install it with pip:

```bash
pip install ofoldx
```

### Structure Prediction

Load the concrete folding Pipeline:

```python
import ofoldx

from ofoldx.io import read_structure

structure, report = read_structure("input.cif")
pipeline = ofoldx.pipeline("fold", model="oteam/alphafold2")
output = pipeline.fold(structure)
```

Every prediction is decoded onto the input `Structure`: each residue's atom37
atoms get predicted coordinates in a new frame, and atoms the model does not
predict (ligands, hydrogens, a terminal OXT) have none.

The Pipeline is callable with the same arguments as `fold`. For staged execution:

```python
prepared = pipeline.prepare(structure)
raw = pipeline.forward(prepared.input, num_samples=1)
result = pipeline.postprocess(prepared, raw)
```

An ordinary Pipeline returns raw `AlphaFold2Output` values from `forward`.
The CASP14 ensemble returns checkpoint-labelled predictions; its `postprocess`
ranks them and accepts `models_to_relax`, `platform`, and `platform_properties`.
Stages describe the operation and do not prescribe CPU or GPU placement.

Load the CASP14 five-model ensemble through the same high-level API:

```python
pipeline = ofoldx.pipeline("fold", model="oteam/alphafold2-casp14")
result = pipeline.fold(structure, num_samples=1, models_to_relax="best", platform="CPU")
best = result.best
```

`result.ranked` retains every prediction, its official checkpoint name,
zero-based sample index, and any Amber relaxation result. Equal mean-pLDDT
values retain checkpoint and sample generation order.

The initial-guess variant consumes a sequence-assigned target--binder
`Structure` and an explicit binder instance:

```python
initial_guess_pipeline = ofoldx.pipeline("fold", model="oteam/alphafold2-initial-guess")
result = initial_guess_pipeline.fold(structure, binder_instance_id="binder", num_recycles=4)
```

Amber relaxation also remains an independently callable family operation over a
decoded structure.

Install [OpenMM](https://docs.openmm.org/latest/userguide/application/01_getting_started.html)
and [PDBFixer](https://github.com/openmm/pdbfixer) in the same environment before
requesting Amber relaxation, including `models_to_relax="best"`:

```bash
conda install -c conda-forge openmm pdbfixer
```

These packages are required for the requested relaxation operation. The folding
Model and the default unrelaxed prediction use the ordinary OFoldX installation.

## Training Details

### Training Data

Refer to the AlphaFold 2 and AlphaFold-Multimer papers and supplementary
materials for the upstream training corpora and data construction. OFoldX does
not redistribute those corpora, sequence databases, or template databases.

### Training Procedure

The upstream monomer models use recycling, MSA and template evidence, and the
released auxiliary losses; the pTM variants were fine-tuned with the
predicted-aligned-error head. AlphaFold-Multimer adds paired-MSA and
chain-relative features and interface confidence.

OFoldX preserves a differentiable final recycle and exposes a masked-MSA
reconstruction loss covering that recycle. It is not the complete released
structural and auxiliary-loss program; MSA, template, and sequence-database
generation remain caller-owned.

## Citation

```bibtex
@article{jumper2021highly,
  author = {Jumper, John and Evans, Richard and Pritzel, Alexander and others},
  title = {Highly accurate protein structure prediction with AlphaFold},
  journal = {Nature},
  volume = {596},
  pages = {583--589},
  year = {2021},
  doi = {10.1038/s41586-021-03819-2}
}
```

For AlphaFold-Multimer predictions, also cite
[Protein complex prediction with AlphaFold-Multimer](https://doi.org/10.1101/2021.10.04.463034).

## Contact

Please use [OFoldX GitHub issues](https://github.com/OTeam-AI4S/OFoldX/issues)
for questions about this implementation or model card. Questions about the
original models should be directed to the upstream AlphaFold authors.

## License

AlphaFold 2 parameters are Copyright 2022 DeepMind Technologies Limited, distributed under [CC BY 4.0](LICENSE). Original parameters: [Google DeepMind AlphaFold](https://storage.googleapis.com/alphafold/alphafold_params_2022-12-06.tar); [upstream parameter licensing](https://github.com/google-deepmind/alphafold#model-parameters). The parameter license allows redistribution and adaptation, including commercial use, subject to attribution and the other license conditions.

The OFoldX implementation is separately licensed under AGPL-3.0-or-later; see [license.md](license.md) and [license-faq.md](license-faq.md).

OFoldX conversion remaps tensor names, layouts and vocabulary axes into the native Model and Processor format. These are modified parameter representations; the original weight terms remain applicable. No upstream endorsement is implied.

Upstream source revision: `c77e5d2a8961d1a353632c462914ff0a32a950f6`.