# oncogenetics/locusexplorer architecture

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

- Interactive diagram: https://gitdiagram.com/oncogenetics/locusexplorer
- Repository: https://github.com/oncogenetics/locusexplorer

## Overview

##### Main Components

a. User Interface Layer:
- Shiny UI components (ui.R)
- Input controls for data visualization parameters

b. Application Layer:
- Shiny server (server.R)
- Core R processing components
- Data transformation and plotting modules

c. Data Layer:
- Genetic association data storage
- Biological annotations storage
- Reference data (like genetic maps)

##### Component Relationships

- User Interface → Application Layer (data requests)
- Application Layer → Data Layer (data retrieval)
- Application Layer → User Interface (plot rendering)

##### Data Flow

Following processes:
- Input data upload → Data validation → Processing
- Annotation data integration → Plot generation
- User interaction → Dynamic plot updates

##### External Dependencies

Connections to:
- R package repositories (CRAN, Bioconductor)
- Genome databases
- External annotation sources

##### Specific Implementation Details

Create sections for:
- Plot generation pipeline
- Data preprocessing modules
- Interactive components handling

Use the following symbols:
- Rectangles: Main components
- Diamonds: Decision points
- Clouds: External services

- Component types

##### The extensibility of the system

This design will help developers understand how LocusExplorer integrates various R packages and biological data sources to create an interactive visualization tool for genetic association data.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Browser
        UI[Web Browser Interface]
    end

    subgraph "User Interface Layer"
        MainUI[Main UI]
        WebAssets[Web Assets]
        GlobalConfig[Global Configuration]
    end

    subgraph "Application Layer"
        ServerLogic[Server Logic]
        PlotGen[Plot Generation]
        DataProc[Data Processing]
        GeneProc[Gene Processing]
    end

    subgraph "Data Layer"
        GeneticMap[(Genetic Map Data)]
        AnnotationData[(Annotation Data)]
        ExampleData[(Example Data)]
        ProstateData[(Prostate Cancer Data)]
        HistoneData[(Histone Data)]
    end

    subgraph "Documentation"
        UserGuides[User Guides]
        FAQ[FAQ]
        Tutorials[Tutorials]
        DataDocs[Data Documentation]
    end

    subgraph "External Dependencies"
        R[R Environment]
        Shiny[Shiny Framework]
        ggplot[ggplot2]
        Bioconductor[Bioconductor]
        GenomicRanges[GenomicRanges]
        TxDb[TxDb.Hsapiens]
    end

    UI --> MainUI
    MainUI --> ServerLogic
    ServerLogic --> PlotGen
    ServerLogic --> DataProc
    ServerLogic --> GeneProc
    
    DataProc --> GeneticMap
    DataProc --> AnnotationData
    DataProc --> ExampleData
    DataProc --> ProstateData
    DataProc --> HistoneData
    
    PlotGen --> UI
    
    R --> ServerLogic
    Shiny --> ServerLogic
    ggplot --> PlotGen
    Bioconductor --> DataProc
    GenomicRanges --> GeneProc
    TxDb --> GeneProc

    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef ui fill:#e1f5fe,stroke:#01579b
    classDef app fill:#e8f5e9,stroke:#1b5e20
    classDef data fill:#fff3e0,stroke:#e65100
    classDef doc fill:#f3e5f5,stroke:#4a148c
    classDef ext fill:#fafafa,stroke:#424242

    class UI,MainUI,WebAssets,GlobalConfig ui
    class ServerLogic,PlotGen,DataProc,GeneProc app
    class GeneticMap,AnnotationData,ExampleData,ProstateData,HistoneData data
    class UserGuides,FAQ,Tutorials,DataDocs doc
    class R,Shiny,ggplot,Bioconductor,GenomicRanges,TxDb ext

    click MainUI "https://github.com/oncogenetics/LocusExplorer/blob/master/ui.R"
    click WebAssets "https://github.com/oncogenetics/LocusExplorer/tree/master/www"
    click GlobalConfig "https://github.com/oncogenetics/LocusExplorer/blob/master/global.R"
    click ServerLogic "https://github.com/oncogenetics/LocusExplorer/blob/master/server.R"
    click PlotGen "https://github.com/oncogenetics/LocusExplorer/blob/master/Source/MergePlots.R"
    click DataProc "https://github.com/oncogenetics/LocusExplorer/blob/master/Source/BedGraph.R"
    click GeneProc "https://github.com/oncogenetics/LocusExplorer/blob/master/Source/Gene_R_fixing_strand_facet_issue.R"
    click GeneticMap "https://github.com/oncogenetics/LocusExplorer/tree/master/Data/GeneticMap1KG"
    click AnnotationData "https://github.com/oncogenetics/LocusExplorer/tree/master/Data/Annotation"
    click ExampleData "https://github.com/oncogenetics/LocusExplorer/tree/master/Data/CustomDataExample"
    click ProstateData "https://github.com/oncogenetics/LocusExplorer/tree/master/Data/ProstateData"
    click HistoneData "https://github.com/oncogenetics/LocusExplorer/tree/master/Data/wgEncodeBroadHistone"
    click UserGuides "https://github.com/oncogenetics/LocusExplorer/blob/master/Markdown/InputFileFormat.md"
    click FAQ "https://github.com/oncogenetics/LocusExplorer/blob/master/Markdown/FAQ.md"
    click Tutorials "https://github.com/oncogenetics/LocusExplorer/blob/master/Markdown/LDTutorial.md"
    click DataDocs "https://github.com/oncogenetics/LocusExplorer/blob/master/Markdown/PracticalData.md"
```
