Skip to content

shawnhoon/constrained_docking

Repository files navigation

OpenDock Enhanced Constraint-Based Molecular Docking

A sophisticated molecular docking pipeline for constraint-based ligand screening with advanced interaction validation and PyMOL visualization.

🎯 Features

  • Chemistry-Aware Constraint Validation: Sophisticated interaction scoring based on chemical compatibility and geometry
  • Unified Ligand Screening: Batch process multiple ligands with comprehensive ranking
  • Enhanced PyMOL Visualizations: Color-coded interactions, toggleable groups, and detailed legends
  • Multiple Validation Methods: Sophisticated (chemistry-aware) and distance-only approaches
  • Detailed Analysis Reports: Complete interaction breakdowns and constraint satisfaction metrics

πŸš€ Quick Start

Installation

# Clone the repository
git clone <repository-url>
cd opendock

# Install dependencies
conda create -n opendock-env python=3.9
conda activate opendock-env
pip install numpy pathlib subprocess

# Install SMINA for docking
# Download from https://sourceforge.net/projects/smina/
# Or install via conda: conda install -c bioconda smina

Basic Usage

# Screen multiple ligands against receptor
python unified_ligand_screening.py data/7R1O_receptor_H.pdb designed_ligands/ results/

# Use specific validation method
python unified_ligand_screening.py data/7R1O_receptor_H.pdb designed_ligands/ results/ sophisticated

πŸ“ Project Structure

opendock/
β”œβ”€β”€ README.md                          # This file
β”œβ”€β”€ unified_ligand_screening.py         # Main screening pipeline
β”œβ”€β”€ scripts/                           # Core analysis scripts
β”‚   β”œβ”€β”€ enhanced_constraint_validation.py
β”‚   β”œβ”€β”€ analyze_smina_poses.py
β”‚   β”œβ”€β”€ smina_local_docking.py
β”‚   └── ...
β”œβ”€β”€ data/                             # Sample data and references
β”œβ”€β”€ designed_ligands/                 # Example ligand library
β”œβ”€β”€ examples/                         # Usage examples (if any)
└── archive/                          # Legacy code and frameworks
    β”œβ”€β”€ experimental_scripts/         # Development scripts
    β”œβ”€β”€ deprecated_workflows/         # OpenDock framework & workflows
    β”œβ”€β”€ old_results/                  # Historical results
    β”œβ”€β”€ test_directories/            # Test runs
    └── ...

πŸ”¬ Core Pipeline

1. Unified Ligand Screening

The main pipeline (unified_ligand_screening.py) provides:

  • Multi-format support: SDF, PDB, PDBQT ligands
  • SMINA-based docking: Expanded pose generation with local optimization
  • Constraint validation: Chemistry-aware interaction scoring
  • Comprehensive reporting: Detailed rankings and visualizations

2. Constraint Validation Methods

Sophisticated Method (Default)

  • Chemistry-aware: Validates H-bond donor/acceptor compatibility
  • Geometric validation: Considers angles and interaction geometry
  • Optimal distance scoring: Based on interaction-specific optimal distances
  • Continuous scoring: 0.0-1.0 range with multiple factors

Distance-Only Method (Fallback)

  • Simple proximity: Distance-based cutoffs only
  • Discrete scoring: 0.0, 0.4, 0.7, or 1.0 based on distance thresholds
  • Fast computation: When chemistry validation fails

3. Enhanced PyMOL Visualizations

  • Color-coded interactions: Different colors for interaction types
  • Thickness indicates strength: Line thickness shows interaction quality
  • Toggleable groups: Show/hide interaction types independently
  • Visual legend: Built-in legend explaining symbols and quality indicators

πŸ“Š Output Files

Ranking Report (ligand_ranking.txt)

ENHANCED LIGAND SCREENING RESULTS
Generated: 2025-08-25 15:35:08
Total ligands processed: 8

Rank  Ligand               Constraints  SMINA      Status
--------------------------------------------------------------------------------
1     RIVPA_sdf            68.3        % -6.025     βœ… GOOD
2     A-40_sdf             67.4        % -5.474     βœ… GOOD

====================================================================================================
DETAILED CONSTRAINT INTERACTION ANALYSIS
====================================================================================================

RANK 1: RIVPA_sdf
--------------------------------------------------
Overall: 68.3% satisfaction (Score: 4.10/6.0)

CONSTRAINT INTERACTIONS:
Constraint   Type            Score    Distance   Atoms                     Status
-------------------------------------------------------------------------------------
D:ILE8       hydrophobic     0.734    3.85       CZ↔CB                     βœ… GOOD
D:ASP10      h_bond          0.736    2.90       NH2↔OD2                   βœ… GOOD
...

Individual Ligand Results

results/
β”œβ”€β”€ ligand_ranking.txt              # Enhanced ranking with interaction details
β”œβ”€β”€ summary_report.json             # JSON summary for programmatic access
β”œβ”€β”€ compare_top_ligands.pml          # PyMOL script comparing top 5 ligands
└── ligand_name/
    β”œβ”€β”€ best_pose.pdb               # Best constraint-satisfying pose
    β”œβ”€β”€ pose_01.pdb to pose_50.pdb  # All generated poses
    β”œβ”€β”€ detailed_analysis.json      # Complete analysis results
    β”œβ”€β”€ constraint_validation.json  # Validation details
    └── visualize_ligand.pml        # Individual PyMOL visualization

πŸ”§ Configuration

Constraint Definitions

Constraints are defined in unified_ligand_screening.py:

self.constraint_residues = {
    'D:ILE8': {'type': 'hydrophobic', 'atoms': 'CB+CG1+CG2+CD1'},
    'D:ASP10': {'type': 'h_bond_acceptor', 'atoms': 'OD1+OD2'},
    'D:ASN13': {'type': 'h_bond_donor_acceptor', 'atoms': 'OD1+ND2'},
    'D:ARG20': {'type': 'h_bond_donor', 'atoms': 'NH1+NH2+NE'},
    'E:ASP4': {'type': 'h_bond_acceptor', 'atoms': 'OD1+OD2'},
    'E:ASP6': {'type': 'h_bond_acceptor', 'atoms': 'OD1+OD2'}
}

Binding Site Parameters

self.binding_center = [19.344, -1.356, 28.097]  # Binding site center
self.binding_box_size = [25.0, 25.0, 25.0]      # Search space

πŸ“š Documentation

πŸ› οΈ Development

Running Examples

# Basic docking example
python examples/framework_success_demo.py

# Constraint comparison
python examples/constraint_comparison.py

Legacy Code

All experimental scripts, old workflows, and test results have been moved to the archive/ directory:

  • archive/experimental_scripts/ - Development and debugging scripts
  • archive/old_results/ - Historical docking results
  • archive/test_directories/ - Test runs and iterations
  • archive/analysis_iterations/ - OpenDock analysis experiments
  • archive/deprecated_workflows/ - Superseded workflows

🀝 Contributing

  1. Keep the main directory clean - use archive/ for experimental work
  2. Update documentation when adding new features
  3. Follow the established naming conventions
  4. Test with both validation methods (sophisticated and distance_only)

πŸ“ License

[Add license information]

πŸ“§ Contact

[Add contact information]

About

Enhanced constraint-based molecular docking pipeline with SMINA and chemistry-aware validation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages