Skip to main content

MaSIF GPU on the HPC Cluster

MaSIF (Molecular Surface Interaction Fingerprints) predicts protein interaction patterns using geometric deep learning on molecular surfaces.

ApplicationTaskOutput
MaSIF-sitePredict protein–protein interaction sitesPer-vertex interaction probability
MaSIF-ligandClassify ligand binding pocket typeLigand class (7 types)
MaSIF-searchScan for structural binding partnersRanked 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.

note

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.

warning

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

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"

Output:

  • output/all_feat_3l/pred_data/pred_4ZQK_A.npy — per-vertex scores
  • output/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
ScriptPartitionGPUCPUsMemTimeInputLogs
data_prepare.slurmhtc116 GB3 h/tasklists/full_list.txt (array)exelogs/data_prepare.<jobid>_<taskid>.{out,err}
masif_site_train.slurmpublicA100432 GB40 hpreprocessed patchesexelogs/masif_site_train.<jobid>.{out,err}
masif_site_eval.slurmpublicA100432 GB40 htrained modelexelogs/masif_site_eval.<jobid>.{out,err}
predict_site.slurmhtcA100416 GB3 h/tasklists/full_list.txt (array)exelogs/predict_site.<jobid>_<taskid>.{out,err}
tip

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.npy
  • val_pdbs_sequence.npy
  • test_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
ScriptPartitionGPUCPUsMemTime
data_prepare.slurmhtc116 GB2 h/task
make_tfrecord.slurmhtc18 GB48 h
train_model.slurmpublicA100416 GB48 h
evaluate_test.slurmpublicA100416 GB24 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
ScriptPartitionGPUCPUsMemTime
data_prepare.slurmhtc18 GB1 h/task
transformation_training_data/generate_all.slurmhtc18 GB4 h
masif_ppi_search_train.slurmpublicA100432 GB40 h
masif_ppi_search_comp_desc.slurmpublicA100432 GB20 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 casePartitionQOSMax walltime
CPU-only jobs, short GPU jobs (≤4 h)htc4 h
Long GPU jobs (>4 h)publicpublic7 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

ScriptPartitionQOSTimeCPUsMemGPU
masif_site/data_prepare.slurmhtc3 h116 G
masif_site/masif_site_train.slurmpublicpublic40 h432 GA100
masif_site/masif_site_eval.slurmpublicpublic40 h432 GA100
masif_site/predict_site.slurmhtc3 h416 GA100
masif_ligand/data_prepare.slurmhtc2 h116 G
masif_ligand/make_tfrecord.slurmhtc48 h18 G
masif_ligand/train_model.slurmpublicpublic48 h416 GA100
masif_ligand/evaluate_test.slurmpublicpublic24 h416 GA100
masif_ppi_search/data_prepare.slurmhtc1 h18 G
masif_ppi_search/transformation_training_data/generate_all.slurmhtc4 h18 G
masif_ppi_search/masif_ppi_search_train.slurmpublicpublic40 h432 GA100
masif_ppi_search/masif_ppi_search_comp_desc.slurmpublicpublic20 h432 GA100
masif_ppi_search_ub/data_prepare.slurmhtc1 h18 G
masif_ppi_search_ub/masif_ppi_search_comp_desc.slurmpublicpublic40 h432 GA100
masif_pdl1_benchmark/data_prepare.slurmhtc1 h18 G
masif_peptides/data_extract_helix.slurmhtc3 h116 G
masif_peptides/data_precompute_patches.slurmhtc3 h116 G
masif_peptides/masif_site_masif_search_eval.slurmpublicpublic8 h416 GA100

Visualising Results in PyMOL

.ply surface files are produced by color_site.sh. To view them:

  1. Install the MaSIF PyMOL plugin on your local machine: see /packages/apps/masif/1.0-gpu/pymol_plugin_installation.md
  2. Copy the .ply file from the cluster to your machine
  3. In PyMOL:
    loadply 4ZQK_A.ply
  4. Hide all objects except those containing iface to 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 files

Make 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.

Permission denied writing output files

You are running from the read-only install. Run copy_data and submit jobs from /scratch/$USER/masif/gpu/ instead.

fatal: not a git repository

This 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.

Container can't find my data files

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 False

Ensure 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 exist

The 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.slurm is 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.