DOI: 10.5061/dryad.3n5tb2rqt
title: R scripts, input and output data for: Season of death, pathogen persistence and wildlife behaviour alter number of anthrax secondary infections from environmental reservoirs

description: An important part of infectious disease management is predicting factors
 that influence disease outbreaks, such as R, the number of secondary
 infections arising from an infected individual. Estimating R is
 particularly challenging for environmentally transmitted pathogens given
 time lags between cases and subsequent infections. Here, we calculated R
 for Bacillus anthracis infections arising from anthrax carcass sites in
 Etosha National Park, Namibia. Combining host behavioural data, pathogen
 concentrations, and simulation models, we show that R is spatially and
 temporally variable, driven by spore concentrations at death, host
 visitation rates and early preference for foraging at infectious sites.
 While spores were detected up to a decade after death, most secondary
 infections occurred within two years. Transmission simulations under
 scenarios combining site infectiousness and host exposure risk under
 different environmental conditions led to dramatically different outbreak
 dynamics, from pathogen extinction (R&lt;1) to explosive outbreaks
 (R&gt;10). These transmission heterogeneities may explain variation in
 anthrax outbreak dynamics observed globally, and more generally, the
 critical importance of environmental variation underlying host-pathogens
 interactions. Notably, our approach allowed us to estimate the lethal dose
 of a highly virulent pathogen non-invasively from observational studies
 and epidemiological data, useful when experiments on wildlife are
 undesirable or impractical.
description: Camera trap data were collected from 13 sites between 2010–2013
 in Etosha National Park, Namibia. Soil samples were collected to analyse
 the concentration of <em>Bacillus</em>
 <em>anthracis</em> spores between 2010–2022 in Etosha National
 Park. Statistical analysis was used to analyse camera
 trap data, and a simulation model was built to estimate the reproduction
 number of anthrax in Etosha National Park.
