DOI: 10.5061/dryad.msbcc2g72
title: Parasite responses to resource provisioning can be altered by within-host co-infection interactions

description: Anthropogenic changes to the environment significantly impact wildlife
 infectious diseases by modifying food resources and impacting
 host-parasite interactions through changes in host demography, behaviour,
 and immune defences. Supplemental resource provisioning has been found to
 both enhance and mitigate parasite transmission; however, the role of
 co-infecting parasites in mediating these effects remains understudied. We
 developed a mathematical model to explore these dynamics, motivated by the
 empirical system of wood mice (Apodemus sylvaticus) infected with the
 nematode Heligmosomoides polygyrus, which suppresses co-infections by the
 apicomplexan microparasite Eimeria hungaryensis. Our model shows that the
 effects of resource provisioning on parasite epidemiology can be mediated,
 and potentially reversed, by within-host co-infection interactions,
 through effects on host-parasite contact rates and host susceptibility.
 Provisioning may elevate microparasite prevalence by reducing nematode
 burdens, thereby releasing the microparasite from the negative effects of
 co-infection. However, if provisioning increases host contact rates with
 parasite infective stages in the environment, the associated increase in
 nematode burdens can result in concomitant reductions in the
 microparasite, due to the negative within-host co-infection interaction.
 Our study highlights the need for experimental designs that decouple the
 complex factors of provisioning on co-infecting parasite dynamics and
 provides a framework for interpreting outcomes in multi-parasite systems.
description: # Parasite responses to resource provisioning can be altered by
 within-host co-infection interactions **Short Summary**\ This repository
 contains code for a mathematical model exploring how supplemental food
 provisioning influences parasite dynamics in wildlife, specifically
 focusing on co-infections in wood mice (*Apodemus sylvaticus*). The model
 examines interactions between the nematode *Heligmosomoides polygyrus* and
 the microparasite *Eimeria hungaryensis*, showing that resource
 provisioning can either increase or decrease parasite prevalence depending
 on how it alters host contact rates, susceptibility, and within-host
 co-infection interactions. The code provides a framework for studying how
 environmental changes shape multi-parasite epidemiology.
 [https://doi.org/10.5061/dryad.msbcc2g72](https://doi.org/10.5061/dryad.msbcc2g72) ## Description of the data and file structure ### Code and Package Versions * **Manual version number**: `v1.0 (initial release)` * **R version**: 4.2.3 (2023-03-15) * **Platform**: x86_64-apple-darwin17.0 (64-bit) * **OS**: macOS Monterey 12.5.1 **R packages used (with versions):**\ `gridExtra` 2.3, `stringr` 1.5.1, `plyr` 1.8.9, `reshape2` 1.4.4, `lattice` 0.20-45,\ `deSolve` 1.40, `coda` 0.19-4.1, `ggplot2` 3.5.2, `tidyr` 1.3.1, `MASS` 7.3-58.2,\ `fitR` 0.2.1, `readr` 2.1.4, `adaptivetau` 2.3, `dplyr` 1.1.4, `lubridate` 1.9.4,\ `mvtnorm` 1.1-3, `bbmle` 1.0.25.1, `emdbook` 1.3.13, `tmvtnorm` 1.6 ### Licensing Information This code and data are released under the **CC0 License**. ### Files and variables ### File: population.csv **Description:** data for population dynamics model - collected *Apodemus sylvaticus* per week * `population.csv`: Contains population data with collection date (date), and number of collected individuals (obs). Time column corresponds to the time step in the simulation.  #### File: Ehungaryensis.csv and Hpolygyrus.csv **Description:** data for co-infection model - *Heligmosomoides polygyrus* infective stage counts and number of *Eimeria hungaryensis* infected mice (*Apodemus sylvaticus* ) per week  * `Ehungaryensis.csv`: Contains *Eimeria hungaryensis* data with collection date (date), observed infected individuals (obs), and number of collected individuals (num). Time column corresponds to the time step in the simulation.  * `Hpolygyrus.csv`: Contains *Helygmosomoides polygyrus* data with collection date (date), and total number of observed eggs (obs) in the population. Time column corresponds to the time step in the simulation.  ## Code/software ### Overview This repository contains R code and Mathematica scripts for parameter estimation and analysis of two models: a population dynamics model and a coinfection model. ### Directory Contains all necessary scripts and data for estimating parameters of the population and coinfection dynamics models. **Key files:** * `main_population.R`: The master script that initiates the population dynamics analysis. * `popdyn_det.R`: Implements the population dynamics model. * `analysis_population.R`: Analyzes the output from `main_population.R`. * `population.csv`: Contains population data with collection date (date), and number of collected individuals (num). Time column corresponds to the time step in the simulation.  - `main_coinfection.R`: The master script that initiates the coinfection analysis. - `coinf_det_I9.R`: Implements the I9 coinfection dynamics. - `coinf_det_L9.R`: Implements the L9 coinfection dynamics. - `analysis_coinfection.R`: Analyzes the output from `main_coinfection.R`. - `Ehungaryensis.csv`: Contains *Eimeria hungaryensis* data with collection date (date), observed infected individuals (obs), and number of collected individuals (num). Time column corresponds to the time step in the simulation.  - `Hpolygyrus.csv`: Contains *Helygmosomoides polygyrus* data with collection date (date), and total number of observed eggs (obs) in the population. Time column corresponds to the time step in the simulation.  #### 3. `functions.R` A collection of functions used across both models, promoting code reusability and modularity. #### 4. `plots.nb` A Mathematica notebook used to generate Figures 3 and 4 from the manuscript, visualizing the results of the models. --- ### Summary of Workflow * `main_population.R` serves as the main entry code for population dynamics fitting and calls the detailed model script `popdyn_det.R` for population dynamics. * After running the simulations and the fitting, `analysis_population.R` processes the output data and performs further analysis. * `main_coinfection.R` serves as the main entry code for coinfection dynamics fitting and calls the detailed model scripts `coinf_det_I9.R` and `coinf_det_L9.R` for coinfection dynamics. * After running the simulations and the fitting, `analysis_coinfection.R` processes the output data and performs further analysis. * The `plots.nb` notebook is then used to create Figures 4 and 5, displaying the model results graphically. 
 
 ### Version changes **03-09-2025:** population (`population.csv)` and
 coinfection (`Ehungaryensis.csv` and `Hpolygyrus.csv`) data were included
 as .csv files (previously `Data_coinfection.RData` and
 `Data_population.RData` files). `main_population.R` and
 `main_coinfection.R` were updated to import these .csv files.