Download README.md from BAAI/OPI-Struc: direct link, hf CLI and curl.
- Browser
- Download file 23.8 kB
-
https://huggingface.co/datasets/BAAI/OPI-Struc/resolve/main/README.md
- Command line
-
hf download hf://datasets/BAAI/OPI-Struc/README.md
-
curl -L -o README.md https://huggingface.co/datasets/BAAI/OPI-Struc/resolve/main/README.md
extra_gated_heading: Acknowledge license to accept the repository
extra_gated_prompt: >
The Beijing Academy of Artificial Intelligence (hereinafter referred to as
"we" or "BAAI") provides you with an open-source dataset (hereinafter referred
to as "dataset") through the OPI-Struc HuggingFace repository
(https://huggingface.co/datasets/BAAI/OPI-Struc). You can download the dataset
you need and use it for purposes such as learning and research while abiding
by the usage rules of each original dataset.
Before you acquire the open-source dataset (including but not limited to
accessing, downloading, copying, distributing, using, or any other handling of
the dataset), you should read and understand this "OPI-Struc Open-Source
Dataset Usage Notice and Disclaimer" (hereinafter referred to as "this
statement"). Once you acquire the open-source dataset, regardless of your
method of acquisition, your actions will be regarded as acknowledgment of the
full content of this statement.
1. Ownership and Operation Rights
You should fully understand that the ownership and operation rights of the
OPI-Struc HuggingFace repository (including the current and all previous
versions) belong to BAAI. BAAI has the final interpretation and decision
rights over this platform/tool and the open-source dataset plan.
You acknowledge and understand that due to updates and improvements in
relevant laws and regulations and the need to fulfill our legal compliance
obligations, we reserve the right to update, maintain, or even suspend or
permanently terminate the services of this platform/tool from time to time. We
will notify you of possible situations mentioned above reasonably such as
through an announcement or email within a reasonable time. You should make
corresponding adjustments and arrangements in a timely manner. However, we do
not bear any responsibility for any losses caused to you by any of the
aforementioned situations.
2. Claim of Rights to Open-Source Datasets
For the purpose of facilitating your dataset acquisition and use for learning,
and research, we have performed necessary steps such as format integration,
data cleaning, labeling, categorizing, annotating, and other related
processing on the third-party original datasets to form the open-source
datasets for this platform/tool's users.
You understand and acknowledge that we do not claim the proprietary rights of
intellectual property to the open-source datasets. Therefore, we have no
obligation to actively recognize and protect the potential intellectual
property of the open-source datasets. However, this does not mean that we
renounce the personal rights to claim credit, publication, modification, and
protection of the integrity of the work (if any) of the open-source datasets.
The potential intellectual property and corresponding legal rights of the
original datasets belong to the original rights holders.
In addition, providing you with open-source datasets that have been reasonably
arranged, processed, and handled does not mean that we acknowledge the
authenticity, accuracy, or indisputability of the intellectual property and
information content of the original datasets. You should filter and carefully
discern the open-source datasets you choose to use. You understand and agree
that BAAI does not undertake any obligation or warranty responsibility for any
defects or flaws in the original datasets you choose to use.
3. Usage Restrictions for Open-Source Datasets
Your use of the dataset must not infringe on our or any third party's legal
rights and interests (including but not limited to copyrights, patent rights,
trademark rights, and other intellectual property and other rights).
After obtaining the open-source dataset, you should ensure that your use of
the open-source dataset does not exceed the usage rules explicitly stipulated
by the rights holders of the original dataset in the form of a public notice
or agreement, including the range, purpose, and lawful purposes of the use of
the original data. We kindly remind you here that if your use of the
open-source dataset exceeds the predetermined range and purpose of the
original dataset, you may face the risk of infringing on the legal rights and
interests of the rights holders of the original dataset, such as intellectual
property, and may bear corresponding legal responsibilities.
4. Personal Information Protection
Due to technical limitations and the public welfare nature of the open-source
datasets, we cannot guarantee that the open-source datasets do not contain any
personal information, and we do not bear any legal responsibility for any
personal information that may be involved in the open-source datasets.
If the open-source dataset involves personal information, we do not bear any
legal responsibility for any personal information processing activities you
may involve when using the open-source dataset. We kindly remind you here that
you should handle personal information in accordance with the provisions of
the "Personal Information Protection Law" and other relevant laws and
regulations.
To protect the legal rights and interests of the information subject and to
fulfill possible applicable laws and administrative regulations, if you find
content that involves or may involve personal information during the use of
the open-source dataset, you should immediately stop using the part of the
dataset that involves personal information and contact us as indicated in "6.
Complaints and Notices."
5. Information Content Management
We do not bear any legal responsibility for any illegal and bad information
that may be involved in the open-source dataset.
If you find that the open-source dataset involves or may involve any illegal
and bad information during your use, you should immediately stop using the
part of the dataset that involves illegal and bad information and contact us
in a timely manner as indicated in "6. Complaints and Notices."
6. Complaints and Notices
If you believe that the open-source dataset has infringed on your legal rights
and interests, you can contact us at 010-50955974, and we will handle your
claims and complaints in accordance with the law in a timely manner.
To handle your claims and complaints, we may need you to provide contact
information, infringement proof materials, and identity proof materials.
Please note that if you maliciously complain or make false statements, you
will bear all legal responsibilities caused thereby (including but not limited
to reasonable compensation costs).
7. Disclaimer
You understand and agree that due to the nature of the open-source dataset,
the dataset may contain data from different sources and contributors, and the
authenticity, accuracy, and objectivity of the data may vary, and we cannot
make any promises about the availability and reliability of any dataset.
In any case, we do not bear any legal responsibility for any risks such as
personal information infringement, illegal and bad information dissemination,
and intellectual property infringement that may exist in the open-source
dataset.
In any case, we do not bear any legal responsibility for any loss (including
but not limited to direct loss, indirect loss, and loss of potential benefits)
you suffer or is related to the open-source dataset.
8. Others
The open-source dataset is in a constant state of development and change. We
may update, adjust the range of the open-source dataset we provide, or
suspend, pause, or terminate the open-source dataset service due to business
development, third-party cooperation, changes in laws and regulations, and
other reasons.
extra_gated_fields:
Name: text
Affiliation: text
Country: text
I agree to accept the license: checkbox
extra_gated_button_content: Acknowledge license
license: cc-by-nc-4.0
task_categories:
- text-generation
- question-answering
- multiple-choice
language:
- en
tags:
- Biology
- Protein
- Multimodal LLM
- AI for Life Science
pretty_name: Open Protein Instructions for Structures (OPI-Struc)
size_categories:
- 100K<n<1M
OPI-Struc: Open Protein Instructions for Structures
Links
- GitHub: https://github.com/ocx-lab/STELLA
- Paper: STELLA: A Multimodal LLM for Protein Functional Annotation via Unified Sequence-Structure Encoding — accepted as a Findings Paper at ACL 2026.
- Related dataset: OPI (Open Protein Instructions)
Dataset Overview
OPI-Struc (Open Protein Instructions for Structures) is a multimodal instruction-tuning dataset specifically designed for the STELLA project. It extends the OPI paradigm by integrating protein 3D structure information with textual instructions, enabling LLMs to perform protein-related tasks grounded in both sequence and structural modalities.
OPI-Struc focuses on two critical protein-related tasks:
- Functional Description Prediction (FP): Predicting the biological function of a protein from its 3D structure, in both free-text QA (FTQA) and multiple-choice QA (MCQA) formats.
- Enzyme-catalyzed Reaction Prediction (EP): Predicting the enzyme name or EC number from a protein's 3D structure.
Total dataset size: 351,183 training samples and 40,993 testing samples.
Note: This repository provides annotation JSON files only. The protein structure embedding files (
embs_pt/) are not included due to their large size. Eachembs_pt/directory contains a placeholder. Users should generate embeddings locally using the provided script — see Generating Protein Structure Embeddings below.
Dataset Construction
The OPI-Struc dataset is curated from two primary sources:
- Function (FP) tasks: Protein entries are sourced from UniProtKB/Swiss-Prot (release 2022_04), following the Prot2Text data split. 3D structures are obtained from the AlphaFold Protein Structure Database (AFDB).
- Enzyme (EP) tasks: Protein entries are sourced from the Enzyme Commission dataset, with 3D structures from RCSB PDB.
Each sample is formatted as a multi-turn conversation (instruction tuning format) with a <structure> token indicating where the protein structure embedding should be inserted.
Dataset Statistics
| Task | Training Set | Training Size | Testing Set | Testing Size | Metrics | Protein Source |
|---|---|---|---|---|---|---|
| FPFTQA | Functiontrain_FTQA (+aug) | 248,315 (+49,663) | Functiontest_FTQA Functiontest_FTQA_v2401 Functiontest_FTQA_trunc90 |
4,203 270 4,203 |
BLEU-4, BERT-score, ROUGE | AFDB |
| FPMCQA | Functiontrain_MCQA | 24,000 | Functiontest_MCQA_1X Functiontest_MCQA_4X |
4,203 16,812 |
Accuracy | AFDB |
| EP | Enzymetrain | 29,205 | Enzymetest Enzymetest_EC_number |
5,651 5,651 |
Accuracy | PDB |
- Functiontest_FTQA_v2401: A temporal out-of-distribution test set constructed from Swiss-Prot release 2024_01, used to evaluate zero-shot generalization on unseen proteins.
- Functiontest_FTQA_trunc90: A structural degradation test set where protein structures are truncated to 90% of their original residues, used to evaluate robustness to incomplete structures.
- Functiontest_MCQA_1X vs. Functiontest_MCQA_4X: The 1X version has options without permutation; the 4X version has options with permutation (4 orderings per question).
Note: FTQA - Free-Text Question Answering, MCQA - Multi-Choice Question Answering
Dataset Folder Structure
This repository provides annotation JSON files and embs_pt/ placeholder directories. The folder structure is organized by protein encoder (ESM3, Prot2Text, SaProt) since each encoder produces different embeddings.
OPI-Struc/
├── Function/
│ ├── esm3/
│ │ ├── train/
│ │ │ ├── ann.json # FP_FTQA training (248,315 samples)
│ │ │ ├── function_aug_49663.json # FP_FTQA augmented training (49,663 samples)
│ │ │ ├── ann_multichoice_24k.json # FP_MCQA training (24,000 samples)
│ │ │ └── embs_pt/ # [placeholder] ESM3 embeddings
│ │ ├── test/
│ │ │ ├── ann.json # FP_FTQA test (4,203 samples)
│ │ │ ├── ann_multichoice_1x.json # FP_MCQA_1X test (4,203 samples)
│ │ │ ├── ann_multichoice_4x.json # FP_MCQA_4X test (16,812 samples)
│ │ │ └── embs_pt/ # [placeholder] ESM3 embeddings
│ │ ├── test_SwissProt_v2401/
│ │ │ ├── ann.json # FP_FTQA temporal OOD test (270 samples)
│ │ │ └── embs_pt/ # [placeholder] ESM3 embeddings
│ │ └── test_struct_trunc90/
│ │ ├── ann.json # FP_FTQA structural degradation test (4,203 samples)
│ │ └── embs_pt/ # [placeholder] ESM3 embeddings
│ ├── Prot2Text/
│ │ ├── train/
│ │ │ ├── ann.json # Same annotations as esm3/train/ann.json
│ │ │ └── embs_pt/ # [placeholder] Prot2Text embeddings
│ │ └── test/
│ │ └── embs_pt/ # [placeholder] Prot2Text embeddings
│ └── SaProt_repr/
│ ├── train/
│ │ ├── ann.json # Same annotations as esm3/train/ann.json
│ │ └── embs_pt/ # [placeholder] SaProt embeddings
│ └── test/
│ └── embs_pt/ # [placeholder] SaProt embeddings
│
├── Enzyme/
│ ├── esm3/
│ │ ├── train/
│ │ │ ├── ann.json # EP training (29,205 samples)
│ │ │ └── embs_pt/ # [placeholder] ESM3 embeddings
│ │ └── test/
│ │ ├── ann.json # EP test (5,651 samples)
│ │ ├── ann_ec_number.json # EP EC number test (5,651 samples)
│ │ └── embs_pt/ # [placeholder] ESM3 embeddings
│ ├── Prot2Text/
│ │ ├── train/
│ │ │ └── embs_pt/ # [placeholder] Prot2Text embeddings
│ │ └── test/
│ │ └── embs_pt/ # [placeholder] Prot2Text embeddings
│ └── ...
│
└── README.md # This file
Note: The annotation JSON files are identical across encoder directories for the same task and split. They are duplicated in each encoder's directory to match the expected layout of STELLA's dataloader, which looks for
ann.jsonandembs_pt/in the same parent directory.
Data Format
FP (Functional Description Prediction) — FTQA Format
Each entry follows the conversation format used by LLaVA:
{
"swissprot_id": "P07412",
"sequence": "GFLTAEEKGLVNGLWGKVNVDEVGGEALGRLLVVYPWTQRFFESFGDLSS...",
"AFDB_id": "AF-P07412-F1-model_v4",
"conversations": [
{
"from": "human",
"value": "<structure>\nCan you furnish a comprehensive description outlining the function associated with the protein?"
},
{
"from": "gpt",
"value": "Involved in oxygen transport from the lung to the various peripheral tissues."
}
]
}
FP — MCQA Format
{
"swissprot_id": "P62877",
"sequence": "MAAAMDVDTPSGTNSGAGKKRFEVKKWNAVALWAWDIVVDNCAICRNHIM...",
"AFDB_id": "AF-P62877-F1-model_v4",
"conversations": [
{
"from": "human",
"value": "<structure>\nWhat are the main functions of this protein?\nA. [option A text]\nB. [option B text]\nC. [option C text]\nD. [option D text]"
},
{
"from": "gpt",
"value": "A"
}
]
}
EP (Enzyme-catalyzed Reaction Prediction) Format
{
"PDB_id": "2pmo.X",
"conversations": [
{
"from": "human",
"value": "<structure>\nPlease share the enzyme terminology for this protein."
},
{
"from": "gpt",
"value": "non-specific serine/threonine protein kinase"
}
]
}
EP — EC Number Format (test only)
{
"PDB_id": "4xi6.A",
"EC_number": "2.3.2.27"
}
Key Fields
| Field | Description |
|---|---|
swissprot_id |
UniProtKB/Swiss-Prot accession ID |
AFDB_id |
AlphaFold DB structure identifier (e.g., AF-P07412-F1-model_v4) |
PDB_id |
PDB structure identifier with chain (e.g., 2pmo.X) |
sequence |
Amino acid sequence of the protein |
conversations |
Multi-turn conversation in LLaVA format; <structure> marks where the structure embedding is injected |
EC_number |
Enzyme Commission classification number |
Generating Protein Structure Embeddings
Since the pre-computed embedding files (embs_pt/) are too large to host on Hugging Face, you need to generate them locally before training or evaluating STELLA.
Prerequisites
Download raw protein structure files:
- For FP tasks (SwissProt/AFDB data): Download AlphaFold DB structures (
.pdbfiles). Each protein's structure ID is in theAFDB_idfield (e.g.,AF-P07412-F1-model_v4). Download from the AlphaFold Protein Structure Database. - For EP tasks (Enzyme/PDB data): Download PDB structures. Each protein's structure ID is in the
PDB_idfield (e.g.,2pmo.X). Download from RCSB PDB.
- For FP tasks (SwissProt/AFDB data): Download AlphaFold DB structures (
Set up the STELLA environment following the STELLA installation guide.
Download protein encoder checkpoints:
Running the Embedding Generation Script
Use scripts/precompute_embeddings.py from the STELLA repository:
# ESM3 embeddings for Function training data
python scripts/precompute_embeddings.py \
--encoder esm3 \
--ann_json /path/to/OPI-Struc/Function/esm3/train/ann.json \
--structure_dir /path/to/alphafold_pdb_files/ \
--output_dir /path/to/OPI-Struc/Function/esm3/train/embs_pt/ \
--encoder_path /path/to/esm3-sm-open-v1
# Prot2Text embeddings for Function training data
python scripts/precompute_embeddings.py \
--encoder prot2text \
--ann_json /path/to/OPI-Struc/Function/Prot2Text/train/ann.json \
--structure_dir /path/to/alphafold_pdb_files/ \
--output_dir /path/to/OPI-Struc/Function/Prot2Text/train/embs_pt/ \
--encoder_path /path/to/prot2text_large
# SaProt embeddings for Function training data
python scripts/precompute_embeddings.py \
--encoder saprot \
--ann_json /path/to/OPI-Struc/Function/SaProt_repr/train/ann.json \
--structure_dir /path/to/alphafold_pdb_files/ \
--output_dir /path/to/OPI-Struc/Function/SaProt_repr/train/embs_pt/ \
--encoder_path /path/to/SaProt_650M_AF2/SaProt_650M_AF2.pt \
--foldseek_path stella/model/multimodal_encoder/bin/foldseek
# ESM3 embeddings for Enzyme training data
python scripts/precompute_embeddings.py \
--encoder esm3 \
--ann_json /path/to/OPI-Struc/Enzyme/esm3/train/ann.json \
--structure_dir /path/to/pdb_files/ \
--output_dir /path/to/OPI-Struc/Enzyme/esm3/train/embs_pt/ \
--encoder_path /path/to/esm3-sm-open-v1
Notes:
- The script supports resume: it automatically skips proteins whose
.ptfiles already exist in the output directory.- Output
embs_pt/directories must be placed alongside the correspondingann.jsonfile, as STELLA's dataloader expects this layout.- For SaProt, the
--foldseek_pathargument is required.- For Prot2Text, graphein and DSSP 3.0 must be installed.
Embedding Output Format
Each protein produces a single .pt file named {structure_id}.pt:
- ESM3: tensor of shape
[1, L, 1536](per-residue embeddings, L = sequence length) - Prot2Text: dict with
hidden_states(tensor[1, 1021, 768]) andattentions(tensor[1, 1021]) - SaProt: tensor of shape
[1, L, 1280](per-residue representations)
Data Sources
| Source | URL | Usage |
|---|---|---|
| UniProtKB/Swiss-Prot (release 2022_04) | https://www.uniprot.org/ | FP task protein annotations |
| UniProtKB/Swiss-Prot (release 2024_01) | https://www.uniprot.org/ | Temporal OOD test set (v2401) |
| AlphaFold Protein Structure Database | https://alphafold.ebi.ac.uk/ | FP task protein 3D structures |
| RCSB Protein Data Bank | https://www.rcsb.org/ | EP task protein 3D structures |
| Enzyme Commission Database | https://www.enzyme-database.org/ | EP task enzyme annotations |
Related Datasets
- OPI (Open Protein Instructions) — The sequence-only instruction dataset for adapting LLMs to protein tasks (NeurIPS 2024 Workshop).
Citation
If you use OPI-Struc in your research, please cite:
@inproceedings{stella2026,
title={STELLA: A Multimodal LLM for Protein Functional Annotation via Unified Sequence-Structure Encoding},
author={Hongwang Xiao, Wenjun Lin, Xi Chen, Hui Wang, Kai Chen, Jiashan Li, Yuancheng Sun, Sicheng Dai, Boya Wu, Qiwei Ye},
booktitle={Findings of the Association for Computational Linguistics: ACL 2026},
year={2026}
}
License
This dataset is licensed under Creative Commons Attribution Non Commercial 4.0 (CC BY-NC 4.0). The use of this dataset must also comply with the original licenses and terms of the upstream data sources:
- UniProt License & Disclaimer
- AlphaFold DB Terms of Use
- RCSB PDB Usage Policy
- ESM3 Community License (for ESM3 embeddings)
- Prot2Text License (for Prot2Text embeddings)
- SaProt License (for SaProt embeddings)