OpenFold is an open-source framework for predicting three-dimensional protein structures from protein sequences, multiple sequence alignments (MSAs), and template information. As a trainable reproduction of AlphaFold2, its core network architecture includes Evoformer, Structure Module, template modules, MSA modules, and other components, supporting a complete structural prediction experiment workflow that includes training, inference, and weight conversion.
OpenFold is based on the Evoformer + Structure Module architecture and is trained with PDB and UniRef data. It is designed for protein three-dimensional structure prediction, model fine-tuning, and research on architectural improvements. The core network contains 48 Evoformer Blocks and 8 Structure Module layers. Through triangle attention and invariant point attention mechanisms, it enables bidirectional fusion of evolutionary information and spatial geometry. Compared with the original AlphaFold2, OpenFold adds memory-efficient attention, mixed-precision training support, and seamless weight conversion capabilities, significantly reducing GPU memory usage and fixing trainability issues.
Applicable Scenarios
Scenario
Description
Local OpenFold invocation
Users can call OpenFold training or inference through the scripts in this repository.
Reuse of the OneScience base
Continue using shared OneScience modules such as datapipes, utils, loss, and np.
ModelScope/OneCode release
Expose only scripts, models, configurations, and weight directories to reduce the release package size.
Weight conversion and data preparation
Use the tools under scripts/ to download databases, preprocess alignments, and convert weights.
Usage
1. Using OneCode
You can try intelligent one-click AI4S programming through the OneCode online environment:
If dependencies such as torch, ml_collections, or deepspeed are reported as missing, install the OneScience-recommended runtime environment first, or install the corresponding dependencies for your DCU/GPU version.
Example Data
The data/ directory is used to store the example inputs required by OpenFold and user-provided data. The current repository includes a monomer inference example at data/demo/monomer, making it easy to quickly check the inference script, model import, and alignment loading workflow.
Directory structure:
Path
Description
data/demo/monomer/fasta_dir/6kwc.fasta
Example protein sequence. The FASTA header is 6KWC_1.
data/demo/monomer/alignments/6KWC_1/
Precomputed MSA/template search results corresponding to the FASTA header.
Monomer inference example script using the FASTA and precomputed alignments above.
The example data does not include OpenFold weights or the PDB mmCIF template library. Before running the demo, prepare:
weight/openfold.pt, or specify the weights with CHECKPOINT_PATH=/path/to/openfold.pt.
The PDB mmCIF template directory. By default, data/databases/pdb_mmcif/mmcif_files is read; it can also be specified with TEMPLATE_MMCIF_DIR=/path/to/mmcif_files.
OpenFold-related source code uses the Apache License 2.0. See LICENSE in the repository root for details. The terms of use for model weights and data should follow the instructions provided by the corresponding publishers.
The OpenProteinSet dataset uses the CC BY 4.0 License. When using this dataset, you should acknowledge the data source and cite the OpenProteinSet paper as required by the dataset page.
If you use OpenFold in research, it is recommended to cite the original OpenFold and AlphaFold2 papers as well as relevant OneScience project information. When using multimer functionality, also cite AlphaFold-Multimer. When using OpenProteinSet or other downstream data resources, also include citations for the corresponding datasets, databases, and original papers.