Skip to content

KSTuominen/LA-MRSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code for modelling environmentally mediated spread of livestock-associated methicillin-resistant Staphylococcus aureus in a pig herd

This repository contains the code used in the manuscript "Modelling the spread of livestock-associated methicillin-resistant Staphylococcus aureus in a Swedish pig herd" by Tuominen et al. The model is written using R language (version 4.0.3).

Dependencies

Running the model requires installing the SimInf package. The latest released version can be installed from CRAN by install.packages("SimInf")

Running the model with pre-generated events

The code for a model that uses pre-generated events is available in model-premade-events.R. This runs the model from day 731 to 3000, where whole herd has been infected on day 730. The indirect transmission rates used in the model run are the median rates from the medium parameter set that were obtained through parametrization (see Approximate Bayesian computation (ABC) below). Simple plot of the herd prevalence over the study period is generated from the model output. The model-premade-events.R also produces a data frame "final_result", which has the status of each node (pen) at each day of the model run.

Approximate Bayesian computation (ABC)

The code used for parametrization is available in abc.R.

The ABC uses the model with pre-generated events and pre-calculated target parameter sets to generate fit and saves the result graph under /fit. The graphs for the last generations of each target parameter sets that were produced for the manuscript are readily provided as .pdf in the subdirectories of /fit. Similarly, the last generation model fits are provided as .Rda files and can be reloaded by typing load("fit/SET/fitted.Rda"), where "SET" is one of the target parameter set subdirectories (low, med or high).

The loaded fit results can then be viewed by typing fit.

Running the model and generating new events

A new model with events can be generated by executing model.R. This runs the model from day 0 to 3000 and generates events "on the go". The transmission rates and result data frame are the same as in model-premade-events.R.

Authors

orcid Thomas Rosendal, orcid Krista Tuominen (Maintainer)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages