This repository contains scripts for setting up and running molecular dynamics (MD) simulations and free energy perturbation (FEP) calculations using GROMACS and related tools.
Before using these scripts, ensure you have the following software installed:
- Python (3.7 or higher). Recommended to create a Conda environment:
conda create -n py37 python=3.7 conda activate py37
- PyModSim: Install via GitHub.
- PyMemDyn: Install via GitHub.
- LigParGen: Install via GitHub.
- GROMACS: Required for MD simulations.
- Schrödinger Maestro (or equivalent software) for protein and ligand preparation.
Before proceeding with the provided scripts, the PyModSim tool must be used to align the protein-ligand complex with the membrane. This step ensures that the system is properly oriented for subsequent docking and molecular dynamics simulations.
-
Prepare Input Files:
- Export the protein and ligand from Schrödinger Maestro (or other software) as separate PDB files.
-
Run PyModSim:
pymodsim -n 3 -p unaligned_protein.pdb
Replace
unaligned_protein.pdbwith the name of your protein file. -
Output: PyModSim generates a properly aligned protein file in
finalOutput/homology.pdbthat can be used as input for the next steps.
Note: Ensure the complex is visually inspected after alignment to confirm correctness.
This protocol was tested by using Schrödinger Maestro. After docking, export protein and ligands as separated pdb files.
Use the setup_pym.py script to prepare ligand-receptor systems for PyMemDyn simulations.
python setup_pym.py [--noclean] [-C CLUSTER] [-p PROTEIN]
[-l LIGAND] [-w WATERS] [-i IONS]
[-r RESTRAINT] [--fep]| Argument | Description |
|---|---|
--noclean |
Retain intermediate files. |
-C CLUSTER |
Specify the cluster for job submission (CSB, CESGA, TETRA). |
-p PROTEIN |
Protein PDB file (default: protein.pdb). |
-l LIGAND |
Ligand identifier in the PDB (default: LIG). |
-w WATERS |
Crystallized water identifiers (default: HOH). |
-i IONS |
Crystallized ion identifiers (default: NA). |
-r RESTRAINT |
Restraint type: bw (Ballesteros-Weinstein) or ca (C-alpha). Default: ca. |
--fep |
Prepare files for FEP calculations (adds --full_relax false to PyMemDyn execution). |
The script:
- Creates a folder for each ligand.
- Generates the ligand-receptor complex.
- Runs LigParGen for ligand parameterization.
- Prepares SLURM scripts (
pymemdyn.shfor PyMemDyn execution andsubmit_pym.shfor batch submission).
Input Structure:
my_project/
├── protein.pdb
├── ligand1.pdb
├── ligand2.pdbOutput Structure:
my_project/
├── 1.input_files/
│ ├── protein.pdb
│ ├── ligand1.pdb
│ ├── ligand2.pdb
├── ligand1/
│ ├── complex.pdb
│ ├── LIG.gro
│ ├── LIG.itp
│ └── pymemdyn.sh
├── ligand2/
├── submit_pym.shSubmit PyMemDyn jobs:
sh submit_pym.shAfter PyMemDyn equilibration, use the setup_md.py script to prepare MD simulation files.
python setup_md.py [-t TIME] [-rt RUNTIME] [-C CLUSTER] [-n NUM_REPLICAS]| Argument | Description |
|---|---|
-t TIME |
Simulation time in nanoseconds (default: 25). |
-rt RUNTIME |
Runtime limit in hours (default: 36). |
-C CLUSTER |
Cluster for job submission (CSB, CESGA, TETRA). |
-n NUM_REPLICAS |
Number of replicas for MD simulations (default: 3). |
The script:
- Copies required files to a
3.md/directory. - Prepares SLURM scripts for MD simulations (
run_md.shfor each replica andsubmit_md.shfor batch submission). - Modifies
prod.mdpto set the simulation time and random seed.
Input Structure:
my_project/
├── 1.input_files/
│ ├── protein.pdb
│ ├── ligand1.pdb
│ ├── ligand2.pdb
├── ligand1/
│ ├── complex.pdb
│ ├── LIG.gro
│ ├── LIG.itp
│ └── pymemdyn.sh
├── ligand2/
├── submit_pym.shOutput Structure:
my_project/
├── 1.input_files/
│ ├── protein.pdb
│ ├── ligand1.pdb
│ ├── ligand2.pdb
├── 2.pymemdyn/
│ ├── ligand1/
│ ├── ligand2/
├── 3.md/
│ ├── lig1_1 <- Replica 1 ligand 1
│ │ ├── LIG.itp
│ │ ├── ffoplsaa_mod.itp
│ │ ├── index.ndx
│ │ ├── posre.itp
│ │ ├── posre_NA.itp
│ │ ├── run_md.sh <- SLURM execution for MD
│ │ ├── topol.tpr
│ │ ├── LIG_backup.itp
│ │ ├── ffoplsaabon_mod.itp
│ │ ├── ions.itp
│ │ ├── posre_HOH.itp
│ │ ├── prod.mdp <- Modified with setup_md.py
│ │ ├── spc.itp
│ │ ├── confout.gro
│ │ ├── ffoplsaanb_mod.itp
│ │ ├── popc.itp
│ │ ├── posre_LIG.itp
│ │ ├── protein.itp
│ │ ├── topol.top
│ ├── lig1_2 <- Replica 2 ligand 1
│ ├── lig1_n <- Replica n ligand 1
│ └── submit_md.sh <- Calls run_md.sh inside each directory
For issues or contributions, contact ruben.prieto@usc.es.