description: # Reproduction Number analysis and model Files to run the model from the
 manuscript "Season of death, pathogen persistence and wildlife
 behavior alter number of anthrax secondary infections from environmental
 reservoirs'. Six CSV data files and one R code are used to run the
 analysis and modeling. Eleven CSV files represent the output of the model
 (Rscript 'R_estimation_Code.R, using the input data CSV files). Those
 outputs are used in the R code 'Plots_R_estimation_Code.R' to
 plot the figures in the MS and the SI. ## Description of the data and file
 structure Input files : * Camera_all_individuals.csv : Records each
 individual zebra and wildebeest observed on the camera. The columns are :
 * Date = Date of recording; * ID = Camera ID; * Treatment = Carcass or
 Control site; * Tini = Time at which the individual entered the zone; *
 Tend = Time at which the individual exited the zone; * Individual = When
 herd visiting the site at the same time, this record the order at which
 the individual entered; * Total_Ind = Number of individuals visiting the
 site at the same time; * Age = Age of the individual : Juvenile : 0-1 year
 / Sub-adult : 1-2 Years / Adult : +2years; * Sex = Male or Female; *
 Confidence = Confidence in the age/sex combination : 0 : Could not
 determine / 1= Low confidence / 2= High confidence / 3: Certain; * TT =
 Total time spent in the zone, in seconds; * TG = Total time spent grazing
 on the zone, in seconds; * Species = Zebra or Wildebeest; * JDay = Julian
 day of observation; * deployed = Date of camera deployement; * TimeStart=
 Number of days since the camera was up; * Season = Season of observation,
 Hot-Wet , Cool-dry or Hot-dry; * Death_date = Date of individual death,
 for carcass sites; * Age_AD = Number of days since death; * Carcass_year=
 Year of death; * Month_AD = Number of months after death; * Grazing= 0: No
 1: Yes; * Year_AD = Number of years after death; * Rainfall =
 Precipitation in mm; * Temp = Temperature in degrees C; * Rain_AD =
 Precipitation at the day of death; * NDVI = Normalized Difference
 Vegetation Index, of the site ID * Camera_monthly_summary.csv : Summary of
 the individual dataset to obtain the number of visits per month, the
 probability of grazing per month. The columns are: * Year = Year of
 observation; * ID = Camera ID; * Month = Month of observation; *
 Treatment= Carcass or Control site; * Species = Zebra or Wildebeest; * Age
 = Age of the individual : Juvenile : 0-1 year / Sub-adult : 1-2 Years /
 Adult : +2years; * Sex = Male or Female; * NV = Number of visitis; * NG =
 Number of individuals grazing; * NDVI = Normalized difference vegetation
 index; * Death_date = date of death; * Season = Season of observation; *
 PropGV = Probability of grazing; * Month_AD = Number of month after death;
 * MY = Month/Year of observation * Location_camera.csv : Distance of the
 cameras from the closest perenial water and salt pan edge. The columns
 are: * ID = Camera site ID; * Name_water = Closest waterhole name; *
 Water_km = Distance in km from the water; * Pan_km = Distance in km from
 the pan edge * Extrapolation.csv : Spore concentration in grass and soil
 at 40 sites for 10 years, obtained from extrapolation and interpolation.
 The column are: * ID = Site ID; * Age = Age of site in years after death;
 * Soil_CFU = Concentration of spores in the soil; * Grass_CFU_above =
 Concentration of spores in the aboveground grass component (everything
 above the roots); * Grass_Top_CFU = Concentration of spores in the top
 grass component (removing the base of the plant which can collect soil); *
 Season = Season of death * Location_CFU.csv : Coordinate of each spore
 concentration site, and NDVI of the sites. The columns are: * ID = Site
 ID; * Lon = Longitude; * Lat = Latitude; * Index = Sample Index; *
 NDVI_Wet = NDVI of the site at death during the hot-wet season; *
 NDVI_CDry = NDVI of the site at death during the Cool-dry season; *
 NDVI_HDry = NDVI of the site at death during the Hot_dry season *
 Camera_work_time.csv : Numbers of days of recording per camera trap. The
 columns are: * ID: Site ID; * Month: Year-Month of the recording; *
 Carcass : Number of days of recording for the carcass camera; * Control :
 Number of days of recording for the control camera Output files : *
 Wildebeest_Final_100.csv : Output for Wildebeests after 100 repetitions,
 for a 10 year simulation, using all information available. The columns are
 : * LD = Lethal dose used for the simulation; * Season = Season of the
 year; * Year = Year of simulation (0 to 10); * Rep = Simulation number
 (100 repetitions); * Distance = Distance from closest waterhole (0-4km,
 4-8km, +8km); * Age = Age of the simulated individual (A=Adult, SA =
 Sub-Adults); * Sex = Sex of the simulated individual (F=Female, M = Male);
 * Visits = Number of simulated visit at a site; * Grazing = Number of
 visiting individuals that grazed; * Infected = Number of infected
 individuals; * Prop = Proportion of individuals ingesting 10% of soil
 during the wet season / during the dry season; * Wwet = Proportion of
 individuals ingesting 10% of soil during the wet season; * Wdry =
 Proportion of individuals ingesting 10% of soil during the dry season *
 Wildebeest_Dry_Pathogen_Dry_Visit_100.csv : Output for wildebeests after
 100 repetitions, for a 10 years simulation; subsampling the input datasets
 by keeping anthrax sites formed in dry season and wildebeest behavioral
 information from dry season only. The columns are : * LD = Lethal dose
 used for the simulation; * Season = Season of the year; * Year = Year of
 simulation (0 to 10); * Rep = Simulation number (100 repetitions); *
 Distance = Distance from closest waterhole (0-4km, 4-8km, +8km); * Age =
 Age of the simulated individual (A=Adult, SA = Sub-Adults); * Sex = Sex of
 the simulated individual (F=Female, M = Male); * Visits = Number of
 simulated visit at a site; * Grazing = Number of visiting individuals that
 grazed; * Infected = Number of infected individuals; * Prop = Proportion
 of individuals ingesting 10% of soil during the wet season / during the
 dry season; * Wwet = Proportion of individuals ingesting 10% of soil
 during the wet season; * Wdry = Proportion of individuals ingesting 10% of
 soil during the dry season * Wildebeest_Wet_Pathogen_Dry_Visit_100.csv :
 Output for wildebeests after 100 repetitions, for a 10 years simulation,
 subsampling the input datasets by keeping anthrax sites formed in wet
 season and wildebeest behavioral information from dry season only. The
 columns are : * LD = Lethal dose used for the simulation; * Season =
 Season of the year; * Year = Year of simulation (0 to 10); * Rep =
 Simulation number (100 repetitions); * Distance = Distance from closest
 waterhole (0-4km, 4-8km, +8km); * Age = Age of the simulated individual
 (A=Adult, SA = Sub-Adults); * Sex = Sex of the simulated individual
 (F=Female, M = Male); * Visits = Number of simulated visit at a site; *
 Grazing = Number of visiting individuals that grazed; * Infected = Number
 of infected individuals; * Prop = Proportion of individuals ingesting 10%
 of soil during the wet season / during the dry season; * Wwet = Proportion
 of individuals ingesting 10% of soil during the wet season; * Wdry =
 Proportion of individuals ingesting 10% of soil during the dry season *
 Wildebeest_Dry_Pathogen_Wet_Visit_100.csv : Output for wildebeests after
 100 repetitions, for a 10 years simulation, subsampling the input datasets
 by keeping anthrax sites formed in dry season and wildebeest behavioral
 information from wet season only. The columns are : * LD = Lethal dose
 used for the simulation; * Season = Season of the year ; * Year = Year of
 simulation (0 to 10); * Rep = Simulation number (100 repetitions); *
 Distance = Distance from closest waterhole (0-4km, 4-8km, +8km); * Age =
 Age of the simulated individual (A=Adult, SA = Sub-Adults); * Sex = Sex of
 the simulated individual (F=Female, M = Male); * Visits = Number of
 simulated visit at a site; * Grazing = Number of visiting individuals that
 grazed; * Infected = Number of infected individuals; * Prop = Proportion
 of individuals ingesting 10% of soil during the wet season / during the
 dry season; * Wwet = Proportion of individuals ingesting 10% of soil
 during the wet season; * Wdry = Proportion of individuals ingesting 10% of
 soil during the dry season * Wildebeest_Wet_Pathogen_Wet_Visit_100.csv :
 Output for wildebeests after 100 repetitions, for a 10 years simulation,
 subsampling the input datasets by keeping anthrax sites formed in wet
 season and wildebeest behavioral information from wet season only. The
 columns are : * LD = Lethal dose used for the simulation; * Season =
 Season of the year ; * Year = Year of simulation (0 to 10); * Rep =
 Simulation number (100 repetitions); * Distance = Distance from closest
 waterhole (0-4km, 4-8km, +8km); * Age = Age of the simulated individual
 (A=Adult, SA = Sub-Adults); * Sex = Sex of the simulated individual
 (F=Female, M = Male); * Visits = Number of simulated visit at a site; *
 Grazing = Number of visiting individuals that grazed; * Infected = Number
 of infected individuals; * Prop = Proportion of individuals ingesting 10%
 of soil during the wet season / during the dry season; * Wwet = Proportion
 of individuals ingesting 10% of soil during the wet season; * Wdry =
 Proportion of individuals ingesting 10% of soil during the dry season *
 Zebra_Final_100.csv : Output for zebras after 100 repetitions, for a 10
 years simulation, using all information available. The columns are : * LD
 = Lethal dose used for the simulation; * Season = Season of the year ; *
 Year = Year of simulation (0 to 10); * Rep = Simulation number (100
 repetitions); * Distance = Distance from closest waterhole (0-4km, 4-8km,
 +8km); * Age = Age of the simulated individual (A=Adult, SA = Sub-Adults);
 * Sex = Sex of the simulated individual (F=Female, M = Male); * Visits =
 Number of simulated visit at a site; * Grazing = Number of visiting
 individuals that grazed; * Infected = Number of infected individuals; *
 Prop = Proportion of individuals ingesting 10% of soil during the wet
 season / during the dry season; * Wwet = Proportion of individuals
 ingesting 10% of soil during the wet season; * Wdry = Proportion of
 individuals ingesting 10% of soil during the dry season *
 Zebra_Dry_Pathogen_Dry_Visit_100.csv : Output for zebra after 100
 repetitions, for a 10 years simulation, subsampling the input datasets by
 keeping anthrax sites formed in dry season and wildebeest behavioral
 information from dry season only. The columns are : * LD = Lethal dose
 used for the simulation; * Season = Season of the year ; * Year = Year of
 simulation (0 to 10); * Rep = Simulation number (100 repetitions); *
 Distance = Distance from closest waterhole (0-4km, 4-8km, +8km); * Age =
 Age of the simulated individual (A=Adult, SA = Sub-Adults); * Sex = Sex of
 the simulated individual (F=Female, M = Male); * Visits = Number of
 simulated visit at a site; * Grazing = Number of visiting individuals that
 grazed; * Infected = Number of infected individuals; * Prop = Proportion
 of individuals ingesting 10% of soil during the wet season / during the
 dry season; * Wwet = Proportion of individuals ingesting 10% of soil
 during the wet season; * Wdry = Proportion of individuals ingesting 10% of
 soil during the dry season * Zebra_Wet_Pathogen_Dry_Visit_100.csv : Output
 for zebra after 100 repetitions, for a 10 year simulation, subsampling the
 input datasets by keeping anthrax sites formed in wet season and
 wildebeest behavioral information from dry season only. The columns are :
 * LD = Lethal dose used for the simulation; * Season = Season of the year
 ; * Year = Year of simulation (0 to 10); * Rep = Simulation number (100
 repetitions); * Distance = Distance from closest waterhole (0-4km, 4-8km,
 +8km); * Age = Age of the simulated individual (A=Adult, SA = Sub-Adults);
 * Sex = Sex of the simulated individual (F=Female, M = Male); * Visits =
 Number of simulated visit at a site; * Grazing = Number of visiting
 individuals that grazed; * Infected = Number of infected individuals; *
 Prop = Proportion of individuals ingesting 10% of soil during the wet
 season / during the dry season; * Wwet = Proportion of individuals
 ingesting 10% of soil during the wet season; * Wdry = Proportion of
 individuals ingesting 10% of soil during the dry season *
 Zebra_Dry_Pathogen_Wet_Visit_100.csv : Output for zebra after 100
 repetitions, for a 10 year simulation, subsampling the input datasets by
 keeping anthrax sites formed in dry season and wildebeest behavioral
 information from wet season only. The columns are: * LD = Lethal dose used
 for the simulation; * Season = Season of the year ; * Year = Year of
 simulation (0 to 10); * Rep = Simulation number (100 repetitions); *
 Distance = Distance from closest waterhole (0-4km, 4-8km, +8km); * Age =
 Age of the simulated individual (A=Adult, SA = Sub-Adults); * Sex = Sex of
 the simulated individual (F=Female, M = Male); * Visits = Number of
 simulated visit at a site; * Grazing = Number of visiting individuals that
 grazed; * Infected = Number of infected individuals; * Prop = Proportion
 of individuals ingesting 10% of soil during the wet season / during the
 dry season; * Wwet = Proportion of individuals ingesting 10% of soil
 during the wet season; * Wdry = Proportion of individuals ingesting 10% of
 soil during the dry season * Zebra_Wet_Pathogen_Wet_Visit_100.csv : Output
 for zebra after 100 repetitions, for a 10 year simulation, subsampling the
 input datasets by keeping anthrax sites formed in wet season and
 wildebeest behavioral information from wet season only. The columns are :
 * LD = Lethal dose used for the simulation ; * Season = Season of the year
 ; * Year = Year of simulation (0 to 10); * Rep = Simulation number (100
 repetitions); * Distance = Distance from closest waterhole (0-4km, 4-8km,
 +8km), * Age = Age of the simulated individual (A=Adult, SA = Sub-Adults);
 * Sex = Sex of the simulated individual (F=Female, M = Male); * Visits =
 Number of simulated visit at a site; * Grazing = Number of visiting
 individuals that grazed; * Infected = Number of infected individuals; *
 Prop = Proportion of individuals ingesting 10% of soil during the wet
 season / during the dry season; * Wwet = Proportion of individuals
 ingesting 10% of soil during the wet season; * Wdry = Proportion of
 individuals ingesting 10% of soil during the dry season * LDF.csv :
 Extrapolation of the number of anthrax cases depending on the lethal dose
 over 100 years. The columns are: * Step = simulated year (0 to 100); * C0
 = Number of carcasses created that step year; * C1= Number of 1-year-old
 carcasses; * C2= Number of 2-years-old carcasses; * C3= Number of
 3-years-old carcasses; * C4= Number of 4-years-old carcasses; * C5= Number
 of 5-years-old carcasses; * C6= Number of 6-years-old carcasses; * C7=
 Number of 7-years-old carcasses; * C8= Number of 8-years-old carcasses; *
 C9= Number of 9-years-old carcasses; * C10= Number of 10-years-old
 carcasses; * LD = Lethal dose used for the simulation; * sim = Simulation
 number (100 repetions); * Weather = Type of environmental conditions
 (Normal vs Drought); * CarTot = Total number of anthrax carcass at the
 step year. ## Sharing/Access information Links to other publicly
 accessible locations of the data: *
 ##
 Code/Software R was used to perform the model, version 4.3.1 Packages
 'ggplot2','ggpubr','tidyverse',
 'dplyr', 'doParallel', 'purrr',
 'lubridate', 'ggbreak', 'parallel',
 'foreach' were used. * R_estimation_Code.R : Run the simulation
 model (contains the function and runs it) * Plots_R_estimation_Code.R :
 Code to run the plots found in the MS