# salipe/genomic-extractor architecture

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

## Overview

##### Project type and purpose
- This is an open-source, command-line and library-based computational genomics tool, implemented in Julia. Its purpose is to take one or more FASTA sequence files as input, slide k-mer windows across them, compute “exclusive” k-mers, and extract discriminative genomic regions for downstream analysis (entropy, convergence, classification). It also provides shell scripts, Jupyter notebooks, and Docker images for execution, benchmarking, and visualization.

##### File structure
- Top-level:
- GREAC/ – the Julia package and core pipeline
– Project.toml, Dockerfile, build scripts
– src/ – modules implementing each pipeline stage
- scripts/ – ready-made shell scripts for local or cluster execution
- comparison_scripts/ – data and scripts to compare against other tools
- notebooks/ – exploratory and reporting Jupyter notebooks
- dockerizing/ – early Docker/Kubernetes image build
- CI config, README, LICENSE, reports

##### README
- Confirms a modular Julia codebase under GREAC/src
- Highlights four main folders: src (core), scripts, notebooks, comparison_scripts, dockerizing
- No pre-drawn architecture, so we build from file layout

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Sources
    subgraph "Data Sources"
        FASTA["FASTA Input"]:::dataStore
        COMP["Comparison Data & Scripts"]:::script
    end

    %% Entry Points & Orchestration
    subgraph "Orchestration Layer"
        CLI["build_greac.jl"]:::script
        BUILD["build.sh"]:::script
        LOCAL["Local Execution Scripts"]:::script
        CLUSTER["Cluster Execution Scripts"]:::script
        DK_BUILDER["createk8image.sh"]:::script
    end

    %% Execution Environments
    subgraph "Execution Environments"
        LOCAL_ENV["Local Shell"]:::env
        CLUSTER_ENV["HPC Cluster"]:::env
        DOCKER_ENV["Docker Container"]:::env
    end

    %% Core Library Entry
    GREAC_ENTRY["GREAC.jl (Core Library Entry)"]:::core

    %% Core Modules
    subgraph "Core GREAC Modules"
        DataIO["DataIO"]:::core
        KmerUtils["KmerUtils"]:::core
        TransformUtils["TransformUtils"]:::core
        RegionExtraction["RegionExtraction"]:::core
        EntropyUtil["EntropyUtil"]:::core
        ConvergenceAnalysis["ConvergenceAnalysis"]:::core
        ClassificationModel["ClassificationModel"]:::core
    end

    %% Outputs & Reporting
    subgraph "Outputs & Reporting"
        REG_OUT["Region Outputs"]:::dataStore
        NOTEBOOKS["Jupyter Notebooks"]:::dataStore
        REPORT["Final Report (report.txt)"]:::dataStore
    end

    %% CI Workflow
    CI["Release Workflow"]:::script

    %% Flows
    FASTA -->|reads FASTA| DataIO
    COMP -->|alternative data| DataIO

    CLI --> GREAC_ENTRY
    BUILD --> GREAC_ENTRY
    LOCAL --> GREAC_ENTRY
    CLUSTER --> GREAC_ENTRY
    DK_BUILDER --> GREAC_ENTRY

    GREAC_ENTRY --> DataIO
    DataIO -->|generates k-mer table| KmerUtils
    KmerUtils -->|filters k-mers| TransformUtils
    TransformUtils -->|extracts windows| RegionExtraction
    RegionExtraction -->|scores regions| EntropyUtil
    RegionExtraction -->|scores regions| ConvergenceAnalysis
    EntropyUtil -->|inputs to model| ClassificationModel
    ConvergenceAnalysis -->|inputs to model| ClassificationModel
    ClassificationModel --> REG_OUT
    REG_OUT --> NOTEBOOKS
    NOTEBOOKS --> REPORT

    LOCAL --> LOCAL_ENV
    CLUSTER --> CLUSTER_ENV
    DK_BUILDER --> DOCKER_ENV

    CI --> BUILD

    %% Click Events
    click DataIO "https://github.com/salipe/genomic-extractor/blob/main/GREAC/src/modules/DataIO.jl"
    click KmerUtils "https://github.com/salipe/genomic-extractor/blob/main/GREAC/src/modules/KmerUtils.jl"
    click TransformUtils "https://github.com/salipe/genomic-extractor/blob/main/GREAC/src/modules/TransformUtils.jl"
    click RegionExtraction "https://github.com/salipe/genomic-extractor/blob/main/GREAC/src/modules/RegionExtraction.jl"
    click EntropyUtil "https://github.com/salipe/genomic-extractor/blob/main/GREAC/src/modules/EntropyUtil.jl"
    click ConvergenceAnalysis "https://github.com/salipe/genomic-extractor/blob/main/GREAC/src/modules/ConvergenceAnalysis.jl"
    click ClassificationModel "https://github.com/salipe/genomic-extractor/blob/main/GREAC/src/modules/ClassificationModel.jl"
    click GREAC_ENTRY "https://github.com/salipe/genomic-extractor/blob/main/GREAC/src/GREAC.jl"
    click CLI "https://github.com/salipe/genomic-extractor/blob/main/GREAC/build_greac.jl"
    click BUILD "https://github.com/salipe/genomic-extractor/blob/main/GREAC/build.sh"
    click LOCAL "https://github.com/salipe/genomic-extractor/blob/main/scripts/local/*.sh"
    click CLUSTER "https://github.com/salipe/genomic-extractor/blob/main/scripts/cl/*.sh"
    click DK_BUILDER "https://github.com/salipe/genomic-extractor/blob/main/dockerizing/createk8image.sh"
    click DOCKER_ENV "https://github.com/salipe/genomic-extractor/tree/main/GREAC/Dockerfile"
    click COMP "https://github.com/salipe/genomic-extractor/tree/main/comparison_scripts/castor_hiv_data/"
    click NOTEBOOKS "https://github.com/salipe/genomic-extractor/blob/main/notebooks/*.ipynb"
    click REPORT "https://github.com/salipe/genomic-extractor/blob/main/report.txt"
    click CI "https://github.com/salipe/genomic-extractor/blob/main/.github/workflows/release.yml"

    %% Styles
    classDef core fill:#BBDEFB,stroke:#0D47A1,color:#0D47A1
    classDef dataStore fill:#C8E6C9,stroke:#1B5E20,color:#1B5E20,stroke-dasharray: 5 5
    classDef script fill:#FFE0B2,stroke:#E65100,color:#E65100
    classDef env fill:#EEEEEE,stroke:#616161,color:#424242,stroke-dasharray: 2 2
```
