mirror of
https://github.com/msberends/AMR.git
synced 2025-09-02 13:04:03 +02:00
Compare commits
3 Commits
46f80b1378
...
v3.0.0
Author | SHA1 | Date | |
---|---|---|---|
1710e220dd | |||
79038fed21 | |||
d384b492cf |
@@ -1,3 +1,3 @@
|
|||||||
Version: 2.1.1
|
Version: 3.0.0
|
||||||
Date: 2023-10-20 16:05:16 UTC
|
Date: 2025-06-01 16:52:53 UTC
|
||||||
SHA: ca72a646d041f7f096c4e196e8ae2fb2b176019c
|
SHA: 79038fed2169a25a7fc067c80bb25d9d78be21d9
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 2.1.1.9288
|
Version: 3.0.0
|
||||||
Date: 2025-06-01
|
Date: 2025-06-01
|
||||||
Title: Antimicrobial Resistance Data Analysis
|
Title: Antimicrobial Resistance Data Analysis
|
||||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||||
|
4
NEWS.md
4
NEWS.md
@@ -1,6 +1,4 @@
|
|||||||
# AMR 2.1.1.9288
|
# AMR 3.0.0
|
||||||
|
|
||||||
*(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](https://amr-for-r.org/#get-this-package).)*
|
|
||||||
|
|
||||||
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](https://www.upei.ca/avc), Canada. To celebrate this great improvement of the package, we also updated the package logo to reflect this change.
|
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](https://www.upei.ca/avc), Canada. To celebrate this great improvement of the package, we also updated the package logo to reflect this change.
|
||||||
|
|
||||||
|
@@ -110,7 +110,7 @@
|
|||||||
#'
|
#'
|
||||||
#' There are various antibiogram types, as summarised by Klinker *et al.* (2021, \doi{10.1177/20499361211011373}), and they are all supported by [antibiogram()].
|
#' There are various antibiogram types, as summarised by Klinker *et al.* (2021, \doi{10.1177/20499361211011373}), and they are all supported by [antibiogram()].
|
||||||
#'
|
#'
|
||||||
#' For clinical coverage estimations, **use WISCA whenever possible**, since it provides more precise coverage estimates by accounting for pathogen incidence and antimicrobial susceptibility, as has been shown by Bielicki *et al.* (2020, \doi{10.1001.jamanetworkopen.2019.21124}). See the section *Explaining WISCA* on this page. Do note that WISCA is pathogen-agnostic, meaning that the outcome is not stratied by pathogen, but rather by syndrome.
|
#' For clinical coverage estimations, **use WISCA whenever possible**, since it provides more precise coverage estimates by accounting for pathogen incidence and antimicrobial susceptibility, as has been shown by Bielicki *et al.* (2020, \doi{10.1001/jamanetworkopen.2019.21124}). See the section *Explaining WISCA* on this page. Do note that WISCA is pathogen-agnostic, meaning that the outcome is not stratied by pathogen, but rather by syndrome.
|
||||||
#'
|
#'
|
||||||
#' 1. **Traditional Antibiogram**
|
#' 1. **Traditional Antibiogram**
|
||||||
#'
|
#'
|
||||||
@@ -266,7 +266,7 @@
|
|||||||
#' For more background, interpretation, and examples, see [the WISCA vignette](https://amr-for-r.org/articles/WISCA.html).
|
#' For more background, interpretation, and examples, see [the WISCA vignette](https://amr-for-r.org/articles/WISCA.html).
|
||||||
#' @source
|
#' @source
|
||||||
#' * Bielicki JA *et al.* (2016). **Selecting appropriate empirical antibiotic regimens for paediatric bloodstream infections: application of a Bayesian decision model to local and pooled antimicrobial resistance surveillance data** *Journal of Antimicrobial Chemotherapy* 71(3); \doi{10.1093/jac/dkv397}
|
#' * Bielicki JA *et al.* (2016). **Selecting appropriate empirical antibiotic regimens for paediatric bloodstream infections: application of a Bayesian decision model to local and pooled antimicrobial resistance surveillance data** *Journal of Antimicrobial Chemotherapy* 71(3); \doi{10.1093/jac/dkv397}
|
||||||
#' * Bielicki JA *et al.* (2020). **Evaluation of the coverage of 3 antibiotic regimens for neonatal sepsis in the hospital setting across Asian countries** *JAMA Netw Open.* 3(2):e1921124; \doi{10.1001.jamanetworkopen.2019.21124}
|
#' * Bielicki JA *et al.* (2020). **Evaluation of the coverage of 3 antibiotic regimens for neonatal sepsis in the hospital setting across Asian countries** *JAMA Netw Open.* 3(2):e1921124; \doi{10.1001/jamanetworkopen.2019.21124}
|
||||||
#' * Klinker KP *et al.* (2021). **Antimicrobial stewardship and antibiograms: importance of moving beyond traditional antibiograms**. *Therapeutic Advances in Infectious Disease*, May 5;8:20499361211011373; \doi{10.1177/20499361211011373}
|
#' * Klinker KP *et al.* (2021). **Antimicrobial stewardship and antibiograms: importance of moving beyond traditional antibiograms**. *Therapeutic Advances in Infectious Disease*, May 5;8:20499361211011373; \doi{10.1177/20499361211011373}
|
||||||
#' * Barbieri E *et al.* (2021). **Development of a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) to guide the choice of the empiric antibiotic treatment for urinary tract infection in paediatric patients: a Bayesian approach** *Antimicrobial Resistance & Infection Control* May 1;10(1):74; \doi{10.1186/s13756-021-00939-2}
|
#' * Barbieri E *et al.* (2021). **Development of a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) to guide the choice of the empiric antibiotic treatment for urinary tract infection in paediatric patients: a Bayesian approach** *Antimicrobial Resistance & Infection Control* May 1;10(1):74; \doi{10.1186/s13756-021-00939-2}
|
||||||
#' * **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition**, 2022, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
|
#' * **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition**, 2022, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
|
||||||
|
6
R/data.R
6
R/data.R
@@ -29,7 +29,10 @@
|
|||||||
|
|
||||||
#' Data Sets with `r format(nrow(antimicrobials) + nrow(antivirals), big.mark = " ")` Antimicrobial Drugs
|
#' Data Sets with `r format(nrow(antimicrobials) + nrow(antivirals), big.mark = " ")` Antimicrobial Drugs
|
||||||
#'
|
#'
|
||||||
|
#' @description
|
||||||
#' Two data sets containing all antimicrobials and antivirals. Use [as.ab()] or one of the [`ab_*`][ab_property()] functions to retrieve values from the [antimicrobials] data set. Three identifiers are included in this data set: an antimicrobial ID (`ab`, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (`atc`) as defined by the WHO, and a Compound ID (`cid`) as found in PubChem. Other properties in this data set are derived from one or more of these codes. Note that some drugs have multiple ATC codes.
|
#' Two data sets containing all antimicrobials and antivirals. Use [as.ab()] or one of the [`ab_*`][ab_property()] functions to retrieve values from the [antimicrobials] data set. Three identifiers are included in this data set: an antimicrobial ID (`ab`, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (`atc`) as defined by the WHO, and a Compound ID (`cid`) as found in PubChem. Other properties in this data set are derived from one or more of these codes. Note that some drugs have multiple ATC codes.
|
||||||
|
#'
|
||||||
|
#' **The `antibiotics` data set has been renamed to `antimicrobials`. The old name will be removed in a future version.**
|
||||||
#' @format
|
#' @format
|
||||||
#' ### For the [antimicrobials] data set: a [tibble][tibble::tibble] with `r nrow(antimicrobials)` observations and `r ncol(antimicrobials)` variables:
|
#' ### For the [antimicrobials] data set: a [tibble][tibble::tibble] with `r nrow(antimicrobials)` observations and `r ncol(antimicrobials)` variables:
|
||||||
#' - `ab`\cr antimicrobial ID as used in this package (such as `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available. ***This is a unique identifier.***
|
#' - `ab`\cr antimicrobial ID as used in this package (such as `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available. ***This is a unique identifier.***
|
||||||
@@ -88,6 +91,9 @@
|
|||||||
#' antivirals
|
#' antivirals
|
||||||
"antimicrobials"
|
"antimicrobials"
|
||||||
|
|
||||||
|
#' @rdname antimicrobials
|
||||||
|
"antibiotics"
|
||||||
|
|
||||||
#' @rdname antimicrobials
|
#' @rdname antimicrobials
|
||||||
"antivirals"
|
"antivirals"
|
||||||
|
|
||||||
|
@@ -72,7 +72,7 @@
|
|||||||
#'
|
#'
|
||||||
#' If there are more than two categories and you want to find out which ones are significantly different from their null expectation, you can use the same method of testing each category vs. the sum of all categories, with the Bonferroni correction. You use *G*-tests for each category, of course.
|
#' If there are more than two categories and you want to find out which ones are significantly different from their null expectation, you can use the same method of testing each category vs. the sum of all categories, with the Bonferroni correction. You use *G*-tests for each category, of course.
|
||||||
#' @seealso [chisq.test()]
|
#' @seealso [chisq.test()]
|
||||||
#' @references 1. McDonald, J.H. 2014. **Handbook of Biological Statistics (3rd ed.)**. Sparky House Publishing, Baltimore, Maryland. <http://www.biostathandbook.com/gtestgof.html>.
|
#' @references 1. McDonald, J.H. 2014. **Handbook of Biological Statistics (3rd ed.)**. Sparky House Publishing, Baltimore, Maryland.
|
||||||
#' @source The code for this function is identical to that of [chisq.test()], except that:
|
#' @source The code for this function is identical to that of [chisq.test()], except that:
|
||||||
#' - The calculation of the statistic was changed to \eqn{2 * sum(x * log(x / E))}
|
#' - The calculation of the statistic was changed to \eqn{2 * sum(x * log(x / E))}
|
||||||
#' - Yates' continuity correction was removed as it does not apply to a *G*-test
|
#' - Yates' continuity correction was removed as it does not apply to a *G*-test
|
||||||
|
6
R/mdro.R
6
R/mdro.R
@@ -204,14 +204,14 @@ mdro <- function(x = NULL,
|
|||||||
}
|
}
|
||||||
if (is.character(vanA)) {
|
if (is.character(vanA)) {
|
||||||
meet_criteria(vanA, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
meet_criteria(vanA, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||||
vanA <- x[[VanA]]
|
vanA <- x[[vanA]]
|
||||||
meet_criteria(vanA, allow_class = "logical", allow_NA = TRUE)
|
meet_criteria(vanA, allow_class = "logical", allow_NA = TRUE)
|
||||||
} else if (length(vanA) == 1) {
|
} else if (length(vanA) == 1) {
|
||||||
vanA <- rep(vanA, NROW(x))
|
vanA <- rep(vanA, NROW(x))
|
||||||
}
|
}
|
||||||
if (is.character(vanB)) {
|
if (is.character(vanB)) {
|
||||||
meet_criteria(vanB, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
meet_criteria(vanB, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||||
vanB <- x[[VanB]]
|
vanB <- x[[vanB]]
|
||||||
meet_criteria(vanB, allow_class = "logical", allow_NA = TRUE)
|
meet_criteria(vanB, allow_class = "logical", allow_NA = TRUE)
|
||||||
} else if (length(vanB) == 1) {
|
} else if (length(vanB) == 1) {
|
||||||
vanB <- rep(vanB, NROW(x))
|
vanB <- rep(vanB, NROW(x))
|
||||||
@@ -1490,7 +1490,7 @@ mdro <- function(x = NULL,
|
|||||||
if (length(ESBLs) > 0) {
|
if (length(ESBLs) > 0) {
|
||||||
trans_tbl(
|
trans_tbl(
|
||||||
2, # positive, unconfirmed
|
2, # positive, unconfirmed
|
||||||
rows = which(x$order == "Enterobacterales" & x[[ESBLs[1]]] == "R" & x[[ESBLs[2]]] == "R" & is.na(esbl)),
|
rows = which(x$order == "Enterobacterales" & col_values(x, ESBLs[1]) == "R" & col_values(x, ESBLs[2]) == "R" & is.na(esbl)),
|
||||||
cols = c(AMX %or% AMP, cephalosporins_3rd),
|
cols = c(AMX %or% AMP, cephalosporins_3rd),
|
||||||
any_all = "all",
|
any_all = "all",
|
||||||
reason = "Enterobacterales: potential ESBL"
|
reason = "Enterobacterales: potential ESBL"
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
\source{
|
\source{
|
||||||
\itemize{
|
\itemize{
|
||||||
\item Bielicki JA \emph{et al.} (2016). \strong{Selecting appropriate empirical antibiotic regimens for paediatric bloodstream infections: application of a Bayesian decision model to local and pooled antimicrobial resistance surveillance data} \emph{Journal of Antimicrobial Chemotherapy} 71(3); \doi{10.1093/jac/dkv397}
|
\item Bielicki JA \emph{et al.} (2016). \strong{Selecting appropriate empirical antibiotic regimens for paediatric bloodstream infections: application of a Bayesian decision model to local and pooled antimicrobial resistance surveillance data} \emph{Journal of Antimicrobial Chemotherapy} 71(3); \doi{10.1093/jac/dkv397}
|
||||||
\item Bielicki JA \emph{et al.} (2020). \strong{Evaluation of the coverage of 3 antibiotic regimens for neonatal sepsis in the hospital setting across Asian countries} \emph{JAMA Netw Open.} 3(2):e1921124; \doi{10.1001.jamanetworkopen.2019.21124}
|
\item Bielicki JA \emph{et al.} (2020). \strong{Evaluation of the coverage of 3 antibiotic regimens for neonatal sepsis in the hospital setting across Asian countries} \emph{JAMA Netw Open.} 3(2):e1921124; \doi{10.1001/jamanetworkopen.2019.21124}
|
||||||
\item Klinker KP \emph{et al.} (2021). \strong{Antimicrobial stewardship and antibiograms: importance of moving beyond traditional antibiograms}. \emph{Therapeutic Advances in Infectious Disease}, May 5;8:20499361211011373; \doi{10.1177/20499361211011373}
|
\item Klinker KP \emph{et al.} (2021). \strong{Antimicrobial stewardship and antibiograms: importance of moving beyond traditional antibiograms}. \emph{Therapeutic Advances in Infectious Disease}, May 5;8:20499361211011373; \doi{10.1177/20499361211011373}
|
||||||
\item Barbieri E \emph{et al.} (2021). \strong{Development of a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) to guide the choice of the empiric antibiotic treatment for urinary tract infection in paediatric patients: a Bayesian approach} \emph{Antimicrobial Resistance & Infection Control} May 1;10(1):74; \doi{10.1186/s13756-021-00939-2}
|
\item Barbieri E \emph{et al.} (2021). \strong{Development of a Weighted-Incidence Syndromic Combination Antibiogram (WISCA) to guide the choice of the empiric antibiotic treatment for urinary tract infection in paediatric patients: a Bayesian approach} \emph{Antimicrobial Resistance & Infection Control} May 1;10(1):74; \doi{10.1186/s13756-021-00939-2}
|
||||||
\item \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition}, 2022, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}.
|
\item \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition}, 2022, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}.
|
||||||
@@ -163,7 +163,7 @@ Set \code{digits} (defaults to \code{0}) to alter the rounding of the susceptibi
|
|||||||
|
|
||||||
There are various antibiogram types, as summarised by Klinker \emph{et al.} (2021, \doi{10.1177/20499361211011373}), and they are all supported by \code{\link[=antibiogram]{antibiogram()}}.
|
There are various antibiogram types, as summarised by Klinker \emph{et al.} (2021, \doi{10.1177/20499361211011373}), and they are all supported by \code{\link[=antibiogram]{antibiogram()}}.
|
||||||
|
|
||||||
For clinical coverage estimations, \strong{use WISCA whenever possible}, since it provides more precise coverage estimates by accounting for pathogen incidence and antimicrobial susceptibility, as has been shown by Bielicki \emph{et al.} (2020, \doi{10.1001.jamanetworkopen.2019.21124}). See the section \emph{Explaining WISCA} on this page. Do note that WISCA is pathogen-agnostic, meaning that the outcome is not stratied by pathogen, but rather by syndrome.
|
For clinical coverage estimations, \strong{use WISCA whenever possible}, since it provides more precise coverage estimates by accounting for pathogen incidence and antimicrobial susceptibility, as has been shown by Bielicki \emph{et al.} (2020, \doi{10.1001/jamanetworkopen.2019.21124}). See the section \emph{Explaining WISCA} on this page. Do note that WISCA is pathogen-agnostic, meaning that the outcome is not stratied by pathogen, but rather by syndrome.
|
||||||
\enumerate{
|
\enumerate{
|
||||||
\item \strong{Traditional Antibiogram}
|
\item \strong{Traditional Antibiogram}
|
||||||
|
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
\docType{data}
|
\docType{data}
|
||||||
\name{antimicrobials}
|
\name{antimicrobials}
|
||||||
\alias{antimicrobials}
|
\alias{antimicrobials}
|
||||||
|
\alias{antibiotics}
|
||||||
\alias{antivirals}
|
\alias{antivirals}
|
||||||
\title{Data Sets with 617 Antimicrobial Drugs}
|
\title{Data Sets with 617 Antimicrobial Drugs}
|
||||||
\format{
|
\format{
|
||||||
@@ -49,6 +50,8 @@ LOINC:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
An object of class \code{deprecated_amr_dataset} (inherits from \code{tbl_df}, \code{tbl}, \code{data.frame}) with 497 rows and 14 columns.
|
||||||
|
|
||||||
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 120 rows and 11 columns.
|
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 120 rows and 11 columns.
|
||||||
}
|
}
|
||||||
\source{
|
\source{
|
||||||
@@ -61,10 +64,14 @@ An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) w
|
|||||||
\usage{
|
\usage{
|
||||||
antimicrobials
|
antimicrobials
|
||||||
|
|
||||||
|
antibiotics
|
||||||
|
|
||||||
antivirals
|
antivirals
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Two data sets containing all antimicrobials and antivirals. Use \code{\link[=as.ab]{as.ab()}} or one of the \code{\link[=ab_property]{ab_*}} functions to retrieve values from the \link{antimicrobials} data set. Three identifiers are included in this data set: an antimicrobial ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes. Note that some drugs have multiple ATC codes.
|
Two data sets containing all antimicrobials and antivirals. Use \code{\link[=as.ab]{as.ab()}} or one of the \code{\link[=ab_property]{ab_*}} functions to retrieve values from the \link{antimicrobials} data set. Three identifiers are included in this data set: an antimicrobial ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes. Note that some drugs have multiple ATC codes.
|
||||||
|
|
||||||
|
\strong{The \code{antibiotics} data set has been renamed to \code{antimicrobials}. The old name will be removed in a future version.}
|
||||||
}
|
}
|
||||||
\details{
|
\details{
|
||||||
Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}. Do note that ATC codes are not unique. For example, J01CR02 is officially the ATC code for "amoxicillin and beta-lactamase inhibitor". Consequently, these two items from the \link{antimicrobials} data set both return \code{"J01CR02"}:
|
Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}. Do note that ATC codes are not unique. For example, J01CR02 is officially the ATC code for "amoxicillin and beta-lactamase inhibitor". Consequently, these two items from the \link{antimicrobials} data set both return \code{"J01CR02"}:
|
||||||
|
@@ -133,7 +133,7 @@ g.test(x)
|
|||||||
}
|
}
|
||||||
\references{
|
\references{
|
||||||
\enumerate{
|
\enumerate{
|
||||||
\item McDonald, J.H. 2014. \strong{Handbook of Biological Statistics (3rd ed.)}. Sparky House Publishing, Baltimore, Maryland. \url{http://www.biostathandbook.com/gtestgof.html}.
|
\item McDonald, J.H. 2014. \strong{Handbook of Biological Statistics (3rd ed.)}. Sparky House Publishing, Baltimore, Maryland.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
\seealso{
|
\seealso{
|
||||||
|
@@ -48,7 +48,7 @@ test_that("test-mdro.R", {
|
|||||||
# example_isolates should have these finding using Dutch guidelines
|
# example_isolates should have these finding using Dutch guidelines
|
||||||
expect_equal(
|
expect_equal(
|
||||||
as.double(table(outcome)),
|
as.double(table(outcome)),
|
||||||
c(1977, 23, 0)
|
c(1977, 21, 2)
|
||||||
)
|
)
|
||||||
|
|
||||||
expect_equal(
|
expect_equal(
|
||||||
|
Reference in New Issue
Block a user