Reproducible workflow to quantify HbS (HBB) differentiation across Ugandan subregions and test whether malaria burden and geography jointly align with locus-specific genetic structure. R pipeline, HWE/FIS, Weir–Cockerham FST, distance matrices (genetic, geographic, PfPR2–10), MMRR joint inference, PCoA/dbRDA, and Rousset IBD sensitivity analysis.
# Malaria burden and geographic distance jointly predict HbS differentiation in Uganda
## Table of Contents
- Overview
- Repository structure
- Data description
- Installation and environment setup
- Workflow 1: Data ingestion and subregion summaries
- Workflow 2: Differentiation and distance matrices
- Workflow 3: Primary joint inference (MMRR)
- Workflow 4: Secondary analyses (PCoA and dbRDA)
- Workflow 5: Sensitivity analyses (Mantel and Rousset)
- Workflow 6: Figures, tables, and report rendering
- Running the full pipeline
- How to cite
- License
- Contact information
---
## Overview
This repository contains code, configuration templates, and documentation to reproduce the analysis for:
**Malaria burden and geographic distance jointly predict HbS differentiation in Uganda**
We quantify locus-specific spatial structure at the sickle-cell variant (HbS) in **HBB** using haemoglobin genotype data aggregated to 15 Ugandan subregions. We then test whether pairwise differentiation aligns with malaria-burden dissimilarity (PfPR\(_{2–10}\)) after accounting for geographic separation.
Objectives:
- Summarize subregional genotype composition (HbAA, HbAS, HbSS) and HbS allele frequency.
- Quantify locus-specific differentiation using global and pairwise Weir–Cockerham \(F_{ST}\).
- Construct genetic, geographic, and malaria-burden dissimilarity matrices.
- Estimate independent associations of geographic distance and PfPR dissimilarity with HbS differentiation using multiple matrix regression with randomization (MMRR) (primary inference).
- Provide secondary multivariate summaries (PCoA, dbRDA) and sensitivity analyses (Mantel-family tests, Rousset IBD regression).
- Produce manuscript-ready tables and figures.
## Repository structure
```text
uganda-hbs-malaria-distance/
├── README.md
├── CITATION.cff
├── LICENSE
├── .gitignore
├── .github/
│ └── workflows/
├── code/
│ ├── config/
│ │ ├── config.yml
│ │ └── paths.example.yml
│ ├── pipeline/
│ …