Phsntom
/

Phsntom fmilletari-czi commited on
Commit
c2f939a
·
0 Parent(s):

Duplicate from biohub/ESMFold2

Browse files

Co-authored-by: Fausto Milletari <fmilletari-czi@users.noreply.huggingface.co>

Files changed (6) hide show
  1. .gitattributes +36 -0
  2. README.md +228 -0
  3. ccd.pkl +3 -0
  4. config.json +105 -0
  5. images/folding_evals.png +3 -0
  6. model.safetensors +3 -0
.gitattributes ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ images/folding_evals.png filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license:
3
+ - mit
4
+ - other
5
+ license_link: https://github.com/Biohub/esm/blob/main/THIRD_PARTY_NOTICE.md
6
+ language: en
7
+ tags:
8
+ - biology
9
+ - esm
10
+ - protein
11
+ - protein-structure-prediction
12
+ - structure-prediction
13
+ - protein-design
14
+ - 3d-structure
15
+ - confidence-estimation
16
+ - molecular-dynamics
17
+ - transformers
18
+ ---
19
+
20
+ # ESMFold2
21
+
22
+ ## Model Details
23
+
24
+ ESMFold2 is a state-of-the-art model for protein structure prediction and design that defines a new frontier for speed and accuracy. The model predicts high-resolution, all-atom 3D protein structures directly from amino acid sequences, with optional multiple sequence alignment (MSA) input for enhanced accuracy on challenging targets. The model outputs comprehensive structural information including all-atom coordinates (backbone and side chains), confidence metrics (pLDDT, pAE, pTM, iPTM), and optional distogram predictions for detailed analysis of predicted structures. Unlike ESMFold, ESMFold2 is able to predict structures for all biomolecules, including small molecules, DNA, RNA, and modified amino acids.
25
+
26
+ ESMFold2 is capable of either single-sequence or MSA conditioned structure prediction for improved accuracy on difficult targets. The ESMFold2-Fast variant is an inference optimized single-sequence structure prediction model and is not MSA conditioned.
27
+
28
+ To run this model with the Biohub Platform API, visit the [Biohub Platform](https://biohub.ai/).
29
+
30
+ Read more about ESMFold2 in our paper [here](https://biohub.ai/papers/esm_protein.pdf).
31
+
32
+ ## Model Variants
33
+
34
+ | Model | MSA Conditioning | Description | Data Cutoff |
35
+ | :---- | :---- | :---- | :---- |
36
+ | [ESMFold2](https://huggingface.co/biohub/ESMFold2) | Yes | Large model, capable of either single-sequence or MSA conditioned structure prediction for improved accuracy on difficult targets | Sept 2021 |
37
+ | [ESMFold2-Fast](https://huggingface.co/biohub/ESMFold2-Fast) | No | Inference optimized single-sequence structure prediction model | Sept 2021 |
38
+
39
+ ## Performance Metrics
40
+
41
+ ESMfold2 was evaluated against state-of-the-art single-sequence and MSA-based structure prediction models on the FoldBench benchmark. ESMFold2 meets or exceeds performance by AlphaFold3 on antibody-antigen complex prediction, protein-protein complex prediction and [Runs N' Poses](https://www.biorxiv.org/content/10.1101/2025.02.03.636309v1) benchmarks. Inference-time compute can dramatically improve performance of ESMFold2, especially across antibody-antigen complexes.
42
+
43
+ ![][image1]
44
+
45
+ Refer to the [paper](https://biohub.ai/papers/esm_protein.pdf) for details on additional performance metrics.
46
+
47
+ ### Usage
48
+
49
+ Please install `esm` from GitHub (a PyPI release is coming soon):
50
+
51
+ ```
52
+ pip install esm@git+https://github.com/Biohub/esm.git@main
53
+ ```
54
+
55
+ You can fold your first protein with:
56
+
57
+ ```py
58
+ from transformers.models.esmfold2.modeling_esmfold2 import ESMFold2Model
59
+
60
+ # Ubiquitin (PDB 1UBQ)
61
+ sequence = "MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGG"
62
+
63
+ # optionally use "biohub/ESMFold2"
64
+ model = ESMFold2Model.from_pretrained("biohub/ESMFold2-Fast").cuda().eval()
65
+ output = model.infer_protein(sequence, num_loops=3, num_sampling_steps=50)
66
+
67
+ print(f"pLDDT mean: {float(output['plddt'].mean()):.3f}, pTM: {float(output['ptm'].mean()):.3f}")
68
+ ```
69
+
70
+ You can also fold complex biomolecules — proteins, DNA/RNA (with modified residues), and small-molecule ligands all at once. Here's an example folding the HhaI DNA methyltransferase + its cognate DNA (with a trapped 5-fluoro-2′-deoxycytidine, CCD `C36`) + the SAH cofactor (PDB [1MHT](https://www.rcsb.org/structure/1MHT)):
71
+
72
+ ```py
73
+ from esm.models.esmfold2 import (
74
+ DNAInput,
75
+ ESMFold2InputBuilder,
76
+ LigandInput,
77
+ Modification,
78
+ ProteinInput,
79
+ StructurePredictionInput,
80
+ )
81
+ from transformers.models.esmfold2.modeling_esmfold2 import ESMFold2Model
82
+
83
+ HHAI_SEQ = (
84
+ "MIEIKDKQLTGLRFIDLFAGLGGFRLALESCGAECVYSNEWDKYAQEVYEMNFGEKPEGDITQVNEKTIPDH"
85
+ "DILCAGFPCQAFSISGKQKGFEDSRGTLFFDIARIVREKKPKVVFMENVKNFASHDNGNTLEVVKNTMNELD"
86
+ "YSFHAKVLNALDYGIPQKRERIYMICFRNDLNIQNFQFPKPFELNTFVKDLLLPDSEVEHLVIDRKDLVMTN"
87
+ "QEIEQTTPKTVRLGIVGKGGQGERIYSTRGIAITLSAYGGGIFAKTGGYLVNGKTRKLHPRECARVMGYPDS"
88
+ "YKVHPSTSQAYKQFGNSVVINVLQYIAYNIGSSLNFKPY"
89
+ )
90
+
91
+ model = ESMFold2Model.from_pretrained("biohub/ESMFold2").cuda().eval()
92
+
93
+ spi = StructurePredictionInput(
94
+ sequences=[
95
+ ProteinInput(id="A", sequence=HHAI_SEQ),
96
+ DNAInput(
97
+ id="B",
98
+ sequence="GATAGCGCTATC",
99
+ modifications=[Modification(position=5, ccd="C36")],
100
+ ),
101
+ DNAInput(
102
+ id="C",
103
+ sequence="TGATAGCGCTATC",
104
+ modifications=[Modification(position=6, ccd="C36")],
105
+ ),
106
+ LigandInput(id="L", ccd=["SAH"]),
107
+ ]
108
+ )
109
+
110
+ result = ESMFold2InputBuilder().fold(
111
+ model, spi, num_loops=3, num_sampling_steps=50, num_diffusion_samples=1, seed=0
112
+ )
113
+
114
+ print(f"pLDDT mean: {float(result.plddt.mean()):.3f}, pTM: {float(result.ptm):.3f}, ipTM: {float(result.iptm):.3f}")
115
+
116
+ with open("1mht_pred.cif", "w") as f:
117
+ f.write(result.complex.to_mmcif())
118
+ ```
119
+
120
+ For the Biohub API, first generate an [API key](https://biohub.ai/developer-console/api-keys) and add it to your Biohub account. The code below assumes the environment variable `ESM_API_KEY=$YOUR_API_KEY`.
121
+
122
+ ```py
123
+ import os
124
+
125
+ from esm.models.esmfold2 import (
126
+ DNAInput,
127
+ LigandInput,
128
+ Modification,
129
+ ProteinInput,
130
+ StructurePredictionInput,
131
+ )
132
+ from esm.sdk import esmfold2_client
133
+ from esm.sdk.api import FoldingConfig
134
+
135
+ HHAI_SEQ = (
136
+ "MIEIKDKQLTGLRFIDLFAGLGGFRLALESCGAECVYSNEWDKYAQEVYEMNFGEKPEGDITQVNEKTIPDH"
137
+ "DILCAGFPCQAFSISGKQKGFEDSRGTLFFDIARIVREKKPKVVFMENVKNFASHDNGNTLEVVKNTMNELD"
138
+ "YSFHAKVLNALDYGIPQKRERIYMICFRNDLNIQNFQFPKPFELNTFVKDLLLPDSEVEHLVIDRKDLVMTN"
139
+ "QEIEQTTPKTVRLGIVGKGGQGERIYSTRGIAITLSAYGGGIFAKTGGYLVNGKTRKLHPRECARVMGYPDS"
140
+ "YKVHPSTSQAYKQFGNSVVINVLQYIAYNIGSSLNFKPY"
141
+ )
142
+
143
+ client = esmfold2_client(model="esmfold2-fast-2026-05", token=os.environ["ESM_API_KEY"])
144
+
145
+ spi = StructurePredictionInput(
146
+ sequences=[
147
+ ProteinInput(id="A", sequence=HHAI_SEQ),
148
+ DNAInput(
149
+ id="B",
150
+ sequence="GATAGCGCTATC",
151
+ modifications=[Modification(position=5, ccd="C36")],
152
+ ),
153
+ DNAInput(
154
+ id="C",
155
+ sequence="TGATAGCGCTATC",
156
+ modifications=[Modification(position=6, ccd="C36")],
157
+ ),
158
+ LigandInput(id="L", ccd=["SAH"]),
159
+ ]
160
+ )
161
+
162
+ result = client.fold_all_atom(spi, config=FoldingConfig(num_loops=3, num_sampling_steps=50))
163
+
164
+ print(f"pLDDT mean: {float(result.plddt.mean()):.3f}, pTM: {float(result.ptm):.3f}, ipTM: {float(result.iptm):.3f}")
165
+ ```
166
+
167
+ ## Training Data
168
+
169
+ ESMfold2 was trained on sequences from the Protein Data Bank (PDB) and the AlphaFold DB (AFDB).
170
+
171
+ ## Frontier Safety
172
+
173
+ Biohub has established a safety team to assess the benefits and potential risks of our models and tools prior to release, and develop mitigations where necessary. Risk assessment was conducted for ESMFold2 prior to release. Further details are available in our corresponding paper appendix.
174
+
175
+ Informed by our risk assessments, we are releasing the source code and model weights for ESMFold2.
176
+
177
+ [Biohub.ai](http://Biohub.ai) Platform: We implement guardrails that detect and restrict the use of keywords and sequences corresponding to controlled pathogens and toxins on our freely accessible platform. For further details regarding these guardrails, please refer to our Biohub platform Resources page.
178
+
179
+ ## Biases and Limitations
180
+
181
+ - **Dataset biases**: The model may reflect biases present in the training data (PDB, AFDB), including over-representation of certain protein families, experimental conditions, or structural classes. Performance may vary for underrepresented protein types.
182
+ - **Dataset limitations:** PDB historically lacks comprehensive data on protein conformations, post-translational modifications, disordered regions, etc. Like all other structure prediction models trained on the PDB, performance may degrade on other biomolecules.
183
+ - **Computational demand:** Highest accuracy structure predictions require scaling inference time compute. Predictions made with reduced inference parameters may lead to suboptimal performance.
184
+ - **Experimental validation required**: All predictions should be considered hypotheses requiring experimental validation. The model cannot replace experimental structure determination methods (X-ray crystallography, cryo-EM, NMR) for definitive structural characterization.
185
+
186
+ ### Out-of-Scope or Unauthorized Use Cases
187
+
188
+ Do not use the model for the following purposes:
189
+
190
+ - Any use that is prohibited by the [Acceptable Use Policy](https://biohub.org/acceptable-use-policy/).
191
+
192
+ ### Caveats and Recommendations
193
+
194
+ - Always review and validate outputs generated by the model.
195
+ - Treat model outputs as machine-generated hypotheses that require further experimental validation, not as established biological facts.
196
+ - We are committed to advancing the responsible development and use of artificial intelligence.
197
+
198
+ Should you have any security or privacy issues or questions related to this model, please reach out to our team at [support@biohub.org](mailto:support@biohub.org).
199
+
200
+ ### Citation
201
+
202
+ ```
203
+ @misc{candido2026language,
204
+ title = {Language Modeling Materializes a World Model of Protein Biology},
205
+ author = {Candido, Salvatore and Hayes, Thomas and Derry, Alexander and Rao, Roshan
206
+ and Lin, Zeming and Verkuil, Robert and Wu, Bryan and Lee, Jin Sub
207
+ and Bruguera, Elise S. and Keval, Jehan A. and Kopylov, Mykhailo
208
+ and Pak, John E. and Wu, Wesley and Thomas, Neil and Mataraso, Samson
209
+ and Hsu, Alvin and Trotman-Grant, Ashton C. and Fatras, Kilian
210
+ and dos Santos Costa, Allan and Badkundri, Rohil and Ak{\i}n, Halil
211
+ and Oktay, Deniz and Deaton, Jonathan and Montabana, Elizabeth
212
+ and Sitwala, Hrishita and Yu, Yue and Wiggert, Marius
213
+ and Carlin, Dylan Alexander and Goering, Anthony W. and Blazejewski, Tomasz
214
+ and Sandora, McCullen and Hla, Michael and Jia, Tina Z.
215
+ and Kloker, Leon H. and Sofroniew, Nicholas J. and Uehara, Masatoshi
216
+ and Pannu, Jassi and Bachas, Sharrol and Liu, Daniel S.
217
+ and Sercu, Tom and Rives, Alexander},
218
+ year = {2026},
219
+ url = {https://biohub.ai/papers/esm_protein.pdf},
220
+ note = {Preprint}
221
+ }
222
+ ```
223
+
224
+ ## Acknowledgements
225
+
226
+ Many people on the Biohub AI Research team and prior EvolutionaryScale team contributed to the development of this model. It would not have been possible without them.
227
+
228
+ [image1]: images/folding_evals.png
ccd.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ff44b1927c6b9198e38ffe0928706827a09a350c15530beeeabebfa88038fc5
3
+ size 417306584
config.json ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ESMFold2Model"
4
+ ],
5
+ "confidence_head": {
6
+ "distogram_bins": 39,
7
+ "enabled": true,
8
+ "folding_trunk": {
9
+ "dropout": 0.25,
10
+ "n_heads": 8,
11
+ "n_layers": 4
12
+ },
13
+ "max_dist": 50.75,
14
+ "min_dist": 3.25,
15
+ "num_pae_bins": 64,
16
+ "num_pde_bins": 64,
17
+ "num_plddt_bins": 50
18
+ },
19
+ "d_pair": 256,
20
+ "d_single": 384,
21
+ "disable_msa_features": false,
22
+ "dtype": "float32",
23
+ "esmc_id": "biohub/ESMC-6B",
24
+ "folding_trunk": {
25
+ "dropout": 0.25,
26
+ "n_heads": 8,
27
+ "n_layers": 48
28
+ },
29
+ "force_lm_dropout_during_inference": false,
30
+ "inputs": {
31
+ "atom_encoder": {
32
+ "d_atom": 128,
33
+ "d_token": 768,
34
+ "expansion_ratio": 2,
35
+ "n_blocks": 3,
36
+ "n_heads": 4,
37
+ "n_spatial_rope_pairs_per_axis": 2,
38
+ "n_uid_rope_pairs": 10,
39
+ "spatial_rope_base_frequency": 20.0,
40
+ "swa_window_size": 128,
41
+ "uid_rope_base_frequency": 10000.0
42
+ },
43
+ "d_inputs": 451
44
+ },
45
+ "lm_d_model": 2560,
46
+ "lm_dropout": 0.0,
47
+ "lm_encoder": {
48
+ "enabled": true,
49
+ "lm_dropout": 0.25,
50
+ "n_layers": 4,
51
+ "per_loop_lm_dropout": true
52
+ },
53
+ "lm_num_layers": 80,
54
+ "model_type": "esmfold2",
55
+ "msa_encoder": {
56
+ "d_hidden": 32,
57
+ "d_msa": 128,
58
+ "enabled": true,
59
+ "msa_head_width": 16,
60
+ "n_heads_msa": 8,
61
+ "n_layers": 4
62
+ },
63
+ "msa_encoder_overwrite": true,
64
+ "n_relative_chain_bins": 2,
65
+ "n_relative_residx_bins": 32,
66
+ "num_diffusion_samples": 32,
67
+ "num_loops": 3,
68
+ "parcae": {
69
+ "coda_n_layers": 2,
70
+ "enabled": true,
71
+ "max_steps": 6,
72
+ "min_steps": 1,
73
+ "poisson_mean": 3.0
74
+ },
75
+ "structure_head": {
76
+ "diffusion_module": {
77
+ "atom_num_blocks": 3,
78
+ "atom_num_heads": 4,
79
+ "c_atom": 128,
80
+ "c_s_inputs": 451,
81
+ "c_token": 768,
82
+ "c_z": 256,
83
+ "fourier_dim": 256,
84
+ "relpos_r_max": 32,
85
+ "relpos_s_max": 2,
86
+ "sigma_data": 16.0,
87
+ "token_num_blocks": 12,
88
+ "token_num_heads": 16,
89
+ "transition_multiplier": 2
90
+ },
91
+ "distogram_bins": 64,
92
+ "gamma_0": 0.8,
93
+ "gamma_min": 1.0,
94
+ "inference_num_steps": 14,
95
+ "inference_p": 7.0,
96
+ "inference_s_max": 160.0,
97
+ "inference_s_min": 0.0004,
98
+ "noise_scale": 1.003,
99
+ "step_scale": 1.5,
100
+ "train_noise_log_mean": -1.2,
101
+ "train_noise_log_std": 1.5
102
+ },
103
+ "transformers_version": "4.57.6",
104
+ "type": "release"
105
+ }
images/folding_evals.png ADDED

Git LFS Details

  • SHA256: 207eeb14a3217cf31318bb8b50598a654def4119e34ef01a5a5ae848aacfca7c
  • Pointer size: 131 Bytes
  • Size of remote file: 122 kB
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:138fd4350d6892b81ce6be7ff9bf5a93ae9d4d3751f46a27438a3f9f0dcefa0e
3
+ size 939505228