# rkimoakbioinformatics/oakvar architecture

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

- Interactive diagram: https://gitdiagram.com/rkimoakbioinformatics/oakvar
- Repository: https://github.com/rkimoakbioinformatics/oakvar

## Overview

##### Main Components Identification

The system should be divided into these major components:

a) Core Engine Layer
- Module System (under /lib/base)
- Data Processing Pipeline
- Variant Analysis Engine

b) Interface Layer
- CLI Interface (/cli)
- GUI Server (/gui)
- Web Interface Components (/gui/websubmit, /gui/webresult)

c) Module Management System
- Module Templates (/lib/assets/module_templates)
- Module Installation & Management (/api/module)
- Store System (/lib/store)

d) Data Processing Components
- Annotators
- Converters
- Mappers
- Aggregators
- Reporters

**┌─────────────────────────────────────┐**
- OakVar Core               │
- ┤
- Variant Processing Engine         │
- Module Management System          │
- Data Pipeline Orchestrator        │
- ┘

**┌─────────────┐ ┌─────────────┐ ┌─────────────┐**
- CLI      │ │    GUI      │ │    API      │
- ┘ └─────────────┘ └─────────────┘

**[Input] → [Converter] → [Mapper] → [Annotator] → [Aggregator] → [Reporter] → [Output]**

##### Key Relationships

- Data flow through the processing pipeline
- Module system interactions with core
- Store system connections
- External service integrations

##### Additional Elements

- A security layer showing user authentication
- Store system architecture
- Workflow integration points (Snakemake, WDL, etc.)
- Demonstrate the module template system
- Report generation system

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Interface
        CLI["CLI Interface"]
        GUI["GUI Server"]
        WebSubmit["Web Submit Interface"]
        WebResult["Web Result Interface"]
        API["API Layer"]
    end

    subgraph Core["Core Engine Layer"]
        ModSys["Module System"]
        BaseRunner["Base Runner"]
        CommonMod["Common Module Framework"]
        VarEngine["Variant Analysis Engine"]
        Pipeline["Data Processing Pipeline"]
    end

    subgraph ModuleManagement["Module Management"]
        ModTemp["Module Templates"]
        ModInstall["Module Installation"]
        Store["Store System"]
    end

    subgraph DataProcessing["Data Processing Components"]
        direction TB
        Input["Input Data"]
        Converter["Converter"]
        Mapper["Mapper"]
        Annotator["Annotator"]
        Aggregator["Aggregator"]
        Reporter["Reporter"]
        Output["Output Data"]
    end

    subgraph Support["Support Systems"]
        MultiUser["Multi-user Support"]
        JobMgmt["Job Management"]
        SysWorkers["System Workers"]
        DBMgmt["Database Management"]
    end

    subgraph Workflow["Workflow Integration"]
        WFSupport["Workflow Support"]
        Snakemake["Snakemake Integration"]
        WDL["WDL Integration"]
    end

    %% Interface connections
    CLI --> Core
    GUI --> Core
    WebSubmit --> Core
    WebResult --> Core
    API --> Core

    %% Core connections
    ModSys --> VarEngine
    BaseRunner --> Pipeline
    CommonMod --> ModSys
    VarEngine --> Pipeline

    %% Module Management connections
    ModTemp --> ModInstall
    ModInstall --> Store
    Store --> Core

    %% Data Processing flow
    Input --> Converter
    Converter --> Mapper
    Mapper --> Annotator
    Annotator --> Aggregator
    Aggregator --> Reporter
    Reporter --> Output

    %% Support system connections
    MultiUser --> Core
    JobMgmt --> Core
    SysWorkers --> Core
    DBMgmt --> Core

    %% Workflow connections
    WFSupport --> Core
    Snakemake --> WFSupport
    WDL --> WFSupport

    %% Click events for component mapping
    click CLI "https://github.com/rkimoakbioinformatics/oakvar/tree/master/oakvar/cli/"
    click GUI "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/gui/server.py"
    click WebSubmit "https://github.com/rkimoakbioinformatics/oakvar/tree/master/oakvar/gui/websubmit/"
    click WebResult "https://github.com/rkimoakbioinformatics/oakvar/tree/master/oakvar/gui/webresult/"
    click ModSys "https://github.com/rkimoakbioinformatics/oakvar/tree/master/oakvar/lib/base/"
    click BaseRunner "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/lib/base/runner.py"
    click CommonMod "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/lib/base/commonmodule.py"
    click ModTemp "https://github.com/rkimoakbioinformatics/oakvar/tree/master/oakvar/lib/assets/module_templates/"
    click ModInstall "https://github.com/rkimoakbioinformatics/oakvar/tree/master/oakvar/api/module/"
    click Store "https://github.com/rkimoakbioinformatics/oakvar/tree/master/oakvar/lib/store/"
    click Converter "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/lib/base/converter.py"
    click Mapper "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/lib/base/mapper.py"
    click Annotator "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/lib/base/annotator.py"
    click Aggregator "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/lib/base/aggregator.py"
    click Reporter "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/lib/base/reporter.py"
    click MultiUser "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/gui/multiuser.py"
    click JobMgmt "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/gui/job_handlers.py"
    click SysWorkers "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/gui/system_worker.py"
    click DBMgmt "https://github.com/rkimoakbioinformatics/oakvar/blob/master/oakvar/lib/util/db.py"
    click WFSupport "https://github.com/rkimoakbioinformatics/oakvar/tree/master/workflows/"
    click Snakemake "https://github.com/rkimoakbioinformatics/oakvar/tree/master/workflows/snakemake/"
    click WDL "https://github.com/rkimoakbioinformatics/oakvar/tree/master/workflows/wdl/"

    classDef interface fill:#90EE90
    classDef core fill:#87CEEB
    classDef module fill:#FFA500
    classDef support fill:#D3D3D3
    classDef workflow fill:#DDA0DD

    class CLI,GUI,WebSubmit,WebResult,API interface
    class ModSys,BaseRunner,CommonMod,VarEngine,Pipeline core
    class ModTemp,ModInstall,Store module
    class Input,Converter,Mapper,Annotator,Aggregator,Reporter,Output module
    class MultiUser,JobMgmt,SysWorkers,DBMgmt support
    class WFSupport,Snakemake,WDL workflow
```
