# 8packcoder/sequenceanalysistool architecture

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

- Interactive diagram: https://gitdiagram.com/8packcoder/sequenceanalysistool
- Repository: https://github.com/8packcoder/sequenceanalysistool

## Overview

##### Project Type and Purpose
- This is a desktop, monolithic Java application with a graphical user interface (GUI) built on JavaFX.
- Purpose: allow students and researchers to perform sequence transcription, translation, alignment, motif finding, and reverse transcription in a lightweight, self-contained tool.

##### File Structure
- Top-level artifacts:
- pom.xml (build & dependency management via Maven)
- src/Main.java (application entry point)
- src/SequenceAnalysisToolWithAPI.java (entry point with optional external API integration)
- No backend/server folders; everything lives client-side.
- No database or persistence layer—sequence data flows in memory.

##### Extract Key Insights from README
- GUI: JavaFX
- Core bioinformatics logic: DNA→RNA, RNA→Protein, motif search, alignment
- Optional external API support in SequenceAnalysisToolWithAPI
- No mention of file storage or DB; purely in-memory processing.

##### Main Components
a. Presentation Layer (JavaFX GUI)
- Windows / Scenes / Controls (text areas, buttons, menus)
- Event Dispatch / Controller classes
b. Application Core (Business Logic)
- TranscriptionService
- TranslationService
- ReverseTranscriptionService
- MotifFinderService
- SequenceAlignmentService
c. Entry Points
- Main (loads JavaFX application)
- SequenceAnalysisToolWithAPI (wraps GUI + optional HTTP client for external services)
d. External Services (optional)
- REST API endpoints for heavy computation (if SequenceAnalysisToolWithAPI is used)
e. Build & Runtime Environment
- Maven (pom.xml)
- JDK + JavaFX runtime

##### Relationships & Data Flow
- User interacts with GUI → Controller receives events → invokes Core Services → processes input sequence → returns result → GUI updates.
- If external API mode is enabled: Core Service delegates heavy tasks to REST API client → receives JSON result → maps back into model → GUI.

##### Architectural Patterns & Principles
- MVC (Model-View-Controller):
- View: JavaFX FXML or code-based scenes
- Controller: event handlers in Main / SequenceAnalysisToolWithAPI
- Model/Services: Java classes encapsulating sequence operations
- Single-process, in-memory processing
- Dependency management via Maven

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"]:::ui
    User --> GUI["JavaFX GUI Layer"]:::ui
    GUI --> Controllers["Controllers (Event Handlers)"]:::ui
    Controllers --> Transcr["TranscriptionService"]:::service
    Transcr --> Transl["TranslationService"]:::service
    Transl --> RevTrans["ReverseTranscriptionService"]:::service
    RevTrans --> Motif["MotifFinderService"]:::service
    Motif --> Align["SequenceAlignmentService"]:::service
    Align --> InMem["In-Memory Data Structures"]:::service
    Align --> HTTPClient["Optional HTTP Client"]:::service
    HTTPClient --> ExternalAPI["External Bioinformatics API"]:::external
    InMem --> Results["Processed Results"]:::service
    Results --> GUI

    Main["Main.java"]:::ui
    APIEntry["SequenceAnalysisToolWithAPI.java"]:::ui
    Main --> GUI
    APIEntry --> GUI
    APIEntry --> HTTPClient

    subgraph "Infrastructure"
        Pom["Maven (pom.xml)"]:::infra
        Manifest["JAR Manifest (META-INF/MANIFEST.MF)"]:::infra
        JAR["JAR Artifact"]:::infra
        JDK["JDK & JavaFX Runtime"]:::infra
    end
    Pom --> Manifest
    Pom --> JAR
    JAR --> Main
    JAR --> APIEntry

    classDef ui fill:#D6EAF8,stroke:#2980B9,color:#2980B9
    classDef service fill:#D5F5E3,stroke:#27AE60,color:#27AE60
    classDef external fill:#FCF3CF,stroke:#F1C40F,color:#A04000
    classDef infra fill:#E5E7E9,stroke:#7F8C8D,color:#2C3E50

    click Main "https://github.com/8packcoder/sequenceanalysistool/blob/master/src/Main.java"
    click APIEntry "https://github.com/8packcoder/sequenceanalysistool/blob/master/src/SequenceAnalysisToolWithAPI.java"
    click Pom "https://github.com/8packcoder/sequenceanalysistool/blob/master/pom.xml"
    click Manifest "https://github.com/8packcoder/sequenceanalysistool/blob/master/META-INF/MANIFEST.MF"
```
