Set up on idmodeling - HopkinsIDD/cholera-mapping-pipeline GitHub Wiki

This page describes the set up instructions to run the pipeline on idmodeling.

Last Updated on 2025-04-21

We are running the pipeline using Conda to ensure R packages are installed correctly under the current version of g++ on the idmodeling server.

Set up R environment in Conda

  1. Download Miniconda: wget http://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
  2. Install Miniconda: bash Miniconda3-latest-Linux-x86_64.sh (this may take a few minutes)
  3. Initialize conda:
  • ~/miniconda3/bin/conda init
  • source ~/.bashrc
  1. Install R in conda: conda create -n r4.2.2-env r-base=4.2 (here is the example of installing R version 4.2.2 in conda)
  2. Activate R in conda: conda activate r4.2.2-env
  3. Install R packages in conda: conda install r-<R package name>
  4. Deactivate R in conda: conda deactivate

Install pipeline-related R packages:

In conda:

  • conda install r-devtools r-ISOcodes r-dplyr r-tidyr r-igraph r-remotes conda install r-ggplot2 r-rstan r-optparse r-sf r-lubridate r-spdep r-doparallel r-itertools r-rgeoboundaries r-kableExtra r-foreach r-rmapshaper r-nngeo r-cowplot r-ggalluvial r-ggpattern r-ggh4x r-Paletteer r-janitor r-tidyverse r-patchwork r-ggspatial
  • conda install -c conda-forge r-lwgeom
  • conda install -c conda-forge r-stringi

In R:

  • install.packages("Rcpp", repos="https://rcppcore.github.io/drat")
  • remotes::install_github("rspatial/terra")
  • remotes::install_github("rspatial/geodata")
  • remotes::install_github("stan-dev/cmdstanr")
  • devtools::install_github("r-dbi/DBI")
  • remotes::install_github("r-dbi/RPostgres")
  • install.packages(‘viridis’)
  • install.packages(‘Cairo’)
  • install.packages('terra', repos='https://rspatial.r-universe.dev')
  • remotes::install_github("r-spatial/sf")

Set up access to the covariate database:

  • Create an account and password for the covariate database (from idmodeling administrator)
  • Get access to the Master grid table
  • Get access to the 20*20 KM population table

Set up the water bodies shapefiles in the pipeline folder:

Set up the database and website username and key file in the pipeline folder:

  • Prepare an R script called database_api_key.R with the following components:
database_username <-'' #put your api username here
database_api_key <-  '' #put your api key here
taxonomy_username <- '' #put your sql username here
taxonomy_password <- '' #put your sql password here
  • Save this R file into the Analysis/R subfolder