# metyu-melkonyan/docking_proteins architecture

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

- Interactive diagram: https://gitdiagram.com/metyu-melkonyan/docking_proteins
- Repository: https://github.com/metyu-melkonyan/docking_proteins

## Overview

##### Main Components

A. Input Processing Layer
- PDB File Handler
- Configuration Parameters Handler

B. Core Processing Engine
- Docking Pose Analyzer
- Residue-Ligand Interaction Calculator
- Score Normalization Module

C. Output Generation Layer
- Results Formatter
- Visualization Data Preparer

**┌─────────────────────────────────────┐**
- Input Layer               │
- ┘
- ↓             ↓
**┌─────────────────────────────────────┐**
- Processing Layer            │
- ┘
- ↓             ↓
**┌─────────────────────────────────────┐**
- Output Layer               │
- ┘

##### Specific Component Details

- Rectangles (Blue): For data processing modules
- Diamonds (Green): For decision points

##### Key Relationships to Highlight

A. Input Flow:
- PDB file → File Parser → Data Validator
- Configuration Parameters → Parameter Validator

B. Processing Flow:
- Best Pose Selection → Energy Score Calculator
- Residue-Ligand Distance Calculator → Interaction Frequency Analyzer
- Score Normalizer → Data Standardizer

C. Output Flow:
- Results Formatter → JSON Generator
- Visualization Data Preparer → JSmol Compatible Output

##### Important Elements

A. Data Formats:
- Input: PDB files
- Intermediate: Python dictionaries
- Output: JSON files

B. Key Functions:
- best_result()
- result_dict_generator()
- normalize_results()

##### Technical Details to Note

- Version requirements (Python 3.8+)
- Required library dependencies
- File format compatibility

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Input Layer
    subgraph Input
        PDB[("PDB Files")]
        Config[("Configuration Parameters")]
        FileHandler["PDB File Handler"]:::input
        ConfigHandler["Config Parameters Handler"]:::input
    end

    %% Core Processing Layer
    subgraph Processing
        DockAnalyzer["Docking Pose Analyzer"]:::core
        InteractionCalc["Residue-Ligand Interaction Calculator"]:::core
        ScoreNorm["Score Normalization Module"]:::core
        
        subgraph KeyFunctions
            BestResult["best_result()"]:::function
            ResultDict["result_dict_generator()"]:::function
            NormalizeResults["normalize_results()"]:::function
        end
    end

    %% Output Layer
    subgraph Output
        ResultFormat["Results Formatter"]:::output
        VisualPrep["Visualization Data Preparer"]:::output
        JSON[("JSON Output")]
        JSmol[("JSmol Visualization Data")]
    end

    %% Connections
    PDB --> FileHandler
    Config --> ConfigHandler
    FileHandler --> DockAnalyzer
    ConfigHandler --> DockAnalyzer
    DockAnalyzer --> BestResult
    BestResult --> InteractionCalc
    InteractionCalc --> ResultDict
    ResultDict --> ScoreNorm
    ScoreNorm --> NormalizeResults
    NormalizeResults --> ResultFormat
    ResultFormat --> JSON
    ResultFormat --> VisualPrep
    VisualPrep --> JSmol

    %% Click Events
    click FileHandler "https://github.com/metyu-melkonyan/docking_proteins/blob/main/docking_proteins.py"
    click ConfigHandler "https://github.com/metyu-melkonyan/docking_proteins/blob/main/docking_proteins.py"
    click DockAnalyzer "https://github.com/metyu-melkonyan/docking_proteins/blob/main/docking_proteins.py"
    click InteractionCalc "https://github.com/metyu-melkonyan/docking_proteins/blob/main/docking_proteins.py"
    click ScoreNorm "https://github.com/metyu-melkonyan/docking_proteins/blob/main/docking_proteins.py"
    click BestResult "https://github.com/metyu-melkonyan/docking_proteins/blob/main/docking_proteins.py"
    click ResultDict "https://github.com/metyu-melkonyan/docking_proteins/blob/main/docking_proteins.py"
    click NormalizeResults "https://github.com/metyu-melkonyan/docking_proteins/blob/main/docking_proteins.py"
    click ResultFormat "https://github.com/metyu-melkonyan/docking_proteins/blob/main/docking_proteins.py"
    click VisualPrep "https://github.com/metyu-melkonyan/docking_proteins/blob/main/docking_proteins.py"

    %% Styles
    classDef input fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef output fill:#e67e22,stroke:#d35400,color:white
    classDef function fill:#9b59b6,stroke:#8e44ad,color:white

    %% Legend
    subgraph Legend
        L1["Input Processing"]:::input
        L2["Core Processing"]:::core
        L3["Output Processing"]:::output
        L4["Key Functions"]:::function
    end
```
