PRIME is a hierarchical graph representation learning framework that models proteins as a nested family of five physically grounded structural graphs spanning surface, atomic, residue, secondary-structure, and protein levels.
Install the required dependencies:
pip install -r requirements.txtStep 1: Download processed data from ProteinWorkshop
Download the preprocessed datasets and standard splits from the ProteinWorkshop repository. Follow their instructions to download the datasets for the tasks you wish to evaluate:
- Fold Classification
- Reaction Class Prediction
- Gene Ontology Prediction
- PPI Site Prediction
Step 2: Build hierarchical graphs
Open utils/hierarchical_graph.sh, set TASK to your desired task and update the paths, then run:
bash utils/hierarchical_graph.shThis script processes the raw protein structures and builds the five-level hierarchical graph representation for each protein in the dataset.
Open train_prime.sh and configure the following fields to match your setup:
TASK="FoldClassification" # FoldClassification | ECReaction | GeneOntology | BindingSite
SEED=1 # use 1, 2, 3 for 3-seed reporting
CROSS_ATTENTION="false" # set to "true" for PRIME (w/ CA) variant
GO_BRANCH="MF" # only for GeneOntology: MF | BP | CC
# Hierarchy ablation — controls which levels are active
ACTIVE_LEVELS=("surface" "atom" "residue" "sse" "protein")
# Readout level — which level is used for prediction
READOUT_LEVEL="residue" # surface | atom | residue | sse | protein
# Direction ablation — controls message passing direction
DIRECTION="bidirectional" # bidirectional | bottom_up_only | top_down_only
# Resume training from an existing checkpoint
RESUME="false" # set to "true" to auto-resume from latest checkpointThen run:
bash train_prime.shOpen test_prime.sh and configure the task and seed to match your training run, then run:
bash test_prime.shThe script automatically resolves the checkpoint path from the training configuration.
Training logs and checkpoints are saved automatically to:
./logs/training_log_prime_{task}_{level_tag}_seed{N}.txt
./ckpts/best_prime_{task}_{level_tag}_seed{N}.pt
where {level_tag} is surface_atom_residue_sse_protein by default and {N} is the random seed.
All model and training hyperparameters are managed through the configuration files in the config/ directory:
config/data_config.yaml— dataset paths and split filesconfig/model_config.yaml— model architecture hyperparameters
Important: Update the
data_rootfield inconfig/data_config.yamlto point to your local data directory before running any scripts.
If our work is useful, please cite our paper:
@misc{nguyen2026primeproteinrepresentationphysicsinformed,
title={PRIME: Protein Representation via Physics-Informed Multiscale Equivariant Hierarchies},
author={Viet Thanh Duy Nguyen and John K. Johnstone and Truong-Son Hy},
year={2026},
eprint={2605.01625},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2605.01625},
}This project is licensed under the MIT License. See the LICENSE file for details.
