# theiagen/public_health_bioinformatics architecture

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

- Interactive diagram: https://gitdiagram.com/theiagen/public_health_bioinformatics
- Repository: https://github.com/theiagen/public_health_bioinformatics

## Overview

##### Main Components

a) Workflow Layer
- Workflows into main categories:
- Genomic Characterization (TheiaCoV, TheiaProk, TheiaEuk)
- Phylogenetic Analysis
- Data Import/Export
- Utilities
- Submission Workflows

b) Task Layer
- Tasks by function:
- Alignment
- Assembly
- Gene Typing
- Quality Control
- Species Typing
- Taxon ID
- Utilities

c) Infrastructure Layer
- WDL Runtime Environment
- Terra.bio Platform Support
- Cromwell/miniWDL Support
- Docker Container Integration

##### Relationships

a) Workflow Dependencies
- How workflows inherit from and utilize tasks
- Data flow between workflow components
- Shared resources and utilities

b) Platform Integration
- Terra.bio integration points
- Local execution paths
- Container orchestration

##### Design Elements

Use the following visual elements:
- Rectangles: Main workflow components
- Rounded rectangles: Tasks
- Hexagons: External services/platforms

- Blue: Core workflows (TheiaCoV, TheiaProk, TheiaEuk)
- Green: Utility functions
- Orange: External integrations
- Purple: Quality control components
- Gray: Infrastructure components

##### Hierarchy Levels

Level 1 (Top): Main Workflow Categories
**[Genomic Characterization] -- [Phylogenetic Analysis] -- [Data Management]**

- v                          v                         v
**Level 2: Specific Workflows (TheiaCoV, TheiaProk, etc.)**

Level 3: Task Categories
**[Alignment] -- [Assembly] -- [Quality Control] -- [Species Typing]**

Level 4: Individual Tasks
**[task_bwa] -- [task_minimap2] -- [task_mafft]**

##### Notes

- Use clear labeling for all components
- Version information where relevant
- Annotations for critical paths and decision points

This system design should be implemented using a professional diagramming tool that supports:
- Hierarchical layouts
- Export to various formats
- Version control integration
- Collaborative editing

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Layers
    subgraph WF["Workflow Layer"]
        GC["Genomic Characterization"]
        PA["Phylogenetic Analysis"]
        DM["Data Management"]
    end

    subgraph TL["Task Layer"]
        AL["Alignment"]
        AS["Assembly"]
        GT["Gene Typing"]
        QC["Quality Control"]
        ST["Species Typing"]
        TI["Taxon ID"]
        UT["Utilities"]
    end

    subgraph IL["Infrastructure Layer"]
        WRE["WDL Runtime"]
        TBS["Terra.bio Support"]
        CMS["Cromwell Support"]
        DCI["Docker Integration"]
        TF["Testing Framework"]
        DOC["Documentation"]
        CI["CI/CD Pipelines"]
    end

    %% Genomic Characterization Workflows
    subgraph GCW["Genomic Characterization Workflows"]
        TC["TheiaCoV"]
        TP["TheiaProk"]
        TE["TheiaEuk"]
        TM["TheiaMeta"]
    end

    %% Quality Control Components
    subgraph QCC["Quality Control Components"]
        BS["Basic Statistics"]
        AM["Advanced Metrics"]
        CP["Comparisons"]
    end

    %% Data Management Components
    subgraph DMC["Data Management Components"]
        DI["Data Import"]
        DE["Data Export"]
        SB["Submission"]
        FH["File Handling"]
        DH["Data Handling"]
        VAL["Validation"]
    end

    %% Relationships
    GC --> GCW
    GCW --> TL
    PA --> TL
    DM --> DMC
    DMC --> TL
    QC --> QCC

    %% Infrastructure Connections
    TL --> IL
    WF --> IL

    %% Click Events
    click TC "https://github.com/theiagen/public_health_bioinformatics/tree/main/workflows/theiacov/"
    click TP "https://github.com/theiagen/public_health_bioinformatics/tree/main/workflows/theiaprok/"
    click TE "https://github.com/theiagen/public_health_bioinformatics/tree/main/workflows/theiaeuk/"
    click TM "https://github.com/theiagen/public_health_bioinformatics/tree/main/workflows/theiameta/"
    click PA "https://github.com/theiagen/public_health_bioinformatics/tree/main/workflows/phylogenetics/"
    click AL "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/alignment/"
    click AS "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/assembly/"
    click GT "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/gene_typing/"
    click QC "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/quality_control/"
    click ST "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/species_typing/"
    click TI "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/taxon_id/"
    click DI "https://github.com/theiagen/public_health_bioinformatics/tree/main/workflows/utilities/data_import/"
    click DE "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/utilities/data_export/"
    click SB "https://github.com/theiagen/public_health_bioinformatics/tree/main/workflows/submission/"
    click FH "https://github.com/theiagen/public_health_bioinformatics/tree/main/workflows/utilities/file_handling/"
    click DH "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/utilities/data_handling/"
    click TF "https://github.com/theiagen/public_health_bioinformatics/tree/main/tests/"
    click DOC "https://github.com/theiagen/public_health_bioinformatics/tree/main/docs/"
    click CI "https://github.com/theiagen/public_health_bioinformatics/tree/main/.github/workflows/"
    click BS "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/quality_control/basic_statistics/"
    click AM "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/quality_control/advanced_metrics/"
    click CP "https://github.com/theiagen/public_health_bioinformatics/tree/main/tasks/quality_control/comparisons/"
    click VAL "https://github.com/theiagen/public_health_bioinformatics/blob/main/workflows/utilities/wf_theiavalidate.wdl"

    %% Styling
    classDef workflow fill:#2374ab
    classDef task fill:#48a9a6
    classDef infra fill:#4a4e69
    classDef qc fill:#9c89b8
    classDef data fill:#f4845f

    class GC,PA,DM,GCW,TC,TP,TE,TM workflow
    class AL,AS,GT,QC,ST,TI,UT,TL task
    class WRE,TBS,CMS,DCI,TF,DOC,CI infra
    class BS,AM,CP,QCC qc
    class DI,DE,SB,FH,DH,VAL,DMC data
```
