# martinghunt/tna architecture

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

## Overview

##### Main Components

a) User Interface Layer
- Main Menu Scene
- Game Scene (Main Visualization)
- Settings Scene
- Project Management Scenes (Load/Save)
- Init Scene

b) Core Logic Layer
- Genome Processing System
- BLAST Integration
- File Handling System
- Visualization Engine

c) Data Layer
- Project Data Management
- User Settings
- File System Integration

##### Key Relationships to Highlight

- Data flow from file input through BLAST processing to visualization
- Settings influence on visualization parameters
- Project data persistence flow

##### Technical Details

- File format support (.fasta, .fastq, .gff)
- BLAST integration point
- Data persistence mechanisms

##### Important Flows

a) Primary Use Flow:
Input Files → BLAST Processing → Data Processing → Visualization

b) Settings Flow:
User Settings → Visualization Parameters → Display Updates

c) Project Management Flow:
Save/Load → Project Data → Visualization State

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#9b59b6,stroke:#8e44ad,color:white
    classDef external fill:#f1c40f,stroke:#f39c12,color:black
    classDef file fill:#95a5a6,stroke:#7f8c8d,color:white

    %% UI Layer
    subgraph UI
        Init["Init Scene"]
        MainMenu["Main Menu"]
        Game["Game Scene"]
        Settings["Settings"]
        LoadProject["Load Project"]
        SaveProject["Save Project"]
    end

    %% Core Logic Layer
    subgraph CoreLogic
        GenomeProc["Genome Processing"]
        BlastInt["BLAST Integration"]
        FeatureMan["Feature Management"]
        FileHandler["File Handling"]
        GameControl["Game Controller"]
        MatchControl["Genome Matches Controller"]
    end

    %% Data Layer
    subgraph DataLayer
        ProjectData["Project Data"]
        UserSettings["User Settings"]
        ColorThemes["Color Themes"]
        FileSystem["File System"]
    end

    %% Relationships
    Init --> MainMenu
    MainMenu --> Game
    MainMenu --> Settings
    MainMenu --> LoadProject
    Game --> SaveProject
    
    Game --> GameControl
    GameControl --> GenomeProc
    GameControl --> MatchControl
    
    GenomeProc --> BlastInt
    BlastInt --> FileHandler
    FileHandler --> FileSystem
    
    Settings --> UserSettings
    UserSettings --> ColorThemes
    
    LoadProject --> ProjectData
    SaveProject --> ProjectData
    ProjectData --> FileSystem
    
    FeatureMan --> GenomeProc
    
    %% Click Events
    click Init "https://github.com/martinghunt/tna/blob/main/scenes/init/init.tscn"
    click MainMenu "https://github.com/martinghunt/tna/blob/main/scenes/main_menu/main_menu.tscn"
    click Game "https://github.com/martinghunt/tna/blob/main/scenes/game/game.tscn"
    click Settings "https://github.com/martinghunt/tna/blob/main/scenes/settings/settings.tscn"
    click LoadProject "https://github.com/martinghunt/tna/blob/main/scenes/load_project/load_project.tscn"
    click SaveProject "https://github.com/martinghunt/tna/blob/main/scenes/save_project/save_project.tscn"
    click GenomeProc "https://github.com/martinghunt/tna/tree/main/lib/genomes_n_matches/"
    click BlastInt "https://github.com/martinghunt/tna/blob/main/lib/blast.gd"
    click FeatureMan "https://github.com/martinghunt/tna/blob/main/lib/annot_feature.gd"
    click FileHandler "https://github.com/martinghunt/tna/blob/main/lib/fastaq.gd"
    click ProjectData "https://github.com/martinghunt/tna/blob/main/lib/project_data.gd"
    click UserSettings "https://github.com/martinghunt/tna/blob/main/lib/user_data.gd"
    click ColorThemes "https://github.com/martinghunt/tna/blob/main/lib/colour_themes.gd"
    click GameControl "https://github.com/martinghunt/tna/blob/main/scenes/game/game.gd"
    click MatchControl "https://github.com/martinghunt/tna/blob/main/scenes/genomes_n_matches/genomes_n_matches.gd"

    %% Style Applications
    class Init,MainMenu,Game,Settings,LoadProject,SaveProject ui
    class GenomeProc,BlastInt,FeatureMan,FileHandler,GameControl,MatchControl core
    class ProjectData,UserSettings,ColorThemes,FileSystem data
```
