Skip to content

mqwilber/moveSTIR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 documentation

    • moveSTIR.py: Contains the functions necessary to implement the MoveSTIR framework
    • moveSTIR_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 from process_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 pigs
    • pig_movements_metadata.txt: Associated metadata
    • pig_info.csv: Information on the sex of collared pigs
    • pig_info_metadata.txt: Associated metadata
    • foi_raster.tif: An intermediate file generated by movestir_pig_movements.ipynb. Contains a rasterized version of potential infection risk as generated by MoveSTIR.
    • ctmm_data/: Folder contains the interpolated CTMM trajectories produced by fit_and_predict_ctmm.R
    • home_range_overlaps_*.csv: Intermediate results from calculate_hr_area.R. Association matrices of home range overlap between pigs.
  • results/: Folder where figures will be saved

    • trans_kernels/: Contains the intermediate results from process_transmission_kernels.py. NOTE: These results will either need to be downloaded here and stored in this folder OR the script process_transmission_kernels.py will need to executed.

Workflow

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

  1. fit_and_predict_ctmm.R: Uses the CTMM package in R to fit the continuous time movement models to the observed pig movements
  2. process_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.
  3. calculate_hr_area.R: Computes home range overlap estimates that are used to compare contact networks.
  4. movestir_pig_movements.ipynb: Analyzes the marginal results from process_transmission_kernels.py
  5. 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.