How forlilab/waterkit works
Project type and purpose
• This repository packages two mature C/C++ command-line tools (AutoDock and AutoGrid) alongside a Python library (“waterkit”) and a set of Python scripts.
• Purpose: provide an end-to-end toolkit for generating receptor/ligand grid maps (via AutoGrid), performing docking simulations (via AutoDock), and then analyzing hydration sites and water behavior through Python.
File structure
• Top level:
• autodocksuite-4.2.6-src/ – full source trees for AutoDock and AutoGrid (C/C++).
• data/ – precomputed parameter files and grid configuration templates.
• docs/ – Sphinx documentation.
• scripts/ – executable Python scripts that orchestrate grid creation, docking, trajectory preparation, etc.
• waterkit/ – core Python package (modules for map I/O, sampling, analysis, force‐fields, etc.).
• setup.py – Python installer entry point.
• Key patterns:
• C binaries live in their own source trees, built via Automake/Autoconf (Makefile.am, configure, etc.).
• Python layer wraps or invokes these binaries (e.g., waterkit/autodock_map.py calls AutoDock executables).
• Data/ and waterkit/data provide static assets (parameter files, water models).
Main components
a. User Interface Layer
• CLI scripts (scripts/*.py)
• Python package entrypoint (waterkit/waterkit.py)
b. Python Library Layer (waterkit/)
• Modules: autodock_map, autogrid, sampling, analysis, forcefield, molecule, spherical_model_map, typer, utils
• Data submodule: static water models & parameters
c. Native Executables Layer
• AutoGrid C binary (built from autodocksuite-4.2.6-src/autogrid)
• AutoDock C binary (built from autodocksuite-4.2.6-src/autodock)
d. Data Layer
• Parameter files (data/, waterkit/data)
• Grid template files (.gpf), map outputs (.map), PDBQT inputs/outputs
e. Documentation Layer
• Sphinx source (docs/) → HTML/PDF
Relationships & data flow
1. User invokes a script or waterkit CLI →
2. Python script imports waterkit modules →
3. Python wrapper builds grid definition (.gpf) →
4. Calls AutoGrid binary (subprocess) → generates map files (.map) →
5. Calls AutoDock binary to perform docking → generates trajectories (.trj, .dlg) →
6. Python sampling & analysis modules parse maps & trajectories → compute hydration metrics →
7. Results returned to user or written to disk
Architectural patterns & design principles
• Separation of concerns:
• Native code handles compute-intensive tasks (grid calc, docking).
• Python handles orchestration, data parsing, analysis, visualization.
• Modular packaging:
• Each Python submodule encapsulates a domain (e.g., waterkit.analysis, waterkit.sampling).
• Extensibility points:
• New analysis routines can be added under waterkit/analysis.
• Additional scripts or workflows in scripts/.
Technologies & frameworks
• C/C++ with Autotools (configure, Makefile.am)
• Python 3.x, setuptools (setup.py)
• Sphinx for docs
• Standard scientific stack (numpy, possibly scipy)