# happykhan/speccheck architecture

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

## Overview

##### Project Type Analysis
This is a specialized Python-based bioinformatics tool focused on quality control using species criteria. The project follows a modular architecture with distinct components for different types of analyses.

##### Main Components

a. Core Components:
- Main Application Entry Point (speccheck.py)
- Data Collection Module (collect.py)
- Criteria Management (criteria.py)
- Report Generation (report.py)

b. Analysis Modules:
- CheckM Module (modules/checkm.py)
- QUAST Module (modules/quast.py)
- Speciator Module (modules/speciator.py)

c. Visualization Components:
- Plot Modules for each analysis type
- plot_checkm.py
- plot_quast.py
- plot_speciator.py

d. External Dependencies:
- Docker Container Runtime
- Python Environment (≥3.10)

##### Specific Implementation Details

a. Data flow:
- Input data → Collection Module
- Collection Module → Analysis Modules
- Analysis Modules → Plot Modules
- All components → Report Generator

b. Integration points:
- Docker runtime environment
- File system interactions
- Template rendering system

c. Configuration:
- Criteria file integration
- Module configuration options

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Docker["Docker Container Environment"]
        direction TB
        Entry["Main Entry Point"]:::core
        click Entry "https://github.com/happykhan/speccheck/blob/main/speccheck/main.py"
        
        subgraph CoreLayer["Core Processing Layer"]
            direction TB
            Collect["Data Collection"]:::core
            click Collect "https://github.com/happykhan/speccheck/blob/main/speccheck/collect.py"
            Criteria["Criteria Management"]:::core
            click Criteria "https://github.com/happykhan/speccheck/blob/main/speccheck/criteria.py"
            CriteriaConfig[(Criteria Config)]:::config
            click CriteriaConfig "https://github.com/happykhan/speccheck/blob/main/criteria.csv"
        end

        subgraph AnalysisLayer["Analysis Layer"]
            direction TB
            CheckM["CheckM Module"]:::analysis
            click CheckM "https://github.com/happykhan/speccheck/blob/main/speccheck/modules/checkm.py"
            QUAST["QUAST Module"]:::analysis
            click QUAST "https://github.com/happykhan/speccheck/blob/main/speccheck/modules/quast.py"
            Speciator["Speciator Module"]:::analysis
            click Speciator "https://github.com/happykhan/speccheck/blob/main/speccheck/modules/speciator.py"
        end

        subgraph VisualizationLayer["Visualization Layer"]
            direction TB
            PlotCheckM["CheckM Plot"]:::plot
            click PlotCheckM "https://github.com/happykhan/speccheck/blob/main/speccheck/plot_modules/plot_checkm.py"
            PlotQUAST["QUAST Plot"]:::plot
            click PlotQUAST "https://github.com/happykhan/speccheck/blob/main/speccheck/plot_modules/plot_quast.py"
            PlotSpeciator["Speciator Plot"]:::plot
            click PlotSpeciator "https://github.com/happykhan/speccheck/blob/main/speccheck/plot_modules/plot_speciator.py"
        end

        Report["Report Generator"]:::output
        click Report "https://github.com/happykhan/speccheck/blob/main/speccheck/report.py"
        Template["HTML Template"]:::template
        click Template "https://github.com/happykhan/speccheck/blob/main/templates/report.html"
    end

    Testing["Testing Framework"]:::testing
    click Testing "https://github.com/happykhan/speccheck/tree/main/tests/"
    CICD["CI/CD Pipeline"]:::cicd
    click CICD "https://github.com/happykhan/speccheck/blob/main/.github/workflows/run_pytest.yml"
    DockerFile["Dockerfile"]:::docker
    click DockerFile "https://github.com/happykhan/speccheck/tree/main/docker/Dockerfile"

    %% Connections
    Entry --> Collect
    Collect --> Criteria
    Criteria --> CriteriaConfig
    
    Collect --> CheckM & QUAST & Speciator
    
    CheckM --> PlotCheckM
    QUAST --> PlotQUAST
    Speciator --> PlotSpeciator
    
    PlotCheckM & PlotQUAST & PlotSpeciator --> Report
    Report --> Template

    %% External Connections
    DockerFile -.-> Docker
    Testing -.-> Docker
    CICD -.-> Testing

    %% Styling
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef analysis fill:#2ecc71,stroke:#27ae60,color:white
    classDef plot fill:#e67e22,stroke:#d35400,color:white
    classDef config fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef output fill:#9b59b6,stroke:#8e44ad,color:white
    classDef template fill:#34495e,stroke:#2c3e50,color:white
    classDef testing fill:#f1c40f,stroke:#f39c12,color:black
    classDef cicd fill:#e74c3c,stroke:#c0392b,color:white
    classDef docker fill:#1abc9c,stroke:#16a085,color:white
```
