# tomasdemelo/ww-genotyper architecture

> Architecture diagram of the GitHub repository tomasdemelo/ww-genotyper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tomasdemelo/ww-genotyper
- Repository: https://github.com/tomasdemelo/ww-genotyper

## Overview

WW-Genotyper processes wastewater sequence data into EV/NV genotypes and a longitudinal summary report. The documented workflow begins with FASTQ preprocessing, then analyzes combined FASTA sequences against reference databases, incorporates viral-load data, and reports abundance, mutation, and statistical results. The README also describes an optional ESM-2 mutation-scoring integration. The R scripts and shell scripts were not excerpted, so detailed internal calls and sequencing are not asserted; the main links below are supported by README statements.

Main entry points: [`WW_Genotyper-v11.R`](https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R) (EV/NV genotyper), [`example_data`](https://github.com/tomasdemelo/ww-genotyper/tree/main/example_data) (Combined FASTA), [`FASTA-seq_condenser.sh`](https://github.com/tomasdemelo/ww-genotyper/blob/main/FASTA-seq_condenser.sh) (FASTA condenser), [`EVminimap2.sh`](https://github.com/tomasdemelo/ww-genotyper/blob/main/EVminimap2.sh) (EV mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Sequence preprocessing"]
  node_fasta_condenser["FASTA condenser"]
  node_ev_mapping["EV mapping<br/>[EVminimap2.sh]"]
  node_nv_mapping["NV mapping<br/>[NVminimap2.sh]"]
end

subgraph group_analysis["Genotyping analysis"]
  node_ev_genotyper["EV/NV genotyper<br/>[WW_Genotyper-v11.R]"]
  node_windows_genotyper["Windows genotyper"]
  node_validation["Validation analysis"]
  node_genotype_results["Genotypes and variants<br/>[WW_Genotyper-v11.R]"]
  node_abundance["Abundance normalization<br/>[WW_Genotyper-v11.R]"]
  node_longitudinal_stats["Longitudinal statistics<br/>[WW_Genotyper-v11.R]"]
end

subgraph group_triage["Mutation triage"]
  node_mutation_scoring["ESM-2 scoring<br/>[score_mutation.py]"]
  node_esm_model["ESM-2 model"]
end

subgraph group_results["Results and inputs"]
  node_combined_sequences["Combined FASTA"]
  node_reference_sequences[("Reference sequences")]
  node_qpcr_data["RT-qPCR data<br/>[RT-qPCR_data.xlsx]"]
  node_summary_report["Summary report<br/>[WW_Genotyper-v11.R]"]
end

node_researcher(("Analyst"))

node_researcher -->|"preprocesses reads"| node_fasta_condenser
node_researcher -->|"preprocesses reads"| node_ev_mapping
node_researcher -->|"preprocesses reads"| node_nv_mapping
node_fasta_condenser -->|"produces sequences"| node_combined_sequences
node_ev_mapping -->|"produces sequences"| node_combined_sequences
node_nv_mapping -->|"produces sequences"| node_combined_sequences
node_researcher -->|"runs analysis"| node_ev_genotyper
node_combined_sequences -->|"analyzed by"| node_ev_genotyper
node_reference_sequences -->|"reference database"| node_ev_genotyper
node_qpcr_data -->|"viral-load input"| node_ev_genotyper
node_researcher -->|"runs on Windows"| node_windows_genotyper
node_researcher -.->|"validates genotyping"| node_validation
node_ev_genotyper -->|"calls genotypes"| node_genotype_results
node_ev_genotyper -->|"normalizes abundance"| node_abundance
node_ev_genotyper -->|"models trends"| node_longitudinal_stats
node_ev_genotyper -->|"scores variants"| node_mutation_scoring
node_mutation_scoring -->|"loads model"| node_esm_model
node_ev_genotyper -->|"generates report"| node_summary_report

click node_fasta_condenser "https://github.com/tomasdemelo/ww-genotyper/blob/main/FASTA-seq_condenser.sh"
click node_ev_mapping "https://github.com/tomasdemelo/ww-genotyper/blob/main/EVminimap2.sh"
click node_nv_mapping "https://github.com/tomasdemelo/ww-genotyper/blob/main/NVminimap2.sh"
click node_combined_sequences "https://github.com/tomasdemelo/ww-genotyper/tree/main/example_data"
click node_ev_genotyper "https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R"
click node_windows_genotyper "https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11_Windows.R"
click node_validation "https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v2_Validation.R"
click node_reference_sequences "https://github.com/tomasdemelo/ww-genotyper/tree/main/references"
click node_qpcr_data "https://github.com/tomasdemelo/ww-genotyper/blob/main/RT-qPCR_data.xlsx"
click node_genotype_results "https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R"
click node_abundance "https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R"
click node_longitudinal_stats "https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R"
click node_mutation_scoring "https://github.com/tomasdemelo/ww-genotyper/blob/main/score_mutation.py"
click node_summary_report "https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fasta_condenser,node_ev_mapping,node_nv_mapping toneBlue
class node_ev_genotyper,node_windows_genotyper,node_validation,node_genotype_results,node_abundance,node_longitudinal_stats toneAmber
class node_mutation_scoring,node_esm_model toneMint
class node_combined_sequences,node_reference_sequences,node_qpcr_data,node_summary_report toneRose
class node_researcher toneIndigo
```

## Components

### Sequence preprocessing

- [FASTA condenser](https://github.com/tomasdemelo/ww-genotyper/blob/main/FASTA-seq_condenser.sh): `FASTA-seq_condenser.sh`
- [EV mapping](https://github.com/tomasdemelo/ww-genotyper/blob/main/EVminimap2.sh): `EVminimap2.sh`
- [NV mapping](https://github.com/tomasdemelo/ww-genotyper/blob/main/NVminimap2.sh): `NVminimap2.sh`

### Genotyping analysis

- [EV/NV genotyper](https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R): `WW_Genotyper-v11.R`
- [Windows genotyper](https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11_Windows.R): `WW_Genotyper-v11_Windows.R`
- [Validation analysis](https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v2_Validation.R): `WW_Genotyper-v2_Validation.R`
- [Genotypes and variants](https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R): `WW_Genotyper-v11.R`
- [Abundance normalization](https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R): `WW_Genotyper-v11.R`
- [Longitudinal statistics](https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R): `WW_Genotyper-v11.R`

### Mutation triage

- [ESM-2 scoring](https://github.com/tomasdemelo/ww-genotyper/blob/main/score_mutation.py): `score_mutation.py`
- **ESM-2 model**

### Results and inputs

- [Combined FASTA](https://github.com/tomasdemelo/ww-genotyper/tree/main/example_data): `example_data`
- [Reference sequences](https://github.com/tomasdemelo/ww-genotyper/tree/main/references): `references`
- [RT-qPCR data](https://github.com/tomasdemelo/ww-genotyper/blob/main/RT-qPCR_data.xlsx): `RT-qPCR_data.xlsx`
- [Summary report](https://github.com/tomasdemelo/ww-genotyper/blob/main/WW_Genotyper-v11.R): `WW_Genotyper-v11.R`

### Other components

- **Analyst**

## Connections

- Analyst → FASTA condenser: preprocesses reads (evidence: `README.md`)
- Analyst → EV mapping: preprocesses reads (evidence: `README.md`)
- Analyst → NV mapping: preprocesses reads (evidence: `README.md`)
- FASTA condenser → Combined FASTA: produces sequences (evidence: `README.md`)
- EV mapping → Combined FASTA: produces sequences (evidence: `README.md`)
- NV mapping → Combined FASTA: produces sequences (evidence: `README.md`)
- Analyst → EV/NV genotyper: runs analysis (evidence: `README.md`)
- Combined FASTA → EV/NV genotyper: analyzed by (evidence: `README.md`)
- Reference sequences → EV/NV genotyper: reference database (evidence: `README.md`)
- RT-qPCR data → EV/NV genotyper: viral-load input (evidence: `README.md`)
- Analyst → Windows genotyper: runs on Windows (evidence: `README.md`)
- Analyst → Validation analysis: validates genotyping
- EV/NV genotyper → Genotypes and variants: calls genotypes (evidence: `README.md`)
- EV/NV genotyper → Abundance normalization: normalizes abundance (evidence: `README.md`)
- EV/NV genotyper → Longitudinal statistics: models trends (evidence: `README.md`)
- EV/NV genotyper → ESM-2 scoring: scores variants (evidence: `README.md`)
- ESM-2 scoring → ESM-2 model: loads model (evidence: `score_mutation.py`)
- EV/NV genotyper → Summary report: generates report (evidence: `README.md`)
