# zrqiao/neuralplexer architecture

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

- Interactive diagram: https://gitdiagram.com/zrqiao/neuralplexer
- Repository: https://github.com/zrqiao/neuralplexer

## Overview

##### Main Components Identification
The system can be broken down into these major components:

a. Core Model Architecture
- Data Processing Layer
- Deep Generative Model
- Inference Engine
- Model Training Infrastructure

b. Supporting Infrastructure
- CLI Interface
- Data Management
- Utility Functions
- Evaluation Systems

**User Interface Layer**
- CLI Interface (neuralplexer/cli.py)
- Notebook Interfaces (notebooks/)

**Core Processing Layer**
- Model Components
- Configuration (model/config.py)
- Embedding System (model/embedding.py)
- Multi-head Transformer (model/mht_encoder.py)
- Core Prediction Module (model/cpm.py)
- ESDM Module (model/esdm.py)
- Data Processing
- Data Loading (data/dataloading.py)
- Molecular Operations (data/molops.py)
- Physical Calculations (data/physical.py)

**Utility Layer**
- Frame Handling (util/frame.py)
- Distribution Utils (util/distributions.py)
- SDE Transformations (util/sde_transform.py)
- Tensor Operations (util/tensorgraph.py)

##### Technical Details

Annotations for:
- CUDA Requirements
- Model Checkpoint Integration
- Sampling Parameters
- Multi-chain/Multi-ligand Support

##### Key Features to Highlight

Create special indicators for:
- Template-based prediction pathway
- Multi-chain protein handling
- Multiple ligand processing
- Confidence scoring system
- Parallel processing capabilities

##### Implementation Notes

- The modular nature of the architecture
- The separation between data processing and model components
- The flexibility in handling different input types
- The parallel processing capabilities
- The integration with external tools and libraries

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef interface fill:#B3E5FC,stroke:#0288D1
    classDef core fill:#C8E6C9,stroke:#388E3C
    classDef data fill:#FFE0B2,stroke:#F57C00
    classDef utility fill:#E0E0E0,stroke:#616161
    classDef infra fill:#E1BEE7,stroke:#7B1FA2

    %% User Interface Layer
    subgraph UI["User Interface Layer"]
        CLI["CLI Interface"]
        NB["Notebook Interfaces"]
    end

    %% Core Processing Layer
    subgraph Core["Core Processing Layer"]
        subgraph MC["Model Components"]
            Config["Configuration"]
            Embed["Embedding System"]
            MHT["Multi-head Transformer"]
            CPM["Core Prediction Module"]
            ESDM["ESDM Module"]
            Train["Model Training"]
            Infer["Inference Engine"]
        end

        subgraph DP["Data Processing"]
            DL["Data Loading"]
            MO["Molecular Operations"]
            PC["Physical Calculations"]
            PLP["PDB Ligand Parsing"]
            Pipeline["Data Pipeline"]
        end
    end

    %% Utility Layer
    subgraph Util["Utility Layer"]
        Frame["Frame Handling"]
        Dist["Distribution Utils"]
        SDE["SDE Transformations"]
        Tensor["Tensor Operations"]
    end

    %% Relationships
    CLI --> DL
    NB --> DL
    DL --> Pipeline
    Pipeline --> MO
    Pipeline --> PC
    Pipeline --> PLP
    MO --> Infer
    PC --> Infer
    Config --> MHT
    Config --> CPM
    Config --> ESDM
    Embed --> MHT
    MHT --> CPM
    CPM --> ESDM
    ESDM --> Infer
    Frame --> MO
    Dist --> ESDM
    SDE --> ESDM
    Tensor --> MHT
    Train --> MHT
    Train --> CPM
    Train --> ESDM

    %% Click Events
    click CLI "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/cli.py"
    click NB "https://github.com/zrqiao/NeuralPLexer/tree/main/notebooks/"
    click Config "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/model/config.py"
    click Embed "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/model/embedding.py"
    click MHT "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/model/mht_encoder.py"
    click CPM "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/model/cpm.py"
    click ESDM "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/model/esdm.py"
    click DL "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/data/dataloading.py"
    click MO "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/data/molops.py"
    click PC "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/data/physical.py"
    click PLP "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/data/pdb_ligand_parsing.py"
    click Frame "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/util/frame.py"
    click Dist "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/util/distributions.py"
    click SDE "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/util/sde_transform.py"
    click Tensor "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/util/tensorgraph.py"
    click Train "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/model/training.py"
    click Infer "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/inference.py"
    click Pipeline "https://github.com/zrqiao/NeuralPLexer/blob/main/neuralplexer/data/pipeline.py"

    %% Style Applications
    class CLI,NB interface
    class Config,Embed,MHT,CPM,ESDM,Train,Infer core
    class DL,MO,PC,PLP,Pipeline data
    class Frame,Dist,SDE,Tensor utility
    
    %% Legend
    subgraph Legend
        L1["Interface Components"]:::interface
        L2["Core Components"]:::core
        L3["Data Components"]:::data
        L4["Utility Components"]:::utility
    end
```
