# kevin-wamae/wgs-amplicon-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/kevin-wamae/wgs-amplicon-analysis
- Repository: https://github.com/kevin-wamae/wgs-amplicon-analysis

## Overview

##### Main Components

A. Input Layer:
- Two distinct sequencing data sources:
- Illumina Amplicon Data
- Nanopore Amplicon Data
- Resources-genome directory containing reference data:
- BED files
- Protein FASTA files

B. Processing Workflows (3 parallel pipelines):
- BCFtools Workflow (Illumina)
- NanoRave Workflow (Nanopore)
- SeekDeep Workflow (Both platforms)

C. Analysis Modules (from wf-seekdeep-amplicon):
- Quality Control Module
- Sequence Clusters Module
- Variant Analysis Module (SNPs and Haplotypes)
- Study-Related Processing Module

**[Input Data Sources] → [Processing Workflows] → [Analysis Modules] → [Output Results]**

##### Key Relationships to Highlight

- Data flow from both sequencing platforms into their respective workflows
- Demonstrate how the SeekDeep workflow can process both types of input data
- Hierarchical relationship in the analysis modules:
- Quality Control → Sequence Clusters → Variant Analysis
- Study-Related Processing as a parallel module

##### Technical Details

- R version requirement (4.0.0+)
- Key R package dependencies (tidyverse, data.table, janitor)
- File format specifications (BED, FASTA)
- Input/Output data formats

##### Notes for Implementation

- Keep the main workflow paths clear and uncluttered
- Version information for key components
- Notes about scalability and parallel processing capabilities
- Error handling or quality check points

## Diagram (Mermaid)

```mermaid
graph TB
    %% Input Layer
    subgraph Input
        IL[Illumina Amplicon Data]:::input
        NP[Nanopore Amplicon Data]:::input
        subgraph Resources["Reference Resources"]
            GR["Genome Resources"]:::resource
            PR["Protein References"]:::resource
            GC["Genome Coordinates"]:::resource
        end
    end

    %% Processing Workflows Layer
    subgraph Workflows["Processing Workflows"]
        BCF["BCFtools Workflow"]:::workflow
        NRW["NanoRave Workflow"]:::workflow
        SDK["SeekDeep Workflow"]:::workflow
    end

    %% Analysis Modules Layer
    subgraph Analysis["Analysis Modules"]
        subgraph QC["Quality Control"]
            QCI["Illumina QC"]:::module
            QCN["Nanopore QC"]:::module
        end
        
        subgraph SC["Sequence Clusters"]
            AGG["Cluster Aggregation"]:::module
            FIL["Cluster Filtering"]:::module
        end
        
        subgraph VA["Variant Analysis"]
            SNP["SNP Analysis"]:::module
            HAP["Haplotype Analysis"]:::module
            RES["Resistance Profiling"]:::module
        end
        
        SRP["Study-Related Processing"]:::module
    end

    %% Output Layer
    OUT[("Final Analysis Results")]:::output

    %% Relationships
    IL --> BCF & SDK
    NP --> NRW & SDK
    GR --> BCF & NRW & SDK
    PR --> BCF & NRW & SDK
    GC --> BCF & NRW & SDK
    
    BCF & NRW & SDK --> QC
    QCI & QCN --> SC
    AGG --> FIL
    SC --> VA
    SNP & HAP --> RES
    VA --> SRP
    SRP --> OUT

    %% Styling
    classDef input fill:#a8d1f0
    classDef resource fill:#d3d3d3
    classDef workflow fill:#90EE90
    classDef module fill:#FFB347
    classDef output fill:#DDA0DD

    %% Click Events
    click GR "https://github.com/kevin-wamae/wgs-amplicon-analysis/tree/main/resources-genome/"
    click PR "https://github.com/kevin-wamae/wgs-amplicon-analysis/tree/main/resources-genome/fasta-protein/"
    click GC "https://github.com/kevin-wamae/wgs-amplicon-analysis/blob/main/resources-genome/bed/Pf3D7_v51.bed"
    click BCF "https://github.com/kevin-wamae/wgs-amplicon-analysis/blob/main/wf-bcftools-illumina-amplicon/scripts/main-bcftools.R"
    click NRW "https://github.com/kevin-wamae/wgs-amplicon-analysis/blob/main/wf-nanorave-nanopore-amplicon/scripts/main-nanopore.R"
    click SDK "https://github.com/kevin-wamae/wgs-amplicon-analysis/blob/main/wf-seekdeep-amplicon/scripts/main-seekdeep.R"
    click QCI "https://github.com/kevin-wamae/wgs-amplicon-analysis/blob/main/wf-seekdeep-amplicon/scripts/functions/quality-control/qc-extraction-illumina.R"
    click QCN "https://github.com/kevin-wamae/wgs-amplicon-analysis/blob/main/wf-seekdeep-amplicon/scripts/functions/quality-control/qc-extraction-nanopore.R"
    click AGG "https://github.com/kevin-wamae/wgs-amplicon-analysis/blob/main/wf-seekdeep-amplicon/scripts/functions/sequence-clusters/clusters-aggregate.R"
    click FIL "https://github.com/kevin-wamae/wgs-amplicon-analysis/blob/main/wf-seekdeep-amplicon/scripts/functions/sequence-clusters/clusters-filter.R"
    click SNP "https://github.com/kevin-wamae/wgs-amplicon-analysis/tree/main/wf-seekdeep-amplicon/scripts/functions/var-snps/"
    click HAP "https://github.com/kevin-wamae/wgs-amplicon-analysis/tree/main/wf-seekdeep-amplicon/scripts/functions/var-haplotype/"
    click RES "https://github.com/kevin-wamae/wgs-amplicon-analysis/blob/main/wf-seekdeep-amplicon/scripts/functions/var-snps/sp-resistance-profile.R"
    click SRP "https://github.com/kevin-wamae/wgs-amplicon-analysis/tree/main/wf-seekdeep-amplicon/scripts/functions/study-related/"
```
