This repository contains the code to reproduce the analysis of:
Carlson, Carleton, Odoulami, Molitor, and Trisos (2026), "The historical fingerprint and future impact of climate change on childhood malaria in Africa" medRxiv preprint.
All data used in this analysis are freely available online.
- Malaria data: Snow, R., Sartorius, B., Kyalo, D. et al. The prevalence of Plasmodium falciparum in sub-Saharan Africa since 1900. Nature 550, 515β518 (2017).
- Climate data:
- Climatic Research Unit gridded time series data version 4.03:
tmpandpredata are used. These data are available from 1901-2018. Newer versions of CRU are available, but 4.03 must be used to reproduce this analysis exactly. - Coupled Model Intercomparison Project (CMIP6):
- The following ten models are used -
ACCESS-CM2,ACCESS-ESM1-5,BCC-CSM2-MR,CanESM5,FGOALS-g3,GFDL-ESM4,IPSL-CM6A-LR,MIROC6,MRI-ESM2-0, andNorESM2-LM - Under 5 climate scenarios -
historical,historical-natural,SSP1-2.6,SSP2-4.5, andSSP5-8.5 - Note: CMIP6 data have gone through a bias correction procedure to calibrate values to CRU 4.03. Due to this, we provide replication data located at forthcoming.
- The following ten models are used -
- European Centre for Medium-Range Weather Forecasts Reanalysis v5 (ERA5): Monthly averaged data on single levels from 1940 to present.
- Climatic Research Unit gridded time series data version 4.03:
- Spatial data:
- Global Burden of Disease (GBD) regions: Defines the 4 regions in sub-Saharan Africa used in the analysis.
- Global Administrative Areas dataset version 3.6: Level one administrative boundaries (ADM1) are used as the primary unit of prevalence and data aggregation.
- Global Human Settlement Layer Urban Centre Database GHS-UCDB R2024A: UCDB defines the boundaries of urban centers and allows us to construct an urban dummy variable for diagnostics.
The data replication package includes all files needed to reproduce the analysis, but does not include publicly available datsets. These data include:
- CRU temperature and precipitation data files, aggregated to ADM1 boundaries.
- Bias corrected CMIP6 data files, including gridded and ADM1 aggregates.
- Elevation data, aggregated to the ADM1 level.
- Analysis ready data files with malaria prevalence and CRU and ERA5 data at the ADM1 level. An additional file is provided with prevalence data aggregated to the native resolution of CRU. All three files include the variables needed in analysis starting at
Pipeline/C - Model estimationof the code.
All R scripts to execute the data analysis and visualization are stored in the Pipeline directory:
Pipeline
βββ A - Utility functions
β βββ A01 - Configuration.R
β βββ A02 - Utility code for calculations.R
β βββ A03 - Utility code for plotting.R
βββ B - Extract climate and prevalence data
β βββ B01 - Extract CRU tmp and prc data ADM1.R
β βββ B02 - Extract GCM tmp and prc data ADM1.R
β βββ B03 - Extract CRU tmp and prc data grid.R
β βββ B04 - Join prev and CRU data.R
β βββ B05 - Extract ERA5 tmp and prc data ADM1.R
β βββ B06 - Join prev and ERA5 data.R
βββ C - Model estimation
β βββ C01 - Main specification.R
β βββ C02 - Bootstrap estimation.R
β βββ C03 - VCOV sampling.R
βββ D - Model sensitivity analyses and checks
β βββ D01 - Model sensitivity.R
β βββ D02 - Randomization tests.R
β βββ D03 - Additional robustness.R
β βββ D04 - Uncertainty analysis.R
β βββ D04b - newrob.R
β βββ D05 - High resolution model.R
β βββ D06 - Urbanization.R
β βββ D07 - ERA5 analysis.R
βββ E - Estimate historical and future prevalence
β βββ E01 - Predict prevalence.R
βββ F - Figure generation for main text
β βββ F01 - Prev maps and TS.R
β βββ F02 - Coeff and TS.R
β βββ F03 - Hist map, temp, elev, and TS.R
β βββ F04 - Future map, temp, elev, and TS.R
βββ G - Figure generation for supplement
β βββ G01 - Visualize thermal curve expectations and data.R
β βββ G02 - Historical partials.R
β βββ G03 - Future partials.R
β βββ G04 - Attributable map.R
β βββ G05 - Projection maps.R
β βββ G06 - Monthly time series.R
β βββ G07 - vcov sample.R
βββ H - Summary statistics for main text
βββ H01 - Thermal responses.R
βββ H02 - Historical summary.R
βββ H03 - Future summary.R
βββ H04 - Global warming levels.R
The figures and tables from the paper can be found in Results folder.
There are two primary pathways to replication.
- Full replication, including all data processing, modeling, prediction, and results summaries. This is equivalent to running all sections of the
Pipeline - Analysis replication, including sections
C,D,F, andG. SectionEis considered optional due to processing time and compute power needed. The appropriate summary files are provided for sectionsF-G.
In both cases, the first steps are the same:
- Download the data replication package located at forthcoming
- Cloning this repository
- Edit the file
A01 - Configuration.Rto include your username on the computer you are using, and the location of the data and code. This means editing two variablesdata_dirandrepo_dir
Full replication is a higher bar to clear as each user will be responsible for downloading the public data files and for placing them in the appropriate data folder following the outline that is reflected in A01 - Configuration.R. Only minimal data processing will be required for the simpler analysis replication pathway.
The Pipeline can be run at any level a user chooses. It is important to note that there is an outdated R package and we have therefore created a Docker container r-malaria-cru which is able to run the files. These files include:
F03 - Hist map, temp, elev, and TS.Rdue to the multiscales packageF04 - Future map, temp, elev, and TS.Rdue to the multiscales package
The rest of the code can be run with more recent versions of R. It has most recently been used with R 4.5.2.
Along with the structured and sequential pipeline, we provide a SLURM orchestration script run_pipeline.slurm. This can be used to run each file sequentially on a high performance compute (HPC) cluster node. Parallel processing has been implemented on the script level where needed to speed up overall run time. This script relies on docker containers, which are freely available on Dockerhub including the r-malaria-cru and rocker/geospatial.
The last complete run of this pipeline took 1 hour and 12 minutes on a single HPC node running an Intel Xeon Gold 6330 processor with 56 cores and 256 GB of RAM. The full data storage requirement with all input data, intermediate data, and output data is XX GB. Running this on a standard desktop computer could incur 1-2 orders of magnitude more run time. The smaller analysis replication on a normal desktop computer will run in approximately 3 hours.
Our code can be used, modified, and distributed freely for educational, research, and not-for-profit uses. For all other cases, please contact us. Further details are available in the license.
