# cathalmills/peru_dengue_province architecture

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

- Interactive diagram: https://gitdiagram.com/cathalmills/peru_dengue_province
- Repository: https://github.com/cathalmills/peru_dengue_province

## Overview

This repository supports dengue epidemic analysis and forecasting, with a Streamlit dashboard for exploring model outputs. The documented workflow is data download, preprocessing, then forecasting; the tree also shows covariate extraction and ensemble modelling capabilities. The dashboard reads prediction and analysis files for maps, province time series, model summaries, and interval scores. Source excerpts do not include the Snakemake rules or most analysis scripts, so internal stage connections beyond the README’s pipeline description are not asserted.

Main entry points: [`workflows/forecasting`](https://github.com/cathalmills/peru_dengue_province/tree/main/workflows/forecasting) (Forecast workflow), [`dashboard/streamlit/app.py`](https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/app.py) (Dashboard entry), [`workflows/Snakefile`](https://github.com/cathalmills/peru_dengue_province/blob/main/workflows/Snakefile) (Pipeline runner), [`workflows/datasets`](https://github.com/cathalmills/peru_dengue_province/tree/main/workflows/datasets) (Data acquisition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Analysis pipeline"]
  node_snakemake["Pipeline runner"]
  node_forecast_workflow["Forecast workflow"]
end

subgraph group_data["Data preparation"]
  node_download["Data acquisition"]
  node_source_data["Provided data"]
  node_case_processing["Case processing<br/>[case_data.R]"]
  node_climate_processing["Climate processing<br/>[climate.R]"]
  node_covariates["Covariate extraction<br/>[extract_covars.R]"]
end

subgraph group_models["Forecast modelling"]
  node_baseline["Baseline forecasts"]
  node_bayesian["Bayesian forecasts<br/>[forecast_bayes.R]"]
  node_sarima["SARIMA forecasts<br/>[forecast_sarima.py]"]
  node_tcn["TCN forecasts<br/>[forecast_tcn.py]"]
  node_timegpt["TimeGPT forecasts"]
  node_ensemble["Ensemble training"]
end

subgraph group_dashboard["Results dashboard"]
  node_dashboard_app["Dashboard entry<br/>[app.py]"]
  node_map["Prediction map<br/>[Map.py]"]
  node_provinces["Province trends<br/>[Provinces.py]"]
  node_summary["Model summary<br/>[Summary.py]"]
  node_scores["Interval scores<br/>[Scores.py]"]
end

node_analyst(("Analyst"))
node_data_sources(("External data sources"))

node_analyst -->|"runs targets"| node_snakemake
node_snakemake -->|"runs data download"| node_download
node_snakemake -->|"runs preprocessing"| node_case_processing
node_snakemake -->|"runs forecasting"| node_forecast_workflow
node_data_sources -->|"provides datasets"| node_download
node_source_data -->|"required inputs"| node_snakemake
node_forecast_workflow -.->|"dispatches"| node_baseline
node_forecast_workflow -.->|"dispatches"| node_bayesian
node_forecast_workflow -.->|"dispatches"| node_sarima
node_forecast_workflow -.->|"dispatches"| node_tcn
node_forecast_workflow -.->|"dispatches"| node_timegpt
node_forecast_workflow -.->|"dispatches"| node_ensemble
node_analyst -.->|"opens dashboard"| node_dashboard_app
node_dashboard_app -.->|"serves page"| node_map
node_dashboard_app -.->|"serves page"| node_provinces
node_dashboard_app -.->|"serves page"| node_summary
node_dashboard_app -.->|"serves page"| node_scores

click node_snakemake "https://github.com/cathalmills/peru_dengue_province/blob/main/workflows/Snakefile"
click node_download "https://github.com/cathalmills/peru_dengue_province/tree/main/workflows/datasets"
click node_source_data "https://github.com/cathalmills/peru_dengue_province/tree/main/data"
click node_case_processing "https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/processing/case_data.R"
click node_climate_processing "https://github.com/cathalmills/peru_dengue_province/blob/main/workflows/processing/climate/workflow/scripts/climate.R"
click node_covariates "https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/covars/extract_covars.R"
click node_baseline "https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/forecasting/forecast_baseline.R"
click node_bayesian "https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/forecasting/forecast_bayes.R"
click node_sarima "https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/forecasting/forecast_sarima.py"
click node_tcn "https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/forecasting/forecast_tcn.py"
click node_timegpt "https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/forecasting/forecast_timegpt.py"
click node_ensemble "https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/ensemble/funcs/iteratively_train_quantile_ensemble_by_province.R"
click node_forecast_workflow "https://github.com/cathalmills/peru_dengue_province/tree/main/workflows/forecasting"
click node_dashboard_app "https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/app.py"
click node_map "https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/pages/Map.py"
click node_provinces "https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/pages/Provinces.py"
click node_summary "https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/pages/Summary.py"
click node_scores "https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/pages/Scores.py"

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_snakemake,node_forecast_workflow toneBlue
class node_download,node_source_data,node_case_processing,node_climate_processing,node_covariates toneAmber
class node_baseline,node_bayesian,node_sarima,node_tcn,node_timegpt,node_ensemble toneMint
class node_dashboard_app,node_map,node_provinces,node_summary,node_scores toneRose
class node_analyst,node_data_sources toneIndigo
```

## Components

### Analysis pipeline

- [Pipeline runner](https://github.com/cathalmills/peru_dengue_province/blob/main/workflows/Snakefile): `workflows/Snakefile`
- [Forecast workflow](https://github.com/cathalmills/peru_dengue_province/tree/main/workflows/forecasting): `workflows/forecasting`

### Data preparation

- [Data acquisition](https://github.com/cathalmills/peru_dengue_province/tree/main/workflows/datasets): `workflows/datasets`
- [Provided data](https://github.com/cathalmills/peru_dengue_province/tree/main/data): `data`
- [Case processing](https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/processing/case_data.R): `scripts/processing/case_data.R`
- [Climate processing](https://github.com/cathalmills/peru_dengue_province/blob/main/workflows/processing/climate/workflow/scripts/climate.R): `workflows/processing/climate/workflow/scripts/climate.R`
- [Covariate extraction](https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/covars/extract_covars.R): `scripts/covars/extract_covars.R`

### Forecast modelling

- [Baseline forecasts](https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/forecasting/forecast_baseline.R): `scripts/forecasting/forecast_baseline.R`
- [Bayesian forecasts](https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/forecasting/forecast_bayes.R): `scripts/forecasting/forecast_bayes.R`
- [SARIMA forecasts](https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/forecasting/forecast_sarima.py): `scripts/forecasting/forecast_sarima.py`
- [TCN forecasts](https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/forecasting/forecast_tcn.py): `scripts/forecasting/forecast_tcn.py`
- [TimeGPT forecasts](https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/forecasting/forecast_timegpt.py): `scripts/forecasting/forecast_timegpt.py`
- [Ensemble training](https://github.com/cathalmills/peru_dengue_province/blob/main/scripts/ensemble/funcs/iteratively_train_quantile_ensemble_by_province.R): `scripts/ensemble/funcs/iteratively_train_quantile_ensemble_by_province.R`

### Results dashboard

- [Dashboard entry](https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/app.py): `dashboard/streamlit/app.py`
- [Prediction map](https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/pages/Map.py): `dashboard/streamlit/pages/Map.py`
- [Province trends](https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/pages/Provinces.py): `dashboard/streamlit/pages/Provinces.py`
- [Model summary](https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/pages/Summary.py): `dashboard/streamlit/pages/Summary.py`
- [Interval scores](https://github.com/cathalmills/peru_dengue_province/blob/main/dashboard/streamlit/pages/Scores.py): `dashboard/streamlit/pages/Scores.py`

### Other components

- **Analyst**
- **External data sources**

## Connections

- Analyst → Pipeline runner: runs targets (evidence: `README.md`)
- Pipeline runner → Data acquisition: runs data download (evidence: `README.md`)
- Pipeline runner → Case processing: runs preprocessing (evidence: `README.md`)
- Pipeline runner → Forecast workflow: runs forecasting (evidence: `README.md`)
- External data sources → Data acquisition: provides datasets (evidence: `README.md`)
- Provided data → Pipeline runner: required inputs (evidence: `README.md`)
- Forecast workflow → Baseline forecasts: dispatches
- Forecast workflow → Bayesian forecasts: dispatches
- Forecast workflow → SARIMA forecasts: dispatches
- Forecast workflow → TCN forecasts: dispatches
- Forecast workflow → TimeGPT forecasts: dispatches
- Forecast workflow → Ensemble training: dispatches
- Analyst → Dashboard entry: opens dashboard
- Dashboard entry → Prediction map: serves page
- Dashboard entry → Province trends: serves page
- Dashboard entry → Model summary: serves page
- Dashboard entry → Interval scores: serves page
