# charliejhadley/idn_hepitopes architecture

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

- Interactive diagram: https://gitdiagram.com/charliejhadley/idn_hepitopes
- Repository: https://github.com/charliejhadley/idn_hepitopes

## Overview

##### Project type and purpose
- This is a self-contained R Shiny web application (“hepitopes”) that provides an interactive, online database of HBV epitopes restricted by HLA Class I.
- The user interface is defined in ui.R, server logic in server.R, and two standalone R scripts (data-processing.R and url-generator.R) perform offline ETL and URL construction.

##### File structure
- Top-level Shiny app:
- ui.R – defines the user interface, input controls, visualizations
- server.R – contains reactive logic, data loading, filtering, plotting
- Data pipeline scripts:
- data-processing.R – reads raw epitope data (e.g., from Figshare DOIs), cleans and aggregates into a processed dataset
- url-generator.R – builds permalinks or reference URLs for each epitope
- Project metadata:
- hepitopes.Rproj – RStudio project file
- .gitignore, LICENSE, README.md – repo configuration and documentation
- App_Description.Rmd/.md, Contact_Us.Rmd – auxiliary docs
- No explicit database folder, suggesting data is stored as flat files (.csv, .RData) or fetched on-the-fly from external sources.

##### README for additional insights
- Live deployment at www.expmedndm.ox.ac.uk/hepitopes
- Data source: Figshare DOIs (live dataset and deposit)
- Goal: maintain an open-access, updatable epitope database for research and vaccine design.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Web Browser"]:::frontend

    subgraph "Shiny Server (Runtime)"
        direction TB
        UI["ui.R"]:::backend
        Server["server.R"]:::backend
    end

    subgraph "ETL Pipeline (Offline)"
        direction TB
        DP["data-processing.R"]:::etl
        URLGen["url-generator.R"]:::etl
    end

    Figshare[(Figshare DOIs)]:::data
    DS[(Data Storage<br/>.RData, CSV)]:::data

    subgraph "Version Control & Docs"
        direction TB
        Repo["hepitopes.Rproj"]:::docs
        Gitignore[".gitignore"]:::docs
        License["LICENSE"]:::docs
        Readme["README.md"]:::docs
        AppDesc["App_Description.Rmd/.md"]:::docs
        Contact["Contact_Us.Rmd"]:::docs
    end

    Figshare --> DP
    DP --> DS
    DS --> URLGen
    URLGen --> DS
    DS --> Server
    Browser --> Server
    Server --> Browser
    Repo --> DP
    Repo --> URLGen
    Repo --> UI
    Repo --> Server

    click UI "https://github.com/charliejhadley/idn_hepitopes/blob/master/ui.R"
    click Server "https://github.com/charliejhadley/idn_hepitopes/blob/master/server.R"
    click DP "https://github.com/charliejhadley/idn_hepitopes/blob/master/data-processing.R"
    click URLGen "https://github.com/charliejhadley/idn_hepitopes/blob/master/url-generator.R"
    click AppDesc "https://github.com/charliejhadley/idn_hepitopes/blob/master/App_Description.Rmd"
    click Contact "https://github.com/charliejhadley/idn_hepitopes/blob/master/Contact_Us.Rmd"
    click Repo "https://github.com/charliejhadley/idn_hepitopes/blob/master/hepitopes.Rproj"
    click Gitignore "https://github.com/charliejhadley/idn_hepitopes/blob/master/.gitignore"
    click License "https://github.com/charliejhadley/idn_hepitopes/tree/master/LICENSE"
    click Readme "https://github.com/charliejhadley/idn_hepitopes/blob/master/README.md"

    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef backend fill:#90EE90,stroke:#333,stroke-width:1px
    classDef etl fill:#FFA500,stroke:#333,stroke-width:1px
    classDef data fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef docs fill:#E6E6FA,stroke:#333,stroke-width:1px
```
