Automated Nextflow pipelines for high-throughput molecular dynamics screening of antibody-antigen complexes
- Overview
- Pipelines
- Requirements
- Installation
- Quick Start
- Pipeline Architecture
- Output Structure
- Configuration Options
- Use Cases
- Cluster Profiles
- Performance
This repository contains production-ready Nextflow pipelines for automated molecular dynamics (MD) simulation and analysis of antibody-antigen complexes. Designed for high-throughput screening of antibody variants on HPC clusters with SLURM scheduling.
Key Features:
- Automated system preparation and MD production with Schrödinger Suite
- Parallel execution across multiple variants and replicates
- Comprehensive trajectory analysis (RMSD, RMSF, Rg, H-bonds, MM-GBSA)
- Reproducible workflows with validated random seeds
- HPC-optimized with GPU support for production runs
Generates MD trajectories for antibody-antigen complexes with independent replicates.
Processes:
- System preparation (solvation, neutralization)
- MD production (NPT ensemble, 100 ns default)
- Trajectory validation
Example:
nextflow run workflows/production.nf \
--variant_list variants.csv \
--md_replicates 3 \
--md_time_ns 100 \
-profile slurmComprehensive analysis of MD trajectories with binding energy calculations.
Analyses performed:
- SID (Simulation Interactions Diagram) — RMSD, RMSF, contacts, H-bonds
- MM-GBSA — Binding free energy estimation
- Trajectory metrics — RMSD, RMSF, Rg, hydrogen bonds
Example:
nextflow run workflows/analysis.nf \
--variant_list variants.csv \
--trajectory_dir results/production/trajectories \
-profile slurm| Requirement | Version |
|---|---|
| Nextflow | ≥ 23.04.0 |
| Schrödinger Suite | 2024-1 or later |
| Python | 3.9+ |
| Python packages | pandas, matplotlib, numpy, seaborn |
| Resource | Purpose |
|---|---|
| SLURM-based HPC cluster | Job scheduling |
| GPU nodes | MD production |
| CPU nodes | Analysis |
Step 1: Clone repository
git clone https://github.com/matt-esqueda/nextflow-md-analysis.git
cd nextflow-md-analysisStep 2: Install Nextflow
curl -s https://get.nextflow.io | bashStep 3: Configure for your cluster
Edit conf/slurm.config to match your HPC environment:
- Schrödinger installation path
- Module names
- Queue/partition names
- GPU resource syntax
Step 4: Install Python dependencies
# Using conda
conda create -n md-analysis python=3.9 pandas matplotlib numpy seaborn
conda activate md-analysis
# Or using pip
pip install pandas matplotlib numpy seabornCreate antibody-antigen complex structures (.maegz format) using Schrödinger Protein Preparation Wizard.
cp test_data/variants.csv.template variants.csv
# Edit variants.csv with your structure pathsExample variants.csv:
variant_name,structure_path
control,/path/to/structures/control.maegz
variant_A,/path/to/structures/variant_A.maegz
variant_B,/path/to/structures/variant_B.maegznextflow run workflows/production.nf \
--variant_list variants.csv \
--md_replicates 3 \
--md_time_ns 100 \
-profile slurmnextflow run workflows/analysis.nf \
--variant_list variants.csv \
--trajectory_dir results/production/trajectories \
-profile slurmFor detailed workflow diagrams and module dependencies, see docs/ARCHITECTURE.md
Production Pipeline:
Input: .maegz structures
↓
System Builder (solvation, ions)
↓
MD Production (parallel replicates)
↓
Trajectory Validation
↓
Output: .cms, .xtc files
Analysis Pipeline:
Input: MD trajectories
↓
SID Analysis (interactions, RMSD, RMSF)
↓
Extract Snapshots (for MM-GBSA)
↓
MM-GBSA Calculations
↓
Trajectory Analysis (Python scripts)
↓
Output: CSV stats, plots (PNG/PDF)
results/
├── production/
│ ├── systems/ # Prepared .cms files
│ ├── trajectories/ # MD trajectories (.xtc)
│ └── validation/ # QC reports
├── analysis/
│ ├── sid/ # SID analysis outputs
│ ├── mmgbsa/ # Binding energies
│ └── trajectory_analysis/
│ ├── rmsd/ # RMSD plots and stats
│ ├── rmsf/ # RMSF plots and stats
│ ├── rg/ # Radius of gyration
│ └── hbonds/ # H-bond analysis
└── pipeline_info/ # Execution reports
| Parameter | Default | Description |
|---|---|---|
--variant_list |
— | CSV with variant names and structure paths (required) |
--md_replicates |
3 |
Number of independent replicates |
--md_time_ns |
100 |
Simulation time (ns) |
--md_temperature |
310.0 |
Temperature (K) |
--system_builder_salt |
0.15 |
Salt concentration (M) |
--outdir |
results |
Output directory |
| Parameter | Default | Description |
|---|---|---|
--variant_list |
— | CSV with variant names (required) |
--trajectory_dir |
— | Directory with MD trajectories (required) |
--mmgbsa_snapshots |
50 |
Number of snapshots for MM-GBSA |
--min_replicates |
3 |
Minimum replicates required |
Screen humanized variants to identify candidates with maintained binding affinity:
variant_name,structure_path
mouse_parent,/data/mouse_mAb.maegz
human_v1,/data/humanized_v1.maegz
human_v2,/data/humanized_v2.maegzCompare binding dynamics across antibodies targeting different epitopes:
variant_name,structure_path
epitope_A,/data/Ab_epitope_A.maegz
epitope_B,/data/Ab_epitope_B.maegzHigh-throughput screening of point mutations:
variant_name,structure_path
wildtype,/data/wt.maegz
Y50A,/data/Y50A.maegz
Y50F,/data/Y50F.maegz
Y50W,/data/Y50W.maegz| Profile | Flag | Description |
|---|---|---|
| SLURM (default) | -profile slurm |
GPU queue for MD; CPU queue for analysis; module-based software loading |
| Test | -profile test |
1 replicate, 1 ns simulation, reduced snapshots |
| Debug | -profile debug |
Enhanced logging, no automatic cleanup |
| Stage | Time |
|---|---|
| System preparation | ~5 min per variant |
| MD production (100 ns) | ~4–6 hours per replicate (GPU) |
| SID analysis | ~15 min per trajectory |
| MM-GBSA (50 snapshots) | ~30 min per trajectory |
| Trajectory analysis | ~5 min per metric |
- Processes run in parallel across variants and replicates
- Can screen 10+ variants with 3 replicates each in ~6–8 hours (wall time)