The dataset could not be loaded because the splits use different data file formats, which is not supported. Read more about the splits configuration. Click for more details.
Error code: FileFormatMismatchBetweenSplitsError
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
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)
- Downloads last month
- 12