# anaka/egfr_binder_rd2 architecture

> Architecture diagram of the GitHub repository anaka/egfr_binder_rd2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anaka/egfr_binder_rd2
- Repository: https://github.com/anaka/egfr_binder_rd2

## Overview

##### Main Components

a. Data Processing Layer
- Binding_dataset.py and expression_dataset.py components
- Datamodule.py as the data orchestration component
- Metrics database (metrics_db.json) connection

b. Model Layer
- ESM2 Language Model Integration (esm2_pll.py)
- Regression Expert System (esm_regression_expert.py)
- Evolutionary Protein Gradient Component (evoprotgrad.py)
- Binding Transformer (bt.py)

c. Prediction & Sampling Layer
- Sampler Component (sampler.py)
- Folding Pipeline (fold.py)

d. External Resources
- PyMOL Visualization Integration
- Template Files (.a3m files)
- Protein Structure Files (.cif, .pdb)

##### Component Grouping

Create logical groupings for:
- Data handling components
- Model components
- Prediction pipeline
- Visualization tools

##### Technical Details

- Python package dependencies
- File format transformations
- Model pipeline flows
- Database interactions

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef data fill:#b3d9ff,stroke:#333
    classDef model fill:#90EE90,stroke:#333
    classDef process fill:#FFB366,stroke:#333
    classDef external fill:#D3D3D3,stroke:#333
    classDef viz fill:#DDA0DD,stroke:#333

    %% Input Layer
    subgraph InputData
        PDB["Protein Structures (PDB/CIF)"]:::external
        A3M["Template Files (A3M)"]:::external
        DataIn["Input Datasets"]:::data
    end

    %% Data Processing Layer
    subgraph DataProcessing
        BD["Binding Dataset"]:::data
        ED["Expression Dataset"]:::data
        DM["Data Module"]:::data
        MD["Metrics DB"]:::data
    end

    %% Model Layer
    subgraph ModelComponents
        ESM["ESM2 Language Model"]:::model
        RES["Regression Expert System"]:::model
        EPG["Evolutionary Protein Gradient"]:::model
        BT["Binding Transformer"]:::model
    end

    %% Prediction Layer
    subgraph PredictionLayer
        SP["Sampler"]:::process
        FP["Folding Pipeline"]:::process
    end

    %% Visualization Layer
    subgraph VisualizationLayer
        PY["PyMOL Visualization"]:::viz
    end

    %% Notebook Interfaces
    subgraph Notebooks
        DSN["Dataset Notebook"]:::process
        FN["Folding Notebook"]:::process
        SN["Sampling Notebook"]:::process
        BTN["BT Testing Notebook"]:::process
    end

    %% Connections
    PDB --> BD
    A3M --> BD
    DataIn --> BD
    DataIn --> ED
    BD --> DM
    ED --> DM
    DM --> ESM
    DM --> MD
    ESM --> RES
    RES --> EPG
    EPG --> BT
    BT --> SP
    SP --> FP
    FP --> PY

    %% Notebook Connections
    DSN -.-> BD
    DSN -.-> ED
    FN -.-> FP
    SN -.-> SP
    BTN -.-> BT

    %% Click Events
    click BD "https://github.com/ANaka/egfr_binder_rd2/blob/main/src/egfr_binder_rd2/binding_dataset.py"
    click ED "https://github.com/ANaka/egfr_binder_rd2/blob/main/src/egfr_binder_rd2/expression_dataset.py"
    click DM "https://github.com/ANaka/egfr_binder_rd2/blob/main/src/egfr_binder_rd2/datamodule.py"
    click MD "https://github.com/ANaka/egfr_binder_rd2/blob/main/src/egfr_binder_rd2/metrics/metrics_db.json"
    click ESM "https://github.com/ANaka/egfr_binder_rd2/blob/main/src/egfr_binder_rd2/esm2_pll.py"
    click RES "https://github.com/ANaka/egfr_binder_rd2/blob/main/src/egfr_binder_rd2/esm_regression_expert.py"
    click EPG "https://github.com/ANaka/egfr_binder_rd2/blob/main/src/egfr_binder_rd2/evoprotgrad.py"
    click BT "https://github.com/ANaka/egfr_binder_rd2/blob/main/src/egfr_binder_rd2/bt.py"
    click SP "https://github.com/ANaka/egfr_binder_rd2/blob/main/src/egfr_binder_rd2/sampler.py"
    click FP "https://github.com/ANaka/egfr_binder_rd2/blob/main/src/egfr_binder_rd2/fold.py"
    click PY "https://github.com/ANaka/egfr_binder_rd2/tree/main/pymol/"
    click PDB "https://github.com/ANaka/egfr_binder_rd2/blob/main/pymol/8HGO_trimmed.pdb"
    click DSN "https://github.com/ANaka/egfr_binder_rd2/blob/main/notebooks/dataset.ipynb"
    click FN "https://github.com/ANaka/egfr_binder_rd2/blob/main/notebooks/fold.ipynb"
    click SN "https://github.com/ANaka/egfr_binder_rd2/blob/main/notebooks/test_sampler.ipynb"
    click BTN "https://github.com/ANaka/egfr_binder_rd2/blob/main/notebooks/test_bt_model.ipynb"
```
