How arifmaulanaazis/gmxauto works
Project Type & Purpose
• gmxauto is an open-source, desktop GUI tool (not a web full-stack app) for automating GROMACS 2025.1 molecular dynamics workflows on Windows.
• It wraps the official GROMACS binaries (both CUDA GPU and CPU builds), providing a PyQt6 interface and Python orchestration modules for preparing, executing, monitoring, and logging multi-step MD simulations.
File Structure & Architectural Indicators
• Top-level Python modules:
• main.py – entry point
• gui_main.py – PyQt6 window & view layer
• command_runner.py – subprocess wrapper for GROMACS calls
• environment_manager.py – selects/configures GPU vs. CPU GROMACS PATH
• mdp_file_manager.py – prepares/validates .mdp parameter files
• gpu_command_builder.py – constructs CUDA-enabled command-line flags
• simulation_worker.py – orchestrates MD steps (energy minimization → equilibration → production) and log parsing
• gambar.py – application-level logging & progress display
• Vendor directories:
• gmx/… – bundled CUDA GROMACS binaries, libs, includes, force-fields, man pages
• gmx_cpu/… – bundled CPU-only GROMACS build
• README.md confirms PyQt6 front-end and Python back-end, with external dependency on GROMACS binaries.
a. User Interface (View)
• PyQt6 GUI (gui_main.py)
• Widgets to select CHARMM-GUI folder, hardware (GPU/CPU), simulation parameters
b. Controller / Orchestration Layer
• main.py: initializes GUI and thread pool
• simulation_worker.py: runs tasks in background threads
• environment_manager.py: points PATH to either gmx/ or gmx_cpu/
c. Model / Utility Modules
• mdp_file_manager.py: generates and validates .mdp files
• gpu_command_builder.py: builds GPU-specific "gmx mdrun" arguments
• command_runner.py: executes built commands, streams stdout/stderr
• gambar.py: captures logs in gmxauto.log and updates GUI progress
d. External Service / Dependencies
• GROMACS executables & libraries in gmx/ (CUDA) or gmx_cpu/ (CPU)
• File system: input (.gro/.top/.mdp), output (.xtc/.trr/.log/.cpt), structured result folders
• (Optional) Analysis tools: VMD, MDAnalysis, PyMOL (external post-processing)
Relationships & Data Flows
• User clicks “Run” → GUI triggers simulation_worker
• simulation_worker asks environment_manager to set PATH
• simulation_worker calls mdp_file_manager & gpu_command_builder → build input files & command arguments
• simulation_worker invokes command_runner → subprocess → gmx[.exe] (in gmx/ or gmx_cpu/)
• command_runner streams logs to gambar.py → GUI progress bar & gmxauto.log
• simulation_worker sequences steps: energy minimization → equilibration → production
• Outputs are collected in an organized directory per simulation
• Upon completion or failure, GUI notifies user and offers logs/viewers
Architectural Patterns & Principles
• MVC-inspired separation: gui_main.py (View), simulation_worker.py + main.py (Controller), mdp_file_manager/gpu_command_builder (Model/Business Logic)
• Modular design for hardware-specific differences (environment_manager toggles between two GROMACS installs)
• Threaded worker pattern (simulation_worker) to keep UI responsive
• Single responsibility for utility modules (command_runner only deals with subprocess, mdp_file_manager only with file formats)
Essential Elements
• Clear labels (module names, data formats)