Skip to content

Commit

Permalink
updated README and figure scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Monica-Golumbeanu committed Oct 17, 2023
1 parent 6f705be commit 5c5cb1f
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# [AnophelesModel](https://swisstph.github.io/AnophelesModel/)
An R package to quantify the impact of vector control interventions according to mosquito species characteristics
AnophelesModel is an R package to quantify the impact of vector control interventions according to mosquito species characteristics. It can be used to parameterize a [dynamical model of the mosquito feeding cycle](https://www.tandfonline.com/doi/full/10.1080/17513750701769857) using data about mosquito bionomics (entomological characteristics) and biting patterns, as well as human activity and intervention effects. The different types of data have been extracted from field studies and are included in the package. The model infers the species-specific impact of various vector control interventions on the vectorial capacity. The package can be used to compare the impact of interventions for different mosquito species and to generate geographic-specific parameterizations for the entomological and vector control components of more complex models of malaria transmission dynamics.

The AnophelesModel package can be used to parameterize a [dynamical model of the mosquito feeding cycle](https://www.tandfonline.com/doi/full/10.1080/17513750701769857) using data about mosquito bionomics (entomological characteristics) and biting patterns, as well as human activity and intervention effects. The different types of data have been extracted from field studies and are included in the package. The model infers the species-specific impact of various vector control interventions on the vectorial capacity. The package can be used to compare the impact of interventions for different mosquito species and to generate parameterizations for the entomological and vector control components of more complex models of malaria transmission dynamics.
This package is associated with the following manuscript:
M. Golumbeanu, O. Briët, C. Champagne, J. Lemant, M. Winkel, B. Zogo, M. Gerhards, M. Sinka, N. Chitnis, M. Penny, E. Pothin, T. Smith. "**AnophelesModel: An R package to quantify the effect of vector bionomics on the impact of vector control interventions against malaria transmitted by *Anopheles* mosquitoes**".

This package is associated with the following manuscript in preparation:
M. Golumbeanu, O. Briët, C. Champagne, J. Lemant, B. Zogo, M. Gerhards, M. Sinka, N. Chitnis, M. Penny, E. Pothin, T. Smith. "**AnophelesModel: An R package to quantify the effect of vector bionomics on the impact of vector control interventions against malaria transmitted by *Anopheles* mosquitoes**".
The scripts and data used for generating figures 2-4 in the manuscript are provided at https://github.com/SwissTPH/AnophelesModel/tree/main/extdata (scripts example_fig2.R, etc.).

To install the package:
```{r}
Expand Down
12 changes: 8 additions & 4 deletions extdata/example_fig2.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################
# Script for generating Fig. 1 which describes the heterogeneity of bionomics,
# Script for generating Fig. 2 which describes the heterogeneity of bionomics,
# mosquito biting and intervention effects and emphasizes the need of a
# way to incorporate those when estimating the effect of vector control
#
Expand All @@ -13,6 +13,7 @@ library(tidyr)
library(reshape2)
library(stringr)
library(ggpubr)
library(reporter)

plot_activities_human = function(country, id_tab, act_file) {

Expand Down Expand Up @@ -200,8 +201,9 @@ nets_prop_Kenya = nets_prop_Kenya %>% filter(Parameter != "SD of log transformed
nets_prop_Kenya = nets_prop_Kenya %>% filter(Net_Type != "PermaNet 3.0")
nets_prop_Kenya$L95 = pmax(nets_prop_Kenya$L95, 0)
nets_prop_Kenya = nets_prop_Kenya %>% filter(Semester < 7)
nets_prop_Kenya[which(nets_prop_Kenya$Parameter == "Mean of log transformed holed area"), "Title"] = "Mean LLIN log holed area"
nets_prop_Kenya[which(nets_prop_Kenya$Parameter == "Survival"), "Title"] = "LLIN survival"
title_area = paste0("Mean LLIN log holed area (cm" %p% supsc("2"), ")")
nets_prop_Kenya[which(nets_prop_Kenya$Parameter == "Mean of log transformed holed area"), "Title"] = title_area
nets_prop_Kenya[which(nets_prop_Kenya$Parameter == "Survival"), "Title"] = "LLIN survival (% remaining nets)"

p_net_decay_country = ggplot(nets_prop_Kenya, aes(x = Semester, y = Value, fill = Net_Type)) +
geom_bar(stat = "identity", position = position_dodge(width=0.9)) +
Expand All @@ -216,4 +218,6 @@ p_net_decay_country = ggplot(nets_prop_Kenya, aes(x = Semester, y = Value, fill
labs(fill = "LLIN type")

p_fig2 = ggarrange(plotlist = list(p_bio, p_act, p_net_decay_country), ncol = 1, nrow = 3, labels = c("A", "B", "D"))
ggsave("~/paper_AnophelesModel/Figures/Fig2.pdf", width = 11, height = 9)

# To modify ouptut folder accordingly
# ggsave("~/paper_AnophelesModel/Figures/Fig2.pdf", width = 11, height = 9)
8 changes: 5 additions & 3 deletions extdata/example_fig3.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
###############################
# Script for generating Fig. 3 which presents the impact on vectorial capacity
# as well as integration with OpenMalaria
# Script for generating Fig. 3 which presents the decay of intervention effects
# for LLIN in PNG and KEN as well as corresponding reduction in vectorial capacity.
# This script also generates the GVI snippets to be used for parameterising OpenMalaria.
#
# [email protected]
# 22.08.2022
##############################
Expand Down Expand Up @@ -163,6 +165,6 @@ p_vc = ggplot(impact_df, aes(x = intervention_coverage, y = intervention_impact*
labs(x = "Coverage", y="Mean reduction in\nvectorial capacity (%)")

p_fig3 = ggarrange(plotlist = list(p_effects, p_vc), ncol = 1, nrow = 2, labels = c("A", "B"))
ggsave("~/paper_AnophelesModel/Figures/Fig3.pdf", width = 8, height = 7)
# ggsave("~/paper_AnophelesModel/Figures/Fig3.pdf", width = 8, height = 7)


29 changes: 22 additions & 7 deletions extdata/example_fig4.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#################################
# Example script for downstream analysis using the postprocessed simulation outputs
# This script generates Figure 4 from the paper.
#
# 10.11.2022
# [email protected]
Expand All @@ -8,12 +9,22 @@ library(RSQLite)
library(magrittr)
library(dplyr)
library(ggplot2)
library(lubridate)
####################
# PART TO BE SPECIFIED BY THE USER
# The file paths are relative to the "extdata/om_data/" directory of the AnophelesModel git repository
# This working directory needs to be specified for each user as it depends on their system
working_dir = "~/GitRepos/STPHrepos/AnophelesModel/extdata/om_data/"
# Folder where the generated figure should be saved
out_dir = "~/paper_AnophelesModel/Figures/"
#####################


# Define database file path
db_exp_KEN = "/scicore/home/pothin/golmon00/OpenMalaria/AnophelesModel/KEN.sqlite"
db_exp_PNG = "/scicore/home/pothin/golmon00/OpenMalaria/AnophelesModel/PNG.sqlite"
scens_KEN = readRDS("/scicore/home/pothin/golmon00/OpenMalaria/AnophelesModel/KEN/cache/scenarios.rds")
scens_PNG = readRDS("/scicore/home/pothin/golmon00/OpenMalaria/AnophelesModel/PNG/cache/scenarios.rds")
db_exp_KEN = paste0(working_dir, "KEN.sqlite")
db_exp_PNG = paste0(working_dir, "PNG.sqlite")
scens_KEN = readRDS(paste0(working_dir, "scenarios_KEN.rds"))
scens_PNG = readRDS(paste0(working_dir, "scenarios_PNG.rds"))

# Read the results table from the database:
# open database connection:
Expand Down Expand Up @@ -62,16 +73,20 @@ plot_df[which(plot_df$setting == "PNG"), "setting"] = "Papua New Guinea"

plot_df$setting = factor(plot_df$setting, levels = c("Papua New Guinea", "Kenya"))

# Make the dates relevant for the present time
plot_df$date = as.Date(plot_df$date) %m+% years(23)

ggplot(plot_df, aes(x = as.Date(date), y = mean_prev*100, color = setting)) +
theme_light() + theme_linedraw() + theme_bw(base_size = 16) +
geom_ribbon(aes(ymin = (mean_prev - sd_prev)*100, ymax = (mean_prev - sd_prev)*100 + 1,
fill = setting, alpha = 0.5, color = NULL), show.legend = FALSE) +
geom_vline(xintercept = as.Date("2000-01-01"), color = "black", linetype = "dashed") +
labs(x = "Time", y="Prevalence (%)") +
geom_vline(xintercept = as.Date("2023-01-01"), color = "black", linetype = "dashed") +
labs(x = "Time since LLIN deployment (years)", y="Prevalence (%)") +
scale_color_manual(values = c("#74c476", "#c51b8a")) +
scale_fill_manual(values = c("#74c476", "#c51b8a")) +
scale_x_date(date_breaks = "4 years",date_labels = "%Y")+
labs(color = "Setting") + theme(legend.position = "top") +
geom_line()

ggsave("~/paper_AnophelesModel/Figures/Fig4.pdf", width = 8, height = 4)
ggsave(paste0(out_dir, "Fig4.pdf"), width = 8, height = 4)

Binary file added extdata/om_data/KEN.sqlite
Binary file not shown.
File renamed without changes.
Binary file added extdata/om_data/PNG.sqlite
Binary file not shown.
File renamed without changes.
Binary file added extdata/om_data/scenarios_KEN.rds
Binary file not shown.
Binary file added extdata/om_data/scenarios_PNG.rds
Binary file not shown.

0 comments on commit 5c5cb1f

Please sign in to comment.