@@ -144,21 +144,21 @@ make the structure of your data generally look like this:
-
2025-01-16
+
2025-01-17
abcd
Escherichia coli
S
S
-
2025-01-16
+
2025-01-17
abcd
Escherichia coli
S
R
-
2025-01-16
+
2025-01-17
efgh
Escherichia coli
R
@@ -516,7 +516,7 @@ columns based on the antibiotic class that your antibiotic results are
in:
our_data_1st%>%
-select(date, aminoglycosides())
+select(date, aminoglycosides())#> ℹ For aminoglycosides() using column 'GEN' (gentamicin)#> # A tibble: 2,724 × 2#> date GEN
@@ -534,7 +534,7 @@ in:
#> # ℹ 2,714 more rowsour_data_1st%>%
-select(bacteria, betalactams())
+select(bacteria, betalactams())#> ℹ For betalactams() using columns 'AMX' (amoxicillin) and 'AMC'#> (amoxicillin/clavulanic acid)#> # A tibble: 2,724 × 3
@@ -571,7 +571,7 @@ in:
# filtering using AB selectors is also possible:our_data_1st%>%
-filter(any(aminoglycosides()=="R"))
+filter(any(aminoglycosides()=="R"))#> ℹ For aminoglycosides() using column 'GEN' (gentamicin)#> # A tibble: 981 × 9#> patient_id hospital date bacteria AMX AMC CIP GEN first
@@ -589,7 +589,7 @@ in:
#> # ℹ 971 more rowsour_data_1st%>%
-filter(all(betalactams()=="R"))
+filter(all(betalactams()=="R"))#> ℹ For betalactams() using columns 'AMX' (amoxicillin) and 'AMC'#> (amoxicillin/clavulanic acid)#> # A tibble: 462 × 9
@@ -608,7 +608,7 @@ in:
#> # ℹ 452 more rows# even works in base R (since R 3.0):
-our_data_1st[all(betalactams()=="R"), ]
+our_data_1st[all(betalactams()=="R"), ]#> ℹ For betalactams() using columns 'AMX' (amoxicillin) and 'AMC'#> (amoxicillin/clavulanic acid)#> # A tibble: 462 × 9
@@ -690,7 +690,7 @@ should be used. The antibiotics argument in the
previously mentioned antibiotic class selectors:
antibiogram(example_isolates,
- antibiotics =c(aminoglycosides(), carbapenems()))
+ antibiotics =c(aminoglycosides(), carbapenems()))#> ℹ The function aminoglycosides() should be used inside a dplyr verb or#> data.frame call, e.g.:#> • your_data %>% select(aminoglycosides())
@@ -835,7 +835,7 @@ language to be Spanish using the language argument:
antibiogram(example_isolates, mo_transform ="gramstain",
- antibiotics =aminoglycosides(),
+ antibiotics =aminoglycosides(), ab_transform ="name", language ="es")#> ℹ The function aminoglycosides() should be used inside a dplyr verb or
@@ -968,7 +968,7 @@ argument must be used. This can be any column in the data, or e.g. an
ifelse() with calculations based on certain columns:
antibiogram(example_isolates,
- antibiotics =c(aminoglycosides(), carbapenems()),
+ antibiotics =c(aminoglycosides(), carbapenems()), syndromic_group ="ward")#> ℹ The function aminoglycosides() should be used inside a dplyr verb or#> data.frame call, e.g.:
diff --git a/articles/AMR_for_Python.html b/articles/AMR_for_Python.html
index 00152bb4c..f41571d49 100644
--- a/articles/AMR_for_Python.html
+++ b/articles/AMR_for_Python.html
@@ -29,7 +29,7 @@
AMR (for R)
- 2.1.1.9123
+ 2.1.1.9125
diff --git a/articles/AMR_with_tidymodels.html b/articles/AMR_with_tidymodels.html
index 8b908e97d..5d95e24fa 100644
--- a/articles/AMR_with_tidymodels.html
+++ b/articles/AMR_with_tidymodels.html
@@ -29,7 +29,7 @@
AMR (for R)
- 2.1.1.9123
+ 2.1.1.9125
@@ -93,7 +93,7 @@ question about the AMR package.
understanding resistance patterns is crucial for managing effective
treatments. The AMR R package provides robust tools for
analysing AMR data, including convenient antibiotic selector functions
-like aminoglycosides() and betalactams(). In
+like aminoglycosides() and betalactams(). In
this post, we will explore how to use the tidymodels
framework to predict resistance patterns in the
example_isolates dataset.
@@ -110,7 +110,7 @@ antibiotic classes: aminoglycosides and beta-lactams.
microorganism based on microbial data. We will:
Define a logistic regression model for prediction.
Use a structured tidymodels workflow to preprocess,
train, and evaluate the model.
@@ -140,7 +140,7 @@ package.
#> ✖dplyr::filter() masks stats::filter()#> ✖dplyr::lag() masks stats::lag()#> ✖recipes::step() masks stats::step()
-#> • Learn how to get started at https://www.tidymodels.org/start/
+#> • Dig deeper into tidy modeling with R at https://www.tmwr.orglibrary(AMR)# For AMR data analysis# Load the example_isolates dataset
@@ -149,7 +149,7 @@ package.
# Select relevant columns for predictiondata<-example_isolates%>%# select AB results dynamically
-select(mo, aminoglycosides(), betalactams())%>%
+select(mo, aminoglycosides(), betalactams())%>%# replace NAs with NI (not-interpretable)mutate(across(where(is.sir),~replace_na(.x, "NI")),
@@ -171,7 +171,7 @@ package.
drop_na() ensures the model receives complete cases for
@@ -191,7 +191,7 @@ three steps: preprocessing, model specification, and fitting.
# Define the recipe for data preprocessingresistance_recipe<-recipe(mo~., data =data)%>%
-step_corr(c(aminoglycosides(), betalactams()), threshold =0.9)
+step_corr(c(aminoglycosides(), betalactams()), threshold =0.9)resistance_recipe#> #> ──Recipe──────────────────────────────────────────────────────────────────────
@@ -353,7 +353,7 @@ antibiotics. The ROC curve looks like this:
In this post, we demonstrated how to build a machine learning
pipeline with the tidymodels framework and the
AMR package. By combining selector functions like
-aminoglycosides() and betalactams() with
+aminoglycosides() and betalactams() with
tidymodels, we efficiently prepared data, trained a model,
and evaluated its performance.
This workflow is extensible to other antibiotic classes and
diff --git a/articles/EUCAST.html b/articles/EUCAST.html
index 745116b29..3336072b3 100644
--- a/articles/EUCAST.html
+++ b/articles/EUCAST.html
@@ -29,7 +29,7 @@
AMR (for R)
- 2.1.1.9123
+ 2.1.1.9125
diff --git a/articles/MDR.html b/articles/MDR.html
index f217f63db..0072d9a09 100644
--- a/articles/MDR.html
+++ b/articles/MDR.html
@@ -29,7 +29,7 @@
AMR (for R)
- 2.1.1.9123
+ 2.1.1.9125
diff --git a/articles/PCA.html b/articles/PCA.html
index f85a033b6..4ca657a39 100644
--- a/articles/PCA.html
+++ b/articles/PCA.html
@@ -29,7 +29,7 @@
AMR (for R)
- 2.1.1.9123
+ 2.1.1.9125
diff --git a/articles/WHONET.html b/articles/WHONET.html
index 5255c7647..9517b44a2 100644
--- a/articles/WHONET.html
+++ b/articles/WHONET.html
@@ -29,7 +29,7 @@
AMR (for R)
- 2.1.1.9123
+ 2.1.1.9125
diff --git a/articles/datasets.html b/articles/datasets.html
index 85c4ef985..afe6b1880 100644
--- a/articles/datasets.html
+++ b/articles/datasets.html
@@ -29,7 +29,7 @@
AMR (for R)
- 2.1.1.9123
+ 2.1.1.9125
@@ -77,7 +77,7 @@
Provides the full microbiological taxonomy and extensive info on all antimicrobial drugs
Applies all recent CLSI and EUCAST clinical and veterinary breakpoints for MICs, disk zones and ECOFFs
-
Corrects for duplicate isolates, calculates and predicts AMR per antibiotic class
+
Corrects for duplicate isolates, calculates and predicts AMR per antimicrobial class
Integrates with WHONET, ATC, EARS-Net, PubChem, LOINC, SNOMED CT, and NCBI
100% free of costs and dependencies, highly suitable for places with limited resources
@@ -125,7 +125,7 @@
Filtering and selecting data
-
One of the most powerful functions of this package, aside from calculating and plotting AMR, is selecting and filtering based on antibiotic columns. This can be done using the so-called antibiotic class selectors that work in base R, dplyr and data.table:
+
One of the most powerful functions of this package, aside from calculating and plotting AMR, is selecting and filtering based on antimicrobial columns. This can be done using the so-called antimicrobial class selectors, which work in base R, dplyr and data.table:
This base R code will work in any version of R since April 2013 (R-3.0). Moreover, this code works identically with the data.table package, only by starting with:
(this beta version will eventually become v3.0. We’re happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using the instructions here.)
-
A New Milestone: AMR v3.0 with One Health Support (= Human + Veterinary + Environmental)
+
A New Milestone: AMR v3.0 with One Health Support (= Human + Veterinary + Environmental)
This package now supports not only tools for AMR data analysis in clinical settings, but also for veterinary and environmental microbiology. This was made possible through a collaboration with the University of Prince Edward Island’s Atlantic Veterinary College, Canada. To celebrate this great improvement of the package, we also updated the package logo to reflect this change.
-
Breaking
+
Breaking
Removed all functions and references that used the deprecated rsi class, which were all replaced with their sir equivalents over a year ago
-
New
+
New
One Health implementation
Function as.sir() now has extensive support for veterinary breakpoints from CLSI. Use breakpoint_type = "animal" and set the host argument to a variable that contains animal species names.
@@ -96,7 +96,7 @@
Support for tidymodels
-
All antimicrobial selectors (such as aminoglycosides() and betalactams()) are now supported in tidymodels packages such as recipe and parsnip. See for more info our tutorial on using AMR function for predictive modelling.
+
All antimicrobial selectors (such as aminoglycosides() and betalactams()) are now supported in tidymodels packages such as recipe and parsnip. See for more info our tutorial on using these AMR functions for predictive modelling.
Other
@@ -104,7 +104,7 @@
-
Changed
+
Changed
SIR interpretation
It is now possible to use column names for argument ab, mo, and uti: as.sir(..., ab = "column1", mo = "column2", uti = "column3"). This greatly improves the flexibility for users.
Users can now set their own criteria (using regular expressions) as to what should be considered S, I, R, SDD, and NI.
@@ -116,19 +116,21 @@
For this reason, add_total_n is now FALSE at default since the denominators are added to the cells
The ab_transform argument now defaults to "name", displaying antibiotic column names instead of codes
‘Antibiotic selectors’ are now called ‘antimicrobial selectors’ since their scope is broader than just antibiotics. All documentation have been updated, and ab_class() and ab_selector() have been replaced with amr_class() and amr_selector(). The old functions are now deprecated and will be removed in a future version.
When using antimicrobial selectors (such as aminoglycosides()) that exclude non-treatable drugs (such as gentamicin-high), the function now always returns a warning that these can be included using only_treatable = FALSE
+
+
Added a new argument return_all to all selectors, which defaults to TRUE to include any match. With FALSE, the old behaviour, only the first hit for each unique antimicrobial is returned.
+
All selectors can now be run as a separate command to retrieve a vector of all possible antimicrobials that the selector can select
+
antibiotics data set
-
Added “clindamycin inducible screening” as CLI1. Since clindamycin is a lincosamide, the antibiotic selector lincosamides() now contains the argument only_treatable = TRUE (similar to other antibiotic selectors that contain non-treatable drugs)
-
Added Amorolfine (AMO, D01AE16), which is now also part of the antifungals() selector
+
Added “clindamycin inducible screening” as CLI1. Since clindamycin is a lincosamide, the antimicrobial selector lincosamides() now contains the argument only_treatable = TRUE (similar to other antibiotic selectors that contain non-treatable drugs)
+
Added Amorolfine (AMO, D01AE16), which is now also part of the antifungals() selector
Added Efflux (EFF), to allow mapping to AMRFinderPlus
When using antibiotic selectors (such as aminoglycosides()) that exclude non-treatable drugs (such as gentamicin-high), the function now always returns a warning that these can be included using only_treatable = FALSE
-
-
All selectors can now be run as a separate command to retrieve a vector of all possible antimicrobials that the selector can select
-
MICs
Added as valid levels: 4096, 6 powers of 0.0625, and 5 powers of 192 (192, 384, 576, 768, 960)
Added new argument keep_operators to as.mic(). This can be "all" (default), "none", or "edges". This argument is also available in the new rescale_mic() and scale_*_mic() functions.
@@ -165,14 +167,14 @@
-
Other
+
Other
Greatly improved vctrs integration, a Tidyverse package working in the background for many Tidyverse functions. For users, this means that functions such as dplyr’s bind_rows(), rowwise() and c_across() are now supported for e.g. columns of class mic. Despite this, this AMR package is still zero-dependent on any other package, including dplyr and vctrs.
Greatly updated and expanded documentation
Added Larisse Bolton, Jordan Stull, Matthew Saab, and Javier Sanchez as contributors, to thank them for their valuable input
Stopped support for SAS (.xpt) files, since their file structure and extremely inefficient and requires more disk space than GitHub allows in a single commit.
-
Older Versions
+
Older Versions
This changelog only contains changes from AMR v3.0 (October 2024) and later.
These functions are so-called 'Deprecated'. They will be removed in a future version of this package. Using these functions will give a warning with the name of the function it has been replaced by (if there is one).