This directory contains the code and data necessary to implement the "Movement-driven modeling of spatio-temporal infection risk" (MoveSTIR). The framework is developed and described in the manuscript "A model for leveraging animal movement to understand spatial disease dynamics". The environment.yml
file builds the Python environment necessary to run the Python code provided in the directory. See here for instructions on how to build a new environment using the Anaconda platform.
-
code/
: Contains the following files scripts and notebooks. All files also contain internal documentationmoveSTIR.py
: Contains the functions necessary to implement the MoveSTIR frameworkmoveSTIR_examples.*
: A Jupyter notebook and rendered HTML providing examples on MoveSTIR's capabilities using simulated data.moveSTIR_tutorial.*
: A Jupyter notebook and rendered HTML showing a minimal workflow with MoveSTIR.fit_and_predict_ctmm.R
: Script uses the CTMM package in R to fit the continuous time movement models to the observed GPS data from wild pigs.process_transmission_kernels.py
: Script builds transmission kernels from the pig CTMMs and saves marginal summaries of the transmission kernels. The kernels themselves are quite large and are removed after the marginal information is processed.movestir_pig_movements.*
: A Jupyter notebook and rendered HTML that analyzes the MoveSTIR results fromprocess_transmission_kernels.py
.calculate_hr_area.R
: Analyzes the spatial heterogeneity in infection risk within pig home ranges and calculates home range overlap metrics.
-
data/
pig_movements.csv
: Observed GPS movement data for wild pigspig_movements_metadata.txt
: Associated metadatapig_info.csv
: Information on the sex of collared pigspig_info_metadata.txt
: Associated metadatafoi_raster.tif
: An intermediate file generated bymovestir_pig_movements.ipynb
. Contains a rasterized version of potential infection risk as generated by MoveSTIR.ctmm_data/
: Folder contains the interpolated CTMM trajectories produced byfit_and_predict_ctmm.R
home_range_overlaps_*.csv
: Intermediate results fromcalculate_hr_area.R
. Association matrices of home range overlap between pigs.
-
results/
: Folder where figures will be savedtrans_kernels/
: Contains the intermediate results fromprocess_transmission_kernels.py
. NOTE: These results will either need to be downloaded here and stored in this folder OR the scriptprocess_transmission_kernels.py
will need to executed.
Users can explore the Jupyter notebook movestir_pig_movements.ipynb
to examine how MoveSTIR can be applied to real movement data. First, the users will need to download or generate the files marginal_fois_step5_use_ctmm_True_dd*.pkl
. See the information under the results/
folder.
To generate all the intermediate results, the scripts and notebooks should be executed in the following order
fit_and_predict_ctmm.R
: Uses the CTMM package in R to fit the continuous time movement models to the observed pig movementsprocess_transmission_kernels.py
: Builds transmission kernels from the pig CTMMs and saves marginal summaries of the transmission kernels as the kernels themselves are quite large.calculate_hr_area.R
: Computes home range overlap estimates that are used to compare contact networks.movestir_pig_movements.ipynb
: Analyzes the marginal results fromprocess_transmission_kernels.py
calculate_hr_area.R
: Analyzes the spatial heterogeneity in infection risk within pig home ranges.
Executing moveSTIR_examples.ipynb
and moveSTIR_tutorial.ipynb
does not require any intermediate results.