Usage (Local)
The ProMaya inference script can be executed directly on a local workstation for analyzing individual protein pairs. For batch processing, we strongly recommend using the Nextflow pipeline (see Cluster/HPC Usage).
Basic Usage
The primary script for predicting interactions between a single protein pair is scripts/predict.py.
python scripts/predict.py \
--config config/config.yaml \
--protein-a data/proteins/1ABC.pdb \
--protein-b data/proteins/2XYZ.pdb \
--checkpoint models/promaya_v1/best_model.pt \
--output results/predictions/ \
--gpu 0 \
--gradcam
Command-Line Arguments
| Argument | Required | Default | Description |
|---|---|---|---|
--config |
Yes | - | Path to the config.yaml file defining model parameters |
--protein-a |
Yes | - | Path to the PDB file for Protein A |
--protein-b |
Yes | - | Path to the PDB file for Protein B |
--checkpoint |
Yes | - | Path to the trained model checkpoint (.pt) |
--output |
Yes | - | Directory to save the prediction results |
--gpu |
No | -1 |
GPU device ID (e.g., 0). Set to -1 to use CPU. |
--threshold |
No | 0.5 |
Decision threshold on probability |
--max-atoms |
No | 384 |
Max atoms kept per protein |
--max-residues |
No | 192 |
Max residues kept per protein |
--max-surface-points |
No | 128 |
Max surface points kept per protein |
--top-k-interactions |
No | 15 |
Top residue-residue pairs to report |
--gradcam |
No | False |
Flag to compute Grad-CAM attributions and generate hotspot visualizations |
[!TIP] Performance Note: Generating Grad-CAM attributions (
--gradcam) involves a backward pass and extensive visualization rendering. Running without this flag roughly triples the throughput per pair, making it ideal for fast, probability-only initial screening.
Python API Integration
You can integrate ProMaya directly into your Python scripts for custom workflows:
import torch
from src.models.promaya_skeleton import ProMaya
from src.utils import load_config
# Load configuration and model
config = load_config('config/config.yaml')
model = ProMaya(config)
model.load_state_dict(torch.load('best_model.pt'))
model.eval()
# Assuming preprocessed feature tensors are loaded
# protein_a, protein_b = load_features(...)
with torch.no_grad():
interaction_score, outputs = model(protein_a, protein_b)
probability = torch.sigmoid(interaction_score).item()
print(f"PPI Probability: {probability:.4f}")