______ ______ __ __ __ __ __ __ __
/\ ___\ /\ __ \ /\ \ _ \ \ /\ "-./ \ /\ \ /\ \ /\ \
\ \___ \ \ \ __ \ \ \ \/ ".\ \ \ \ \-./\ \ \ \ \ \ \ \____ \ \ \____
\/\_____\ \ \_\ \_\ \ \__/".~\_\ \ \_\ \ \_\ \ \_\ \ \_____\ \ \_____\
\/_____/ \/_/\/_/ \/_/ \/_/ \/_/ \/_/ \/_/ \/_____/ \/_____/
The iAM.AMR models are informed by one or more queries (timber) from the CEDAR (Collection of Epidemiologically Derived Associations with Resistance) database. The sawmill package processes timber by performing basic quality control, calculating model parameters (e.g., odds ratios), and performing meta-analyses.
To install sawmill using the bootstrap method (recommended), follow the instructions to download and execute the bootstrap.R script.
- Obtain a timber file.
- The column specification is given in raw_timber_specs.csv.
- To run the interactive pipeline with default settings, use:
sawmill::start_mill()
. - To specify custom settings, use:
sawmill::mill()
.- To see the supported arguements, use:
?sawmill::mill()
.
- To see the supported arguements, use:
A cached copy of a timber object with all resistance-outcomes in CEDAR is included as local_timber
. To use this cached copy, first filter as necessary, then write to a .CSV. Open this file in Excel or another editor to make any required changes (e.g., add meta-analysis groupings), and save as a .XLSX. Then, use sawmill as instructed above. An exmaple of the R code:
library(tidyverse)
local_timber %>%
dplyr::filter(is_archived == FALSE, # Filter out archived references
is_excluded_extract == FALSE, # Filter out excluded references
capture_search_2019 == TRUE) %>% # Select only the iAM.AMR.SEARCH project references
dplyr::select(-is_archived, -is_excluded_extract, -capture_search_2019, -cedar_extract_esr) %>%
readr::write_csv(file.choose())
To update to the latest release, run sawmill::update_sawmill()
.
- CEDAR (Collection of Epidemiologically Derived Associations with Resistance) is a database of factors associated with antimicrobial resistance in the argi-food production system.
- See the documentation.
- iAM.AMR is the Integrated Assessment Model for Antimicrobial Resistance project.
- See the documentation.
- See the GitHub Organization.
According to Hadley Wickham and Jennifer Bryan:
In R, the fundamental unit of shareable code is the package. A package bundles together code, data, documentation, and tests, and is easy to share with others.
When we export queries from CEDAR (which we call timber), they lack important information for modelling. The sawmill package is a collection of functions that prepare the queries for use in the iAM.AMR models.
sawmill
is not currently available in CRAN.
Try accessing the individual function help files -- using R's ?function()
notation -- or consulting the iAM.AMR project's documentation.
sawmill
is set up so that its main functions (a.k.a. main steps in the processing pipeline) exist within their own .R
files, found in the R directory of this repository. For example, the function sawmill::debark()
is found in debark.R. To access the help file for this function, enter ?debark()
or ?sawmill::debark()
into the RStudio console.
Created by @chapb and @phillipsclynn. Maintained by @chapb.
To build sawmill locally: