Tuesday, August 12, 2025

# Module 2 Installation & Environment Setup

 

~ with a real-life example (ACE co-crystal PDB 1O86 + Lisinopril ligand).
I’ll include exact commands (Linux/macOS/WSL), small scripts to compute the docking box center, and troubleshooting tips.


Quick plan (what you’ll do in this module)

  1. Create a conda environment and install Vina, OpenBabel, and MGLTools (AutoDockTools).

  2. Download the example receptor (PDB 1O86) and ligand (Lisinopril) SMILES.

  3. Convert ligand SMILES → 3D → mol2 (OpenBabel).

  4. Prepare receptor and ligand .pdbqt files (AutoDockTools prepare_receptor4.py / prepare_ligand4.py).

  5. Run a test docking with vina (example command).

  6. Inspect outputs and common errors.


Important downloads / references


0) Prerequisites (one-time)

  • Install Miniconda/Anaconda (recommended).

  • (Optional but recommended) install mamba for faster conda installs.

Install mamba (optional, faster):

bash
conda install -n base -c conda-forge mamba -y

1) Create environment & install tools (recommended: Linux/macOS/WSL)

Recommended approach: use conda channels conda-forge and bioconda and install vina, openbabel, and mgltools.

Using mamba (fast):

bash
# add channels (if not already) conda config --add channels conda-forge conda config --add channels bioconda conda config --set channel_priority strict # create env and install mamba create -n autodock python=3.9 -y conda activate autodock # install core packages mamba install -n autodock -c conda-forge -c bioconda vina openbabel mgltools -y

Fallback with plain conda:

bash
conda create -n autodock python=3.9 -y conda activate autodock conda install -c conda-forge vina openbabel -y conda install -c bioconda mgltools -y

Notes:

  • vina is available from conda-forge / bioconda (use whichever channel works on your platform). Anaconda+1

  • MGLTools installers are also available directly from the Scripps page if you prefer GUI installers. ccsb.scripps.edu

Windows users: you may download installers (Vina MSI or zip and MGLTools .exe) from the vendor pages and add Vina to PATH; or use WSL2 and follow the Linux steps for a smoother experience. AutoDock Vinaccsb.scripps.edu


2) Get the example files (receptor + ligand)

A. Download ACE co-crystal (PDB 1O86) — save as 1O86.pdb:

bash
curl -L -o 1O86.pdb https://files.wwpdb.org/download/1O86.pdb

(You can also download from RCSB web UI.) RCSB PDB+1

B. Create a SMILES file for Lisinopril (PubChem CID 5362119; canonical SMILES shown):

bash
# example SMILES (from PubChem) echo "C1C[C@H](N(C1)C(=O)C(CCCCN)NC(CCC2=CC=CC=C2)C(=O)O)C(=O)O" > lisinopril.smiles

(You can also wget/download the SDF from PubChem). PubChem


3) Convert SMILES → 3D SDF → MOL2 (OpenBabel)

Generate 3D coordinates and write a mol2 (preferred for prepare_ligand4.py):

bash
# 1) SMILES -> SDF (3D) obabel -ismi lisinopril.smiles -O lisinopril.sdf --gen3D # 2) SDF -> MOL2 (add hydrogens) obabel -isdf lisinopril.sdf -omol2 -O lisinopril.mol2 --addhs --minimize

If you prefer a single-step: obabel -ismi lisinopril.smiles -omol2 -O lisinopril.mol2 --gen3D --addhs --minimize

Tip: OpenBabel flags --gen3D, --addhs, and --minimize create a reasonable 3D geometry. For charges you generally use AutoDockTools (prepare_ligand4) to assign Gasteiger charges. openbabel.github.ioopen-babel.readthedocs.io


4) Prepare receptor and ligand .pdbqt (AutoDockTools scripts)

Why use AutoDockTools (MGLTools)? prepare_receptor4.py and prepare_ligand4.py correctly set atom types, merge non-polar hydrogens, assign Gasteiger charges and define torsions — this is the recommended route for reliable .pdbqt. dockey.readthedocs.ioGitHub

Example commands (paths depend on how MGLTools installed — if installed via conda the scripts will be on your PATH; else use full path to MGLToolsPckgs/.../Utilities24/prepare_receptor4.py):

