How luwei0917/dynamicbind works
Project type and purpose
• Project Type: This is an open‐source scientific software toolkit with a deep equivariant generative model (DynamicBind) for predicting ligand-specific protein–ligand complex structures, plus supporting training, inference, high-throughput screening, and movie generation.
• Purpose: Starting from unbound protein structures and ligand SMILES, it (a) cleans and preprocesses inputs, (b) applies a deep equivariant generative model (built on ESM and bespoke score models) to predict binding poses and affinity scores, (c) optionally runs structural relaxation (OpenMM), and (d) outputs ranked docked complexes and animations.
File structure
• Top‐level scripts & entrypoints:
• train.py – model training pipeline
• run_single_protein_inference.py – inference & docking CLI
• screening.py / merge_screening_results.py – high-throughput screening
• movie_generation.py – animation generation
• inference.py / analysis.py / check_structure_violations.py / compute_lddt.py – auxiliary analysis
• Core directories:
• data/ & datasets/ – raw data files and data‐prep modules (conformer matching, embeddings, pdbbind)
• esm/ – third-party ESM library submodule for protein language models and inverse folding
• models/ – model wrappers and score networks (all_atom_score_model.py, score_model.py)
• confidence/ – modules & datasets for training a confidence‐prediction network
• utils/ – geometric, diffusion, sampling, parsing, relaxation helper routines
• Supporting files:
• environment.yml – conda environment spec
• helper_functions.py – common utility functions
• LICENSE, README.md – project metadata
• External/deployment:
• Uses external libraries: PyTorch (+ CUDA), e3nn, RDKit, PyG, OpenMM, Biopython, AmberTools.
README for insights
• Describes end-to-end workflows: environment setup, checkpoint download, dynamic docking, movie generation, high-throughput screening.
• Specifies I/O contracts: input protein PDB, ligand CSV SMILES, and output directories with CSVs, PDBs, SDFs, PKLs.
• Highlights dependencies and two conda environments (dynamicbind, relax).
a. Main Components
1. Input Preprocessing
– Modules: clean_pdb.py, process_mols.py, parsing utilities
– Inputs: protein.pdb, ligand.csv
2. Data Preparation & Embedding
– Datasets: pdbbind, esm_embedding_preparation, conformer_matching
– ESM submodule: sequence embeddings, inverse folding encoders/decoders
3. Core Generative Model
– Score models in models/ (all-atom and coarse grained)
– Diffusion & sampling routines in utils/diffusion_utils.py, utils/sampling.py
– Confidence‐prediction network in confidence/
4. Inference & Scoring
– run_single_protein_inference.py calls inference.py → generates multiple poses → score & rank
– compute_lddt.py for per‐pose quality estimation
5. Structural Relaxation
– relax_final.py using OpenMM via utils/relax.py
6. Postprocessing & Output
– merge_screening_results.py, screening.py for HTS reports
– Movie generation pipeline: movie_generation.py uses reverseprocess pkls and relax routines
b. Interactions & Data Flow
– Protein PDB + ligand SMILES → Preprocessing → Data Preparation → Embeddings → Generative Model
– Model outputs coordinate distributions → Sampling pipeline → Pose candidates
– Candidates → Scoring (affinity & lDDT) → Ranking → Optional OpenMM Relaxation → Final PDB/SDF
– Final structures & intermediate data → Movie generation
– HTS variant runs through same flow in batch mode
c. Architectural Patterns & Design Principles
– Modular ML pipeline: clear separation of data prep, model, inference, and postprocessing
– Plug-and-play embedders: ESM code vendored under esm/ for invertible folding
– Reusable utilities following single‐responsibility (utils/)
– CLI entrypoints orchestrate the pipeline
d. Key Technologies & Frameworks
– PyTorch, PyG, e3nn for equivariant networks
– ESM library for protein language models
– RDKit & OpenMM for chemistry & relaxation
– Conda environments for dependency isolation