# drewnutt/open_combind architecture

> Architecture diagram of the GitHub repository drewnutt/open_combind, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/drewnutt/open_combind
- Repository: https://github.com/drewnutt/open_combind

## Overview

##### Main Components
- Input/Curation Component – This includes data curation and preparation of raw inputs. The pipeline expects structural data (protein and ligand files) in specific directories (e.g. structures/raw, structures/proteins, structures/ligands). The “structprep” and “ligprep” commands in the README demonstrate how raw data is first curated.
- Docking Engine – Implemented in “open_combind/dock”, this module wraps the docking process using GNINA as the underlying docking tool. It handles tasks like generating docking template files and executing GNINA commands.
- Scoring & Pose Prediction – The “open_combind/score” module, combined with “open_combind/pose-prediction” and “extract-top-poses” commands, uses the computed features to predict the best binding poses and rank them.
- Command Line Interface (CLI) – The “open_combind/cli” folder indicates available CLI tools to drive commands like “structprep”, “ligprep”, “dock-ligands”, “featurize”, “pose-prediction”, and “extract-top-poses”.
- Supporting Modules & Data – Additional folders such as “open_combind/chembl”, “open_combind/data”, “open_combind/pymol” (for visualization) and “open_combind/stats_data” (for benchmarking statistics) support core functions and provide auxiliary data sets.
- Testing & Documentation – “open_combind/tests” ensures functionality and “docs” provides user and developer insights into the API and usage instructions.

##### Depicting Relationships and Interactions
- That these inputs are split into two parallel processes: one responsible for preparing the protein structures (via “structprep”) and one for processing ligand information (via “ligprep”).
- The docking results then move into the Featurization Module (open_combind/features) where pose features are computed.
- Next, these features are used by the Pose Prediction/Scoring Module (open_combind/score) to determine and extract the optimal poses.
- Finally, include paths for benchmarking and validation using modules in “open_combind/stats_data” and tests in “open_combind/tests”.

##### Important Architectural Patterns/Design Principles
- Modular design: Each module (docking, featurization, scoring) is self-contained and can be invoked independently via CLI commands.
- Pipeline workflow: Emphasize that the overall process is sequential with specific hand-offs between components.
- Extensibility: The use of “open_combind/cli” and segregated module directories demonstrates an architecture that anticipates extensions (for example, swapping out docking algorithms or integrating new featurization techniques).
- Integration of external tools: Clearly denote GNINA, OpenMM, PDBFixer, PyMol, and ProDy as key external dependencies that interact with internal modules.

##### Listing Relevant Technologies and Tools
- Languages/Frameworks: Python (as indicated by the .py files and setup.py/config files)
- External Dependencies: GNINA, OpenMM, PDBFixer, PyMol (mentioned explicitly in the README), ProDy.
- Build/Deployment Tools: Provided by “pyproject.toml”, “setup.cfg”, and scripts in “devtools/” for environment creation and setup.
- Continuous Integration/Documentation: The presence of GitHub workflows, Codecov, and ReadTheDocs integration shows emphasis on testing and documentation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Preparation
    subgraph "Data Preparation"
        A["Data Curation/Preparation\n(Raw Structures)"]:::input
    end

    %% Core Pipeline
    subgraph "Core Pipeline"
        B["Docking Engine (open_combind/dock)"]:::process
        C["Featurization Module (open_combind/features)"]:::process
        D["Scoring & Pose Prediction (open_combind/score)"]:::process
    end

    %% User Interface
    subgraph "User Interface"
        E["CLI Interface (open_combind/cli)"]:::cli
    end

    %% Supporting Modules & Data
    subgraph "Supporting Modules & Data"
        F["Chemical Data & Processing (open_combind/chembl)"]:::support
        G["Auxiliary Data (open_combind/data)"]:::support
        H["Visualization Support (open_combind/pymol)"]:::support
        I["Benchmarking Statistics (open_combind/stats_data)"]:::support
    end

    %% Quality & Information
    subgraph "Quality & Information"
        J["Testing (open_combind/tests)"]:::test
        K["Documentation (docs)"]:::doc
    end

    %% External Tools
    subgraph "External Tools"
        L["GNINA"]:::external
        M["OpenMM"]:::external
        N["PDBFixer"]:::external
        O["ProDy"]:::external
    end

    %% Pipeline Flow Connections
    A -->|"prepares_input"| B
    B -->|"docking_results"| C
    C -->|"features_for_scoring"| D

    %% External Tools Integration
    B ---|"calls"| L
    B ---|"calls"| M
    B ---|"calls"| N
    D ---|"may_call"| O

    %% CLI orchestrates Pipeline
    E -.-> A
    E -.-> B
    E -.-> C
    E -.-> D
    E -.-> J
    E -.-> K

    %% Supporting Modules Interactions
    F -->|"supports_scoring"| D
    G -->|"feeds_features"| C
    H ---|"visualizes_results"| D
    I -->|"benchmark_reports"| D

    %% Testing & Documentation Relationship
    K -->|"informs_testing"| J

    %% Click Events
    click A "https://github.com/drewnutt/open_combind/tree/main/open_combind/tests/structures/raw"
    click B "https://github.com/drewnutt/open_combind/tree/main/open_combind/dock"
    click C "https://github.com/drewnutt/open_combind/tree/main/open_combind/features"
    click D "https://github.com/drewnutt/open_combind/tree/main/open_combind/score"
    click E "https://github.com/drewnutt/open_combind/tree/main/open_combind/cli"
    click F "https://github.com/drewnutt/open_combind/tree/main/open_combind/chembl"
    click G "https://github.com/drewnutt/open_combind/tree/main/open_combind/data"
    click H "https://github.com/drewnutt/open_combind/tree/main/open_combind/pymol"
    click I "https://github.com/drewnutt/open_combind/tree/main/open_combind/stats_data"
    click J "https://github.com/drewnutt/open_combind/tree/main/open_combind/tests"
    click K "https://github.com/drewnutt/open_combind/tree/main/docs"

    %% Styles
    classDef input fill:#ACE5EE,stroke:#333,stroke-width:2px;
    classDef process fill:#FDD7E4,stroke:#333,stroke-width:2px;
    classDef cli fill:#D4EDDA,stroke:#333,stroke-width:2px;
    classDef support fill:#FFF3CD,stroke:#333,stroke-width:2px;
    classDef test fill:#E2D1F9,stroke:#333,stroke-width:2px;
    classDef doc fill:#D1ECF1,stroke:#333,stroke-width:2px;
    classDef external fill:#E8E8E8,stroke:#333,stroke-width:2px,stroke-dasharray: 5,5;
```
