# drewlindsey/denovoprediction architecture

> Architecture diagram of the GitHub repository drewlindsey/denovoprediction, 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/drewlindsey/denovoprediction
- Repository: https://github.com/drewlindsey/denovoprediction

## Overview

##### Main Components Identification

a. Core Pipeline Components (Primary Processing Flow):
- Conformation Initializer
- Fragment Library Generator
- Seef (Energy Computation)
- Conformation Sampler
- Residue Mapper
- PDB Mapper

b. External Dependencies:
- calRW (RW Potential calculation)
- CRANKITE (PDB file format mapping)
- ROBETTA (Fragment generation)

c. Web Interface:
- Flask Web Server
- Redis (indicated by run-redis.sh)
- Celery (indicated by run-celery.sh)

**[Flask Web Server] ←→ [Celery Worker] ←→ [Redis]**

**[Pipeline Controller]**

**[Conformation Initializer] → [Fragment Library Generator] → [Seef] → [Conformation Sampler] → [Residue Mapper] → [PDB Mapper]**

##### Specific Implementation Details

a. Data Flow:
- How protein sequence data enters the system
- Intermediate data transformations
- Final PDB structure output

b. Module Organization (based on src/ directory):
- Conformation module (src/conformation/)
- Fragments module (src/fragments/)
- Pipeline module (src/pipeline/)
- Score module (src/score/)
- Seef module (src/seef/)

##### Additional Elements

- Input/Output formats at each stage
- Key file formats (PDB, fragment libraries)
- Processing stages with their respective computational methods
- Integration points with external tools

##### Notes for Implementation

- Use standard UML or similar notation for components
- Brief descriptions of each component's function
- Error handling and alternative paths
- Parallel processing capabilities (especially for Celery workers)
- Where configuration files are used

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef web fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#f1c40f,stroke:#f39c12,color:black
    classDef data fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef pipeline fill:#e74c3c,stroke:#c0392b,color:white

    %% Web Interface Layer
    subgraph Web
        Flask["Flask Web Server"]:::web
        Celery["Celery Worker"]:::web
        Redis["Redis Server"]:::web
        
        Flask <--> Celery
        Celery <--> Redis
    end

    %% Pipeline Controller
    Pipeline["Pipeline Controller"]:::pipeline
    
    %% Core Processing Components
    subgraph Core
        ConfInit["Conformation Initializer"]:::core
        FragLib["Fragment Library Generator"]:::core
        Seef["Seef Energy Computation"]:::core
        ConfSamp["Conformation Sampler"]:::core
        ResMap["Residue Mapper"]:::core
        PDBMap["PDB Mapper"]:::core
        Score["Score Calculator"]:::core
    end

    %% External Dependencies
    subgraph External
        calRW["calRW"]:::external
        CRANKITE["CRANKITE"]:::external
        ROBETTA["ROBETTA"]:::external
        dDFIRE["dDFIRE"]:::external
        TMscore["TMscore"]:::external
    end

    %% Data Files
    subgraph Data
        AminoData["Amino Acid Data"]:::data
        ConfigData["Configuration Data"]:::data
        DFIREData["DFIRE Data"]:::data
    end

    %% Relationships
    Celery --> Pipeline
    Pipeline --> ConfInit
    ConfInit --> FragLib
    FragLib --> Seef
    Seef --> ConfSamp
    ConfSamp --> ResMap
    ResMap --> PDBMap
    Seef --> Score

    %% External Tool Dependencies
    Seef -.-> calRW
    PDBMap -.-> CRANKITE
    FragLib -.-> ROBETTA
    Score -.-> dDFIRE
    Score -.-> TMscore

    %% Data Dependencies
    AminoData -.-> ConfInit
    ConfigData -.-> Pipeline
    DFIREData -.-> Seef

    %% Click Events
    click Flask "https://github.com/drewlindsey/denovoprediction/blob/master/example/run_webserver.py"
    click Redis "https://github.com/drewlindsey/denovoprediction/blob/master/example/run-redis.sh"
    click Celery "https://github.com/drewlindsey/denovoprediction/blob/master/example/run-celery.sh"
    click Pipeline "https://github.com/drewlindsey/denovoprediction/blob/master/src/pipeline/Pipeline.py"
    click ConfInit "https://github.com/drewlindsey/denovoprediction/blob/master/src/conformation/Conformation.py"
    click ConfSamp "https://github.com/drewlindsey/denovoprediction/blob/master/src/conformation/ConformationSampler.py"
    click ResMap "https://github.com/drewlindsey/denovoprediction/blob/master/src/conformation/Residue.py"
    click FragLib "https://github.com/drewlindsey/denovoprediction/blob/master/src/fragments/FragmentLibrary.py"
    click Seef "https://github.com/drewlindsey/denovoprediction/blob/master/src/seef/Seef.py"
    click Score "https://github.com/drewlindsey/denovoprediction/blob/master/src/score/Score.py"
    click PDBMap "https://github.com/drewlindsey/denovoprediction/blob/master/src/mapper.py"
    click calRW "https://github.com/drewlindsey/denovoprediction/tree/master/example/calRW"
    click dDFIRE "https://github.com/drewlindsey/denovoprediction/tree/master/example/dDFIRE"
    click TMscore "https://github.com/drewlindsey/denovoprediction/tree/master/example/TMscore"
    click AminoData "https://github.com/drewlindsey/denovoprediction/blob/master/example/amino.dat"
    click ConfigData "https://github.com/drewlindsey/denovoprediction/blob/master/example/data.dat"
    click DFIREData "https://github.com/drewlindsey/denovoprediction/blob/master/example/dfire.1"
```
