How paiardin/dockingpie works
Project Type and Purpose
• DockingPie is a desktop plugin for the PyMOL molecular graphics system. It is neither a web service nor a microservice suite, but a full-stack GUI application embedded inside PyMOL.
• Its purpose is to provide a unified front-end for running and comparing multiple molecular docking engines (Smina, AutoDock Vina, RxDock, ADFR) and to perform consensus scoring analyses.
File-Structure Analysis
• Top-level “DockingPie1/” directory contains:
• lib/docking_program_main/Functions → core business logic (wrappers for docking engines, I/O, threads, error handling, installer routines)
• lib/docking_program_main/config → static configuration files for each engine
• lib/docking_program_main/docking_program_gui → Qt-based GUI (dialogs, frames, main window, QSS styling)
• lib/docking_program_main/plots → plotting sub-system using pyqtgraph
• lib/docking_program_main/tables → tabular data display
• Key patterns:
• MVC-style separation: GUI layer (Views + Controllers) vs. Functions layer (Services)
• Multithreaded job execution via threads.py/dockings_thread.py
• Plug-in integration into host application (PyMOL API calls via pymol_interactions.py)
README Insights
• Plugin is installed via PyMOL’s Plugin Manager and runs inside PyMOL ≥2.3.x
• External tools (RxDock, Vina, Smina, ADFR, OpenBabel, sPyRMSD, sdsorter) are managed by installer routines
• Emphasis on consensus docking: results from multiple engines are aggregated and visualized
Main Components
A. Host Environment
• PyMOL application (plugin loader, molecular scene)
B. Plugin Layers
1. GUI Layer (Qt/PyQt)
– MainWindow, Tabs, Dialogs, Frames (docking_program_gui/)
– Event handlers (handle_widgets.py)
2. Controller/Service Layer
– Functions package (adfr_functions, vina_functions, rxdock_functions, smina_functions)
– ConsensusProtocol (consensus_protocol.py)
– Installer & Config Loader (installer.py + config/)
3. Data-Visualization Layer
– Plots via pyqtgraph (plots/…)
– Tables (tables/tables.py)
4. Integration Layer
– PyMOL API interactions (pymol_interactions.py)
5. Concurrency Layer
– Thread management (threads.py, dockings_thread.py)
C. External Dependencies
• Docking executables: Smina, Vina, RxDock, ADFR
• Cheminformatics libraries: OpenBabel, AutoDockTools, sPyRMSD, sdsorter
Component Relationships and Data Flow
• User triggers action in GUI → GUI event handler
→ Controller (Functions) prepares inputs (ligand, receptor)
→ Installer/Config modules supply engine-specific parameters
→ Controller dispatches docking jobs to worker threads
→ Each thread invokes external executable (via subprocess call)
→ Raw docking results returned to Controller
→ ConsensusProtocol aggregates and ranks results
→ Visualization modules (pyqtgraph + tables) render plots/tables
→ pymol_interactions updates PyMOL viewport with best poses
• Bi-directional flows:
• GUI ↔ Controller (user inputs & status updates)
• Controller ↔ Worker Threads (job dispatch & result callbacks)
• Controller ↔ External Tools (command-line calls & exit codes)
• Controller → Visualization (data in)
• Visualization → GUI (widgets display)
Architectural Patterns & Design Principles
• MVC: clear separation of Views (Qt GUI) from Model/Services (Functions)
• Layered architecture: Presentation, Application Logic, Integration, External
• Concurrency: Thread-per-engine pattern to run docking jobs in parallel
• Plugin architecture: decoupled modules loaded by host (PyMOL)
Technologies, Frameworks & Libraries
• Python 3.x
• PyMOL Plugin API
• PyQt5 / Qt Designer (.ui templates, QSS styling)
• pyqtgraph for interactive plotting
• subprocess for external tool invocation
• threading module for concurrency
• config files (text-based) for engine parameters
• Annotation of key cross-cutting concerns (threads, installer)