MaSIF GPU on the HPC Cluster
MaSIF (Molecular Surface Interaction Fingerprints) predicts protein interaction patterns using geometric deep learning on molecular surfaces.
| Application | Task | Output |
|---|---|---|
| MaSIF-site | Predict protein–protein interaction sites | Per-vertex interaction probability |
| MaSIF-ligand | Classify ligand binding pocket type | Ligand class (7 types) |
| MaSIF-search | Scan for structural binding partners | Ranked binding configurations |
Reference: Gainza et al., Nature Methods 17, 184–192 (2020).
This GPU module uses TensorFlow 1.15.4 (CUDA 11.4) and is compatible with A100 GPUs. For CPU-only workflows, see the MaSIF (CPU) page.
Getting Started
1. Load the GPU module
module load masif/1.0-gpu
This sets MASIF_ROOT, MASIF_SIF (pointing to masif-gpu.sif), and provides the
masif-exec, masif-shell, masif_data, and copy_data shell functions.
The GPU module (masif/1.0-gpu) conflicts with the CPU module (masif/1.0). Load only
one at a time.
2. Copy the working files to scratch
The installed scripts under /packages/apps/masif/1.0-gpu/ are read-only.
Use copy_data to get a personal writable copy on scratch:
copy_data
This copies GPU-ready Slurm scripts, pre-trained model weights, and input lists to
/scratch/$USER/masif/gpu/. You only need to do this once. After that, run all jobs
from your copy.
The data directories contain only scripts, lists, and pre-trained model weights — not
preprocessed surface data. Preprocessing writes intermediate surface files to
data_preparation/ inside each application directory. A full dataset (all proteins
from the paper) requires ~400 GB.
3. Bind scratch into the container
Apptainer does not automatically bind /scratch. Set MASIF_BINDS before running any
commands or submitting jobs — add this to your ~/.bashrc so it persists across sessions:
echo 'export MASIF_BINDS=/scratch/$USER/masif/gpu:/scratch/$USER/masif/gpu' >> ~/.bashrc
source ~/.bashrc
All Slurm scripts read MASIF_BINDS automatically — no changes needed in the scripts.
If your data lives elsewhere, point MASIF_BINDS to that path instead.
4. (Optional) Browse the read-only install
masif_data # cd to /packages/apps/masif/1.0-gpu/userdata
Interactive Use
Two shell functions are available for running commands inside the GPU MaSIF container.
Both automatically enable GPU passthrough (--nv) and bind MASIF_ROOT:
# Run a single command
masif-exec bash -c "cd $PWD && ./data_prepare_one.sh 4ZQK_A"
# Open an interactive shell
masif-shell
Verify GPU visibility inside the container:
masif-exec nvidia-smi
masif-exec python3 -c "import tensorflow as tf; print(tf.test.is_gpu_available())"
To add extra bind mounts (e.g. a project directory outside your scratch working directory):
export MASIF_BINDS=/scratch/myproject:/scratch/myproject
masif-exec bash -c "cd $PWD && ./data_prepare_one.sh 4ZQK_A"
MaSIF-site — PPI Site Prediction
Predicts which surface residues are likely to participate in protein–protein interactions.
Quick start — single protein
- Interactive
- Slurm Batch
cd /scratch/$USER/masif/gpu/masif_site
# Preprocess: download PDB, compute surface mesh + electrostatics + patches (~1–2 min)
masif-exec bash -c "cd $PWD && ./data_prepare_one.sh 4ZQK_A"
# Predict interaction sites (GPU-accelerated)
masif-exec bash -c "cd $PWD && ./predict_site.sh 4ZQK_A"
# Colour surface by predicted score (writes a .ply file)
masif-exec bash -c "cd $PWD && ./color_site.sh 4ZQK_A"
cd /scratch/$USER/masif/gpu/masif_site
# 1. Preprocess all proteins in lists/full_list.txt (CPU array job)
sbatch data_prepare.slurm
# 2. Train the neural network (GPU, ~40 h for full dataset)
sbatch masif_site_train.slurm
# 3. Evaluate on benchmark set (GPU)
sbatch masif_site_eval.slurm
# 4. Predict on a custom list (GPU array job)
sbatch predict_site.slurm
The pre-trained model weights are already included in nn_models/all_feat_3l/model_data/ —
you can skip training and run predictions directly.
Output:
output/all_feat_3l/pred_data/pred_4ZQK_A.npy— per-vertex scoresoutput/all_feat_3l/pred_surfaces/4ZQK_A.ply— coloured surface mesh (open in PyMOL)
Using your own PDB file
masif-exec bash -c "cd $PWD && ./data_prepare_one.sh --file /path/to/protein.pdb 4ZQK_A"
Multi-chain input
For a single chain: 4ZQK_A
For a complex where chains A and B interact: 1AKJ_A_B
Slurm resource reference
MaSIF-site Slurm script resources
| Script | Partition | GPU | CPUs | Mem | Time | Input | Logs |
|---|---|---|---|---|---|---|---|
data_prepare.slurm | htc | — | 1 | 16 GB | 3 h/task | lists/full_list.txt (array) | exelogs/data_prepare.<jobid>_<taskid>.{out,err} |
masif_site_train.slurm | public | A100 | 4 | 32 GB | 40 h | preprocessed patches | exelogs/masif_site_train.<jobid>.{out,err} |
masif_site_eval.slurm | public | A100 | 4 | 32 GB | 40 h | trained model | exelogs/masif_site_eval.<jobid>.{out,err} |
predict_site.slurm | htc | A100 | 4 | 16 GB | 3 h/task | lists/full_list.txt (array) | exelogs/predict_site.<jobid>_<taskid>.{out,err} |
Adjust #SBATCH --array= to match your protein list length before submitting.
MaSIF-ligand — Ligand Pocket Classification
Classifies binding pockets into 7 ligand categories using 12 Å geodesic patches.
cd /scratch/$USER/masif/gpu/masif_ligand
# 1. Preprocess proteins (CPU array job)
sbatch data_prepare.slurm
# 2. Generate TFRecords for training (CPU)
sbatch make_tfrecord.slurm
# 3. Train the classifier (GPU)
sbatch train_model.slurm
# 4. Evaluate on test set (GPU)
sbatch evaluate_test.slurm
Protein lists are numpy arrays in lists/:
train_pdbs_sequence.npyval_pdbs_sequence.npytest_pdbs_sequence.npy
Output in test_set_predictions/:
<PDB>_<chains>_labels.npy— ground truth labels<PDB>_<chains>_logits.npy— predicted logits
MaSIF-ligand Slurm script resources
| Script | Partition | GPU | CPUs | Mem | Time |
|---|---|---|---|---|---|
data_prepare.slurm | htc | — | 1 | 16 GB | 2 h/task |
make_tfrecord.slurm | htc | — | 1 | 8 GB | 48 h |
train_model.slurm | public | A100 | 4 | 16 GB | 48 h |
evaluate_test.slurm | public | A100 | 4 | 16 GB | 24 h |
MaSIF-search — PPI Surface Scanning
Scans a database of protein surfaces for structural binding partners of a query patch.
cd /scratch/$USER/masif/gpu/masif_ppi_search
# 1. Preprocess proteins (CPU array job)
sbatch data_prepare.slurm
# 2. Generate training transformation data (CPU)
sbatch transformation_training_data/generate_all.slurm
# 3. Train the descriptor network (GPU)
sbatch masif_ppi_search_train.slurm
# 4. Compute descriptors for search (GPU)
sbatch masif_ppi_search_comp_desc.slurm
MaSIF-search Slurm script resources
| Script | Partition | GPU | CPUs | Mem | Time |
|---|---|---|---|---|---|
data_prepare.slurm | htc | — | 1 | 8 GB | 1 h/task |
transformation_training_data/generate_all.slurm | htc | — | 1 | 8 GB | 4 h |
masif_ppi_search_train.slurm | public | A100 | 4 | 32 GB | 40 h |
masif_ppi_search_comp_desc.slurm | public | A100 | 4 | 32 GB | 20 h |
Unbound benchmark variant
Scripts for the unbound docking benchmark are in /scratch/$USER/masif/gpu/masif_ppi_search_ub/:
cd /scratch/$USER/masif/gpu/masif_ppi_search_ub
sbatch data_prepare.slurm # processes lists/benchmark_list_ub.txt
sbatch masif_ppi_search_comp_desc.slurm # compute descriptors
MaSIF-pdl1 Benchmark
Reproduces the PDL1 benchmark from the paper.
cd /scratch/$USER/masif/gpu/masif_pdl1_benchmark
sbatch data_prepare.slurm # CPU array, lists/full_list.txt
MaSIF-peptides
Evaluates MaSIF-site and MaSIF-search on peptide–protein interactions.
cd /scratch/$USER/masif/gpu/masif_peptides
# Extract helix data (CPU array)
sbatch data_extract_helix.slurm
# Precompute patches (CPU array)
sbatch data_precompute_patches.slurm
# Evaluate (GPU)
sbatch masif_site_masif_search_eval.slurm
Adjusting Slurm Scripts
Every script has lines to review before submitting. GPU scripts ship with two partitions:
| Use case | Partition | QOS | Max walltime |
|---|---|---|---|
| CPU-only jobs, short GPU jobs (≤4 h) | htc | — | 4 h |
| Long GPU jobs (>4 h) | public | public | 7 days |
#SBATCH --partition=public # change to your cluster's GPU partition name
#SBATCH --qos=public # required for the public partition
#SBATCH -G a100:1 # request one A100 GPU
#SBATCH --array=1-1000 # adjust upper bound to match your list length
The SIF image path defaults to /packages/apps/simg/masif-gpu.sif. Override per-job:
MASIF_SIF=/other/path/masif-gpu.sif sbatch masif_site_train.slurm
Or export for a batch of submissions:
export MASIF_SIF=/other/path/masif-gpu.sif
sbatch masif_site_train.slurm
sbatch masif_site_eval.slurm
Extra bind mounts for data outside /scratch/$USER/masif/gpu:
export MASIF_BINDS=/projects/mylab/data:/projects/mylab/data
sbatch data_prepare.slurm
Multiple bind paths are separated by commas:
export MASIF_BINDS=/scratch/$USER/masif/gpu:/scratch/$USER/masif/gpu,/projects/shared:/projects/shared
Complete Slurm Script Reference
| Script | Partition | QOS | Time | CPUs | Mem | GPU |
|---|---|---|---|---|---|---|
masif_site/data_prepare.slurm | htc | — | 3 h | 1 | 16 G | — |
masif_site/masif_site_train.slurm | public | public | 40 h | 4 | 32 G | A100 |
masif_site/masif_site_eval.slurm | public | public | 40 h | 4 | 32 G | A100 |
masif_site/predict_site.slurm | htc | — | 3 h | 4 | 16 G | A100 |
masif_ligand/data_prepare.slurm | htc | — | 2 h | 1 | 16 G | — |
masif_ligand/make_tfrecord.slurm | htc | — | 48 h | 1 | 8 G | — |
masif_ligand/train_model.slurm | public | public | 48 h | 4 | 16 G | A100 |
masif_ligand/evaluate_test.slurm | public | public | 24 h | 4 | 16 G | A100 |
masif_ppi_search/data_prepare.slurm | htc | — | 1 h | 1 | 8 G | — |
masif_ppi_search/transformation_training_data/generate_all.slurm | htc | — | 4 h | 1 | 8 G | — |
masif_ppi_search/masif_ppi_search_train.slurm | public | public | 40 h | 4 | 32 G | A100 |
masif_ppi_search/masif_ppi_search_comp_desc.slurm | public | public | 20 h | 4 | 32 G | A100 |
masif_ppi_search_ub/data_prepare.slurm | htc | — | 1 h | 1 | 8 G | — |
masif_ppi_search_ub/masif_ppi_search_comp_desc.slurm | public | public | 40 h | 4 | 32 G | A100 |
masif_pdl1_benchmark/data_prepare.slurm | htc | — | 1 h | 1 | 8 G | — |
masif_peptides/data_extract_helix.slurm | htc | — | 3 h | 1 | 16 G | — |
masif_peptides/data_precompute_patches.slurm | htc | — | 3 h | 1 | 16 G | — |
masif_peptides/masif_site_masif_search_eval.slurm | public | public | 8 h | 4 | 16 G | A100 |
Visualising Results in PyMOL
.ply surface files are produced by color_site.sh. To view them:
- Install the MaSIF PyMOL plugin on your local machine:
see
/packages/apps/masif/1.0-gpu/pymol_plugin_installation.md - Copy the
.plyfile from the cluster to your machine - In PyMOL:
loadply 4ZQK_A.ply - Hide all objects except those containing
ifaceto show the predicted interaction site coloured by score.
Checking Job Status
squeue -u $USER # running/pending jobs
sacct -j <jobid> --format=JobID,State,ExitCode,Elapsed # completed job summary
cat exelogs/data_prepare.<jobid>_1.out # inspect one task's log
Troubleshooting
MASIF_ROOT not set / python can't find source filesMake sure you loaded the module before submitting: module load masif/1.0-gpu. The Slurm
scripts fall back to /packages/apps/masif/1.0 if the variable is unset, but it's safer
to have the module loaded.
You are running from the read-only install. Run copy_data and submit jobs from
/scratch/$USER/masif/gpu/ instead.
fatal: not a git repositoryThis warning can appear if a script's git rev-parse fallback fires. It is harmless —
the scripts use MASIF_ROOT when set, which takes precedence over git.
Files outside MASIF_ROOT and your working directory are not visible inside the container.
Set MASIF_BINDS to bind your data location, or use --bind directly with apptainer exec.
CUDA_ERROR_NO_DEVICE or tf.test.is_gpu_available() returns FalseEnsure the Slurm script requests a GPU (#SBATCH -G a100:1) and that you are submitting
to a GPU-capable partition. Verify GPU visibility from the compute node:
masif-exec nvidia-smi
The container requires CUDA driver ≥ 470 (for CUDA 11.4). Check with nvidia-smi on
the login node.
Could not load dynamic library 'libcusolver.so.11'This is a known NGC TF1 warning on some systems; it does not affect computation.
Desired structure doesn't existThe PDB download script fetches from https://files.rcsb.org. Check connectivity from
the compute node, or pre-download PDB files and place them in data_preparation/raw_pdb/.
Known Limitations
- TensorFlow 1.15.4 only — no TF2 / eager mode.
- Single-GPU only; the models are not configured for multi-GPU training.
- Data preparation (surface triangulation) is CPU-only; GPU is used only for neural network training, evaluation, and descriptor computation.
masif_ligand/make_tfrecord.slurmis CPU-only; TFRecord generation does not use the GPU.- Results may differ slightly from the published paper because the MATLAB preprocessing pipeline has been replaced with Python equivalents. To reproduce exact paper results, see masif_paper on GitHub.