# wewantsaul/findingnipah architecture

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

- Interactive diagram: https://gitdiagram.com/wewantsaul/findingnipah
- Repository: https://github.com/wewantsaul/findingnipah

## Overview

##### Main Components

a) Input/Output Components:
- Input data sources (Illumina paired-end sequencing files)
- Reference genome input
- Output directories for results
- Database components (NIPAH virus nucleotide and protein databases)

b) Processing Modules:
- Host genome indexing module
- Quality control module
- Alignment module
- Filtering module
- Assembly module
- BLAST search modules

##### Specific Components

a) Input Section:
- Paired-end FASTQ files
- Host reference genome
- NIPAH virus databases (both nucleotide and protein)

b) Pipeline Modules (in sequence):
##### Results Summarization

c) Database Section:
- Nipah nucleotide database
- Nipah protein database

##### Workflow Connections

- Double lines: Parallel processes

##### Key Elements to Highlight

a) Pipeline Parameters:
- Detection criteria (>100 nt/aa, E-value < 0.00001)
- Bit score thresholds (>100)

b) Docker Integration:
- Docker container boundary around processing modules

c) Nextflow Workflow Management:
- Workflow orchestration layer

##### Technical Details

a) Module Organization:
- Relationship between modules/ directory structure and workflow
- Configuration files (nextflow.config)

b) Support Scripts:
- Python scripts from bin/ directory
- Their interaction with main workflow

##### Additional Recommendations

- Version information and dependencies
- Error handling and recovery paths
- Resource requirements and scaling points

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        I1[("Paired-end FASTQ")]
        I2[("Host Reference")]
        I3[("NIPAH Databases")]
    end

    subgraph "Pipeline Orchestration"
        NF["Nextflow Config"]:::config
        MF["Main Workflow"]:::workflow
        IF["Index Workflow"]:::workflow
    end

    subgraph "Quality Control"
        QC["Fastp QC"]:::module
    end

    subgraph "Alignment & Processing"
        BWI["BWA Index"]:::module
        BWA["BWA Alignment"]:::module
        SAM["SAM Filter"]:::module
        S2F["SAM to FASTQ"]:::module
        SIN["Singleton Processing"]:::module
        BAM["BAM Statistics"]:::module
    end

    subgraph "Assembly & Detection"
        MEG["Megahit Assembly"]:::module
        BLN["BLASTN Search"]:::module
        BLX["BLASTX Search"]:::module
    end

    subgraph "Results Processing"
        SUM["Summary Generator"]:::script
        HTML["HTML Generator"]:::script
        COM["Combined Summary"]:::script
    end

    subgraph "Databases"
        NDB[("NIPAH Nucleotide DB")]:::database
        PDB[("NIPAH Protein DB")]:::database
    end

    %% Connections
    I1 --> QC
    I2 --> BWI
    I3 --> NDB & PDB
    
    NF --> MF & IF
    IF --> BWI
    
    QC --> BWA
    BWI --> BWA
    BWA --> SAM
    SAM --> S2F & BAM
    S2F --> SIN
    SIN --> MEG
    
    MEG --> BLN & BLX
    NDB --> BLN
    PDB --> BLX
    
    BLN & BLX --> SUM
    SUM --> HTML
    HTML --> COM

    %% Styles
    classDef module fill:#90EE90,stroke:#333,stroke-width:2px
    classDef workflow fill:#FFB6C1,stroke:#333,stroke-width:2px
    classDef script fill:#ADD8E6,stroke:#333,stroke-width:2px
    classDef database fill:#FFD700,stroke:#333,stroke-width:2px
    classDef config fill:#D3D3D3,stroke:#333,stroke-width:2px

    %% Click Events
    click MF "https://github.com/wewantsaul/findingNIPAH/blob/main/workflows/mainflow.nf"
    click IF "https://github.com/wewantsaul/findingNIPAH/blob/main/workflows/index.nf"
    click QC "https://github.com/wewantsaul/findingNIPAH/blob/main/modules/fastp.nf"
    click BWA "https://github.com/wewantsaul/findingNIPAH/blob/main/modules/bwamem.nf"
    click SAM "https://github.com/wewantsaul/findingNIPAH/blob/main/modules/samfilter.nf"
    click MEG "https://github.com/wewantsaul/findingNIPAH/blob/main/modules/megahit.nf"
    click BLN "https://github.com/wewantsaul/findingNIPAH/blob/main/modules/blastn.nf"
    click BLX "https://github.com/wewantsaul/findingNIPAH/blob/main/modules/blastx.nf"
    click SUM "https://github.com/wewantsaul/findingNIPAH/blob/main/bin/summarizer.py"
    click HTML "https://github.com/wewantsaul/findingNIPAH/blob/main/bin/htmlgenerator.py"
    click COM "https://github.com/wewantsaul/findingNIPAH/blob/main/bin/CombineSummary.py"
    click NDB "https://github.com/wewantsaul/findingNIPAH/tree/main/database/nipah_nuc_db"
    click PDB "https://github.com/wewantsaul/findingNIPAH/tree/main/database/nipah_prot_db"
    click BWI "https://github.com/wewantsaul/findingNIPAH/blob/main/modules/bwaindex.nf"
    click S2F "https://github.com/wewantsaul/findingNIPAH/blob/main/modules/samfastq.nf"
    click NF "https://github.com/wewantsaul/findingNIPAH/blob/main/nextflow.config"
    click SIN "https://github.com/wewantsaul/findingNIPAH/blob/main/modules/singletons.nf"
    click BAM "https://github.com/wewantsaul/findingNIPAH/blob/main/modules/bamstats.nf"
```
