Running AutoDock Vina (PyRx) on ASL Slurm Cluster

Overview about PyRx:

PyRx is a well-known Virtual Screening software initially developed by Dr. Sargis Dallakyan at The Scripps Research Institute, later enhanced by Omar Al-Attraqchi in 2024. It combines AutoDock Vina, OpenBabel, and visualization tools for Computer-Aided Drug Design (CADD).

On our Slurm cluster, we provide the core components (AutoDock Vina + OpenBabel) packaged in Singularity containers to enable large-scale, reproducible docking runs. While the cluster version doesn’t include the full PyRx GUI, researchers can prepare input files locally using PyRx’s interface and submit high-throughput jobs to the cluster backend for faster processing.

This guide will help you run molecular docking jobs using AutoDock Vina (PyRx backend) on our Slurm cluster.
We provide a pre-built Singularity container environment to simplify and standardize the process.


1๏ธ Required Input Files

Prepare the following files:

FileDescription
receptor.pdbqtTarget protein in .pdbqt format
ligand.pdbqtMolecule/ligand to dock, also .pdbqt format
conf.txtConfiguration file for Vina parameters

2 Create Configuration File (conf.txt)

receptor = receptor.pdbqt
ligand = ligand.pdbqt

center_x = 10
center_y = 10
center_z = 10

size_x = 20
size_y = 20
size_z = 20

num_modes = 9
exhaustiveness = 8

out = output.pdbqt


3 Create SLURM Job Script

Create a file named pyrx_cpu_job.slurm:

#!/bin/bash
#SBATCH --job-name=docking_cpu
#SBATCH --output=output_cpu.log
#SBATCH --ntasks=1
#SBATCH --time=01:00:00
#SBATCH --mem=4G
#SBATCH --partition=ASL-cpu

singularity exec /home/containers/pyrx_components.sif vina –config conf.txt


4 Submit Job

sbatch pyrx_cpu_job.slurm

5 Monitor Job Status

squeue -u $USER

6 Check Output

cat output_cpu.log
ls output.pdbqt

All-in-One Slurm Script: vina_split_and_run.slurm

#!/bin/bash
#SBATCH –job-name=vina_batch
#SBATCH –output=logs/out_%A_%a.log
#SBATCH –error=logs/err_%A_%a.log
#SBATCH –ntasks=1
#SBATCH –time=01:00:00
#SBATCH –mem=4G
#SBATCH –partition=ASL-cpu

# ========= PRE-SUBMISSION SECTION =========
# This section only runs when SLURM_ARRAY_TASK_ID is empty (first submission)

if [ -z “$SLURM_ARRAY_TASK_ID” ]; then
echo “๐Ÿงช Step 1: Splitting ligand.pdbqt using OpenBabel…”

mkdir -p logs

if [ ! -f ligand.pdbqt ]; then
echo “โŒ ligand.pdbqt not found in current directory!”
exit 1
fi

# Split the multi-model ligand into individual PDBQT files
singularity exec /home/containers/pyrx_components.sif obabel ligand.pdbqt -O ligand_split.pdbqt -m

# Count how many were created
LIG_COUNT=$(ls ligand_split*.pdbqt 2>/dev/null | wc -l)

if [ “$LIG_COUNT” -eq 0 ]; then
echo “โŒ No ligand_split*.pdbqt files were created!”
exit 1
fi

echo “โœ… Successfully split $LIG_COUNT ligands.”

# Re-submit this script as an array job
echo “๐Ÿš€ Submitting SLURM job array…”
sbatch –array=1-“$LIG_COUNT” “$0”
exit 0
fi

# ========= SLURM ARRAY TASK SECTION =========
# This section runs per ligand_split*.pdbqt file (each SLURM array task)

# Get ligand filename for this task
LIG_FILE=$(ls ligand_split*.pdbqt | sed -n “${SLURM_ARRAY_TASK_ID}p”)

if [ -z “$LIG_FILE” ]; then
echo “โŒ No ligand found for task ID $SLURM_ARRAY_TASK_ID”
exit 1
fi

echo “๐Ÿ”ฌ Running docking for $LIG_FILE”

# Run docking using vina
singularity exec /home/containers/pyrx_components.sif vina \
–config conf.txt \
–ligand “$LIG_FILE” \
–out “out_${LIG_FILE}” \
–cpu 1

echo “โœ… Finished docking for $LIG_FILE”


RUN >> vina_split_and_run.slurm

Output Files:

  • ligand_split1.pdbqt, ligand_split2.pdbqt, …

  • out_ligand_split1.pdbqt, out_ligand_split2.pdbqt, …

  • Logs: logs/out_JOBID_TASKID.log, logs/err_JOBID_TASKID.log



ย