mirror of
https://github.com/msberends/AMR.git
synced 2025-04-15 13:10:32 +02:00
(v2.1.1.9195) add BTL-S
, fix ranks in unknown microorganisms
This commit is contained in:
parent
a7ef22a21e
commit
9aab129ea6
@ -1,6 +1,6 @@
|
||||
Package: AMR
|
||||
Version: 2.1.1.9194
|
||||
Date: 2025-03-12
|
||||
Version: 2.1.1.9195
|
||||
Date: 2025-03-13
|
||||
Title: Antimicrobial Resistance Data Analysis
|
||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||
data analysis and to work with microbial and antimicrobial properties by
|
||||
|
6
NEWS.md
6
NEWS.md
@ -1,4 +1,4 @@
|
||||
# AMR 2.1.1.9194
|
||||
# AMR 2.1.1.9195
|
||||
|
||||
*(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://msberends.github.io/AMR/#latest-development-version).)*
|
||||
|
||||
@ -62,8 +62,8 @@ This package now supports not only tools for AMR data analysis in clinical setti
|
||||
* The selectors `lincosamides()` and `macrolides()` do not overlap anymore - each antibiotic is now classified as either of these and not both
|
||||
* Fixed selector `fluoroquinolones()`, which now really only selects second-generation quinolones and up (first-generation quinolones do not contain a fluorine group)
|
||||
* `antimicrobials` data set
|
||||
* Added agents used for screening, with an ID all ending with `-S`: benzylpenicillin screening test (`PEN-S`), clindamycin inducible screening test (`CLI-S`), nalidixic acid screening test (`NAL-S`), norfloxacin screening test (`NOR-S`), oxacillin screening test (`OXA-S`), pefloxacin screening test (`PEF-S`), and tetracycline screening test (`TCY-S`). The ID of cefoxitin screening was renamed from `FOX1` to `FOX-S`, while the old code remains to work.
|
||||
* Since clindamycin is a lincosamide, the antimicrobial selector `lincosamides()` now contains the argument `only_treatable = TRUE` (similar to other antimicrobial selectors that contain non-treatable drugs)
|
||||
* Added agents used for screening, with an ID all ending with `-S`: benzylpenicillin screening test (`PEN-S`), beta-lactamase screening test (`BTL-S`), clindamycin inducible screening test (`CLI-S`), nalidixic acid screening test (`NAL-S`), norfloxacin screening test (`NOR-S`), oxacillin screening test (`OXA-S`), pefloxacin screening test (`PEF-S`), and tetracycline screening test (`TCY-S`). The ID of cefoxitin screening was renamed from `FOX1` to `FOX-S`, while the old code remains to work.
|
||||
* For this reason, the antimicrobial selectors `lincosamides()`, `isoxazolylpenicillins()`, `quinolones()`, `fluoroquinolones()`, `tetracyclines()` now contain the argument `only_treatable = TRUE` (similar to other antimicrobial 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
|
||||
* Added tigemonam (`TNM`), a monobactam
|
||||
|
@ -1,6 +1,6 @@
|
||||
Metadata-Version: 2.2
|
||||
Name: AMR
|
||||
Version: 2.1.1.9194
|
||||
Version: 2.1.1.9195
|
||||
Summary: A Python wrapper for the AMR R package
|
||||
Home-page: https://github.com/msberends/AMR
|
||||
Author: Matthijs Berends
|
||||
|
BIN
PythonPackage/AMR/dist/amr-2.1.1.9194.tar.gz
vendored
BIN
PythonPackage/AMR/dist/amr-2.1.1.9194.tar.gz
vendored
Binary file not shown.
Binary file not shown.
BIN
PythonPackage/AMR/dist/amr-2.1.1.9195.tar.gz
vendored
Normal file
BIN
PythonPackage/AMR/dist/amr-2.1.1.9195.tar.gz
vendored
Normal file
Binary file not shown.
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name='AMR',
|
||||
version='2.1.1.9194',
|
||||
version='2.1.1.9195',
|
||||
packages=find_packages(),
|
||||
install_requires=[
|
||||
'rpy2',
|
||||
|
@ -338,10 +338,10 @@ cephalosporins_5th <- function(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
fluoroquinolones <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
fluoroquinolones <- function(only_sir_columns = FALSE, only_treatable = TRUE, return_all = TRUE, ...) {
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(return_all, allow_class = "logical", has_length = 1)
|
||||
amr_select_exec("fluoroquinolones", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
amr_select_exec("fluoroquinolones", only_sir_columns = only_sir_columns, only_treatable = only_treatable, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
@ -354,10 +354,10 @@ glycopeptides <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
isoxazolylpenicillins <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
isoxazolylpenicillins <- function(only_sir_columns = FALSE, only_treatable = TRUE, return_all = TRUE, ...) {
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(return_all, allow_class = "logical", has_length = 1)
|
||||
amr_select_exec("isoxazolylpenicillins", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
amr_select_exec("isoxazolylpenicillins", only_sir_columns = only_sir_columns, only_treatable = only_treatable, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
@ -436,10 +436,10 @@ polymyxins <- function(only_sir_columns = FALSE, only_treatable = TRUE, return_a
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
quinolones <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
quinolones <- function(only_sir_columns = FALSE, only_treatable = TRUE, return_all = TRUE, ...) {
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(return_all, allow_class = "logical", has_length = 1)
|
||||
amr_select_exec("quinolones", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
amr_select_exec("quinolones", only_sir_columns = only_sir_columns, only_treatable = only_treatable, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
@ -460,10 +460,10 @@ streptogramins <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
tetracyclines <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
tetracyclines <- function(only_sir_columns = FALSE, only_treatable = TRUE, return_all = TRUE, ...) {
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(return_all, allow_class = "logical", has_length = 1)
|
||||
amr_select_exec("tetracyclines", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
amr_select_exec("tetracyclines", only_sir_columns = only_sir_columns, only_treatable = only_treatable, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
@ -676,12 +676,12 @@ amr_select_exec <- function(function_name,
|
||||
}
|
||||
|
||||
# untreatable drugs
|
||||
untreatable <- AMR_env$AB_lookup$ab[which(AMR_env$AB_lookup$name %like% "(-high|EDTA|polysorbate|macromethod|screening|nacubactam)")]
|
||||
if (!is.null(vars_df) && only_treatable == TRUE) {
|
||||
untreatable <- AMR_env$AB_lookup[which(AMR_env$AB_lookup$name %like% "(-high|EDTA|polysorbate|macromethod|screening|nacubactam)"), "ab", drop = TRUE]
|
||||
if (any(untreatable %in% names(ab_in_data))) {
|
||||
if (message_not_thrown_before(function_name, "amr_class", "untreatable")) {
|
||||
warning_(
|
||||
"in `", function_name, "()`: some drugs were ignored since they cannot be used for treating patients: ",
|
||||
"in `", function_name, "()`: some drugs were ignored since they cannot be used for treatment: ",
|
||||
vector_and(
|
||||
ab_name(names(ab_in_data)[names(ab_in_data) %in% untreatable],
|
||||
language = NULL,
|
||||
@ -749,6 +749,26 @@ amr_select_exec <- function(function_name,
|
||||
if (is.null(vars_df)) {
|
||||
# no data found, no antimicrobials, so no input. Happens if users run e.g. `aminoglycosides()` as a separate command.
|
||||
# print.ab will cover the additional printing text
|
||||
if (only_treatable == TRUE) {
|
||||
if (message_not_thrown_before(function_name, "amr_class", "untreatable")) {
|
||||
message_(
|
||||
"in `", function_name, "()`: ",
|
||||
vector_and(
|
||||
paste0(
|
||||
ab_name(abx[abx %in% untreatable],
|
||||
language = NULL,
|
||||
tolower = TRUE
|
||||
),
|
||||
" (`", abx[abx %in% untreatable], "`)"
|
||||
),
|
||||
quotes = FALSE,
|
||||
sort = TRUE,
|
||||
initial_captital = TRUE
|
||||
), ifelse(length(abx[abx %in% untreatable]) == 1, " is ", " are "), "not included since `only_treatable = TRUE`."
|
||||
)
|
||||
}
|
||||
abx <- abx[!abx %in% untreatable]
|
||||
}
|
||||
return(structure(sort(abx), amr_selector = function_name))
|
||||
}
|
||||
|
||||
|
17
R/sir.R
17
R/sir.R
@ -1270,10 +1270,13 @@ as_sir_method <- function(method_short,
|
||||
}
|
||||
}
|
||||
|
||||
mo_grams <- suppressWarnings(suppressMessages(mo_gramstain(df_unique$mo, language = NULL, keep_synonyms = FALSE)))
|
||||
|
||||
# run the rules (df_unique is a row combination per mo/ab/uti/host) ----
|
||||
for (i in seq_len(nrow(df_unique))) {
|
||||
p$tick()
|
||||
mo_current <- df_unique[i, "mo", drop = TRUE]
|
||||
mo_gram_current <- mo_grams[i]
|
||||
ab_current <- df_unique[i, "ab", drop = TRUE]
|
||||
host_current <- df_unique[i, "host", drop = TRUE]
|
||||
uti_current <- df_unique[i, "uti", drop = TRUE]
|
||||
@ -1300,12 +1303,25 @@ as_sir_method <- function(method_short,
|
||||
mo_current_class <- AMR_env$MO_lookup$mo[match(AMR_env$MO_lookup$class[match(mo_current, AMR_env$MO_lookup$mo)], AMR_env$MO_lookup$fullname)]
|
||||
mo_current_rank <- AMR_env$MO_lookup$rank[match(mo_current, AMR_env$MO_lookup$mo)]
|
||||
mo_current_name <- AMR_env$MO_lookup$fullname[match(mo_current, AMR_env$MO_lookup$mo)]
|
||||
mo_current_oxygen_tolerance <- AMR_env$MO_lookup$oxygen_tolerance[match(mo_current, AMR_env$MO_lookup$mo)]
|
||||
if (mo_current %in% AMR::microorganisms.groups$mo) {
|
||||
# get the species group (might be more than 1 entry)
|
||||
mo_current_species_group <- AMR::microorganisms.groups$mo_group[which(AMR::microorganisms.groups$mo == mo_current)]
|
||||
} else {
|
||||
mo_current_species_group <- NULL
|
||||
}
|
||||
mo_current_gram <- structure(character(0), class = c("mo", "character"))
|
||||
if (identical(mo_gram_current, "Gram-negative")) {
|
||||
mo_current_gram <- c(mo_current_gram, "B_GRAMN")
|
||||
if (identical(mo_current_oxygen_tolerance, "anaerobe")) {
|
||||
mo_current_gram <- c(mo_current_gram, "B_ANAER", "B_ANAER-NEG")
|
||||
}
|
||||
} else if (identical(mo_gram_current, "Gram-positive")) {
|
||||
mo_current_gram <- c(mo_current_gram, "B_GRAMP")
|
||||
if (identical(mo_current_oxygen_tolerance, "anaerobe")) {
|
||||
mo_current_gram <- c(mo_current_gram, "B_ANAER", "B_ANAER-POS")
|
||||
}
|
||||
}
|
||||
mo_current_other <- structure("UNKNOWN", class = c("mo", "character"))
|
||||
# formatted for notes
|
||||
mo_formatted <- mo_current_name
|
||||
@ -1325,6 +1341,7 @@ as_sir_method <- function(method_short,
|
||||
mo_current, mo_current_genus, mo_current_family,
|
||||
mo_current_order, mo_current_class,
|
||||
mo_current_species_group,
|
||||
mo_current_gram,
|
||||
mo_current_other
|
||||
))
|
||||
|
||||
|
BIN
R/sysdata.rda
BIN
R/sysdata.rda
Binary file not shown.
@ -61,7 +61,7 @@ ab_selector <- function(...) {
|
||||
deprecation_warning <- function(old = NULL, new = NULL, fn = NULL, extra_msg = NULL, is_function = FALSE, is_dataset = FALSE, is_argument = FALSE) {
|
||||
if (is.null(old)) {
|
||||
warning_(extra_msg)
|
||||
} else {
|
||||
} else if (message_not_thrown_before("deprecation", old, new, entire_session = TRUE)) {
|
||||
env <- paste0("deprecated_", old)
|
||||
if (!env %in% names(AMR_env)) {
|
||||
AMR_env[[paste0("deprecated_", old)]] <- 1
|
||||
|
@ -1 +1 @@
|
||||
a5a28ebde6fc79e231c0a6bcfcd8818d
|
||||
b52ea0014f63a73b9369475611c74644
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -39,6 +39,7 @@
|
||||
"PEN" 5904 "Benzylpenicillin" "Beta-lactams/penicillins" "J01CE01,S01AA14" "Combinations of antibacterials" "Combinations of antibacterials" "bepe,pen,peni,peni g,penicillin,penicillin g,pg" "abbocillin,ayercillin,bencilpenicilina,benzopenicillin,benzylpenicilline,benzylpenicilling,benzylpenicillinum,bicillin,cillora,cilloral,cilopen,compocilling,cosmopen,dropcillin,freepenicilling,freepenicillinii,galofak,gelacillin,liquacillin,megacillin,pencilling,penicillin,penicilling,pentids,permapen,pfizerpen,pfizerpeng,pharmacillin,pradupen,specillineg,ursopen" 3.6 "g" ""
|
||||
"PEN-S" "Benzylpenicillin screening test" "Beta-lactams/penicillins" "NA" "pen screen" "" ""
|
||||
"BES" 10178705 "Besifloxacin" "Fluoroquinolones" "S01AE08" "" "besivance" "73606-6,73628-0,73651-2"
|
||||
"BTL-S" "Beta-lactamase screening test" "Other" "NA" "beta-lactamase,betalactamase,bl screen,blt screen" "" ""
|
||||
"BIA" 71339 "Biapenem" "Carbapenems" "J01DH05" "" "biapenern,bipenem,omegacin" 1.2 "g" "41665-1,41666-9,41667-7,41728-7"
|
||||
"BCZ" 65807 "Bicyclomycin" "Other antibacterials" "NA" "bicozamycin" "aizumycin,bacfeed,bacteron,bicozamicina,bicozamycin,bicozamycine,bicozamycinum" ""
|
||||
"BLM" 5360373 "Bleomycin" "Glycopeptides" "L01DC01" "" "ble,bleo" ""
|
||||
|
Binary file not shown.
@ -1 +1 @@
|
||||
dbf340329f7547aba18ecaa09e990b79
|
||||
82e205c8e726381a75ce3040f238f776
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
This knowledge base contains all context you must know about the AMR package for R. You are a GPT trained to be an assistant for the AMR package in R. You are an incredible R specialist, especially trained in this package and in the tidyverse.
|
||||
|
||||
First and foremost, you are trained on version 2.1.1.9194. Remember this whenever someone asks which AMR package version you’re at.
|
||||
First and foremost, you are trained on version 2.1.1.9195. Remember this whenever someone asks which AMR package version you’re at.
|
||||
|
||||
Below are the contents of the file, the file, and all the files (documentation) in the package. Every file content is split using 100 hypens.
|
||||
----------------------------------------------------------------------------------------------------
|
||||
@ -732,7 +732,7 @@ THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/AMR-deprecated.Rd':
|
||||
\alias{ab_selector}
|
||||
\title{Deprecated Functions}
|
||||
\format{
|
||||
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 494 rows and 14 columns.
|
||||
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 495 rows and 14 columns.
|
||||
}
|
||||
\usage{
|
||||
ab_class(...)
|
||||
@ -851,7 +851,7 @@ The \code{AMR} package is a \href{https://msberends.github.io/AMR/#copyright}{fr
|
||||
|
||||
This work was published in the Journal of Statistical Software (Volume 104(3); \doi{10.18637/jss.v104.i03}) and formed the basis of two PhD theses (\doi{10.33612/diss.177417131} and \doi{10.33612/diss.192486375}).
|
||||
|
||||
After installing this package, R knows \href{https://msberends.github.io/AMR/reference/microorganisms.html}{\strong{~79 000 microorganisms}} (updated June 2024) and all \href{https://msberends.github.io/AMR/reference/antimicrobials.html}{\strong{~610 antibiotic, antimycotic and antiviral drugs}} by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI and EUCAST are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). \strong{It was designed to work in any setting, including those with very limited resources}. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the public \href{https://www.rug.nl}{University of Groningen}, in collaboration with non-profit organisations \href{https://www.certe.nl}{Certe Medical Diagnostics and Advice Foundation} and \href{https://www.umcg.nl}{University Medical Center Groningen}.
|
||||
After installing this package, R knows \href{https://msberends.github.io/AMR/reference/microorganisms.html}{\strong{~79 000 microorganisms}} (updated June 2024) and all \href{https://msberends.github.io/AMR/reference/antimicrobials.html}{\strong{~620 antibiotic, antimycotic and antiviral drugs}} by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI and EUCAST are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). \strong{It was designed to work in any setting, including those with very limited resources}. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the public \href{https://www.rug.nl}{University of Groningen}, in collaboration with non-profit organisations \href{https://www.certe.nl}{Certe Medical Diagnostics and Advice Foundation} and \href{https://www.umcg.nl}{University Medical Center Groningen}.
|
||||
|
||||
The \code{AMR} package is available in English, Chinese, Czech, Danish, Dutch, Finnish, French, German, Greek, Italian, Japanese, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish, Turkish, and Ukrainian. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages.
|
||||
}
|
||||
@ -2176,11 +2176,13 @@ cephalosporins_4th(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
cephalosporins_5th(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
fluoroquinolones(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
fluoroquinolones(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
|
||||
glycopeptides(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
isoxazolylpenicillins(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
isoxazolylpenicillins(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
|
||||
lincosamides(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
@ -2202,13 +2204,15 @@ phenicols(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
polymyxins(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
|
||||
quinolones(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
quinolones(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
|
||||
rifamycins(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
streptogramins(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
tetracyclines(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
tetracyclines(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
|
||||
trimethoprims(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
@ -2499,9 +2503,9 @@ THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/antimicrobials.Rd':
|
||||
\name{antimicrobials}
|
||||
\alias{antimicrobials}
|
||||
\alias{antivirals}
|
||||
\title{Data Sets with 614 Antimicrobial Drugs}
|
||||
\title{Data Sets with 615 Antimicrobial Drugs}
|
||||
\format{
|
||||
\subsection{For the \link{antimicrobials} data set: a \link[tibble:tibble]{tibble} with 494 observations and 14 variables:}{
|
||||
\subsection{For the \link{antimicrobials} data set: a \link[tibble:tibble]{tibble} with 495 observations and 14 variables:}{
|
||||
\itemize{
|
||||
\item \code{ab}\cr antimcrobial ID as used in this package (such as \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available. \emph{\strong{This is a unique identifier.}}
|
||||
\item \code{cid}\cr Compound ID as found in PubChem. \emph{\strong{This is a unique identifier.}}
|
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
eb00595a506d917ec1f00688c2cc41cf
|
||||
9c53db03dcf9c98ef571fcc6c16d0a68
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,13 +1,13 @@
|
||||
"mo" "fullname" "status" "kingdom" "phylum" "class" "order" "family" "genus" "species" "subspecies" "rank" "ref" "oxygen_tolerance" "source" "lpsn" "lpsn_parent" "lpsn_renamed_to" "mycobank" "mycobank_parent" "mycobank_renamed_to" "gbif" "gbif_parent" "gbif_renamed_to" "prevalence" "snomed"
|
||||
"B_GRAMN" "(unknown Gram-negatives)" "unknown" "Bacteria" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "subspecies" "manually added" 2 ""
|
||||
"B_GRAMP" "(unknown Gram-positives)" "unknown" "Bacteria" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "subspecies" "manually added" 2 ""
|
||||
"B_ANAER-NEG" "(unknown anaerobic Gram-negatives)" "unknown" "Bacteria" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "subspecies" "manually added" 2 ""
|
||||
"B_ANAER-POS" "(unknown anaerobic Gram-positives)" "unknown" "Bacteria" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "subspecies" "manually added" 2 ""
|
||||
"B_ANAER" "(unknown anaerobic bacteria)" "unknown" "Bacteria" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "subspecies" "manually added" 2 ""
|
||||
"F_FUNGUS" "(unknown fungus)" "unknown" "Fungi" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "subspecies" "manually added" 2 ""
|
||||
"UNKNOWN" "(unknown name)" "unknown" "(unknown kingdom)" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "subspecies" "manually added" 2 ""
|
||||
"P_PROTOZOAN" "(unknown protozoan)" "unknown" "Protozoa" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "subspecies" "manually added" 2 ""
|
||||
"F_YEAST" "(unknown yeast)" "unknown" "Fungi" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "subspecies" "manually added" 2 ""
|
||||
"B_GRAMN" "(unknown Gram-negatives)" "unknown" "Bacteria" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "(unknown rank)" "manually added" 2 ""
|
||||
"B_GRAMP" "(unknown Gram-positives)" "unknown" "Bacteria" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "(unknown rank)" "manually added" 2 ""
|
||||
"B_ANAER-NEG" "(unknown anaerobic Gram-negatives)" "unknown" "Bacteria" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "(unknown rank)" "manually added" 2 ""
|
||||
"B_ANAER-POS" "(unknown anaerobic Gram-positives)" "unknown" "Bacteria" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "(unknown rank)" "manually added" 2 ""
|
||||
"B_ANAER" "(unknown anaerobic bacteria)" "unknown" "Bacteria" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "(unknown rank)" "manually added" 2 ""
|
||||
"F_FUNGUS" "(unknown fungus)" "unknown" "Fungi" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "(unknown rank)" "manually added" 2 ""
|
||||
"UNKNOWN" "(unknown name)" "unknown" "(unknown kingdom)" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "(unknown rank)" "manually added" 2 ""
|
||||
"P_PROTOZOAN" "(unknown protozoan)" "unknown" "Protozoa" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "(unknown rank)" "manually added" 2 ""
|
||||
"F_YEAST" "(unknown yeast)" "unknown" "Fungi" "(unknown phylum)" "(unknown class)" "(unknown order)" "(unknown family)" "(unknown genus)" "(unknown species)" "(unknown subspecies)" "(unknown rank)" "manually added" 2 ""
|
||||
"F_AABRN" "Aabaarnia" "unknown" "Fungi" "Ascomycota" "Lecanoromycetes" "Ostropales" "" "Aabaarnia" "" "" "genus" "manually added" "90490" "1279" 2 ""
|
||||
"B_[FAM]_ABDTBCTR" "Abditibacteriaceae" "accepted" "Bacteria" "Abditibacteriota" "Abditibacteriia" "Abditibacteriales" "Abditibacteriaceae" "" "" "" "family" "Tahon et al., 2018" "LPSN" "4812" "4982" "10678443" "10853930" 2 ""
|
||||
"B_[ORD]_ABDTBCTR" "Abditibacteriales" "accepted" "Bacteria" "Abditibacteriota" "Abditibacteriia" "Abditibacteriales" "" "" "" "" "order" "Tahon et al., 2018" "LPSN" "4982" "29679" "10853930" 2 ""
|
||||
|
Binary file not shown.
@ -789,6 +789,21 @@ antimicrobials[which(antimicrobials$ab == "CLI-S"), "abbreviations"][[1]] <- lis
|
||||
# add all screenings
|
||||
antimicrobials <- antimicrobials |>
|
||||
bind_rows(
|
||||
antimicrobials |>
|
||||
filter(ab == "EFF") |>
|
||||
mutate(ab = "BTL-S",
|
||||
name = paste("Beta-lactamase", "screening test"),
|
||||
cid = NA_real_,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("beta-lactamase", "betalactamase", "bl screen", "blt screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))),
|
||||
antimicrobials |>
|
||||
filter(ab == "PEN") |>
|
||||
mutate(ab = "PEN-S",
|
||||
|
@ -346,14 +346,14 @@ breakpoints_new$mo[breakpoints_new$mo == "B_STPHY" & breakpoints_new$ab == "NIT"
|
||||
# determine rank again now that some changes were made on taxonomic level (genus -> species)
|
||||
breakpoints_new <- breakpoints_new %>%
|
||||
mutate(rank_index = case_when(
|
||||
is.na(mo_rank(mo, keep_synonyms = TRUE)) ~ 6, # for UNKNOWN, B_GRAMN, B_ANAER, B_ANAER-NEG, etc.
|
||||
mo_rank(mo, keep_synonyms = TRUE) %like% "(infra|sub)" ~ 1,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "species" ~ 2,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "species group" ~ 2.5,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "genus" ~ 3,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "family" ~ 4,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "order" ~ 5,
|
||||
TRUE ~ 6
|
||||
mo != "UNKNOWN" ~ 6, # for B_ANAER, etc.
|
||||
TRUE ~ 7
|
||||
))
|
||||
|
||||
# WHONET adds one log2 level to the R breakpoint for their software, e.g. in AMC in Enterobacterales:
|
||||
|
@ -2099,6 +2099,12 @@ taxonomy$mo[duplicated(taxonomy$mo)]
|
||||
any(duplicated(taxonomy$fullname))
|
||||
taxonomy$fullname[duplicated(taxonomy$fullname)]
|
||||
|
||||
|
||||
# Set unknown ranks -------------------------------------------------------------------------------
|
||||
|
||||
taxonomy$rank[which(taxonomy$fullname %like% "unknown")] <- "(unknown rank)"
|
||||
|
||||
|
||||
# Some final checks -------------------------------------------------------------------------------
|
||||
|
||||
fix_old_mos <- function(dataset) {
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,7 +8,7 @@
|
||||
\alias{ab_selector}
|
||||
\title{Deprecated Functions}
|
||||
\format{
|
||||
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 494 rows and 14 columns.
|
||||
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 495 rows and 14 columns.
|
||||
}
|
||||
\usage{
|
||||
ab_class(...)
|
||||
|
@ -32,7 +32,7 @@ The \code{AMR} package is a \href{https://msberends.github.io/AMR/#copyright}{fr
|
||||
|
||||
This work was published in the Journal of Statistical Software (Volume 104(3); \doi{10.18637/jss.v104.i03}) and formed the basis of two PhD theses (\doi{10.33612/diss.177417131} and \doi{10.33612/diss.192486375}).
|
||||
|
||||
After installing this package, R knows \href{https://msberends.github.io/AMR/reference/microorganisms.html}{\strong{~79 000 microorganisms}} (updated June 2024) and all \href{https://msberends.github.io/AMR/reference/antimicrobials.html}{\strong{~610 antibiotic, antimycotic and antiviral drugs}} by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI and EUCAST are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). \strong{It was designed to work in any setting, including those with very limited resources}. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the public \href{https://www.rug.nl}{University of Groningen}, in collaboration with non-profit organisations \href{https://www.certe.nl}{Certe Medical Diagnostics and Advice Foundation} and \href{https://www.umcg.nl}{University Medical Center Groningen}.
|
||||
After installing this package, R knows \href{https://msberends.github.io/AMR/reference/microorganisms.html}{\strong{~79 000 microorganisms}} (updated June 2024) and all \href{https://msberends.github.io/AMR/reference/antimicrobials.html}{\strong{~620 antibiotic, antimycotic and antiviral drugs}} by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI and EUCAST are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). \strong{It was designed to work in any setting, including those with very limited resources}. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the public \href{https://www.rug.nl}{University of Groningen}, in collaboration with non-profit organisations \href{https://www.certe.nl}{Certe Medical Diagnostics and Advice Foundation} and \href{https://www.umcg.nl}{University Medical Center Groningen}.
|
||||
|
||||
The \code{AMR} package is available in English, Chinese, Czech, Danish, Dutch, Finnish, French, German, Greek, Italian, Japanese, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, Swedish, Turkish, and Ukrainian. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages.
|
||||
}
|
||||
|
@ -70,11 +70,13 @@ cephalosporins_4th(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
cephalosporins_5th(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
fluoroquinolones(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
fluoroquinolones(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
|
||||
glycopeptides(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
isoxazolylpenicillins(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
isoxazolylpenicillins(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
|
||||
lincosamides(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
@ -96,13 +98,15 @@ phenicols(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
polymyxins(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
|
||||
quinolones(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
quinolones(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
|
||||
rifamycins(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
streptogramins(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
tetracyclines(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
tetracyclines(only_sir_columns = FALSE, only_treatable = TRUE,
|
||||
return_all = TRUE, ...)
|
||||
|
||||
trimethoprims(only_sir_columns = FALSE, return_all = TRUE, ...)
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
\name{antimicrobials}
|
||||
\alias{antimicrobials}
|
||||
\alias{antivirals}
|
||||
\title{Data Sets with 614 Antimicrobial Drugs}
|
||||
\title{Data Sets with 615 Antimicrobial Drugs}
|
||||
\format{
|
||||
\subsection{For the \link{antimicrobials} data set: a \link[tibble:tibble]{tibble} with 494 observations and 14 variables:}{
|
||||
\subsection{For the \link{antimicrobials} data set: a \link[tibble:tibble]{tibble} with 495 observations and 14 variables:}{
|
||||
\itemize{
|
||||
\item \code{ab}\cr antimcrobial ID as used in this package (such as \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available. \emph{\strong{This is a unique identifier.}}
|
||||
\item \code{cid}\cr Compound ID as found in PubChem. \emph{\strong{This is a unique identifier.}}
|
||||
|
@ -49,6 +49,15 @@ test_that("data works", {
|
||||
expect_false(anyNA(microorganisms.codes$mo))
|
||||
expect_true(all(dosage$ab %in% AMR::antimicrobials$ab))
|
||||
expect_true(all(dosage$name %in% AMR::antimicrobials$name))
|
||||
eucast_abx <- AMR:::EUCAST_RULES_DF$and_these_antibiotics
|
||||
eucast_abx <- unique(unlist(strsplit(eucast_abx[!is.na(eucast_abx)], ", +")))
|
||||
expect_true(all(eucast_abx %in% AMR::antimicrobials$ab),
|
||||
info = paste0(
|
||||
"Missing in `antimicrobials` data set: ",
|
||||
toString(eucast_abx[which(!eucast_abx %in% AMR::antimicrobials$ab)])
|
||||
)
|
||||
)
|
||||
|
||||
# check valid disks/MICs
|
||||
expect_false(anyNA(as.mic(clinical_breakpoints[which(clinical_breakpoints$method == "MIC" & clinical_breakpoints$ref_tbl != "ECOFF"), "breakpoint_S", drop = TRUE])))
|
||||
expect_true(anyNA(as.mic(clinical_breakpoints[which(clinical_breakpoints$method == "MIC" & clinical_breakpoints$ref_tbl != "ECOFF"), "breakpoint_R", drop = TRUE])))
|
||||
|
@ -124,6 +124,9 @@ test_that("sir works", {
|
||||
|
||||
# Human -------------------------------------------------------------------
|
||||
|
||||
# these are used in the script
|
||||
expect_true(all(c("B_GRAMN", "B_GRAMP", "B_ANAER-NEG", "B_ANAER-POS", "B_ANAER") %in% AMR::microorganisms$mo))
|
||||
|
||||
mics <- as.mic(2^c(-4:6)) # 0.0625 to 64 in factors of 2
|
||||
expect_identical(
|
||||
as.character(as.sir(mics,
|
||||
|
Loading…
x
Reference in New Issue
Block a user