bash
# Prepare receptor: remove water / heteroatoms and make pdbqt prepare_receptor4.py -r 1O86.pdb -o 1O86_receptor.pdbqt # (If needed: remove water/ligand first in PyMOL or via flags such as -U) # e.g., prepare_receptor4.py -r 1O86.pdb -o 1O86_receptor.pdbqt -U 'nphs' # Prepare ligand (use the mol2 created earlier) prepare_ligand4.py -l lisinopril.mol2 -o lisinopril.pdbqt

If your MGLTools is not Python-3 compatible on your system, use the packaged installer or the autodocktools-prepare conda package that provides prepare_* scripts. Anacondaccsb.scripps.edu

Alternate: Meeko (Python package) or obabel --partialcharges gasteiger -opdbqt can be used, but AutoDockTools remain the most commonly used/robust for assigning torsions for Vina. Durrant Labdockey.readthedocs.io


5) Find the docking box center (practical options)

You need center_x/y/z for vina. three ways:

A) PyMOL GUI (quick)

  • Load 1O86.pdb, select the ligand (e.g., select lig, resn LPR) then center on it and read coordinates or use a centroid plugin.

B) Small Python snippet (Biopython) — compute ligand centroid automatically
Install Biopython: conda install -c conda-forge biopython -y
Then run:

python
# get_centroid_ligand.py from Bio.PDB import PDBParser import numpy as np p = PDBParser(QUIET=True) s = p.get_structure('1O86','1O86.pdb') coords = [] for atom in s.get_atoms(): # ligand in 1O86 has residue name 'LPR' (lisinopril); adjust if different if atom.get_parent().get_resname().strip() == 'LPR': coords.append(atom.get_coord()) coords = np.array(coords) centroid = coords.mean(axis=0) print("center_x, center_y, center_z = ", centroid.tolist())

Run: python get_centroid_ligand.py — this prints coordinates you can pass to vina.

C) Manual — pick coordinates from the ligand lines in the PDB (HETATM lines).

(Residue name for lisinopril in 1O86 is LPR — confirm in the PDB file). RCSB PDBIUPHAR/MMV Guide to Malaria Pharmacology


6) Run a test docking with Vina

Example (replace center_* with values from the centroid tool or PyMOL):

bash
vina --receptor 1O86_receptor.pdbqt \ --ligand lisinopril.pdbqt \ --center_x XX.XXX --center_y YY.YYY --center_z ZZ.ZZZ \ --size_x 20 --size_y 20 --size_z 20 \ --exhaustiveness 8 \ --out lisinopril_out.pdbqt \ --log lisinopril_log.txt
  • size_* controls the box dimensions (Å). 20 Å is a reasonable starting cube for small ligands but tune as needed.

  • Inspect lisinopril_log.txt — it lists binding energy (kcal/mol) for the top poses. AutoDock Vina


7) Quick visualization

Open lisinopril_out.pdbqt in PyMOL/PyRx and view poses; compare with co-crystallized ligand in 1O86 for validation.


Common errors & fixes

  • “Parse error… Unknown tag”: often malformed .pdbqt. Rebuild ligand with prepare_ligand4.py (do not hand-edit). ResearchGate

  • Missing charges (q = 0) after OpenBabel conversion — add --partialcharges gasteiger or use AutoDockTools. OpenBabel sometimes needs explicit flags. Durrant LabGitHub

  • prepare_ligand/prepare_receptor scripts expect python2: use MGLTools installer or the conda mgltools package / autodocktools-prepare that supplies python3-compatible scripts. Anaconda+1


Short checklist to hand to participants

  1. Create env: conda/mamba create -n autodock python=3.9conda activate autodock.

  2. Install: mamba install -c conda-forge -c bioconda vina openbabel mgltools (or download installers). Anacondaccsb.scripps.eduopenbabel.github.io

  3. Download 1O86.pdb. RCSB PDB

  4. Get Lisinopril SMILES (PubChem CID 5362119). PubChem

  5. Convert, prepare and run vina (commands above).

  6. Visualize results in PyMOL or PyRx.

No comments:

Post a Comment

#Module 5 Post-Docking Analysis

Post-Docking Analysis , laid out as a clean, runnable activity so your participants can walk straight through it after docking. It includes ...