Title: | Simulate and Analyze Human Exposure to Mosquito Biting |
---|---|
Description: | This package provides tools to analyse human and mosquito behavioral intercations and compute exposure to mosquito bites. It includes functions to generate behavioral data for individuals and biting patterns for mosquitoes, compute hourly exposure for bednet users and non-users, and summarize or visualize these dynamics across a 24-hour cycle. |
Authors: | Nicolas Moiroux [aut, cre] |
Maintainer: | Nicolas Moiroux <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-10-03 16:30:04 UTC |
Source: | https://github.com/Nmoiroux/ExpBites |
Using a model of behavioral interactions, computes the hourly exposure to mosquito bites for both bednet users and non-users, based on their location (indoors, outdoors, under a net) and mosquito biting rates. For users, exposure is adjusted for the protective effect of bednets.
calculate_Exp(df, df_bites, protection = 0.92)
calculate_Exp(df, df_bites, protection = 0.92)
df |
A dataframe with individual-level data, including columns:
|
df_bites |
A dataframe of biting rates by hour, with columns:
|
protection |
A numeric value (default = 0.92, according to Corbel et al. 2009 for Permanet 2 ITNs) indicating the proportion of bites prevented by bednet use. |
The mathematical model of behavioral interactions is an extension of the Killeen’s model (1) as previously described in Geissbühler et al. (2) and Moiroux et al. (3)
(1) Killeen, Gerry F., Japhet Kihonda, Edith Lyimo, Fred R. Oketch, Maya E. Kotas, Evan Mathenge, Joanna A. Schellenberg, Christian Lengeler, Thomas A. Smith, and Chris J. Drakeley. ‘Quantifying Behavioural Interactions between Humans and Mosquitoes: Evaluating the Protective Efficacy of Insecticidal Nets against Malaria Transmission in Rural Tanzania’. BMC Infectious Diseases 6 (2006): 161. https://doi.org/10.1186/1471-2334-6-161.
(2) Geissbühler, Yvonne, Prosper Chaki, Basiliana Emidi, Nicodemus J. Govella, Rudolf Shirima, Valeliana Mayagaya, Deo Mtasiwa, et al. ‘Interdependence of Domestic Malaria Prevention Measures and Mosquito-Human Interactions in Urban Dar Es Salaam, Tanzania’. Malaria Journal 6 (2007): 126. https://doi.org/10.1186/1475-2875-6-126.
(3) Moiroux, Nicolas, Georgia B. Damien, Marc Egrot, Armel Djenontin, Fabrice Chandre, Vincent Corbel, Gerry F. Killeen, and Cédric Pennetier. ‘Human Exposure to Early Morning Anopheles Funestus Biting Behavior and Personal Protection Provided by Long-Lasting Insecticidal Nets’. PloS One 9, no. 8 (2014): e104967. https://doi.org/10.1371/journal.pone.0104967.
Reference for the protection
parameter:
(4) Corbel, Vincent, Joseph Chabi, Roch K. Dabiré, Josiane Etang, Philippe Nwane, Olivier Pigeon, Martin Akogbeto, and Jean-Marc Hougard. ‘Field Efficacy of a New Mosaic Long-Lasting Mosquito Net (PermaNet 3.0) against Pyrethroid-Resistant Malaria Vectors: A Multi Centre Study in Western and Central Africa’. Malaria Journal 9 (27 April 2010): 113. https://doi.org/10.1186/1475-2875-9-113.
A dataframe with one row per hour (0–23) and the following columns:
Bi_t
– indoor biting rate,
Bo_t
– outdoor biting rate,
N
– number of human individuals,
Np
– number of human individuals that are net users,
It
– proportion of people indoors (users and non-users),
Eui
– mean exposure of non-users indoors,
Euo
– mean exposure of non-users outdoors,
Eu
– total mean exposure of non-users,
p_in
– proportion of people (users) being indoors,
p_net
– proportion of people (users) being asleep (under net),
Epi
– mean exposure of users indoors (not under net),
Epn
– mean exposure of users indoors under bednet (adjusted by protection),
Epo
– mean exposure of users outdoors,
Epp
– mean exposure prevented by bednet use,
Ep
– total mean exposure of users.
# generate fake data df <- gen_df_human(n_individuals = 100, hours = c(0:9,17:23)) df_bites <- gen_df_mosquito() # calculate mean hourly exposure to bites exposure_results <- calculate_Exp(df, df_bites)
# generate fake data df <- gen_df_human(n_individuals = 100, hours = c(0:9,17:23)) df_bites <- gen_df_mosquito() # calculate mean hourly exposure to bites exposure_results <- calculate_Exp(df, df_bites)
Simulates the hourly state of a set of individuals (either bednet users or non-users) over a 24-hour period. Each individual's state is assigned probabilistically based on the hour of the day and whether they use a bednet.
gen_df_human(n_individuals = 100, hours = c(0:23), prob_use = 0.5)
gen_df_human(n_individuals = 100, hours = c(0:23), prob_use = 0.5)
n_individuals |
Integer. Number of individuals to simulate. Default is 100. |
hours |
Integer vector. The hours of the day to simulate, typically |
prob_use |
Numeric. Probability of being a bednet user vs non-user. Default is 0.5. |
A data.frame with the following columns:
Individual ID.
Hour of the day (0–23).
Logical, indicating whether the individual is a bednet user.
Integer representing the individual’s state at that hour:
1
= outdoors, 2
= indoors and awake, 3
= indoors asleep (non-user), 4
= indoors asleep under bednet (user).
Factor version of state
with descriptive labels.
df <- gen_df_human(n_individuals = 50) df <- gen_df_human(n_individuals = 100, hours = c(0:9,17:23)) head(df)
df <- gen_df_human(n_individuals = 50) df <- gen_df_human(n_individuals = 100, hours = c(0:9,17:23)) head(df)
Simulates the number of Anopheles mosquito bites occurring indoors and outdoors for each hour of the day. Biting rates follow predefined lambda patterns that reflect typical mosquito activity (e.g., low during the day, peaking at night).
gen_df_mosquito()
gen_df_mosquito()
A data.frame with the following columns:
Hour of the day (0–23).
Simulated number of mosquito bites occurring indoors for each hour.
Simulated number of mosquito bites occurring outdoors for each hour.
df_bites <- gen_df_mosquito() head(df_bites)
df_bites <- gen_df_mosquito() head(df_bites)
Generates a dual-axis plot showing the hourly variation in human behavior (proportion of individuals indoors and under bednets) and mosquito biting behavior (biting rates indoors and outdoors). Human behavior is shown as a stacked area plot on the primary Y-axis, while mosquito biting rates are shown as lines on the secondary Y-axis. Hours are centered on midnight.
plot_behaviors(data)
plot_behaviors(data)
data |
A dataframe (typically the output of
|
A ggplot2
plot object with a stacked area chart for human behavior (on the primary Y-axis)
and line plots for mosquito biting rates (on the secondary Y-axis), with hours centered on midnight.
# Assuming `result` is the output from `calculate_Exp()` plot_behaviors(result)
# Assuming `result` is the output from `calculate_Exp()` plot_behaviors(result)
Creates a stacked area chart showing the hourly distribution of exposure to mosquito bites among bednet users, broken down by exposure type: outdoors, indoors (no net), indoors (under net), and prevented exposure due to bednet use. The hours are centered on midnight for better visualization.
plot_exposure(data, cPalette = c("#000000", "#E69F00", "#56B4E9", "#009E73"))
plot_exposure(data, cPalette = c("#000000", "#E69F00", "#56B4E9", "#009E73"))
data |
A dataframe resulting from the
|
cPalette |
A character vector of color values (hex codes or color names) used to fill each exposure category.
Must be of length 4 and will be applied in the following order:
|
A ggplot2
stacked area chart object showing the distribution of exposure types across centered hours.
# Assuming `result` is the output from `calculate_Exp()` plot_exposure(result)
# Assuming `result` is the output from `calculate_Exp()` plot_exposure(result)
Computes daily (24h) and interval-specific exposure statistics for both non-users and bednet users,
based on the output of calculate_Exp
. Protective efficacy of bednets
and proportion of exposure indoors or during the specified interval are computed.
summarise_exposure(data, interval = c(22, 5))
summarise_exposure(data, interval = c(22, 5))
data |
A dataframe returned by
|
interval |
A numeric vector of length 2 giving the start and end hour (inclusive) of the time interval,
e.g., |
The mathematical model of behavioral interactions is an extension of the Killeen’s model (1) as previously described in Geissbühler et al. (2) and Moiroux et al. (3)
(1) Killeen, Gerry F., Japhet Kihonda, Edith Lyimo, Fred R. Oketch, Maya E. Kotas, Evan Mathenge, Joanna A. Schellenberg, Christian Lengeler, Thomas A. Smith, and Chris J. Drakeley. ‘Quantifying Behavioural Interactions between Humans and Mosquitoes: Evaluating the Protective Efficacy of Insecticidal Nets against Malaria Transmission in Rural Tanzania’. BMC Infectious Diseases 6 (2006): 161. https://doi.org/10.1186/1471-2334-6-161.
(2) Geissbühler, Yvonne, Prosper Chaki, Basiliana Emidi, Nicodemus J. Govella, Rudolf Shirima, Valeliana Mayagaya, Deo Mtasiwa, et al. ‘Interdependence of Domestic Malaria Prevention Measures and Mosquito-Human Interactions in Urban Dar Es Salaam, Tanzania’. Malaria Journal 6 (2007): 126. https://doi.org/10.1186/1475-2875-6-126.
(3) Moiroux, Nicolas, Georgia B. Damien, Marc Egrot, Armel Djenontin, Fabrice Chandre, Vincent Corbel, Gerry F. Killeen, and Cédric Pennetier. ‘Human Exposure to Early Morning Anopheles Funestus Biting Behavior and Personal Protection Provided by Long-Lasting Insecticidal Nets’. PloS One 9, no. 8 (2014): e104967. https://doi.org/10.1371/journal.pone.0104967.
A tibble with three columns:
Character string indicating the category of summary: "non_user_daily"
, "user_daily"
,
"non_user_interval"
, "user_interval"
, "interval_vs_daily"
or "net_efficacy"
.
Name of the exposure component or metric (e.g., "Eui"
, "Euo"
, "Ep"
,
"Epp"
, "prop_indoor"
, etc., "prop_interval_non_user"
, "prop_interval_user"
and "prop_prevented"
).
Numeric value corresponding to the output for the given type.
# Assuming `result` is the output from calculate_Exp() summarise_exposure(result, interval = c(22, 5))
# Assuming `result` is the output from calculate_Exp() summarise_exposure(result, interval = c(22, 5))