TankBind Modal
Modal-first inference wrapper for TankBind, using A100 GPU workers and checkpoints mirrored on Hugging Face for faster container builds.
Model weights: nabbo/tankbind-modal
Credits
This repository is based on TankBind from Lu, Wei; Wu, Qifeng; Zhang, Jixian; Rao, Jiahua; Li, Chengtao; and Zheng, Shuangjia:
TankBind: Trigonometry-Aware Neural NetworKs for Drug-Protein Binding Structure Prediction, NeurIPS 2022.
Original project: TankBind
What Changed
- Refactored the repo for Modal inference instead of local notebook workflows.
- Moved TankBind checkpoints to Hugging Face:
nabbo/tankbind-modal. - Updated Modal images to pull
self_dock.ptfrom Hugging Face during image build. - Updated panel inference to install p2rank in the Modal image instead of vendoring the local tool directory.
- Kept
input/andoutput/as the user-facing data folders.
Inputs
Put proteins and ligands under:
input/structures/ # protein structures, PDB format
input/ligands/ # ligand structures, SDF format
TankBind expects structure files, not PDF or SVG files. Use:
- Protein:
.pdb - Ligand:
.sdf
For panel inference, prepare a CSV like input/panel_prediction_inputs.csv:
id,protein_path,ligand_path
pik3ca_wt_alpelisib,input/structures/pik3ca_wt.pdb,input/ligands/alpelisib.sdf
Paths must be relative to the repository root.
Local CLI Setup
You only need a lightweight local environment for the Modal CLI. The model runs remotely on Modal.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
modal setup
If you use Modal profiles:
export MODAL_PROFILE=csblabigib
Single Pair Inference
modal run scripts/modal_tankbind.py \
--protein input/structures/pik3ca_wt.pdb \
--ligand input/ligands/alpelisib.sdf
Or:
./scripts/run_modal_tankbind.sh \
--protein input/structures/pik3ca_wt.pdb \
--ligand input/ligands/alpelisib.sdf
Output is printed as JSON:
{
"affinity_pred": 7.12,
"device": "cuda"
}
Panel Inference
Run many protein-ligand pairs from a CSV:
modal run scripts/modal_run_prepared_panel.py \
--input-csv input/panel_prediction_inputs.csv \
--run-id panel_a100 \
--out-dir output/modal_panel
The panel runner:
- Stages input files into a Modal volume.
- Runs p2rank pocket detection for each unique protein.
- Scores each protein-ligand pair on A100 workers.
- Writes summaries to
output/modal_panel/.
Expected outputs:
output/modal_panel/<run_id>_pair_affinity_summary.csv
output/modal_panel/<run_id>_run_summary.json
Checkpoints
The Modal build downloads checkpoints from:
https://huggingface.co/nabbo/tankbind-modal
Uploaded files:
self_dock.pt
re_dock.pt
Only self_dock.pt is used by the current Modal inference scripts.
Citation
@article{lu2022tankbind,
title={Tankbind: Trigonometry-aware neural networks for drug-protein binding structure prediction},
author={Lu, Wei and Wu, Qifeng and Zhang, Jixian and Rao, Jiahua and Li, Chengtao and Zheng, Shuangjia},
journal={Advances in Neural Information Processing Systems},
year={2022}
}