From f7938289eb29a7db87e9c74d30f6c5dd44a993c7 Mon Sep 17 00:00:00 2001 From: Matthijs Berends Date: Fri, 7 Mar 2025 20:43:26 +0100 Subject: [PATCH] (v2.1.1.9186) replace `antibiotics` with `antimicrobials`! --- AMR.Rproj | 1 + DESCRIPTION | 4 +- NAMESPACE | 1 + NEWS.md | 9 +- PythonPackage/AMR/AMR.egg-info/PKG-INFO | 6 +- PythonPackage/AMR/AMR/__init__.py | 3 +- PythonPackage/AMR/AMR/datasets.py | 2 +- PythonPackage/AMR/AMR/functions.py | 3 - PythonPackage/AMR/README.md | 4 +- .../AMR/dist/amr-2.1.1.9183-py3-none-any.whl | Bin 10309 -> 0 bytes PythonPackage/AMR/dist/amr-2.1.1.9183.tar.gz | Bin 10115 -> 0 bytes .../AMR/dist/amr-2.1.1.9186-py3-none-any.whl | Bin 0 -> 10282 bytes PythonPackage/AMR/dist/amr-2.1.1.9186.tar.gz | Bin 0 -> 10092 bytes PythonPackage/AMR/setup.py | 2 +- R/aa_amr-package.R | 4 +- R/aa_globals.R | 2 +- R/aa_helper_functions.R | 4 +- R/aa_options.R | 4 +- R/ab.R | 14 +- R/ab_from_text.R | 8 +- R/ab_property.R | 10 +- R/amr_selectors.R | 24 +- R/antibiogram.R | 18 +- R/atc_online.R | 6 +- R/bug_drug_combinations.R | 4 +- R/count.R | 2 +- R/custom_antimicrobials.R | 16 +- R/custom_eucast_rules.R | 8 +- R/data.R | 35 +- R/eucast_rules.R | 24 +- R/first_isolate.R | 2 +- R/ggplot_sir.R | 6 +- R/guess_ab_col.R | 4 +- R/key_antimicrobials.R | 11 +- R/mdro.R | 12 +- R/mo_property.R | 2 +- R/plotting.R | 2 +- R/proportion.R | 6 +- R/temp_file | 1 + R/zz_deprecated.R | 24 +- R/zzz.R | 17 +- _pkgdown.yml | 6 +- data-raw/_generate_python_wrapper.sh | 6 +- data-raw/_pre_commit_checks.R | 78 +- ....txt => gpt_training_text_v2.1.1.9186.txt} | 411 ++++---- data-raw/loinc.R | 26 +- data-raw/reproduction_of_antibiotics.R | 948 ------------------ data-raw/reproduction_of_antimicrobials.R | 948 ++++++++++++++++++ .../reproduction_of_clinical_breakpoints.R | 2 +- .../reproduction_of_intrinsic_resistant.R | 8 +- data/antibiotics.rda | Bin 43480 -> 0 bytes data/antimicrobials.rda | Bin 0 -> 43488 bytes index.md | 11 +- man/AMR-deprecated.Rd | 10 +- man/AMR-options.Rd | 4 +- man/AMR.Rd | 4 +- man/WHONET.Rd | 4 +- man/ab_from_text.Rd | 2 +- man/ab_property.Rd | 8 +- man/add_custom_antimicrobials.Rd | 6 +- man/antibiogram.Rd | 18 +- man/antimicrobial_selectors.Rd | 16 +- man/{antibiotics.Rd => antimicrobials.Rd} | 15 +- man/as.ab.Rd | 8 +- man/as.av.Rd | 2 +- man/as.mo.Rd | 2 +- man/as.sir.Rd | 2 +- man/atc_online.Rd | 4 +- man/av_property.Rd | 2 +- man/bug_drug_combinations.Rd | 4 +- man/clinical_breakpoints.Rd | 2 +- man/count.Rd | 8 +- man/custom_eucast_rules.Rd | 8 +- man/dosage.Rd | 2 +- man/eucast_rules.Rd | 18 +- man/example_isolates.Rd | 2 +- man/example_isolates_unclean.Rd | 2 +- man/ggplot_sir.Rd | 6 +- man/guess_ab_col.Rd | 4 +- man/intrinsic_resistant.Rd | 2 +- man/key_antimicrobials.Rd | 4 +- man/mdro.Rd | 12 +- man/mo_matching_score.Rd | 2 +- man/mo_property.Rd | 4 +- man/plot.Rd | 2 +- man/proportion.Rd | 6 +- tests/testthat.R | 12 - tests/testthat/helper-functions.R | 38 + tests/testthat/test-_deprecated.R | 6 +- tests/testthat/test-_misc.R | 116 +-- tests/testthat/test-ab.R | 132 +-- tests/testthat/test-ab_from_text.R | 60 +- tests/testthat/test-ab_property.R | 124 +-- tests/testthat/test-age.R | 114 +-- tests/testthat/test-amr_selectors.R | 156 +-- tests/testthat/test-antibiogram.R | 217 ++-- tests/testthat/test-atc_online.R | 20 +- tests/testthat/test-av.R | 88 +- tests/testthat/test-av_from_text.R | 58 +- tests/testthat/test-av_property.R | 52 +- tests/testthat/test-availability.R | 4 +- tests/testthat/test-bug_drug_combinations.R | 24 +- tests/testthat/test-count.R | 154 +-- tests/testthat/test-custom_antimicrobials.R | 26 +- tests/testthat/test-custom_microorganisms.R | 53 +- tests/testthat/test-data.R | 174 ++-- tests/testthat/test-disk.R | 54 +- tests/testthat/test-eucast_rules.R | 344 +++---- tests/testthat/test-first_isolate.R | 432 ++++---- tests/testthat/test-g.test.R | 72 +- tests/testthat/test-get_episode.R | 88 +- tests/testthat/test-ggplot_sir.R | 202 ++-- tests/testthat/test-guess_ab_col.R | 66 +- tests/testthat/test-italicise_taxonomy.R | 34 +- tests/testthat/test-join_microorganisms.R | 48 +- tests/testthat/test-key_antimicrobials.R | 22 +- tests/testthat/test-kurtosis.R | 42 +- tests/testthat/test-like.R | 40 +- tests/testthat/test-mdro.R | 480 ++++----- tests/testthat/test-mean_amr_distance.R | 60 +- tests/testthat/test-mic.R | 270 ++--- tests/testthat/test-mo.R | 538 +++++----- tests/testthat/test-mo_property.R | 412 ++++---- tests/testthat/test-pca.R | 84 +- tests/testthat/test-plotting.R | 158 +-- tests/testthat/test-proportion.R | 240 ++--- tests/testthat/test-random.R | 24 +- tests/testthat/test-resistance_predict.R | 180 ++-- tests/testthat/test-sir.R | 637 ++++++------ tests/testthat/test-skewness.R | 26 +- tests/testthat/test-top_n_microorganisms.R | 24 +- tests/testthat/test-translate.R | 46 +- tests/testthat/test-vctrs.R | 56 +- tests/testthat/test-zzz.R | 290 +++--- tests/tinytest.R.old | 5 + vignettes/AMR_for_Python.Rmd | 4 +- vignettes/AMR_with_tidymodels.Rmd | 2 +- vignettes/EUCAST.Rmd | 2 +- vignettes/datasets.Rmd | 14 +- vignettes/welcome_to_AMR.Rmd | 4 +- 140 files changed, 4870 insertions(+), 4702 deletions(-) delete mode 100644 PythonPackage/AMR/dist/amr-2.1.1.9183-py3-none-any.whl delete mode 100644 PythonPackage/AMR/dist/amr-2.1.1.9183.tar.gz create mode 100644 PythonPackage/AMR/dist/amr-2.1.1.9186-py3-none-any.whl create mode 100644 PythonPackage/AMR/dist/amr-2.1.1.9186.tar.gz create mode 100644 R/temp_file rename data-raw/{gpt_training_text_v2.1.1.9183.txt => gpt_training_text_v2.1.1.9186.txt} (96%) delete mode 100644 data-raw/reproduction_of_antibiotics.R create mode 100644 data-raw/reproduction_of_antimicrobials.R delete mode 100644 data/antibiotics.rda create mode 100644 data/antimicrobials.rda rename man/{antibiotics.Rd => antimicrobials.Rd} (84%) create mode 100644 tests/testthat/helper-functions.R diff --git a/AMR.Rproj b/AMR.Rproj index 4e119c35f..f015c9dc5 100644 --- a/AMR.Rproj +++ b/AMR.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: 5128c748-a412-44db-a5fb-45c68c93dd10 RestoreWorkspace: No SaveWorkspace: No diff --git a/DESCRIPTION b/DESCRIPTION index 673b844e8..ac7a6527b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 2.1.1.9183 -Date: 2025-03-03 +Version: 2.1.1.9186 +Date: 2025-03-07 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 diff --git a/NAMESPACE b/NAMESPACE index 3886b0a6a..41d7e5301 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -159,6 +159,7 @@ export(amr_distance_from_row) export(amr_selector) export(anti_join_microorganisms) export(antibiogram) +export(antibiotics) export(antifungals) export(antimicrobials_equal) export(antimycobacterials) diff --git a/NEWS.md b/NEWS.md index 36cadeaeb..22993b25c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.1.1.9183 +# AMR 2.1.1.9186 *(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).)* @@ -6,14 +6,15 @@ 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. ## Breaking -* Removed all functions and references that used the deprecated `rsi` class, which were all replaced with their `sir` equivalents two years ago +* Dataset `antibiotics` has been renamed to `antimicrobials` as the data set contains more than just antibiotics. Calling `antibiotics` will still work, but now returns a warning. +* Removed all functions and references that used the deprecated `rsi` class, which were all replaced with their `sir` equivalents two years ago. ## 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. * The CLSI VET09 guideline has been implemented to address cases where veterinary breakpoints are missing (only applies when `guideline` is set to CLSI) * The `clinical_breakpoints` data set contains all these breakpoints, and can be downloaded on our [download page](https://msberends.github.io/AMR/articles/datasets.html). - * The `antibiotics` data set contains all veterinary antibiotics, such as pradofloxacin and enrofloxacin. All WHOCC codes for veterinary use have been added as well. + * The (new) `antimicrobials` data set contains all veterinary antibiotics, such as pradofloxacin and enrofloxacin. All WHOCC codes for veterinary use have been added as well. * `ab_atc()` now supports ATC codes of veterinary antibiotics (that all start with "Q") * `ab_url()` now supports retrieving the WHOCC url of their ATCvet pages * **Support for WISCA antibiograms** @@ -57,7 +58,7 @@ This package now supports not only tools for AMR data analysis in clinical setti * 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 * The selectors `lincosamides()` and `macrolides()` do not overlap anymore - each antibiotic is now classified as either of these and not both -* `antibiotics` data set +* `antimicrobials` data set * 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 diff --git a/PythonPackage/AMR/AMR.egg-info/PKG-INFO b/PythonPackage/AMR/AMR.egg-info/PKG-INFO index 522c8fd5d..fe244a9f4 100644 --- a/PythonPackage/AMR/AMR.egg-info/PKG-INFO +++ b/PythonPackage/AMR/AMR.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.2 Name: AMR -Version: 2.1.1.9183 +Version: 2.1.1.9186 Summary: A Python wrapper for the AMR R package Home-page: https://github.com/msberends/AMR Author: Matthijs Berends @@ -175,7 +175,7 @@ In this example, we generate an antibiogram by selecting various antibiotics. ## Taxonomic Data Sets Now in Python! -As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antibiotics`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames: +As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antimicrobials`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames: ```python AMR.microorganisms @@ -196,7 +196,7 @@ AMR.microorganisms | F_ZYZYG | Zyzygomyces | unknown | Fungi | None | 7581 | None | 2.0 | ```python -AMR.antibiotics +AMR.antimicrobials ``` | ab | cid | name | group | oral_ddd | oral_units | iv_ddd | iv_units | diff --git a/PythonPackage/AMR/AMR/__init__.py b/PythonPackage/AMR/AMR/__init__.py index 723dd3795..ddc4a41a3 100644 --- a/PythonPackage/AMR/AMR/__init__.py +++ b/PythonPackage/AMR/AMR/__init__.py @@ -1,6 +1,6 @@ from .datasets import example_isolates from .datasets import microorganisms -from .datasets import antibiotics +from .datasets import antimicrobials from .datasets import clinical_breakpoints from .functions import ab_class from .functions import ab_selector @@ -138,7 +138,6 @@ from .functions import semi_join_microorganisms from .functions import anti_join_microorganisms from .functions import key_antimicrobials from .functions import all_antimicrobials -from .functions import antimicrobials_equal from .functions import kurtosis from .functions import like from .functions import mdro diff --git a/PythonPackage/AMR/AMR/datasets.py b/PythonPackage/AMR/AMR/datasets.py index 880f14f7c..79d691ade 100644 --- a/PythonPackage/AMR/AMR/datasets.py +++ b/PythonPackage/AMR/AMR/datasets.py @@ -71,7 +71,7 @@ example_isolates['date'] = pd.to_datetime(example_isolates['date']) # microorganisms microorganisms = pandas2ri.rpy2py(robjects.r('AMR::microorganisms[, !sapply(AMR::microorganisms, is.list)]')) -antibiotics = pandas2ri.rpy2py(robjects.r('AMR::antibiotics[, !sapply(AMR::antibiotics, is.list)]')) +antimicrobials = pandas2ri.rpy2py(robjects.r('AMR::antimicrobials[, !sapply(AMR::antimicrobials, is.list)]')) clinical_breakpoints = pandas2ri.rpy2py(robjects.r('AMR::clinical_breakpoints[, !sapply(AMR::clinical_breakpoints, is.list)]')) base.options(warn = 0) diff --git a/PythonPackage/AMR/AMR/functions.py b/PythonPackage/AMR/AMR/functions.py index 73265f6b3..05f53a448 100644 --- a/PythonPackage/AMR/AMR/functions.py +++ b/PythonPackage/AMR/AMR/functions.py @@ -444,9 +444,6 @@ def key_antimicrobials(x = None, *args, **kwargs): def all_antimicrobials(x = None, *args, **kwargs): """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html""" return convert_to_python(amr_r.all_antimicrobials(x = None, *args, **kwargs)) -def antimicrobials_equal(y, *args, **kwargs): - """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html""" - return convert_to_python(amr_r.antimicrobials_equal(y, *args, **kwargs)) def kurtosis(x, *args, **kwargs): """See our website of the R package for the manual: https://msberends.github.io/AMR/index.html""" return convert_to_python(amr_r.kurtosis(x, *args, **kwargs)) diff --git a/PythonPackage/AMR/README.md b/PythonPackage/AMR/README.md index de26a764e..ccb62fe0a 100755 --- a/PythonPackage/AMR/README.md +++ b/PythonPackage/AMR/README.md @@ -147,7 +147,7 @@ In this example, we generate an antibiogram by selecting various antibiotics. ## Taxonomic Data Sets Now in Python! -As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antibiotics`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames: +As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antimicrobials`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames: ```python AMR.microorganisms @@ -168,7 +168,7 @@ AMR.microorganisms | F_ZYZYG | Zyzygomyces | unknown | Fungi | None | 7581 | None | 2.0 | ```python -AMR.antibiotics +AMR.antimicrobials ``` | ab | cid | name | group | oral_ddd | oral_units | iv_ddd | iv_units | diff --git a/PythonPackage/AMR/dist/amr-2.1.1.9183-py3-none-any.whl b/PythonPackage/AMR/dist/amr-2.1.1.9183-py3-none-any.whl deleted file mode 100644 index fbfb5c45a10b6433e58897d4a7f5fd3c395d0316..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10309 zcmaKS1ymecmvskscSwK)Yur7--QBfum&RR!OOW7hjk^(;8;r_Q-|E6c&c;Q;^uB*3WyNO#0wTHP2P0ML5}0AT*PDx#puVq|3P zU=21hVs`TSsx#`o%8j;m!0-hB(K&;${j@&X;V0&1K3xpL+bA<>*_`2pTh;m#8AX5% z_q%xKdl=zO!-wRZr<)b43MTbY+)3d6gSeIetx}lWO|$B~(*w1gMJi}430>a;*-UIN z2xLx6nRU=T;mu)IpNhvf%X4UrT2sDV*^`ye`^ zgvz#RVV}vhlCb=q#A?J@CTdL+qIXN26Cd~qND-fB#SmM#kFGtAqa8~huBJXF2aV#| zOQT!JMCw6URi!Uj|LHus5>!RVvn#mtwD_fi%ioLThAR%eE-5P!_sk?2@q*BK#65+A zML+9nOuCJQ?ywzQ5+hB4td616J{E0&Yu&HXBCil?QDozI*}QY|fUHKMMro7I9)3Id z=y~Be@4U*>Qvswn{YmL*4zf~p0?TV-XB^dF#UndE#=8Qt-%`n5%%=Gd$oIgA+h4T1 z7x#2mt{=(8{Sy*syZXtxn2?&{MHIuB3~-9e&C!;B&iTi`>|++8+er&krL*TB;9*t? z>glW1yfdH_45(HVup@l3Q-uuBM8r7ICED5e+A zqD?w9Nr`Bv6P-B3Vh%;;Bjul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jre>mW52^#h%`!2RX z!MomEV{jrr9an`gZ)@PiRZvI1 zSha@E4_m_l8@W>*kE@ugt6G8b<@C9#ND2>zgNg2dFx*#aML_^Tz#q558yGy;|JywF z=Nkmzn{Hf7;C-F$(;pX~2H~B!Ldi diff --git a/PythonPackage/AMR/dist/amr-2.1.1.9183.tar.gz b/PythonPackage/AMR/dist/amr-2.1.1.9183.tar.gz deleted file mode 100644 index 1a291400c2def4e2d6176c6befc65816dfa16d1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10115 zcmch6RZtv2(=8I*-2w!HyF&;X+zAACcPGJF+}+(J1eXo&?#|-wzPK#xpYQ)(?$dp{ zx28|csWYdix~dec=?~W^*@jg}Lzaa$9R@aC%=V z-v+PirK$a`+E5VA7tCbgZl#YN&&zbX+%FTrMv)_SBV%jemHTrE@-({gO9Ej8Wzz&T z(7Pm}2t+d$pg`JYtqa8KW`$2F-u8ml-(@4^-eipSPY1PDwhWyF#x6NKx5)00;+xiF zu$-mDWqp6Y&o+BuDD!+Z=M%o7jDPv`^lrQ^Oz}}gSy@>(e&K%6Xy5@0X+s3!wkk?O z;aC3-5TY0c(1W)&jjN}LUZBQ8q#|=eSS!#AV|l;R3~?0lgh@*yqgM|*6KHt$LwD^t zGIxL89vb}fRrK^B z`o_$i_8L)oOtf<@>fI3gvGoKJ3;ZwyR4Z(S{FfAcA2zqX z5O=~a(j)rx%npCZ2vN+RVS&GK+PXqMxZNdehT)QiFaHP&%H%?49{#EM7v1u>KO#DH zB;v4(%qz(km-J@6CFGq=5*{THA(pywlt;;{h9XcY(Pb|w9fVUjZf_i+KPWJJ&p_EtLbgM?>_nJrIUw(a=UlDSlfzkzJ!~Wi zbfjnejO>@d(kzVo2b%?*Q&WJFp%y&`J0myrtanSTXrz2%ef0OT|6m9lGLscPo%3LT z3|FWeUW{ZL*}3$1TB-bQn6dM>bFGOPKhhp<<4yT!40kTpEA}KsVv$03Qn+++7?K9k zw11IAuSBS?ke6!F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~97eLDvvb>$?Rzn^k?7AxQSeE(?je}fH;+fM+jw=VZc+sH`& E3wi82m;e9( literal 0 HcmV?d00001 diff --git a/PythonPackage/AMR/setup.py b/PythonPackage/AMR/setup.py index eef73c0f9..7e27980ee 100644 --- a/PythonPackage/AMR/setup.py +++ b/PythonPackage/AMR/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='AMR', - version='2.1.1.9183', + version='2.1.1.9186', packages=find_packages(), install_requires=[ 'rpy2', diff --git a/R/aa_amr-package.R b/R/aa_amr-package.R index f29af48f7..dd8903fdf 100755 --- a/R/aa_amr-package.R +++ b/R/aa_amr-package.R @@ -36,11 +36,11 @@ #' #' 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 [**`r format_included_data_number(AMR::microorganisms)` microorganisms**](https://msberends.github.io/AMR/reference/microorganisms.html) (updated `r format(TAXONOMY_VERSION$GBIF$accessed_date, "%B %Y")`) and all [**`r format_included_data_number(nrow(AMR::antibiotics) + nrow(AMR::antivirals))` antibiotic, antimycotic and antiviral drugs**](https://msberends.github.io/AMR/reference/antibiotics.html) 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). **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 [University of Groningen](https://www.rug.nl), in collaboration with non-profit organisations [Certe Medical Diagnostics and Advice Foundation](https://www.certe.nl) and [University Medical Center Groningen](https://www.umcg.nl). +#' After installing this package, R knows [**`r format_included_data_number(AMR::microorganisms)` microorganisms**](https://msberends.github.io/AMR/reference/microorganisms.html) (updated `r format(TAXONOMY_VERSION$GBIF$accessed_date, "%B %Y")`) and all [**`r format_included_data_number(nrow(AMR::antimicrobials) + nrow(AMR::antivirals))` antibiotic, antimycotic and antiviral drugs**](https://msberends.github.io/AMR/reference/antimicrobials.html) 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). **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 [University of Groningen](https://www.rug.nl), in collaboration with non-profit organisations [Certe Medical Diagnostics and Advice Foundation](https://www.certe.nl) and [University Medical Center Groningen](https://www.umcg.nl). #' #' The `AMR` package is available in `r vector_and(vapply(FUN.VALUE = character(1), LANGUAGES_SUPPORTED_NAMES, function(x) x$exonym), quotes = FALSE, sort = FALSE)`. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages. #' @section Reference Data Publicly Available: -#' All data sets in this `AMR` package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit [our website for the download links](https://msberends.github.io/AMR/articles/datasets.html). The actual files are of course available on [our GitHub repository](https://github.com/msberends/AMR/tree/main/data-raw). +#' All data sets in this `AMR` package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit [our website for the download links](https://msberends.github.io/AMR/articles/datasets.html). The actual files are of course available on [our GitHub repository](https://github.com/msberends/AMR/tree/main/data-raw). #' @source #' To cite AMR in publications use: #' diff --git a/R/aa_globals.R b/R/aa_globals.R index 479d56016..07793bca5 100755 --- a/R/aa_globals.R +++ b/R/aa_globals.R @@ -134,7 +134,7 @@ globalVariables(c( "affect_mo_name", "angle", "antibiotic", - "antibiotics", + "antimicrobials", "atc_group1", "atc_group2", "base_ab", diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index 012fd3582..8f6e9be7f 100644 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -266,7 +266,7 @@ search_type_in_df <- function(x, type, info = TRUE, add_col_prefix = TRUE) { found <- sort(colnames(x)[colnames_formatted %like_case% "species"]) } } - # -- key antibiotics + # -- key antimicrobials if (type %in% c("keyantibiotics", "keyantimicrobials")) { if (any(colnames_formatted %like_case% "^key.*(ab|antibiotics|antimicrobials)")) { found <- sort(colnames(x)[colnames_formatted %like_case% "^key.*(ab|antibiotics|antimicrobials)"]) @@ -712,7 +712,7 @@ create_eucast_ab_documentation <- function() { ab <- character() for (val in x) { if (paste0("AB_", val) %in% ls(envir = asNamespace("AMR"))) { - # antibiotic group names, as defined in data-raw/_pre_commit_checks.R, such as `CARBAPENEMS` + # antimicrobial group names, as defined in data-raw/_pre_commit_checks.R, such as `CARBAPENEMS` val <- eval(parse(text = paste0("AB_", val)), envir = asNamespace("AMR")) } else if (val %in% AMR_env$AB_lookup$ab) { # separate drugs, such as `AMX` diff --git a/R/aa_options.R b/R/aa_options.R index d8e69850c..3551cfdc6 100755 --- a/R/aa_options.R +++ b/R/aa_options.R @@ -31,7 +31,7 @@ #' #' This is an overview of all the package-specific [options()] you can set in the `AMR` package. #' @section Options: -#' * `AMR_antibiogram_formatting_type` \cr A [numeric] (1-12) to use in [antibiogram()], to indicate which formatting type to use. +#' * `AMR_antibiogram_formatting_type` \cr A [numeric] (1-22) to use in [antibiogram()], to indicate which formatting type to use. #' * `AMR_breakpoint_type` \cr A [character] to use in [as.sir()], to indicate which breakpoint type to use. This must be either `r vector_or(clinical_breakpoints$type)`. #' * `AMR_cleaning_regex` \cr A [regular expression][base::regex] (case-insensitive) to use in [as.mo()] and all [`mo_*`][mo_property()] functions, to clean the user input. The default is the outcome of [mo_cleaning_regex()], which removes texts between brackets and texts such as "species" and "serovar". #' * `AMR_custom_ab` \cr A file location to an RDS file, to use custom antimicrobial drugs with this package. This is explained in [add_custom_antimicrobials()]. @@ -59,7 +59,7 @@ #' options(AMR_include_PKPD = TRUE) #' ``` #' -#' ...to add Portuguese language support of antibiotics, and allow PK/PD rules when interpreting MIC values with [as.sir()]. +#' ...to add Portuguese language support of antimicrobials, and allow PK/PD rules when interpreting MIC values with [as.sir()]. #' #' ### Share Options Within Team #' diff --git a/R/ab.R b/R/ab.R index cc7f741e4..21314b90f 100755 --- a/R/ab.R +++ b/R/ab.R @@ -29,7 +29,7 @@ #' Transform Input to an Antibiotic ID #' -#' Use this function to determine the antibiotic drug code of one or more antibiotics. The data set [antibiotics] will be searched for abbreviations, official names and synonyms (brand names). +#' Use this function to determine the antimicrobial drug code of one or more antimicrobials. The data set [antimicrobials] will be searched for abbreviations, official names and synonyms (brand names). #' @param x a [character] vector to determine to antibiotic ID #' @param flag_multiple_results a [logical] to indicate whether a note should be printed to the console that probably more than one antibiotic drug code or name can be retrieved from a single input value. #' @param language language to coerce input values from any of the `r length(LANGUAGES_SUPPORTED)` supported languages - default to the system language if supported (see [get_AMR_locale()]) @@ -37,7 +37,7 @@ #' @param ... arguments passed on to internal functions #' @rdname as.ab #' @inheritSection WHOCC WHOCC -#' @details All entries in the [antibiotics] data set have three different identifiers: a human readable EARS-Net code (column `ab`, used by ECDC and WHONET), an ATC code (column `atc`, used by WHO), and a CID code (column `cid`, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. Not that some drugs contain multiple ATC codes. +#' @details All entries in the [antimicrobials] data set have three different identifiers: a human readable EARS-Net code (column `ab`, used by ECDC and WHONET), an ATC code (column `atc`, used by WHO), and a CID code (column `cid`, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. Not that some drugs contain multiple ATC codes. #' #' All these properties will be searched for the user input. The [as.ab()] can correct for different forms of misspelling: #' @@ -58,7 +58,7 @@ #' @aliases ab #' @return A [character] [vector] with additional class [`ab`] #' @seealso -#' * [antibiotics] for the [data.frame] that is being used to determine ATCs +#' * [antimicrobials] for the [data.frame] that is being used to determine ATCs #' * [ab_from_text()] for a function to retrieve antimicrobial drugs from clinical text (from health care records) #' @inheritSection AMR Reference Data Publicly Available #' @export @@ -411,7 +411,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(), # take failed ATC codes apart from rest if (length(x_unknown_ATCs) > 0 && fast_mode == FALSE) { warning_( - "in `as.ab()`: these ATC codes are not (yet) in the antibiotics data set: ", + "in `as.ab()`: these ATC codes are not (yet) in the antimicrobials data set: ", vector_and(x_unknown_ATCs), "." ) } @@ -629,9 +629,9 @@ get_translate_ab <- function(translate_ab) { return(FALSE) } else { translate_ab <- tolower(translate_ab) - stop_ifnot(translate_ab %in% colnames(AMR::antibiotics), - "invalid value for 'translate_ab', this must be a column name of the antibiotics data set\n", - "or TRUE (equals 'name') or FALSE to not translate at all.", + stop_ifnot(translate_ab %in% colnames(AMR::antimicrobials), + "invalid value for 'translate_ab', this must be a column name of the `antimicrobials` data set\n", + "or `TRUE` (equals 'name') or `FALSE` to not translate at all.", call = FALSE ) translate_ab diff --git a/R/ab_from_text.R b/R/ab_from_text.R index c93bbb0ba..7444bb510 100755 --- a/R/ab_from_text.R +++ b/R/ab_from_text.R @@ -33,7 +33,7 @@ #' @param text text to analyse #' @param type type of property to search for, either `"drug"`, `"dose"` or `"administration"`, see *Examples* #' @param collapse a [character] to pass on to `paste(, collapse = ...)` to only return one [character] per element of `text`, see *Examples* -#' @param translate_ab if `type = "drug"`: a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()]. The default is `FALSE`. Using `TRUE` is equal to using "name". +#' @param translate_ab if `type = "drug"`: a column name of the [antimicrobials] data set to translate the antibiotic abbreviations to, using [ab_property()]. The default is `FALSE`. Using `TRUE` is equal to using "name". #' @param thorough_search a [logical] to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to `TRUE` will take considerably more time than when using `FALSE`. At default, it will turn `TRUE` when all input elements contain a maximum of three words. #' @param info a [logical] to indicate whether a progress bar should be printed - the default is `TRUE` only in interactive mode #' @param ... arguments passed on to [as.ab()] @@ -139,10 +139,10 @@ ab_from_text <- function(text, }) } else { # no thorough search - abbr <- unlist(AMR::antibiotics$abbreviations) + abbr <- unlist(AMR::antimicrobials$abbreviations) abbr <- abbr[nchar(abbr) >= 4] - names_atc <- substr(c(AMR::antibiotics$name, AMR::antibiotics$atc), 1, 5) - synonyms <- unlist(AMR::antibiotics$synonyms) + names_atc <- substr(c(AMR::antimicrobials$name, AMR::antimicrobials$atc), 1, 5) + synonyms <- unlist(AMR::antimicrobials$synonyms) synonyms <- synonyms[nchar(synonyms) >= 4] # regular expression must not be too long, so split synonyms in two: synonyms_part1 <- synonyms[seq_len(0.5 * length(synonyms))] diff --git a/R/ab_property.R b/R/ab_property.R index dbe9f69b1..7aa8f0883 100755 --- a/R/ab_property.R +++ b/R/ab_property.R @@ -29,10 +29,10 @@ #' Get Properties of an Antibiotic #' -#' Use these functions to return a specific property of an antibiotic from the [antibiotics] data set. All input values will be evaluated internally with [as.ab()]. +#' Use these functions to return a specific property of an antibiotic from the [antimicrobials] data set. All input values will be evaluated internally with [as.ab()]. #' @param x any (vector of) text that can be coerced to a valid antibiotic drug code with [as.ab()] #' @param tolower a [logical] to indicate whether the first [character] of every output should be transformed to a lower case [character]. This will lead to e.g. "polymyxin B" and not "polymyxin b". -#' @param property one of the column names of one of the [antibiotics] data set: `vector_or(colnames(antibiotics), sort = FALSE)`. +#' @param property one of the column names of one of the [antimicrobials] data set: `vector_or(colnames(antimicrobials), sort = FALSE)`. #' @param language language of the returned text - the default is the current system language (see [get_AMR_locale()]) and can also be set with the package option [`AMR_locale`][AMR-options]. Use `language = NULL` or `language = ""` to prevent translation. #' @param administration way of administration, either `"oral"` or `"iv"` #' @param open browse the URL using [utils::browseURL()] @@ -55,7 +55,7 @@ #' - A [data.frame] in case of [set_ab_names()] #' - A [character] in all other cases #' @export -#' @seealso [antibiotics] +#' @seealso [antimicrobials] #' @inheritSection AMR Reference Data Publicly Available #' @examples #' # all properties: @@ -337,7 +337,7 @@ ab_url <- function(x, open = FALSE, ...) { #' @export ab_property <- function(x, property = "name", language = get_AMR_locale(), ...) { meet_criteria(x, allow_NA = TRUE) - meet_criteria(property, is_in = colnames(AMR::antibiotics), has_length = 1) + meet_criteria(property, is_in = colnames(AMR::antimicrobials), has_length = 1) language <- validate_language(language) translate_into_language(ab_validate(x = x, property = property, ...), language = language) } @@ -347,7 +347,7 @@ ab_property <- function(x, property = "name", language = get_AMR_locale(), ...) #' @export set_ab_names <- function(data, ..., property = "name", language = get_AMR_locale(), snake_case = NULL) { meet_criteria(data, allow_class = c("data.frame", "character")) - meet_criteria(property, is_in = colnames(AMR::antibiotics), has_length = 1, ignore.case = TRUE) + meet_criteria(property, is_in = colnames(AMR::antimicrobials), has_length = 1, ignore.case = TRUE) language <- validate_language(language) meet_criteria(snake_case, allow_class = "logical", has_length = 1, allow_NULL = TRUE) diff --git a/R/amr_selectors.R b/R/amr_selectors.R index 4075f29e3..7a6488220 100755 --- a/R/amr_selectors.R +++ b/R/amr_selectors.R @@ -38,8 +38,8 @@ #' my_data_with_all_these_columns %>% #' select(cephalosporins()) #' ``` -#' @param amr_class an antimicrobial class or a part of it, such as `"carba"` and `"carbapenems"`. The columns `group`, `atc_group1` and `atc_group2` of the [antibiotics] data set will be searched (case-insensitive) for this value. -#' @param filter an [expression] to be evaluated in the [antibiotics] data set, such as `name %like% "trim"` +#' @param amr_class an antimicrobial class or a part of it, such as `"carba"` and `"carbapenems"`. The columns `group`, `atc_group1` and `atc_group2` of the [antimicrobials] data set will be searched (case-insensitive) for this value. +#' @param filter an [expression] to be evaluated in the [antimicrobials] data set, such as `name %like% "trim"` #' @param only_sir_columns a [logical] to indicate whether only columns of class `sir` must be selected (default is `FALSE`), see [as.sir()] #' @param only_treatable a [logical] to indicate whether antimicrobial drugs should be excluded that are only for laboratory tests (default is `TRUE`), such as gentamicin-high (`GEH`) and imipenem/EDTA (`IPE`) #' @param return_all a [logical] to indicate whether all matched columns must be returned (default is `TRUE`). With `FALSE`, only the first of each unique antimicrobial will be returned, e.g. if both columns `"genta"` and `"gentamicin"` exist in the data, only the first hit for gentamicin will be returned. @@ -49,9 +49,9 @@ #' #' All selectors can also be used in `tidymodels` packages such as `recipe` and `parsnip`. See for more info [our tutorial](https://msberends.github.io/AMR/articles/AMR_with_tidymodels.html) on using antimicrobial selectors for predictive modelling. #' -#' All columns in the data in which these functions are called will be searched for known antimicrobial names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) according to the [antibiotics] data set. This means that a selector such as [aminoglycosides()] will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. +#' All columns in the data in which these functions are called will be searched for known antimicrobial names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) according to the [antimicrobials] data set. This means that a selector such as [aminoglycosides()] will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. #' -#' The [amr_class()] function can be used to filter/select on a manually defined antimicrobial class. It searches for results in the [antibiotics] data set within the columns `group`, `atc_group1` and `atc_group2`. +#' The [amr_class()] function can be used to filter/select on a manually defined antimicrobial class. It searches for results in the [antimicrobials] data set within the columns `group`, `atc_group1` and `atc_group2`. #' @section Full list of supported (antimicrobial) classes: #' #' `r paste0(" * ", na.omit(sapply(DEFINED_AB_GROUPS, function(ab) ifelse(tolower(gsub("^AB_", "", ab)) %in% ls(envir = asNamespace("AMR")), paste0("[", tolower(gsub("^AB_", "", ab)), "()] can select: \\cr ", vector_and(paste0(ab_name(eval(parse(text = ab), envir = asNamespace("AMR")), language = NULL, tolower = TRUE), " (", eval(parse(text = ab), envir = asNamespace("AMR")), ")"), quotes = FALSE, sort = TRUE)), character(0)), USE.NAMES = FALSE)), "\n", collapse = "")` @@ -193,7 +193,7 @@ #' # and erythromycin is not a penicillin: #' example_isolates[, penicillins() & administrable_per_os()] #' -#' # amr_selector() applies a filter in the `antibiotics` data set and is thus +#' # amr_selector() applies a filter in the `antimicrobials` data set and is thus #' # very flexible. For instance, to select antimicrobials with an oral DDD #' # of at least 1 gram: #' example_isolates[, amr_selector(oral_ddd > 1 & oral_units == "g")] @@ -483,7 +483,7 @@ ureidopenicillins <- function(only_sir_columns = FALSE, return_all = TRUE, ...) } #' @rdname antimicrobial_selectors -#' @details The [administrable_per_os()] and [administrable_iv()] functions also rely on the [antibiotics] data set - antimicrobials will be matched where a DDD (defined daily dose) for resp. oral and IV treatment is available in the [antibiotics] data set. +#' @details The [administrable_per_os()] and [administrable_iv()] functions also rely on the [antimicrobials] data set - antimicrobials will be matched where a DDD (defined daily dose) for resp. oral and IV treatment is available in the [antimicrobials] data set. #' @export amr_class <- function(amr_class, only_sir_columns = FALSE, @@ -498,7 +498,7 @@ amr_class <- function(amr_class, } #' @rdname antimicrobial_selectors -#' @details The [amr_selector()] function can be used to internally filter the [antibiotics] data set on any results, see *Examples*. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set. +#' @details The [amr_selector()] function can be used to internally filter the [antimicrobials] data set on any results, see *Examples*. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set. #' @export amr_selector <- function(filter, only_sir_columns = FALSE, @@ -799,9 +799,9 @@ all_any_amr_selector <- function(type, ..., na.rm = TRUE) { df <- get_current_data(arg_name = NA, call = -3) if (type == "all") { - scope_fn <- all + scope_fn <- base::all } else { - scope_fn <- any + scope_fn <- base::any } x_transposed <- as.list(as.data.frame(t(df[, cols_ab, drop = FALSE]), stringsAsFactors = FALSE)) @@ -932,12 +932,14 @@ any.amr_selector_any_all <- function(..., na.rm = FALSE) { is_any <- function(el1) { syscalls <- paste0(trimws2(deparse(sys.calls())), collapse = " ") - el1 <- gsub("(.*),.*", "\\1", el1) + el1 <- gsub("(", "\\(", el1, fixed = TRUE) + el1 <- gsub(")", "\\)", el1, fixed = TRUE) syscalls %like% paste0("[^_a-zA-Z0-9]any\\(", "(c\\()?", el1) } is_all <- function(el1) { syscalls <- paste0(trimws2(deparse(sys.calls())), collapse = " ") - el1 <- gsub("(.*),.*", "\\1", el1) + el1 <- gsub("(", "\\(", el1, fixed = TRUE) + el1 <- gsub(")", "\\)", el1, fixed = TRUE) syscalls %like% paste0("[^_a-zA-Z0-9]all\\(", "(c\\()?", el1) } diff --git a/R/antibiogram.R b/R/antibiogram.R index aad521f54..0a7a0720a 100755 --- a/R/antibiogram.R +++ b/R/antibiogram.R @@ -36,7 +36,7 @@ #' @param x a [data.frame] containing at least a column with microorganisms and columns with antimicrobial results (class 'sir', see [as.sir()]) #' @param antibiotics vector of any antimicrobial name or code (will be evaluated with [as.ab()], column name of `x`, or (any combinations of) [antimicrobial selectors][antimicrobial_selectors] such as [aminoglycosides()] or [carbapenems()]. For combination antibiograms, this can also be set to values separated with `"+"`, such as `"TZP+TOB"` or `"cipro + genta"`, given that columns resembling such antimicrobials exist in `x`. See *Examples*. #' @param mo_transform a character to transform microorganism input - must be `"name"`, `"shortname"` (default), `"gramstain"`, or one of the column names of the [microorganisms] data set: `r vector_or(colnames(microorganisms), sort = FALSE, quotes = TRUE)`. Can also be `NULL` to not transform the input or `NA` to consider all microorganisms 'unknown'. -#' @param ab_transform a character to transform antimicrobial input - must be one of the column names of the [antibiotics] data set (defaults to `"name"`): `r vector_or(colnames(antibiotics), sort = FALSE, quotes = TRUE)`. Can also be `NULL` to not transform the input. +#' @param ab_transform a character to transform antimicrobial input - must be one of the column names of the [antimicrobials] data set (defaults to `"name"`): `r vector_or(colnames(antimicrobials), sort = FALSE, quotes = TRUE)`. Can also be `NULL` to not transform the input. #' @param syndromic_group a column name of `x`, or values calculated to split rows of `x`, e.g. by using [ifelse()] or [`case_when()`][dplyr::case_when()]. See *Examples*. #' @param add_total_n a [logical] to indicate whether `n_tested` available numbers per pathogen should be added to the table (default is `TRUE`). This will add the lowest and highest number of available isolates per antimicrobial (e.g, if for *E. coli* 200 isolates are available for ciprofloxacin and 150 for amoxicillin, the returned number will be "150-200"). This option is unavailable when `wisca = TRUE`; in that case, use [retrieve_wisca_parameters()] to get the parameters used for WISCA. #' @param only_all_tested (for combination antibiograms): a [logical] to indicate that isolates must be tested for all antimicrobials, see *Details* @@ -64,7 +64,7 @@ #' #' ### Formatting Type #' -#' The formatting of the 'cells' of the table can be set with the argument `formatting_type`. In these examples, `5` is the antimicrobial coverage (`4-6` indicates the confidence level), `15` the number of susceptible isolates, and `300` the number of tested (i.e., available) isolates: +#' The formatting of the 'cells' of the table can be set with the argument `formatting_type`. In these examples, `5` indicates the antimicrobial coverage (`4-6` the confidence level), `15` the number of susceptible isolates, and `300` the number of tested (i.e., available) isolates: #' #' 1. 5 #' 2. 15 @@ -79,17 +79,17 @@ #' 11. 5 (N=15/300) #' 12. 5% (N=15/300) #' 13. 5 (4-6) -#' 14. 5% (4-6%) - **default** +#' 14. 5% (4-6%) - **default for WISCA** #' 15. 5 (4-6,300) #' 16. 5% (4-6%,300) #' 17. 5 (4-6,N=300) -#' 18. 5% (4-6%,N=300) +#' 18. 5% (4-6%,N=300) - **default for non-WISCA** #' 19. 5 (4-6,15/300) #' 20. 5% (4-6%,15/300) #' 21. 5 (4-6,N=15/300) #' 22. 5% (4-6%,N=15/300) #' -#' The default is `14`, which can be set globally with the package option [`AMR_antibiogram_formatting_type`][AMR-options], e.g. `options(AMR_antibiogram_formatting_type = 5)`. Do note that for WISCA, the total numbers of tested and susceptible isolates are less useful to report, since these are included in the Bayesian model and apparent from the susceptibility and its confidence level. +#' The default can be set globally with the package option [`AMR_antibiogram_formatting_type`][AMR-options], e.g. `options(AMR_antibiogram_formatting_type = 5)`. Do note that for WISCA, the total numbers of tested and susceptible isolates are less useful to report, since these are included in the Bayesian model and apparent from the susceptibility and its confidence level. #' #' Set `digits` (defaults to `0`) to alter the rounding of the susceptibility percentages. #' @@ -412,7 +412,7 @@ antibiogram <- function(x, add_total_n = FALSE, only_all_tested = FALSE, digits = ifelse(wisca, 1, 0), - formatting_type = getOption("AMR_antibiogram_formatting_type", 14), + formatting_type = getOption("AMR_antibiogram_formatting_type", ifelse(wisca, 14, 18)), col_mo = NULL, language = get_AMR_locale(), minimum = 30, @@ -436,7 +436,7 @@ antibiogram.default <- function(x, add_total_n = FALSE, only_all_tested = FALSE, digits = ifelse(wisca, 1, 0), - formatting_type = getOption("AMR_antibiogram_formatting_type", 14), + formatting_type = getOption("AMR_antibiogram_formatting_type", ifelse(wisca, 14, 18)), col_mo = NULL, language = get_AMR_locale(), minimum = 30, @@ -460,7 +460,7 @@ antibiogram.default <- function(x, meet_criteria(mo_transform, allow_class = "character", has_length = 1, is_in = c("name", "shortname", "gramstain", colnames(AMR::microorganisms)), allow_NULL = TRUE, allow_NA = TRUE) } if (!is.function(ab_transform)) { - meet_criteria(ab_transform, allow_class = "character", has_length = 1, is_in = colnames(AMR::antibiotics), allow_NULL = TRUE) + meet_criteria(ab_transform, allow_class = "character", has_length = 1, is_in = colnames(AMR::antimicrobials), allow_NULL = TRUE) } meet_criteria(syndromic_group, allow_class = "character", allow_NULL = TRUE, allow_NA = TRUE) meet_criteria(add_total_n, allow_class = "logical", has_length = 1) @@ -962,7 +962,7 @@ antibiogram.grouped_df <- function(x, add_total_n = FALSE, only_all_tested = FALSE, digits = ifelse(wisca, 1, 0), - formatting_type = getOption("AMR_antibiogram_formatting_type", 14), + formatting_type = getOption("AMR_antibiogram_formatting_type", ifelse(wisca, 14, 18)), col_mo = NULL, language = get_AMR_locale(), minimum = 30, diff --git a/R/atc_online.R b/R/atc_online.R index f6976f754..55cd0b1e1 100755 --- a/R/atc_online.R +++ b/R/atc_online.R @@ -29,8 +29,8 @@ #' Get ATC Properties from WHOCC Website #' -#' Gets data from the WHOCC website to determine properties of an Anatomical Therapeutic Chemical (ATC) (e.g. an antibiotic), such as the name, defined daily dose (DDD) or standard unit. -#' @param atc_code a [character] (vector) with ATC code(s) of antibiotics, will be coerced with [as.ab()] and [ab_atc()] internally if not a valid ATC code +#' Gets data from the WHOCC website to determine properties of an Anatomical Therapeutic Chemical (ATC) (e.g. an antimicrobial), such as the name, defined daily dose (DDD) or standard unit. +#' @param atc_code a [character] (vector) with ATC code(s) of antimicrobials, will be coerced with [as.ab()] and [ab_atc()] internally if not a valid ATC code #' @param property property of an ATC code. Valid values are `"ATC"`, `"Name"`, `"DDD"`, `"U"` (`"unit"`), `"Adm.R"`, `"Note"` and `groups`. For this last option, all hierarchical groups of an ATC code will be returned, see *Examples*. #' @param administration type of administration when using `property = "Adm.R"`, see *Details* #' @param url url of website of the WHOCC. The sign `%s` can be used as a placeholder for ATC codes. @@ -98,7 +98,7 @@ atc_online_property <- function(atc_code, html_text <- import_fn("html_text", "rvest") read_html <- import_fn("read_html", "xml2") - if (!all(atc_code %in% unlist(AMR::antibiotics$atc))) { + if (!all(atc_code %in% unlist(AMR::antimicrobials$atc))) { atc_code <- as.character(ab_atc(atc_code, only_first = TRUE)) } diff --git a/R/bug_drug_combinations.R b/R/bug_drug_combinations.R index 499619178..021786420 100755 --- a/R/bug_drug_combinations.R +++ b/R/bug_drug_combinations.R @@ -35,7 +35,7 @@ #' @param add_ab_group a [logical] to indicate where the group of the antimicrobials must be included as a first column #' @param remove_intrinsic_resistant [logical] to indicate that rows and columns with 100% resistance for all tested antimicrobials must be removed from the table #' @param FUN the function to call on the `mo` column to transform the microorganism codes - the default is [mo_shortname()] -#' @param translate_ab a [character] of length 1 containing column names of the [antibiotics] data set +#' @param translate_ab a [character] of length 1 containing column names of the [antimicrobials] data set #' @param include_n_rows a [logical] to indicate if the total number of rows must be included in the output #' @param ... arguments passed on to `FUN` #' @inheritParams sir_df @@ -93,7 +93,7 @@ bug_drug_combinations <- function(x, unique_mo <- sort(unique(x[, col_mo, drop = TRUE])) - # select only groups and antibiotics + # select only groups and antimicrobials if (is_null_or_grouped_tbl(x.bak)) { data_has_groups <- TRUE groups <- get_group_names(x.bak) diff --git a/R/count.R b/R/count.R index 4319b0e95..074e7f861 100755 --- a/R/count.R +++ b/R/count.R @@ -39,7 +39,7 @@ #' #' The function [count_resistant()] is equal to the function [count_R()]. The function [count_susceptible()] is equal to the function [count_SI()]. #' -#' The function [n_sir()] is an alias of [count_all()]. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to `n_distinct()`. Their function is equal to `count_susceptible(...) + count_resistant(...)`. +#' The function [n_sir()] is an alias of [count_all()]. They can be used to count all available isolates, i.e. where all input antimicrobials have an available result (S, I or R). Their use is equal to `n_distinct()`. Their function is equal to `count_susceptible(...) + count_resistant(...)`. #' #' The function [count_df()] takes any variable from `data` that has an [`sir`] class (created with [as.sir()]) and counts the number of S's, I's and R's. It also supports grouped variables. The function [sir_df()] works exactly like [count_df()], but adds the percentage of S, I and R. #' @inheritSection proportion Combination Therapy diff --git a/R/custom_antimicrobials.R b/R/custom_antimicrobials.R index c8b611cd0..55cbccc25 100755 --- a/R/custom_antimicrobials.R +++ b/R/custom_antimicrobials.R @@ -30,14 +30,14 @@ #' Add Custom Antimicrobials #' #' With [add_custom_antimicrobials()] you can add your own custom antimicrobial drug names and codes. -#' @param x a [data.frame] resembling the [antibiotics] data set, at least containing columns "ab" and "name" +#' @param x a [data.frame] resembling the [antimicrobials] data set, at least containing columns "ab" and "name" #' @details **Important:** Due to how \R works, the [add_custom_antimicrobials()] function has to be run in every \R session - added antimicrobials are not stored between sessions and are thus lost when \R is exited. #' #' There are two ways to circumvent this and automate the process of adding antimicrobials: #' #' **Method 1:** Using the package option [`AMR_custom_ab`][AMR-options], which is the preferred method. To use this method: #' -#' 1. Create a data set in the structure of the [antibiotics] data set (containing at the very least columns "ab" and "name") and save it with [saveRDS()] to a location of choice, e.g. `"~/my_custom_ab.rds"`, or any remote location. +#' 1. Create a data set in the structure of the [antimicrobials] data set (containing at the very least columns "ab" and "name") and save it with [saveRDS()] to a location of choice, e.g. `"~/my_custom_ab.rds"`, or any remote location. #' #' 2. Set the file location to the package option [`AMR_custom_ab`][AMR-options]: `options(AMR_custom_ab = "~/my_custom_ab.rds")`. This can even be a remote file location, such as an https URL. Since options are not saved between \R sessions, it is best to save this option to the `.Rprofile` file so that it will be loaded on start-up of \R. To do this, open the `.Rprofile` file using e.g. `utils::file.edit("~/.Rprofile")`, add this text and save the file: #' @@ -79,7 +79,7 @@ #' ab = "TESTAB", #' name = "Test Antibiotic", #' # you can add any property present in the -#' # 'antibiotics' data set, such as 'group': +#' # 'antimicrobials' data set, such as 'group': #' group = "Test Group" #' ) #' ) @@ -123,11 +123,11 @@ add_custom_antimicrobials <- function(x) { ) stop_if( any(x$ab %in% AMR_env$AB_lookup$ab), - "Antimicrobial drug code(s) ", vector_and(x$ab[x$ab %in% AMR_env$AB_lookup$ab]), " already exist in the internal `antibiotics` data set." + "Antimicrobial drug code(s) ", vector_and(x$ab[x$ab %in% AMR_env$AB_lookup$ab]), " already exist in the internal `antimicrobials` data set." ) # remove any extra class/type, such as grouped tbl, or data.table: x <- as.data.frame(x, stringsAsFactors = FALSE) - # keep only columns available in the antibiotics data set + # keep only columns available in the antimicrobials data set x <- x[, colnames(AMR_env$AB_lookup)[colnames(AMR_env$AB_lookup) %in% colnames(x)], drop = FALSE] x$generalised_name <- generalise_antibiotic_name(x$name) x$generalised_all <- as.list(x$generalised_name) @@ -155,16 +155,16 @@ add_custom_antimicrobials <- function(x) { AMR_env$ab_previously_coerced <- AMR_env$ab_previously_coerced[which(!AMR_env$ab_previously_coerced$ab %in% c(x$ab, x$generalised_name) & !AMR_env$ab_previously_coerced$x %in% c(x$ab, x$generalised_name)), , drop = FALSE] class(AMR_env$AB_lookup$ab) <- c("ab", "character") - message_("Added ", nr2char(nrow(x)), " record", ifelse(nrow(x) > 1, "s", ""), " to the internal `antibiotics` data set.") + message_("Added ", nr2char(nrow(x)), " record", ifelse(nrow(x) > 1, "s", ""), " to the internal `antimicrobials` data set.") } #' @rdname add_custom_antimicrobials #' @export clear_custom_antimicrobials <- function() { n <- nrow(AMR_env$AB_lookup) - AMR_env$AB_lookup <- cbind(AMR::antibiotics, AB_LOOKUP) + AMR_env$AB_lookup <- cbind(AMR::antimicrobials, AB_LOOKUP) n2 <- nrow(AMR_env$AB_lookup) AMR_env$custom_ab_codes <- character(0) AMR_env$ab_previously_coerced <- AMR_env$ab_previously_coerced[which(AMR_env$ab_previously_coerced$ab %in% AMR_env$AB_lookup$ab), , drop = FALSE] - message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal `antibiotics` data set.") + message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal `antimicrobials` data set.") } diff --git a/R/custom_eucast_rules.R b/R/custom_eucast_rules.R index ed8a9dbb1..729e14d38 100755 --- a/R/custom_eucast_rules.R +++ b/R/custom_eucast_rules.R @@ -89,11 +89,11 @@ #' #> 2 Klebsiella pneumoniae R R S #' ``` #' -#' ### Usage of multiple antibiotics and antibiotic group names +#' ### Usage of multiple antimicrobials and antimicrobial group names #' -#' You can define antibiotic groups instead of single antibiotics for the rule consequence, which is the part *after* the tilde (~). In the examples above, the antibiotic group `aminopenicillins` includes both ampicillin and amoxicillin. +#' You can define antimicrobial groups instead of single antimicrobials for the rule consequence, which is the part *after* the tilde (~). In the examples above, the antimicrobial group `aminopenicillins` includes both ampicillin and amoxicillin. #' -#' Rules can also be applied to multiple antibiotics and antibiotic groups simultaneously. Use the `c()` function to combine multiple antibiotics. For instance, the following example sets all aminopenicillins and ureidopenicillins to "R" if column TZP (piperacillin/tazobactam) is "R": +#' Rules can also be applied to multiple antimicrobials and antimicrobial groups simultaneously. Use the `c()` function to combine multiple antimicrobials. For instance, the following example sets all aminopenicillins and ureidopenicillins to "R" if column TZP (piperacillin/tazobactam) is "R": #' #' ```r #' x <- custom_eucast_rules(TZP == "R" ~ c(aminopenicillins, ureidopenicillins) == "R") @@ -104,7 +104,7 @@ #' #> amoxicillin (AMX), ampicillin (AMP), azlocillin (AZL), mezlocillin (MEZ), piperacillin (PIP), piperacillin/tazobactam (TZP) #' ``` #' -#' These `r length(DEFINED_AB_GROUPS)` antibiotic groups are allowed in the rules (case-insensitive) and can be used in any combination: +#' These `r length(DEFINED_AB_GROUPS)` antimicrobial groups are allowed in the rules (case-insensitive) and can be used in any combination: #' #' `r paste0(" * ", sapply(DEFINED_AB_GROUPS, function(x) paste0(tolower(gsub("^AB_", "", x)), "\\cr(", vector_and(ab_name(eval(parse(text = x), envir = asNamespace("AMR")), language = NULL, tolower = TRUE), quotes = FALSE), ")"), USE.NAMES = FALSE), "\n", collapse = "")` #' @returns A [list] containing the custom rules diff --git a/R/data.R b/R/data.R index ce55e5482..869ff3936 100755 --- a/R/data.R +++ b/R/data.R @@ -27,23 +27,23 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -#' Data Sets with `r format(nrow(antibiotics) + nrow(antivirals), big.mark = " ")` Antimicrobial Drugs +#' Data Sets with `r format(nrow(antimicrobials) + nrow(antivirals), big.mark = " ")` Antimicrobial Drugs #' -#' Two data sets containing all antibiotics/antimycotics and antivirals. Use [as.ab()] or one of the [`ab_*`][ab_property()] functions to retrieve values from the [antibiotics] data set. Three identifiers are included in this data set: an antibiotic 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 antimcrobial 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. #' @format -#' ### For the [antibiotics] data set: a [tibble][tibble::tibble] with `r nrow(antibiotics)` observations and `r ncol(antibiotics)` variables: -#' - `ab`\cr Antibiotic 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.*** +#' ### For the [antimicrobials] data set: a [tibble][tibble::tibble] with `r nrow(antimicrobials)` observations and `r ncol(antimicrobials)` variables: +#' - `ab`\cr antimcrobial 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.*** #' - `cid`\cr Compound ID as found in PubChem. ***This is a unique identifier.*** #' - `name`\cr Official name as used by WHONET/EARS-Net or the WHO. ***This is a unique identifier.*** #' - `group`\cr A short and concise group name, based on WHONET and WHOCC definitions #' - `atc`\cr ATC codes (Anatomical Therapeutic Chemical) as defined by the WHOCC, like `J01CR02` #' - `atc_group1`\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like `"Macrolides, lincosamides and streptogramins"` #' - `atc_group2`\cr Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like `"Macrolides"` -#' - `abbr`\cr List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST) +#' - `abbr`\cr List of abbreviations as used in many countries, also for antimcrobial susceptibility testing (AST) #' - `synonyms`\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID -#' - `oral_ddd`\cr Defined Daily Dose (DDD), oral treatment, currently available for `r sum(!is.na(antibiotics$oral_ddd))` drugs +#' - `oral_ddd`\cr Defined Daily Dose (DDD), oral treatment, currently available for `r sum(!is.na(AMR::antimicrobials$oral_ddd))` drugs #' - `oral_units`\cr Units of `oral_ddd` -#' - `iv_ddd`\cr Defined Daily Dose (DDD), parenteral (intravenous) treatment, currently available for `r sum(!is.na(antibiotics$iv_ddd))` drugs +#' - `iv_ddd`\cr Defined Daily Dose (DDD), parenteral (intravenous) treatment, currently available for `r sum(!is.na(AMR::antimicrobials$iv_ddd))` drugs #' - `iv_units`\cr Units of `iv_ddd` #' - `loinc`\cr All codes associated with the name of the antimicrobial drug from `r TAXONOMY_VERSION$LOINC$citation` Use [ab_loinc()] to retrieve them quickly, see [ab_property()]. #' @@ -74,12 +74,13 @@ #' * European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: #' @inheritSection WHOCC WHOCC #' @seealso [microorganisms], [intrinsic_resistant] +#' @aliases antibiotics #' @examples -#' antibiotics +#' antimicrobials #' antivirals -"antibiotics" +"antimicrobials" -#' @rdname antibiotics +#' @rdname antimicrobials "antivirals" #' Data Set with `r format(nrow(microorganisms), big.mark = " ")` Taxonomic Records of Microorganisms @@ -214,7 +215,7 @@ #' - `gender`\cr Gender of the patient, either `r vector_or(example_isolates$gender)` #' - `ward`\cr Ward type where the patient was admitted, either `r vector_or(example_isolates$ward)` #' - `mo`\cr ID of microorganism created with [as.mo()], see also the [microorganisms] data set -#' - `PEN:RIF`\cr `r sum(vapply(FUN.VALUE = logical(1), example_isolates, is.sir))` different antibiotics with class [`sir`] (see [as.sir()]); these column names occur in the [antibiotics] data set and can be translated with [set_ab_names()] or [ab_name()] +#' - `PEN:RIF`\cr `r sum(vapply(FUN.VALUE = logical(1), example_isolates, is.sir))` different antimicrobials with class [`sir`] (see [as.sir()]); these column names occur in the [antimicrobials] data set and can be translated with [set_ab_names()] or [ab_name()] #' @details #' Like all data sets in this package, this data set is publicly available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. Please visit [our website for the download links](https://msberends.github.io/AMR/articles/datasets.html). The actual files are of course available on [our GitHub repository](https://github.com/msberends/AMR/tree/main/data-raw). #' @examples @@ -229,7 +230,7 @@ #' - `date`\cr date of receipt at the laboratory #' - `hospital`\cr ID of the hospital, from A to C #' - `bacteria`\cr info about microorganism that can be transformed with [as.mo()], see also [microorganisms] -#' - `AMX:GEN`\cr 4 different antibiotics that have to be transformed with [as.sir()] +#' - `AMX:GEN`\cr 4 different antimicrobials that have to be transformed with [as.sir()] #' @details #' Like all data sets in this package, this data set is publicly available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. Please visit [our website for the download links](https://msberends.github.io/AMR/articles/datasets.html). The actual files are of course available on [our GitHub repository](https://github.com/msberends/AMR/tree/main/data-raw). #' @examples @@ -238,7 +239,7 @@ #' Data Set with `r format(nrow(WHONET), big.mark = " ")` Isolates - WHONET Example #' -#' This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antibiotic results are from our [example_isolates] data set. All patient names were created using online surname generators and are only in place for practice purposes. +#' This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antimcrobial results are from our [example_isolates] data set. All patient names were created using online surname generators and are only in place for practice purposes. #' @format A [tibble][tibble::tibble] with `r format(nrow(WHONET), big.mark = " ")` observations and `r ncol(WHONET)` variables: #' - `Identification number`\cr ID of the sample #' - `Specimen number`\cr ID of the specimen @@ -265,7 +266,7 @@ #' - `Inducible clindamycin resistance`\cr Clindamycin can be induced? #' - `Comment`\cr Other comments #' - `Date of data entry`\cr [Date] this data was entered in WHONET -#' - `AMP_ND10:CIP_EE`\cr `r sum(vapply(FUN.VALUE = logical(1), WHONET, is.sir))` different antibiotics. You can lookup the abbreviations in the [antibiotics] data set, or use e.g. [`ab_name("AMP")`][ab_name()] to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using [as.sir()]. +#' - `AMP_ND10:CIP_EE`\cr `r sum(vapply(FUN.VALUE = logical(1), WHONET, is.sir))` different antimicrobials. You can lookup the abbreviations in the [antimicrobials] data set, or use e.g. [`ab_name("AMP")`][ab_name()] to get the official name immediately. Before analysis, you should transform this to a valid antimcrobial class, using [as.sir()]. #' @details #' Like all data sets in this package, this data set is publicly available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. Please visit [our website for the download links](https://msberends.github.io/AMR/articles/datasets.html). The actual files are of course available on [our GitHub repository](https://github.com/msberends/AMR/tree/main/data-raw). #' @examples @@ -290,7 +291,7 @@ #' - `site`\cr Body site for which the breakpoint must be applied, e.g. "Oral" or "Respiratory" #' - `mo`\cr Microbial ID, see [as.mo()] #' - `rank_index`\cr Taxonomic rank index of `mo` from 1 (subspecies/infraspecies) to 5 (unknown microorganism) -#' - `ab`\cr Antibiotic code as used by this package, EARS-Net and WHONET, see [as.ab()] +#' - `ab`\cr Antimcrobial code as used by this package, EARS-Net and WHONET, see [as.ab()] #' - `ref_tbl`\cr Info about where the guideline rule can be found #' - `disk_dose`\cr Dose of the used disk diffusion method #' - `breakpoint_S`\cr Lowest MIC value or highest number of millimetres that leads to "S" @@ -323,7 +324,7 @@ #' Data set containing defined intrinsic resistance by EUCAST of all bug-drug combinations. #' @format A [tibble][tibble::tibble] with `r format(nrow(intrinsic_resistant), big.mark = " ")` observations and `r ncol(intrinsic_resistant)` variables: #' - `mo`\cr Microorganism ID -#' - `ab`\cr Antibiotic ID +#' - `ab`\cr Antimcrobial ID #' @details #' This data set is based on `r format_eucast_version_nr(3.3)`. #' @@ -339,7 +340,7 @@ #' #' EUCAST breakpoints used in this package are based on the dosages in this data set. They can be retrieved with [eucast_dosage()]. #' @format A [tibble][tibble::tibble] with `r format(nrow(dosage), big.mark = " ")` observations and `r ncol(dosage)` variables: -#' - `ab`\cr Antibiotic ID as used in this package (such as `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available +#' - `ab`\cr Antimcrobial ID as used in this package (such as `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available #' - `name`\cr Official name of the antimicrobial drug as used by WHONET/EARS-Net or the WHO #' - `type`\cr Type of the dosage, either `r vector_or(dosage$type)` #' - `dose`\cr Dose, such as "2 g" or "25 mg/kg" diff --git a/R/eucast_rules.R b/R/eucast_rules.R index da09fcd74..dc151b818 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -59,7 +59,7 @@ format_eucast_version_nr <- function(version, markdown = TRUE) { #' Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, ), see *Source*. Use [eucast_dosage()] to get a [data.frame] with advised dosages of a certain bug-drug combination, which is based on the [dosage] data set. #' #' To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see *Details*. -#' @param x a data set with antibiotic columns, such as `amox`, `AMX` and `AMC` +#' @param x a data set with antimicrobials columns, such as `amox`, `AMX` and `AMC` #' @param info a [logical] to indicate whether progress should be printed to the console - the default is only print while in interactive sessions #' @param rules a [character] vector that specifies which rules should be applied. Must be one or more of `"breakpoints"`, `"expert"`, `"other"`, `"custom"`, `"all"`, and defaults to `c("breakpoints", "expert")`. The default value can be set to another value using the package option [`AMR_eucastrules`][AMR-options]: `options(AMR_eucastrules = "all")`. If using `"custom"`, be sure to fill in argument `custom_rules` too. Custom rules can be created with [custom_eucast_rules()]. #' @param verbose a [logical] to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way. Using Verbose mode takes a lot more time. @@ -67,10 +67,10 @@ format_eucast_version_nr <- function(version, markdown = TRUE) { #' @param version_expertrules the version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be `r vector_or(names(EUCAST_VERSION_EXPERT_RULES), reverse = TRUE)`. # @param version_resistant_phenotypes the version number to use for the EUCAST Expected Resistant Phenotypes. Can be `r vector_or(names(EUCAST_VERSION_RESISTANTPHENOTYPES), reverse = TRUE)`. #' @param ampc_cephalosporin_resistance a [character] value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants - the default is `NA`. Currently only works when `version_expertrules` is `3.2` and higher; these version of '*EUCAST Expert Rules on Enterobacterales*' state that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three drugs. A value of `NA` (the default) for this argument will remove results for these three drugs, while e.g. a value of `"R"` will make the results for these drugs resistant. Use `NULL` or `FALSE` to not alter results for these three drugs of AmpC de-repressed cephalosporin-resistant mutants. Using `TRUE` is equal to using `"R"`. \cr For *EUCAST Expert Rules* v3.2, this rule applies to: `r vector_and(gsub("[^a-zA-Z ]+", "", unlist(strsplit(EUCAST_RULES_DF[which(EUCAST_RULES_DF$reference.version %in% c(3.2, 3.3) & EUCAST_RULES_DF$reference.rule %like% "ampc"), "this_value"][1], "|", fixed = TRUE))), quotes = "*")`. -#' @param ... column name of an antibiotic, see section *Antibiotics* below -#' @param ab any (vector of) text that can be coerced to a valid antibiotic drug code with [as.ab()] +#' @param ... column name of an antimicrobial, see section *Antimicrobials* below +#' @param ab any (vector of) text that can be coerced to a valid antimicrobial drug code with [as.ab()] #' @param administration route of administration, either `r vector_or(dosage$administration)` -#' @param only_sir_columns a [logical] to indicate whether only antibiotic columns must be detected that were transformed to class `sir` (see [as.sir()]) on beforehand (default is `FALSE`) +#' @param only_sir_columns a [logical] to indicate whether only antimicrobial columns must be detected that were transformed to class `sir` (see [as.sir()]) on beforehand (default is `FALSE`) #' @param custom_rules custom rules to apply, created with [custom_eucast_rules()] #' @param overwrite a [logical] to indicate whether non-`NA` values must be overwritten (defaults to `TRUE`). With `FALSE`, only `NA` values are changed. #' @inheritParams first_isolate @@ -101,16 +101,16 @@ format_eucast_version_nr <- function(version, markdown = TRUE) { #' Important examples include amoxicillin and amoxicillin/clavulanic acid, and trimethoprim and trimethoprim/sulfamethoxazole. Needless to say, for these rules to work, both drugs must be available in the data set. #' #' Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include `"other"` to the `rules` argument, or use `eucast_rules(..., rules = "all")`. You can also set the package option [`AMR_eucastrules`][AMR-options], i.e. run `options(AMR_eucastrules = "all")`. -#' @section Antibiotics: -#' To define antibiotics column names, leave as it is to determine it automatically with [guess_ab_col()] or input a text (case-insensitive), or use `NULL` to skip a column (e.g. `TIC = NULL` to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. +#' @section Antimicrobials: +#' To define antimicrobials column names, leave as it is to determine it automatically with [guess_ab_col()] or input a text (case-insensitive), or use `NULL` to skip a column (e.g. `TIC = NULL` to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. #' -#' The following antibiotics are eligible for the functions [eucast_rules()] and [mdro()]. These are shown below in the format 'name (`antimicrobial ID`, [ATC code](https://atcddd.fhi.no/atc/structure_and_principles/))', sorted alphabetically: +#' The following antimicrobials are eligible for the functions [eucast_rules()] and [mdro()]. These are shown below in the format 'name (`antimicrobial ID`, [ATC code](https://atcddd.fhi.no/atc/structure_and_principles/))', sorted alphabetically: #' #' `r create_eucast_ab_documentation()` #' @aliases EUCAST #' @rdname eucast_rules #' @export -#' @return The input of `x`, possibly with edited values of antibiotics. Or, if `verbose = TRUE`, a [data.frame] with all original and new values of the affected bug-drug combinations. +#' @return The input of `x`, possibly with edited values of antimicrobials. Or, if `verbose = TRUE`, a [data.frame] with all original and new values of the affected bug-drug combinations. #' @source #' - EUCAST Expert Rules. Version 2.0, 2012.\cr #' Leclercq et al. **EUCAST expert rules in antimicrobial susceptibility testing.** *Clin Microbiol Infect.* 2013;19(2):141-60; \doi{https://doi.org/10.1111/j.1469-0691.2011.03703.x} @@ -346,7 +346,7 @@ eucast_rules <- function(x, strsplit(",") %pm>% unlist() %pm>% trimws2() %pm>% - vapply(FUN.VALUE = character(1), function(x) if (x %in% AMR::antibiotics$ab) ab_name(x, language = NULL, tolower = TRUE, fast_mode = TRUE) else x) %pm>% + vapply(FUN.VALUE = character(1), function(x) if (x %in% AMR::antimicrobials$ab) ab_name(x, language = NULL, tolower = TRUE, fast_mode = TRUE) else x) %pm>% sort() %pm>% paste(collapse = ", ") x <- gsub("_", " ", x, fixed = TRUE) @@ -471,10 +471,10 @@ eucast_rules <- function(x, )) cat("\n\n") } - ab_enzyme <- subset(AMR::antibiotics, name %like% "/")[, c("ab", "name"), drop = FALSE] + ab_enzyme <- subset(AMR::antimicrobials, name %like% "/")[, c("ab", "name"), drop = FALSE] colnames(ab_enzyme) <- c("enzyme_ab", "enzyme_name") ab_enzyme$base_name <- gsub("^([a-zA-Z0-9]+).*", "\\1", ab_enzyme$enzyme_name) - ab_enzyme$base_ab <- AMR::antibiotics[match(ab_enzyme$base_name, AMR::antibiotics$name), "ab", drop = TRUE] + ab_enzyme$base_ab <- AMR::antimicrobials[match(ab_enzyme$base_name, AMR::antimicrobials$name), "ab", drop = TRUE] ab_enzyme <- subset(ab_enzyme, !is.na(base_ab)) # make ampicillin and amoxicillin interchangable ampi <- subset(ab_enzyme, base_ab == "AMX") @@ -825,7 +825,7 @@ eucast_rules <- function(x, # error = function(e) integer(0)) # nolint end } else { - stop_("only 2 antibiotics supported for source_antibiotics") + stop_("only 2 antimicrobials supported for source_antibiotics") } } diff --git a/R/first_isolate.R b/R/first_isolate.R index 033783157..c76da8826 100644 --- a/R/first_isolate.R +++ b/R/first_isolate.R @@ -364,7 +364,7 @@ first_isolate <- function(x = NULL, specimen_group <- NULL } - # filter on specimen group and keyantibiotics when they are filled in + # filter on specimen group and keyantimicrobials when they are filled in if (!is.null(specimen_group)) { check_columns_existance(col_specimen, x) if (isTRUE(info) && message_not_thrown_before("first_isolate", "excludingspecimen")) { diff --git a/R/ggplot_sir.R b/R/ggplot_sir.R index 1b1659f7a..7334f9f91 100755 --- a/R/ggplot_sir.R +++ b/R/ggplot_sir.R @@ -49,9 +49,9 @@ #' @param x.title text to show as x axis description #' @param y.title text to show as y axis description #' @param ... other arguments passed on to [geom_sir()] or, in case of [scale_sir_colours()], named values to set colours. The default colours are colour-blind friendly, while maintaining the convention that e.g. 'susceptible' should be green and 'resistant' should be red. See *Examples*. -#' @details At default, the names of antibiotics will be shown on the plots using [ab_name()]. This can be set with the `translate_ab` argument. See [count_df()]. +#' @details At default, the names of antimicrobials will be shown on the plots using [ab_name()]. This can be set with the `translate_ab` argument. See [count_df()]. #' -#' [geom_sir()] will take any variable from the data that has an [`sir`] class (created with [as.sir()]) using [sir_df()] and will plot bars with the percentage S, I, and R. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis. +#' [geom_sir()] will take any variable from the data that has an [`sir`] class (created with [as.sir()]) using [sir_df()] and will plot bars with the percentage S, I, and R. The default behaviour is to have the bars stacked and to have the different antimicrobials on the x axis. #' #' Additional functions include: #' @@ -320,7 +320,7 @@ geom_sir <- function(position = NULL, x <- substr(x, 2, nchar(x) - 1) } - if (tolower(x) %in% tolower(c("ab", "abx", "antibiotics"))) { + if (tolower(x) %in% tolower(c("ab", "abx", "antimicrobials"))) { x <- "antibiotic" } else if (tolower(x) %in% tolower(c("SIR", "sir", "interpretations", "result"))) { x <- "interpretation" diff --git a/R/guess_ab_col.R b/R/guess_ab_col.R index 4ae26f188..b6584f5b0 100755 --- a/R/guess_ab_col.R +++ b/R/guess_ab_col.R @@ -29,12 +29,12 @@ #' Guess Antibiotic Column #' -#' This tries to find a column name in a data set based on information from the [antibiotics] data set. Also supports WHONET abbreviations. +#' This tries to find a column name in a data set based on information from the [antimicrobials] data set. Also supports WHONET abbreviations. #' @param x a [data.frame] #' @param search_string a text to search `x` for, will be checked with [as.ab()] if this value is not a column in `x` #' @param verbose a [logical] to indicate whether additional info should be printed #' @param only_sir_columns a [logical] to indicate whether only antibiotic columns must be detected that were transformed to class `sir` (see [as.sir()]) on beforehand (default is `FALSE`) -#' @details You can look for an antibiotic (trade) name or abbreviation and it will search `x` and the [antibiotics] data set for any column containing a name or code of that antibiotic. +#' @details You can look for an antibiotic (trade) name or abbreviation and it will search `x` and the [antimicrobials] data set for any column containing a name or code of that antibiotic. #' @return A column name of `x`, or `NULL` when no result is found. #' @export #' @examples diff --git a/R/key_antimicrobials.R b/R/key_antimicrobials.R index db5e98aab..9423f33d5 100755 --- a/R/key_antimicrobials.R +++ b/R/key_antimicrobials.R @@ -30,7 +30,7 @@ #' (Key) Antimicrobials for First Weighted Isolates #' #' These functions can be used to determine first weighted isolates by considering the phenotype for isolate selection (see [first_isolate()]). Using a phenotype-based method to determine first isolates is more reliable than methods that disregard phenotypes. -#' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be left blank to determine automatically +#' @param x a [data.frame] with antimicrobials columns, like `AMX` or `amox`. Can be left blank to determine automatically. #' @param y,z [character] vectors to compare #' @inheritParams first_isolate #' @param universal names of **broad-spectrum** antimicrobial drugs, case-insensitive. Set to `NULL` to ignore. See *Details* for the default antimicrobial drugs @@ -73,7 +73,6 @@ #' - Tetracycline #' - Vancomycin #' -#' #' The default antimicrobial drugs used for **fungi** (set in `antifungal`) are: #' #' - Anidulafungin @@ -102,7 +101,7 @@ #' #' \donttest{ #' if (require("dplyr")) { -#' # set key antibiotics to a new variable +#' # set key antimicrobials to a new variable #' my_patients <- example_isolates %>% #' mutate(keyab = key_antimicrobials(antifungal = NULL)) %>% # no need to define `x` #' mutate( @@ -192,7 +191,7 @@ key_antimicrobials <- function(x = NULL, ) } - generate_antimcrobials_string(x[which(filter), c(universal, values), drop = FALSE]) + generate_antimicrobials_string(x[which(filter), c(universal, values), drop = FALSE]) } if (is.null(universal)) { @@ -264,10 +263,10 @@ all_antimicrobials <- function(x = NULL, sort = FALSE, fn = "all_antimicrobials" ) - generate_antimcrobials_string(x[, cols, drop = FALSE]) + generate_antimicrobials_string(x[, cols, drop = FALSE]) } -generate_antimcrobials_string <- function(df) { +generate_antimicrobials_string <- function(df) { if (NCOL(df) == 0) { return(rep("", NROW(df))) } diff --git a/R/mdro.R b/R/mdro.R index 19b114d45..b2742d7e9 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -30,7 +30,7 @@ #' Determine Multidrug-Resistant Organisms (MDRO) #' #' Determine which isolates are multidrug-resistant organisms (MDRO) according to international, national, or custom guidelines. -#' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be left blank for automatic determination. +#' @param x a [data.frame] with antimicrobials columns, like `AMX` or `amox`. Can be left blank for automatic determination. #' @param guideline a specific guideline to follow, see sections *Supported international / national guidelines* and *Using Custom Guidelines* below. When left empty, the publication by Magiorakos *et al.* (see below) will be followed. #' @param esbl [logical] values, or a column name containing logical values, indicating the presence of an ESBL gene (or production of its proteins) #' @param carbapenemase [logical] values, or a column name containing logical values, indicating the presence of a carbapenemase gene (or production of its proteins) @@ -38,13 +38,13 @@ #' @param mecC [logical] values, or a column name containing logical values, indicating the presence of a *mecC* gene (or production of its proteins) #' @param vanA [logical] values, or a column name containing logical values, indicating the presence of a *vanA* gene (or production of its proteins) #' @param vanB [logical] values, or a column name containing logical values, indicating the presence of a *vanB* gene (or production of its proteins) -#' @param ... in case of [custom_mdro_guideline()]: a set of rules, see section *Using Custom Guidelines* below. Otherwise: column name of an antibiotic, see section *Antibiotics* below. +#' @param ... in case of [custom_mdro_guideline()]: a set of rules, see section *Using Custom Guidelines* below. Otherwise: column name of an antibiotic, see section *Antimicrobials* below. #' @param as_factor a [logical] to indicate whether the returned value should be an ordered [factor] (`TRUE`, default), or otherwise a [character] vector #' @inheritParams eucast_rules #' @param pct_required_classes minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for *S. aureus*. Setting this `pct_required_classes` argument to `0.5` (default) means that for every *S. aureus* isolate at least 8 different classes must be available. Any lower number of available classes will return `NA` for that isolate. #' @param combine_SI a [logical] to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the [mdro()] function, it follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using `combine_SI = FALSE`, resistance is considered when isolates are R or I. #' @param verbose a [logical] to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not. -#' @inheritSection eucast_rules Antibiotics +#' @inheritSection eucast_rules Antimicrobials #' @details #' These functions are context-aware. This means that the `x` argument can be left blank if used inside a [data.frame] call, see *Examples*. #' @@ -801,7 +801,7 @@ mdro <- function(x = NULL, if (is.null(reason)) { reason <- paste0( any_all, - " of the required antibiotics ", + " of the required antimicrobials ", ifelse(any_all == "any", "is", "are"), " R", ifelse(!isTRUE(combine_SI), " or I", "") @@ -1126,7 +1126,7 @@ mdro <- function(x = NULL, x[which(x$classes_affected == 999 & x$classes_in_guideline == x$classes_available), "MDRO"] <- 4 if (isTRUE(verbose)) { x[which(x$MDRO == 4), "reason"] <- paste( - "all antibiotics in all", + "all antimicrobials in all", x$classes_in_guideline[which(x$MDRO == 4)], "classes were tested R", ifelse(!isTRUE(combine_SI), " or I", "") @@ -1850,7 +1850,7 @@ mdro <- function(x = NULL, " (3 required for MDR)" ) } else { - # x[which(x$MDRO == 1), "reason"] <- "too few antibiotics are R" + # x[which(x$MDRO == 1), "reason"] <- "too few antimicrobials are R" } } diff --git a/R/mo_property.R b/R/mo_property.R index 7cf4a8920..0edccd364 100755 --- a/R/mo_property.R +++ b/R/mo_property.R @@ -52,7 +52,7 @@ #' #' Determination of yeasts ([mo_is_yeast()]) will be based on the taxonomic kingdom and class. *Budding yeasts* are yeasts that reproduce asexually through a process called budding, where a new cell develops from a small protrusion on the parent cell. Taxonomically, these are members of the phylum Ascomycota, class Saccharomycetes (also called Hemiascomycetes) or Pichiomycetes. *True yeasts* quite specifically refers to yeasts in the underlying order Saccharomycetales (such as *Saccharomyces cerevisiae*). Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes or Pichiomycetes, the function will return `TRUE`. It returns `FALSE` otherwise (or `NA` when the input is `NA` or the MO code is `UNKNOWN`). #' -#' Determination of intrinsic resistance ([mo_is_intrinsic_resistant()]) will be based on the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(3.3)`. The [mo_is_intrinsic_resistant()] function can be vectorised over both argument `x` (input for microorganisms) and `ab` (input for antibiotics). +#' Determination of intrinsic resistance ([mo_is_intrinsic_resistant()]) will be based on the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(3.3)`. The [mo_is_intrinsic_resistant()] function can be vectorised over both argument `x` (input for microorganisms) and `ab` (input for antimicrobials). #' #' Determination of bacterial oxygen tolerance ([mo_oxygen_tolerance()]) will be based on BacDive, see *Source*. The function [mo_is_anaerobic()] only returns `TRUE` if the oxygen tolerance is `"anaerobe"`, indicting an obligate anaerobic species or genus. It always returns `FALSE` for species outside the taxonomic kingdom of Bacteria. #' diff --git a/R/plotting.R b/R/plotting.R index a05ae0579..9bf8f7abc 100755 --- a/R/plotting.R +++ b/R/plotting.R @@ -1230,7 +1230,7 @@ facet_sir <- function(facet = c("interpretation", "antibiotic"), nrow = NULL) { if (tolower(facet) %in% tolower(c("SIR", "sir", "interpretations", "result"))) { facet <- "interpretation" - } else if (tolower(facet) %in% tolower(c("ab", "abx", "antibiotics"))) { + } else if (tolower(facet) %in% tolower(c("ab", "abx", "antimicrobials"))) { facet <- "antibiotic" } diff --git a/R/proportion.R b/R/proportion.R index 63983e86b..94cfb434c 100644 --- a/R/proportion.R +++ b/R/proportion.R @@ -35,9 +35,9 @@ #' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [as.sir()] if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See *Examples*. #' @param minimum the minimum allowed number of available (tested) isolates. Any isolate count lower than `minimum` will return `NA` with a warning. The default number of `30` isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see *Source*. #' @param as_percent a [logical] to indicate whether the output must be returned as a hundred fold with % sign (a character). A value of `0.123456` will then be returned as `"12.3%"`. -#' @param only_all_tested (for combination therapies, i.e. using more than one variable for `...`): a [logical] to indicate that isolates must be tested for all antibiotics, see section *Combination Therapy* below +#' @param only_all_tested (for combination therapies, i.e. using more than one variable for `...`): a [logical] to indicate that isolates must be tested for all antimicrobials, see section *Combination Therapy* below #' @param data a [data.frame] containing columns with class [`sir`] (see [as.sir()]) -#' @param translate_ab a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()] +#' @param translate_ab a column name of the [antimicrobials] data set to translate the antibiotic abbreviations to, using [ab_property()] #' @inheritParams ab_property #' @param combine_SI a [logical] to indicate whether all values of S, SDD, and I must be merged into one, so the output only consists of S+SDD+I vs. R (susceptible vs. resistant) - the default is `TRUE` #' @param ab_result antibiotic results to test against, must be one or more values of "S", "SDD", "I", or "R" @@ -58,7 +58,7 @@ #' #' The function [proportion_df()] takes any variable from `data` that has an [`sir`] class (created with [as.sir()]) and calculates the proportions S, I, and R. It also supports grouped variables. The function [sir_df()] works exactly like [proportion_df()], but adds the number of isolates. #' @section Combination Therapy: -#' When using more than one variable for `...` (= combination therapy), use `only_all_tested` to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how [susceptibility()] works to calculate the %SI: +#' When using more than one variable for `...` (= combination therapy), use `only_all_tested` to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antimicrobials, Drug A and Drug B, about how [susceptibility()] works to calculate the %SI: #' #' #' ``` diff --git a/R/temp_file b/R/temp_file new file mode 100644 index 000000000..2cec545fc --- /dev/null +++ b/R/temp_file @@ -0,0 +1 @@ +test_that("key_antimicrobials works", { diff --git a/R/zz_deprecated.R b/R/zz_deprecated.R index 99b168727..06ec4ad20 100755 --- a/R/zz_deprecated.R +++ b/R/zz_deprecated.R @@ -29,12 +29,16 @@ #' Deprecated Functions #' -#' 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). +#' These objects are so-called '[Deprecated]'. **They will be removed in a future version of this package.** Using these will give a warning with the name of the alternative object it has been replaced by (if there is one). #' @keywords internal #' @name AMR-deprecated #' @rdname AMR-deprecated NULL +#' @rdname AMR-deprecated +#' @export +"antibiotics" + #' @rdname AMR-deprecated #' @export ab_class <- function(...) { @@ -50,7 +54,7 @@ ab_selector <- function(...) { } -deprecation_warning <- function(old = NULL, new = NULL, extra_msg = NULL, is_function = TRUE) { +deprecation_warning <- function(old = NULL, new = NULL, extra_msg = NULL, is_function = TRUE, is_dataset = FALSE) { if (is.null(old)) { warning_(extra_msg) } else { @@ -61,17 +65,25 @@ deprecation_warning <- function(old = NULL, new = NULL, extra_msg = NULL, is_fun old <- paste0(old, "()") new <- paste0(new, "()") type <- "function" + } else if (isTRUE(is_dataset)) { + type <- "dataset" } else { type <- "argument" } warning_( ifelse(is.null(new), paste0("The `", old, "` ", type, " is no longer in use"), - paste0("The `", old, "` ", type, " has been replaced with `", new, "` and will be removed in a future version") + ifelse(type == "dataset", + paste0("The `", old, "` ", type, " has been renamed to `", new, "`"), + paste0("The `", old, "` ", type, " has been replaced with `", new, "` and will be removed in a future version") + ) ), - ifelse(type == "argument", - ". While the old argument still works, it will be removed in a future version, so please update your code.", - ", see `?AMR-deprecated`." + ifelse(type == "dataset", + ". The old name will be removed in future version, so please update your code.", + ifelse(type == "argument", + ". While the old argument still works, it will be removed in a future version, so please update your code.", + ", see `?AMR-deprecated`." + ) ), ifelse(!is.null(extra_msg), paste0(" ", extra_msg), diff --git a/R/zzz.R b/R/zzz.R index a76fcd412..d89f1e869 100755 --- a/R/zzz.R +++ b/R/zzz.R @@ -91,7 +91,7 @@ AMR_env$cli_abort <- import_fn("cli_abort", "cli", error_on_fail = FALSE) AMR_env$cross_icon <- if (isTRUE(base::l10n_info()$`UTF-8`)) "\u00d7" else "x" -.onLoad <- function(lib, pkg) { +.onLoad <- function(libname, pkgname) { # Support for tibble headers (type_sum) and tibble columns content (pillar_shaft) # without the need to depend on other packages. This was suggested by the # developers of the vctrs package: @@ -203,15 +203,22 @@ AMR_env$cross_icon <- if (isTRUE(base::l10n_info()$`UTF-8`)) "\u00d7" else "x" # reference data - they have additional data to improve algorithm speed # they cannot be part of R/sysdata.rda since CRAN thinks it would make the package too large (+3 MB) - if (NROW(AB_LOOKUP) != NROW(AMR::antibiotics)) { + if (NROW(AB_LOOKUP) != NROW(AMR::antimicrobials)) { # antibiotics data set was updated - run create_AB_AV_lookup() again - AB_LOOKUP <- create_AB_AV_lookup(AMR::antibiotics) + AB_LOOKUP <- create_AB_AV_lookup(AMR::antimicrobials) } - AMR_env$AB_lookup <- cbind(AMR::antibiotics, AB_LOOKUP) + + # deprecated antibiotics data set + makeActiveBinding("antibiotics", function() { + deprecation_warning(old = "antibiotics", new = "antimicrobials", is_function = FALSE, is_dataset = TRUE) + AMR::antimicrobials + }, env = asNamespace(pkgname)) + + AMR_env$AB_lookup <- cbind(AMR::antimicrobials, AB_LOOKUP) AMR_env$AV_lookup <- cbind(AMR::antivirals, AV_LOOKUP) } -.onAttach <- function(lib, pkg) { +.onAttach <- function(libname, pkgname) { # if custom ab option is available, load it if (!is.null(getOption("AMR_custom_ab")) && file.exists(getOption("AMR_custom_ab", default = ""))) { if (getOption("AMR_custom_ab") %unlike% "[.]rds$") { diff --git a/_pkgdown.yml b/_pkgdown.yml index 192c503c3..89430a521 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -151,9 +151,9 @@ reference: - "`add_custom_microorganisms`" - "`mo_source`" - - title: "Preparing data: antibiotics" + - title: "Preparing data: antimicrobials" desc: > - Use these functions to get valid properties of antibiotics from any input or to clean your input. + Use these functions to get valid properties of antimicrobials from any input or to clean your input. You can even retrieve drug names and doses from clinical text records, using `ab_from_text()`. contents: - "`as.ab`" @@ -236,7 +236,7 @@ reference: for more information about how to work with functions in this package. contents: - "`microorganisms`" - - "`antibiotics`" + - "`antimicrobials`" - "`clinical_breakpoints`" - "`example_isolates`" - "`microorganisms.codes`" diff --git a/data-raw/_generate_python_wrapper.sh b/data-raw/_generate_python_wrapper.sh index e337c8638..ae38033c4 100644 --- a/data-raw/_generate_python_wrapper.sh +++ b/data-raw/_generate_python_wrapper.sh @@ -115,7 +115,7 @@ example_isolates['date'] = pd.to_datetime(example_isolates['date']) # microorganisms microorganisms = pandas2ri.rpy2py(robjects.r('AMR::microorganisms[, !sapply(AMR::microorganisms, is.list)]')) -antibiotics = pandas2ri.rpy2py(robjects.r('AMR::antibiotics[, !sapply(AMR::antibiotics, is.list)]')) +antimicrobials = pandas2ri.rpy2py(robjects.r('AMR::antimicrobials[, !sapply(AMR::antimicrobials, is.list)]')) clinical_breakpoints = pandas2ri.rpy2py(robjects.r('AMR::clinical_breakpoints[, !sapply(AMR::clinical_breakpoints, is.list)]')) base.options(warn = 0) @@ -125,7 +125,7 @@ EOL echo "from .datasets import example_isolates" >> $init_file echo "from .datasets import microorganisms" >> $init_file -echo "from .datasets import antibiotics" >> $init_file +echo "from .datasets import antimicrobials" >> $init_file echo "from .datasets import clinical_breakpoints" >> $init_file @@ -239,7 +239,7 @@ for rd_file in "$rd_dir"/*.Rd; do } # Skip functions matching the regex pattern - if (func_name_py ~ /^(x |facet|scale|set|get|NA_|microorganisms|antibiotics|clinical_breakpoints|example_isolates)/) { + if (func_name_py ~ /^(x |facet|scale|set|get|NA_|microorganisms|antimicrobials|clinical_breakpoints|example_isolates)/) { next } diff --git a/data-raw/_pre_commit_checks.R b/data-raw/_pre_commit_checks.R index 4dceeccf4..3d055cc10 100644 --- a/data-raw/_pre_commit_checks.R +++ b/data-raw/_pre_commit_checks.R @@ -364,98 +364,98 @@ pre_commit_lst$MO_RELEVANT_GENERA <- c( # antibiotic groups # (these will also be used for eucast_rules() and understanding data-raw/eucast_rules.tsv) -pre_commit_lst$AB_AMINOGLYCOSIDES <- antibiotics %>% +pre_commit_lst$AB_AMINOGLYCOSIDES <- antimicrobials %>% filter(group %like% "aminoglycoside") %>% pull(ab) pre_commit_lst$AB_AMINOPENICILLINS <- as.ab(c("AMP", "AMX")) -pre_commit_lst$AB_ANTIFUNGALS <- antibiotics %>% +pre_commit_lst$AB_ANTIFUNGALS <- antimicrobials %>% filter(group %like% "antifungal") %>% pull(ab) -pre_commit_lst$AB_ANTIMYCOBACTERIALS <- antibiotics %>% +pre_commit_lst$AB_ANTIMYCOBACTERIALS <- antimicrobials %>% filter(group %like% "antimycobacterial") %>% pull(ab) -pre_commit_lst$AB_CARBAPENEMS <- antibiotics %>% +pre_commit_lst$AB_CARBAPENEMS <- antimicrobials %>% filter(group %like% "carbapenem") %>% pull(ab) -pre_commit_lst$AB_CEPHALOSPORINS <- antibiotics %>% +pre_commit_lst$AB_CEPHALOSPORINS <- antimicrobials %>% filter(group %like% "cephalosporin") %>% pull(ab) -pre_commit_lst$AB_CEPHALOSPORINS_1ST <- antibiotics %>% +pre_commit_lst$AB_CEPHALOSPORINS_1ST <- antimicrobials %>% filter(group %like% "cephalosporin.*1") %>% pull(ab) -pre_commit_lst$AB_CEPHALOSPORINS_2ND <- antibiotics %>% +pre_commit_lst$AB_CEPHALOSPORINS_2ND <- antimicrobials %>% filter(group %like% "cephalosporin.*2") %>% pull(ab) -pre_commit_lst$AB_CEPHALOSPORINS_3RD <- antibiotics %>% +pre_commit_lst$AB_CEPHALOSPORINS_3RD <- antimicrobials %>% filter(group %like% "cephalosporin.*3") %>% pull(ab) -pre_commit_lst$AB_CEPHALOSPORINS_4TH <- antibiotics %>% +pre_commit_lst$AB_CEPHALOSPORINS_4TH <- antimicrobials %>% filter(group %like% "cephalosporin.*4") %>% pull(ab) -pre_commit_lst$AB_CEPHALOSPORINS_5TH <- antibiotics %>% +pre_commit_lst$AB_CEPHALOSPORINS_5TH <- antimicrobials %>% filter(group %like% "cephalosporin.*5") %>% pull(ab) pre_commit_lst$AB_CEPHALOSPORINS_EXCEPT_CAZ <- pre_commit_lst$AB_CEPHALOSPORINS[pre_commit_lst$AB_CEPHALOSPORINS != "CAZ"] -pre_commit_lst$AB_FLUOROQUINOLONES <- antibiotics %>% +pre_commit_lst$AB_FLUOROQUINOLONES <- antimicrobials %>% filter(atc_group2 %like% "fluoroquinolone" | (group %like% "quinolone" & is.na(atc_group2))) %>% pull(ab) -pre_commit_lst$AB_GLYCOPEPTIDES <- antibiotics %>% +pre_commit_lst$AB_GLYCOPEPTIDES <- antimicrobials %>% filter(group %like% "glycopeptide") %>% pull(ab) -pre_commit_lst$AB_ISOXAZOLYLPENICILLINS <- antibiotics %>% +pre_commit_lst$AB_ISOXAZOLYLPENICILLINS <- antimicrobials %>% filter(name %like% "oxacillin|cloxacillin|dicloxacillin|flucloxacillin|meth?icillin") %>% pull(ab) pre_commit_lst$AB_LIPOGLYCOPEPTIDES <- as.ab(c("DAL", "ORI", "TLV")) # dalba/orita/tela pre_commit_lst$AB_GLYCOPEPTIDES_EXCEPT_LIPO <- pre_commit_lst$AB_GLYCOPEPTIDES[!pre_commit_lst$AB_GLYCOPEPTIDES %in% pre_commit_lst$AB_LIPOGLYCOPEPTIDES] -pre_commit_lst$AB_LINCOSAMIDES <- antibiotics %>% +pre_commit_lst$AB_LINCOSAMIDES <- antimicrobials %>% filter(atc_group2 %like% "lincosamide" | (group %like% "lincosamide" & is.na(atc_group2) & name %like% "^(pirlimycin)" & name %unlike% "screening|inducible")) %>% pull(ab) -pre_commit_lst$AB_MACROLIDES <- antibiotics %>% +pre_commit_lst$AB_MACROLIDES <- antimicrobials %>% filter(atc_group2 %like% "macrolide" | (group %like% "macrolide" & is.na(atc_group2) & name %like% "^(acetylmidecamycin|acetylspiramycin|gamith?romycin|kitasamycin|meleumycin|nafith?romycin|solith?romycin|tildipirosin|tilmicosin|tulath?romycin|tylosin|tylvalosin)" & name %unlike% "screening|inducible")) %>% pull(ab) -pre_commit_lst$AB_MONOBACTAMS <- antibiotics %>% +pre_commit_lst$AB_MONOBACTAMS <- antimicrobials %>% filter(group %like% "monobactam") %>% pull(ab) -pre_commit_lst$AB_NITROFURANS <- antibiotics %>% +pre_commit_lst$AB_NITROFURANS <- antimicrobials %>% filter(name %like% "^furaz|nitrofura" | atc_group2 %like% "nitrofuran") %>% pull(ab) -pre_commit_lst$AB_OXAZOLIDINONES <- antibiotics %>% +pre_commit_lst$AB_OXAZOLIDINONES <- antimicrobials %>% filter(group %like% "oxazolidinone") %>% pull(ab) -pre_commit_lst$AB_PENICILLINS <- antibiotics %>% +pre_commit_lst$AB_PENICILLINS <- antimicrobials %>% filter(group %like% "penicillin" & !(name %unlike% "/" & name %like% ".*bactam$")) %>% pull(ab) -pre_commit_lst$AB_PHENICOLS <- antibiotics %>% +pre_commit_lst$AB_PHENICOLS <- antimicrobials %>% filter(group %like% "phenicol" | atc_group1 %like% "phenicol" | atc_group2 %like% "phenicol") %>% pull(ab) -pre_commit_lst$AB_POLYMYXINS <- antibiotics %>% +pre_commit_lst$AB_POLYMYXINS <- antimicrobials %>% filter(group %like% "polymyxin") %>% pull(ab) -pre_commit_lst$AB_QUINOLONES <- antibiotics %>% +pre_commit_lst$AB_QUINOLONES <- antimicrobials %>% filter(group %like% "quinolone") %>% pull(ab) -pre_commit_lst$AB_RIFAMYCINS <- antibiotics %>% +pre_commit_lst$AB_RIFAMYCINS <- antimicrobials %>% filter(name %like% "Rifampi|Rifabutin|Rifapentine|rifamy") %>% pull(ab) -pre_commit_lst$AB_STREPTOGRAMINS <- antibiotics %>% +pre_commit_lst$AB_STREPTOGRAMINS <- antimicrobials %>% filter(atc_group2 %like% "streptogramin") %>% pull(ab) -pre_commit_lst$AB_TETRACYCLINES <- antibiotics %>% +pre_commit_lst$AB_TETRACYCLINES <- antimicrobials %>% filter(group %like% "tetracycline") %>% pull(ab) pre_commit_lst$AB_TETRACYCLINES_EXCEPT_TGC <- pre_commit_lst$AB_TETRACYCLINES[pre_commit_lst$AB_TETRACYCLINES != "TGC"] -pre_commit_lst$AB_TRIMETHOPRIMS <- antibiotics %>% +pre_commit_lst$AB_TRIMETHOPRIMS <- antimicrobials %>% filter(group %like% "trimethoprim") %>% pull(ab) pre_commit_lst$AB_UREIDOPENICILLINS <- as.ab(c("PIP", "TZP", "AZL", "MEZ")) pre_commit_lst$AB_BETALACTAMS <- sort(c(pre_commit_lst$AB_PENICILLINS, pre_commit_lst$AB_CEPHALOSPORINS, pre_commit_lst$AB_CARBAPENEMS, pre_commit_lst$AB_MONOBACTAMS)) -pre_commit_lst$AB_BETALACTAMS_WITH_INHIBITOR <- antibiotics %>% +pre_commit_lst$AB_BETALACTAMS_WITH_INHIBITOR <- antimicrobials %>% filter(name %like% "/" & name %unlike% "EDTA" & ab %in% pre_commit_lst$AB_BETALACTAMS) %>% pull(ab) # this will be used for documentation: pre_commit_lst$DEFINED_AB_GROUPS <- sort(names(pre_commit_lst)[names(pre_commit_lst) %like% "^AB_" & names(pre_commit_lst) != "AB_LOOKUP"]) -pre_commit_lst$AB_LOOKUP <- create_AB_AV_lookup(antibiotics) +pre_commit_lst$AB_LOOKUP <- create_AB_AV_lookup(antimicrobials) pre_commit_lst$AV_LOOKUP <- create_AB_AV_lookup(antivirals) # Export to package as internal data ---- @@ -506,7 +506,7 @@ changed_md5 <- function(object) { # give official names to ABs and MOs clin_break <- clinical_breakpoints %>% mutate(mo_name = microorganisms$fullname[match(mo, microorganisms$mo)], .after = mo) %>% - mutate(ab_name = antibiotics$name[match(ab, antibiotics$ab)], .after = ab) + mutate(ab_name = antimicrobials$name[match(ab, antimicrobials$ab)], .after = ab) if (changed_md5(clin_break)) { usethis::ui_info(paste0("Saving {usethis::ui_value('clinical_breakpoints')} to {usethis::ui_value('data-raw/')}")) write_md5(clin_break) @@ -560,18 +560,18 @@ if (changed_md5(microorganisms.groups)) { try(arrow::write_parquet(microorganisms.groups, "data-raw/microorganisms.groups.parquet"), silent = TRUE) } -ab <- dplyr::mutate_if(antibiotics, ~ !is.numeric(.), as.character) +ab <- dplyr::mutate_if(antimicrobials, ~ !is.numeric(.), as.character) if (changed_md5(ab)) { - usethis::ui_info(paste0("Saving {usethis::ui_value('antibiotics')} to {usethis::ui_value('data-raw/')}")) + usethis::ui_info(paste0("Saving {usethis::ui_value('antimicrobials')} to {usethis::ui_value('data-raw/')}")) write_md5(ab) - try(saveRDS(antibiotics, "data-raw/antibiotics.rds", version = 2, compress = "xz"), silent = TRUE) - try(haven::write_sav(ab, "data-raw/antibiotics.sav"), silent = TRUE) - try(haven::write_dta(ab, "data-raw/antibiotics.dta"), silent = TRUE) - ab_lists <- antibiotics %>% mutate_if(is.list, function(x) sapply(x, paste, collapse = ",")) - try(write.table(ab_lists, "data-raw/antibiotics.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE) - try(openxlsx2::write_xlsx(ab_lists, "data-raw/antibiotics.xlsx"), silent = TRUE) - try(arrow::write_feather(antibiotics, "data-raw/antibiotics.feather"), silent = TRUE) - try(arrow::write_parquet(antibiotics, "data-raw/antibiotics.parquet"), silent = TRUE) + try(saveRDS(antimicrobials, "data-raw/antimicrobials.rds", version = 2, compress = "xz"), silent = TRUE) + try(haven::write_sav(ab, "data-raw/antimicrobials.sav"), silent = TRUE) + try(haven::write_dta(ab, "data-raw/antimicrobials.dta"), silent = TRUE) + ab_lists <- antimicrobials %>% mutate_if(is.list, function(x) sapply(x, paste, collapse = ",")) + try(write.table(ab_lists, "data-raw/antimicrobials.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE) + try(openxlsx2::write_xlsx(ab_lists, "data-raw/antimicrobials.xlsx"), silent = TRUE) + try(arrow::write_feather(antimicrobials, "data-raw/antimicrobials.feather"), silent = TRUE) + try(arrow::write_parquet(antimicrobials, "data-raw/antimicrobials.parquet"), silent = TRUE) } av <- dplyr::mutate_if(antivirals, ~ !is.numeric(.), as.character) diff --git a/data-raw/gpt_training_text_v2.1.1.9183.txt b/data-raw/gpt_training_text_v2.1.1.9186.txt similarity index 96% rename from data-raw/gpt_training_text_v2.1.1.9183.txt rename to data-raw/gpt_training_text_v2.1.1.9186.txt index 216ec51b7..396aa19d7 100644 --- a/data-raw/gpt_training_text_v2.1.1.9183.txt +++ b/data-raw/gpt_training_text_v2.1.1.9186.txt @@ -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.9183. Remember this whenever someone asks which AMR package version you’re at. +First and foremost, you are trained on version 2.1.1.9186. 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. ---------------------------------------------------------------------------------------------------- @@ -170,6 +170,7 @@ export(amr_distance_from_row) export(amr_selector) export(anti_join_microorganisms) export(antibiogram) +export(antibiotics) export(antifungals) export(antimicrobials_equal) export(antimycobacterials) @@ -419,7 +420,7 @@ The `AMR` package is a [free and open-source](#copyright) R package with [zero d This work was published in the Journal of Statistical Software (Volume 104(3); [DOI 10.18637/jss.v104.i03](https://doi.org/10.18637/jss.v104.i03)) and formed the basis of two PhD theses ([DOI 10.33612/diss.177417131](https://doi.org/10.33612/diss.177417131) and [DOI 10.33612/diss.192486375](https://doi.org/10.33612/diss.192486375)). -After installing this package, R knows [**~52,000 distinct microbial species**](./reference/microorganisms.html) (updated December 2022) and all [**~600 antibiotic, antimycotic and antiviral drugs**](./reference/antibiotics.html) 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). **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 [University of Groningen](https://www.rug.nl), in collaboration with non-profit organisations [Certe Medical Diagnostics and Advice Foundation](https://www.certe.nl) and [University Medical Center Groningen](https://www.umcg.nl). +After installing this package, R knows [**~52,000 distinct microbial species**](./reference/microorganisms.html) (updated December 2022) and all [**~600 antimicrobial and antiviral drugs**](./reference/antibiotics.html) 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). **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 [University of Groningen](https://www.rug.nl), in collaboration with non-profit organisations [Certe Medical Diagnostics and Advice Foundation](https://www.certe.nl) and [University Medical Center Groningen](https://www.umcg.nl). ##### Used in over 175 countries, available in 20 languages @@ -451,7 +452,7 @@ example_isolates %>% carbapenems()) ``` -With only having defined a row filter on Gram-negative bacteria with intrinsic resistance to cefotaxime (`mo_is_gram_negative()` and `mo_is_intrinsic_resistant()`) and a column selection on two antibiotic groups (`aminoglycosides()` and `carbapenems()`), the reference data about [all microorganisms](./reference/microorganisms.html) and [all antibiotics](./reference/antibiotics.html) in the `AMR` package make sure you get what you meant: +With only having defined a row filter on Gram-negative bacteria with intrinsic resistance to cefotaxime (`mo_is_gram_negative()` and `mo_is_intrinsic_resistant()`) and a column selection on two antibiotic groups (`aminoglycosides()` and `carbapenems()`), the reference data about [all microorganisms](./reference/microorganisms.html) and [all antimicrobials](./reference/antimicrobials.html) in the `AMR` package make sure you get what you meant: |bacteria | GEN | TOB | AMK | KAN | IPM | MEM | |:------------------------------|:---:|:---:|:---:|:---:|:---:|:---:| @@ -474,7 +475,8 @@ If used inside [R Markdown](https://rmarkdown.rstudio.com) or [Quarto](https://q ```r antibiogram(example_isolates, - antibiotics = c(aminoglycosides(), carbapenems())) + antibiotics = c(aminoglycosides(), carbapenems()), + formatting_type = 14) ``` | Pathogen | Amikacin | Gentamicin | Imipenem | Kanamycin | Meropenem | Tobramycin | @@ -495,7 +497,8 @@ In combination antibiograms, it is clear that combined antibiotics yield higher ```r antibiogram(example_isolates, antibiotics = c("TZP", "TZP+TOB", "TZP+GEN"), - mo_transform = "gramstain") + mo_transform = "gramstain", + formatting_type = 14) ``` |Pathogen | Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin | @@ -510,6 +513,7 @@ antibiogram(example_isolates, antibiotics = c("cipro", "tobra", "genta"), # any arbitrary name or code will work mo_transform = "gramstain", ab_transform = "name", + formatting_type = 14, language = "uk") # Ukrainian ``` @@ -720,19 +724,27 @@ THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/AMR-deprecated.Rd': % Generated by roxygen2: do not edit by hand % Please edit documentation in R/zz_deprecated.R +\docType{data} \name{AMR-deprecated} \alias{AMR-deprecated} +\alias{antibiotics} \alias{ab_class} \alias{ab_selector} \title{Deprecated Functions} +\format{ +An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 487 rows and 14 columns. +} \usage{ +antibiotics + ab_class(...) ab_selector(...) } \description{ -These functions are so-called '\link{Deprecated}'. \strong{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). +These objects are so-called '\link{Deprecated}'. \strong{They will be removed in a future version of this package.} Using these will give a warning with the name of the alternative object it has been replaced by (if there is one). } +\keyword{datasets} \keyword{internal} @@ -752,7 +764,7 @@ This is an overview of all the package-specific \code{\link[=options]{options()} \section{Options}{ \itemize{ -\item \code{AMR_antibiogram_formatting_type} \cr A \link{numeric} (1-12) to use in \code{\link[=antibiogram]{antibiogram()}}, to indicate which formatting type to use. +\item \code{AMR_antibiogram_formatting_type} \cr A \link{numeric} (1-22) to use in \code{\link[=antibiogram]{antibiogram()}}, to indicate which formatting type to use. \item \code{AMR_breakpoint_type} \cr A \link{character} to use in \code{\link[=as.sir]{as.sir()}}, to indicate which breakpoint type to use. This must be either "ECOFF", "animal", or "human". \item \code{AMR_cleaning_regex} \cr A \link[base:regex]{regular expression} (case-insensitive) to use in \code{\link[=as.mo]{as.mo()}} and all \code{\link[=mo_property]{mo_*}} functions, to clean the user input. The default is the outcome of \code{\link[=mo_cleaning_regex]{mo_cleaning_regex()}}, which removes texts between brackets and texts such as "species" and "serovar". \item \code{AMR_custom_ab} \cr A file location to an RDS file, to use custom antimicrobial drugs with this package. This is explained in \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}}. @@ -781,7 +793,7 @@ In this file, you can set options such as... options(AMR_include_PKPD = TRUE) }\if{html}{\out{}} -...to add Portuguese language support of antibiotics, and allow PK/PD rules when interpreting MIC values with \code{\link[=as.sir]{as.sir()}}. +...to add Portuguese language support of antimicrobials, and allow PK/PD rules when interpreting MIC values with \code{\link[=as.sir]{as.sir()}}. \subsection{Share Options Within Team}{ For a more global approach, e.g. within a (data) team, save an options file to a remote file location, such as a shared network drive, and have each user read in this file automatically at start-up. This would work in this way: @@ -840,13 +852,13 @@ 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/antibiotics.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{~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}. 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. } \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \seealso{ @@ -969,14 +981,14 @@ A \link[tibble:tibble]{tibble} with 500 observations and 53 variables: \item \verb{Inducible clindamycin resistance}\cr Clindamycin can be induced? \item \code{Comment}\cr Other comments \item \verb{Date of data entry}\cr \link{Date} this data was entered in WHONET -\item \code{AMP_ND10:CIP_EE}\cr 28 different antibiotics. You can lookup the abbreviations in the \link{antibiotics} data set, or use e.g. \code{\link[=ab_name]{ab_name("AMP")}} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link[=as.sir]{as.sir()}}. +\item \code{AMP_ND10:CIP_EE}\cr 28 different antimicrobials. You can lookup the abbreviations in the \link{antimicrobials} data set, or use e.g. \code{\link[=ab_name]{ab_name("AMP")}} to get the official name immediately. Before analysis, you should transform this to a valid antimcrobial class, using \code{\link[=as.sir]{as.sir()}}. } } \usage{ WHONET } \description{ -This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antibiotic results are from our \link{example_isolates} data set. All patient names were created using online surname generators and are only in place for practice purposes. +This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antimcrobial results are from our \link{example_isolates} data set. All patient names were created using online surname generators and are only in place for practice purposes. } \details{ Like all data sets in this package, this data set is publicly available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. @@ -1009,7 +1021,7 @@ ab_from_text(text, type = c("drug", "dose", "administration"), \item{collapse}{a \link{character} to pass on to \code{paste(, collapse = ...)} to only return one \link{character} per element of \code{text}, see \emph{Examples}} -\item{translate_ab}{if \code{type = "drug"}: a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}. The default is \code{FALSE}. Using \code{TRUE} is equal to using "name".} +\item{translate_ab}{if \code{type = "drug"}: a column name of the \link{antimicrobials} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}. The default is \code{FALSE}. Using \code{TRUE} is equal to using "name".} \item{thorough_search}{a \link{logical} to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to \code{TRUE} will take considerably more time than when using \code{FALSE}. At default, it will turn \code{TRUE} when all input elements contain a maximum of three words.} @@ -1160,7 +1172,7 @@ set_ab_names(data, ..., property = "name", language = get_AMR_locale(), \item{open}{browse the URL using \code{\link[utils:browseURL]{utils::browseURL()}}} -\item{property}{one of the column names of one of the \link{antibiotics} data set: \code{vector_or(colnames(antibiotics), sort = FALSE)}.} +\item{property}{one of the column names of one of the \link{antimicrobials} data set: \code{vector_or(colnames(antimicrobials), sort = FALSE)}.} \item{data}{a \link{data.frame} of which the columns need to be renamed, or a \link{character} vector of column names} @@ -1176,7 +1188,7 @@ set_ab_names(data, ..., property = "name", language = get_AMR_locale(), } } \description{ -Use these functions to return a specific property of an antibiotic from the \link{antibiotics} data set. All input values will be evaluated internally with \code{\link[=as.ab]{as.ab()}}. +Use these functions to return a specific property of an antibiotic from the \link{antimicrobials} data set. All input values will be evaluated internally with \code{\link[=as.ab]{as.ab()}}. } \details{ All output \link[=translate]{will be translated} where possible. @@ -1194,7 +1206,7 @@ European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{htt \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -1263,7 +1275,7 @@ if (require("dplyr")) { } } \seealso{ -\link{antibiotics} +\link{antimicrobials} } @@ -1284,7 +1296,7 @@ add_custom_antimicrobials(x) clear_custom_antimicrobials() } \arguments{ -\item{x}{a \link{data.frame} resembling the \link{antibiotics} data set, at least containing columns "ab" and "name"} +\item{x}{a \link{data.frame} resembling the \link{antimicrobials} data set, at least containing columns "ab" and "name"} } \description{ With \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}} you can add your own custom antimicrobial drug names and codes. @@ -1296,7 +1308,7 @@ There are two ways to circumvent this and automate the process of adding antimic \strong{Method 1:} Using the package option \code{\link[=AMR-options]{AMR_custom_ab}}, which is the preferred method. To use this method: \enumerate{ -\item Create a data set in the structure of the \link{antibiotics} data set (containing at the very least columns "ab" and "name") and save it with \code{\link[=saveRDS]{saveRDS()}} to a location of choice, e.g. \code{"~/my_custom_ab.rds"}, or any remote location. +\item Create a data set in the structure of the \link{antimicrobials} data set (containing at the very least columns "ab" and "name") and save it with \code{\link[=saveRDS]{saveRDS()}} to a location of choice, e.g. \code{"~/my_custom_ab.rds"}, or any remote location. \item Set the file location to the package option \code{\link[=AMR-options]{AMR_custom_ab}}: \code{options(AMR_custom_ab = "~/my_custom_ab.rds")}. This can even be a remote file location, such as an https URL. Since options are not saved between \R sessions, it is best to save this option to the \code{.Rprofile} file so that it will be loaded on start-up of \R. To do this, open the \code{.Rprofile} file using e.g. \code{utils::file.edit("~/.Rprofile")}, add this text and save the file: \if{html}{\out{
}}\preformatted{# Add custom antimicrobial codes: @@ -1334,7 +1346,7 @@ add_custom_antimicrobials( ab = "TESTAB", name = "Test Antibiotic", # you can add any property present in the - # 'antibiotics' data set, such as 'group': + # 'antimicrobials' data set, such as 'group': group = "Test Group" ) ) @@ -1662,10 +1674,10 @@ THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/antibiogram.Rd': antibiogram(x, antibiotics = where(is.sir), mo_transform = "shortname", ab_transform = "name", syndromic_group = NULL, add_total_n = FALSE, only_all_tested = FALSE, digits = ifelse(wisca, 1, 0), - formatting_type = getOption("AMR_antibiogram_formatting_type", 14), - col_mo = NULL, language = get_AMR_locale(), minimum = 30, - combine_SI = TRUE, sep = " + ", wisca = FALSE, simulations = 1000, - conf_interval = 0.95, interval_side = "two-tailed", + formatting_type = getOption("AMR_antibiogram_formatting_type", + ifelse(wisca, 14, 18)), col_mo = NULL, language = get_AMR_locale(), + minimum = 30, combine_SI = TRUE, sep = " + ", wisca = FALSE, + simulations = 1000, conf_interval = 0.95, interval_side = "two-tailed", info = interactive()) wisca(x, antibiotics = where(is.sir), ab_transform = "name", @@ -1693,7 +1705,7 @@ retrieve_wisca_parameters(wisca_model, ...) \item{mo_transform}{a character to transform microorganism input - must be \code{"name"}, \code{"shortname"} (default), \code{"gramstain"}, or one of the column names of the \link{microorganisms} data set: "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", or "snomed". Can also be \code{NULL} to not transform the input or \code{NA} to consider all microorganisms 'unknown'.} -\item{ab_transform}{a character to transform antimicrobial input - must be one of the column names of the \link{antibiotics} data set (defaults to \code{"name"}): "ab", "cid", "name", "group", "atc", "atc_group1", "atc_group2", "abbreviations", "synonyms", "oral_ddd", "oral_units", "iv_ddd", "iv_units", or "loinc". Can also be \code{NULL} to not transform the input.} +\item{ab_transform}{a character to transform antimicrobial input - must be one of the column names of the \link{antimicrobials} data set (defaults to \code{"name"}): "ab", "cid", "name", "group", "atc", "atc_group1", "atc_group2", "abbreviations", "synonyms", "oral_ddd", "oral_units", "iv_ddd", "iv_units", or "loinc". Can also be \code{NULL} to not transform the input.} \item{syndromic_group}{a column name of \code{x}, or values calculated to split rows of \code{x}, e.g. by using \code{\link[=ifelse]{ifelse()}} or \code{\link[dplyr:case_when]{case_when()}}. See \emph{Examples}.} @@ -1750,7 +1762,7 @@ For estimating antimicrobial coverage, especially when creating a WISCA, the out The numeric values of an antibiogram are stored in a long format as the \link[=attributes]{attribute} \code{long_numeric}. You can retrieve them using \code{attributes(x)$long_numeric}, where \code{x} is the outcome of \code{\link[=antibiogram]{antibiogram()}} or \code{\link[=wisca]{wisca()}}. This is ideal for e.g. advanced plotting. \subsection{Formatting Type}{ -The formatting of the 'cells' of the table can be set with the argument \code{formatting_type}. In these examples, \code{5} is the antimicrobial coverage (\code{4-6} indicates the confidence level), \code{15} the number of susceptible isolates, and \code{300} the number of tested (i.e., available) isolates: +The formatting of the 'cells' of the table can be set with the argument \code{formatting_type}. In these examples, \code{5} indicates the antimicrobial coverage (\code{4-6} the confidence level), \code{15} the number of susceptible isolates, and \code{300} the number of tested (i.e., available) isolates: \enumerate{ \item 5 \item 15 @@ -1765,18 +1777,18 @@ The formatting of the 'cells' of the table can be set with the argument \code{fo \item 5 (N=15/300) \item 5\% (N=15/300) \item 5 (4-6) -\item 5\% (4-6\%) - \strong{default} +\item 5\% (4-6\%) - \strong{default for WISCA} \item 5 (4-6,300) \item 5\% (4-6\%,300) \item 5 (4-6,N=300) -\item 5\% (4-6\%,N=300) +\item 5\% (4-6\%,N=300) - \strong{default for non-WISCA} \item 5 (4-6,15/300) \item 5\% (4-6\%,15/300) \item 5 (4-6,N=15/300) \item 5\% (4-6\%,N=15/300) } -The default is \code{14}, which can be set globally with the package option \code{\link[=AMR-options]{AMR_antibiogram_formatting_type}}, e.g. \code{options(AMR_antibiogram_formatting_type = 5)}. Do note that for WISCA, the total numbers of tested and susceptible isolates are less useful to report, since these are included in the Bayesian model and apparent from the susceptibility and its confidence level. +The default can be set globally with the package option \code{\link[=AMR-options]{AMR_antibiogram_formatting_type}}, e.g. \code{options(AMR_antibiogram_formatting_type = 5)}. Do note that for WISCA, the total numbers of tested and susceptible isolates are less useful to report, since these are included in the Bayesian model and apparent from the susceptibility and its confidence level. Set \code{digits} (defaults to \code{0}) to alter the rounding of the susceptibility percentages. } @@ -2088,101 +2100,6 @@ Implementation: Dr. Larisse Bolton and Dr. Matthijs Berends ----------------------------------------------------------------------------------------------------- -THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/antibiotics.Rd': - - -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{antibiotics} -\alias{antibiotics} -\alias{antivirals} -\title{Data Sets with 607 Antimicrobial Drugs} -\format{ -\subsection{For the \link{antibiotics} data set: a \link[tibble:tibble]{tibble} with 487 observations and 14 variables:}{ -\itemize{ -\item \code{ab}\cr Antibiotic 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.}} -\item \code{name}\cr Official name as used by WHONET/EARS-Net or the WHO. \emph{\strong{This is a unique identifier.}} -\item \code{group}\cr A short and concise group name, based on WHONET and WHOCC definitions -\item \code{atc}\cr ATC codes (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02} -\item \code{atc_group1}\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like \code{"Macrolides, lincosamides and streptogramins"} -\item \code{atc_group2}\cr Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like \code{"Macrolides"} -\item \code{abbr}\cr List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST) -\item \code{synonyms}\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID -\item \code{oral_ddd}\cr Defined Daily Dose (DDD), oral treatment, currently available for 179 drugs -\item \code{oral_units}\cr Units of \code{oral_ddd} -\item \code{iv_ddd}\cr Defined Daily Dose (DDD), parenteral (intravenous) treatment, currently available for 153 drugs -\item \code{iv_units}\cr Units of \code{iv_ddd} -\item \code{loinc}\cr All codes associated with the name of the antimicrobial drug from Logical Observation Identifiers Names and Codes (LOINC), Version 2.76 (18 September, 2023). Use \code{\link[=ab_loinc]{ab_loinc()}} to retrieve them quickly, see \code{\link[=ab_property]{ab_property()}}. -} -} - -\subsection{For the \link{antivirals} data set: a \link[tibble:tibble]{tibble} with 120 observations and 11 variables:}{ -\itemize{ -\item \code{av}\cr Antiviral ID as used in this package (such as \code{ACI}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available. \emph{\strong{This is a unique identifier.}} Combinations are codes that contain a \code{+} to indicate this, such as \code{ATA+COBI} for atazanavir/cobicistat. -\item \code{name}\cr Official name as used by WHONET/EARS-Net or the WHO. \emph{\strong{This is a unique identifier.}} -\item \code{atc}\cr ATC codes (Anatomical Therapeutic Chemical) as defined by the WHOCC -\item \code{cid}\cr Compound ID as found in PubChem. \emph{\strong{This is a unique identifier.}} -\item \code{atc_group}\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC -\item \code{synonyms}\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID -\item \code{oral_ddd}\cr Defined Daily Dose (DDD), oral treatment -\item \code{oral_units}\cr Units of \code{oral_ddd} -\item \code{iv_ddd}\cr Defined Daily Dose (DDD), parenteral treatment -\item \code{iv_units}\cr Units of \code{iv_ddd} -\item \code{loinc}\cr All codes associated with the name of the antiviral drug from Logical Observation Identifiers Names and Codes (LOINC), Version 2.76 (18 September, 2023). Use \code{\link[=av_loinc]{av_loinc()}} to retrieve them quickly, see \code{\link[=av_property]{av_property()}}. -} -} - -An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 120 rows and 11 columns. -} -\source{ -\itemize{ -\item World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://atcddd.fhi.no/atc_ddd_index/} -\item Logical Observation Identifiers Names and Codes (LOINC), Version 2.76 (18 September, 2023). Accessed from \url{https://loinc.org} on October 19th, 2023. -\item European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm} -} -} -\usage{ -antibiotics - -antivirals -} -\description{ -Two data sets containing all antibiotics/antimycotics 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{antibiotics} data set. Three identifiers are included in this data set: an antibiotic 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. -} -\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}. - -Synonyms (i.e. trade names) were derived from the PubChem Compound ID (column \code{cid}) and consequently only available where a CID is available. -\subsection{Direct download}{ - -Like all data sets in this package, these data sets are publicly available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. -} -} -\section{WHOCC}{ - -This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://atcddd.fhi.no}) and the Pharmaceuticals Community Register of the European Commission (\url{https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm}). - -These have become the gold standard for international drug utilisation monitoring and research. - -The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. - -\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.} See \url{https://atcddd.fhi.no/copyright_disclaimer/.} -} - -\examples{ -antibiotics -antivirals -} -\seealso{ -\link{microorganisms}, \link{intrinsic_resistant} -} -\keyword{datasets} - - - ---------------------------------------------------------------------------------------------------- THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/antimicrobial_selectors.Rd': @@ -2319,9 +2236,9 @@ not_intrinsic_resistant(only_sir_columns = FALSE, col_mo = NULL, \item{...}{ignored, only in place to allow future extensions} -\item{amr_class}{an antimicrobial class or a part of it, such as \code{"carba"} and \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.} +\item{amr_class}{an antimicrobial class or a part of it, such as \code{"carba"} and \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antimicrobials} data set will be searched (case-insensitive) for this value.} -\item{filter}{an \link{expression} to be evaluated in the \link{antibiotics} data set, such as \code{name \%like\% "trim"}} +\item{filter}{an \link{expression} to be evaluated in the \link{antimicrobials} data set, such as \code{name \%like\% "trim"}} \item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}) - the default is the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} @@ -2345,13 +2262,13 @@ These functions can be used in data set calls for selecting columns and filterin All selectors can also be used in \code{tidymodels} packages such as \code{recipe} and \code{parsnip}. See for more info \href{https://msberends.github.io/AMR/articles/AMR_with_tidymodels.html}{our tutorial} on using antimicrobial selectors for predictive modelling. -All columns in the data in which these functions are called will be searched for known antimicrobial names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) according to the \link{antibiotics} data set. This means that a selector such as \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. +All columns in the data in which these functions are called will be searched for known antimicrobial names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) according to the \link{antimicrobials} data set. This means that a selector such as \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. -The \code{\link[=amr_class]{amr_class()}} function can be used to filter/select on a manually defined antimicrobial class. It searches for results in the \link{antibiotics} data set within the columns \code{group}, \code{atc_group1} and \code{atc_group2}. +The \code{\link[=amr_class]{amr_class()}} function can be used to filter/select on a manually defined antimicrobial class. It searches for results in the \link{antimicrobials} data set within the columns \code{group}, \code{atc_group1} and \code{atc_group2}. -The \code{\link[=administrable_per_os]{administrable_per_os()}} and \code{\link[=administrable_iv]{administrable_iv()}} functions also rely on the \link{antibiotics} data set - antimicrobials will be matched where a DDD (defined daily dose) for resp. oral and IV treatment is available in the \link{antibiotics} data set. +The \code{\link[=administrable_per_os]{administrable_per_os()}} and \code{\link[=administrable_iv]{administrable_iv()}} functions also rely on the \link{antimicrobials} data set - antimicrobials will be matched where a DDD (defined daily dose) for resp. oral and IV treatment is available in the \link{antimicrobials} data set. -The \code{\link[=amr_selector]{amr_selector()}} function can be used to internally filter the \link{antibiotics} data set on any results, see \emph{Examples}. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set. +The \code{\link[=amr_selector]{amr_selector()}} function can be used to internally filter the \link{antimicrobials} data set on any results, see \emph{Examples}. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set. The \code{\link[=not_intrinsic_resistant]{not_intrinsic_resistant()}} function can be used to only select antimicrobials that pose no intrinsic resistance for the microorganisms in the data set. For example, if a data set contains only microorganism codes or names of \emph{E. coli} and \emph{K. pneumoniae} and contains a column "vancomycin", this column will be removed (or rather, unselected) using this function. It currently applies \href{https://www.eucast.org/expert_rules_and_expected_phenotypes}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021) to determine intrinsic resistance, using the \code{\link[=eucast_rules]{eucast_rules()}} function internally. Because of this determination, this function is quite slow in terms of performance. } @@ -2394,7 +2311,7 @@ The \code{\link[=not_intrinsic_resistant]{not_intrinsic_resistant()}} function c \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -2530,7 +2447,7 @@ example_isolates[any(carbapenems() == "R"), penicillins()] # and erythromycin is not a penicillin: example_isolates[, penicillins() & administrable_per_os()] -# amr_selector() applies a filter in the `antibiotics` data set and is thus +# amr_selector() applies a filter in the `antimicrobials` data set and is thus # very flexible. For instance, to select antimicrobials with an oral DDD # of at least 1 gram: example_isolates[, amr_selector(oral_ddd > 1 & oral_units == "g")] @@ -2572,6 +2489,102 @@ if (require("data.table")) { +---------------------------------------------------------------------------------------------------- +THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/antimicrobials.Rd': + + +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{antimicrobials} +\alias{antimicrobials} +\alias{antibiotics} +\alias{antivirals} +\title{Data Sets with 607 Antimicrobial Drugs} +\format{ +\subsection{For the \link{antimicrobials} data set: a \link[tibble:tibble]{tibble} with 487 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.}} +\item \code{name}\cr Official name as used by WHONET/EARS-Net or the WHO. \emph{\strong{This is a unique identifier.}} +\item \code{group}\cr A short and concise group name, based on WHONET and WHOCC definitions +\item \code{atc}\cr ATC codes (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02} +\item \code{atc_group1}\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like \code{"Macrolides, lincosamides and streptogramins"} +\item \code{atc_group2}\cr Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like \code{"Macrolides"} +\item \code{abbr}\cr List of abbreviations as used in many countries, also for antimcrobial susceptibility testing (AST) +\item \code{synonyms}\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID +\item \code{oral_ddd}\cr Defined Daily Dose (DDD), oral treatment, currently available for 179 drugs +\item \code{oral_units}\cr Units of \code{oral_ddd} +\item \code{iv_ddd}\cr Defined Daily Dose (DDD), parenteral (intravenous) treatment, currently available for 153 drugs +\item \code{iv_units}\cr Units of \code{iv_ddd} +\item \code{loinc}\cr All codes associated with the name of the antimicrobial drug from Logical Observation Identifiers Names and Codes (LOINC), Version 2.76 (18 September, 2023). Use \code{\link[=ab_loinc]{ab_loinc()}} to retrieve them quickly, see \code{\link[=ab_property]{ab_property()}}. +} +} + +\subsection{For the \link{antivirals} data set: a \link[tibble:tibble]{tibble} with 120 observations and 11 variables:}{ +\itemize{ +\item \code{av}\cr Antiviral ID as used in this package (such as \code{ACI}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available. \emph{\strong{This is a unique identifier.}} Combinations are codes that contain a \code{+} to indicate this, such as \code{ATA+COBI} for atazanavir/cobicistat. +\item \code{name}\cr Official name as used by WHONET/EARS-Net or the WHO. \emph{\strong{This is a unique identifier.}} +\item \code{atc}\cr ATC codes (Anatomical Therapeutic Chemical) as defined by the WHOCC +\item \code{cid}\cr Compound ID as found in PubChem. \emph{\strong{This is a unique identifier.}} +\item \code{atc_group}\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC +\item \code{synonyms}\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID +\item \code{oral_ddd}\cr Defined Daily Dose (DDD), oral treatment +\item \code{oral_units}\cr Units of \code{oral_ddd} +\item \code{iv_ddd}\cr Defined Daily Dose (DDD), parenteral treatment +\item \code{iv_units}\cr Units of \code{iv_ddd} +\item \code{loinc}\cr All codes associated with the name of the antiviral drug from Logical Observation Identifiers Names and Codes (LOINC), Version 2.76 (18 September, 2023). Use \code{\link[=av_loinc]{av_loinc()}} to retrieve them quickly, see \code{\link[=av_property]{av_property()}}. +} +} + +An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 120 rows and 11 columns. +} +\source{ +\itemize{ +\item World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://atcddd.fhi.no/atc_ddd_index/} +\item Logical Observation Identifiers Names and Codes (LOINC), Version 2.76 (18 September, 2023). Accessed from \url{https://loinc.org} on October 19th, 2023. +\item European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm} +} +} +\usage{ +antimicrobials + +antivirals +} +\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 antimcrobial 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. +} +\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}. + +Synonyms (i.e. trade names) were derived from the PubChem Compound ID (column \code{cid}) and consequently only available where a CID is available. +\subsection{Direct download}{ + +Like all data sets in this package, these data sets are publicly available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +} +} +\section{WHOCC}{ + +This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://atcddd.fhi.no}) and the Pharmaceuticals Community Register of the European Commission (\url{https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm}). + +These have become the gold standard for international drug utilisation monitoring and research. + +The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. + +\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.} See \url{https://atcddd.fhi.no/copyright_disclaimer/.} +} + +\examples{ +antimicrobials +antivirals +} +\seealso{ +\link{microorganisms}, \link{intrinsic_resistant} +} +\keyword{datasets} + + + ---------------------------------------------------------------------------------------------------- THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/as.ab.Rd': @@ -2607,10 +2620,10 @@ ab_reset_session() A \link{character} \link{vector} with additional class \code{\link{ab}} } \description{ -Use this function to determine the antibiotic drug code of one or more antibiotics. The data set \link{antibiotics} will be searched for abbreviations, official names and synonyms (brand names). +Use this function to determine the antimicrobial drug code of one or more antimicrobials. The data set \link{antimicrobials} will be searched for abbreviations, official names and synonyms (brand names). } \details{ -All entries in the \link{antibiotics} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. Not that some drugs contain multiple ATC codes. +All entries in the \link{antimicrobials} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. Not that some drugs contain multiple ATC codes. All these properties will be searched for the user input. The \code{\link[=as.ab]{as.ab()}} can correct for different forms of misspelling: \itemize{ @@ -2646,7 +2659,7 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -2682,7 +2695,7 @@ if (require("dplyr")) { } \seealso{ \itemize{ -\item \link{antibiotics} for the \link{data.frame} that is being used to determine ATCs +\item \link{antimicrobials} for the \link{data.frame} that is being used to determine ATCs \item \code{\link[=ab_from_text]{ab_from_text()}} for a function to retrieve antimicrobial drugs from clinical text (from health care records) } } @@ -2755,7 +2768,7 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -3224,7 +3237,7 @@ All matches are sorted descending on their matching score and for all user input \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -3509,7 +3522,7 @@ This AMR package honours this insight. Use \code{\link[=susceptibility]{suscepti \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -3730,7 +3743,7 @@ atc_online_ddd(atc_code, ...) atc_online_ddd_units(atc_code, ...) } \arguments{ -\item{atc_code}{a \link{character} (vector) with ATC code(s) of antibiotics, will be coerced with \code{\link[=as.ab]{as.ab()}} and \code{\link[=ab_atc]{ab_atc()}} internally if not a valid ATC code} +\item{atc_code}{a \link{character} (vector) with ATC code(s) of antimicrobials, will be coerced with \code{\link[=as.ab]{as.ab()}} and \code{\link[=ab_atc]{ab_atc()}} internally if not a valid ATC code} \item{property}{property of an ATC code. Valid values are \code{"ATC"}, \code{"Name"}, \code{"DDD"}, \code{"U"} (\code{"unit"}), \code{"Adm.R"}, \code{"Note"} and \code{groups}. For this last option, all hierarchical groups of an ATC code will be returned, see \emph{Examples}.} @@ -3743,7 +3756,7 @@ atc_online_ddd_units(atc_code, ...) \item{...}{arguments to pass on to \code{atc_property}} } \description{ -Gets data from the WHOCC website to determine properties of an Anatomical Therapeutic Chemical (ATC) (e.g. an antibiotic), such as the name, defined daily dose (DDD) or standard unit. +Gets data from the WHOCC website to determine properties of an Anatomical Therapeutic Chemical (ATC) (e.g. an antimicrobial), such as the name, defined daily dose (DDD) or standard unit. } \details{ Options for argument \code{administration}: @@ -3940,7 +3953,7 @@ European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{htt \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -4040,7 +4053,7 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ",", ".", ","), ...) } \arguments{ -\item{x}{a data set with antibiotic columns, such as \code{amox}, \code{AMX} and \code{AMC}} +\item{x}{a data set with antimicrobials columns, such as \code{amox}, \code{AMX} and \code{AMC}} \item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}) - the default is the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} @@ -4050,7 +4063,7 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, \item{...}{arguments passed on to \code{FUN}} -\item{translate_ab}{a \link{character} of length 1 containing column names of the \link{antibiotics} data set} +\item{translate_ab}{a \link{character} of length 1 containing column names of the \link{antimicrobials} data set} \item{language}{language of the returned text - the default is the current system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with the package option \code{\link[=AMR-options]{AMR_locale}}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} @@ -4126,7 +4139,7 @@ A \link[tibble:tibble]{tibble} with 34 063 observations and 14 variables: \item \code{site}\cr Body site for which the breakpoint must be applied, e.g. "Oral" or "Respiratory" \item \code{mo}\cr Microbial ID, see \code{\link[=as.mo]{as.mo()}} \item \code{rank_index}\cr Taxonomic rank index of \code{mo} from 1 (subspecies/infraspecies) to 5 (unknown microorganism) -\item \code{ab}\cr Antibiotic code as used by this package, EARS-Net and WHONET, see \code{\link[=as.ab]{as.ab()}} +\item \code{ab}\cr Antimcrobial code as used by this package, EARS-Net and WHONET, see \code{\link[=as.ab]{as.ab()}} \item \code{ref_tbl}\cr Info about where the guideline rule can be found \item \code{disk_dose}\cr Dose of the used disk diffusion method \item \code{breakpoint_S}\cr Lowest MIC value or highest number of millimetres that leads to "S" @@ -4229,11 +4242,11 @@ count_df(data, translate_ab = "name", language = get_AMR_locale(), \arguments{ \item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link[=as.sir]{as.sir()}} if needed.} -\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}): a \link{logical} to indicate that isolates must be tested for all antibiotics, see section \emph{Combination Therapy} below} +\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}): a \link{logical} to indicate that isolates must be tested for all antimicrobials, see section \emph{Combination Therapy} below} \item{data}{a \link{data.frame} containing columns with class \code{\link{sir}} (see \code{\link[=as.sir]{as.sir()}})} -\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} +\item{translate_ab}{a column name of the \link{antimicrobials} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} \item{language}{language of the returned text - the default is the current system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with the package option \code{\link[=AMR-options]{AMR_locale}}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} @@ -4252,7 +4265,7 @@ These functions are meant to count isolates. Use the \code{\link[=resistance]{re The function \code{\link[=count_resistant]{count_resistant()}} is equal to the function \code{\link[=count_R]{count_R()}}. The function \code{\link[=count_susceptible]{count_susceptible()}} is equal to the function \code{\link[=count_SI]{count_SI()}}. -The function \code{\link[=n_sir]{n_sir()}} is an alias of \code{\link[=count_all]{count_all()}}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{n_distinct()}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. +The function \code{\link[=n_sir]{n_sir()}} is an alias of \code{\link[=count_all]{count_all()}}. They can be used to count all available isolates, i.e. where all input antimicrobials have an available result (S, I or R). Their use is equal to \code{n_distinct()}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. The function \code{\link[=count_df]{count_df()}} takes any variable from \code{data} that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) and counts the number of S's, I's and R's. It also supports grouped variables. The function \code{\link[=sir_df]{sir_df()}} works exactly like \code{\link[=count_df]{count_df()}}, but adds the percentage of S, I and R. } @@ -4276,7 +4289,7 @@ This AMR package honours this insight. Use \code{\link[=susceptibility]{suscepti \section{Combination Therapy}{ -When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI: +When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antimicrobials, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI: \if{html}{\out{
}}\preformatted{-------------------------------------------------------------------- only_all_tested = FALSE only_all_tested = TRUE @@ -4467,11 +4480,11 @@ eucast_rules(df, rules = "custom", custom_rules = y, info = FALSE) }\if{html}{\out{
}} } -\subsection{Usage of multiple antibiotics and antibiotic group names}{ +\subsection{Usage of multiple antimicrobials and antimicrobial group names}{ -You can define antibiotic groups instead of single antibiotics for the rule consequence, which is the part \emph{after} the tilde (~). In the examples above, the antibiotic group \code{aminopenicillins} includes both ampicillin and amoxicillin. +You can define antimicrobial groups instead of single antimicrobials for the rule consequence, which is the part \emph{after} the tilde (~). In the examples above, the antimicrobial group \code{aminopenicillins} includes both ampicillin and amoxicillin. -Rules can also be applied to multiple antibiotics and antibiotic groups simultaneously. Use the \code{c()} function to combine multiple antibiotics. For instance, the following example sets all aminopenicillins and ureidopenicillins to "R" if column TZP (piperacillin/tazobactam) is "R": +Rules can also be applied to multiple antimicrobials and antimicrobial groups simultaneously. Use the \code{c()} function to combine multiple antimicrobials. For instance, the following example sets all aminopenicillins and ureidopenicillins to "R" if column TZP (piperacillin/tazobactam) is "R": \if{html}{\out{
}}\preformatted{x <- custom_eucast_rules(TZP == "R" ~ c(aminopenicillins, ureidopenicillins) == "R") x @@ -4481,7 +4494,7 @@ x #> amoxicillin (AMX), ampicillin (AMP), azlocillin (AZL), mezlocillin (MEZ), piperacillin (PIP), piperacillin/tazobactam (TZP) }\if{html}{\out{
}} -These 34 antibiotic groups are allowed in the rules (case-insensitive) and can be used in any combination: +These 34 antimicrobial groups are allowed in the rules (case-insensitive) and can be used in any combination: \itemize{ \item aminoglycosides\cr(amikacin, amikacin/fosfomycin, apramycin, arbekacin, astromicin, bekanamycin, dibekacin, framycetin, gentamicin, gentamicin-high, habekacin, hygromycin, isepamicin, kanamycin, kanamycin-high, kanamycin/cephalexin, micronomicin, neomycin, netilmicin, pentisomicin, plazomicin, propikacin, ribostamycin, sisomicin, streptoduocin, streptomycin, streptomycin-high, tobramycin, and tobramycin-high) \item aminopenicillins\cr(amoxicillin and ampicillin) @@ -4559,7 +4572,7 @@ THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/dosage.Rd': \format{ A \link[tibble:tibble]{tibble} with 503 observations and 9 variables: \itemize{ -\item \code{ab}\cr Antibiotic ID as used in this package (such as \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available +\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 \item \code{name}\cr Official name of the antimicrobial drug as used by WHONET/EARS-Net or the WHO \item \code{type}\cr Type of the dosage, either "high_dosage", "standard_dosage", or "uncomplicated_uti" \item \code{dose}\cr Dose, such as "2 g" or "25 mg/kg" @@ -4620,7 +4633,7 @@ eucast_rules(x, col_mo = NULL, info = interactive(), eucast_dosage(ab, administration = "iv", version_breakpoints = 12) } \arguments{ -\item{x}{a data set with antibiotic columns, such as \code{amox}, \code{AMX} and \code{AMC}} +\item{x}{a data set with antimicrobials columns, such as \code{amox}, \code{AMX} and \code{AMC}} \item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}) - the default is the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} @@ -4636,20 +4649,20 @@ eucast_dosage(ab, administration = "iv", version_breakpoints = 12) \item{ampc_cephalosporin_resistance}{a \link{character} value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants - the default is \code{NA}. Currently only works when \code{version_expertrules} is \code{3.2} and higher; these version of '\emph{EUCAST Expert Rules on Enterobacterales}' state that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three drugs. A value of \code{NA} (the default) for this argument will remove results for these three drugs, while e.g. a value of \code{"R"} will make the results for these drugs resistant. Use \code{NULL} or \code{FALSE} to not alter results for these three drugs of AmpC de-repressed cephalosporin-resistant mutants. Using \code{TRUE} is equal to using \code{"R"}. \cr For \emph{EUCAST Expert Rules} v3.2, this rule applies to: \emph{Citrobacter braakii}, \emph{Citrobacter freundii}, \emph{Citrobacter gillenii}, \emph{Citrobacter murliniae}, \emph{Citrobacter rodenticum}, \emph{Citrobacter sedlakii}, \emph{Citrobacter werkmanii}, \emph{Citrobacter youngae}, \emph{Enterobacter}, \emph{Hafnia alvei}, \emph{Klebsiella aerogenes}, \emph{Morganella morganii}, \emph{Providencia}, and \emph{Serratia}.} -\item{only_sir_columns}{a \link{logical} to indicate whether only antibiotic columns must be detected that were transformed to class \code{sir} (see \code{\link[=as.sir]{as.sir()}}) on beforehand (default is \code{FALSE})} +\item{only_sir_columns}{a \link{logical} to indicate whether only antimicrobial columns must be detected that were transformed to class \code{sir} (see \code{\link[=as.sir]{as.sir()}}) on beforehand (default is \code{FALSE})} \item{custom_rules}{custom rules to apply, created with \code{\link[=custom_eucast_rules]{custom_eucast_rules()}}} \item{overwrite}{a \link{logical} to indicate whether non-\code{NA} values must be overwritten (defaults to \code{TRUE}). With \code{FALSE}, only \code{NA} values are changed.} -\item{...}{column name of an antibiotic, see section \emph{Antibiotics} below} +\item{...}{column name of an antimicrobial, see section \emph{Antimicrobials} below} -\item{ab}{any (vector of) text that can be coerced to a valid antibiotic drug code with \code{\link[=as.ab]{as.ab()}}} +\item{ab}{any (vector of) text that can be coerced to a valid antimicrobial drug code with \code{\link[=as.ab]{as.ab()}}} \item{administration}{route of administration, either "im", "iv", or "oral"} } \value{ -The input of \code{x}, possibly with edited values of antibiotics. Or, if \code{verbose = TRUE}, a \link{data.frame} with all original and new values of the affected bug-drug combinations. +The input of \code{x}, possibly with edited values of antimicrobials. Or, if \code{verbose = TRUE}, a \link{data.frame} with all original and new values of the affected bug-drug combinations. } \description{ Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{https://www.eucast.org}), see \emph{Source}. Use \code{\link[=eucast_dosage]{eucast_dosage()}} to get a \link{data.frame} with advised dosages of a certain bug-drug combination, which is based on the \link{dosage} data set. @@ -4685,18 +4698,18 @@ Important examples include amoxicillin and amoxicillin/clavulanic acid, and trim Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include \code{"other"} to the \code{rules} argument, or use \code{eucast_rules(..., rules = "all")}. You can also set the package option \code{\link[=AMR-options]{AMR_eucastrules}}, i.e. run \code{options(AMR_eucastrules = "all")}. } } -\section{Antibiotics}{ +\section{Antimicrobials}{ -To define antibiotics column names, leave as it is to determine it automatically with \code{\link[=guess_ab_col]{guess_ab_col()}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. +To define antimicrobials column names, leave as it is to determine it automatically with \code{\link[=guess_ab_col]{guess_ab_col()}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. -The following antibiotics are eligible for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format 'name (\verb{antimicrobial ID}, \href{https://atcddd.fhi.no/atc/structure_and_principles/}{ATC code})', sorted alphabetically: +The following antimicrobials are eligible for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format 'name (\verb{antimicrobial ID}, \href{https://atcddd.fhi.no/atc/structure_and_principles/}{ATC code})', sorted alphabetically: Amikacin (\code{AMK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB06&showdescription=no}{J01GB06}), amoxicillin (\code{AMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA04&showdescription=no}{J01CA04}), amoxicillin/clavulanic acid (\code{AMC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR02&showdescription=no}{J01CR02}), ampicillin (\code{AMP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA01&showdescription=no}{J01CA01}), ampicillin/sulbactam (\code{SAM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR01&showdescription=no}{J01CR01}), apramycin (\code{APR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QA07AA92&showdescription=no}{QA07AA92}), arbekacin (\code{ARB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB12&showdescription=no}{J01GB12}), aspoxicillin (\code{APX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA19&showdescription=no}{J01CA19}), azidocillin (\code{AZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE04&showdescription=no}{J01CE04}), azithromycin (\code{AZM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA10&showdescription=no}{J01FA10}), azlocillin (\code{AZL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA09&showdescription=no}{J01CA09}), aztreonam (\code{ATM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DF01&showdescription=no}{J01DF01}), bacampicillin (\code{BAM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA06&showdescription=no}{J01CA06}), bekanamycin (\code{BEK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB13&showdescription=no}{J01GB13}), benzathine benzylpenicillin (\code{BNB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE08&showdescription=no}{J01CE08}), benzathine phenoxymethylpenicillin (\code{BNP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE10&showdescription=no}{J01CE10}), benzylpenicillin (\code{PEN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE01&showdescription=no}{J01CE01}), besifloxacin (\code{BES}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=S01AE08&showdescription=no}{S01AE08}), biapenem (\code{BIA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH05&showdescription=no}{J01DH05}), carbenicillin (\code{CRB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA03&showdescription=no}{J01CA03}), carindacillin (\code{CRN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA05&showdescription=no}{J01CA05}), carumonam (\code{CAR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DF02&showdescription=no}{J01DF02}), cefacetrile (\code{CAC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB10&showdescription=no}{J01DB10}), cefaclor (\code{CEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC04&showdescription=no}{J01DC04}), cefadroxil (\code{CFR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB05&showdescription=no}{J01DB05}), cefalexin (\code{LEX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB01&showdescription=no}{J01DB01}), cefaloridine (\code{RID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB02&showdescription=no}{J01DB02}), cefalotin (\code{CEP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB03&showdescription=no}{J01DB03}), cefamandole (\code{MAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC03&showdescription=no}{J01DC03}), cefapirin (\code{HAP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB08&showdescription=no}{J01DB08}), cefatrizine (\code{CTZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB07&showdescription=no}{J01DB07}), cefazedone (\code{CZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB06&showdescription=no}{J01DB06}), cefazolin (\code{CZO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB04&showdescription=no}{J01DB04}), cefcapene (\code{CCP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD17&showdescription=no}{J01DD17}), cefdinir (\code{CDR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD15&showdescription=no}{J01DD15}), cefditoren (\code{DIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD16&showdescription=no}{J01DD16}), cefepime (\code{FEP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE01&showdescription=no}{J01DE01}), cefepime/amikacin (\code{CFA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01RA06&showdescription=no}{J01RA06}), cefetamet (\code{CAT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD10&showdescription=no}{J01DD10}), cefiderocol (\code{FDC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI04&showdescription=no}{J01DI04}), cefixime (\code{CFM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD08&showdescription=no}{J01DD08}), cefmenoxime (\code{CMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD05&showdescription=no}{J01DD05}), cefmetazole (\code{CMZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC09&showdescription=no}{J01DC09}), cefodizime (\code{DIZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD09&showdescription=no}{J01DD09}), cefonicid (\code{CID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC06&showdescription=no}{J01DC06}), cefoperazone (\code{CFP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD12&showdescription=no}{J01DD12}), cefoperazone/sulbactam (\code{CSL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD62&showdescription=no}{J01DD62}), ceforanide (\code{CND}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC11&showdescription=no}{J01DC11}), cefotaxime (\code{CTX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD01&showdescription=no}{J01DD01}), cefotaxime/clavulanic acid (\code{CTC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD51&showdescription=no}{J01DD51}), cefotetan (\code{CTT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC05&showdescription=no}{J01DC05}), cefotiam (\code{CTF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC07&showdescription=no}{J01DC07}), cefovecin (\code{FOV}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01DD91&showdescription=no}{QJ01DD91}), cefoxitin (\code{FOX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC01&showdescription=no}{J01DC01}), cefozopran (\code{ZOP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE03&showdescription=no}{J01DE03}), cefpiramide (\code{CPM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD11&showdescription=no}{J01DD11}), cefpirome (\code{CPO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE02&showdescription=no}{J01DE02}), cefpodoxime (\code{CPD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD13&showdescription=no}{J01DD13}), cefprozil (\code{CPR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC10&showdescription=no}{J01DC10}), cefquinome (\code{CEQ}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QG51AA07&showdescription=no}{QG51AA07}), cefroxadine (\code{CRD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB11&showdescription=no}{J01DB11}), cefsulodin (\code{CFS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD03&showdescription=no}{J01DD03}), ceftaroline (\code{CPT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI02&showdescription=no}{J01DI02}), ceftazidime (\code{CAZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD02&showdescription=no}{J01DD02}), ceftazidime/clavulanic acid (\code{CCV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD52&showdescription=no}{J01DD52}), cefteram (\code{CEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD18&showdescription=no}{J01DD18}), ceftezole (\code{CTL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB12&showdescription=no}{J01DB12}), ceftibuten (\code{CTB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD14&showdescription=no}{J01DD14}), ceftiofur (\code{TIO}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01DD90&showdescription=no}{QJ01DD90}), ceftizoxime (\code{CZX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD07&showdescription=no}{J01DD07}), ceftobiprole medocaril (\code{CFM1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI01&showdescription=no}{J01DI01}), ceftolozane/tazobactam (\code{CZT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI54&showdescription=no}{J01DI54}), ceftriaxone (\code{CRO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD04&showdescription=no}{J01DD04}), ceftriaxone/beta-lactamase inhibitor (\code{CEB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD63&showdescription=no}{J01DD63}), cefuroxime (\code{CXM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC02&showdescription=no}{J01DC02}), cephradine (\code{CED}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB09&showdescription=no}{J01DB09}), chloramphenicol (\code{CHL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01BA01&showdescription=no}{J01BA01}), ciprofloxacin (\code{CIP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA02&showdescription=no}{J01MA02}), clarithromycin (\code{CLR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA09&showdescription=no}{J01FA09}), clindamycin (\code{CLI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FF01&showdescription=no}{J01FF01}), clometocillin (\code{CLM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE07&showdescription=no}{J01CE07}), cloxacillin (\code{CLO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF02&showdescription=no}{J01CF02}), colistin (\code{COL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XB01&showdescription=no}{J01XB01}), cycloserine (\code{CYC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J04AB01&showdescription=no}{J04AB01}), dalbavancin (\code{DAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA04&showdescription=no}{J01XA04}), danofloxacin (\code{DAN}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA92&showdescription=no}{QJ01MA92}), daptomycin (\code{DAP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX09&showdescription=no}{J01XX09}), delafloxacin (\code{DFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA23&showdescription=no}{J01MA23}), dibekacin (\code{DKB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB09&showdescription=no}{J01GB09}), dicloxacillin (\code{DIC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF01&showdescription=no}{J01CF01}), difloxacin (\code{DIF}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA94&showdescription=no}{QJ01MA94}), dirithromycin (\code{DIR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA13&showdescription=no}{J01FA13}), doripenem (\code{DOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH04&showdescription=no}{J01DH04}), doxycycline (\code{DOX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA02&showdescription=no}{J01AA02}), enoxacin (\code{ENX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA04&showdescription=no}{J01MA04}), enrofloxacin (\code{ENR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA90&showdescription=no}{QJ01MA90}), epicillin (\code{EPC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA07&showdescription=no}{J01CA07}), ertapenem (\code{ETP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH03&showdescription=no}{J01DH03}), erythromycin (\code{ERY}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA01&showdescription=no}{J01FA01}), fleroxacin (\code{FLE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA08&showdescription=no}{J01MA08}), flucloxacillin (\code{FLC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF05&showdescription=no}{J01CF05}), flurithromycin (\code{FLR1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA14&showdescription=no}{J01FA14}), fosfomycin (\code{FOS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX01&showdescription=no}{J01XX01}), framycetin (\code{FRM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=D09AA01&showdescription=no}{D09AA01}), fusidic acid (\code{FUS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XC01&showdescription=no}{J01XC01}), gamithromycin (\code{GAM}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA95&showdescription=no}{QJ01FA95}), garenoxacin (\code{GRN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA19&showdescription=no}{J01MA19}), gatifloxacin (\code{GAT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA16&showdescription=no}{J01MA16}), gemifloxacin (\code{GEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA15&showdescription=no}{J01MA15}), gentamicin (\code{GEN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB03&showdescription=no}{J01GB03}), grepafloxacin (\code{GRX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA11&showdescription=no}{J01MA11}), hetacillin (\code{HET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA18&showdescription=no}{J01CA18}), imipenem (\code{IPM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH51&showdescription=no}{J01DH51}), imipenem/relebactam (\code{IMR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH56&showdescription=no}{J01DH56}), isepamicin (\code{ISE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB11&showdescription=no}{J01GB11}), josamycin (\code{JOS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA07&showdescription=no}{J01FA07}), kanamycin (\code{KAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB04&showdescription=no}{J01GB04}), kitasamycin (\code{KIT}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA93&showdescription=no}{QJ01FA93}), lascufloxacin (\code{LSC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA25&showdescription=no}{J01MA25}), latamoxef (\code{LTM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD06&showdescription=no}{J01DD06}), levofloxacin (\code{LVX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA12&showdescription=no}{J01MA12}), levonadifloxacin (\code{LND}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA24&showdescription=no}{J01MA24}), lincomycin (\code{LIN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FF02&showdescription=no}{J01FF02}), linezolid (\code{LNZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX08&showdescription=no}{J01XX08}), lomefloxacin (\code{LOM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA07&showdescription=no}{J01MA07}), loracarbef (\code{LOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC08&showdescription=no}{J01DC08}), marbofloxacin (\code{MAR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA93&showdescription=no}{QJ01MA93}), mecillinam (\code{MEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA11&showdescription=no}{J01CA11}), meropenem (\code{MEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH02&showdescription=no}{J01DH02}), meropenem/vaborbactam (\code{MEV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH52&showdescription=no}{J01DH52}), metampicillin (\code{MTM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA14&showdescription=no}{J01CA14}), meticillin (\code{MET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF03&showdescription=no}{J01CF03}), mezlocillin (\code{MEZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA10&showdescription=no}{J01CA10}), micronomicin (\code{MCR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=S01AA22&showdescription=no}{S01AA22}), midecamycin (\code{MID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA03&showdescription=no}{J01FA03}), minocycline (\code{MNO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA08&showdescription=no}{J01AA08}), miocamycin (\code{MCM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA11&showdescription=no}{J01FA11}), moxifloxacin (\code{MFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA14&showdescription=no}{J01MA14}), nadifloxacin (\code{NAD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=D10AF05&showdescription=no}{D10AF05}), nafcillin (\code{NAF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF06&showdescription=no}{J01CF06}), nalidixic acid (\code{NAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MB02&showdescription=no}{J01MB02}), neomycin (\code{NEO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB05&showdescription=no}{J01GB05}), netilmicin (\code{NET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB07&showdescription=no}{J01GB07}), nitrofurantoin (\code{NIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XE01&showdescription=no}{J01XE01}), norfloxacin (\code{NOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA06&showdescription=no}{J01MA06}), novobiocin (\code{NOV}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01XX95&showdescription=no}{QJ01XX95}), ofloxacin (\code{OFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA01&showdescription=no}{J01MA01}), oleandomycin (\code{OLE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA05&showdescription=no}{J01FA05}), orbifloxacin (\code{ORB}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA95&showdescription=no}{QJ01MA95}), oritavancin (\code{ORI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA05&showdescription=no}{J01XA05}), oxacillin (\code{OXA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF04&showdescription=no}{J01CF04}), panipenem (\code{PAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH55&showdescription=no}{J01DH55}), pazufloxacin (\code{PAZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA18&showdescription=no}{J01MA18}), pefloxacin (\code{PEF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA03&showdescription=no}{J01MA03}), penamecillin (\code{PNM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE06&showdescription=no}{J01CE06}), pheneticillin (\code{PHE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE05&showdescription=no}{J01CE05}), phenoxymethylpenicillin (\code{PHN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE02&showdescription=no}{J01CE02}), piperacillin (\code{PIP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA12&showdescription=no}{J01CA12}), piperacillin/tazobactam (\code{TZP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR05&showdescription=no}{J01CR05}), pirlimycin (\code{PRL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ51FF90&showdescription=no}{QJ51FF90}), pivampicillin (\code{PVM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA02&showdescription=no}{J01CA02}), pivmecillinam (\code{PME}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA08&showdescription=no}{J01CA08}), plazomicin (\code{PLZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB14&showdescription=no}{J01GB14}), polymyxin B (\code{PLB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XB02&showdescription=no}{J01XB02}), pradofloxacin (\code{PRA}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA97&showdescription=no}{QJ01MA97}), pristinamycin (\code{PRI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FG01&showdescription=no}{J01FG01}), procaine benzylpenicillin (\code{PRB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE09&showdescription=no}{J01CE09}), propicillin (\code{PRP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE03&showdescription=no}{J01CE03}), prulifloxacin (\code{PRU}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA17&showdescription=no}{J01MA17}), quinupristin/dalfopristin (\code{QDA}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FG02&showdescription=no}{QJ01FG02}), ribostamycin (\code{RST}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB10&showdescription=no}{J01GB10}), rifampicin (\code{RIF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J04AB02&showdescription=no}{J04AB02}), rokitamycin (\code{ROK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA12&showdescription=no}{J01FA12}), roxithromycin (\code{RXT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA06&showdescription=no}{J01FA06}), rufloxacin (\code{RFL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA10&showdescription=no}{J01MA10}), sarafloxacin (\code{SAR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA98&showdescription=no}{QJ01MA98}), sisomicin (\code{SIS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB08&showdescription=no}{J01GB08}), sitafloxacin (\code{SIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA21&showdescription=no}{J01MA21}), solithromycin (\code{SOL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA16&showdescription=no}{J01FA16}), sparfloxacin (\code{SPX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA09&showdescription=no}{J01MA09}), spiramycin (\code{SPI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA02&showdescription=no}{J01FA02}), streptoduocin (\code{STR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GA02&showdescription=no}{J01GA02}), streptomycin (\code{STR1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GA01&showdescription=no}{J01GA01}), sulbenicillin (\code{SBC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA16&showdescription=no}{J01CA16}), sulfadiazine (\code{SDI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC02&showdescription=no}{J01EC02}), sulfadiazine/trimethoprim (\code{SLT1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE02&showdescription=no}{J01EE02}), sulfadimethoxine (\code{SUD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED01&showdescription=no}{J01ED01}), sulfadimidine (\code{SDM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB03&showdescription=no}{J01EB03}), sulfadimidine/trimethoprim (\code{SLT2}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE05&showdescription=no}{J01EE05}), sulfafurazole (\code{SLF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB05&showdescription=no}{J01EB05}), sulfaisodimidine (\code{SLF1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB01&showdescription=no}{J01EB01}), sulfalene (\code{SLF2}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED02&showdescription=no}{J01ED02}), sulfamazone (\code{SZO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED09&showdescription=no}{J01ED09}), sulfamerazine (\code{SLF3}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED07&showdescription=no}{J01ED07}), sulfamerazine/trimethoprim (\code{SLT3}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE07&showdescription=no}{J01EE07}), sulfamethizole (\code{SLF4}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB02&showdescription=no}{J01EB02}), sulfamethoxazole (\code{SMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC01&showdescription=no}{J01EC01}), sulfamethoxypyridazine (\code{SLF5}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED05&showdescription=no}{J01ED05}), sulfametomidine (\code{SLF6}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED03&showdescription=no}{J01ED03}), sulfametoxydiazine (\code{SLF7}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED04&showdescription=no}{J01ED04}), sulfametrole/trimethoprim (\code{SLT4}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE03&showdescription=no}{J01EE03}), sulfamoxole (\code{SLF8}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC03&showdescription=no}{J01EC03}), sulfamoxole/trimethoprim (\code{SLT5}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE04&showdescription=no}{J01EE04}), sulfanilamide (\code{SLF9}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB06&showdescription=no}{J01EB06}), sulfaperin (\code{SLF10}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED06&showdescription=no}{J01ED06}), sulfaphenazole (\code{SLF11}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED08&showdescription=no}{J01ED08}), sulfapyridine (\code{SLF12}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB04&showdescription=no}{J01EB04}), sulfathiazole (\code{SUT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB07&showdescription=no}{J01EB07}), sulfathiourea (\code{SLF13}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB08&showdescription=no}{J01EB08}), sultamicillin (\code{SLT6}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR04&showdescription=no}{J01CR04}), talampicillin (\code{TAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA15&showdescription=no}{J01CA15}), tebipenem (\code{TBP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH06&showdescription=no}{J01DH06}), tedizolid (\code{TZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX11&showdescription=no}{J01XX11}), teicoplanin (\code{TEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA02&showdescription=no}{J01XA02}), telavancin (\code{TLV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA03&showdescription=no}{J01XA03}), telithromycin (\code{TLT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA15&showdescription=no}{J01FA15}), temafloxacin (\code{TMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA05&showdescription=no}{J01MA05}), temocillin (\code{TEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA17&showdescription=no}{J01CA17}), tetracycline (\code{TCY}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA07&showdescription=no}{J01AA07}), ticarcillin (\code{TIC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA13&showdescription=no}{J01CA13}), ticarcillin/clavulanic acid (\code{TCC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR03&showdescription=no}{J01CR03}), tigecycline (\code{TGC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA12&showdescription=no}{J01AA12}), tilbroquinol (\code{TBQ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=P01AA05&showdescription=no}{P01AA05}), tildipirosin (\code{TIP}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA96&showdescription=no}{QJ01FA96}), tilmicosin (\code{TIL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA91&showdescription=no}{QJ01FA91}), tobramycin (\code{TOB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB01&showdescription=no}{J01GB01}), tosufloxacin (\code{TFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA22&showdescription=no}{J01MA22}), trimethoprim (\code{TMP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EA01&showdescription=no}{J01EA01}), trimethoprim/sulfamethoxazole (\code{SXT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE01&showdescription=no}{J01EE01}), troleandomycin (\code{TRL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA08&showdescription=no}{J01FA08}), trovafloxacin (\code{TVA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA13&showdescription=no}{J01MA13}), tulathromycin (\code{TUL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA94&showdescription=no}{QJ01FA94}), tylosin (\code{TYL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA90&showdescription=no}{QJ01FA90}), tylvalosin (\code{TYL1}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA92&showdescription=no}{QJ01FA92}), vancomycin (\code{VAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA01&showdescription=no}{J01XA01}) } \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -4762,7 +4775,7 @@ A \link[tibble:tibble]{tibble} with 2 000 observations and 46 variables: \item \code{gender}\cr Gender of the patient, either "F" or "M" \item \code{ward}\cr Ward type where the patient was admitted, either "Clinical", "ICU", or "Outpatient" \item \code{mo}\cr ID of microorganism created with \code{\link[=as.mo]{as.mo()}}, see also the \link{microorganisms} data set -\item \code{PEN:RIF}\cr 40 different antibiotics with class \code{\link{sir}} (see \code{\link[=as.sir]{as.sir()}}); these column names occur in the \link{antibiotics} data set and can be translated with \code{\link[=set_ab_names]{set_ab_names()}} or \code{\link[=ab_name]{ab_name()}} +\item \code{PEN:RIF}\cr 40 different antimicrobials with class \code{\link{sir}} (see \code{\link[=as.sir]{as.sir()}}); these column names occur in the \link{antimicrobials} data set and can be translated with \code{\link[=set_ab_names]{set_ab_names()}} or \code{\link[=ab_name]{ab_name()}} } } \usage{ @@ -4798,7 +4811,7 @@ A \link[tibble:tibble]{tibble} with 3 000 observations and 8 variables: \item \code{date}\cr date of receipt at the laboratory \item \code{hospital}\cr ID of the hospital, from A to C \item \code{bacteria}\cr info about microorganism that can be transformed with \code{\link[=as.mo]{as.mo()}}, see also \link{microorganisms} -\item \code{AMX:GEN}\cr 4 different antibiotics that have to be transformed with \code{\link[=as.sir]{as.sir()}} +\item \code{AMX:GEN}\cr 4 different antimicrobials that have to be transformed with \code{\link[=as.sir]{as.sir()}} } } \usage{ @@ -5556,7 +5569,7 @@ geom_sir(position = NULL, x = c("antibiotic", "interpretation"), \item{limits}{a \link{numeric} vector of length two providing limits of the scale, use \code{NA} to refer to the existing minimum or maximum} -\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} +\item{translate_ab}{a column name of the \link{antimicrobials} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} \item{combine_SI}{a \link{logical} to indicate whether all values of S, SDD, and I must be merged into one, so the output only consists of S+SDD+I vs. R (susceptible vs. resistant) - the default is \code{TRUE}} @@ -5590,9 +5603,9 @@ geom_sir(position = NULL, x = c("antibiotic", "interpretation"), Use these functions to create bar plots for AMR data analysis. All functions rely on \link[ggplot2:ggplot]{ggplot2} functions. } \details{ -At default, the names of antibiotics will be shown on the plots using \code{\link[=ab_name]{ab_name()}}. This can be set with the \code{translate_ab} argument. See \code{\link[=count_df]{count_df()}}. +At default, the names of antimicrobials will be shown on the plots using \code{\link[=ab_name]{ab_name()}}. This can be set with the \code{translate_ab} argument. See \code{\link[=count_df]{count_df()}}. -\code{\link[=geom_sir]{geom_sir()}} will take any variable from the data that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) using \code{\link[=sir_df]{sir_df()}} and will plot bars with the percentage S, I, and R. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis. +\code{\link[=geom_sir]{geom_sir()}} will take any variable from the data that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) using \code{\link[=sir_df]{sir_df()}} and will plot bars with the percentage S, I, and R. The default behaviour is to have the bars stacked and to have the different antimicrobials on the x axis. Additional functions include: \itemize{ @@ -5733,10 +5746,10 @@ guess_ab_col(x = NULL, search_string = NULL, verbose = FALSE, A column name of \code{x}, or \code{NULL} when no result is found. } \description{ -This tries to find a column name in a data set based on information from the \link{antibiotics} data set. Also supports WHONET abbreviations. +This tries to find a column name in a data set based on information from the \link{antimicrobials} data set. Also supports WHONET abbreviations. } \details{ -You can look for an antibiotic (trade) name or abbreviation and it will search \code{x} and the \link{antibiotics} data set for any column containing a name or code of that antibiotic. +You can look for an antibiotic (trade) name or abbreviation and it will search \code{x} and the \link{antimicrobials} data set for any column containing a name or code of that antibiotic. } \examples{ df <- data.frame( @@ -5776,7 +5789,7 @@ THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/intrinsic_resistant.Rd': A \link[tibble:tibble]{tibble} with 301 583 observations and 2 variables: \itemize{ \item \code{mo}\cr Microorganism ID -\item \code{ab}\cr Antibiotic ID +\item \code{ab}\cr Antimcrobial ID } } \usage{ @@ -5948,7 +5961,7 @@ antimicrobials_equal(y, z, type = c("points", "keyantimicrobials"), ignore_I = TRUE, points_threshold = 2, ...) } \arguments{ -\item{x}{a \link{data.frame} with antibiotics columns, like \code{AMX} or \code{amox}. Can be left blank to determine automatically} +\item{x}{a \link{data.frame} with antimicrobials columns, like \code{AMX} or \code{amox}. Can be left blank to determine automatically.} \item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}) - the default is the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} @@ -6039,7 +6052,7 @@ antimicrobials_equal(strainA, strainB, type = "keyantimicrobials", ignore_I = FA \donttest{ if (require("dplyr")) { - # set key antibiotics to a new variable + # set key antimicrobials to a new variable my_patients <- example_isolates \%>\% mutate(keyab = key_antimicrobials(antifungal = NULL)) \%>\% # no need to define `x` mutate( @@ -6231,7 +6244,7 @@ eucast_exceptional_phenotypes(x = NULL, only_sir_columns = FALSE, verbose = FALSE, ...) } \arguments{ -\item{x}{a \link{data.frame} with antibiotics columns, like \code{AMX} or \code{amox}. Can be left blank for automatic determination.} +\item{x}{a \link{data.frame} with antimicrobials columns, like \code{AMX} or \code{amox}. Can be left blank for automatic determination.} \item{guideline}{a specific guideline to follow, see sections \emph{Supported international / national guidelines} and \emph{Using Custom Guidelines} below. When left empty, the publication by Magiorakos \emph{et al.} (see below) will be followed.} @@ -6257,9 +6270,9 @@ eucast_exceptional_phenotypes(x = NULL, only_sir_columns = FALSE, \item{verbose}{a \link{logical} to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.} -\item{only_sir_columns}{a \link{logical} to indicate whether only antibiotic columns must be detected that were transformed to class \code{sir} (see \code{\link[=as.sir]{as.sir()}}) on beforehand (default is \code{FALSE})} +\item{only_sir_columns}{a \link{logical} to indicate whether only antimicrobial columns must be detected that were transformed to class \code{sir} (see \code{\link[=as.sir]{as.sir()}}) on beforehand (default is \code{FALSE})} -\item{...}{in case of \code{\link[=custom_mdro_guideline]{custom_mdro_guideline()}}: a set of rules, see section \emph{Using Custom Guidelines} below. Otherwise: column name of an antibiotic, see section \emph{Antibiotics} below.} +\item{...}{in case of \code{\link[=custom_mdro_guideline]{custom_mdro_guideline()}}: a set of rules, see section \emph{Using Custom Guidelines} below. Otherwise: column name of an antibiotic, see section \emph{Antimicrobials} below.} \item{as_factor}{a \link{logical} to indicate whether the returned value should be an ordered \link{factor} (\code{TRUE}, default), or otherwise a \link{character} vector} } @@ -6369,11 +6382,11 @@ table(x) The rules set (the \code{custom} object in this case) could be exported to a shared file location using \code{\link[=saveRDS]{saveRDS()}} if you collaborate with multiple users. The custom rules set could then be imported using \code{\link[=readRDS]{readRDS()}}. } -\section{Antibiotics}{ +\section{Antimicrobials}{ -To define antibiotics column names, leave as it is to determine it automatically with \code{\link[=guess_ab_col]{guess_ab_col()}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. +To define antimicrobials column names, leave as it is to determine it automatically with \code{\link[=guess_ab_col]{guess_ab_col()}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. -The following antibiotics are eligible for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format 'name (\verb{antimicrobial ID}, \href{https://atcddd.fhi.no/atc/structure_and_principles/}{ATC code})', sorted alphabetically: +The following antimicrobials are eligible for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format 'name (\verb{antimicrobial ID}, \href{https://atcddd.fhi.no/atc/structure_and_principles/}{ATC code})', sorted alphabetically: Amikacin (\code{AMK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB06&showdescription=no}{J01GB06}), amoxicillin (\code{AMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA04&showdescription=no}{J01CA04}), amoxicillin/clavulanic acid (\code{AMC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR02&showdescription=no}{J01CR02}), ampicillin (\code{AMP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA01&showdescription=no}{J01CA01}), ampicillin/sulbactam (\code{SAM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR01&showdescription=no}{J01CR01}), apramycin (\code{APR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QA07AA92&showdescription=no}{QA07AA92}), arbekacin (\code{ARB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB12&showdescription=no}{J01GB12}), aspoxicillin (\code{APX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA19&showdescription=no}{J01CA19}), azidocillin (\code{AZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE04&showdescription=no}{J01CE04}), azithromycin (\code{AZM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA10&showdescription=no}{J01FA10}), azlocillin (\code{AZL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA09&showdescription=no}{J01CA09}), aztreonam (\code{ATM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DF01&showdescription=no}{J01DF01}), bacampicillin (\code{BAM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA06&showdescription=no}{J01CA06}), bekanamycin (\code{BEK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB13&showdescription=no}{J01GB13}), benzathine benzylpenicillin (\code{BNB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE08&showdescription=no}{J01CE08}), benzathine phenoxymethylpenicillin (\code{BNP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE10&showdescription=no}{J01CE10}), benzylpenicillin (\code{PEN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE01&showdescription=no}{J01CE01}), besifloxacin (\code{BES}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=S01AE08&showdescription=no}{S01AE08}), biapenem (\code{BIA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH05&showdescription=no}{J01DH05}), carbenicillin (\code{CRB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA03&showdescription=no}{J01CA03}), carindacillin (\code{CRN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA05&showdescription=no}{J01CA05}), carumonam (\code{CAR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DF02&showdescription=no}{J01DF02}), cefacetrile (\code{CAC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB10&showdescription=no}{J01DB10}), cefaclor (\code{CEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC04&showdescription=no}{J01DC04}), cefadroxil (\code{CFR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB05&showdescription=no}{J01DB05}), cefalexin (\code{LEX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB01&showdescription=no}{J01DB01}), cefaloridine (\code{RID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB02&showdescription=no}{J01DB02}), cefalotin (\code{CEP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB03&showdescription=no}{J01DB03}), cefamandole (\code{MAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC03&showdescription=no}{J01DC03}), cefapirin (\code{HAP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB08&showdescription=no}{J01DB08}), cefatrizine (\code{CTZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB07&showdescription=no}{J01DB07}), cefazedone (\code{CZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB06&showdescription=no}{J01DB06}), cefazolin (\code{CZO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB04&showdescription=no}{J01DB04}), cefcapene (\code{CCP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD17&showdescription=no}{J01DD17}), cefdinir (\code{CDR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD15&showdescription=no}{J01DD15}), cefditoren (\code{DIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD16&showdescription=no}{J01DD16}), cefepime (\code{FEP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE01&showdescription=no}{J01DE01}), cefepime/amikacin (\code{CFA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01RA06&showdescription=no}{J01RA06}), cefetamet (\code{CAT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD10&showdescription=no}{J01DD10}), cefiderocol (\code{FDC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI04&showdescription=no}{J01DI04}), cefixime (\code{CFM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD08&showdescription=no}{J01DD08}), cefmenoxime (\code{CMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD05&showdescription=no}{J01DD05}), cefmetazole (\code{CMZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC09&showdescription=no}{J01DC09}), cefodizime (\code{DIZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD09&showdescription=no}{J01DD09}), cefonicid (\code{CID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC06&showdescription=no}{J01DC06}), cefoperazone (\code{CFP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD12&showdescription=no}{J01DD12}), cefoperazone/sulbactam (\code{CSL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD62&showdescription=no}{J01DD62}), ceforanide (\code{CND}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC11&showdescription=no}{J01DC11}), cefotaxime (\code{CTX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD01&showdescription=no}{J01DD01}), cefotaxime/clavulanic acid (\code{CTC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD51&showdescription=no}{J01DD51}), cefotetan (\code{CTT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC05&showdescription=no}{J01DC05}), cefotiam (\code{CTF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC07&showdescription=no}{J01DC07}), cefovecin (\code{FOV}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01DD91&showdescription=no}{QJ01DD91}), cefoxitin (\code{FOX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC01&showdescription=no}{J01DC01}), cefozopran (\code{ZOP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE03&showdescription=no}{J01DE03}), cefpiramide (\code{CPM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD11&showdescription=no}{J01DD11}), cefpirome (\code{CPO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE02&showdescription=no}{J01DE02}), cefpodoxime (\code{CPD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD13&showdescription=no}{J01DD13}), cefprozil (\code{CPR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC10&showdescription=no}{J01DC10}), cefquinome (\code{CEQ}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QG51AA07&showdescription=no}{QG51AA07}), cefroxadine (\code{CRD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB11&showdescription=no}{J01DB11}), cefsulodin (\code{CFS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD03&showdescription=no}{J01DD03}), ceftaroline (\code{CPT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI02&showdescription=no}{J01DI02}), ceftazidime (\code{CAZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD02&showdescription=no}{J01DD02}), ceftazidime/clavulanic acid (\code{CCV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD52&showdescription=no}{J01DD52}), cefteram (\code{CEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD18&showdescription=no}{J01DD18}), ceftezole (\code{CTL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB12&showdescription=no}{J01DB12}), ceftibuten (\code{CTB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD14&showdescription=no}{J01DD14}), ceftiofur (\code{TIO}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01DD90&showdescription=no}{QJ01DD90}), ceftizoxime (\code{CZX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD07&showdescription=no}{J01DD07}), ceftobiprole medocaril (\code{CFM1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI01&showdescription=no}{J01DI01}), ceftolozane/tazobactam (\code{CZT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI54&showdescription=no}{J01DI54}), ceftriaxone (\code{CRO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD04&showdescription=no}{J01DD04}), ceftriaxone/beta-lactamase inhibitor (\code{CEB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD63&showdescription=no}{J01DD63}), cefuroxime (\code{CXM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC02&showdescription=no}{J01DC02}), cephradine (\code{CED}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB09&showdescription=no}{J01DB09}), chloramphenicol (\code{CHL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01BA01&showdescription=no}{J01BA01}), ciprofloxacin (\code{CIP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA02&showdescription=no}{J01MA02}), clarithromycin (\code{CLR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA09&showdescription=no}{J01FA09}), clindamycin (\code{CLI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FF01&showdescription=no}{J01FF01}), clometocillin (\code{CLM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE07&showdescription=no}{J01CE07}), cloxacillin (\code{CLO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF02&showdescription=no}{J01CF02}), colistin (\code{COL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XB01&showdescription=no}{J01XB01}), cycloserine (\code{CYC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J04AB01&showdescription=no}{J04AB01}), dalbavancin (\code{DAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA04&showdescription=no}{J01XA04}), danofloxacin (\code{DAN}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA92&showdescription=no}{QJ01MA92}), daptomycin (\code{DAP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX09&showdescription=no}{J01XX09}), delafloxacin (\code{DFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA23&showdescription=no}{J01MA23}), dibekacin (\code{DKB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB09&showdescription=no}{J01GB09}), dicloxacillin (\code{DIC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF01&showdescription=no}{J01CF01}), difloxacin (\code{DIF}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA94&showdescription=no}{QJ01MA94}), dirithromycin (\code{DIR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA13&showdescription=no}{J01FA13}), doripenem (\code{DOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH04&showdescription=no}{J01DH04}), doxycycline (\code{DOX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA02&showdescription=no}{J01AA02}), enoxacin (\code{ENX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA04&showdescription=no}{J01MA04}), enrofloxacin (\code{ENR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA90&showdescription=no}{QJ01MA90}), epicillin (\code{EPC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA07&showdescription=no}{J01CA07}), ertapenem (\code{ETP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH03&showdescription=no}{J01DH03}), erythromycin (\code{ERY}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA01&showdescription=no}{J01FA01}), fleroxacin (\code{FLE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA08&showdescription=no}{J01MA08}), flucloxacillin (\code{FLC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF05&showdescription=no}{J01CF05}), flurithromycin (\code{FLR1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA14&showdescription=no}{J01FA14}), fosfomycin (\code{FOS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX01&showdescription=no}{J01XX01}), framycetin (\code{FRM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=D09AA01&showdescription=no}{D09AA01}), fusidic acid (\code{FUS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XC01&showdescription=no}{J01XC01}), gamithromycin (\code{GAM}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA95&showdescription=no}{QJ01FA95}), garenoxacin (\code{GRN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA19&showdescription=no}{J01MA19}), gatifloxacin (\code{GAT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA16&showdescription=no}{J01MA16}), gemifloxacin (\code{GEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA15&showdescription=no}{J01MA15}), gentamicin (\code{GEN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB03&showdescription=no}{J01GB03}), grepafloxacin (\code{GRX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA11&showdescription=no}{J01MA11}), hetacillin (\code{HET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA18&showdescription=no}{J01CA18}), imipenem (\code{IPM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH51&showdescription=no}{J01DH51}), imipenem/relebactam (\code{IMR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH56&showdescription=no}{J01DH56}), isepamicin (\code{ISE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB11&showdescription=no}{J01GB11}), josamycin (\code{JOS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA07&showdescription=no}{J01FA07}), kanamycin (\code{KAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB04&showdescription=no}{J01GB04}), kitasamycin (\code{KIT}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA93&showdescription=no}{QJ01FA93}), lascufloxacin (\code{LSC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA25&showdescription=no}{J01MA25}), latamoxef (\code{LTM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD06&showdescription=no}{J01DD06}), levofloxacin (\code{LVX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA12&showdescription=no}{J01MA12}), levonadifloxacin (\code{LND}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA24&showdescription=no}{J01MA24}), lincomycin (\code{LIN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FF02&showdescription=no}{J01FF02}), linezolid (\code{LNZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX08&showdescription=no}{J01XX08}), lomefloxacin (\code{LOM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA07&showdescription=no}{J01MA07}), loracarbef (\code{LOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC08&showdescription=no}{J01DC08}), marbofloxacin (\code{MAR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA93&showdescription=no}{QJ01MA93}), mecillinam (\code{MEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA11&showdescription=no}{J01CA11}), meropenem (\code{MEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH02&showdescription=no}{J01DH02}), meropenem/vaborbactam (\code{MEV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH52&showdescription=no}{J01DH52}), metampicillin (\code{MTM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA14&showdescription=no}{J01CA14}), meticillin (\code{MET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF03&showdescription=no}{J01CF03}), mezlocillin (\code{MEZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA10&showdescription=no}{J01CA10}), micronomicin (\code{MCR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=S01AA22&showdescription=no}{S01AA22}), midecamycin (\code{MID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA03&showdescription=no}{J01FA03}), minocycline (\code{MNO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA08&showdescription=no}{J01AA08}), miocamycin (\code{MCM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA11&showdescription=no}{J01FA11}), moxifloxacin (\code{MFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA14&showdescription=no}{J01MA14}), nadifloxacin (\code{NAD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=D10AF05&showdescription=no}{D10AF05}), nafcillin (\code{NAF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF06&showdescription=no}{J01CF06}), nalidixic acid (\code{NAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MB02&showdescription=no}{J01MB02}), neomycin (\code{NEO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB05&showdescription=no}{J01GB05}), netilmicin (\code{NET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB07&showdescription=no}{J01GB07}), nitrofurantoin (\code{NIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XE01&showdescription=no}{J01XE01}), norfloxacin (\code{NOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA06&showdescription=no}{J01MA06}), novobiocin (\code{NOV}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01XX95&showdescription=no}{QJ01XX95}), ofloxacin (\code{OFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA01&showdescription=no}{J01MA01}), oleandomycin (\code{OLE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA05&showdescription=no}{J01FA05}), orbifloxacin (\code{ORB}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA95&showdescription=no}{QJ01MA95}), oritavancin (\code{ORI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA05&showdescription=no}{J01XA05}), oxacillin (\code{OXA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF04&showdescription=no}{J01CF04}), panipenem (\code{PAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH55&showdescription=no}{J01DH55}), pazufloxacin (\code{PAZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA18&showdescription=no}{J01MA18}), pefloxacin (\code{PEF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA03&showdescription=no}{J01MA03}), penamecillin (\code{PNM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE06&showdescription=no}{J01CE06}), pheneticillin (\code{PHE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE05&showdescription=no}{J01CE05}), phenoxymethylpenicillin (\code{PHN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE02&showdescription=no}{J01CE02}), piperacillin (\code{PIP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA12&showdescription=no}{J01CA12}), piperacillin/tazobactam (\code{TZP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR05&showdescription=no}{J01CR05}), pirlimycin (\code{PRL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ51FF90&showdescription=no}{QJ51FF90}), pivampicillin (\code{PVM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA02&showdescription=no}{J01CA02}), pivmecillinam (\code{PME}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA08&showdescription=no}{J01CA08}), plazomicin (\code{PLZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB14&showdescription=no}{J01GB14}), polymyxin B (\code{PLB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XB02&showdescription=no}{J01XB02}), pradofloxacin (\code{PRA}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA97&showdescription=no}{QJ01MA97}), pristinamycin (\code{PRI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FG01&showdescription=no}{J01FG01}), procaine benzylpenicillin (\code{PRB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE09&showdescription=no}{J01CE09}), propicillin (\code{PRP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE03&showdescription=no}{J01CE03}), prulifloxacin (\code{PRU}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA17&showdescription=no}{J01MA17}), quinupristin/dalfopristin (\code{QDA}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FG02&showdescription=no}{QJ01FG02}), ribostamycin (\code{RST}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB10&showdescription=no}{J01GB10}), rifampicin (\code{RIF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J04AB02&showdescription=no}{J04AB02}), rokitamycin (\code{ROK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA12&showdescription=no}{J01FA12}), roxithromycin (\code{RXT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA06&showdescription=no}{J01FA06}), rufloxacin (\code{RFL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA10&showdescription=no}{J01MA10}), sarafloxacin (\code{SAR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA98&showdescription=no}{QJ01MA98}), sisomicin (\code{SIS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB08&showdescription=no}{J01GB08}), sitafloxacin (\code{SIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA21&showdescription=no}{J01MA21}), solithromycin (\code{SOL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA16&showdescription=no}{J01FA16}), sparfloxacin (\code{SPX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA09&showdescription=no}{J01MA09}), spiramycin (\code{SPI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA02&showdescription=no}{J01FA02}), streptoduocin (\code{STR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GA02&showdescription=no}{J01GA02}), streptomycin (\code{STR1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GA01&showdescription=no}{J01GA01}), sulbenicillin (\code{SBC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA16&showdescription=no}{J01CA16}), sulfadiazine (\code{SDI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC02&showdescription=no}{J01EC02}), sulfadiazine/trimethoprim (\code{SLT1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE02&showdescription=no}{J01EE02}), sulfadimethoxine (\code{SUD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED01&showdescription=no}{J01ED01}), sulfadimidine (\code{SDM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB03&showdescription=no}{J01EB03}), sulfadimidine/trimethoprim (\code{SLT2}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE05&showdescription=no}{J01EE05}), sulfafurazole (\code{SLF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB05&showdescription=no}{J01EB05}), sulfaisodimidine (\code{SLF1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB01&showdescription=no}{J01EB01}), sulfalene (\code{SLF2}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED02&showdescription=no}{J01ED02}), sulfamazone (\code{SZO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED09&showdescription=no}{J01ED09}), sulfamerazine (\code{SLF3}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED07&showdescription=no}{J01ED07}), sulfamerazine/trimethoprim (\code{SLT3}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE07&showdescription=no}{J01EE07}), sulfamethizole (\code{SLF4}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB02&showdescription=no}{J01EB02}), sulfamethoxazole (\code{SMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC01&showdescription=no}{J01EC01}), sulfamethoxypyridazine (\code{SLF5}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED05&showdescription=no}{J01ED05}), sulfametomidine (\code{SLF6}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED03&showdescription=no}{J01ED03}), sulfametoxydiazine (\code{SLF7}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED04&showdescription=no}{J01ED04}), sulfametrole/trimethoprim (\code{SLT4}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE03&showdescription=no}{J01EE03}), sulfamoxole (\code{SLF8}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC03&showdescription=no}{J01EC03}), sulfamoxole/trimethoprim (\code{SLT5}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE04&showdescription=no}{J01EE04}), sulfanilamide (\code{SLF9}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB06&showdescription=no}{J01EB06}), sulfaperin (\code{SLF10}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED06&showdescription=no}{J01ED06}), sulfaphenazole (\code{SLF11}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED08&showdescription=no}{J01ED08}), sulfapyridine (\code{SLF12}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB04&showdescription=no}{J01EB04}), sulfathiazole (\code{SUT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB07&showdescription=no}{J01EB07}), sulfathiourea (\code{SLF13}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB08&showdescription=no}{J01EB08}), sultamicillin (\code{SLT6}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR04&showdescription=no}{J01CR04}), talampicillin (\code{TAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA15&showdescription=no}{J01CA15}), tebipenem (\code{TBP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH06&showdescription=no}{J01DH06}), tedizolid (\code{TZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX11&showdescription=no}{J01XX11}), teicoplanin (\code{TEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA02&showdescription=no}{J01XA02}), telavancin (\code{TLV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA03&showdescription=no}{J01XA03}), telithromycin (\code{TLT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA15&showdescription=no}{J01FA15}), temafloxacin (\code{TMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA05&showdescription=no}{J01MA05}), temocillin (\code{TEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA17&showdescription=no}{J01CA17}), tetracycline (\code{TCY}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA07&showdescription=no}{J01AA07}), ticarcillin (\code{TIC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA13&showdescription=no}{J01CA13}), ticarcillin/clavulanic acid (\code{TCC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR03&showdescription=no}{J01CR03}), tigecycline (\code{TGC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA12&showdescription=no}{J01AA12}), tilbroquinol (\code{TBQ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=P01AA05&showdescription=no}{P01AA05}), tildipirosin (\code{TIP}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA96&showdescription=no}{QJ01FA96}), tilmicosin (\code{TIL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA91&showdescription=no}{QJ01FA91}), tobramycin (\code{TOB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB01&showdescription=no}{J01GB01}), tosufloxacin (\code{TFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA22&showdescription=no}{J01MA22}), trimethoprim (\code{TMP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EA01&showdescription=no}{J01EA01}), trimethoprim/sulfamethoxazole (\code{SXT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE01&showdescription=no}{J01EE01}), troleandomycin (\code{TRL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA08&showdescription=no}{J01FA08}), trovafloxacin (\code{TVA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA13&showdescription=no}{J01MA13}), tulathromycin (\code{TUL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA94&showdescription=no}{QJ01FA94}), tylosin (\code{TYL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA90&showdescription=no}{QJ01FA90}), tylvalosin (\code{TYL1}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA92&showdescription=no}{QJ01FA92}), vancomycin (\code{VAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA01&showdescription=no}{J01XA01}) } @@ -6786,7 +6799,7 @@ All matches are sorted descending on their matching score and for all user input \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -7006,7 +7019,7 @@ Determination of the Gram stain (\code{\link[=mo_gramstain]{mo_gramstain()}}) wi Determination of yeasts (\code{\link[=mo_is_yeast]{mo_is_yeast()}}) will be based on the taxonomic kingdom and class. \emph{Budding yeasts} are yeasts that reproduce asexually through a process called budding, where a new cell develops from a small protrusion on the parent cell. Taxonomically, these are members of the phylum Ascomycota, class Saccharomycetes (also called Hemiascomycetes) or Pichiomycetes. \emph{True yeasts} quite specifically refers to yeasts in the underlying order Saccharomycetales (such as \emph{Saccharomyces cerevisiae}). Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes or Pichiomycetes, the function will return \code{TRUE}. It returns \code{FALSE} otherwise (or \code{NA} when the input is \code{NA} or the MO code is \code{UNKNOWN}). -Determination of intrinsic resistance (\code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}}) will be based on the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021). The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} function can be vectorised over both argument \code{x} (input for microorganisms) and \code{ab} (input for antibiotics). +Determination of intrinsic resistance (\code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}}) will be based on the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021). The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} function can be vectorised over both argument \code{x} (input for microorganisms) and \code{ab} (input for antimicrobials). Determination of bacterial oxygen tolerance (\code{\link[=mo_oxygen_tolerance]{mo_oxygen_tolerance()}}) will be based on BacDive, see \emph{Source}. The function \code{\link[=mo_is_anaerobic]{mo_is_anaerobic()}} only returns \code{TRUE} if the oxygen tolerance is \code{"anaerobe"}, indicting an obligate anaerobic species or genus. It always returns \code{FALSE} for species outside the taxonomic kingdom of Bacteria. @@ -7038,7 +7051,7 @@ This function uses \code{\link[=as.mo]{as.mo()}} internally, which uses an advan \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -7539,7 +7552,7 @@ labels_sir_count(position = NULL, x = "antibiotic", \item{position}{position adjustment of bars, either \code{"fill"}, \code{"stack"} or \code{"dodge"}} -\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} +\item{translate_ab}{a column name of the \link{antimicrobials} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} \item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see \emph{Source}.} @@ -7800,7 +7813,7 @@ sir_df(data, translate_ab = "name", language = get_AMR_locale(), \item{as_percent}{a \link{logical} to indicate whether the output must be returned as a hundred fold with \% sign (a character). A value of \code{0.123456} will then be returned as \code{"12.3\%"}.} -\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}): a \link{logical} to indicate that isolates must be tested for all antibiotics, see section \emph{Combination Therapy} below} +\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}): a \link{logical} to indicate that isolates must be tested for all antimicrobials, see section \emph{Combination Therapy} below} \item{ab_result}{antibiotic results to test against, must be one or more values of "S", "SDD", "I", or "R"} @@ -7812,7 +7825,7 @@ sir_df(data, translate_ab = "name", language = get_AMR_locale(), \item{data}{a \link{data.frame} containing columns with class \code{\link{sir}} (see \code{\link[=as.sir]{as.sir()}})} -\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} +\item{translate_ab}{a column name of the \link{antimicrobials} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} \item{language}{language of the returned text - the default is the current system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with the package option \code{\link[=AMR-options]{AMR_locale}}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} @@ -7841,7 +7854,7 @@ The function \code{\link[=proportion_df]{proportion_df()}} takes any variable fr } \section{Combination Therapy}{ -When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI: +When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antimicrobials, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI: \if{html}{\out{
}}\preformatted{-------------------------------------------------------------------- only_all_tested = FALSE only_all_tested = TRUE @@ -8986,7 +8999,7 @@ In this example, we generate an antibiogram by selecting various antibiotics. ## Taxonomic Data Sets Now in Python! -As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antibiotics`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames: +As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antimicrobials`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames: ```python AMR.microorganisms @@ -9007,7 +9020,7 @@ AMR.microorganisms | F_ZYZYG | Zyzygomyces | unknown | Fungi | None | 7581 | None | 2.0 | ```python -AMR.antibiotics +AMR.antimicrobials ``` | ab | cid | name | group | oral_ddd | oral_units | iv_ddd | iv_units | @@ -9104,7 +9117,7 @@ data <- example_isolates %>% **Explanation:** -- `aminoglycosides()` and `betalactams()` dynamically select columns for antibiotics in these classes. +- `aminoglycosides()` and `betalactams()` dynamically select columns for antimicrobials in these classes. - `drop_na()` ensures the model receives complete cases for training. ### **Defining the Workflow** @@ -9286,7 +9299,7 @@ oops eucast_rules(oops, info = FALSE) ``` -A more convenient function is `mo_is_intrinsic_resistant()` that uses the same guideline, but allows to check for one or more specific microorganisms or antibiotics: +A more convenient function is `mo_is_intrinsic_resistant()` that uses the same guideline, but allows to check for one or more specific microorganisms or antimicrobials: ```{r, warning = FALSE, message = FALSE} mo_is_intrinsic_resistant( @@ -9758,7 +9771,7 @@ download_txt <- function(filename) { msg <- paste0( "It was last updated on ", trimws(format(file.mtime(paste0("../data/", filename, ".rda")), "%e %B %Y %H:%M:%S %Z", tz = "UTC")), - ". Find more info about the structure of this data set [here](https://msberends.github.io/AMR/reference/", ifelse(filename == "antivirals", "antibiotics", filename), ".html).\n" + ". Find more info about the structure of this data set [here](https://msberends.github.io/AMR/reference/", ifelse(filename == "antivirals", "antimicrobials", filename), ".html).\n" ) github_base <- "https://github.com/msberends/AMR/raw/main/data-raw/" filename <- paste0("../data-raw/", filename) @@ -9829,7 +9842,7 @@ print_df <- function(x, rows = 6) { } ``` -All reference data (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) in this `AMR` package are reliable, up-to-date and freely available. We continually export our data sets to formats for use in R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. +All reference data (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) in this `AMR` package are reliable, up-to-date and freely available. We continually export our data sets to formats for use in R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. On this page, we explain how to download them and how the structure of the data sets look like. @@ -9876,13 +9889,13 @@ microorganisms %>% ``` -## `antibiotics`: Antibiotic (+Antifungal) Drugs +## `antimicrobials`: Antibiotic and Antifungal Drugs -`r structure_txt(antibiotics)` +`r structure_txt(antimicrobials)` -This data set is in R available as `antibiotics`, after you load the `AMR` package. +This data set is in R available as `antimicrobials`, after you load the `AMR` package. -`r download_txt("antibiotics")` +`r download_txt("antimicrobials")` The tab-separated text, Microsoft Excel, SPSS, and Stata files all contain the ATC codes, common abbreviations, trade names and LOINC codes as comma separated values. @@ -9898,7 +9911,7 @@ This data set contains all EARS-Net and ATC codes gathered from WHO and WHONET, ### Example content ```{r, echo = FALSE} -antibiotics %>% +antimicrobials %>% filter(ab %in% colnames(example_isolates)) %>% print_df() ``` @@ -10262,7 +10275,7 @@ The `AMR` package is a [free and open-source](https://msberends.github.io/AMR/#c This work was published in the Journal of Statistical Software (Volume 104(3); [DOI 10.18637/jss.v104.i03](https://doi.org/10.18637/jss.v104.i03)) and formed the basis of two PhD theses ([DOI 10.33612/diss.177417131](https://doi.org/10.33612/diss.177417131) and [DOI 10.33612/diss.192486375](https://doi.org/10.33612/diss.192486375)). -After installing this package, R knows `r AMR:::format_included_data_number(AMR::microorganisms)` distinct microbial species and all `r AMR:::format_included_data_number(rbind(AMR::antibiotics[, "atc", drop = FALSE], AMR::antivirals[, "atc", drop = FALSE]))` 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 breakpoint guidelines from CLSI and EUCAST are included from the last 10 years. It supports and can read any data format, including WHONET data. +After installing this package, R knows `r AMR:::format_included_data_number(AMR::microorganisms)` distinct microbial species and all `r AMR:::format_included_data_number(rbind(AMR::antimicrobials[, "atc", drop = FALSE], AMR::antivirals[, "atc", drop = FALSE]))` 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 breakpoint guidelines from CLSI and EUCAST are included from the last 10 years. It supports and can read any data format, including WHONET data. With the help of contributors from all corners of the world, the `AMR` package is available in English, Czech, Chinese, 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. @@ -10287,7 +10300,7 @@ This package can be used for: * Machine reading the EUCAST and CLSI guidelines from 2011-2020 to translate MIC values and disk diffusion diameters to SIR * Principal component analysis for AMR -All reference data sets (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) in this `AMR` package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find [all download links on our website](https://msberends.github.io/AMR/articles/datasets.html), which is automatically updated with every code change. +All reference data sets (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) in this `AMR` package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find [all download links on our website](https://msberends.github.io/AMR/articles/datasets.html), which is automatically updated with every code change. This R package was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the [University of Groningen](https://www.rug.nl), in collaboration with non-profit organisations [Certe Medical Diagnostics and Advice Foundation](https://www.certe.nl) and [University Medical Center Groningen](https://www.umcg.nl), and is being [actively and durably maintained](https://msberends.github.io/AMR/news/) by two public healthcare organisations in the Netherlands. diff --git a/data-raw/loinc.R b/data-raw/loinc.R index 6ba222ef0..4633a80d3 100644 --- a/data-raw/loinc.R +++ b/data-raw/loinc.R @@ -50,15 +50,15 @@ loinc_df <- loinc_df %>% filter(CLASS %in% c("DRUG/TOX", "ABXBACT")) %>% mutate(name = generalise_antibiotic_name(COMPONENT), .before = 1) -# antibiotics -antibiotics$loinc <- as.list(rep(NA_character_, nrow(antibiotics))) -for (i in seq_len(nrow(antibiotics))) { +# antimicrobials +antimicrobials$loinc <- as.list(rep(NA_character_, nrow(antimicrobials))) +for (i in seq_len(nrow(antimicrobials))) { message(i) loinc_ab <- loinc_df %>% - filter(name %like% paste0("^", generalise_antibiotic_name(antibiotics$name[i]))) %>% + filter(name %like% paste0("^", generalise_antibiotic_name(antimicrobials$name[i]))) %>% pull(LOINC_NUM) if (length(loinc_ab) > 0) { - antibiotics$loinc[i] <- list(loinc_ab) + antimicrobials$loinc[i] <- list(loinc_ab) } } @@ -75,10 +75,10 @@ for (i in seq_len(nrow(antivirals))) { } # sort and fix for empty values -for (i in 1:nrow(antibiotics)) { - loinc <- as.character(sort(unique(tolower(antibiotics[i, "loinc", drop = TRUE][[1]])))) +for (i in 1:nrow(antimicrobials)) { + loinc <- as.character(sort(unique(tolower(antimicrobials[i, "loinc", drop = TRUE][[1]])))) loinc <- loinc[loinc != ""] - antibiotics[i, "loinc"][[1]] <- ifelse(length(loinc) == 0, list(""), list(loinc)) + antimicrobials[i, "loinc"][[1]] <- ifelse(length(loinc) == 0, list(""), list(loinc)) } for (i in 1:nrow(antivirals)) { loinc <- as.character(sort(unique(tolower(antivirals[i, "loinc", drop = TRUE][[1]])))) @@ -86,17 +86,17 @@ for (i in 1:nrow(antivirals)) { antivirals[i, "loinc"][[1]] <- ifelse(length(loinc) == 0, list(""), list(loinc)) } -antibiotics <- dataset_UTF8_to_ASCII(as.data.frame(antibiotics, stringsAsFactors = FALSE)) -antibiotics <- dplyr::arrange(antibiotics, name) +antimicrobials <- dataset_UTF8_to_ASCII(as.data.frame(antimicrobials, stringsAsFactors = FALSE)) +antimicrobials <- dplyr::arrange(antimicrobials, name) antivirals <- dataset_UTF8_to_ASCII(as.data.frame(antivirals, stringsAsFactors = FALSE)) antivirals <- dplyr::arrange(antivirals, name) # remember to update R/aa_globals.R for the documentation -dim(antibiotics) # for R/data.R -usethis::use_data(antibiotics, internal = FALSE, overwrite = TRUE, compress = "xz", version = 2) -rm(antibiotics) +dim(antimicrobials) # for R/data.R +usethis::use_data(antimicrobials, internal = FALSE, overwrite = TRUE, compress = "xz", version = 2) +rm(antimicrobials) dim(antivirals) # for R/data.R usethis::use_data(antivirals, internal = FALSE, overwrite = TRUE, compress = "xz", version = 2) diff --git a/data-raw/reproduction_of_antibiotics.R b/data-raw/reproduction_of_antibiotics.R deleted file mode 100644 index f315fc9a8..000000000 --- a/data-raw/reproduction_of_antibiotics.R +++ /dev/null @@ -1,948 +0,0 @@ -# ==================================================================== # -# TITLE: # -# AMR: An R Package for Working with Antimicrobial Resistance Data # -# # -# SOURCE CODE: # -# https://github.com/msberends/AMR # -# # -# PLEASE CITE THIS SOFTWARE AS: # -# Berends MS, Luz CF, Friedrich AW, et al. (2022). # -# AMR: An R Package for Working with Antimicrobial Resistance Data. # -# Journal of Statistical Software, 104(3), 1-31. # -# https://doi.org/10.18637/jss.v104.i03 # -# # -# Developed at the University of Groningen and the University Medical # -# Center Groningen in The Netherlands, in collaboration with many # -# colleagues from around the world, see our website. # -# # -# This R package is free software; you can freely use and distribute # -# it for both personal and commercial purposes under the terms of the # -# GNU General Public License version 2.0 (GNU GPL-2), as published by # -# the Free Software Foundation. # -# We created this package for both routine data analysis and academic # -# research and it was publicly released in the hope that it will be # -# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. # -# # -# Visit our website for the full manual and a complete tutorial about # -# how to conduct AMR data analysis: https://msberends.github.io/AMR/ # -# ==================================================================== # - -library(dplyr) - -# got EARS-Net codes (= ECDC/WHO codes) from here: - -# Installed WHONET 2019 software on Windows (http://www.whonet.org/software.html), -# opened C:\WHONET\Codes\WHONETCodes.mdb in MS Access -# and exported table 'DRGLST' to MS Excel -library(readxl) -DRGLST <- read_excel("DRGLST.xlsx") -abx <- DRGLST %>% - select( - ab = WHON5_CODE, - name = ANTIBIOTIC - ) %>% - # remove the ones without WHONET code - filter(!is.na(ab)) %>% - distinct(name, .keep_all = TRUE) %>% - # add the ones without WHONET code - bind_rows( - DRGLST %>% - select( - ab = WHON5_CODE, - name = ANTIBIOTIC - ) %>% - filter(is.na(ab)) %>% - distinct(name, .keep_all = TRUE) - # add new ab code later - ) %>% - arrange(name) - -# add old ATC codes -ab_old <- AMR::antibiotics %>% - mutate( - official = gsub("( and |, )", "/", official), - abbr = tolower(paste(ifelse(is.na(abbr), "", abbr), - ifelse(is.na(certe), "", certe), - ifelse(is.na(umcg), "", umcg), - sep = "|" - )) - ) -for (i in 1:nrow(ab_old)) { - abbr <- ab_old[i, "abbr"] - abbr <- strsplit(abbr, "|", fixed = TRUE) %>% - unlist() %>% - unique() - abbr <- abbr[abbr != ""] - # print(abbr) - if (length(abbr) == 0) { - ab_old[i, "abbr"] <- NA_character_ - } else { - ab_old[i, "abbr"] <- paste(abbr, collapse = "|") - } -} - -# create reference data set: to be able to map ab to atc -abx_atc1 <- abx %>% - mutate(name_lower = tolower(name)) %>% - left_join(ab_old %>% - select(ears_net, atc), by = c(ab = "ears_net")) %>% - rename(atc1 = atc) %>% - left_join(ab_old %>% - mutate(official = gsub(", combinations", "", official, fixed = TRUE)) %>% - transmute(official = tolower(official), atc), by = c(name_lower = "official")) %>% - rename(atc2 = atc) %>% - left_join(ab_old %>% - mutate(official = gsub(", combinations", "", official, fixed = TRUE)) %>% - mutate(official = gsub("f", "ph", official)) %>% - transmute(official = tolower(official), atc), by = c(name_lower = "official")) %>% - rename(atc3 = atc) %>% - left_join(ab_old %>% - mutate(official = gsub(", combinations", "", official, fixed = TRUE)) %>% - mutate(official = gsub("t", "th", official)) %>% - transmute(official = tolower(official), atc), by = c(name_lower = "official")) %>% - rename(atc4 = atc) %>% - left_join(ab_old %>% - mutate(official = gsub(", combinations", "", official, fixed = TRUE)) %>% - mutate(official = gsub("f", "ph", official)) %>% - mutate(official = gsub("t", "th", official)) %>% - transmute(official = tolower(official), atc), by = c(name_lower = "official")) %>% - rename(atc5 = atc) %>% - left_join(ab_old %>% - mutate(official = gsub(", combinations", "", official, fixed = TRUE)) %>% - mutate(official = gsub("f", "ph", official)) %>% - mutate(official = gsub("t", "th", official)) %>% - mutate(official = gsub("ine$", "in", official)) %>% - transmute(official = tolower(official), atc), by = c(name_lower = "official")) %>% - rename(atc6 = atc) %>% - mutate(atc = case_when( - !is.na(atc1) ~ atc1, - !is.na(atc2) ~ atc2, - !is.na(atc3) ~ atc3, - !is.na(atc4) ~ atc4, - !is.na(atc4) ~ atc5, - TRUE ~ atc6 - )) %>% - distinct(ab, name, .keep_all = TRUE) %>% - select(ab, atc, name) - -abx_atc2 <- ab_old %>% - filter( - !atc %in% abx_atc1$atc, - is.na(ears_net), - !is.na(atc_group1), - atc_group1 %unlike% ("virus|vaccin|viral|immun"), - official %unlike% "(combinations| with )" - ) %>% - mutate(ab = NA_character_) %>% - as.data.frame(stringsAsFactors = FALSE) %>% - select(ab, atc, name = official) - -abx2 <- bind_rows(abx_atc1, abx_atc2) - -rm(abx_atc1) -rm(abx_atc2) - -abx2$ab[is.na(abx2$ab)] <- toupper(abbreviate( - gsub( - "[/0-9-]", - " ", - abx2$name[is.na(abx2$ab)] - ), - minlength = 3, - method = "left.kept", - strict = TRUE -)) - -n_distinct(abx2$ab) - -abx2 <- abx2 %>% arrange(ab) -seqnr <- 0 -# add follow up nrs -for (i in 2:nrow(abx2)) { - if (abx2[i, "ab", drop = TRUE] == abx2[i - 1, "ab", drop = TRUE]) { - seqnr <- seqnr + 1 - abx2[i, "seqnr"] <- seqnr - } else { - seqnr <- 0 - } -} -for (i in 2:nrow(abx2)) { - if (!is.na(abx2[i, "seqnr"])) { - abx2[i, "ab"] <- paste0(abx2[i, "ab", drop = TRUE], abx2[i, "seqnr", drop = TRUE]) - } -} -abx2 <- abx2 %>% - select(-seqnr) %>% - arrange(name) - -# everything unique?? -nrow(abx2) == n_distinct(abx2$ab) - -# get ATC properties -abx2 <- abx2 %>% - left_join(ab_old %>% - select( - atc, abbr, atc_group1, atc_group2, - oral_ddd, oral_units, iv_ddd, iv_units - )) - -abx2$abbr <- lapply(as.list(abx2$abbr), function(x) unlist(strsplit(x, "|", fixed = TRUE))) - -# Update Compound IDs and Synonyms ---- - -# vector with official names, returns vector with CIDs -get_CID <- function(ab) { - CID <- rep(NA_integer_, length(ab)) - p <- AMR:::progress_ticker(n = length(ab), min_time = 0) - for (i in 1:length(ab)) { - p$tick() - - CID[i] <- tryCatch( - data.table::fread( - paste0( - "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/", - URLencode(ab[i], reserved = TRUE), - "/cids/TXT?name_type=complete" - ), - showProgress = FALSE - )[[1]][1], - error = function(e) NA_integer_ - ) - if (is.na(CID[i])) { - # try with removing the text in brackets - CID[i] <- tryCatch( - data.table::fread( - paste0( - "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/", - URLencode(trimws(gsub("[(].*[)]", "", ab[i])), reserved = TRUE), - "/cids/TXT?name_type=complete" - ), - showProgress = FALSE - )[[1]][1], - error = function(e) NA_integer_ - ) - } - if (is.na(CID[i])) { - # try match on word and take the lowest CID value (sorted) - ab[i] <- gsub("[^a-z0-9]+", " ", ab[i], ignore.case = TRUE) - CID[i] <- tryCatch( - data.table::fread( - paste0( - "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/", - URLencode(ab[i], reserved = TRUE), - "/cids/TXT?name_type=word" - ), - showProgress = FALSE - )[[1]][1], - error = function(e) NA_integer_ - ) - } - Sys.sleep(0.1) - } - CID -} - -# get CIDs (4-5 min) -CIDs <- get_CID(antibiotics$name) -# take missing from previously found CIDs -CIDs[is.na(CIDs) & !is.na(antibiotics$cid)] <- antibiotics$cid[is.na(CIDs) & !is.na(antibiotics$cid)] -# These could not be found: -antibiotics[is.na(CIDs), ] %>% View() - -# returns list with synonyms (brand names), with CIDs as names -get_synonyms <- function(CID, clean = TRUE) { - synonyms <- rep(NA_character_, length(CID)) - p <- AMR:::progress_ticker(n = length(CID), min_time = 0) - - for (i in 1:length(CID)) { - p$tick() - - synonyms_txt <- "" - - if (is.na(CID[i])) { - next - } - - # we will now get the closest compounds with a 96% threshold - similar_cids <- tryCatch( - data.table::fread( - paste0( - "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/fastsimilarity_2d/cid/", - CID[i], - "/cids/TXT?Threshold=96&MaxRecords=5" - ), - sep = "\n", - showProgress = FALSE - )[[1]], - error = function(e) NA_character_ - ) - # include the current CID of course - all_cids <- unique(c(CID[i], similar_cids)) - # but leave out all CIDs that we have in our antibiotics dataset to prevent duplication - all_cids <- all_cids[!all_cids %in% antibiotics$cid[!is.na(antibiotics$cid)]] - # for each one, we are getting the synonyms - current_syns <- character(0) - for (j in seq_len(length(all_cids))) { - synonyms_txt <- tryCatch( - data.table::fread( - paste0( - "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/fastidentity/cid/", - all_cids[j], - "/synonyms/TXT" - ), - sep = "\n", - showProgress = FALSE - )[[1]], - error = function(e) NA_character_ - ) - - Sys.sleep(0.05) - - if (clean == TRUE) { - # remove text between brackets - synonyms_txt <- trimws(gsub( - "[(].*[)]", "", - gsub( - "[[].*[]]", "", - gsub( - "[(].*[]]", "", - gsub("[[].*[)]", "", synonyms_txt) - ) - ) - )) - synonyms_txt <- gsub("Co-", "Co", synonyms_txt, fixed = TRUE) - synonyms_txt <- gsub(" ?(mono)?sodium ?", "", ignore.case = TRUE, synonyms_txt) - synonyms_txt <- gsub(" ?(injection|pediatric) ?", "", ignore.case = TRUE, synonyms_txt) - # only length 6 to 20 and no txt with reading marks or numbers and must start with capital letter (= brand) - synonyms_txt <- synonyms_txt[nchar(synonyms_txt) %in% c(5:20) & - !grepl("[-&{},_0-9/:]", synonyms_txt) & - grepl("^[A-Z]", synonyms_txt, ignore.case = FALSE)] - synonyms_txt <- unlist(strsplit(synonyms_txt, ";", fixed = TRUE)) - } - - current_syns <- c(current_syns, synonyms_txt) - } - - current_syns <- unique(trimws(current_syns[tolower(current_syns) %in% unique(tolower(current_syns))])) - synonyms[i] <- list(sort(current_syns)) - } - names(synonyms) <- CID - synonyms -} - -# get brand names from PubChem (3-4 min) -synonyms <- get_synonyms(CIDs) -synonyms.bak <- synonyms -synonyms <- synonyms.bak - -# add existing ones (will be cleaned later) -for (i in seq_len(length(synonyms))) { - old <- unname(unlist(AMR::antibiotics[i, "synonyms", drop = TRUE])) - synonyms[[i]] <- c(unname(synonyms[[i]]), old) -} - -antibiotics$synonyms <- synonyms - -stop("remember to remove co-trimoxazole as synonyms from SMX (Sulfamethoxazole), so it only exists in SXT!") -sulfa <- antibiotics[which(antibiotics$ab == "SMX"), "synonyms", drop = TRUE][[1]] -cotrim <- antibiotics[which(antibiotics$ab == "SXT"), "synonyms", drop = TRUE][[1]] -# 2024-10-06 not the case anymore, no overlapping names: sulfa[sulfa %in% cotrim] -sulfa <- sulfa[!sulfa %in% cotrim] -antibiotics[which(antibiotics$ab == "SMX"), "synonyms"][[1]][[1]] <- sulfa - - -# now go to end of this file - - -# ----- - -# add them to data set -antibiotics <- abx2 %>% - left_join(DRGLST %>% - select(ab = WHON5_CODE, CLASS, SUBCLASS) %>% - distinct(ab, .keep_all = TRUE), by = "ab") %>% - transmute(ab, - atc, - cid = CIDs, - # no capital after a slash: Ampicillin/Sulbactam -> Ampicillin/sulbactam - name = name %>% - gsub("([/-])([A-Z])", "\\1\\L\\2", ., perl = TRUE) %>% - gsub("edta", "EDTA", ., ignore.case = TRUE), - group = case_when( - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "am(ph|f)enicol" ~ "Amphenicols", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "aminoglycoside" ~ "Aminoglycosides", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "carbapenem" | name %like% "(imipenem|meropenem)" ~ "Carbapenems", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "First-generation cephalosporin" ~ "Cephalosporins (1st gen.)", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "Second-generation cephalosporin" ~ "Cephalosporins (2nd gen.)", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "Third-generation cephalosporin" ~ "Cephalosporins (3rd gen.)", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "Fourth-generation cephalosporin" ~ "Cephalosporins (4th gen.)", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "(tuberculosis|mycobacter)" ~ "Antimycobacterials", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "cephalosporin" ~ "Cephalosporins", - name %like% "^Ce" & is.na(atc_group1) & paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "beta-?lactam" ~ "Cephalosporins", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "(beta-?lactam|penicillin)" ~ "Beta-lactams/penicillins", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "quinolone" ~ "Quinolones", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "glycopeptide" ~ "Glycopeptides", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "macrolide" ~ "Macrolides/lincosamides", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "tetracycline" ~ "Tetracyclines", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "trimethoprim" ~ "Trimethoprims", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "polymyxin" ~ "Polymyxins", - paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "(fungal|mycot)" ~ "Antifungals/antimycotics", - TRUE ~ "Other antibacterials" - ), - atc_group1, atc_group2, - abbreviations = unname(abbr), - synonyms = unname(synonyms), - oral_ddd, oral_units, - iv_ddd, iv_units - ) %>% - as.data.frame(stringsAsFactors = FALSE) - -# some exceptions -antibiotics[which(antibiotics$ab == "DOX"), "abbreviations"][[1]] <- list(c("dox", "doxy")) -antibiotics[which(antibiotics$ab == "FLC"), "abbreviations"][[1]] <- list(c("clox")) -antibiotics[which(antibiotics$ab == "CEC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CEC"), "abbreviations"][[1]], "CFC")) # cefaclor old WHONET4 code -antibiotics[which(antibiotics$ab == "AMX"), "synonyms"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "AMX"), "synonyms"][[1]], "Amoxy"))) -# 'Polymixin B' (POL) and 'Polymyxin B' (PLB) both exist, so: -antibiotics[which(antibiotics$ab == "PLB"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PLB"), "abbreviations"][[1]], "POL", "Polymixin", "Polymixin B", "Poly B")) -antibiotics <- filter(antibiotics, ab != "POL") -# 'Latamoxef' (LTM) and 'Moxalactam (Latamoxef)' (MOX) both exist, so: -antibiotics[which(antibiotics$ab == "LTM"), "abbreviations"][[1]] <- list(c("MOX", "moxa")) -antibiotics <- filter(antibiotics, ab != "MOX") -# RFP and RFP1 (the J0 one) both mean 'rifapentine', although 'rifp' is not recognised, so: -antibiotics <- filter(antibiotics, ab != "RFP") -antibiotics[which(antibiotics$ab == "RFP1"), "ab"] <- "RFP" -antibiotics[which(antibiotics$ab == "RFP"), "abbreviations"][[1]] <- list(c("rifp")) -# Rifampicin is better known as a drug than Rifampin (Rifampin is still listed as a brand name), so: -antibiotics[which(antibiotics$ab == "RIF"), "name"] <- "Rifampicin" -# PME and PVM1 (the J0 one) both mean 'Pivmecillinam', so: -antibiotics <- filter(antibiotics, ab != "PME") -antibiotics[which(antibiotics$ab == "PVM1"), "ab"] <- "PME" -# Remove Sinecatechins -antibiotics <- filter(antibiotics, ab != "SNC") -# GLIMS codes -antibiotics[which(antibiotics$ab == as.ab("cefuroxim")), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == as.ab("cefuroxim")), "abbreviations"][[1]], "cfrx")) -antibiotics[which(antibiotics$ab == as.ab("cefotaxim")), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == as.ab("cefotaxim")), "abbreviations"][[1]], "cftx")) -antibiotics[which(antibiotics$ab == as.ab("ceftazidime")), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == as.ab("ceftazidime")), "abbreviations"][[1]], "cftz")) -antibiotics[which(antibiotics$ab == as.ab("cefepime")), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == as.ab("cefepime")), "abbreviations"][[1]], "cfpi")) -antibiotics[which(antibiotics$ab == as.ab("cefoxitin")), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == as.ab("cefoxitin")), "abbreviations"][[1]], "cfxt")) -# Add cefoxitin screening -class(antibiotics$ab) <- "character" -antibiotics <- rbind(antibiotics, data.frame( - ab = "FOX1", atc = NA, cid = NA, - name = "Cefoxitin screening", - group = "Cephalosporins (2nd gen.)", atc_group1 = NA, atc_group2 = NA, - abbreviations = "cfsc", synonyms = NA, - oral_ddd = NA, oral_units = NA, iv_ddd = NA, iv_units = NA, - loinc = NA, - stringsAsFactors = FALSE -)) -# More GLIMS codes -antibiotics[which(antibiotics$ab == "AMB"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "AMB"), "abbreviations"][[1]], "amf")) -antibiotics[which(antibiotics$ab == "CAZ"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CAZ"), "abbreviations"][[1]], "cftz")) -antibiotics[which(antibiotics$ab == "COL"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "COL"), "abbreviations"][[1]], "cst")) -antibiotics[which(antibiotics$ab == "CRO"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CRO"), "abbreviations"][[1]], "cftr")) -antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]], "cftx")) -antibiotics[which(antibiotics$ab == "CXM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CXM"), "abbreviations"][[1]], "cfrx")) -antibiotics[which(antibiotics$ab == "CZO"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CZO"), "abbreviations"][[1]], "cfzl")) -antibiotics[which(antibiotics$ab == "FCT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FCT"), "abbreviations"][[1]], "fcu")) -antibiotics[which(antibiotics$ab == "FCT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FCT"), "abbreviations"][[1]], "fluy")) -antibiotics[which(antibiotics$ab == "FLU"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FLU"), "abbreviations"][[1]], "flz")) -antibiotics[which(antibiotics$ab == "FOS"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FOS"), "abbreviations"][[1]], "fof")) -antibiotics[which(antibiotics$ab == "FOX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FOX"), "abbreviations"][[1]], "cfxt")) -antibiotics[which(antibiotics$ab == "FUS"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FUS"), "abbreviations"][[1]], "fa")) -antibiotics[which(antibiotics$ab == "GEH"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "GEH"), "abbreviations"][[1]], "g_h")) -antibiotics[which(antibiotics$ab == "KAH"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "KAH"), "abbreviations"][[1]], "k_h")) -antibiotics[which(antibiotics$ab == "KET"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "KET"), "abbreviations"][[1]], "ktc")) -antibiotics[which(antibiotics$ab == "PIP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PIP"), "abbreviations"][[1]], "pipc")) -antibiotics[which(antibiotics$ab == "PIP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PIP"), "abbreviations"][[1]], "PIPC")) -antibiotics[which(antibiotics$ab == "SPX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SPX"), "abbreviations"][[1]], "spa")) -antibiotics[which(antibiotics$ab == "STH"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "STH"), "abbreviations"][[1]], "s_h")) -antibiotics[which(antibiotics$ab == "STR1"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "STR1"), "abbreviations"][[1]], "stm")) -antibiotics[which(antibiotics$ab == "SXT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SXT"), "abbreviations"][[1]], "COTRIM")) -antibiotics[which(antibiotics$ab == "SXT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SXT"), "abbreviations"][[1]], "trsx")) -antibiotics[which(antibiotics$ab == "TGC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TGC"), "abbreviations"][[1]], "tig")) -antibiotics[which(antibiotics$ab == "TMP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TMP"), "abbreviations"][[1]], "tri")) -antibiotics[which(antibiotics$ab == "TZP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TZP"), "abbreviations"][[1]], "PIPTAZ")) -antibiotics[which(antibiotics$ab == "TZP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TZP"), "abbreviations"][[1]], "pit")) -antibiotics[which(antibiotics$ab == "TZP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TZP"), "abbreviations"][[1]], "pita")) -antibiotics[which(antibiotics$ab == "VOR"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "VOR"), "abbreviations"][[1]], "vrc")) - -# official RIVM codes (Dutch National Health Institute) -# https://www.rivm.nl/sites/default/files/2019-09/Bijlage_4_Lijst_antibiotica%202020%201.0.pdf -antibiotics[which(antibiotics$ab == "FCT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FCT"), "abbreviations"][[1]], "5flc")) -antibiotics[which(antibiotics$ab == "AMC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "AMC"), "abbreviations"][[1]], "amcl")) -antibiotics[which(antibiotics$ab == "AMB"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "AMB"), "abbreviations"][[1]], "amfb")) -antibiotics[which(antibiotics$ab == "AMH"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "AMH"), "abbreviations"][[1]], "amhl")) -antibiotics[which(antibiotics$ab == "AMK"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "AMK"), "abbreviations"][[1]], "amik")) -antibiotics[which(antibiotics$ab == "AMX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "AMX"), "abbreviations"][[1]], "amox")) -antibiotics[which(antibiotics$ab == "AMP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "AMP"), "abbreviations"][[1]], "ampi")) -antibiotics[which(antibiotics$ab == "SAM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SAM"), "abbreviations"][[1]], "amsu")) -antibiotics[which(antibiotics$ab == "ANI"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "ANI"), "abbreviations"][[1]], "anid")) -antibiotics[which(antibiotics$ab == "SAM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SAM"), "abbreviations"][[1]], "apsu")) -antibiotics[which(antibiotics$ab == "AZM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "AZM"), "abbreviations"][[1]], "azit")) -antibiotics[which(antibiotics$ab == "AZL"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "AZL"), "abbreviations"][[1]], "azlo")) -antibiotics[which(antibiotics$ab == "ATM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "ATM"), "abbreviations"][[1]], "aztr")) -antibiotics[which(antibiotics$ab == "PNV"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PNV"), "abbreviations"][[1]], "bepe")) -antibiotics[which(antibiotics$ab == "CAP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CAP"), "abbreviations"][[1]], "capr")) -antibiotics[which(antibiotics$ab == "CRB"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CRB"), "abbreviations"][[1]], "carb")) -antibiotics[which(antibiotics$ab == "CAS"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CAS"), "abbreviations"][[1]], "casp")) -antibiotics[which(antibiotics$ab == "CDC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CDC"), "abbreviations"][[1]], "cecl")) -antibiotics[which(antibiotics$ab == "CXA"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CXA"), "abbreviations"][[1]], "cfax")) -antibiotics[which(antibiotics$ab == "CTB"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CTB"), "abbreviations"][[1]], "cfbu")) -antibiotics[which(antibiotics$ab == "CEC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CEC"), "abbreviations"][[1]], "cfcl")) -antibiotics[which(antibiotics$ab == "CFR"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CFR"), "abbreviations"][[1]], "cfdx")) -antibiotics[which(antibiotics$ab == "CEP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CEP"), "abbreviations"][[1]], "cflt")) -antibiotics[which(antibiotics$ab == "LEX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "LEX"), "abbreviations"][[1]], "cflx")) -antibiotics[which(antibiotics$ab == "MAN"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "MAN"), "abbreviations"][[1]], "cfmn")) -antibiotics[which(antibiotics$ab == "CPD"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CPD"), "abbreviations"][[1]], "cfpd")) -antibiotics[which(antibiotics$ab == "FEP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FEP"), "abbreviations"][[1]], "cfpi")) -antibiotics[which(antibiotics$ab == "CPO"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CPO"), "abbreviations"][[1]], "cfpr")) -antibiotics[which(antibiotics$ab == "CFP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CFP"), "abbreviations"][[1]], "cfpz")) -antibiotics[which(antibiotics$ab == "CED"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CED"), "abbreviations"][[1]], "cfrd")) -antibiotics[which(antibiotics$ab == "CPT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CPT"), "abbreviations"][[1]], "cfro")) -antibiotics[which(antibiotics$ab == "CXM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CXM"), "abbreviations"][[1]], "cfrx")) -antibiotics[which(antibiotics$ab == "CFS"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CFS"), "abbreviations"][[1]], "cfsl")) -antibiotics[which(antibiotics$ab == "CRO"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CRO"), "abbreviations"][[1]], "cftr")) -antibiotics[which(antibiotics$ab == "CTT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CTT"), "abbreviations"][[1]], "cftt")) -antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]], "cftx")) -antibiotics[which(antibiotics$ab == "CAZ"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CAZ"), "abbreviations"][[1]], "cftz")) -antibiotics[which(antibiotics$ab == "CFM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CFM"), "abbreviations"][[1]], "cfxm")) -antibiotics[which(antibiotics$ab == "FOX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FOX"), "abbreviations"][[1]], "cfxt")) -antibiotics[which(antibiotics$ab == "CZA"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CZA"), "abbreviations"][[1]], "cfav")) -antibiotics[which(antibiotics$ab == "CZO"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CZO"), "abbreviations"][[1]], "cfzl")) -antibiotics[which(antibiotics$ab == "CZX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CZX"), "abbreviations"][[1]], "cfzx")) -antibiotics[which(antibiotics$ab == "CHL"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CHL"), "abbreviations"][[1]], "chlo")) -antibiotics[which(antibiotics$ab == "CPC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CPC"), "abbreviations"][[1]], "cicl")) -antibiotics[which(antibiotics$ab == "CIN"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CIN"), "abbreviations"][[1]], "cino")) -antibiotics[which(antibiotics$ab == "CIP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CIP"), "abbreviations"][[1]], "cipr")) -antibiotics[which(antibiotics$ab == "CIX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CIX"), "abbreviations"][[1]], "cipx")) -antibiotics[which(antibiotics$ab == "CLR"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CLR"), "abbreviations"][[1]], "clar")) -antibiotics[which(antibiotics$ab == "CLI"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CLI"), "abbreviations"][[1]], "clin")) -antibiotics[which(antibiotics$ab == "CTR"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CTR"), "abbreviations"][[1]], "clot")) -antibiotics[which(antibiotics$ab == "CLO"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CLO"), "abbreviations"][[1]], "clox")) -antibiotics[which(antibiotics$ab == "COL"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "COL"), "abbreviations"][[1]], "coli")) -antibiotics[which(antibiotics$ab == "CTC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CTC"), "abbreviations"][[1]], "cxcl")) -antibiotics[which(antibiotics$ab == "CYC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CYC"), "abbreviations"][[1]], "cycl")) -antibiotics[which(antibiotics$ab == "CCV"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CCV"), "abbreviations"][[1]], "czcl")) -antibiotics[which(antibiotics$ab == "DAP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "DAP"), "abbreviations"][[1]], "dapt")) -antibiotics[which(antibiotics$ab == "DIC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "DIC"), "abbreviations"][[1]], "dicl")) -antibiotics[which(antibiotics$ab == "DOR"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "DOR"), "abbreviations"][[1]], "dori")) -antibiotics[which(antibiotics$ab == "DOX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "DOX"), "abbreviations"][[1]], "doxy")) -antibiotics[which(antibiotics$ab == "ENX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "ENX"), "abbreviations"][[1]], "enox")) -antibiotics[which(antibiotics$ab == "ETP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "ETP"), "abbreviations"][[1]], "erta")) -antibiotics[which(antibiotics$ab == "ERY"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "ERY"), "abbreviations"][[1]], "eryt")) -antibiotics[which(antibiotics$ab == "PHE"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PHE"), "abbreviations"][[1]], "fene")) -antibiotics[which(antibiotics$ab == "PHN"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PHN"), "abbreviations"][[1]], "fepe")) -antibiotics[which(antibiotics$ab == "FLE"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FLE"), "abbreviations"][[1]], "fler")) -antibiotics[which(antibiotics$ab == "FLU"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FLU"), "abbreviations"][[1]], "fluc")) -antibiotics[which(antibiotics$ab == "FLC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FLC"), "abbreviations"][[1]], "flux")) -antibiotics[which(antibiotics$ab == "FOS"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FOS"), "abbreviations"][[1]], "fosf")) -antibiotics[which(antibiotics$ab == "FRM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FRM"), "abbreviations"][[1]], "fram")) -antibiotics[which(antibiotics$ab == "FUS"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FUS"), "abbreviations"][[1]], "fusi")) -antibiotics[which(antibiotics$ab == "GAT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "GAT"), "abbreviations"][[1]], "gati")) -antibiotics[which(antibiotics$ab == "GEH"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "GEH"), "abbreviations"][[1]], "gehl")) -antibiotics[which(antibiotics$ab == "GEN"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "GEN"), "abbreviations"][[1]], "gent")) -antibiotics[which(antibiotics$ab == "GRX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "GRX"), "abbreviations"][[1]], "grep")) -antibiotics[which(antibiotics$ab == "IPM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "IPM"), "abbreviations"][[1]], "imci")) -antibiotics[which(antibiotics$ab == "IPM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "IPM"), "abbreviations"][[1]], "imip")) -antibiotics[which(antibiotics$ab == "ISV"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "ISV"), "abbreviations"][[1]], "isav")) -antibiotics[which(antibiotics$ab == "ITR"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "ITR"), "abbreviations"][[1]], "itra")) -antibiotics[which(antibiotics$ab == "KAH"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "KAH"), "abbreviations"][[1]], "kahl")) -antibiotics[which(antibiotics$ab == "KAN"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "KAN"), "abbreviations"][[1]], "kana")) -antibiotics[which(antibiotics$ab == "KET"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "KET"), "abbreviations"][[1]], "keto")) -antibiotics[which(antibiotics$ab == "LVX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "LVX"), "abbreviations"][[1]], "levo")) -antibiotics[which(antibiotics$ab == "LIN"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "LIN"), "abbreviations"][[1]], "linc")) -antibiotics[which(antibiotics$ab == "LNZ"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "LNZ"), "abbreviations"][[1]], "line")) -antibiotics[which(antibiotics$ab == "LOR"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "LOR"), "abbreviations"][[1]], "lora")) -antibiotics[which(antibiotics$ab == "MEM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "MEM"), "abbreviations"][[1]], "mero")) -antibiotics[which(antibiotics$ab == "MET"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "MET"), "abbreviations"][[1]], "meti")) -antibiotics[which(antibiotics$ab == "MTR"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "MTR"), "abbreviations"][[1]], "metr")) -antibiotics[which(antibiotics$ab == "MEZ"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "MEZ"), "abbreviations"][[1]], "mezl")) -antibiotics[which(antibiotics$ab == "MIF"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "MIF"), "abbreviations"][[1]], "mica")) -antibiotics[which(antibiotics$ab == "MCZ"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "MCZ"), "abbreviations"][[1]], "mico")) -antibiotics[which(antibiotics$ab == "MNO"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "MNO"), "abbreviations"][[1]], "mino")) -antibiotics[which(antibiotics$ab == "LTM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "LTM"), "abbreviations"][[1]], "moxa", "moxalactam")) -antibiotics[which(antibiotics$ab == "MFX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "MFX"), "abbreviations"][[1]], "moxi")) -antibiotics[which(antibiotics$ab == "NAL"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "NAL"), "abbreviations"][[1]], "nali")) -antibiotics[which(antibiotics$ab == "NEO"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "NEO"), "abbreviations"][[1]], "neom")) -antibiotics[which(antibiotics$ab == "NET"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "NET"), "abbreviations"][[1]], "neti")) -antibiotics[which(antibiotics$ab == "NIT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "NIT"), "abbreviations"][[1]], "nitr")) -antibiotics[which(antibiotics$ab == "NOR"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "NOR"), "abbreviations"][[1]], "norf")) -antibiotics[which(antibiotics$ab == "NYS"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "NYS"), "abbreviations"][[1]], "nyst")) -antibiotics[which(antibiotics$ab == "OFX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "OFX"), "abbreviations"][[1]], "oflo")) -antibiotics[which(antibiotics$ab == "OXA"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "OXA"), "abbreviations"][[1]], "oxal")) -antibiotics[which(antibiotics$ab == "PEF"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PEF"), "abbreviations"][[1]], "pefl")) -antibiotics[which(antibiotics$ab == "PEN"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PEN"), "abbreviations"][[1]], "peni")) -antibiotics[which(antibiotics$ab == "PIP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PIP"), "abbreviations"][[1]], "pipc")) -antibiotics[which(antibiotics$ab == "PPA"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PPA"), "abbreviations"][[1]], "pipz")) -antibiotics[which(antibiotics$ab == "TZP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TZP"), "abbreviations"][[1]], "pita")) -antibiotics[which(antibiotics$ab == "PLB"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PLB"), "abbreviations"][[1]], "polb")) -antibiotics[which(antibiotics$ab == "POS"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "POS"), "abbreviations"][[1]], "posa")) -antibiotics[which(antibiotics$ab == "PRI"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "PRI"), "abbreviations"][[1]], "pris")) -antibiotics[which(antibiotics$ab == "QDA"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "QDA"), "abbreviations"][[1]], "quda")) -antibiotics[which(antibiotics$ab == "RIF"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "RIF"), "abbreviations"][[1]], "rifa")) -antibiotics[which(antibiotics$ab == "RXT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "RXT"), "abbreviations"][[1]], "roxi")) -antibiotics[which(antibiotics$ab == "SMX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SMX"), "abbreviations"][[1]], "sfmx")) -antibiotics[which(antibiotics$ab == "SLF4"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SLF4"), "abbreviations"][[1]], "sfmz")) -antibiotics[which(antibiotics$ab == "SSS"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SSS"), "abbreviations"][[1]], "sfna")) -antibiotics[which(antibiotics$ab == "SLF"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SLF"), "abbreviations"][[1]], "sfsz")) -antibiotics[which(antibiotics$ab == "SPX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SPX"), "abbreviations"][[1]], "spar")) -antibiotics[which(antibiotics$ab == "SPT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SPT"), "abbreviations"][[1]], "spec")) -antibiotics[which(antibiotics$ab == "SPI"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SPI"), "abbreviations"][[1]], "spir")) -antibiotics[which(antibiotics$ab == "STH"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "STH"), "abbreviations"][[1]], "sthl")) -antibiotics[which(antibiotics$ab == "STR1"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "STR1"), "abbreviations"][[1]], "stre")) -antibiotics[which(antibiotics$ab == "TAZ"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TAZ"), "abbreviations"][[1]], "tazo")) -antibiotics[which(antibiotics$ab == "TEC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TEC"), "abbreviations"][[1]], "teic")) -antibiotics[which(antibiotics$ab == "TLT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TLT"), "abbreviations"][[1]], "teli")) -antibiotics[which(antibiotics$ab == "TMX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TMX"), "abbreviations"][[1]], "tema")) -antibiotics[which(antibiotics$ab == "TEM"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TEM"), "abbreviations"][[1]], "temo")) -antibiotics[which(antibiotics$ab == "TRB"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TRB"), "abbreviations"][[1]], "terb")) -antibiotics[which(antibiotics$ab == "TCY"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TCY"), "abbreviations"][[1]], "tetr")) -antibiotics[which(antibiotics$ab == "TIC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TIC"), "abbreviations"][[1]], "tica")) -antibiotics[which(antibiotics$ab == "TCC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TCC"), "abbreviations"][[1]], "ticl")) -antibiotics[which(antibiotics$ab == "TGC"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TGC"), "abbreviations"][[1]], "tige")) -antibiotics[which(antibiotics$ab == "TIN"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TIN"), "abbreviations"][[1]], "tini")) -antibiotics[which(antibiotics$ab == "TOB"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TOB"), "abbreviations"][[1]], "tobr")) -antibiotics[which(antibiotics$ab == "TOH"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TOH"), "abbreviations"][[1]], "tohl")) -antibiotics[which(antibiotics$ab == "TMP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TMP"), "abbreviations"][[1]], "trim")) -antibiotics[which(antibiotics$ab == "TVA"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "TVA"), "abbreviations"][[1]], "trov")) -antibiotics[which(antibiotics$ab == "SLT4"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SLT4"), "abbreviations"][[1]], "trsm")) -antibiotics[which(antibiotics$ab == "SXT"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "SXT"), "abbreviations"][[1]], "trsx")) -antibiotics[which(antibiotics$ab == "VAN"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "VAN"), "abbreviations"][[1]], "vanc")) -antibiotics[which(antibiotics$ab == "VOR"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "VOR"), "abbreviations"][[1]], "vori")) - -antibiotics[which(antibiotics$ab == "FOS"), "synonyms"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "FOS"), "synonyms"][[1]], "Monuril"))) -antibiotics[which(antibiotics$ab == "FOS"), "synonyms"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "FOS"), "synonyms"][[1]], "Monurol"))) - -antibiotics[which(antibiotics$ab == "TZP"), "abbreviations"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "TZP"), "abbreviations"][[1]], "piptazo"))) - -antibiotics[which(antibiotics$ab == "RFP"), "abbreviations"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "RFP"), "abbreviations"][[1]], "RPT"))) -antibiotics[which(antibiotics$ab == "RTP"), "abbreviations"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "RTP"), "abbreviations"][[1]], "RET"))) -antibiotics[which(antibiotics$ab == "TYL1"), "abbreviations"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "TYL1"), "abbreviations"][[1]], "TVN"))) - -antibiotics <- antibiotics %>% - mutate(ab = as.character(ab)) %>% - rbind(antibiotics %>% - filter(ab == "GEH") %>% - mutate( - ab = "AMH", - name = "Amphotericin B-high", - abbreviations = list(c("amhl", "amfo b high", "ampho b high", "amphotericin high")) - )) %>% - rbind(antibiotics %>% - filter(ab == "GEH") %>% - mutate( - ab = "TOH", - name = "Tobramycin-high", - abbreviations = list(c("tohl", "tobra high", "tobramycin high")) - )) %>% - rbind(antibiotics %>% - filter(ab == "BUT") %>% - mutate( - ab = "CIX", - atc = "D01AE14", - name = "Ciclopirox", - group = "Antifungals/antimycotics", - atc_group1 = "Antifungals for topical use", - atc_group2 = "Other antifungals for topical use", - abbreviations = list(c("cipx")) - )) -antibiotics[which(antibiotics$ab == "SSS"), "name"] <- "Sulfonamide" -# ESBL E-test codes: -antibiotics[which(antibiotics$ab == "CCV"), "abbreviations"][[1]] <- list(c("xtzl")) -antibiotics[which(antibiotics$ab == "CAZ"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CAZ"), "abbreviations"][[1]], "xtz", "cefta")) -antibiotics[which(antibiotics$ab == "CPC"), "abbreviations"][[1]] <- list(c("xpml")) -antibiotics[which(antibiotics$ab == "FEP"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "FEP"), "abbreviations"][[1]], "xpm")) -antibiotics[which(antibiotics$ab == "CTC"), "abbreviations"][[1]] <- list(c("xctl")) -antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CTX"), "abbreviations"][[1]], "xct")) -# High level Gentamcin and Streptomycin -antibiotics[which(antibiotics$ab == "GEH"), "abbreviations"][[1]] <- list(c("gehl", "gentamicin high", "genta high", "gehi")) -antibiotics[which(antibiotics$ab == "STH"), "abbreviations"][[1]] <- list(c("sthl", "streptomycin high", "strepto high", "sthi")) -# add imi and "imipenem/cilastatine" to imipenem -antibiotics[which(antibiotics$ab == "IPM"), "abbreviations"][[1]] <- list(c("imip", "imi", "imp")) -antibiotics[which(antibiotics$ab == "IPM"), "synonyms"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "IPM"), "synonyms"][[1]], "imipenem/cilastatin"))) -# add synonyms of ones not found -antibiotics[which(antibiotics$ab == "TZP"), "synonyms"][[1]] <- list(sort(c(antibiotics[which(antibiotics$ab == "TZP"), "synonyms"][[1]], "Tazocel", "tazocillin", "Tazocin", "Zosyn"))) -antibiotics[which(antibiotics$ab == "COL"), "synonyms"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "COL"), "synonyms"][[1]], "Colisticin", "Polymyxin E", "Colimycin", "Coly-Mycin", "Totazina", "Colistimethate", "Promixin", "Colistimethate Sodium")))) -# remove incorrect synonyms from rifampicin (RIF) and add them to the combination rifampicin/isoniazid (RFI) -old_sym <- antibiotics[which(antibiotics$ab == "RIF"), "synonyms"][[1]] -old_sym <- old_sym[!old_sym %in% c("Rifinah", "Rimactazid")] -antibiotics[which(antibiotics$ab == "RIF"), "synonyms"][[1]] <- list(old_sym) -antibiotics[which(antibiotics$ab == "RFI"), "synonyms"][[1]] <- list(sort(c("Rifinah", "Rimactazid"))) -# remove incorrect synonyms from sulfamethoxazole (SMX) and add them to the combination trimethoprim/sulfamethoxazole (SXT) -old_sym <- antibiotics[which(antibiotics$ab == "SMX"), "synonyms"][[1]] -old_sym <- old_sym[!old_sym %in% c("Cotrimoxazole", "Bactrimel")] -antibiotics[which(antibiotics$ab == "SMX"), "synonyms"][[1]] <- list(old_sym) -antibiotics[which(antibiotics$ab == "SXT"), "synonyms"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "COL"), "synonyms"][[1]], "Cotrimoxazole", "Bactrimel", "Septra", "Bactrim", "Cotrimazole")))) - -# Fix penicillins -antibiotics[which(antibiotics$ab == "PEN"), "abbreviations"][[1]] <- list(c("bepe", "pg", "pen", "peni", "peni g", "penicillin", "penicillin g")) -antibiotics[which(antibiotics$ab == "PEN"), "name"] <- "Benzylpenicillin" -antibiotics[which(antibiotics$ab == "PHN"), "abbreviations"][[1]] <- list(c("fepe", "peni v", "pv", "penicillin v", "PNV")) -antibiotics <- subset(antibiotics, antibiotics$ab != "PNV") - -# New DDDs -antibiotics[which(antibiotics$ab == "PEN"), "iv_ddd"] <- 3.6 -antibiotics[which(antibiotics$ab == "PEN"), "iv_units"] <- "g" - -## new ATC codes -# ceftaroline -antibiotics[which(antibiotics$ab == "CPT"), "atc"] <- "J01DI02" -# faropenem -antibiotics[which(antibiotics$ab == "FAR"), "atc"] <- "J01DI03" -# ceftobiprole -antibiotics[which(antibiotics$ab == "BPR"), "atc"] <- "J01DI01" -# ceftazidime / avibactam -antibiotics[which(antibiotics$ab == "CZA"), "atc"] <- "J01DD52" -antibiotics[which(antibiotics$ab == "CZA"), "cid"] <- 90643431 -antibiotics[which(antibiotics$ab == "CZA"), "atc_group1"] <- "Other beta-lactam antibacterials" -antibiotics[which(antibiotics$ab == "CZA"), "atc_group2"] <- "Third-generation cephalosporins" -antibiotics[which(antibiotics$ab == "CZA"), "iv_ddd"] <- 6 -antibiotics[which(antibiotics$ab == "CZA"), "iv_units"] <- "g" -antibiotics[which(antibiotics$ab == "CZA"), "synonyms"] <- list(c("Avycaz", "Zavicefta")) - -# typo -antibiotics[which(antibiotics$ab == "RXT"), "name"] <- "Roxithromycin" -antibiotics[which(antibiotics$ab == "PEN"), "atc"] <- "J01CE01" - -# WHONET cleanup -antibiotics[which(antibiotics$ab == "BCZ"), "name"] <- "Bicyclomycin" -antibiotics[which(antibiotics$ab == "CCL"), "name"] <- "Cefetecol" -antibiotics[which(antibiotics$ab == "ENV"), "name"] <- "Enviomycin" -antibiotics[which(antibiotics$ab == "KIT"), "name"] <- "Kitasamycin" -antibiotics[which(antibiotics$ab == "LSP"), "name"] <- "Linco-spectin" -antibiotics[which(antibiotics$ab == "MEC"), "name"] <- "Mecillinam" -antibiotics[which(antibiotics$ab == "PMR"), "name"] <- "Pimaricin" -antibiotics[which(antibiotics$ab == "BCZ"), "abbreviations"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "BCZ"), "abbreviations"][[1]], "Bicozamycin")))) -antibiotics[which(antibiotics$ab == "CCL"), "abbreviations"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "CCL"), "abbreviations"][[1]], "Cefcatacol")))) -antibiotics[which(antibiotics$ab == "ENV"), "abbreviations"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "ENV"), "abbreviations"][[1]], "Tuberactinomycin")))) -antibiotics[which(antibiotics$ab == "KIT"), "abbreviations"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "KIT"), "abbreviations"][[1]], "Leucomycin")))) -antibiotics[which(antibiotics$ab == "LSP"), "abbreviations"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "LSP"), "abbreviations"][[1]], "lincomycin/spectinomycin")))) -antibiotics[which(antibiotics$ab == "MEC"), "abbreviations"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "MEC"), "abbreviations"][[1]], "Amdinocillin")))) -antibiotics[which(antibiotics$ab == "PMR"), "abbreviations"][[1]] <- list(sort(unique(c(antibiotics[which(antibiotics$ab == "PMR"), "abbreviations"][[1]], "Natamycin")))) - - -# set cephalosporins groups for the ones that could not be determined automatically: -antibiotics <- antibiotics %>% - mutate(group = case_when( - name == "Cefcapene" ~ "Cephalosporins (3rd gen.)", - name == "Cefcapene pivoxil" ~ "Cephalosporins (3rd gen.)", - name == "Cefditoren pivoxil" ~ "Cephalosporins (3rd gen.)", - name == "Cefepime/clavulanic acid" ~ "Cephalosporins (4th gen.)", - name == "Cefepime/tazobactam" ~ "Cephalosporins (4th gen.)", - name == "Cefetamet pivoxil" ~ "Cephalosporins (3rd gen.)", - name == "Cefetecol (Cefcatacol)" ~ "Cephalosporins (4th gen.)", - name == "Cefetrizole" ~ "Cephalosporins (unclassified gen.)", - name == "Cefoselis" ~ "Cephalosporins (4th gen.)", - name == "Cefotaxime/clavulanic acid" ~ "Cephalosporins (3rd gen.)", - name == "Cefotaxime/sulbactam" ~ "Cephalosporins (3rd gen.)", - name == "Cefotiam hexetil" ~ "Cephalosporins (3rd gen.)", - name == "Cefovecin" ~ "Cephalosporins (3rd gen.)", - name == "Cefozopran" ~ "Cephalosporins (4th gen.)", - name == "Cefpimizole" ~ "Cephalosporins (3rd gen.)", - name == "Cefpodoxime proxetil" ~ "Cephalosporins (3rd gen.)", - name == "Cefpodoxime/clavulanic acid" ~ "Cephalosporins (3rd gen.)", - name == "Cefquinome" ~ "Cephalosporins (4th gen.)", - name == "Cefsumide" ~ "Cephalosporins (unclassified gen.)", - name == "Ceftaroline" ~ "Cephalosporins (5th gen.)", - name == "Ceftaroline/avibactam" ~ "Cephalosporins (5th gen.)", - name == "Ceftazidime/avibactam" ~ "Cephalosporins (3rd gen.)", - name == "Cefteram" ~ "Cephalosporins (3rd gen.)", - name == "Cefteram pivoxil" ~ "Cephalosporins (3rd gen.)", - name == "Ceftiofur" ~ "Cephalosporins (3rd gen.)", - name == "Ceftizoxime alapivoxil" ~ "Cephalosporins (3rd gen.)", - name == "Ceftobiprole" ~ "Cephalosporins (5th gen.)", - name == "Ceftobiprole medocaril" ~ "Cephalosporins (5th gen.)", - name == "Ceftolozane/enzyme inhibitor" ~ "Cephalosporins (5th gen.)", - name == "Ceftolozane/tazobactam" ~ "Cephalosporins (5th gen.)", - name == "Cefuroxime axetil" ~ "Cephalosporins (2nd gen.)", - TRUE ~ group - )) -antibiotics[which(antibiotics$ab %in% c("CYC", "LNZ", "THA", "TZD")), "group"] <- "Oxazolidinones" - -# add efflux -effl <- antibiotics |> - filter(ab == "ACM") |> - mutate(ab = as.character("EFF"), - cid = NA_real_, - name = "Efflux", - group = "Other") -antibiotics <- antibiotics |> - mutate(ab = as.character(ab)) |> - bind_rows(effl) -class(antibiotics$ab) <- c("ab", "character") -antibiotics[which(antibiotics$ab == "EFF"), "abbreviations"][[1]] <- list(c("effflux pump")) - - -# add clindamycin inducible screening -clin <- antibiotics |> - filter(ab == "FOX1") |> - mutate(ab = as.character("CLI1"), - name = "Clindamycin inducible screening", - group = "Macrolides/lincosamides") -antibiotics <- antibiotics |> - mutate(ab = as.character(ab)) |> - bind_rows(clin) -class(antibiotics$ab) <- c("ab", "character") -antibiotics[which(antibiotics$ab == "CLI1"), "abbreviations"][[1]] <- list(c("clindamycin inducible", "clinda inducible", "clin inducible")) - -# add pretomanid -antibiotics <- antibiotics %>% - mutate(ab = as.character(ab)) %>% - bind_rows(antibiotics %>% - mutate(ab = as.character(ab)) %>% - filter(ab == "SMF") %>% - mutate( - ab = "PMD", - atc = "J04AK08", - cid = 456199, - name = "Pretomanid", - abbreviations = list(""), - oral_ddd = NA_real_ - )) - - - -# update ATC codes from WHOCC website ------------------------------------- - -# last time checked: 2024-02-22 - -library(rvest) -updated_atc <- as.list(antibiotics$atc) - -get_atcs <- function(ab_name, type = "human") { - if (type == "human") { - url <- "https://atcddd.fhi.no/atc_ddd_index/" - } else if (type == "veterinary") { - url <- "https://atcddd.fhi.no/atcvet/atcvet_index/" - } else { - stop("invalid type") - } - - ab_name <- gsub("/", " and ", tolower(ab_name), fixed = TRUE) - - # we will do a search on their website, which means: - - # go to the url - atc_tbl <- read_html(url) %>% - # get all forms - html_form() %>% - # get the second form (the first form is a global website form) - .[[2]] %>% - # set the name input box to our search parameter - html_form_set(name = ab_name) %>% - # hit Submit - html_form_submit() %>% - # read the resulting page - read_html() %>% - # retrieve the table on it - html_node("table") %>% - # transform it to an R data set - html_table(header = FALSE) - - # and get the ATCs (first column) of only exact hits - unique(as.character(atc_tbl[which(tolower(atc_tbl[, 2, drop = TRUE]) == ab_name), 1, drop = TRUE])) -} - -# this takes around 4 minutes (some are skipped and go faster) -for (i in seq_len(nrow(antibiotics))) { - message(percentage(i / nrow(antibiotics), digits = 1), - " - Downloading ", antibiotics$name[i], - appendLF = FALSE - ) - atcs <- get_atcs(antibiotics$name[i], type = "human") - if (all(is.na(atcs))) { - atcs <- get_atcs(antibiotics$name[i], type = "veterinary") - } - if (length(atcs) > 0) { - updated_atc[[i]] <- atcs - message(" (", length(atcs), " results)") - # let the WHO server rest for a second - they might have a limitation on the queries per second - Sys.sleep(1) - } else { - message(" (skipping)") - } -} - -antibiotics$atc <- updated_atc - -# update DDDs from WHOCC website ------------------------------------------ - -# last time checked: 2024-02-22 -ddd_oral <- rep(NA_real_, nrow(antibiotics)) -ddd_oral_units <- rep(NA_character_, nrow(antibiotics)) -ddd_iv <- rep(NA_real_, nrow(antibiotics)) -ddd_iv_units <- rep(NA_character_, nrow(antibiotics)) -progress <- progress_ticker(nrow(antibiotics)) -for (i in seq_len(nrow(antibiotics))) { - on.exit(close(progress)) - progress$tick() - atcs <- antibiotics$atc[[i]] - if (!all(is.na(atcs))) { - for (j in seq_len(length(atcs))) { - # oral - if (is.na(ddd_oral[i])) { - ddd_oral[i] <- atc_online_ddd(atcs[j], administration = "O") - if (!is.na(ddd_oral[i])) { - ddd_oral_units[i] <- atc_online_ddd_units(atcs[j], administration = "O") - } - } - # parenteral - if (is.na(ddd_iv[i])) { - ddd_iv[i] <- atc_online_ddd(atcs[j], administration = "P") - if (!is.na(ddd_iv[i])) { - ddd_iv_units[i] <- atc_online_ddd_units(atcs[j], administration = "P") - } - } - } - } - if (!is.na(ddd_oral[i]) | !is.na(ddd_iv[i])) { - # let the WHO server rest for 0.25 second - they might have a limitation on the queries per second - Sys.sleep(0.25) - } -} - -antibiotics$oral_ddd <- ddd_oral -antibiotics$oral_units <- ddd_oral_units -antibiotics$iv_ddd <- ddd_iv -antibiotics$iv_units <- ddd_iv_units - -# Wrap up ----------------------------------------------------------------- - -# set as data.frame again -antibiotics <- dataset_UTF8_to_ASCII(as.data.frame(antibiotics, stringsAsFactors = FALSE)) -class(antibiotics$ab) <- c("ab", "character") -antibiotics <- dplyr::arrange(antibiotics, name) - -# REFER TO data-raw/loinc.R FOR ADDING LOINC CODES - -# make all abbreviations and synonyms lower case, unique and alphabetically sorted ---- -for (i in 1:nrow(antibiotics)) { - abb <- as.character(sort(unique(tolower(antibiotics[i, "abbreviations", drop = TRUE][[1]])))) - abb <- abb[abb != "" & abb %unlike% ":"] - syn <- as.character(sort(unique(tolower(unname(unlist(antibiotics[i, "synonyms", drop = TRUE])))))) - syn <- gsub("[^a-z]", "", syn) - syn <- gsub(" +", " ", syn) - pharm_terms <- "(pa?ediatric|injection|oral|inhale|otic|sulfate|sulphate|sodium|base|anhydrous|anhydrate|stearate|syrup|natrium|hydrate|x?hcl|gsalt|vet[.]?)" - syn <- gsub(paste0(" ", pharm_terms, "$"), "", syn) - syn <- gsub(paste0("^", pharm_terms, " "), "", syn) - syn <- trimws(syn) - syn <- gsub(" [a-z]{1,3}$", "", syn, perl = TRUE) - syn <- trimws(syn) - syn <- syn[syn != "" & syn %unlike% ":" & !syn %in% tolower(antibiotics$name)] - syn <- unique(syn) - # special cases - if (antibiotics$ab[i] == "VAN") syn <- syn[syn %unlike% "^tei?ch?o"] - if (antibiotics$ab[i] == "CLR") syn <- syn[syn %unlike% "^ery"] - antibiotics[i, "abbreviations"][[1]] <- ifelse(length(abb) == 0, list(""), list(abb)) - antibiotics[i, "synonyms"][[1]] <- ifelse(length(syn) == 0, list(""), list(syn)) - if ("loinc" %in% colnames(antibiotics)) { - loinc <- as.character(sort(unique(tolower(antibiotics[i, "loinc", drop = TRUE][[1]])))) - loinc <- loinc[loinc != ""] - antibiotics[i, "loinc"][[1]] <- ifelse(length(loinc) == 0, list(""), list(loinc)) - } -} - - -usethis::use_data(antibiotics, overwrite = TRUE, version = 2, compress = "xz") -rm(antibiotics) diff --git a/data-raw/reproduction_of_antimicrobials.R b/data-raw/reproduction_of_antimicrobials.R new file mode 100644 index 000000000..918ee425e --- /dev/null +++ b/data-raw/reproduction_of_antimicrobials.R @@ -0,0 +1,948 @@ +# ==================================================================== # +# TITLE: # +# AMR: An R Package for Working with Antimicrobial Resistance Data # +# # +# SOURCE CODE: # +# https://github.com/msberends/AMR # +# # +# PLEASE CITE THIS SOFTWARE AS: # +# Berends MS, Luz CF, Friedrich AW, et al. (2022). # +# AMR: An R Package for Working with Antimicrobial Resistance Data. # +# Journal of Statistical Software, 104(3), 1-31. # +# https://doi.org/10.18637/jss.v104.i03 # +# # +# Developed at the University of Groningen and the University Medical # +# Center Groningen in The Netherlands, in collaboration with many # +# colleagues from around the world, see our website. # +# # +# This R package is free software; you can freely use and distribute # +# it for both personal and commercial purposes under the terms of the # +# GNU General Public License version 2.0 (GNU GPL-2), as published by # +# the Free Software Foundation. # +# We created this package for both routine data analysis and academic # +# research and it was publicly released in the hope that it will be # +# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. # +# # +# Visit our website for the full manual and a complete tutorial about # +# how to conduct AMR data analysis: https://msberends.github.io/AMR/ # +# ==================================================================== # + +library(dplyr) + +# got EARS-Net codes (= ECDC/WHO codes) from here: + +# Installed WHONET 2019 software on Windows (http://www.whonet.org/software.html), +# opened C:\WHONET\Codes\WHONETCodes.mdb in MS Access +# and exported table 'DRGLST' to MS Excel +library(readxl) +DRGLST <- read_excel("DRGLST.xlsx") +abx <- DRGLST %>% + select( + ab = WHON5_CODE, + name = ANTIBIOTIC + ) %>% + # remove the ones without WHONET code + filter(!is.na(ab)) %>% + distinct(name, .keep_all = TRUE) %>% + # add the ones without WHONET code + bind_rows( + DRGLST %>% + select( + ab = WHON5_CODE, + name = ANTIBIOTIC + ) %>% + filter(is.na(ab)) %>% + distinct(name, .keep_all = TRUE) + # add new ab code later + ) %>% + arrange(name) + +# add old ATC codes +ab_old <- AMR::antimicrobials %>% + mutate( + official = gsub("( and |, )", "/", official), + abbr = tolower(paste(ifelse(is.na(abbr), "", abbr), + ifelse(is.na(certe), "", certe), + ifelse(is.na(umcg), "", umcg), + sep = "|" + )) + ) +for (i in 1:nrow(ab_old)) { + abbr <- ab_old[i, "abbr"] + abbr <- strsplit(abbr, "|", fixed = TRUE) %>% + unlist() %>% + unique() + abbr <- abbr[abbr != ""] + # print(abbr) + if (length(abbr) == 0) { + ab_old[i, "abbr"] <- NA_character_ + } else { + ab_old[i, "abbr"] <- paste(abbr, collapse = "|") + } +} + +# create reference data set: to be able to map ab to atc +abx_atc1 <- abx %>% + mutate(name_lower = tolower(name)) %>% + left_join(ab_old %>% + select(ears_net, atc), by = c(ab = "ears_net")) %>% + rename(atc1 = atc) %>% + left_join(ab_old %>% + mutate(official = gsub(", combinations", "", official, fixed = TRUE)) %>% + transmute(official = tolower(official), atc), by = c(name_lower = "official")) %>% + rename(atc2 = atc) %>% + left_join(ab_old %>% + mutate(official = gsub(", combinations", "", official, fixed = TRUE)) %>% + mutate(official = gsub("f", "ph", official)) %>% + transmute(official = tolower(official), atc), by = c(name_lower = "official")) %>% + rename(atc3 = atc) %>% + left_join(ab_old %>% + mutate(official = gsub(", combinations", "", official, fixed = TRUE)) %>% + mutate(official = gsub("t", "th", official)) %>% + transmute(official = tolower(official), atc), by = c(name_lower = "official")) %>% + rename(atc4 = atc) %>% + left_join(ab_old %>% + mutate(official = gsub(", combinations", "", official, fixed = TRUE)) %>% + mutate(official = gsub("f", "ph", official)) %>% + mutate(official = gsub("t", "th", official)) %>% + transmute(official = tolower(official), atc), by = c(name_lower = "official")) %>% + rename(atc5 = atc) %>% + left_join(ab_old %>% + mutate(official = gsub(", combinations", "", official, fixed = TRUE)) %>% + mutate(official = gsub("f", "ph", official)) %>% + mutate(official = gsub("t", "th", official)) %>% + mutate(official = gsub("ine$", "in", official)) %>% + transmute(official = tolower(official), atc), by = c(name_lower = "official")) %>% + rename(atc6 = atc) %>% + mutate(atc = case_when( + !is.na(atc1) ~ atc1, + !is.na(atc2) ~ atc2, + !is.na(atc3) ~ atc3, + !is.na(atc4) ~ atc4, + !is.na(atc4) ~ atc5, + TRUE ~ atc6 + )) %>% + distinct(ab, name, .keep_all = TRUE) %>% + select(ab, atc, name) + +abx_atc2 <- ab_old %>% + filter( + !atc %in% abx_atc1$atc, + is.na(ears_net), + !is.na(atc_group1), + atc_group1 %unlike% ("virus|vaccin|viral|immun"), + official %unlike% "(combinations| with )" + ) %>% + mutate(ab = NA_character_) %>% + as.data.frame(stringsAsFactors = FALSE) %>% + select(ab, atc, name = official) + +abx2 <- bind_rows(abx_atc1, abx_atc2) + +rm(abx_atc1) +rm(abx_atc2) + +abx2$ab[is.na(abx2$ab)] <- toupper(abbreviate( + gsub( + "[/0-9-]", + " ", + abx2$name[is.na(abx2$ab)] + ), + minlength = 3, + method = "left.kept", + strict = TRUE +)) + +n_distinct(abx2$ab) + +abx2 <- abx2 %>% arrange(ab) +seqnr <- 0 +# add follow up nrs +for (i in 2:nrow(abx2)) { + if (abx2[i, "ab", drop = TRUE] == abx2[i - 1, "ab", drop = TRUE]) { + seqnr <- seqnr + 1 + abx2[i, "seqnr"] <- seqnr + } else { + seqnr <- 0 + } +} +for (i in 2:nrow(abx2)) { + if (!is.na(abx2[i, "seqnr"])) { + abx2[i, "ab"] <- paste0(abx2[i, "ab", drop = TRUE], abx2[i, "seqnr", drop = TRUE]) + } +} +abx2 <- abx2 %>% + select(-seqnr) %>% + arrange(name) + +# everything unique?? +nrow(abx2) == n_distinct(abx2$ab) + +# get ATC properties +abx2 <- abx2 %>% + left_join(ab_old %>% + select( + atc, abbr, atc_group1, atc_group2, + oral_ddd, oral_units, iv_ddd, iv_units + )) + +abx2$abbr <- lapply(as.list(abx2$abbr), function(x) unlist(strsplit(x, "|", fixed = TRUE))) + +# Update Compound IDs and Synonyms ---- + +# vector with official names, returns vector with CIDs +get_CID <- function(ab) { + CID <- rep(NA_integer_, length(ab)) + p <- AMR:::progress_ticker(n = length(ab), min_time = 0) + for (i in 1:length(ab)) { + p$tick() + + CID[i] <- tryCatch( + data.table::fread( + paste0( + "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/", + URLencode(ab[i], reserved = TRUE), + "/cids/TXT?name_type=complete" + ), + showProgress = FALSE + )[[1]][1], + error = function(e) NA_integer_ + ) + if (is.na(CID[i])) { + # try with removing the text in brackets + CID[i] <- tryCatch( + data.table::fread( + paste0( + "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/", + URLencode(trimws(gsub("[(].*[)]", "", ab[i])), reserved = TRUE), + "/cids/TXT?name_type=complete" + ), + showProgress = FALSE + )[[1]][1], + error = function(e) NA_integer_ + ) + } + if (is.na(CID[i])) { + # try match on word and take the lowest CID value (sorted) + ab[i] <- gsub("[^a-z0-9]+", " ", ab[i], ignore.case = TRUE) + CID[i] <- tryCatch( + data.table::fread( + paste0( + "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/", + URLencode(ab[i], reserved = TRUE), + "/cids/TXT?name_type=word" + ), + showProgress = FALSE + )[[1]][1], + error = function(e) NA_integer_ + ) + } + Sys.sleep(0.1) + } + CID +} + +# get CIDs (4-5 min) +CIDs <- get_CID(antimicrobials$name) +# take missing from previously found CIDs +CIDs[is.na(CIDs) & !is.na(antimicrobials$cid)] <- antimicrobials$cid[is.na(CIDs) & !is.na(antimicrobials$cid)] +# These could not be found: +antimicrobials[is.na(CIDs), ] %>% View() + +# returns list with synonyms (brand names), with CIDs as names +get_synonyms <- function(CID, clean = TRUE) { + synonyms <- rep(NA_character_, length(CID)) + p <- AMR:::progress_ticker(n = length(CID), min_time = 0) + + for (i in 1:length(CID)) { + p$tick() + + synonyms_txt <- "" + + if (is.na(CID[i])) { + next + } + + # we will now get the closest compounds with a 96% threshold + similar_cids <- tryCatch( + data.table::fread( + paste0( + "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/fastsimilarity_2d/cid/", + CID[i], + "/cids/TXT?Threshold=96&MaxRecords=5" + ), + sep = "\n", + showProgress = FALSE + )[[1]], + error = function(e) NA_character_ + ) + # include the current CID of course + all_cids <- unique(c(CID[i], similar_cids)) + # but leave out all CIDs that we have in our antimicrobials dataset to prevent duplication + all_cids <- all_cids[!all_cids %in% antimicrobials$cid[!is.na(antimicrobials$cid)]] + # for each one, we are getting the synonyms + current_syns <- character(0) + for (j in seq_len(length(all_cids))) { + synonyms_txt <- tryCatch( + data.table::fread( + paste0( + "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/fastidentity/cid/", + all_cids[j], + "/synonyms/TXT" + ), + sep = "\n", + showProgress = FALSE + )[[1]], + error = function(e) NA_character_ + ) + + Sys.sleep(0.05) + + if (clean == TRUE) { + # remove text between brackets + synonyms_txt <- trimws(gsub( + "[(].*[)]", "", + gsub( + "[[].*[]]", "", + gsub( + "[(].*[]]", "", + gsub("[[].*[)]", "", synonyms_txt) + ) + ) + )) + synonyms_txt <- gsub("Co-", "Co", synonyms_txt, fixed = TRUE) + synonyms_txt <- gsub(" ?(mono)?sodium ?", "", ignore.case = TRUE, synonyms_txt) + synonyms_txt <- gsub(" ?(injection|pediatric) ?", "", ignore.case = TRUE, synonyms_txt) + # only length 6 to 20 and no txt with reading marks or numbers and must start with capital letter (= brand) + synonyms_txt <- synonyms_txt[nchar(synonyms_txt) %in% c(5:20) & + !grepl("[-&{},_0-9/:]", synonyms_txt) & + grepl("^[A-Z]", synonyms_txt, ignore.case = FALSE)] + synonyms_txt <- unlist(strsplit(synonyms_txt, ";", fixed = TRUE)) + } + + current_syns <- c(current_syns, synonyms_txt) + } + + current_syns <- unique(trimws(current_syns[tolower(current_syns) %in% unique(tolower(current_syns))])) + synonyms[i] <- list(sort(current_syns)) + } + names(synonyms) <- CID + synonyms +} + +# get brand names from PubChem (3-4 min) +synonyms <- get_synonyms(CIDs) +synonyms.bak <- synonyms +synonyms <- synonyms.bak + +# add existing ones (will be cleaned later) +for (i in seq_len(length(synonyms))) { + old <- unname(unlist(AMR::antimicrobials[i, "synonyms", drop = TRUE])) + synonyms[[i]] <- c(unname(synonyms[[i]]), old) +} + +antimicrobials$synonyms <- synonyms + +stop("remember to remove co-trimoxazole as synonyms from SMX (Sulfamethoxazole), so it only exists in SXT!") +sulfa <- antimicrobials[which(antimicrobials$ab == "SMX"), "synonyms", drop = TRUE][[1]] +cotrim <- antimicrobials[which(antimicrobials$ab == "SXT"), "synonyms", drop = TRUE][[1]] +# 2024-10-06 not the case anymore, no overlapping names: sulfa[sulfa %in% cotrim] +sulfa <- sulfa[!sulfa %in% cotrim] +antimicrobials[which(antimicrobials$ab == "SMX"), "synonyms"][[1]][[1]] <- sulfa + + +# now go to end of this file + + +# ----- + +# add them to data set +antimicrobials <- abx2 %>% + left_join(DRGLST %>% + select(ab = WHON5_CODE, CLASS, SUBCLASS) %>% + distinct(ab, .keep_all = TRUE), by = "ab") %>% + transmute(ab, + atc, + cid = CIDs, + # no capital after a slash: Ampicillin/Sulbactam -> Ampicillin/sulbactam + name = name %>% + gsub("([/-])([A-Z])", "\\1\\L\\2", ., perl = TRUE) %>% + gsub("edta", "EDTA", ., ignore.case = TRUE), + group = case_when( + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "am(ph|f)enicol" ~ "Amphenicols", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "aminoglycoside" ~ "Aminoglycosides", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "carbapenem" | name %like% "(imipenem|meropenem)" ~ "Carbapenems", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "First-generation cephalosporin" ~ "Cephalosporins (1st gen.)", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "Second-generation cephalosporin" ~ "Cephalosporins (2nd gen.)", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "Third-generation cephalosporin" ~ "Cephalosporins (3rd gen.)", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "Fourth-generation cephalosporin" ~ "Cephalosporins (4th gen.)", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "(tuberculosis|mycobacter)" ~ "Antimycobacterials", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "cephalosporin" ~ "Cephalosporins", + name %like% "^Ce" & is.na(atc_group1) & paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "beta-?lactam" ~ "Cephalosporins", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "(beta-?lactam|penicillin)" ~ "Beta-lactams/penicillins", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "quinolone" ~ "Quinolones", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "glycopeptide" ~ "Glycopeptides", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "macrolide" ~ "Macrolides/lincosamides", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "tetracycline" ~ "Tetracyclines", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "trimethoprim" ~ "Trimethoprims", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "polymyxin" ~ "Polymyxins", + paste(atc_group1, atc_group2, CLASS, SUBCLASS) %like% "(fungal|mycot)" ~ "Antifungals/antimycotics", + TRUE ~ "Other antibacterials" + ), + atc_group1, atc_group2, + abbreviations = unname(abbr), + synonyms = unname(synonyms), + oral_ddd, oral_units, + iv_ddd, iv_units + ) %>% + as.data.frame(stringsAsFactors = FALSE) + +# some exceptions +antimicrobials[which(antimicrobials$ab == "DOX"), "abbreviations"][[1]] <- list(c("dox", "doxy")) +antimicrobials[which(antimicrobials$ab == "FLC"), "abbreviations"][[1]] <- list(c("clox")) +antimicrobials[which(antimicrobials$ab == "CEC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CEC"), "abbreviations"][[1]], "CFC")) # cefaclor old WHONET4 code +antimicrobials[which(antimicrobials$ab == "AMX"), "synonyms"][[1]] <- list(sort(c(antimicrobials[which(antimicrobials$ab == "AMX"), "synonyms"][[1]], "Amoxy"))) +# 'Polymixin B' (POL) and 'Polymyxin B' (PLB) both exist, so: +antimicrobials[which(antimicrobials$ab == "PLB"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PLB"), "abbreviations"][[1]], "POL", "Polymixin", "Polymixin B", "Poly B")) +antimicrobials <- filter(antimicrobials, ab != "POL") +# 'Latamoxef' (LTM) and 'Moxalactam (Latamoxef)' (MOX) both exist, so: +antimicrobials[which(antimicrobials$ab == "LTM"), "abbreviations"][[1]] <- list(c("MOX", "moxa")) +antimicrobials <- filter(antimicrobials, ab != "MOX") +# RFP and RFP1 (the J0 one) both mean 'rifapentine', although 'rifp' is not recognised, so: +antimicrobials <- filter(antimicrobials, ab != "RFP") +antimicrobials[which(antimicrobials$ab == "RFP1"), "ab"] <- "RFP" +antimicrobials[which(antimicrobials$ab == "RFP"), "abbreviations"][[1]] <- list(c("rifp")) +# Rifampicin is better known as a drug than Rifampin (Rifampin is still listed as a brand name), so: +antimicrobials[which(antimicrobials$ab == "RIF"), "name"] <- "Rifampicin" +# PME and PVM1 (the J0 one) both mean 'Pivmecillinam', so: +antimicrobials <- filter(antimicrobials, ab != "PME") +antimicrobials[which(antimicrobials$ab == "PVM1"), "ab"] <- "PME" +# Remove Sinecatechins +antimicrobials <- filter(antimicrobials, ab != "SNC") +# GLIMS codes +antimicrobials[which(antimicrobials$ab == as.ab("cefuroxim")), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == as.ab("cefuroxim")), "abbreviations"][[1]], "cfrx")) +antimicrobials[which(antimicrobials$ab == as.ab("cefotaxim")), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == as.ab("cefotaxim")), "abbreviations"][[1]], "cftx")) +antimicrobials[which(antimicrobials$ab == as.ab("ceftazidime")), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == as.ab("ceftazidime")), "abbreviations"][[1]], "cftz")) +antimicrobials[which(antimicrobials$ab == as.ab("cefepime")), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == as.ab("cefepime")), "abbreviations"][[1]], "cfpi")) +antimicrobials[which(antimicrobials$ab == as.ab("cefoxitin")), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == as.ab("cefoxitin")), "abbreviations"][[1]], "cfxt")) +# Add cefoxitin screening +class(antimicrobials$ab) <- "character" +antimicrobials <- rbind(antimicrobials, data.frame( + ab = "FOX1", atc = NA, cid = NA, + name = "Cefoxitin screening", + group = "Cephalosporins (2nd gen.)", atc_group1 = NA, atc_group2 = NA, + abbreviations = "cfsc", synonyms = NA, + oral_ddd = NA, oral_units = NA, iv_ddd = NA, iv_units = NA, + loinc = NA, + stringsAsFactors = FALSE +)) +# More GLIMS codes +antimicrobials[which(antimicrobials$ab == "AMB"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "AMB"), "abbreviations"][[1]], "amf")) +antimicrobials[which(antimicrobials$ab == "CAZ"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CAZ"), "abbreviations"][[1]], "cftz")) +antimicrobials[which(antimicrobials$ab == "COL"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "COL"), "abbreviations"][[1]], "cst")) +antimicrobials[which(antimicrobials$ab == "CRO"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CRO"), "abbreviations"][[1]], "cftr")) +antimicrobials[which(antimicrobials$ab == "CTX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CTX"), "abbreviations"][[1]], "cftx")) +antimicrobials[which(antimicrobials$ab == "CXM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CXM"), "abbreviations"][[1]], "cfrx")) +antimicrobials[which(antimicrobials$ab == "CZO"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CZO"), "abbreviations"][[1]], "cfzl")) +antimicrobials[which(antimicrobials$ab == "FCT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FCT"), "abbreviations"][[1]], "fcu")) +antimicrobials[which(antimicrobials$ab == "FCT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FCT"), "abbreviations"][[1]], "fluy")) +antimicrobials[which(antimicrobials$ab == "FLU"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FLU"), "abbreviations"][[1]], "flz")) +antimicrobials[which(antimicrobials$ab == "FOS"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FOS"), "abbreviations"][[1]], "fof")) +antimicrobials[which(antimicrobials$ab == "FOX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FOX"), "abbreviations"][[1]], "cfxt")) +antimicrobials[which(antimicrobials$ab == "FUS"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FUS"), "abbreviations"][[1]], "fa")) +antimicrobials[which(antimicrobials$ab == "GEH"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "GEH"), "abbreviations"][[1]], "g_h")) +antimicrobials[which(antimicrobials$ab == "KAH"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "KAH"), "abbreviations"][[1]], "k_h")) +antimicrobials[which(antimicrobials$ab == "KET"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "KET"), "abbreviations"][[1]], "ktc")) +antimicrobials[which(antimicrobials$ab == "PIP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PIP"), "abbreviations"][[1]], "pipc")) +antimicrobials[which(antimicrobials$ab == "PIP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PIP"), "abbreviations"][[1]], "PIPC")) +antimicrobials[which(antimicrobials$ab == "SPX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SPX"), "abbreviations"][[1]], "spa")) +antimicrobials[which(antimicrobials$ab == "STH"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "STH"), "abbreviations"][[1]], "s_h")) +antimicrobials[which(antimicrobials$ab == "STR1"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "STR1"), "abbreviations"][[1]], "stm")) +antimicrobials[which(antimicrobials$ab == "SXT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SXT"), "abbreviations"][[1]], "COTRIM")) +antimicrobials[which(antimicrobials$ab == "SXT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SXT"), "abbreviations"][[1]], "trsx")) +antimicrobials[which(antimicrobials$ab == "TGC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TGC"), "abbreviations"][[1]], "tig")) +antimicrobials[which(antimicrobials$ab == "TMP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TMP"), "abbreviations"][[1]], "tri")) +antimicrobials[which(antimicrobials$ab == "TZP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TZP"), "abbreviations"][[1]], "PIPTAZ")) +antimicrobials[which(antimicrobials$ab == "TZP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TZP"), "abbreviations"][[1]], "pit")) +antimicrobials[which(antimicrobials$ab == "TZP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TZP"), "abbreviations"][[1]], "pita")) +antimicrobials[which(antimicrobials$ab == "VOR"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "VOR"), "abbreviations"][[1]], "vrc")) + +# official RIVM codes (Dutch National Health Institute) +# https://www.rivm.nl/sites/default/files/2019-09/Bijlage_4_Lijst_antibiotica%202020%201.0.pdf +antimicrobials[which(antimicrobials$ab == "FCT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FCT"), "abbreviations"][[1]], "5flc")) +antimicrobials[which(antimicrobials$ab == "AMC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "AMC"), "abbreviations"][[1]], "amcl")) +antimicrobials[which(antimicrobials$ab == "AMB"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "AMB"), "abbreviations"][[1]], "amfb")) +antimicrobials[which(antimicrobials$ab == "AMH"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "AMH"), "abbreviations"][[1]], "amhl")) +antimicrobials[which(antimicrobials$ab == "AMK"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "AMK"), "abbreviations"][[1]], "amik")) +antimicrobials[which(antimicrobials$ab == "AMX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "AMX"), "abbreviations"][[1]], "amox")) +antimicrobials[which(antimicrobials$ab == "AMP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "AMP"), "abbreviations"][[1]], "ampi")) +antimicrobials[which(antimicrobials$ab == "SAM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SAM"), "abbreviations"][[1]], "amsu")) +antimicrobials[which(antimicrobials$ab == "ANI"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "ANI"), "abbreviations"][[1]], "anid")) +antimicrobials[which(antimicrobials$ab == "SAM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SAM"), "abbreviations"][[1]], "apsu")) +antimicrobials[which(antimicrobials$ab == "AZM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "AZM"), "abbreviations"][[1]], "azit")) +antimicrobials[which(antimicrobials$ab == "AZL"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "AZL"), "abbreviations"][[1]], "azlo")) +antimicrobials[which(antimicrobials$ab == "ATM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "ATM"), "abbreviations"][[1]], "aztr")) +antimicrobials[which(antimicrobials$ab == "PNV"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PNV"), "abbreviations"][[1]], "bepe")) +antimicrobials[which(antimicrobials$ab == "CAP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CAP"), "abbreviations"][[1]], "capr")) +antimicrobials[which(antimicrobials$ab == "CRB"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CRB"), "abbreviations"][[1]], "carb")) +antimicrobials[which(antimicrobials$ab == "CAS"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CAS"), "abbreviations"][[1]], "casp")) +antimicrobials[which(antimicrobials$ab == "CDC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CDC"), "abbreviations"][[1]], "cecl")) +antimicrobials[which(antimicrobials$ab == "CXA"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CXA"), "abbreviations"][[1]], "cfax")) +antimicrobials[which(antimicrobials$ab == "CTB"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CTB"), "abbreviations"][[1]], "cfbu")) +antimicrobials[which(antimicrobials$ab == "CEC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CEC"), "abbreviations"][[1]], "cfcl")) +antimicrobials[which(antimicrobials$ab == "CFR"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CFR"), "abbreviations"][[1]], "cfdx")) +antimicrobials[which(antimicrobials$ab == "CEP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CEP"), "abbreviations"][[1]], "cflt")) +antimicrobials[which(antimicrobials$ab == "LEX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "LEX"), "abbreviations"][[1]], "cflx")) +antimicrobials[which(antimicrobials$ab == "MAN"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "MAN"), "abbreviations"][[1]], "cfmn")) +antimicrobials[which(antimicrobials$ab == "CPD"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CPD"), "abbreviations"][[1]], "cfpd")) +antimicrobials[which(antimicrobials$ab == "FEP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FEP"), "abbreviations"][[1]], "cfpi")) +antimicrobials[which(antimicrobials$ab == "CPO"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CPO"), "abbreviations"][[1]], "cfpr")) +antimicrobials[which(antimicrobials$ab == "CFP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CFP"), "abbreviations"][[1]], "cfpz")) +antimicrobials[which(antimicrobials$ab == "CED"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CED"), "abbreviations"][[1]], "cfrd")) +antimicrobials[which(antimicrobials$ab == "CPT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CPT"), "abbreviations"][[1]], "cfro")) +antimicrobials[which(antimicrobials$ab == "CXM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CXM"), "abbreviations"][[1]], "cfrx")) +antimicrobials[which(antimicrobials$ab == "CFS"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CFS"), "abbreviations"][[1]], "cfsl")) +antimicrobials[which(antimicrobials$ab == "CRO"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CRO"), "abbreviations"][[1]], "cftr")) +antimicrobials[which(antimicrobials$ab == "CTT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CTT"), "abbreviations"][[1]], "cftt")) +antimicrobials[which(antimicrobials$ab == "CTX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CTX"), "abbreviations"][[1]], "cftx")) +antimicrobials[which(antimicrobials$ab == "CAZ"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CAZ"), "abbreviations"][[1]], "cftz")) +antimicrobials[which(antimicrobials$ab == "CFM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CFM"), "abbreviations"][[1]], "cfxm")) +antimicrobials[which(antimicrobials$ab == "FOX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FOX"), "abbreviations"][[1]], "cfxt")) +antimicrobials[which(antimicrobials$ab == "CZA"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CZA"), "abbreviations"][[1]], "cfav")) +antimicrobials[which(antimicrobials$ab == "CZO"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CZO"), "abbreviations"][[1]], "cfzl")) +antimicrobials[which(antimicrobials$ab == "CZX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CZX"), "abbreviations"][[1]], "cfzx")) +antimicrobials[which(antimicrobials$ab == "CHL"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CHL"), "abbreviations"][[1]], "chlo")) +antimicrobials[which(antimicrobials$ab == "CPC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CPC"), "abbreviations"][[1]], "cicl")) +antimicrobials[which(antimicrobials$ab == "CIN"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CIN"), "abbreviations"][[1]], "cino")) +antimicrobials[which(antimicrobials$ab == "CIP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CIP"), "abbreviations"][[1]], "cipr")) +antimicrobials[which(antimicrobials$ab == "CIX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CIX"), "abbreviations"][[1]], "cipx")) +antimicrobials[which(antimicrobials$ab == "CLR"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CLR"), "abbreviations"][[1]], "clar")) +antimicrobials[which(antimicrobials$ab == "CLI"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CLI"), "abbreviations"][[1]], "clin")) +antimicrobials[which(antimicrobials$ab == "CTR"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CTR"), "abbreviations"][[1]], "clot")) +antimicrobials[which(antimicrobials$ab == "CLO"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CLO"), "abbreviations"][[1]], "clox")) +antimicrobials[which(antimicrobials$ab == "COL"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "COL"), "abbreviations"][[1]], "coli")) +antimicrobials[which(antimicrobials$ab == "CTC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CTC"), "abbreviations"][[1]], "cxcl")) +antimicrobials[which(antimicrobials$ab == "CYC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CYC"), "abbreviations"][[1]], "cycl")) +antimicrobials[which(antimicrobials$ab == "CCV"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CCV"), "abbreviations"][[1]], "czcl")) +antimicrobials[which(antimicrobials$ab == "DAP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "DAP"), "abbreviations"][[1]], "dapt")) +antimicrobials[which(antimicrobials$ab == "DIC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "DIC"), "abbreviations"][[1]], "dicl")) +antimicrobials[which(antimicrobials$ab == "DOR"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "DOR"), "abbreviations"][[1]], "dori")) +antimicrobials[which(antimicrobials$ab == "DOX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "DOX"), "abbreviations"][[1]], "doxy")) +antimicrobials[which(antimicrobials$ab == "ENX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "ENX"), "abbreviations"][[1]], "enox")) +antimicrobials[which(antimicrobials$ab == "ETP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "ETP"), "abbreviations"][[1]], "erta")) +antimicrobials[which(antimicrobials$ab == "ERY"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "ERY"), "abbreviations"][[1]], "eryt")) +antimicrobials[which(antimicrobials$ab == "PHE"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PHE"), "abbreviations"][[1]], "fene")) +antimicrobials[which(antimicrobials$ab == "PHN"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PHN"), "abbreviations"][[1]], "fepe")) +antimicrobials[which(antimicrobials$ab == "FLE"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FLE"), "abbreviations"][[1]], "fler")) +antimicrobials[which(antimicrobials$ab == "FLU"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FLU"), "abbreviations"][[1]], "fluc")) +antimicrobials[which(antimicrobials$ab == "FLC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FLC"), "abbreviations"][[1]], "flux")) +antimicrobials[which(antimicrobials$ab == "FOS"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FOS"), "abbreviations"][[1]], "fosf")) +antimicrobials[which(antimicrobials$ab == "FRM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FRM"), "abbreviations"][[1]], "fram")) +antimicrobials[which(antimicrobials$ab == "FUS"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FUS"), "abbreviations"][[1]], "fusi")) +antimicrobials[which(antimicrobials$ab == "GAT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "GAT"), "abbreviations"][[1]], "gati")) +antimicrobials[which(antimicrobials$ab == "GEH"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "GEH"), "abbreviations"][[1]], "gehl")) +antimicrobials[which(antimicrobials$ab == "GEN"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "GEN"), "abbreviations"][[1]], "gent")) +antimicrobials[which(antimicrobials$ab == "GRX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "GRX"), "abbreviations"][[1]], "grep")) +antimicrobials[which(antimicrobials$ab == "IPM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "IPM"), "abbreviations"][[1]], "imci")) +antimicrobials[which(antimicrobials$ab == "IPM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "IPM"), "abbreviations"][[1]], "imip")) +antimicrobials[which(antimicrobials$ab == "ISV"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "ISV"), "abbreviations"][[1]], "isav")) +antimicrobials[which(antimicrobials$ab == "ITR"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "ITR"), "abbreviations"][[1]], "itra")) +antimicrobials[which(antimicrobials$ab == "KAH"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "KAH"), "abbreviations"][[1]], "kahl")) +antimicrobials[which(antimicrobials$ab == "KAN"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "KAN"), "abbreviations"][[1]], "kana")) +antimicrobials[which(antimicrobials$ab == "KET"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "KET"), "abbreviations"][[1]], "keto")) +antimicrobials[which(antimicrobials$ab == "LVX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "LVX"), "abbreviations"][[1]], "levo")) +antimicrobials[which(antimicrobials$ab == "LIN"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "LIN"), "abbreviations"][[1]], "linc")) +antimicrobials[which(antimicrobials$ab == "LNZ"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "LNZ"), "abbreviations"][[1]], "line")) +antimicrobials[which(antimicrobials$ab == "LOR"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "LOR"), "abbreviations"][[1]], "lora")) +antimicrobials[which(antimicrobials$ab == "MEM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "MEM"), "abbreviations"][[1]], "mero")) +antimicrobials[which(antimicrobials$ab == "MET"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "MET"), "abbreviations"][[1]], "meti")) +antimicrobials[which(antimicrobials$ab == "MTR"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "MTR"), "abbreviations"][[1]], "metr")) +antimicrobials[which(antimicrobials$ab == "MEZ"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "MEZ"), "abbreviations"][[1]], "mezl")) +antimicrobials[which(antimicrobials$ab == "MIF"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "MIF"), "abbreviations"][[1]], "mica")) +antimicrobials[which(antimicrobials$ab == "MCZ"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "MCZ"), "abbreviations"][[1]], "mico")) +antimicrobials[which(antimicrobials$ab == "MNO"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "MNO"), "abbreviations"][[1]], "mino")) +antimicrobials[which(antimicrobials$ab == "LTM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "LTM"), "abbreviations"][[1]], "moxa", "moxalactam")) +antimicrobials[which(antimicrobials$ab == "MFX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "MFX"), "abbreviations"][[1]], "moxi")) +antimicrobials[which(antimicrobials$ab == "NAL"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "NAL"), "abbreviations"][[1]], "nali")) +antimicrobials[which(antimicrobials$ab == "NEO"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "NEO"), "abbreviations"][[1]], "neom")) +antimicrobials[which(antimicrobials$ab == "NET"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "NET"), "abbreviations"][[1]], "neti")) +antimicrobials[which(antimicrobials$ab == "NIT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "NIT"), "abbreviations"][[1]], "nitr")) +antimicrobials[which(antimicrobials$ab == "NOR"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "NOR"), "abbreviations"][[1]], "norf")) +antimicrobials[which(antimicrobials$ab == "NYS"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "NYS"), "abbreviations"][[1]], "nyst")) +antimicrobials[which(antimicrobials$ab == "OFX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "OFX"), "abbreviations"][[1]], "oflo")) +antimicrobials[which(antimicrobials$ab == "OXA"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "OXA"), "abbreviations"][[1]], "oxal")) +antimicrobials[which(antimicrobials$ab == "PEF"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PEF"), "abbreviations"][[1]], "pefl")) +antimicrobials[which(antimicrobials$ab == "PEN"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PEN"), "abbreviations"][[1]], "peni")) +antimicrobials[which(antimicrobials$ab == "PIP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PIP"), "abbreviations"][[1]], "pipc")) +antimicrobials[which(antimicrobials$ab == "PPA"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PPA"), "abbreviations"][[1]], "pipz")) +antimicrobials[which(antimicrobials$ab == "TZP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TZP"), "abbreviations"][[1]], "pita")) +antimicrobials[which(antimicrobials$ab == "PLB"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PLB"), "abbreviations"][[1]], "polb")) +antimicrobials[which(antimicrobials$ab == "POS"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "POS"), "abbreviations"][[1]], "posa")) +antimicrobials[which(antimicrobials$ab == "PRI"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "PRI"), "abbreviations"][[1]], "pris")) +antimicrobials[which(antimicrobials$ab == "QDA"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "QDA"), "abbreviations"][[1]], "quda")) +antimicrobials[which(antimicrobials$ab == "RIF"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "RIF"), "abbreviations"][[1]], "rifa")) +antimicrobials[which(antimicrobials$ab == "RXT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "RXT"), "abbreviations"][[1]], "roxi")) +antimicrobials[which(antimicrobials$ab == "SMX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SMX"), "abbreviations"][[1]], "sfmx")) +antimicrobials[which(antimicrobials$ab == "SLF4"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SLF4"), "abbreviations"][[1]], "sfmz")) +antimicrobials[which(antimicrobials$ab == "SSS"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SSS"), "abbreviations"][[1]], "sfna")) +antimicrobials[which(antimicrobials$ab == "SLF"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SLF"), "abbreviations"][[1]], "sfsz")) +antimicrobials[which(antimicrobials$ab == "SPX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SPX"), "abbreviations"][[1]], "spar")) +antimicrobials[which(antimicrobials$ab == "SPT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SPT"), "abbreviations"][[1]], "spec")) +antimicrobials[which(antimicrobials$ab == "SPI"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SPI"), "abbreviations"][[1]], "spir")) +antimicrobials[which(antimicrobials$ab == "STH"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "STH"), "abbreviations"][[1]], "sthl")) +antimicrobials[which(antimicrobials$ab == "STR1"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "STR1"), "abbreviations"][[1]], "stre")) +antimicrobials[which(antimicrobials$ab == "TAZ"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TAZ"), "abbreviations"][[1]], "tazo")) +antimicrobials[which(antimicrobials$ab == "TEC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TEC"), "abbreviations"][[1]], "teic")) +antimicrobials[which(antimicrobials$ab == "TLT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TLT"), "abbreviations"][[1]], "teli")) +antimicrobials[which(antimicrobials$ab == "TMX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TMX"), "abbreviations"][[1]], "tema")) +antimicrobials[which(antimicrobials$ab == "TEM"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TEM"), "abbreviations"][[1]], "temo")) +antimicrobials[which(antimicrobials$ab == "TRB"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TRB"), "abbreviations"][[1]], "terb")) +antimicrobials[which(antimicrobials$ab == "TCY"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TCY"), "abbreviations"][[1]], "tetr")) +antimicrobials[which(antimicrobials$ab == "TIC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TIC"), "abbreviations"][[1]], "tica")) +antimicrobials[which(antimicrobials$ab == "TCC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TCC"), "abbreviations"][[1]], "ticl")) +antimicrobials[which(antimicrobials$ab == "TGC"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TGC"), "abbreviations"][[1]], "tige")) +antimicrobials[which(antimicrobials$ab == "TIN"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TIN"), "abbreviations"][[1]], "tini")) +antimicrobials[which(antimicrobials$ab == "TOB"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TOB"), "abbreviations"][[1]], "tobr")) +antimicrobials[which(antimicrobials$ab == "TOH"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TOH"), "abbreviations"][[1]], "tohl")) +antimicrobials[which(antimicrobials$ab == "TMP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TMP"), "abbreviations"][[1]], "trim")) +antimicrobials[which(antimicrobials$ab == "TVA"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "TVA"), "abbreviations"][[1]], "trov")) +antimicrobials[which(antimicrobials$ab == "SLT4"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SLT4"), "abbreviations"][[1]], "trsm")) +antimicrobials[which(antimicrobials$ab == "SXT"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "SXT"), "abbreviations"][[1]], "trsx")) +antimicrobials[which(antimicrobials$ab == "VAN"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "VAN"), "abbreviations"][[1]], "vanc")) +antimicrobials[which(antimicrobials$ab == "VOR"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "VOR"), "abbreviations"][[1]], "vori")) + +antimicrobials[which(antimicrobials$ab == "FOS"), "synonyms"][[1]] <- list(sort(c(antimicrobials[which(antimicrobials$ab == "FOS"), "synonyms"][[1]], "Monuril"))) +antimicrobials[which(antimicrobials$ab == "FOS"), "synonyms"][[1]] <- list(sort(c(antimicrobials[which(antimicrobials$ab == "FOS"), "synonyms"][[1]], "Monurol"))) + +antimicrobials[which(antimicrobials$ab == "TZP"), "abbreviations"][[1]] <- list(sort(c(antimicrobials[which(antimicrobials$ab == "TZP"), "abbreviations"][[1]], "piptazo"))) + +antimicrobials[which(antimicrobials$ab == "RFP"), "abbreviations"][[1]] <- list(sort(c(antimicrobials[which(antimicrobials$ab == "RFP"), "abbreviations"][[1]], "RPT"))) +antimicrobials[which(antimicrobials$ab == "RTP"), "abbreviations"][[1]] <- list(sort(c(antimicrobials[which(antimicrobials$ab == "RTP"), "abbreviations"][[1]], "RET"))) +antimicrobials[which(antimicrobials$ab == "TYL1"), "abbreviations"][[1]] <- list(sort(c(antimicrobials[which(antimicrobials$ab == "TYL1"), "abbreviations"][[1]], "TVN"))) + +antimicrobials <- antimicrobials %>% + mutate(ab = as.character(ab)) %>% + rbind(antimicrobials %>% + filter(ab == "GEH") %>% + mutate( + ab = "AMH", + name = "Amphotericin B-high", + abbreviations = list(c("amhl", "amfo b high", "ampho b high", "amphotericin high")) + )) %>% + rbind(antimicrobials %>% + filter(ab == "GEH") %>% + mutate( + ab = "TOH", + name = "Tobramycin-high", + abbreviations = list(c("tohl", "tobra high", "tobramycin high")) + )) %>% + rbind(antimicrobials %>% + filter(ab == "BUT") %>% + mutate( + ab = "CIX", + atc = "D01AE14", + name = "Ciclopirox", + group = "Antifungals/antimycotics", + atc_group1 = "Antifungals for topical use", + atc_group2 = "Other antifungals for topical use", + abbreviations = list(c("cipx")) + )) +antimicrobials[which(antimicrobials$ab == "SSS"), "name"] <- "Sulfonamide" +# ESBL E-test codes: +antimicrobials[which(antimicrobials$ab == "CCV"), "abbreviations"][[1]] <- list(c("xtzl")) +antimicrobials[which(antimicrobials$ab == "CAZ"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CAZ"), "abbreviations"][[1]], "xtz", "cefta")) +antimicrobials[which(antimicrobials$ab == "CPC"), "abbreviations"][[1]] <- list(c("xpml")) +antimicrobials[which(antimicrobials$ab == "FEP"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "FEP"), "abbreviations"][[1]], "xpm")) +antimicrobials[which(antimicrobials$ab == "CTC"), "abbreviations"][[1]] <- list(c("xctl")) +antimicrobials[which(antimicrobials$ab == "CTX"), "abbreviations"][[1]] <- list(c(antimicrobials[which(antimicrobials$ab == "CTX"), "abbreviations"][[1]], "xct")) +# High level Gentamcin and Streptomycin +antimicrobials[which(antimicrobials$ab == "GEH"), "abbreviations"][[1]] <- list(c("gehl", "gentamicin high", "genta high", "gehi")) +antimicrobials[which(antimicrobials$ab == "STH"), "abbreviations"][[1]] <- list(c("sthl", "streptomycin high", "strepto high", "sthi")) +# add imi and "imipenem/cilastatine" to imipenem +antimicrobials[which(antimicrobials$ab == "IPM"), "abbreviations"][[1]] <- list(c("imip", "imi", "imp")) +antimicrobials[which(antimicrobials$ab == "IPM"), "synonyms"][[1]] <- list(sort(c(antimicrobials[which(antimicrobials$ab == "IPM"), "synonyms"][[1]], "imipenem/cilastatin"))) +# add synonyms of ones not found +antimicrobials[which(antimicrobials$ab == "TZP"), "synonyms"][[1]] <- list(sort(c(antimicrobials[which(antimicrobials$ab == "TZP"), "synonyms"][[1]], "Tazocel", "tazocillin", "Tazocin", "Zosyn"))) +antimicrobials[which(antimicrobials$ab == "COL"), "synonyms"][[1]] <- list(sort(unique(c(antimicrobials[which(antimicrobials$ab == "COL"), "synonyms"][[1]], "Colisticin", "Polymyxin E", "Colimycin", "Coly-Mycin", "Totazina", "Colistimethate", "Promixin", "Colistimethate Sodium")))) +# remove incorrect synonyms from rifampicin (RIF) and add them to the combination rifampicin/isoniazid (RFI) +old_sym <- antimicrobials[which(antimicrobials$ab == "RIF"), "synonyms"][[1]] +old_sym <- old_sym[!old_sym %in% c("Rifinah", "Rimactazid")] +antimicrobials[which(antimicrobials$ab == "RIF"), "synonyms"][[1]] <- list(old_sym) +antimicrobials[which(antimicrobials$ab == "RFI"), "synonyms"][[1]] <- list(sort(c("Rifinah", "Rimactazid"))) +# remove incorrect synonyms from sulfamethoxazole (SMX) and add them to the combination trimethoprim/sulfamethoxazole (SXT) +old_sym <- antimicrobials[which(antimicrobials$ab == "SMX"), "synonyms"][[1]] +old_sym <- old_sym[!old_sym %in% c("Cotrimoxazole", "Bactrimel")] +antimicrobials[which(antimicrobials$ab == "SMX"), "synonyms"][[1]] <- list(old_sym) +antimicrobials[which(antimicrobials$ab == "SXT"), "synonyms"][[1]] <- list(sort(unique(c(antimicrobials[which(antimicrobials$ab == "COL"), "synonyms"][[1]], "Cotrimoxazole", "Bactrimel", "Septra", "Bactrim", "Cotrimazole")))) + +# Fix penicillins +antimicrobials[which(antimicrobials$ab == "PEN"), "abbreviations"][[1]] <- list(c("bepe", "pg", "pen", "peni", "peni g", "penicillin", "penicillin g")) +antimicrobials[which(antimicrobials$ab == "PEN"), "name"] <- "Benzylpenicillin" +antimicrobials[which(antimicrobials$ab == "PHN"), "abbreviations"][[1]] <- list(c("fepe", "peni v", "pv", "penicillin v", "PNV")) +antimicrobials <- subset(antimicrobials, antimicrobials$ab != "PNV") + +# New DDDs +antimicrobials[which(antimicrobials$ab == "PEN"), "iv_ddd"] <- 3.6 +antimicrobials[which(antimicrobials$ab == "PEN"), "iv_units"] <- "g" + +## new ATC codes +# ceftaroline +antimicrobials[which(antimicrobials$ab == "CPT"), "atc"] <- "J01DI02" +# faropenem +antimicrobials[which(antimicrobials$ab == "FAR"), "atc"] <- "J01DI03" +# ceftobiprole +antimicrobials[which(antimicrobials$ab == "BPR"), "atc"] <- "J01DI01" +# ceftazidime / avibactam +antimicrobials[which(antimicrobials$ab == "CZA"), "atc"] <- "J01DD52" +antimicrobials[which(antimicrobials$ab == "CZA"), "cid"] <- 90643431 +antimicrobials[which(antimicrobials$ab == "CZA"), "atc_group1"] <- "Other beta-lactam antibacterials" +antimicrobials[which(antimicrobials$ab == "CZA"), "atc_group2"] <- "Third-generation cephalosporins" +antimicrobials[which(antimicrobials$ab == "CZA"), "iv_ddd"] <- 6 +antimicrobials[which(antimicrobials$ab == "CZA"), "iv_units"] <- "g" +antimicrobials[which(antimicrobials$ab == "CZA"), "synonyms"] <- list(c("Avycaz", "Zavicefta")) + +# typo +antimicrobials[which(antimicrobials$ab == "RXT"), "name"] <- "Roxithromycin" +antimicrobials[which(antimicrobials$ab == "PEN"), "atc"] <- "J01CE01" + +# WHONET cleanup +antimicrobials[which(antimicrobials$ab == "BCZ"), "name"] <- "Bicyclomycin" +antimicrobials[which(antimicrobials$ab == "CCL"), "name"] <- "Cefetecol" +antimicrobials[which(antimicrobials$ab == "ENV"), "name"] <- "Enviomycin" +antimicrobials[which(antimicrobials$ab == "KIT"), "name"] <- "Kitasamycin" +antimicrobials[which(antimicrobials$ab == "LSP"), "name"] <- "Linco-spectin" +antimicrobials[which(antimicrobials$ab == "MEC"), "name"] <- "Mecillinam" +antimicrobials[which(antimicrobials$ab == "PMR"), "name"] <- "Pimaricin" +antimicrobials[which(antimicrobials$ab == "BCZ"), "abbreviations"][[1]] <- list(sort(unique(c(antimicrobials[which(antimicrobials$ab == "BCZ"), "abbreviations"][[1]], "Bicozamycin")))) +antimicrobials[which(antimicrobials$ab == "CCL"), "abbreviations"][[1]] <- list(sort(unique(c(antimicrobials[which(antimicrobials$ab == "CCL"), "abbreviations"][[1]], "Cefcatacol")))) +antimicrobials[which(antimicrobials$ab == "ENV"), "abbreviations"][[1]] <- list(sort(unique(c(antimicrobials[which(antimicrobials$ab == "ENV"), "abbreviations"][[1]], "Tuberactinomycin")))) +antimicrobials[which(antimicrobials$ab == "KIT"), "abbreviations"][[1]] <- list(sort(unique(c(antimicrobials[which(antimicrobials$ab == "KIT"), "abbreviations"][[1]], "Leucomycin")))) +antimicrobials[which(antimicrobials$ab == "LSP"), "abbreviations"][[1]] <- list(sort(unique(c(antimicrobials[which(antimicrobials$ab == "LSP"), "abbreviations"][[1]], "lincomycin/spectinomycin")))) +antimicrobials[which(antimicrobials$ab == "MEC"), "abbreviations"][[1]] <- list(sort(unique(c(antimicrobials[which(antimicrobials$ab == "MEC"), "abbreviations"][[1]], "Amdinocillin")))) +antimicrobials[which(antimicrobials$ab == "PMR"), "abbreviations"][[1]] <- list(sort(unique(c(antimicrobials[which(antimicrobials$ab == "PMR"), "abbreviations"][[1]], "Natamycin")))) + + +# set cephalosporins groups for the ones that could not be determined automatically: +antimicrobials <- antimicrobials %>% + mutate(group = case_when( + name == "Cefcapene" ~ "Cephalosporins (3rd gen.)", + name == "Cefcapene pivoxil" ~ "Cephalosporins (3rd gen.)", + name == "Cefditoren pivoxil" ~ "Cephalosporins (3rd gen.)", + name == "Cefepime/clavulanic acid" ~ "Cephalosporins (4th gen.)", + name == "Cefepime/tazobactam" ~ "Cephalosporins (4th gen.)", + name == "Cefetamet pivoxil" ~ "Cephalosporins (3rd gen.)", + name == "Cefetecol (Cefcatacol)" ~ "Cephalosporins (4th gen.)", + name == "Cefetrizole" ~ "Cephalosporins (unclassified gen.)", + name == "Cefoselis" ~ "Cephalosporins (4th gen.)", + name == "Cefotaxime/clavulanic acid" ~ "Cephalosporins (3rd gen.)", + name == "Cefotaxime/sulbactam" ~ "Cephalosporins (3rd gen.)", + name == "Cefotiam hexetil" ~ "Cephalosporins (3rd gen.)", + name == "Cefovecin" ~ "Cephalosporins (3rd gen.)", + name == "Cefozopran" ~ "Cephalosporins (4th gen.)", + name == "Cefpimizole" ~ "Cephalosporins (3rd gen.)", + name == "Cefpodoxime proxetil" ~ "Cephalosporins (3rd gen.)", + name == "Cefpodoxime/clavulanic acid" ~ "Cephalosporins (3rd gen.)", + name == "Cefquinome" ~ "Cephalosporins (4th gen.)", + name == "Cefsumide" ~ "Cephalosporins (unclassified gen.)", + name == "Ceftaroline" ~ "Cephalosporins (5th gen.)", + name == "Ceftaroline/avibactam" ~ "Cephalosporins (5th gen.)", + name == "Ceftazidime/avibactam" ~ "Cephalosporins (3rd gen.)", + name == "Cefteram" ~ "Cephalosporins (3rd gen.)", + name == "Cefteram pivoxil" ~ "Cephalosporins (3rd gen.)", + name == "Ceftiofur" ~ "Cephalosporins (3rd gen.)", + name == "Ceftizoxime alapivoxil" ~ "Cephalosporins (3rd gen.)", + name == "Ceftobiprole" ~ "Cephalosporins (5th gen.)", + name == "Ceftobiprole medocaril" ~ "Cephalosporins (5th gen.)", + name == "Ceftolozane/enzyme inhibitor" ~ "Cephalosporins (5th gen.)", + name == "Ceftolozane/tazobactam" ~ "Cephalosporins (5th gen.)", + name == "Cefuroxime axetil" ~ "Cephalosporins (2nd gen.)", + TRUE ~ group + )) +antimicrobials[which(antimicrobials$ab %in% c("CYC", "LNZ", "THA", "TZD")), "group"] <- "Oxazolidinones" + +# add efflux +effl <- antimicrobials |> + filter(ab == "ACM") |> + mutate(ab = as.character("EFF"), + cid = NA_real_, + name = "Efflux", + group = "Other") +antimicrobials <- antimicrobials |> + mutate(ab = as.character(ab)) |> + bind_rows(effl) +class(antimicrobials$ab) <- c("ab", "character") +antimicrobials[which(antimicrobials$ab == "EFF"), "abbreviations"][[1]] <- list(c("effflux pump")) + + +# add clindamycin inducible screening +clin <- antimicrobials |> + filter(ab == "FOX1") |> + mutate(ab = as.character("CLI1"), + name = "Clindamycin inducible screening", + group = "Macrolides/lincosamides") +antimicrobials <- antimicrobials |> + mutate(ab = as.character(ab)) |> + bind_rows(clin) +class(antimicrobials$ab) <- c("ab", "character") +antimicrobials[which(antimicrobials$ab == "CLI1"), "abbreviations"][[1]] <- list(c("clindamycin inducible", "clinda inducible", "clin inducible")) + +# add pretomanid +antimicrobials <- antimicrobials %>% + mutate(ab = as.character(ab)) %>% + bind_rows(antimicrobials %>% + mutate(ab = as.character(ab)) %>% + filter(ab == "SMF") %>% + mutate( + ab = "PMD", + atc = "J04AK08", + cid = 456199, + name = "Pretomanid", + abbreviations = list(""), + oral_ddd = NA_real_ + )) + + + +# update ATC codes from WHOCC website ------------------------------------- + +# last time checked: 2024-02-22 + +library(rvest) +updated_atc <- as.list(antimicrobials$atc) + +get_atcs <- function(ab_name, type = "human") { + if (type == "human") { + url <- "https://atcddd.fhi.no/atc_ddd_index/" + } else if (type == "veterinary") { + url <- "https://atcddd.fhi.no/atcvet/atcvet_index/" + } else { + stop("invalid type") + } + + ab_name <- gsub("/", " and ", tolower(ab_name), fixed = TRUE) + + # we will do a search on their website, which means: + + # go to the url + atc_tbl <- read_html(url) %>% + # get all forms + html_form() %>% + # get the second form (the first form is a global website form) + .[[2]] %>% + # set the name input box to our search parameter + html_form_set(name = ab_name) %>% + # hit Submit + html_form_submit() %>% + # read the resulting page + read_html() %>% + # retrieve the table on it + html_node("table") %>% + # transform it to an R data set + html_table(header = FALSE) + + # and get the ATCs (first column) of only exact hits + unique(as.character(atc_tbl[which(tolower(atc_tbl[, 2, drop = TRUE]) == ab_name), 1, drop = TRUE])) +} + +# this takes around 4 minutes (some are skipped and go faster) +for (i in seq_len(nrow(antimicrobials))) { + message(percentage(i / nrow(antimicrobials), digits = 1), + " - Downloading ", antimicrobials$name[i], + appendLF = FALSE + ) + atcs <- get_atcs(antimicrobials$name[i], type = "human") + if (all(is.na(atcs))) { + atcs <- get_atcs(antimicrobials$name[i], type = "veterinary") + } + if (length(atcs) > 0) { + updated_atc[[i]] <- atcs + message(" (", length(atcs), " results)") + # let the WHO server rest for a second - they might have a limitation on the queries per second + Sys.sleep(1) + } else { + message(" (skipping)") + } +} + +antimicrobials$atc <- updated_atc + +# update DDDs from WHOCC website ------------------------------------------ + +# last time checked: 2024-02-22 +ddd_oral <- rep(NA_real_, nrow(antimicrobials)) +ddd_oral_units <- rep(NA_character_, nrow(antimicrobials)) +ddd_iv <- rep(NA_real_, nrow(antimicrobials)) +ddd_iv_units <- rep(NA_character_, nrow(antimicrobials)) +progress <- progress_ticker(nrow(antimicrobials)) +for (i in seq_len(nrow(antimicrobials))) { + on.exit(close(progress)) + progress$tick() + atcs <- antimicrobials$atc[[i]] + if (!all(is.na(atcs))) { + for (j in seq_len(length(atcs))) { + # oral + if (is.na(ddd_oral[i])) { + ddd_oral[i] <- atc_online_ddd(atcs[j], administration = "O") + if (!is.na(ddd_oral[i])) { + ddd_oral_units[i] <- atc_online_ddd_units(atcs[j], administration = "O") + } + } + # parenteral + if (is.na(ddd_iv[i])) { + ddd_iv[i] <- atc_online_ddd(atcs[j], administration = "P") + if (!is.na(ddd_iv[i])) { + ddd_iv_units[i] <- atc_online_ddd_units(atcs[j], administration = "P") + } + } + } + } + if (!is.na(ddd_oral[i]) | !is.na(ddd_iv[i])) { + # let the WHO server rest for 0.25 second - they might have a limitation on the queries per second + Sys.sleep(0.25) + } +} + +antimicrobials$oral_ddd <- ddd_oral +antimicrobials$oral_units <- ddd_oral_units +antimicrobials$iv_ddd <- ddd_iv +antimicrobials$iv_units <- ddd_iv_units + +# Wrap up ----------------------------------------------------------------- + +# set as data.frame again +antimicrobials <- dataset_UTF8_to_ASCII(as.data.frame(antimicrobials, stringsAsFactors = FALSE)) +class(antimicrobials$ab) <- c("ab", "character") +antimicrobials <- dplyr::arrange(antimicrobials, name) + +# REFER TO data-raw/loinc.R FOR ADDING LOINC CODES + +# make all abbreviations and synonyms lower case, unique and alphabetically sorted ---- +for (i in 1:nrow(antimicrobials)) { + abb <- as.character(sort(unique(tolower(antimicrobials[i, "abbreviations", drop = TRUE][[1]])))) + abb <- abb[abb != "" & abb %unlike% ":"] + syn <- as.character(sort(unique(tolower(unname(unlist(antimicrobials[i, "synonyms", drop = TRUE])))))) + syn <- gsub("[^a-z]", "", syn) + syn <- gsub(" +", " ", syn) + pharm_terms <- "(pa?ediatric|injection|oral|inhale|otic|sulfate|sulphate|sodium|base|anhydrous|anhydrate|stearate|syrup|natrium|hydrate|x?hcl|gsalt|vet[.]?)" + syn <- gsub(paste0(" ", pharm_terms, "$"), "", syn) + syn <- gsub(paste0("^", pharm_terms, " "), "", syn) + syn <- trimws(syn) + syn <- gsub(" [a-z]{1,3}$", "", syn, perl = TRUE) + syn <- trimws(syn) + syn <- syn[syn != "" & syn %unlike% ":" & !syn %in% tolower(antimicrobials$name)] + syn <- unique(syn) + # special cases + if (antimicrobials$ab[i] == "VAN") syn <- syn[syn %unlike% "^tei?ch?o"] + if (antimicrobials$ab[i] == "CLR") syn <- syn[syn %unlike% "^ery"] + antimicrobials[i, "abbreviations"][[1]] <- ifelse(length(abb) == 0, list(""), list(abb)) + antimicrobials[i, "synonyms"][[1]] <- ifelse(length(syn) == 0, list(""), list(syn)) + if ("loinc" %in% colnames(antimicrobials)) { + loinc <- as.character(sort(unique(tolower(antimicrobials[i, "loinc", drop = TRUE][[1]])))) + loinc <- loinc[loinc != ""] + antimicrobials[i, "loinc"][[1]] <- ifelse(length(loinc) == 0, list(""), list(loinc)) + } +} + + +usethis::use_data(antimicrobials, overwrite = TRUE, version = 2, compress = "xz") +rm(antimicrobials) diff --git a/data-raw/reproduction_of_clinical_breakpoints.R b/data-raw/reproduction_of_clinical_breakpoints.R index 668c9153a..06b01f9d4 100644 --- a/data-raw/reproduction_of_clinical_breakpoints.R +++ b/data-raw/reproduction_of_clinical_breakpoints.R @@ -235,7 +235,7 @@ breakpoints %>% filter(!WHONET_ABX_CODE %in% whonet_antibiotics$WHONET_ABX_CODE) %>% pull(WHONET_ABX_CODE) %>% unique() -# they are at the moment all old codes that have the right replacements in `antibiotics`, so we can use as.ab() +# they are at the moment all old codes that have the right replacements in `antimicrobials`, so we can use as.ab() ## Build new breakpoints table ---- diff --git a/data-raw/reproduction_of_intrinsic_resistant.R b/data-raw/reproduction_of_intrinsic_resistant.R index fc46a52bb..508313918 100644 --- a/data-raw/reproduction_of_intrinsic_resistant.R +++ b/data-raw/reproduction_of_intrinsic_resistant.R @@ -30,9 +30,9 @@ library(AMR) library(dplyr) int_resis <- data.frame(mo = microorganisms$mo, stringsAsFactors = FALSE) -for (i in seq_len(nrow(antibiotics))) { +for (i in seq_len(nrow(antimicrobials))) { int_resis$new <- as.sir("S") - colnames(int_resis)[ncol(int_resis)] <- antibiotics$ab[i] + colnames(int_resis)[ncol(int_resis)] <- antimicrobials$ab[i] } int_resis <- eucast_rules(int_resis, @@ -49,14 +49,14 @@ int_resis2 <- int_resis[, sapply(int_resis, function(x) any(!is.sir(x) | x == "R select(mo, ab = name) # remove lab drugs -untreatable <- antibiotics[which(antibiotics$name %like% "-high|EDTA|polysorbate|macromethod|screening|/nacubactam"), "ab", drop = TRUE] +untreatable <- antimicrobials[which(antimicrobials$name %like% "-high|EDTA|polysorbate|macromethod|screening|/nacubactam"), "ab", drop = TRUE] # takes ages with filter()..., weird int_resis3 <- int_resis2[which(!int_resis2$ab %in% untreatable), ] class(int_resis3$ab) <- c("ab", "character") int_resis3 all(int_resis3$mo %in% microorganisms$mo) -all(int_resis3$ab %in% antibiotics$ab) +all(int_resis3$ab %in% antimicrobials$ab) intrinsic_resistant <- df_remove_nonASCII(int_resis3) usethis::use_data(intrinsic_resistant, internal = FALSE, overwrite = TRUE, version = 2, compress = "xz") diff --git a/data/antibiotics.rda b/data/antibiotics.rda deleted file mode 100644 index 10e16a4551751a910fab14b2389787fd81a7ab8c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43480 zcmV(rK<>Z&H+ooF0004LBHlIv03iV!0000G&sfaksPUvQ&2UJ%gRpOV>D zs)9rkVDrO9@CKe(@YD<9TLr&QY2tbTr9FEcQkQ~*sO}`f0djJBBDV1$tHKXr=D{rK zQWO(;=v+8gokt;@{Kw*0uk;}OwNINz{cpeW>I4A#(qp1pRU;O~8X&7q{mZ-$KM{52 z962nux5BFOP{zg)``~UpRM8c-;4TTSnV_CDeTEz4JkwDNJ}O^r!&z%!$`z(nH3JlOB=S?n1Fm?GKv&OR#IOdocRet3#^S{7-+`)l zR`MYh0ew}MeSQA>AjSW|=GBI&+sak=VE=j*?P=6Tjc6+-64`FvxmbBhfj?J+vJ=sz*v`&>f=8 zcs(AO)%p?EkUqi24rYJN|HEuQ*Vrtm-_-`|Av3095>?ax(h7lM;T4>OB7iI{l1*`nDsy-p)i;H-Qq*gvvTbO_u!^7_F}{KTR|p*E|Vku z0S;%_^5GV4Gs)j-4LW5(sEO|YQZeW^L5rfpopK5^-1S}U+r;4G8%UN6 z>{t>1AtFU*R6Ib0H}O7$-|GOkflkZ5mN$b46i6>njaz##Et%7v*EbOlt8fG+_xIa8 z7-V}ALq25^%O71fV7Tbhma@OZoEb=&YAQj|fiQ% z?*s9ZV?SV6pOQI{ZW9-&fvBe_QjUukKhG_ zXVN@)NZlMa|Em*SItIWK@Z6B`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k zWQ$Ga_B=9-aK!zPpDND^v-YvGCoK;pZs4$WOjfhBk!XsiW-NI6tAPRT^5$)E+IYaH zMA)JC53FAvJRr$!2zd9Sp+|N&ZFZZuh~IOzp&b|qi>n=R9C%&=tV~5fPd_d;~L?7^TvPIfJ);#*9ubm@?wM zfo;P=Zd_d4G4Htn)Rc*v$^!hO)Kl(rPIjEHCh~8E0i}(iRT+a^Hwg`ay@q#x^L|K|={j#5GP&d*+q>FaVENz5>4bB< z?>AS^J0rUS;k+ZOfdDBIW1R3B0*sY6xQwx%m5-Fezy1uzV=}*@z-X%f38Mf205>>m cF8~3u(*p9*4o20`IX*BAivj=u00045TF;D|E&u=k diff --git a/data/antimicrobials.rda b/data/antimicrobials.rda new file mode 100644 index 0000000000000000000000000000000000000000..1f44d06ceeef06b2dec88cf24bb8cb26db856317 GIT binary patch literal 43488 zcmV(pK=8l)H+ooF0004LBHlIv03iV!0000G&sfaksPw6!T>vQ&2UJ%gRpOV>D zs)9rkVDrO9@CKe(@YECUelWOVArpCN)-b(j#!$c1X{{im2F3-P7czl-4F8y}t(@C* zUV2upaS~!Mq3_ZVg{ekFTvKMYR&(qB5i936Fry^lh>*0p_batRm$N}S!8YxWyd`QL z4Y(PMAqQV;(WO*j1duv2E{6nE z%Wi^p>sp>p+E?z#HqaD~$&SwCJ1TVXjL;xU+PzJ%t*{O4laYSfUNw#5UQ{xpHTp)> zA4_nN;BPN}fF01VJFQUr@(s=MBy1+xA zb`6g)nHJsQ%5|Be`GXr_-F7^EV5z_3rj2Z81dp3M9l2=C#{sqy$X*v`j#N_&?ypTi zH_%R$!C18j%!Vpk?nRlca2w()`HVrWD=pH@b*)B-dAKC=Kh3)Q&njeu~P#+ znfs=i-h@po!{P(y-)7@8a2Yw<6O<=mWJnH9nBYHe$3MT6N@aRM64ff>mL<0AOgs!h z3bNZ(OUtU4;dA$oNIJ_Q2A987tbj#}+a{SK;W>vxpvs#`oajxDhw-&@Hq?_cefcWr zA^lKR%OA@-B_3E|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ddd85f..4782b8e08 100644 --- a/index.md +++ b/index.md @@ -26,7 +26,7 @@ The `AMR` package is a [free and open-source](#copyright) R package with [zero d This work was published in the Journal of Statistical Software (Volume 104(3); [DOI 10.18637/jss.v104.i03](https://doi.org/10.18637/jss.v104.i03)) and formed the basis of two PhD theses ([DOI 10.33612/diss.177417131](https://doi.org/10.33612/diss.177417131) and [DOI 10.33612/diss.192486375](https://doi.org/10.33612/diss.192486375)). -After installing this package, R knows [**~52,000 distinct microbial species**](./reference/microorganisms.html) (updated December 2022) and all [**~600 antibiotic, antimycotic and antiviral drugs**](./reference/antibiotics.html) 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). **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 [University of Groningen](https://www.rug.nl), in collaboration with non-profit organisations [Certe Medical Diagnostics and Advice Foundation](https://www.certe.nl) and [University Medical Center Groningen](https://www.umcg.nl). +After installing this package, R knows [**~52,000 distinct microbial species**](./reference/microorganisms.html) (updated December 2022) and all [**~600 antimicrobial and antiviral drugs**](./reference/antibiotics.html) 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). **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 [University of Groningen](https://www.rug.nl), in collaboration with non-profit organisations [Certe Medical Diagnostics and Advice Foundation](https://www.certe.nl) and [University Medical Center Groningen](https://www.umcg.nl). ##### Used in over 175 countries, available in 20 languages @@ -58,7 +58,7 @@ example_isolates %>% carbapenems()) ``` -With only having defined a row filter on Gram-negative bacteria with intrinsic resistance to cefotaxime (`mo_is_gram_negative()` and `mo_is_intrinsic_resistant()`) and a column selection on two antibiotic groups (`aminoglycosides()` and `carbapenems()`), the reference data about [all microorganisms](./reference/microorganisms.html) and [all antibiotics](./reference/antibiotics.html) in the `AMR` package make sure you get what you meant: +With only having defined a row filter on Gram-negative bacteria with intrinsic resistance to cefotaxime (`mo_is_gram_negative()` and `mo_is_intrinsic_resistant()`) and a column selection on two antibiotic groups (`aminoglycosides()` and `carbapenems()`), the reference data about [all microorganisms](./reference/microorganisms.html) and [all antimicrobials](./reference/antimicrobials.html) in the `AMR` package make sure you get what you meant: |bacteria | GEN | TOB | AMK | KAN | IPM | MEM | |:------------------------------|:---:|:---:|:---:|:---:|:---:|:---:| @@ -81,7 +81,8 @@ If used inside [R Markdown](https://rmarkdown.rstudio.com) or [Quarto](https://q ```r antibiogram(example_isolates, - antibiotics = c(aminoglycosides(), carbapenems())) + antibiotics = c(aminoglycosides(), carbapenems()), + formatting_type = 14) ``` | Pathogen | Amikacin | Gentamicin | Imipenem | Kanamycin | Meropenem | Tobramycin | @@ -102,7 +103,8 @@ In combination antibiograms, it is clear that combined antibiotics yield higher ```r antibiogram(example_isolates, antibiotics = c("TZP", "TZP+TOB", "TZP+GEN"), - mo_transform = "gramstain") + mo_transform = "gramstain", + formatting_type = 14) ``` |Pathogen | Piperacillin/tazobactam | Piperacillin/tazobactam + Gentamicin | Piperacillin/tazobactam + Tobramycin | @@ -117,6 +119,7 @@ antibiogram(example_isolates, antibiotics = c("cipro", "tobra", "genta"), # any arbitrary name or code will work mo_transform = "gramstain", ab_transform = "name", + formatting_type = 14, language = "uk") # Ukrainian ``` diff --git a/man/AMR-deprecated.Rd b/man/AMR-deprecated.Rd index 3ab303ef5..173621038 100644 --- a/man/AMR-deprecated.Rd +++ b/man/AMR-deprecated.Rd @@ -1,16 +1,24 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/zz_deprecated.R +\docType{data} \name{AMR-deprecated} \alias{AMR-deprecated} +\alias{antibiotics} \alias{ab_class} \alias{ab_selector} \title{Deprecated Functions} +\format{ +An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 487 rows and 14 columns. +} \usage{ +antibiotics + ab_class(...) ab_selector(...) } \description{ -These functions are so-called '\link{Deprecated}'. \strong{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). +These objects are so-called '\link{Deprecated}'. \strong{They will be removed in a future version of this package.} Using these will give a warning with the name of the alternative object it has been replaced by (if there is one). } +\keyword{datasets} \keyword{internal} diff --git a/man/AMR-options.Rd b/man/AMR-options.Rd index e31e98651..2412639ee 100644 --- a/man/AMR-options.Rd +++ b/man/AMR-options.Rd @@ -9,7 +9,7 @@ This is an overview of all the package-specific \code{\link[=options]{options()} \section{Options}{ \itemize{ -\item \code{AMR_antibiogram_formatting_type} \cr A \link{numeric} (1-12) to use in \code{\link[=antibiogram]{antibiogram()}}, to indicate which formatting type to use. +\item \code{AMR_antibiogram_formatting_type} \cr A \link{numeric} (1-22) to use in \code{\link[=antibiogram]{antibiogram()}}, to indicate which formatting type to use. \item \code{AMR_breakpoint_type} \cr A \link{character} to use in \code{\link[=as.sir]{as.sir()}}, to indicate which breakpoint type to use. This must be either "ECOFF", "animal", or "human". \item \code{AMR_cleaning_regex} \cr A \link[base:regex]{regular expression} (case-insensitive) to use in \code{\link[=as.mo]{as.mo()}} and all \code{\link[=mo_property]{mo_*}} functions, to clean the user input. The default is the outcome of \code{\link[=mo_cleaning_regex]{mo_cleaning_regex()}}, which removes texts between brackets and texts such as "species" and "serovar". \item \code{AMR_custom_ab} \cr A file location to an RDS file, to use custom antimicrobial drugs with this package. This is explained in \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}}. @@ -38,7 +38,7 @@ In this file, you can set options such as... options(AMR_include_PKPD = TRUE) }\if{html}{\out{
}} -...to add Portuguese language support of antibiotics, and allow PK/PD rules when interpreting MIC values with \code{\link[=as.sir]{as.sir()}}. +...to add Portuguese language support of antimicrobials, and allow PK/PD rules when interpreting MIC values with \code{\link[=as.sir]{as.sir()}}. \subsection{Share Options Within Team}{ For a more global approach, e.g. within a (data) team, save an options file to a remote file location, such as a shared network drive, and have each user read in this file automatically at start-up. This would work in this way: diff --git a/man/AMR.Rd b/man/AMR.Rd index 87c39d697..50cab1dee 100644 --- a/man/AMR.Rd +++ b/man/AMR.Rd @@ -32,13 +32,13 @@ 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/antibiotics.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{~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}. 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. } \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \seealso{ diff --git a/man/WHONET.Rd b/man/WHONET.Rd index e5ee78f9b..cab5cd99f 100644 --- a/man/WHONET.Rd +++ b/man/WHONET.Rd @@ -32,14 +32,14 @@ A \link[tibble:tibble]{tibble} with 500 observations and 53 variables: \item \verb{Inducible clindamycin resistance}\cr Clindamycin can be induced? \item \code{Comment}\cr Other comments \item \verb{Date of data entry}\cr \link{Date} this data was entered in WHONET -\item \code{AMP_ND10:CIP_EE}\cr 28 different antibiotics. You can lookup the abbreviations in the \link{antibiotics} data set, or use e.g. \code{\link[=ab_name]{ab_name("AMP")}} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link[=as.sir]{as.sir()}}. +\item \code{AMP_ND10:CIP_EE}\cr 28 different antimicrobials. You can lookup the abbreviations in the \link{antimicrobials} data set, or use e.g. \code{\link[=ab_name]{ab_name("AMP")}} to get the official name immediately. Before analysis, you should transform this to a valid antimcrobial class, using \code{\link[=as.sir]{as.sir()}}. } } \usage{ WHONET } \description{ -This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antibiotic results are from our \link{example_isolates} data set. All patient names were created using online surname generators and are only in place for practice purposes. +This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antimcrobial results are from our \link{example_isolates} data set. All patient names were created using online surname generators and are only in place for practice purposes. } \details{ Like all data sets in this package, this data set is publicly available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. diff --git a/man/ab_from_text.Rd b/man/ab_from_text.Rd index 218db37a8..da549f34f 100644 --- a/man/ab_from_text.Rd +++ b/man/ab_from_text.Rd @@ -15,7 +15,7 @@ ab_from_text(text, type = c("drug", "dose", "administration"), \item{collapse}{a \link{character} to pass on to \code{paste(, collapse = ...)} to only return one \link{character} per element of \code{text}, see \emph{Examples}} -\item{translate_ab}{if \code{type = "drug"}: a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}. The default is \code{FALSE}. Using \code{TRUE} is equal to using "name".} +\item{translate_ab}{if \code{type = "drug"}: a column name of the \link{antimicrobials} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}. The default is \code{FALSE}. Using \code{TRUE} is equal to using "name".} \item{thorough_search}{a \link{logical} to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to \code{TRUE} will take considerably more time than when using \code{FALSE}. At default, it will turn \code{TRUE} when all input elements contain a maximum of three words.} diff --git a/man/ab_property.Rd b/man/ab_property.Rd index 1b438c155..2f844468c 100644 --- a/man/ab_property.Rd +++ b/man/ab_property.Rd @@ -65,7 +65,7 @@ set_ab_names(data, ..., property = "name", language = get_AMR_locale(), \item{open}{browse the URL using \code{\link[utils:browseURL]{utils::browseURL()}}} -\item{property}{one of the column names of one of the \link{antibiotics} data set: \code{vector_or(colnames(antibiotics), sort = FALSE)}.} +\item{property}{one of the column names of one of the \link{antimicrobials} data set: \code{vector_or(colnames(antimicrobials), sort = FALSE)}.} \item{data}{a \link{data.frame} of which the columns need to be renamed, or a \link{character} vector of column names} @@ -81,7 +81,7 @@ set_ab_names(data, ..., property = "name", language = get_AMR_locale(), } } \description{ -Use these functions to return a specific property of an antibiotic from the \link{antibiotics} data set. All input values will be evaluated internally with \code{\link[=as.ab]{as.ab()}}. +Use these functions to return a specific property of an antibiotic from the \link{antimicrobials} data set. All input values will be evaluated internally with \code{\link[=as.ab]{as.ab()}}. } \details{ All output \link[=translate]{will be translated} where possible. @@ -99,7 +99,7 @@ European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{htt \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -168,5 +168,5 @@ if (require("dplyr")) { } } \seealso{ -\link{antibiotics} +\link{antimicrobials} } diff --git a/man/add_custom_antimicrobials.Rd b/man/add_custom_antimicrobials.Rd index 85c0625b1..913b05e2c 100644 --- a/man/add_custom_antimicrobials.Rd +++ b/man/add_custom_antimicrobials.Rd @@ -10,7 +10,7 @@ add_custom_antimicrobials(x) clear_custom_antimicrobials() } \arguments{ -\item{x}{a \link{data.frame} resembling the \link{antibiotics} data set, at least containing columns "ab" and "name"} +\item{x}{a \link{data.frame} resembling the \link{antimicrobials} data set, at least containing columns "ab" and "name"} } \description{ With \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}} you can add your own custom antimicrobial drug names and codes. @@ -22,7 +22,7 @@ There are two ways to circumvent this and automate the process of adding antimic \strong{Method 1:} Using the package option \code{\link[=AMR-options]{AMR_custom_ab}}, which is the preferred method. To use this method: \enumerate{ -\item Create a data set in the structure of the \link{antibiotics} data set (containing at the very least columns "ab" and "name") and save it with \code{\link[=saveRDS]{saveRDS()}} to a location of choice, e.g. \code{"~/my_custom_ab.rds"}, or any remote location. +\item Create a data set in the structure of the \link{antimicrobials} data set (containing at the very least columns "ab" and "name") and save it with \code{\link[=saveRDS]{saveRDS()}} to a location of choice, e.g. \code{"~/my_custom_ab.rds"}, or any remote location. \item Set the file location to the package option \code{\link[=AMR-options]{AMR_custom_ab}}: \code{options(AMR_custom_ab = "~/my_custom_ab.rds")}. This can even be a remote file location, such as an https URL. Since options are not saved between \R sessions, it is best to save this option to the \code{.Rprofile} file so that it will be loaded on start-up of \R. To do this, open the \code{.Rprofile} file using e.g. \code{utils::file.edit("~/.Rprofile")}, add this text and save the file: \if{html}{\out{
}}\preformatted{# Add custom antimicrobial codes: @@ -60,7 +60,7 @@ add_custom_antimicrobials( ab = "TESTAB", name = "Test Antibiotic", # you can add any property present in the - # 'antibiotics' data set, such as 'group': + # 'antimicrobials' data set, such as 'group': group = "Test Group" ) ) diff --git a/man/antibiogram.Rd b/man/antibiogram.Rd index c3c4af969..0412272f0 100644 --- a/man/antibiogram.Rd +++ b/man/antibiogram.Rd @@ -21,10 +21,10 @@ antibiogram(x, antibiotics = where(is.sir), mo_transform = "shortname", ab_transform = "name", syndromic_group = NULL, add_total_n = FALSE, only_all_tested = FALSE, digits = ifelse(wisca, 1, 0), - formatting_type = getOption("AMR_antibiogram_formatting_type", 14), - col_mo = NULL, language = get_AMR_locale(), minimum = 30, - combine_SI = TRUE, sep = " + ", wisca = FALSE, simulations = 1000, - conf_interval = 0.95, interval_side = "two-tailed", + formatting_type = getOption("AMR_antibiogram_formatting_type", + ifelse(wisca, 14, 18)), col_mo = NULL, language = get_AMR_locale(), + minimum = 30, combine_SI = TRUE, sep = " + ", wisca = FALSE, + simulations = 1000, conf_interval = 0.95, interval_side = "two-tailed", info = interactive()) wisca(x, antibiotics = where(is.sir), ab_transform = "name", @@ -52,7 +52,7 @@ retrieve_wisca_parameters(wisca_model, ...) \item{mo_transform}{a character to transform microorganism input - must be \code{"name"}, \code{"shortname"} (default), \code{"gramstain"}, or one of the column names of the \link{microorganisms} data set: "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", or "snomed". Can also be \code{NULL} to not transform the input or \code{NA} to consider all microorganisms 'unknown'.} -\item{ab_transform}{a character to transform antimicrobial input - must be one of the column names of the \link{antibiotics} data set (defaults to \code{"name"}): "ab", "cid", "name", "group", "atc", "atc_group1", "atc_group2", "abbreviations", "synonyms", "oral_ddd", "oral_units", "iv_ddd", "iv_units", or "loinc". Can also be \code{NULL} to not transform the input.} +\item{ab_transform}{a character to transform antimicrobial input - must be one of the column names of the \link{antimicrobials} data set (defaults to \code{"name"}): "ab", "cid", "name", "group", "atc", "atc_group1", "atc_group2", "abbreviations", "synonyms", "oral_ddd", "oral_units", "iv_ddd", "iv_units", or "loinc". Can also be \code{NULL} to not transform the input.} \item{syndromic_group}{a column name of \code{x}, or values calculated to split rows of \code{x}, e.g. by using \code{\link[=ifelse]{ifelse()}} or \code{\link[dplyr:case_when]{case_when()}}. See \emph{Examples}.} @@ -109,7 +109,7 @@ For estimating antimicrobial coverage, especially when creating a WISCA, the out The numeric values of an antibiogram are stored in a long format as the \link[=attributes]{attribute} \code{long_numeric}. You can retrieve them using \code{attributes(x)$long_numeric}, where \code{x} is the outcome of \code{\link[=antibiogram]{antibiogram()}} or \code{\link[=wisca]{wisca()}}. This is ideal for e.g. advanced plotting. \subsection{Formatting Type}{ -The formatting of the 'cells' of the table can be set with the argument \code{formatting_type}. In these examples, \code{5} is the antimicrobial coverage (\code{4-6} indicates the confidence level), \code{15} the number of susceptible isolates, and \code{300} the number of tested (i.e., available) isolates: +The formatting of the 'cells' of the table can be set with the argument \code{formatting_type}. In these examples, \code{5} indicates the antimicrobial coverage (\code{4-6} the confidence level), \code{15} the number of susceptible isolates, and \code{300} the number of tested (i.e., available) isolates: \enumerate{ \item 5 \item 15 @@ -124,18 +124,18 @@ The formatting of the 'cells' of the table can be set with the argument \code{fo \item 5 (N=15/300) \item 5\% (N=15/300) \item 5 (4-6) -\item 5\% (4-6\%) - \strong{default} +\item 5\% (4-6\%) - \strong{default for WISCA} \item 5 (4-6,300) \item 5\% (4-6\%,300) \item 5 (4-6,N=300) -\item 5\% (4-6\%,N=300) +\item 5\% (4-6\%,N=300) - \strong{default for non-WISCA} \item 5 (4-6,15/300) \item 5\% (4-6\%,15/300) \item 5 (4-6,N=15/300) \item 5\% (4-6\%,N=15/300) } -The default is \code{14}, which can be set globally with the package option \code{\link[=AMR-options]{AMR_antibiogram_formatting_type}}, e.g. \code{options(AMR_antibiogram_formatting_type = 5)}. Do note that for WISCA, the total numbers of tested and susceptible isolates are less useful to report, since these are included in the Bayesian model and apparent from the susceptibility and its confidence level. +The default can be set globally with the package option \code{\link[=AMR-options]{AMR_antibiogram_formatting_type}}, e.g. \code{options(AMR_antibiogram_formatting_type = 5)}. Do note that for WISCA, the total numbers of tested and susceptible isolates are less useful to report, since these are included in the Bayesian model and apparent from the susceptibility and its confidence level. Set \code{digits} (defaults to \code{0}) to alter the rounding of the susceptibility percentages. } diff --git a/man/antimicrobial_selectors.Rd b/man/antimicrobial_selectors.Rd index fc29ac4db..d3f033134 100644 --- a/man/antimicrobial_selectors.Rd +++ b/man/antimicrobial_selectors.Rd @@ -130,9 +130,9 @@ not_intrinsic_resistant(only_sir_columns = FALSE, col_mo = NULL, \item{...}{ignored, only in place to allow future extensions} -\item{amr_class}{an antimicrobial class or a part of it, such as \code{"carba"} and \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.} +\item{amr_class}{an antimicrobial class or a part of it, such as \code{"carba"} and \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antimicrobials} data set will be searched (case-insensitive) for this value.} -\item{filter}{an \link{expression} to be evaluated in the \link{antibiotics} data set, such as \code{name \%like\% "trim"}} +\item{filter}{an \link{expression} to be evaluated in the \link{antimicrobials} data set, such as \code{name \%like\% "trim"}} \item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}) - the default is the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} @@ -156,13 +156,13 @@ These functions can be used in data set calls for selecting columns and filterin All selectors can also be used in \code{tidymodels} packages such as \code{recipe} and \code{parsnip}. See for more info \href{https://msberends.github.io/AMR/articles/AMR_with_tidymodels.html}{our tutorial} on using antimicrobial selectors for predictive modelling. -All columns in the data in which these functions are called will be searched for known antimicrobial names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) according to the \link{antibiotics} data set. This means that a selector such as \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. +All columns in the data in which these functions are called will be searched for known antimicrobial names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) according to the \link{antimicrobials} data set. This means that a selector such as \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc. -The \code{\link[=amr_class]{amr_class()}} function can be used to filter/select on a manually defined antimicrobial class. It searches for results in the \link{antibiotics} data set within the columns \code{group}, \code{atc_group1} and \code{atc_group2}. +The \code{\link[=amr_class]{amr_class()}} function can be used to filter/select on a manually defined antimicrobial class. It searches for results in the \link{antimicrobials} data set within the columns \code{group}, \code{atc_group1} and \code{atc_group2}. -The \code{\link[=administrable_per_os]{administrable_per_os()}} and \code{\link[=administrable_iv]{administrable_iv()}} functions also rely on the \link{antibiotics} data set - antimicrobials will be matched where a DDD (defined daily dose) for resp. oral and IV treatment is available in the \link{antibiotics} data set. +The \code{\link[=administrable_per_os]{administrable_per_os()}} and \code{\link[=administrable_iv]{administrable_iv()}} functions also rely on the \link{antimicrobials} data set - antimicrobials will be matched where a DDD (defined daily dose) for resp. oral and IV treatment is available in the \link{antimicrobials} data set. -The \code{\link[=amr_selector]{amr_selector()}} function can be used to internally filter the \link{antibiotics} data set on any results, see \emph{Examples}. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set. +The \code{\link[=amr_selector]{amr_selector()}} function can be used to internally filter the \link{antimicrobials} data set on any results, see \emph{Examples}. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set. The \code{\link[=not_intrinsic_resistant]{not_intrinsic_resistant()}} function can be used to only select antimicrobials that pose no intrinsic resistance for the microorganisms in the data set. For example, if a data set contains only microorganism codes or names of \emph{E. coli} and \emph{K. pneumoniae} and contains a column "vancomycin", this column will be removed (or rather, unselected) using this function. It currently applies \href{https://www.eucast.org/expert_rules_and_expected_phenotypes}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021) to determine intrinsic resistance, using the \code{\link[=eucast_rules]{eucast_rules()}} function internally. Because of this determination, this function is quite slow in terms of performance. } @@ -205,7 +205,7 @@ The \code{\link[=not_intrinsic_resistant]{not_intrinsic_resistant()}} function c \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -341,7 +341,7 @@ example_isolates[any(carbapenems() == "R"), penicillins()] # and erythromycin is not a penicillin: example_isolates[, penicillins() & administrable_per_os()] -# amr_selector() applies a filter in the `antibiotics` data set and is thus +# amr_selector() applies a filter in the `antimicrobials` data set and is thus # very flexible. For instance, to select antimicrobials with an oral DDD # of at least 1 gram: example_isolates[, amr_selector(oral_ddd > 1 & oral_units == "g")] diff --git a/man/antibiotics.Rd b/man/antimicrobials.Rd similarity index 84% rename from man/antibiotics.Rd rename to man/antimicrobials.Rd index d4c71cdce..5d8ac88d4 100644 --- a/man/antibiotics.Rd +++ b/man/antimicrobials.Rd @@ -1,21 +1,22 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.R \docType{data} -\name{antibiotics} +\name{antimicrobials} +\alias{antimicrobials} \alias{antibiotics} \alias{antivirals} \title{Data Sets with 607 Antimicrobial Drugs} \format{ -\subsection{For the \link{antibiotics} data set: a \link[tibble:tibble]{tibble} with 487 observations and 14 variables:}{ +\subsection{For the \link{antimicrobials} data set: a \link[tibble:tibble]{tibble} with 487 observations and 14 variables:}{ \itemize{ -\item \code{ab}\cr Antibiotic 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{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.}} \item \code{name}\cr Official name as used by WHONET/EARS-Net or the WHO. \emph{\strong{This is a unique identifier.}} \item \code{group}\cr A short and concise group name, based on WHONET and WHOCC definitions \item \code{atc}\cr ATC codes (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02} \item \code{atc_group1}\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like \code{"Macrolides, lincosamides and streptogramins"} \item \code{atc_group2}\cr Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like \code{"Macrolides"} -\item \code{abbr}\cr List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST) +\item \code{abbr}\cr List of abbreviations as used in many countries, also for antimcrobial susceptibility testing (AST) \item \code{synonyms}\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID \item \code{oral_ddd}\cr Defined Daily Dose (DDD), oral treatment, currently available for 179 drugs \item \code{oral_units}\cr Units of \code{oral_ddd} @@ -51,12 +52,12 @@ An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) w } } \usage{ -antibiotics +antimicrobials antivirals } \description{ -Two data sets containing all antibiotics/antimycotics 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{antibiotics} data set. Three identifiers are included in this data set: an antibiotic 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 antimcrobial 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. } \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}. @@ -79,7 +80,7 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun } \examples{ -antibiotics +antimicrobials antivirals } \seealso{ diff --git a/man/as.ab.Rd b/man/as.ab.Rd index 80ff9a700..37bfcb34d 100644 --- a/man/as.ab.Rd +++ b/man/as.ab.Rd @@ -29,10 +29,10 @@ ab_reset_session() A \link{character} \link{vector} with additional class \code{\link{ab}} } \description{ -Use this function to determine the antibiotic drug code of one or more antibiotics. The data set \link{antibiotics} will be searched for abbreviations, official names and synonyms (brand names). +Use this function to determine the antimicrobial drug code of one or more antimicrobials. The data set \link{antimicrobials} will be searched for abbreviations, official names and synonyms (brand names). } \details{ -All entries in the \link{antibiotics} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. Not that some drugs contain multiple ATC codes. +All entries in the \link{antimicrobials} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. Not that some drugs contain multiple ATC codes. All these properties will be searched for the user input. The \code{\link[=as.ab]{as.ab()}} can correct for different forms of misspelling: \itemize{ @@ -68,7 +68,7 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ @@ -104,7 +104,7 @@ if (require("dplyr")) { } \seealso{ \itemize{ -\item \link{antibiotics} for the \link{data.frame} that is being used to determine ATCs +\item \link{antimicrobials} for the \link{data.frame} that is being used to determine ATCs \item \code{\link[=ab_from_text]{ab_from_text()}} for a function to retrieve antimicrobial drugs from clinical text (from health care records) } } diff --git a/man/as.av.Rd b/man/as.av.Rd index 441eaf1d4..6221ec3d1 100644 --- a/man/as.av.Rd +++ b/man/as.av.Rd @@ -60,7 +60,7 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ diff --git a/man/as.mo.Rd b/man/as.mo.Rd index 119f7b43f..623a91eb0 100644 --- a/man/as.mo.Rd +++ b/man/as.mo.Rd @@ -204,7 +204,7 @@ All matches are sorted descending on their matching score and for all user input \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ diff --git a/man/as.sir.Rd b/man/as.sir.Rd index c7fd595b6..a3234c993 100644 --- a/man/as.sir.Rd +++ b/man/as.sir.Rd @@ -224,7 +224,7 @@ This AMR package honours this insight. Use \code{\link[=susceptibility]{suscepti \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ diff --git a/man/atc_online.Rd b/man/atc_online.Rd index 7336ca760..95ae2c4c8 100644 --- a/man/atc_online.Rd +++ b/man/atc_online.Rd @@ -21,7 +21,7 @@ atc_online_ddd(atc_code, ...) atc_online_ddd_units(atc_code, ...) } \arguments{ -\item{atc_code}{a \link{character} (vector) with ATC code(s) of antibiotics, will be coerced with \code{\link[=as.ab]{as.ab()}} and \code{\link[=ab_atc]{ab_atc()}} internally if not a valid ATC code} +\item{atc_code}{a \link{character} (vector) with ATC code(s) of antimicrobials, will be coerced with \code{\link[=as.ab]{as.ab()}} and \code{\link[=ab_atc]{ab_atc()}} internally if not a valid ATC code} \item{property}{property of an ATC code. Valid values are \code{"ATC"}, \code{"Name"}, \code{"DDD"}, \code{"U"} (\code{"unit"}), \code{"Adm.R"}, \code{"Note"} and \code{groups}. For this last option, all hierarchical groups of an ATC code will be returned, see \emph{Examples}.} @@ -34,7 +34,7 @@ atc_online_ddd_units(atc_code, ...) \item{...}{arguments to pass on to \code{atc_property}} } \description{ -Gets data from the WHOCC website to determine properties of an Anatomical Therapeutic Chemical (ATC) (e.g. an antibiotic), such as the name, defined daily dose (DDD) or standard unit. +Gets data from the WHOCC website to determine properties of an Anatomical Therapeutic Chemical (ATC) (e.g. an antimicrobial), such as the name, defined daily dose (DDD) or standard unit. } \details{ Options for argument \code{administration}: diff --git a/man/av_property.Rd b/man/av_property.Rd index 9e75b0b4d..eabb0fd75 100644 --- a/man/av_property.Rd +++ b/man/av_property.Rd @@ -79,7 +79,7 @@ European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{htt \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ diff --git a/man/bug_drug_combinations.Rd b/man/bug_drug_combinations.Rd index 8a2206b83..550083624 100644 --- a/man/bug_drug_combinations.Rd +++ b/man/bug_drug_combinations.Rd @@ -15,7 +15,7 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ",", ".", ","), ...) } \arguments{ -\item{x}{a data set with antibiotic columns, such as \code{amox}, \code{AMX} and \code{AMC}} +\item{x}{a data set with antimicrobials columns, such as \code{amox}, \code{AMX} and \code{AMC}} \item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}) - the default is the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} @@ -25,7 +25,7 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, \item{...}{arguments passed on to \code{FUN}} -\item{translate_ab}{a \link{character} of length 1 containing column names of the \link{antibiotics} data set} +\item{translate_ab}{a \link{character} of length 1 containing column names of the \link{antimicrobials} data set} \item{language}{language of the returned text - the default is the current system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with the package option \code{\link[=AMR-options]{AMR_locale}}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} diff --git a/man/clinical_breakpoints.Rd b/man/clinical_breakpoints.Rd index 2feb722b4..a06d1253d 100644 --- a/man/clinical_breakpoints.Rd +++ b/man/clinical_breakpoints.Rd @@ -14,7 +14,7 @@ A \link[tibble:tibble]{tibble} with 34 063 observations and 14 variables: \item \code{site}\cr Body site for which the breakpoint must be applied, e.g. "Oral" or "Respiratory" \item \code{mo}\cr Microbial ID, see \code{\link[=as.mo]{as.mo()}} \item \code{rank_index}\cr Taxonomic rank index of \code{mo} from 1 (subspecies/infraspecies) to 5 (unknown microorganism) -\item \code{ab}\cr Antibiotic code as used by this package, EARS-Net and WHONET, see \code{\link[=as.ab]{as.ab()}} +\item \code{ab}\cr Antimcrobial code as used by this package, EARS-Net and WHONET, see \code{\link[=as.ab]{as.ab()}} \item \code{ref_tbl}\cr Info about where the guideline rule can be found \item \code{disk_dose}\cr Dose of the used disk diffusion method \item \code{breakpoint_S}\cr Lowest MIC value or highest number of millimetres that leads to "S" diff --git a/man/count.Rd b/man/count.Rd index 1f77c99d0..4b7aed3f1 100644 --- a/man/count.Rd +++ b/man/count.Rd @@ -38,11 +38,11 @@ count_df(data, translate_ab = "name", language = get_AMR_locale(), \arguments{ \item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link[=as.sir]{as.sir()}} if needed.} -\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}): a \link{logical} to indicate that isolates must be tested for all antibiotics, see section \emph{Combination Therapy} below} +\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}): a \link{logical} to indicate that isolates must be tested for all antimicrobials, see section \emph{Combination Therapy} below} \item{data}{a \link{data.frame} containing columns with class \code{\link{sir}} (see \code{\link[=as.sir]{as.sir()}})} -\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} +\item{translate_ab}{a column name of the \link{antimicrobials} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} \item{language}{language of the returned text - the default is the current system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with the package option \code{\link[=AMR-options]{AMR_locale}}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} @@ -61,7 +61,7 @@ These functions are meant to count isolates. Use the \code{\link[=resistance]{re The function \code{\link[=count_resistant]{count_resistant()}} is equal to the function \code{\link[=count_R]{count_R()}}. The function \code{\link[=count_susceptible]{count_susceptible()}} is equal to the function \code{\link[=count_SI]{count_SI()}}. -The function \code{\link[=n_sir]{n_sir()}} is an alias of \code{\link[=count_all]{count_all()}}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{n_distinct()}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. +The function \code{\link[=n_sir]{n_sir()}} is an alias of \code{\link[=count_all]{count_all()}}. They can be used to count all available isolates, i.e. where all input antimicrobials have an available result (S, I or R). Their use is equal to \code{n_distinct()}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. The function \code{\link[=count_df]{count_df()}} takes any variable from \code{data} that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) and counts the number of S's, I's and R's. It also supports grouped variables. The function \code{\link[=sir_df]{sir_df()}} works exactly like \code{\link[=count_df]{count_df()}}, but adds the percentage of S, I and R. } @@ -85,7 +85,7 @@ This AMR package honours this insight. Use \code{\link[=susceptibility]{suscepti \section{Combination Therapy}{ -When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI: +When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antimicrobials, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI: \if{html}{\out{
}}\preformatted{-------------------------------------------------------------------- only_all_tested = FALSE only_all_tested = TRUE diff --git a/man/custom_eucast_rules.Rd b/man/custom_eucast_rules.Rd index 0e513db4a..47e1dc18a 100644 --- a/man/custom_eucast_rules.Rd +++ b/man/custom_eucast_rules.Rd @@ -72,11 +72,11 @@ eucast_rules(df, rules = "custom", custom_rules = y, info = FALSE) }\if{html}{\out{
}} } -\subsection{Usage of multiple antibiotics and antibiotic group names}{ +\subsection{Usage of multiple antimicrobials and antimicrobial group names}{ -You can define antibiotic groups instead of single antibiotics for the rule consequence, which is the part \emph{after} the tilde (~). In the examples above, the antibiotic group \code{aminopenicillins} includes both ampicillin and amoxicillin. +You can define antimicrobial groups instead of single antimicrobials for the rule consequence, which is the part \emph{after} the tilde (~). In the examples above, the antimicrobial group \code{aminopenicillins} includes both ampicillin and amoxicillin. -Rules can also be applied to multiple antibiotics and antibiotic groups simultaneously. Use the \code{c()} function to combine multiple antibiotics. For instance, the following example sets all aminopenicillins and ureidopenicillins to "R" if column TZP (piperacillin/tazobactam) is "R": +Rules can also be applied to multiple antimicrobials and antimicrobial groups simultaneously. Use the \code{c()} function to combine multiple antimicrobials. For instance, the following example sets all aminopenicillins and ureidopenicillins to "R" if column TZP (piperacillin/tazobactam) is "R": \if{html}{\out{
}}\preformatted{x <- custom_eucast_rules(TZP == "R" ~ c(aminopenicillins, ureidopenicillins) == "R") x @@ -86,7 +86,7 @@ x #> amoxicillin (AMX), ampicillin (AMP), azlocillin (AZL), mezlocillin (MEZ), piperacillin (PIP), piperacillin/tazobactam (TZP) }\if{html}{\out{
}} -These 34 antibiotic groups are allowed in the rules (case-insensitive) and can be used in any combination: +These 34 antimicrobial groups are allowed in the rules (case-insensitive) and can be used in any combination: \itemize{ \item aminoglycosides\cr(amikacin, amikacin/fosfomycin, apramycin, arbekacin, astromicin, bekanamycin, dibekacin, framycetin, gentamicin, gentamicin-high, habekacin, hygromycin, isepamicin, kanamycin, kanamycin-high, kanamycin/cephalexin, micronomicin, neomycin, netilmicin, pentisomicin, plazomicin, propikacin, ribostamycin, sisomicin, streptoduocin, streptomycin, streptomycin-high, tobramycin, and tobramycin-high) \item aminopenicillins\cr(amoxicillin and ampicillin) diff --git a/man/dosage.Rd b/man/dosage.Rd index f63458f8c..1ef1458e1 100644 --- a/man/dosage.Rd +++ b/man/dosage.Rd @@ -7,7 +7,7 @@ \format{ A \link[tibble:tibble]{tibble} with 503 observations and 9 variables: \itemize{ -\item \code{ab}\cr Antibiotic ID as used in this package (such as \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available +\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 \item \code{name}\cr Official name of the antimicrobial drug as used by WHONET/EARS-Net or the WHO \item \code{type}\cr Type of the dosage, either "high_dosage", "standard_dosage", or "uncomplicated_uti" \item \code{dose}\cr Dose, such as "2 g" or "25 mg/kg" diff --git a/man/eucast_rules.Rd b/man/eucast_rules.Rd index 90f011976..fa6a81ead 100644 --- a/man/eucast_rules.Rd +++ b/man/eucast_rules.Rd @@ -28,7 +28,7 @@ eucast_rules(x, col_mo = NULL, info = interactive(), eucast_dosage(ab, administration = "iv", version_breakpoints = 12) } \arguments{ -\item{x}{a data set with antibiotic columns, such as \code{amox}, \code{AMX} and \code{AMC}} +\item{x}{a data set with antimicrobials columns, such as \code{amox}, \code{AMX} and \code{AMC}} \item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}) - the default is the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} @@ -44,20 +44,20 @@ eucast_dosage(ab, administration = "iv", version_breakpoints = 12) \item{ampc_cephalosporin_resistance}{a \link{character} value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants - the default is \code{NA}. Currently only works when \code{version_expertrules} is \code{3.2} and higher; these version of '\emph{EUCAST Expert Rules on Enterobacterales}' state that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three drugs. A value of \code{NA} (the default) for this argument will remove results for these three drugs, while e.g. a value of \code{"R"} will make the results for these drugs resistant. Use \code{NULL} or \code{FALSE} to not alter results for these three drugs of AmpC de-repressed cephalosporin-resistant mutants. Using \code{TRUE} is equal to using \code{"R"}. \cr For \emph{EUCAST Expert Rules} v3.2, this rule applies to: \emph{Citrobacter braakii}, \emph{Citrobacter freundii}, \emph{Citrobacter gillenii}, \emph{Citrobacter murliniae}, \emph{Citrobacter rodenticum}, \emph{Citrobacter sedlakii}, \emph{Citrobacter werkmanii}, \emph{Citrobacter youngae}, \emph{Enterobacter}, \emph{Hafnia alvei}, \emph{Klebsiella aerogenes}, \emph{Morganella morganii}, \emph{Providencia}, and \emph{Serratia}.} -\item{only_sir_columns}{a \link{logical} to indicate whether only antibiotic columns must be detected that were transformed to class \code{sir} (see \code{\link[=as.sir]{as.sir()}}) on beforehand (default is \code{FALSE})} +\item{only_sir_columns}{a \link{logical} to indicate whether only antimicrobial columns must be detected that were transformed to class \code{sir} (see \code{\link[=as.sir]{as.sir()}}) on beforehand (default is \code{FALSE})} \item{custom_rules}{custom rules to apply, created with \code{\link[=custom_eucast_rules]{custom_eucast_rules()}}} \item{overwrite}{a \link{logical} to indicate whether non-\code{NA} values must be overwritten (defaults to \code{TRUE}). With \code{FALSE}, only \code{NA} values are changed.} -\item{...}{column name of an antibiotic, see section \emph{Antibiotics} below} +\item{...}{column name of an antimicrobial, see section \emph{Antimicrobials} below} -\item{ab}{any (vector of) text that can be coerced to a valid antibiotic drug code with \code{\link[=as.ab]{as.ab()}}} +\item{ab}{any (vector of) text that can be coerced to a valid antimicrobial drug code with \code{\link[=as.ab]{as.ab()}}} \item{administration}{route of administration, either "im", "iv", or "oral"} } \value{ -The input of \code{x}, possibly with edited values of antibiotics. Or, if \code{verbose = TRUE}, a \link{data.frame} with all original and new values of the affected bug-drug combinations. +The input of \code{x}, possibly with edited values of antimicrobials. Or, if \code{verbose = TRUE}, a \link{data.frame} with all original and new values of the affected bug-drug combinations. } \description{ Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{https://www.eucast.org}), see \emph{Source}. Use \code{\link[=eucast_dosage]{eucast_dosage()}} to get a \link{data.frame} with advised dosages of a certain bug-drug combination, which is based on the \link{dosage} data set. @@ -93,18 +93,18 @@ Important examples include amoxicillin and amoxicillin/clavulanic acid, and trim Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include \code{"other"} to the \code{rules} argument, or use \code{eucast_rules(..., rules = "all")}. You can also set the package option \code{\link[=AMR-options]{AMR_eucastrules}}, i.e. run \code{options(AMR_eucastrules = "all")}. } } -\section{Antibiotics}{ +\section{Antimicrobials}{ -To define antibiotics column names, leave as it is to determine it automatically with \code{\link[=guess_ab_col]{guess_ab_col()}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. +To define antimicrobials column names, leave as it is to determine it automatically with \code{\link[=guess_ab_col]{guess_ab_col()}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. -The following antibiotics are eligible for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format 'name (\verb{antimicrobial ID}, \href{https://atcddd.fhi.no/atc/structure_and_principles/}{ATC code})', sorted alphabetically: +The following antimicrobials are eligible for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format 'name (\verb{antimicrobial ID}, \href{https://atcddd.fhi.no/atc/structure_and_principles/}{ATC code})', sorted alphabetically: Amikacin (\code{AMK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB06&showdescription=no}{J01GB06}), amoxicillin (\code{AMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA04&showdescription=no}{J01CA04}), amoxicillin/clavulanic acid (\code{AMC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR02&showdescription=no}{J01CR02}), ampicillin (\code{AMP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA01&showdescription=no}{J01CA01}), ampicillin/sulbactam (\code{SAM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR01&showdescription=no}{J01CR01}), apramycin (\code{APR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QA07AA92&showdescription=no}{QA07AA92}), arbekacin (\code{ARB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB12&showdescription=no}{J01GB12}), aspoxicillin (\code{APX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA19&showdescription=no}{J01CA19}), azidocillin (\code{AZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE04&showdescription=no}{J01CE04}), azithromycin (\code{AZM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA10&showdescription=no}{J01FA10}), azlocillin (\code{AZL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA09&showdescription=no}{J01CA09}), aztreonam (\code{ATM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DF01&showdescription=no}{J01DF01}), bacampicillin (\code{BAM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA06&showdescription=no}{J01CA06}), bekanamycin (\code{BEK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB13&showdescription=no}{J01GB13}), benzathine benzylpenicillin (\code{BNB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE08&showdescription=no}{J01CE08}), benzathine phenoxymethylpenicillin (\code{BNP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE10&showdescription=no}{J01CE10}), benzylpenicillin (\code{PEN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE01&showdescription=no}{J01CE01}), besifloxacin (\code{BES}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=S01AE08&showdescription=no}{S01AE08}), biapenem (\code{BIA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH05&showdescription=no}{J01DH05}), carbenicillin (\code{CRB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA03&showdescription=no}{J01CA03}), carindacillin (\code{CRN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA05&showdescription=no}{J01CA05}), carumonam (\code{CAR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DF02&showdescription=no}{J01DF02}), cefacetrile (\code{CAC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB10&showdescription=no}{J01DB10}), cefaclor (\code{CEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC04&showdescription=no}{J01DC04}), cefadroxil (\code{CFR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB05&showdescription=no}{J01DB05}), cefalexin (\code{LEX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB01&showdescription=no}{J01DB01}), cefaloridine (\code{RID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB02&showdescription=no}{J01DB02}), cefalotin (\code{CEP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB03&showdescription=no}{J01DB03}), cefamandole (\code{MAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC03&showdescription=no}{J01DC03}), cefapirin (\code{HAP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB08&showdescription=no}{J01DB08}), cefatrizine (\code{CTZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB07&showdescription=no}{J01DB07}), cefazedone (\code{CZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB06&showdescription=no}{J01DB06}), cefazolin (\code{CZO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB04&showdescription=no}{J01DB04}), cefcapene (\code{CCP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD17&showdescription=no}{J01DD17}), cefdinir (\code{CDR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD15&showdescription=no}{J01DD15}), cefditoren (\code{DIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD16&showdescription=no}{J01DD16}), cefepime (\code{FEP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE01&showdescription=no}{J01DE01}), cefepime/amikacin (\code{CFA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01RA06&showdescription=no}{J01RA06}), cefetamet (\code{CAT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD10&showdescription=no}{J01DD10}), cefiderocol (\code{FDC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI04&showdescription=no}{J01DI04}), cefixime (\code{CFM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD08&showdescription=no}{J01DD08}), cefmenoxime (\code{CMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD05&showdescription=no}{J01DD05}), cefmetazole (\code{CMZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC09&showdescription=no}{J01DC09}), cefodizime (\code{DIZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD09&showdescription=no}{J01DD09}), cefonicid (\code{CID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC06&showdescription=no}{J01DC06}), cefoperazone (\code{CFP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD12&showdescription=no}{J01DD12}), cefoperazone/sulbactam (\code{CSL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD62&showdescription=no}{J01DD62}), ceforanide (\code{CND}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC11&showdescription=no}{J01DC11}), cefotaxime (\code{CTX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD01&showdescription=no}{J01DD01}), cefotaxime/clavulanic acid (\code{CTC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD51&showdescription=no}{J01DD51}), cefotetan (\code{CTT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC05&showdescription=no}{J01DC05}), cefotiam (\code{CTF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC07&showdescription=no}{J01DC07}), cefovecin (\code{FOV}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01DD91&showdescription=no}{QJ01DD91}), cefoxitin (\code{FOX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC01&showdescription=no}{J01DC01}), cefozopran (\code{ZOP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE03&showdescription=no}{J01DE03}), cefpiramide (\code{CPM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD11&showdescription=no}{J01DD11}), cefpirome (\code{CPO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE02&showdescription=no}{J01DE02}), cefpodoxime (\code{CPD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD13&showdescription=no}{J01DD13}), cefprozil (\code{CPR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC10&showdescription=no}{J01DC10}), cefquinome (\code{CEQ}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QG51AA07&showdescription=no}{QG51AA07}), cefroxadine (\code{CRD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB11&showdescription=no}{J01DB11}), cefsulodin (\code{CFS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD03&showdescription=no}{J01DD03}), ceftaroline (\code{CPT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI02&showdescription=no}{J01DI02}), ceftazidime (\code{CAZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD02&showdescription=no}{J01DD02}), ceftazidime/clavulanic acid (\code{CCV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD52&showdescription=no}{J01DD52}), cefteram (\code{CEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD18&showdescription=no}{J01DD18}), ceftezole (\code{CTL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB12&showdescription=no}{J01DB12}), ceftibuten (\code{CTB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD14&showdescription=no}{J01DD14}), ceftiofur (\code{TIO}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01DD90&showdescription=no}{QJ01DD90}), ceftizoxime (\code{CZX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD07&showdescription=no}{J01DD07}), ceftobiprole medocaril (\code{CFM1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI01&showdescription=no}{J01DI01}), ceftolozane/tazobactam (\code{CZT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI54&showdescription=no}{J01DI54}), ceftriaxone (\code{CRO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD04&showdescription=no}{J01DD04}), ceftriaxone/beta-lactamase inhibitor (\code{CEB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD63&showdescription=no}{J01DD63}), cefuroxime (\code{CXM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC02&showdescription=no}{J01DC02}), cephradine (\code{CED}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB09&showdescription=no}{J01DB09}), chloramphenicol (\code{CHL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01BA01&showdescription=no}{J01BA01}), ciprofloxacin (\code{CIP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA02&showdescription=no}{J01MA02}), clarithromycin (\code{CLR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA09&showdescription=no}{J01FA09}), clindamycin (\code{CLI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FF01&showdescription=no}{J01FF01}), clometocillin (\code{CLM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE07&showdescription=no}{J01CE07}), cloxacillin (\code{CLO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF02&showdescription=no}{J01CF02}), colistin (\code{COL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XB01&showdescription=no}{J01XB01}), cycloserine (\code{CYC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J04AB01&showdescription=no}{J04AB01}), dalbavancin (\code{DAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA04&showdescription=no}{J01XA04}), danofloxacin (\code{DAN}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA92&showdescription=no}{QJ01MA92}), daptomycin (\code{DAP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX09&showdescription=no}{J01XX09}), delafloxacin (\code{DFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA23&showdescription=no}{J01MA23}), dibekacin (\code{DKB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB09&showdescription=no}{J01GB09}), dicloxacillin (\code{DIC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF01&showdescription=no}{J01CF01}), difloxacin (\code{DIF}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA94&showdescription=no}{QJ01MA94}), dirithromycin (\code{DIR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA13&showdescription=no}{J01FA13}), doripenem (\code{DOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH04&showdescription=no}{J01DH04}), doxycycline (\code{DOX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA02&showdescription=no}{J01AA02}), enoxacin (\code{ENX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA04&showdescription=no}{J01MA04}), enrofloxacin (\code{ENR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA90&showdescription=no}{QJ01MA90}), epicillin (\code{EPC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA07&showdescription=no}{J01CA07}), ertapenem (\code{ETP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH03&showdescription=no}{J01DH03}), erythromycin (\code{ERY}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA01&showdescription=no}{J01FA01}), fleroxacin (\code{FLE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA08&showdescription=no}{J01MA08}), flucloxacillin (\code{FLC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF05&showdescription=no}{J01CF05}), flurithromycin (\code{FLR1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA14&showdescription=no}{J01FA14}), fosfomycin (\code{FOS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX01&showdescription=no}{J01XX01}), framycetin (\code{FRM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=D09AA01&showdescription=no}{D09AA01}), fusidic acid (\code{FUS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XC01&showdescription=no}{J01XC01}), gamithromycin (\code{GAM}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA95&showdescription=no}{QJ01FA95}), garenoxacin (\code{GRN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA19&showdescription=no}{J01MA19}), gatifloxacin (\code{GAT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA16&showdescription=no}{J01MA16}), gemifloxacin (\code{GEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA15&showdescription=no}{J01MA15}), gentamicin (\code{GEN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB03&showdescription=no}{J01GB03}), grepafloxacin (\code{GRX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA11&showdescription=no}{J01MA11}), hetacillin (\code{HET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA18&showdescription=no}{J01CA18}), imipenem (\code{IPM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH51&showdescription=no}{J01DH51}), imipenem/relebactam (\code{IMR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH56&showdescription=no}{J01DH56}), isepamicin (\code{ISE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB11&showdescription=no}{J01GB11}), josamycin (\code{JOS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA07&showdescription=no}{J01FA07}), kanamycin (\code{KAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB04&showdescription=no}{J01GB04}), kitasamycin (\code{KIT}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA93&showdescription=no}{QJ01FA93}), lascufloxacin (\code{LSC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA25&showdescription=no}{J01MA25}), latamoxef (\code{LTM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD06&showdescription=no}{J01DD06}), levofloxacin (\code{LVX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA12&showdescription=no}{J01MA12}), levonadifloxacin (\code{LND}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA24&showdescription=no}{J01MA24}), lincomycin (\code{LIN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FF02&showdescription=no}{J01FF02}), linezolid (\code{LNZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX08&showdescription=no}{J01XX08}), lomefloxacin (\code{LOM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA07&showdescription=no}{J01MA07}), loracarbef (\code{LOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC08&showdescription=no}{J01DC08}), marbofloxacin (\code{MAR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA93&showdescription=no}{QJ01MA93}), mecillinam (\code{MEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA11&showdescription=no}{J01CA11}), meropenem (\code{MEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH02&showdescription=no}{J01DH02}), meropenem/vaborbactam (\code{MEV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH52&showdescription=no}{J01DH52}), metampicillin (\code{MTM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA14&showdescription=no}{J01CA14}), meticillin (\code{MET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF03&showdescription=no}{J01CF03}), mezlocillin (\code{MEZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA10&showdescription=no}{J01CA10}), micronomicin (\code{MCR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=S01AA22&showdescription=no}{S01AA22}), midecamycin (\code{MID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA03&showdescription=no}{J01FA03}), minocycline (\code{MNO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA08&showdescription=no}{J01AA08}), miocamycin (\code{MCM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA11&showdescription=no}{J01FA11}), moxifloxacin (\code{MFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA14&showdescription=no}{J01MA14}), nadifloxacin (\code{NAD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=D10AF05&showdescription=no}{D10AF05}), nafcillin (\code{NAF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF06&showdescription=no}{J01CF06}), nalidixic acid (\code{NAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MB02&showdescription=no}{J01MB02}), neomycin (\code{NEO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB05&showdescription=no}{J01GB05}), netilmicin (\code{NET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB07&showdescription=no}{J01GB07}), nitrofurantoin (\code{NIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XE01&showdescription=no}{J01XE01}), norfloxacin (\code{NOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA06&showdescription=no}{J01MA06}), novobiocin (\code{NOV}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01XX95&showdescription=no}{QJ01XX95}), ofloxacin (\code{OFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA01&showdescription=no}{J01MA01}), oleandomycin (\code{OLE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA05&showdescription=no}{J01FA05}), orbifloxacin (\code{ORB}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA95&showdescription=no}{QJ01MA95}), oritavancin (\code{ORI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA05&showdescription=no}{J01XA05}), oxacillin (\code{OXA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF04&showdescription=no}{J01CF04}), panipenem (\code{PAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH55&showdescription=no}{J01DH55}), pazufloxacin (\code{PAZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA18&showdescription=no}{J01MA18}), pefloxacin (\code{PEF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA03&showdescription=no}{J01MA03}), penamecillin (\code{PNM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE06&showdescription=no}{J01CE06}), pheneticillin (\code{PHE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE05&showdescription=no}{J01CE05}), phenoxymethylpenicillin (\code{PHN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE02&showdescription=no}{J01CE02}), piperacillin (\code{PIP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA12&showdescription=no}{J01CA12}), piperacillin/tazobactam (\code{TZP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR05&showdescription=no}{J01CR05}), pirlimycin (\code{PRL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ51FF90&showdescription=no}{QJ51FF90}), pivampicillin (\code{PVM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA02&showdescription=no}{J01CA02}), pivmecillinam (\code{PME}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA08&showdescription=no}{J01CA08}), plazomicin (\code{PLZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB14&showdescription=no}{J01GB14}), polymyxin B (\code{PLB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XB02&showdescription=no}{J01XB02}), pradofloxacin (\code{PRA}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA97&showdescription=no}{QJ01MA97}), pristinamycin (\code{PRI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FG01&showdescription=no}{J01FG01}), procaine benzylpenicillin (\code{PRB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE09&showdescription=no}{J01CE09}), propicillin (\code{PRP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE03&showdescription=no}{J01CE03}), prulifloxacin (\code{PRU}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA17&showdescription=no}{J01MA17}), quinupristin/dalfopristin (\code{QDA}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FG02&showdescription=no}{QJ01FG02}), ribostamycin (\code{RST}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB10&showdescription=no}{J01GB10}), rifampicin (\code{RIF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J04AB02&showdescription=no}{J04AB02}), rokitamycin (\code{ROK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA12&showdescription=no}{J01FA12}), roxithromycin (\code{RXT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA06&showdescription=no}{J01FA06}), rufloxacin (\code{RFL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA10&showdescription=no}{J01MA10}), sarafloxacin (\code{SAR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA98&showdescription=no}{QJ01MA98}), sisomicin (\code{SIS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB08&showdescription=no}{J01GB08}), sitafloxacin (\code{SIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA21&showdescription=no}{J01MA21}), solithromycin (\code{SOL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA16&showdescription=no}{J01FA16}), sparfloxacin (\code{SPX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA09&showdescription=no}{J01MA09}), spiramycin (\code{SPI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA02&showdescription=no}{J01FA02}), streptoduocin (\code{STR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GA02&showdescription=no}{J01GA02}), streptomycin (\code{STR1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GA01&showdescription=no}{J01GA01}), sulbenicillin (\code{SBC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA16&showdescription=no}{J01CA16}), sulfadiazine (\code{SDI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC02&showdescription=no}{J01EC02}), sulfadiazine/trimethoprim (\code{SLT1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE02&showdescription=no}{J01EE02}), sulfadimethoxine (\code{SUD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED01&showdescription=no}{J01ED01}), sulfadimidine (\code{SDM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB03&showdescription=no}{J01EB03}), sulfadimidine/trimethoprim (\code{SLT2}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE05&showdescription=no}{J01EE05}), sulfafurazole (\code{SLF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB05&showdescription=no}{J01EB05}), sulfaisodimidine (\code{SLF1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB01&showdescription=no}{J01EB01}), sulfalene (\code{SLF2}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED02&showdescription=no}{J01ED02}), sulfamazone (\code{SZO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED09&showdescription=no}{J01ED09}), sulfamerazine (\code{SLF3}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED07&showdescription=no}{J01ED07}), sulfamerazine/trimethoprim (\code{SLT3}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE07&showdescription=no}{J01EE07}), sulfamethizole (\code{SLF4}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB02&showdescription=no}{J01EB02}), sulfamethoxazole (\code{SMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC01&showdescription=no}{J01EC01}), sulfamethoxypyridazine (\code{SLF5}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED05&showdescription=no}{J01ED05}), sulfametomidine (\code{SLF6}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED03&showdescription=no}{J01ED03}), sulfametoxydiazine (\code{SLF7}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED04&showdescription=no}{J01ED04}), sulfametrole/trimethoprim (\code{SLT4}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE03&showdescription=no}{J01EE03}), sulfamoxole (\code{SLF8}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC03&showdescription=no}{J01EC03}), sulfamoxole/trimethoprim (\code{SLT5}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE04&showdescription=no}{J01EE04}), sulfanilamide (\code{SLF9}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB06&showdescription=no}{J01EB06}), sulfaperin (\code{SLF10}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED06&showdescription=no}{J01ED06}), sulfaphenazole (\code{SLF11}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED08&showdescription=no}{J01ED08}), sulfapyridine (\code{SLF12}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB04&showdescription=no}{J01EB04}), sulfathiazole (\code{SUT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB07&showdescription=no}{J01EB07}), sulfathiourea (\code{SLF13}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB08&showdescription=no}{J01EB08}), sultamicillin (\code{SLT6}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR04&showdescription=no}{J01CR04}), talampicillin (\code{TAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA15&showdescription=no}{J01CA15}), tebipenem (\code{TBP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH06&showdescription=no}{J01DH06}), tedizolid (\code{TZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX11&showdescription=no}{J01XX11}), teicoplanin (\code{TEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA02&showdescription=no}{J01XA02}), telavancin (\code{TLV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA03&showdescription=no}{J01XA03}), telithromycin (\code{TLT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA15&showdescription=no}{J01FA15}), temafloxacin (\code{TMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA05&showdescription=no}{J01MA05}), temocillin (\code{TEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA17&showdescription=no}{J01CA17}), tetracycline (\code{TCY}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA07&showdescription=no}{J01AA07}), ticarcillin (\code{TIC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA13&showdescription=no}{J01CA13}), ticarcillin/clavulanic acid (\code{TCC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR03&showdescription=no}{J01CR03}), tigecycline (\code{TGC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA12&showdescription=no}{J01AA12}), tilbroquinol (\code{TBQ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=P01AA05&showdescription=no}{P01AA05}), tildipirosin (\code{TIP}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA96&showdescription=no}{QJ01FA96}), tilmicosin (\code{TIL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA91&showdescription=no}{QJ01FA91}), tobramycin (\code{TOB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB01&showdescription=no}{J01GB01}), tosufloxacin (\code{TFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA22&showdescription=no}{J01MA22}), trimethoprim (\code{TMP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EA01&showdescription=no}{J01EA01}), trimethoprim/sulfamethoxazole (\code{SXT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE01&showdescription=no}{J01EE01}), troleandomycin (\code{TRL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA08&showdescription=no}{J01FA08}), trovafloxacin (\code{TVA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA13&showdescription=no}{J01MA13}), tulathromycin (\code{TUL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA94&showdescription=no}{QJ01FA94}), tylosin (\code{TYL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA90&showdescription=no}{QJ01FA90}), tylvalosin (\code{TYL1}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA92&showdescription=no}{QJ01FA92}), vancomycin (\code{VAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA01&showdescription=no}{J01XA01}) } \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ diff --git a/man/example_isolates.Rd b/man/example_isolates.Rd index f7c933aa5..0df411cb8 100644 --- a/man/example_isolates.Rd +++ b/man/example_isolates.Rd @@ -13,7 +13,7 @@ A \link[tibble:tibble]{tibble} with 2 000 observations and 46 variables: \item \code{gender}\cr Gender of the patient, either "F" or "M" \item \code{ward}\cr Ward type where the patient was admitted, either "Clinical", "ICU", or "Outpatient" \item \code{mo}\cr ID of microorganism created with \code{\link[=as.mo]{as.mo()}}, see also the \link{microorganisms} data set -\item \code{PEN:RIF}\cr 40 different antibiotics with class \code{\link{sir}} (see \code{\link[=as.sir]{as.sir()}}); these column names occur in the \link{antibiotics} data set and can be translated with \code{\link[=set_ab_names]{set_ab_names()}} or \code{\link[=ab_name]{ab_name()}} +\item \code{PEN:RIF}\cr 40 different antimicrobials with class \code{\link{sir}} (see \code{\link[=as.sir]{as.sir()}}); these column names occur in the \link{antimicrobials} data set and can be translated with \code{\link[=set_ab_names]{set_ab_names()}} or \code{\link[=ab_name]{ab_name()}} } } \usage{ diff --git a/man/example_isolates_unclean.Rd b/man/example_isolates_unclean.Rd index 20de6bd76..40acc405d 100644 --- a/man/example_isolates_unclean.Rd +++ b/man/example_isolates_unclean.Rd @@ -11,7 +11,7 @@ A \link[tibble:tibble]{tibble} with 3 000 observations and 8 variables: \item \code{date}\cr date of receipt at the laboratory \item \code{hospital}\cr ID of the hospital, from A to C \item \code{bacteria}\cr info about microorganism that can be transformed with \code{\link[=as.mo]{as.mo()}}, see also \link{microorganisms} -\item \code{AMX:GEN}\cr 4 different antibiotics that have to be transformed with \code{\link[=as.sir]{as.sir()}} +\item \code{AMX:GEN}\cr 4 different antimicrobials that have to be transformed with \code{\link[=as.sir]{as.sir()}} } } \usage{ diff --git a/man/ggplot_sir.Rd b/man/ggplot_sir.Rd index 9b4f3d6a1..eb3aab4d1 100644 --- a/man/ggplot_sir.Rd +++ b/man/ggplot_sir.Rd @@ -33,7 +33,7 @@ geom_sir(position = NULL, x = c("antibiotic", "interpretation"), \item{limits}{a \link{numeric} vector of length two providing limits of the scale, use \code{NA} to refer to the existing minimum or maximum} -\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} +\item{translate_ab}{a column name of the \link{antimicrobials} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} \item{combine_SI}{a \link{logical} to indicate whether all values of S, SDD, and I must be merged into one, so the output only consists of S+SDD+I vs. R (susceptible vs. resistant) - the default is \code{TRUE}} @@ -67,9 +67,9 @@ geom_sir(position = NULL, x = c("antibiotic", "interpretation"), Use these functions to create bar plots for AMR data analysis. All functions rely on \link[ggplot2:ggplot]{ggplot2} functions. } \details{ -At default, the names of antibiotics will be shown on the plots using \code{\link[=ab_name]{ab_name()}}. This can be set with the \code{translate_ab} argument. See \code{\link[=count_df]{count_df()}}. +At default, the names of antimicrobials will be shown on the plots using \code{\link[=ab_name]{ab_name()}}. This can be set with the \code{translate_ab} argument. See \code{\link[=count_df]{count_df()}}. -\code{\link[=geom_sir]{geom_sir()}} will take any variable from the data that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) using \code{\link[=sir_df]{sir_df()}} and will plot bars with the percentage S, I, and R. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis. +\code{\link[=geom_sir]{geom_sir()}} will take any variable from the data that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) using \code{\link[=sir_df]{sir_df()}} and will plot bars with the percentage S, I, and R. The default behaviour is to have the bars stacked and to have the different antimicrobials on the x axis. Additional functions include: \itemize{ diff --git a/man/guess_ab_col.Rd b/man/guess_ab_col.Rd index 03c50b9b1..9f189858f 100644 --- a/man/guess_ab_col.Rd +++ b/man/guess_ab_col.Rd @@ -20,10 +20,10 @@ guess_ab_col(x = NULL, search_string = NULL, verbose = FALSE, A column name of \code{x}, or \code{NULL} when no result is found. } \description{ -This tries to find a column name in a data set based on information from the \link{antibiotics} data set. Also supports WHONET abbreviations. +This tries to find a column name in a data set based on information from the \link{antimicrobials} data set. Also supports WHONET abbreviations. } \details{ -You can look for an antibiotic (trade) name or abbreviation and it will search \code{x} and the \link{antibiotics} data set for any column containing a name or code of that antibiotic. +You can look for an antibiotic (trade) name or abbreviation and it will search \code{x} and the \link{antimicrobials} data set for any column containing a name or code of that antibiotic. } \examples{ df <- data.frame( diff --git a/man/intrinsic_resistant.Rd b/man/intrinsic_resistant.Rd index 1516c55a9..9534e8a6b 100644 --- a/man/intrinsic_resistant.Rd +++ b/man/intrinsic_resistant.Rd @@ -8,7 +8,7 @@ A \link[tibble:tibble]{tibble} with 301 583 observations and 2 variables: \itemize{ \item \code{mo}\cr Microorganism ID -\item \code{ab}\cr Antibiotic ID +\item \code{ab}\cr Antimcrobial ID } } \usage{ diff --git a/man/key_antimicrobials.Rd b/man/key_antimicrobials.Rd index 5bd2484bb..7fb2e9968 100644 --- a/man/key_antimicrobials.Rd +++ b/man/key_antimicrobials.Rd @@ -21,7 +21,7 @@ antimicrobials_equal(y, z, type = c("points", "keyantimicrobials"), ignore_I = TRUE, points_threshold = 2, ...) } \arguments{ -\item{x}{a \link{data.frame} with antibiotics columns, like \code{AMX} or \code{amox}. Can be left blank to determine automatically} +\item{x}{a \link{data.frame} with antimicrobials columns, like \code{AMX} or \code{amox}. Can be left blank to determine automatically.} \item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}) - the default is the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} @@ -112,7 +112,7 @@ antimicrobials_equal(strainA, strainB, type = "keyantimicrobials", ignore_I = FA \donttest{ if (require("dplyr")) { - # set key antibiotics to a new variable + # set key antimicrobials to a new variable my_patients <- example_isolates \%>\% mutate(keyab = key_antimicrobials(antifungal = NULL)) \%>\% # no need to define `x` mutate( diff --git a/man/mdro.Rd b/man/mdro.Rd index 1c81f16ed..b9d4d96de 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -38,7 +38,7 @@ eucast_exceptional_phenotypes(x = NULL, only_sir_columns = FALSE, verbose = FALSE, ...) } \arguments{ -\item{x}{a \link{data.frame} with antibiotics columns, like \code{AMX} or \code{amox}. Can be left blank for automatic determination.} +\item{x}{a \link{data.frame} with antimicrobials columns, like \code{AMX} or \code{amox}. Can be left blank for automatic determination.} \item{guideline}{a specific guideline to follow, see sections \emph{Supported international / national guidelines} and \emph{Using Custom Guidelines} below. When left empty, the publication by Magiorakos \emph{et al.} (see below) will be followed.} @@ -64,9 +64,9 @@ eucast_exceptional_phenotypes(x = NULL, only_sir_columns = FALSE, \item{verbose}{a \link{logical} to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.} -\item{only_sir_columns}{a \link{logical} to indicate whether only antibiotic columns must be detected that were transformed to class \code{sir} (see \code{\link[=as.sir]{as.sir()}}) on beforehand (default is \code{FALSE})} +\item{only_sir_columns}{a \link{logical} to indicate whether only antimicrobial columns must be detected that were transformed to class \code{sir} (see \code{\link[=as.sir]{as.sir()}}) on beforehand (default is \code{FALSE})} -\item{...}{in case of \code{\link[=custom_mdro_guideline]{custom_mdro_guideline()}}: a set of rules, see section \emph{Using Custom Guidelines} below. Otherwise: column name of an antibiotic, see section \emph{Antibiotics} below.} +\item{...}{in case of \code{\link[=custom_mdro_guideline]{custom_mdro_guideline()}}: a set of rules, see section \emph{Using Custom Guidelines} below. Otherwise: column name of an antibiotic, see section \emph{Antimicrobials} below.} \item{as_factor}{a \link{logical} to indicate whether the returned value should be an ordered \link{factor} (\code{TRUE}, default), or otherwise a \link{character} vector} } @@ -176,11 +176,11 @@ table(x) The rules set (the \code{custom} object in this case) could be exported to a shared file location using \code{\link[=saveRDS]{saveRDS()}} if you collaborate with multiple users. The custom rules set could then be imported using \code{\link[=readRDS]{readRDS()}}. } -\section{Antibiotics}{ +\section{Antimicrobials}{ -To define antibiotics column names, leave as it is to determine it automatically with \code{\link[=guess_ab_col]{guess_ab_col()}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. +To define antimicrobials column names, leave as it is to determine it automatically with \code{\link[=guess_ab_col]{guess_ab_col()}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. -The following antibiotics are eligible for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format 'name (\verb{antimicrobial ID}, \href{https://atcddd.fhi.no/atc/structure_and_principles/}{ATC code})', sorted alphabetically: +The following antimicrobials are eligible for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format 'name (\verb{antimicrobial ID}, \href{https://atcddd.fhi.no/atc/structure_and_principles/}{ATC code})', sorted alphabetically: Amikacin (\code{AMK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB06&showdescription=no}{J01GB06}), amoxicillin (\code{AMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA04&showdescription=no}{J01CA04}), amoxicillin/clavulanic acid (\code{AMC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR02&showdescription=no}{J01CR02}), ampicillin (\code{AMP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA01&showdescription=no}{J01CA01}), ampicillin/sulbactam (\code{SAM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR01&showdescription=no}{J01CR01}), apramycin (\code{APR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QA07AA92&showdescription=no}{QA07AA92}), arbekacin (\code{ARB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB12&showdescription=no}{J01GB12}), aspoxicillin (\code{APX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA19&showdescription=no}{J01CA19}), azidocillin (\code{AZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE04&showdescription=no}{J01CE04}), azithromycin (\code{AZM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA10&showdescription=no}{J01FA10}), azlocillin (\code{AZL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA09&showdescription=no}{J01CA09}), aztreonam (\code{ATM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DF01&showdescription=no}{J01DF01}), bacampicillin (\code{BAM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA06&showdescription=no}{J01CA06}), bekanamycin (\code{BEK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB13&showdescription=no}{J01GB13}), benzathine benzylpenicillin (\code{BNB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE08&showdescription=no}{J01CE08}), benzathine phenoxymethylpenicillin (\code{BNP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE10&showdescription=no}{J01CE10}), benzylpenicillin (\code{PEN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE01&showdescription=no}{J01CE01}), besifloxacin (\code{BES}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=S01AE08&showdescription=no}{S01AE08}), biapenem (\code{BIA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH05&showdescription=no}{J01DH05}), carbenicillin (\code{CRB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA03&showdescription=no}{J01CA03}), carindacillin (\code{CRN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA05&showdescription=no}{J01CA05}), carumonam (\code{CAR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DF02&showdescription=no}{J01DF02}), cefacetrile (\code{CAC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB10&showdescription=no}{J01DB10}), cefaclor (\code{CEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC04&showdescription=no}{J01DC04}), cefadroxil (\code{CFR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB05&showdescription=no}{J01DB05}), cefalexin (\code{LEX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB01&showdescription=no}{J01DB01}), cefaloridine (\code{RID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB02&showdescription=no}{J01DB02}), cefalotin (\code{CEP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB03&showdescription=no}{J01DB03}), cefamandole (\code{MAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC03&showdescription=no}{J01DC03}), cefapirin (\code{HAP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB08&showdescription=no}{J01DB08}), cefatrizine (\code{CTZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB07&showdescription=no}{J01DB07}), cefazedone (\code{CZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB06&showdescription=no}{J01DB06}), cefazolin (\code{CZO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB04&showdescription=no}{J01DB04}), cefcapene (\code{CCP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD17&showdescription=no}{J01DD17}), cefdinir (\code{CDR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD15&showdescription=no}{J01DD15}), cefditoren (\code{DIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD16&showdescription=no}{J01DD16}), cefepime (\code{FEP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE01&showdescription=no}{J01DE01}), cefepime/amikacin (\code{CFA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01RA06&showdescription=no}{J01RA06}), cefetamet (\code{CAT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD10&showdescription=no}{J01DD10}), cefiderocol (\code{FDC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI04&showdescription=no}{J01DI04}), cefixime (\code{CFM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD08&showdescription=no}{J01DD08}), cefmenoxime (\code{CMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD05&showdescription=no}{J01DD05}), cefmetazole (\code{CMZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC09&showdescription=no}{J01DC09}), cefodizime (\code{DIZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD09&showdescription=no}{J01DD09}), cefonicid (\code{CID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC06&showdescription=no}{J01DC06}), cefoperazone (\code{CFP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD12&showdescription=no}{J01DD12}), cefoperazone/sulbactam (\code{CSL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD62&showdescription=no}{J01DD62}), ceforanide (\code{CND}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC11&showdescription=no}{J01DC11}), cefotaxime (\code{CTX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD01&showdescription=no}{J01DD01}), cefotaxime/clavulanic acid (\code{CTC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD51&showdescription=no}{J01DD51}), cefotetan (\code{CTT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC05&showdescription=no}{J01DC05}), cefotiam (\code{CTF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC07&showdescription=no}{J01DC07}), cefovecin (\code{FOV}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01DD91&showdescription=no}{QJ01DD91}), cefoxitin (\code{FOX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC01&showdescription=no}{J01DC01}), cefozopran (\code{ZOP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE03&showdescription=no}{J01DE03}), cefpiramide (\code{CPM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD11&showdescription=no}{J01DD11}), cefpirome (\code{CPO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DE02&showdescription=no}{J01DE02}), cefpodoxime (\code{CPD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD13&showdescription=no}{J01DD13}), cefprozil (\code{CPR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC10&showdescription=no}{J01DC10}), cefquinome (\code{CEQ}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QG51AA07&showdescription=no}{QG51AA07}), cefroxadine (\code{CRD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB11&showdescription=no}{J01DB11}), cefsulodin (\code{CFS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD03&showdescription=no}{J01DD03}), ceftaroline (\code{CPT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI02&showdescription=no}{J01DI02}), ceftazidime (\code{CAZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD02&showdescription=no}{J01DD02}), ceftazidime/clavulanic acid (\code{CCV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD52&showdescription=no}{J01DD52}), cefteram (\code{CEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD18&showdescription=no}{J01DD18}), ceftezole (\code{CTL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB12&showdescription=no}{J01DB12}), ceftibuten (\code{CTB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD14&showdescription=no}{J01DD14}), ceftiofur (\code{TIO}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01DD90&showdescription=no}{QJ01DD90}), ceftizoxime (\code{CZX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD07&showdescription=no}{J01DD07}), ceftobiprole medocaril (\code{CFM1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI01&showdescription=no}{J01DI01}), ceftolozane/tazobactam (\code{CZT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DI54&showdescription=no}{J01DI54}), ceftriaxone (\code{CRO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD04&showdescription=no}{J01DD04}), ceftriaxone/beta-lactamase inhibitor (\code{CEB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD63&showdescription=no}{J01DD63}), cefuroxime (\code{CXM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC02&showdescription=no}{J01DC02}), cephradine (\code{CED}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DB09&showdescription=no}{J01DB09}), chloramphenicol (\code{CHL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01BA01&showdescription=no}{J01BA01}), ciprofloxacin (\code{CIP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA02&showdescription=no}{J01MA02}), clarithromycin (\code{CLR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA09&showdescription=no}{J01FA09}), clindamycin (\code{CLI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FF01&showdescription=no}{J01FF01}), clometocillin (\code{CLM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE07&showdescription=no}{J01CE07}), cloxacillin (\code{CLO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF02&showdescription=no}{J01CF02}), colistin (\code{COL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XB01&showdescription=no}{J01XB01}), cycloserine (\code{CYC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J04AB01&showdescription=no}{J04AB01}), dalbavancin (\code{DAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA04&showdescription=no}{J01XA04}), danofloxacin (\code{DAN}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA92&showdescription=no}{QJ01MA92}), daptomycin (\code{DAP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX09&showdescription=no}{J01XX09}), delafloxacin (\code{DFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA23&showdescription=no}{J01MA23}), dibekacin (\code{DKB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB09&showdescription=no}{J01GB09}), dicloxacillin (\code{DIC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF01&showdescription=no}{J01CF01}), difloxacin (\code{DIF}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA94&showdescription=no}{QJ01MA94}), dirithromycin (\code{DIR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA13&showdescription=no}{J01FA13}), doripenem (\code{DOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH04&showdescription=no}{J01DH04}), doxycycline (\code{DOX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA02&showdescription=no}{J01AA02}), enoxacin (\code{ENX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA04&showdescription=no}{J01MA04}), enrofloxacin (\code{ENR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA90&showdescription=no}{QJ01MA90}), epicillin (\code{EPC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA07&showdescription=no}{J01CA07}), ertapenem (\code{ETP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH03&showdescription=no}{J01DH03}), erythromycin (\code{ERY}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA01&showdescription=no}{J01FA01}), fleroxacin (\code{FLE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA08&showdescription=no}{J01MA08}), flucloxacillin (\code{FLC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF05&showdescription=no}{J01CF05}), flurithromycin (\code{FLR1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA14&showdescription=no}{J01FA14}), fosfomycin (\code{FOS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX01&showdescription=no}{J01XX01}), framycetin (\code{FRM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=D09AA01&showdescription=no}{D09AA01}), fusidic acid (\code{FUS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XC01&showdescription=no}{J01XC01}), gamithromycin (\code{GAM}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA95&showdescription=no}{QJ01FA95}), garenoxacin (\code{GRN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA19&showdescription=no}{J01MA19}), gatifloxacin (\code{GAT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA16&showdescription=no}{J01MA16}), gemifloxacin (\code{GEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA15&showdescription=no}{J01MA15}), gentamicin (\code{GEN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB03&showdescription=no}{J01GB03}), grepafloxacin (\code{GRX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA11&showdescription=no}{J01MA11}), hetacillin (\code{HET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA18&showdescription=no}{J01CA18}), imipenem (\code{IPM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH51&showdescription=no}{J01DH51}), imipenem/relebactam (\code{IMR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH56&showdescription=no}{J01DH56}), isepamicin (\code{ISE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB11&showdescription=no}{J01GB11}), josamycin (\code{JOS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA07&showdescription=no}{J01FA07}), kanamycin (\code{KAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB04&showdescription=no}{J01GB04}), kitasamycin (\code{KIT}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA93&showdescription=no}{QJ01FA93}), lascufloxacin (\code{LSC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA25&showdescription=no}{J01MA25}), latamoxef (\code{LTM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DD06&showdescription=no}{J01DD06}), levofloxacin (\code{LVX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA12&showdescription=no}{J01MA12}), levonadifloxacin (\code{LND}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA24&showdescription=no}{J01MA24}), lincomycin (\code{LIN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FF02&showdescription=no}{J01FF02}), linezolid (\code{LNZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX08&showdescription=no}{J01XX08}), lomefloxacin (\code{LOM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA07&showdescription=no}{J01MA07}), loracarbef (\code{LOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DC08&showdescription=no}{J01DC08}), marbofloxacin (\code{MAR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA93&showdescription=no}{QJ01MA93}), mecillinam (\code{MEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA11&showdescription=no}{J01CA11}), meropenem (\code{MEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH02&showdescription=no}{J01DH02}), meropenem/vaborbactam (\code{MEV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH52&showdescription=no}{J01DH52}), metampicillin (\code{MTM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA14&showdescription=no}{J01CA14}), meticillin (\code{MET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF03&showdescription=no}{J01CF03}), mezlocillin (\code{MEZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA10&showdescription=no}{J01CA10}), micronomicin (\code{MCR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=S01AA22&showdescription=no}{S01AA22}), midecamycin (\code{MID}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA03&showdescription=no}{J01FA03}), minocycline (\code{MNO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA08&showdescription=no}{J01AA08}), miocamycin (\code{MCM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA11&showdescription=no}{J01FA11}), moxifloxacin (\code{MFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA14&showdescription=no}{J01MA14}), nadifloxacin (\code{NAD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=D10AF05&showdescription=no}{D10AF05}), nafcillin (\code{NAF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF06&showdescription=no}{J01CF06}), nalidixic acid (\code{NAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MB02&showdescription=no}{J01MB02}), neomycin (\code{NEO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB05&showdescription=no}{J01GB05}), netilmicin (\code{NET}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB07&showdescription=no}{J01GB07}), nitrofurantoin (\code{NIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XE01&showdescription=no}{J01XE01}), norfloxacin (\code{NOR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA06&showdescription=no}{J01MA06}), novobiocin (\code{NOV}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01XX95&showdescription=no}{QJ01XX95}), ofloxacin (\code{OFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA01&showdescription=no}{J01MA01}), oleandomycin (\code{OLE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA05&showdescription=no}{J01FA05}), orbifloxacin (\code{ORB}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA95&showdescription=no}{QJ01MA95}), oritavancin (\code{ORI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA05&showdescription=no}{J01XA05}), oxacillin (\code{OXA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CF04&showdescription=no}{J01CF04}), panipenem (\code{PAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH55&showdescription=no}{J01DH55}), pazufloxacin (\code{PAZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA18&showdescription=no}{J01MA18}), pefloxacin (\code{PEF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA03&showdescription=no}{J01MA03}), penamecillin (\code{PNM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE06&showdescription=no}{J01CE06}), pheneticillin (\code{PHE}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE05&showdescription=no}{J01CE05}), phenoxymethylpenicillin (\code{PHN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE02&showdescription=no}{J01CE02}), piperacillin (\code{PIP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA12&showdescription=no}{J01CA12}), piperacillin/tazobactam (\code{TZP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR05&showdescription=no}{J01CR05}), pirlimycin (\code{PRL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ51FF90&showdescription=no}{QJ51FF90}), pivampicillin (\code{PVM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA02&showdescription=no}{J01CA02}), pivmecillinam (\code{PME}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA08&showdescription=no}{J01CA08}), plazomicin (\code{PLZ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB14&showdescription=no}{J01GB14}), polymyxin B (\code{PLB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XB02&showdescription=no}{J01XB02}), pradofloxacin (\code{PRA}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA97&showdescription=no}{QJ01MA97}), pristinamycin (\code{PRI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FG01&showdescription=no}{J01FG01}), procaine benzylpenicillin (\code{PRB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE09&showdescription=no}{J01CE09}), propicillin (\code{PRP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CE03&showdescription=no}{J01CE03}), prulifloxacin (\code{PRU}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA17&showdescription=no}{J01MA17}), quinupristin/dalfopristin (\code{QDA}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FG02&showdescription=no}{QJ01FG02}), ribostamycin (\code{RST}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB10&showdescription=no}{J01GB10}), rifampicin (\code{RIF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J04AB02&showdescription=no}{J04AB02}), rokitamycin (\code{ROK}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA12&showdescription=no}{J01FA12}), roxithromycin (\code{RXT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA06&showdescription=no}{J01FA06}), rufloxacin (\code{RFL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA10&showdescription=no}{J01MA10}), sarafloxacin (\code{SAR}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01MA98&showdescription=no}{QJ01MA98}), sisomicin (\code{SIS}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB08&showdescription=no}{J01GB08}), sitafloxacin (\code{SIT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA21&showdescription=no}{J01MA21}), solithromycin (\code{SOL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA16&showdescription=no}{J01FA16}), sparfloxacin (\code{SPX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA09&showdescription=no}{J01MA09}), spiramycin (\code{SPI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA02&showdescription=no}{J01FA02}), streptoduocin (\code{STR}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GA02&showdescription=no}{J01GA02}), streptomycin (\code{STR1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GA01&showdescription=no}{J01GA01}), sulbenicillin (\code{SBC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA16&showdescription=no}{J01CA16}), sulfadiazine (\code{SDI}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC02&showdescription=no}{J01EC02}), sulfadiazine/trimethoprim (\code{SLT1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE02&showdescription=no}{J01EE02}), sulfadimethoxine (\code{SUD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED01&showdescription=no}{J01ED01}), sulfadimidine (\code{SDM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB03&showdescription=no}{J01EB03}), sulfadimidine/trimethoprim (\code{SLT2}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE05&showdescription=no}{J01EE05}), sulfafurazole (\code{SLF}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB05&showdescription=no}{J01EB05}), sulfaisodimidine (\code{SLF1}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB01&showdescription=no}{J01EB01}), sulfalene (\code{SLF2}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED02&showdescription=no}{J01ED02}), sulfamazone (\code{SZO}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED09&showdescription=no}{J01ED09}), sulfamerazine (\code{SLF3}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED07&showdescription=no}{J01ED07}), sulfamerazine/trimethoprim (\code{SLT3}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE07&showdescription=no}{J01EE07}), sulfamethizole (\code{SLF4}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB02&showdescription=no}{J01EB02}), sulfamethoxazole (\code{SMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC01&showdescription=no}{J01EC01}), sulfamethoxypyridazine (\code{SLF5}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED05&showdescription=no}{J01ED05}), sulfametomidine (\code{SLF6}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED03&showdescription=no}{J01ED03}), sulfametoxydiazine (\code{SLF7}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED04&showdescription=no}{J01ED04}), sulfametrole/trimethoprim (\code{SLT4}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE03&showdescription=no}{J01EE03}), sulfamoxole (\code{SLF8}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EC03&showdescription=no}{J01EC03}), sulfamoxole/trimethoprim (\code{SLT5}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE04&showdescription=no}{J01EE04}), sulfanilamide (\code{SLF9}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB06&showdescription=no}{J01EB06}), sulfaperin (\code{SLF10}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED06&showdescription=no}{J01ED06}), sulfaphenazole (\code{SLF11}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01ED08&showdescription=no}{J01ED08}), sulfapyridine (\code{SLF12}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB04&showdescription=no}{J01EB04}), sulfathiazole (\code{SUT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB07&showdescription=no}{J01EB07}), sulfathiourea (\code{SLF13}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EB08&showdescription=no}{J01EB08}), sultamicillin (\code{SLT6}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR04&showdescription=no}{J01CR04}), talampicillin (\code{TAL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA15&showdescription=no}{J01CA15}), tebipenem (\code{TBP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01DH06&showdescription=no}{J01DH06}), tedizolid (\code{TZD}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XX11&showdescription=no}{J01XX11}), teicoplanin (\code{TEC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA02&showdescription=no}{J01XA02}), telavancin (\code{TLV}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA03&showdescription=no}{J01XA03}), telithromycin (\code{TLT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA15&showdescription=no}{J01FA15}), temafloxacin (\code{TMX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA05&showdescription=no}{J01MA05}), temocillin (\code{TEM}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA17&showdescription=no}{J01CA17}), tetracycline (\code{TCY}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA07&showdescription=no}{J01AA07}), ticarcillin (\code{TIC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CA13&showdescription=no}{J01CA13}), ticarcillin/clavulanic acid (\code{TCC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01CR03&showdescription=no}{J01CR03}), tigecycline (\code{TGC}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01AA12&showdescription=no}{J01AA12}), tilbroquinol (\code{TBQ}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=P01AA05&showdescription=no}{P01AA05}), tildipirosin (\code{TIP}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA96&showdescription=no}{QJ01FA96}), tilmicosin (\code{TIL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA91&showdescription=no}{QJ01FA91}), tobramycin (\code{TOB}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01GB01&showdescription=no}{J01GB01}), tosufloxacin (\code{TFX}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA22&showdescription=no}{J01MA22}), trimethoprim (\code{TMP}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EA01&showdescription=no}{J01EA01}), trimethoprim/sulfamethoxazole (\code{SXT}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01EE01&showdescription=no}{J01EE01}), troleandomycin (\code{TRL}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01FA08&showdescription=no}{J01FA08}), trovafloxacin (\code{TVA}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01MA13&showdescription=no}{J01MA13}), tulathromycin (\code{TUL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA94&showdescription=no}{QJ01FA94}), tylosin (\code{TYL}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA90&showdescription=no}{QJ01FA90}), tylvalosin (\code{TYL1}, \href{https://atcddd.fhi.no/atcvet/atcvet_index/?code=QJ01FA92&showdescription=no}{QJ01FA92}), vancomycin (\code{VAN}, \href{https://atcddd.fhi.no/atc_ddd_index//?code=J01XA01&showdescription=no}{J01XA01}) } diff --git a/man/mo_matching_score.Rd b/man/mo_matching_score.Rd index 85f2a226c..edd78c316 100644 --- a/man/mo_matching_score.Rd +++ b/man/mo_matching_score.Rd @@ -58,7 +58,7 @@ All matches are sorted descending on their matching score and for all user input \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ diff --git a/man/mo_property.Rd b/man/mo_property.Rd index 4b1be0219..2cda75073 100644 --- a/man/mo_property.Rd +++ b/man/mo_property.Rd @@ -197,7 +197,7 @@ Determination of the Gram stain (\code{\link[=mo_gramstain]{mo_gramstain()}}) wi Determination of yeasts (\code{\link[=mo_is_yeast]{mo_is_yeast()}}) will be based on the taxonomic kingdom and class. \emph{Budding yeasts} are yeasts that reproduce asexually through a process called budding, where a new cell develops from a small protrusion on the parent cell. Taxonomically, these are members of the phylum Ascomycota, class Saccharomycetes (also called Hemiascomycetes) or Pichiomycetes. \emph{True yeasts} quite specifically refers to yeasts in the underlying order Saccharomycetales (such as \emph{Saccharomyces cerevisiae}). Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes or Pichiomycetes, the function will return \code{TRUE}. It returns \code{FALSE} otherwise (or \code{NA} when the input is \code{NA} or the MO code is \code{UNKNOWN}). -Determination of intrinsic resistance (\code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}}) will be based on the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021). The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} function can be vectorised over both argument \code{x} (input for microorganisms) and \code{ab} (input for antibiotics). +Determination of intrinsic resistance (\code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}}) will be based on the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021). The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} function can be vectorised over both argument \code{x} (input for microorganisms) and \code{ab} (input for antimicrobials). Determination of bacterial oxygen tolerance (\code{\link[=mo_oxygen_tolerance]{mo_oxygen_tolerance()}}) will be based on BacDive, see \emph{Source}. The function \code{\link[=mo_is_anaerobic]{mo_is_anaerobic()}} only returns \code{TRUE} if the oxygen tolerance is \code{"anaerobe"}, indicting an obligate anaerobic species or genus. It always returns \code{FALSE} for species outside the taxonomic kingdom of Bacteria. @@ -229,7 +229,7 @@ This function uses \code{\link[=as.mo]{as.mo()}} internally, which uses an advan \section{Reference Data Publicly Available}{ -All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. +All data sets in this \code{AMR} package (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}. } \examples{ diff --git a/man/plot.Rd b/man/plot.Rd index 38ba65227..0e12dce4e 100644 --- a/man/plot.Rd +++ b/man/plot.Rd @@ -151,7 +151,7 @@ labels_sir_count(position = NULL, x = "antibiotic", \item{position}{position adjustment of bars, either \code{"fill"}, \code{"stack"} or \code{"dodge"}} -\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} +\item{translate_ab}{a column name of the \link{antimicrobials} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} \item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see \emph{Source}.} diff --git a/man/proportion.Rd b/man/proportion.Rd index 29d9e3c96..a63358a57 100644 --- a/man/proportion.Rd +++ b/man/proportion.Rd @@ -58,7 +58,7 @@ sir_df(data, translate_ab = "name", language = get_AMR_locale(), \item{as_percent}{a \link{logical} to indicate whether the output must be returned as a hundred fold with \% sign (a character). A value of \code{0.123456} will then be returned as \code{"12.3\%"}.} -\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}): a \link{logical} to indicate that isolates must be tested for all antibiotics, see section \emph{Combination Therapy} below} +\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}): a \link{logical} to indicate that isolates must be tested for all antimicrobials, see section \emph{Combination Therapy} below} \item{ab_result}{antibiotic results to test against, must be one or more values of "S", "SDD", "I", or "R"} @@ -70,7 +70,7 @@ sir_df(data, translate_ab = "name", language = get_AMR_locale(), \item{data}{a \link{data.frame} containing columns with class \code{\link{sir}} (see \code{\link[=as.sir]{as.sir()}})} -\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} +\item{translate_ab}{a column name of the \link{antimicrobials} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} \item{language}{language of the returned text - the default is the current system language (see \code{\link[=get_AMR_locale]{get_AMR_locale()}}) and can also be set with the package option \code{\link[=AMR-options]{AMR_locale}}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} @@ -99,7 +99,7 @@ The function \code{\link[=proportion_df]{proportion_df()}} takes any variable fr } \section{Combination Therapy}{ -When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI: +When using more than one variable for \code{...} (= combination therapy), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antimicrobials, Drug A and Drug B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI: \if{html}{\out{
}}\preformatted{-------------------------------------------------------------------- only_all_tested = FALSE only_all_tested = TRUE diff --git a/tests/testthat.R b/tests/testthat.R index d6b99c029..0acf02312 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -30,16 +30,4 @@ library(testthat) library(AMR) -# add functions from the tinytest package (which we use for older R versions) -expect_inherits <- function(x, y, ...) { - expect(inherits(x, y), - failure_message = paste0( - "object has class ", paste0(class(x), collapse = "/"), - ", required is class ", paste0(y, collapse = "/") - ) - ) -} -expect_stdout <- expect_output - -# start unit tests test_check("AMR") diff --git a/tests/testthat/helper-functions.R b/tests/testthat/helper-functions.R new file mode 100644 index 000000000..352ef38d5 --- /dev/null +++ b/tests/testthat/helper-functions.R @@ -0,0 +1,38 @@ +# ==================================================================== # +# TITLE: # +# AMR: An R Package for Working with Antimicrobial Resistance Data # +# # +# SOURCE CODE: # +# https://github.com/msberends/AMR # +# # +# PLEASE CITE THIS SOFTWARE AS: # +# Berends MS, Luz CF, Friedrich AW, et al. (2022). # +# AMR: An R Package for Working with Antimicrobial Resistance Data. # +# Journal of Statistical Software, 104(3), 1-31. # +# https://doi.org/10.18637/jss.v104.i03 # +# # +# Developed at the University of Groningen and the University Medical # +# Center Groningen in The Netherlands, in collaboration with many # +# colleagues from around the world, see our website. # +# # +# This R package is free software; you can freely use and distribute # +# it for both personal and commercial purposes under the terms of the # +# GNU General Public License version 2.0 (GNU GPL-2), as published by # +# the Free Software Foundation. # +# We created this package for both routine data analysis and academic # +# research and it was publicly released in the hope that it will be # +# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. # +# # +# Visit our website for the full manual and a complete tutorial about # +# how to conduct AMR data analysis: https://msberends.github.io/AMR/ # +# ==================================================================== # + +# add functions from the tinytest package (which we use for older R versions) +expect_inherits <- function(x, y, ...) { + expect(inherits(x, y), + failure_message = paste0( + "object has class ", paste0(class(x), collapse = "/"), + ", required is class ", paste0(y, collapse = "/") + ) + ) +} diff --git a/tests/testthat/test-_deprecated.R b/tests/testthat/test-_deprecated.R index 95bfcd045..9ff237722 100644 --- a/tests/testthat/test-_deprecated.R +++ b/tests/testthat/test-_deprecated.R @@ -27,5 +27,7 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_warning(example_isolates[, ab_class("mycobact")]) -expect_warning(example_isolates[, ab_selector(name %like% "trim")]) +test_that("deprecated works", { + expect_warning(example_isolates[, ab_class("mycobact")]) + expect_warning(example_isolates[, ab_selector(name %like% "trim")]) +}) diff --git a/tests/testthat/test-_misc.R b/tests/testthat/test-_misc.R index a69052fd9..43d33d09f 100755 --- a/tests/testthat/test-_misc.R +++ b/tests/testthat/test-_misc.R @@ -27,70 +27,72 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_equal(AMR:::percentage(0.25), "25%") -expect_equal(AMR:::percentage(0.5), "50%") -expect_equal(AMR:::percentage(0.500, digits = 1), "50.0%") -expect_equal(AMR:::percentage(0.1234), "12.3%") -# round up 0.5 -expect_equal(AMR:::percentage(0.0054), "0.5%") -expect_equal(AMR:::percentage(0.0055), "0.6%") +test_that("misc works", { + expect_equal(AMR:::percentage(0.25), "25%") + expect_equal(AMR:::percentage(0.5), "50%") + expect_equal(AMR:::percentage(0.500, digits = 1), "50.0%") + expect_equal(AMR:::percentage(0.1234), "12.3%") + # round up 0.5 + expect_equal(AMR:::percentage(0.0054), "0.5%") + expect_equal(AMR:::percentage(0.0055), "0.6%") -# test functions on all R versions - R < 3.3 did not contain these -expect_equal(strrep("A", 5), "AAAAA") -expect_equal(strrep(c("A", "B"), c(5, 2)), c("AAAAA", "BB")) -expect_equal(trimws(" test "), "test") -expect_equal(trimws(" test ", "l"), "test ") -expect_equal(trimws(" test ", "r"), " test") -expect_equal(AMR:::trimws2(" test "), "test") -expect_equal(AMR:::trimws2(" test ", "l"), "test ") -expect_equal(AMR:::trimws2(" test ", "r"), " test") + # test functions on all R versions - R < 3.3 did not contain these + expect_equal(strrep("A", 5), "AAAAA") + expect_equal(strrep(c("A", "B"), c(5, 2)), c("AAAAA", "BB")) + expect_equal(trimws(" test "), "test") + expect_equal(trimws(" test ", "l"), "test ") + expect_equal(trimws(" test ", "r"), " test") + expect_equal(AMR:::trimws2(" test "), "test") + expect_equal(AMR:::trimws2(" test ", "l"), "test ") + expect_equal(AMR:::trimws2(" test ", "r"), " test") -expect_message(AMR:::get_column_abx(example_isolates, soft_dependencies = "FUS")) + expect_message(AMR:::get_column_abx(example_isolates, soft_dependencies = "FUS")) -# we rely on "grouped_tbl" being a class of grouped tibbles, so run a test that checks for this: -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_true(AMR:::is_null_or_grouped_tbl(example_isolates %>% group_by(ward))) -} - - -# test get_current_data() ---- - -is_right <- FALSE -check_df <- function(check_element, return_val = 0) { - is_right <<- FALSE - for (env in sys.frames()) { - if (!is.null(env[[check_element]]) && is.data.frame(env[[check_element]])) { - is_right <<- TRUE - } + # we rely on "grouped_tbl" being a class of grouped tibbles, so run a test that checks for this: + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_true(AMR:::is_null_or_grouped_tbl(example_isolates %>% group_by(ward))) } - return_val -} -df <- example_isolates[, check_df("x")] -expect_true(is_right, info = "the environmental data cannot be found for base/x (1)") -if (getRversion() < "4.0.0") { - df <- example_isolates[c(1:3), check_df("xx")] - expect_true(is_right, info = "the environmental data cannot be found for base/xx") -} else { - df <- example_isolates[c(1:3), check_df("x")] - expect_true(is_right, info = "the environmental data cannot be found for base/x (2)") -} + # test get_current_data() ---- -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - df <- example_isolates %>% select(mo, check_df("data123")) - expect_false(is_right, info = "just a check if non-sense is not being gathered by get_current_data()") + is_right <- FALSE + check_df <- function(check_element, return_val = 0) { + is_right <<- FALSE + for (env in sys.frames()) { + if (!is.null(env[[check_element]]) && is.data.frame(env[[check_element]])) { + is_right <<- TRUE + } + } + return_val + } - df <- example_isolates %>% select(mo, check_df(".data")) - expect_true(is_right, info = "the environmental data cannot be found for dplyr/select()") + df <- example_isolates[, check_df("x")] + expect_true(is_right, info = "the environmental data cannot be found for base/x (1)") - df <- example_isolates %>% select_at(check_df(".tbl")) - expect_true(is_right, info = "the environmental data cannot be found for dplyr/select_at()") -} + if (getRversion() < "4.0.0") { + df <- example_isolates[c(1:3), check_df("xx")] + expect_true(is_right, info = "the environmental data cannot be found for base/xx") + } else { + df <- example_isolates[c(1:3), check_df("x")] + expect_true(is_right, info = "the environmental data cannot be found for base/x (2)") + } -if (AMR:::pkg_is_available("tidymodels", also_load = TRUE)) { - resistance_recipe <- recipe(mo ~ ., data = example_isolates) %>% - step_corr(check_df("training")) %>% - prep() - expect_true(is_right, info = "the environmental data cannot be found for tidymodels/prep()") -} + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + df <- example_isolates %>% select(mo, check_df("data123")) + expect_false(is_right, info = "just a check if non-sense is not being gathered by get_current_data()") + + df <- example_isolates %>% select(mo, check_df(".data")) + expect_true(is_right, info = "the environmental data cannot be found for dplyr/select()") + + df <- example_isolates %>% select_at(check_df(".tbl")) + expect_true(is_right, info = "the environmental data cannot be found for dplyr/select_at()") + } + + if (AMR:::pkg_is_available("tidymodels", also_load = TRUE)) { + resistance_recipe <- recipe(mo ~ ., data = example_isolates) %>% + step_corr(check_df("training")) %>% + prep() + expect_true(is_right, info = "the environmental data cannot be found for tidymodels/prep()") + } +}) diff --git a/tests/testthat/test-ab.R b/tests/testthat/test-ab.R index 882d36b5e..ede941943 100755 --- a/tests/testthat/test-ab.R +++ b/tests/testthat/test-ab.R @@ -27,80 +27,82 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -ab_reset_session() +test_that("ab works", { + ab_reset_session() -expect_equal( - as.character(as.ab(c( - "J01FA01", - "J 01 FA 01", - "Erythromycin", - "eryt", - "ERYT", - "ERY", - "erytromicine", - "Erythrocin", - "Romycin" - ))), - rep("ERY", 9) -) + expect_equal( + as.character(as.ab(c( + "J01FA01", + "J 01 FA 01", + "Erythromycin", + "eryt", + "ERYT", + "ERY", + "erytromicine", + "Erythrocin", + "Romycin" + ))), + rep("ERY", 9) + ) -expect_identical(class(as.ab("amox")), c("ab", "character")) -expect_identical(class(antibiotics$ab), c("ab", "character")) -expect_true(is.ab(as.ab("amox"))) -expect_stdout(print(as.ab("amox"))) -expect_stdout(print(data.frame(a = as.ab("amox")))) + expect_identical(class(as.ab("amox")), c("ab", "character")) + expect_identical(class(AMR::antimicrobials$ab), c("ab", "character")) + expect_true(is.ab(as.ab("amox"))) + expect_output(print(as.ab("amox"))) + expect_output(print(data.frame(a = as.ab("amox")))) -expect_warning(as.ab("J00AA00")) # ATC not yet available in data set -# expect_warning(as.ab("UNKNOWN")) + expect_warning(as.ab("J00AA00")) # ATC not yet available in data set + # expect_warning(as.ab("UNKNOWN")) -expect_stdout(print(as.ab("amox"))) + expect_output(print(as.ab("amox"))) -expect_equal( - as.character(as.ab("Phloxapen")), - "FLC" -) + expect_equal( + as.character(as.ab("Phloxapen")), + "FLC" + ) -expect_equal( - suppressWarnings(as.character(as.ab(c("Bacteria", "Bacterial")))), - c(NA, "TMP") -) + expect_equal( + suppressWarnings(as.character(as.ab(c("Bacteria", "Bacterial")))), + c(NA, "TMP") + ) -expect_equal( - as.character(as.ab("Amoxy + clavulaanzuur")), - "AMC" -) + expect_equal( + as.character(as.ab("Amoxy + clavulaanzuur")), + "AMC" + ) -expect_equal( - as.character(as.ab(c("mreopenem", "co-maoxiclav"))), - c("MEM", "AMC") -) + expect_equal( + as.character(as.ab(c("mreopenem", "co-maoxiclav"))), + c("MEM", "AMC") + ) -# expect_warning(as.ab("cipro mero")) + # expect_warning(as.ab("cipro mero")) -# based on Levenshtein distance -expect_identical(ab_name("ceftazidim/avibactam", language = NULL), "Ceftazidime/avibactam") + # based on Levenshtein distance + expect_identical(ab_name("ceftazidim/avibactam", language = NULL), "Ceftazidime/avibactam") -expect_identical( - as.character(as.ab(c( - "gentamicine High Level", - "gentamicine High", - "gentamicine (High Level)", - "gentamicine (High)", - "gentamicine HL", - "gentamicine H-L", - "gentamicine (HL)", - "gentamicine (H-L)" - ))), - rep("GEH", 8) -) + expect_identical( + as.character(as.ab(c( + "gentamicine High Level", + "gentamicine High", + "gentamicine (High Level)", + "gentamicine (High)", + "gentamicine HL", + "gentamicine H-L", + "gentamicine (HL)", + "gentamicine (H-L)" + ))), + rep("GEH", 8) + ) -# assigning and subsetting -x <- antibiotics$ab -expect_inherits(x[1], "ab") -expect_inherits(x[[1]], "ab") -expect_inherits(c(x[1], x[9]), "ab") -expect_inherits(unique(x[1], x[9]), "ab") -expect_inherits(rep(x[1], 2), "ab") -# expect_warning(x[1] <- "invalid code") -# expect_warning(x[[1]] <- "invalid code") -# expect_warning(c(x[1], "test")) + # assigning and subsetting + x <- AMR::antimicrobials$ab + expect_inherits(x[1], "ab") + expect_inherits(x[[1]], "ab") + expect_inherits(c(x[1], x[9]), "ab") + expect_inherits(unique(x[1], x[9]), "ab") + expect_inherits(rep(x[1], 2), "ab") + # expect_warning(x[1] <- "invalid code") + # expect_warning(x[[1]] <- "invalid code") + # expect_warning(c(x[1], "test")) +}) diff --git a/tests/testthat/test-ab_from_text.R b/tests/testthat/test-ab_from_text.R index 3ae1fc36e..2aab027ef 100644 --- a/tests/testthat/test-ab_from_text.R +++ b/tests/testthat/test-ab_from_text.R @@ -27,34 +27,36 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -ab_reset_session() +test_that("ab_from_text works", { + ab_reset_session() -expect_identical( - ab_from_text("28/03/2020 amoxicilliin 500mg po tds")[[1]], - as.ab("Amoxicillin") -) -expect_identical( - ab_from_text("28/03/2020 amoxicilliin 500mg po tds", thorough_search = TRUE)[[1]], - as.ab("Amoxicillin") -) -expect_identical( - ab_from_text("28/03/2020 amoxicilliin 500mg po tds", thorough_search = FALSE)[[1]], - as.ab("Amoxicillin") -) -expect_identical( - ab_from_text("28/03/2020 amoxicilliin 500mg po tds", translate_ab = TRUE)[[1]], - "Amoxicillin" -) -expect_identical( - ab_from_text("administered amoxi/clav and cipro", collapse = ", ")[[1]], - "AMC, CIP" -) + expect_identical( + ab_from_text("28/03/2020 amoxicilliin 500mg po tds")[[1]], + as.ab("Amoxicillin") + ) + expect_identical( + ab_from_text("28/03/2020 amoxicilliin 500mg po tds", thorough_search = TRUE)[[1]], + as.ab("Amoxicillin") + ) + expect_identical( + ab_from_text("28/03/2020 amoxicilliin 500mg po tds", thorough_search = FALSE)[[1]], + as.ab("Amoxicillin") + ) + expect_identical( + ab_from_text("28/03/2020 amoxicilliin 500mg po tds", translate_ab = TRUE)[[1]], + "Amoxicillin" + ) + expect_identical( + ab_from_text("administered amoxi/clav and cipro", collapse = ", ")[[1]], + "AMC, CIP" + ) -expect_identical( - ab_from_text("28/03/2020 amoxicilliin 500mg po tds", type = "dose")[[1]], - 500 -) -expect_identical( - ab_from_text("28/03/2020 amoxicilliin 500mg po tds", type = "admin")[[1]], - "oral" -) + expect_identical( + ab_from_text("28/03/2020 amoxicilliin 500mg po tds", type = "dose")[[1]], + 500 + ) + expect_identical( + ab_from_text("28/03/2020 amoxicilliin 500mg po tds", type = "admin")[[1]], + "oral" + ) +}) diff --git a/tests/testthat/test-ab_property.R b/tests/testthat/test-ab_property.R index 83cff84ae..5427122fa 100644 --- a/tests/testthat/test-ab_property.R +++ b/tests/testthat/test-ab_property.R @@ -27,72 +27,74 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -ab_reset_session() +test_that("ab_property works", { + ab_reset_session() -expect_identical(ab_name("AMX", language = NULL), "Amoxicillin") -expect_identical(ab_atc("AMX"), "J01CA04") -expect_identical(ab_cid("AMX"), as.integer(33613)) + expect_identical(ab_name("AMX", language = NULL), "Amoxicillin") + expect_identical(ab_atc("AMX"), "J01CA04") + expect_identical(ab_cid("AMX"), as.integer(33613)) -expect_inherits(ab_tradenames("AMX"), "character") -expect_inherits(ab_tradenames(c("AMX", "AMX")), "list") + expect_inherits(ab_tradenames("AMX"), "character") + expect_inherits(ab_tradenames(c("AMX", "AMX")), "list") -expect_identical(ab_group("AMX", language = NULL), "Beta-lactams/penicillins") -expect_identical(ab_atc_group1("AMX", language = NULL), "Beta-lactam antibacterials, penicillins") -expect_identical(ab_atc_group2("AMX", language = NULL), "Penicillins with extended spectrum") + expect_identical(ab_group("AMX", language = NULL), "Beta-lactams/penicillins") + expect_identical(ab_atc_group1("AMX", language = NULL), "Beta-lactam antibacterials, penicillins") + expect_identical(ab_atc_group2("AMX", language = NULL), "Penicillins with extended spectrum") -expect_identical(ab_name("Fluclox", language = NULL), "Flucloxacillin") -expect_identical(ab_name("fluklox", language = NULL), "Flucloxacillin") -expect_identical(ab_name("floxapen", language = NULL), "Flucloxacillin") -expect_identical(ab_name(21319, language = NULL), "Flucloxacillin") -expect_identical(ab_name("J01CF05", language = NULL), "Flucloxacillin") + expect_identical(ab_name("Fluclox", language = NULL), "Flucloxacillin") + expect_identical(ab_name("fluklox", language = NULL), "Flucloxacillin") + expect_identical(ab_name("floxapen", language = NULL), "Flucloxacillin") + expect_identical(ab_name(21319, language = NULL), "Flucloxacillin") + expect_identical(ab_name("J01CF05", language = NULL), "Flucloxacillin") -expect_identical(ab_ddd("AMX", "oral"), 1.5) -expect_identical(ab_ddd_units("AMX", "iv"), "g") -expect_identical(ab_ddd("AMX", "iv"), 3) + expect_identical(ab_ddd("AMX", "oral"), 1.5) + expect_identical(ab_ddd_units("AMX", "iv"), "g") + expect_identical(ab_ddd("AMX", "iv"), 3) -expect_identical(ab_name(x = c("AMC", "PLB"), language = NULL), c("Amoxicillin/clavulanic acid", "Polymyxin B")) -expect_identical( - ab_name(x = c("AMC", "PLB"), tolower = TRUE, language = NULL), - c("amoxicillin/clavulanic acid", "polymyxin B") -) - -expect_inherits(ab_info("AMX"), "list") - -expect_error(ab_property("amox", "invalid property")) -expect_error(ab_name("amox", language = "INVALID")) -expect_stdout(print(ab_name("amox", language = NULL))) - -expect_equal(ab_name("21066-6", language = NULL), "Ampicillin") -expect_equal( - ab_loinc("ampicillin"), - c("101477-8", "101478-6", "18864-9", "18865-6", "20374-5", "21066-6", "23618-2", "27-3", "28-1", "29-9", "30-7", "31-5", "32-3", "33-1", "3355-5", "33562-0", "33919-2", "34-9", "43883-8", "43884-6", "6979-9", "6980-7", "87604-5") -) - -expect_true(ab_url("AMX") %like% "fhi[.]no") - -expect_identical( - colnames(set_ab_names(example_isolates[, 17:22])), - c("cefoxitin", "cefotaxime", "ceftazidime", "ceftriaxone", "gentamicin", "tobramycin") -) -expect_identical( - colnames(set_ab_names(example_isolates[, 17:22], language = "nl", snake_case = FALSE)), - c("Cefoxitine", "Cefotaxim", "Ceftazidim", "Ceftriaxon", "Gentamicine", "Tobramycine") -) -expect_identical( - colnames(set_ab_names(example_isolates[, 17:22], property = "atc")), - c("J01DC01", "J01DD01", "J01DD02", "J01DD04", "J01GB03", "J01GB01") -) - -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_identical(ab_name(x = c("AMC", "PLB"), language = NULL), c("Amoxicillin/clavulanic acid", "Polymyxin B")) expect_identical( - example_isolates %>% set_ab_names(), - example_isolates %>% rename_with(set_ab_names) + ab_name(x = c("AMC", "PLB"), tolower = TRUE, language = NULL), + c("amoxicillin/clavulanic acid", "polymyxin B") ) - expect_true(all(c( - "SXT", "nitrofurantoin", "fosfomycin", "linezolid", "ciprofloxacin", - "moxifloxacin", "vancomycin", "TEC" - ) %in% - (example_isolates %>% - set_ab_names(NIT:VAN) %>% - colnames()))) -} + + expect_inherits(ab_info("AMX"), "list") + + expect_error(ab_property("amox", "invalid property")) + expect_error(ab_name("amox", language = "INVALID")) + expect_output(print(ab_name("amox", language = NULL))) + + expect_equal(ab_name("21066-6", language = NULL), "Ampicillin") + expect_equal( + ab_loinc("ampicillin"), + c("101477-8", "101478-6", "18864-9", "18865-6", "20374-5", "21066-6", "23618-2", "27-3", "28-1", "29-9", "30-7", "31-5", "32-3", "33-1", "3355-5", "33562-0", "33919-2", "34-9", "43883-8", "43884-6", "6979-9", "6980-7", "87604-5") + ) + + expect_true(ab_url("AMX") %like% "fhi[.]no") + + expect_identical( + colnames(set_ab_names(example_isolates[, 17:22])), + c("cefoxitin", "cefotaxime", "ceftazidime", "ceftriaxone", "gentamicin", "tobramycin") + ) + expect_identical( + colnames(set_ab_names(example_isolates[, 17:22], language = "nl", snake_case = FALSE)), + c("Cefoxitine", "Cefotaxim", "Ceftazidim", "Ceftriaxon", "Gentamicine", "Tobramycine") + ) + expect_identical( + colnames(set_ab_names(example_isolates[, 17:22], property = "atc")), + c("J01DC01", "J01DD01", "J01DD02", "J01DD04", "J01GB03", "J01GB01") + ) + + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_identical( + example_isolates %>% set_ab_names(), + example_isolates %>% rename_with(set_ab_names) + ) + expect_true(all(c( + "SXT", "nitrofurantoin", "fosfomycin", "linezolid", "ciprofloxacin", + "moxifloxacin", "vancomycin", "TEC" + ) %in% + (example_isolates %>% + set_ab_names(NIT:VAN) %>% + colnames()))) + } +}) diff --git a/tests/testthat/test-age.R b/tests/testthat/test-age.R index 8ebd4752d..a92460097 100644 --- a/tests/testthat/test-age.R +++ b/tests/testthat/test-age.R @@ -27,69 +27,71 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_equal( - age( +test_that("age works", { + expect_equal( + age( + x = c("1980-01-01", "1985-01-01", "1990-01-01"), + reference = "2019-01-01" + ), + c(39, 34, 29) + ) + + expect_equal( + age( + x = c("2019-01-01", "2019-04-01", "2019-07-01"), + reference = "2019-09-01", + exact = TRUE + ), + c(0.6656393, 0.4191781, 0.1698630), + tolerance = 0.001 + ) + + expect_error(age( x = c("1980-01-01", "1985-01-01", "1990-01-01"), - reference = "2019-01-01" - ), - c(39, 34, 29) -) + reference = c("2019-01-01", "2019-01-01") + )) -expect_equal( - age( - x = c("2019-01-01", "2019-04-01", "2019-07-01"), - reference = "2019-09-01", - exact = TRUE - ), - c(0.6656393, 0.4191781, 0.1698630), - tolerance = 0.001 -) + # expect_warning(age(x = c("1980-01-01", "1985-01-01", "1990-01-01"), reference = "1975-01-01")) + # expect_warning(age(x = c("1800-01-01", "1805-01-01", "1810-01-01"), reference = "2019-01-01")) -expect_error(age( - x = c("1980-01-01", "1985-01-01", "1990-01-01"), - reference = c("2019-01-01", "2019-01-01") -)) - -# expect_warning(age(x = c("1980-01-01", "1985-01-01", "1990-01-01"), reference = "1975-01-01")) -# expect_warning(age(x = c("1800-01-01", "1805-01-01", "1810-01-01"), reference = "2019-01-01")) - -expect_equal( - length(age(x = c("2019-01-01", NA), na.rm = TRUE)), - 1 -) + expect_equal( + length(age(x = c("2019-01-01", NA), na.rm = TRUE)), + 1 + ) -ages <- c(3, 8, 16, 54, 31, 76, 101, 43, 21) + ages <- c(3, 8, 16, 54, 31, 76, 101, 43, 21) -expect_equal( - length(unique(age_groups(ages, 50))), - 2 -) -expect_equal( - length(unique(age_groups(ages, c(50, 60)))), - 3 -) -expect_identical( - class(age_groups(ages, "child")), - c("ordered", "factor") -) + expect_equal( + length(unique(age_groups(ages, 50))), + 2 + ) + expect_equal( + length(unique(age_groups(ages, c(50, 60)))), + 3 + ) + expect_identical( + class(age_groups(ages, "child")), + c("ordered", "factor") + ) -expect_identical( - class(age_groups(ages, "elderly")), - c("ordered", "factor") -) + expect_identical( + class(age_groups(ages, "elderly")), + c("ordered", "factor") + ) -expect_identical( - class(age_groups(ages, "tens")), - c("ordered", "factor") -) + expect_identical( + class(age_groups(ages, "tens")), + c("ordered", "factor") + ) -expect_identical( - class(age_groups(ages, "fives")), - c("ordered", "factor") -) + expect_identical( + class(age_groups(ages, "fives")), + c("ordered", "factor") + ) -expect_equal( - length(age_groups(c(10, 20, 30, NA), na.rm = TRUE)), - 3 -) + expect_equal( + length(age_groups(c(10, 20, 30, NA), na.rm = TRUE)), + 3 + ) +}) diff --git a/tests/testthat/test-amr_selectors.R b/tests/testthat/test-amr_selectors.R index 5d2071807..9c768fff8 100644 --- a/tests/testthat/test-amr_selectors.R +++ b/tests/testthat/test-amr_selectors.R @@ -27,90 +27,92 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -# antibiotic class selectors -expect_equal(ncol(example_isolates[, amr_class("antimyco"), drop = FALSE]), 1, tolerance = 0.5) -expect_equal(ncol(example_isolates[, amr_selector(name %like% "trim"), drop = FALSE]), 2, tolerance = 0.5) -expect_equal(ncol(example_isolates[, aminoglycosides(), drop = FALSE]), 4, tolerance = 0.5) -expect_equal(ncol(example_isolates[, aminopenicillins(), drop = FALSE]), 2, tolerance = 0.5) -expect_equal(ncol(example_isolates[, betalactams(), drop = FALSE]), 16, tolerance = 0.5) -expect_equal(ncol(example_isolates[, carbapenems(), drop = FALSE]), 2, tolerance = 0.5) -expect_equal(ncol(example_isolates[, cephalosporins(), drop = FALSE]), 7, tolerance = 0.5) -expect_equal(ncol(example_isolates[, cephalosporins_1st(), drop = FALSE]), 1, tolerance = 0.5) -expect_equal(ncol(example_isolates[, cephalosporins_2nd(), drop = FALSE]), 2, tolerance = 0.5) -expect_equal(ncol(example_isolates[, cephalosporins_3rd(), drop = FALSE]), 3, tolerance = 0.5) -expect_equal(ncol(example_isolates[, cephalosporins_4th(), drop = FALSE]), 1, tolerance = 0.5) -expect_equal(ncol(example_isolates[, cephalosporins_5th(), drop = FALSE]), 0, tolerance = 0.5) -expect_equal(ncol(example_isolates[, fluoroquinolones(), drop = FALSE]), 2, tolerance = 0.5) -expect_equal(ncol(example_isolates[, glycopeptides(), drop = FALSE]), 2, tolerance = 0.5) -expect_equal(ncol(example_isolates[, isoxazolylpenicillins(), drop = FALSE]), 2, tolerance = 0.5) -expect_equal(ncol(example_isolates[, lincosamides(), drop = FALSE]), 1, tolerance = 0.5) -expect_equal(ncol(example_isolates[, lipoglycopeptides(), drop = FALSE]), 0, tolerance = 0.5) -expect_equal(ncol(example_isolates[, macrolides(), drop = FALSE]), 2, tolerance = 0.5) -expect_equal(ncol(example_isolates[, monobactams(), drop = FALSE]), 0, tolerance = 0.5) -expect_equal(ncol(example_isolates[, nitrofurans(), drop = FALSE]), 1, tolerance = 0.5) -expect_equal(ncol(example_isolates[, oxazolidinones(), drop = FALSE]), 1, tolerance = 0.5) -expect_equal(ncol(example_isolates[, penicillins(), drop = FALSE]), 7, tolerance = 0.5) -expect_equal(ncol(example_isolates[, phenicols(), drop = FALSE]), 1, tolerance = 0.5) -expect_equal(ncol(example_isolates[, polymyxins(), drop = FALSE]), 1, tolerance = 0.5) -expect_equal(ncol(example_isolates[, rifamycins(), drop = FALSE]), 1, tolerance = 0.5) -expect_equal(ncol(example_isolates[, streptogramins(), drop = FALSE]), 0, tolerance = 0.5) -expect_equal(ncol(example_isolates[, quinolones(), drop = FALSE]), 2, tolerance = 0.5) -expect_equal(ncol(example_isolates[, tetracyclines(), drop = FALSE]), 3, tolerance = 0.5) -expect_equal(ncol(example_isolates[, trimethoprims(), drop = FALSE]), 2, tolerance = 0.5) -expect_equal(ncol(example_isolates[, ureidopenicillins(), drop = FALSE]), 1, tolerance = 0.5) +test_that("amr selectors works", { + # antibiotic class selectors + expect_equal(ncol(example_isolates[, amr_class("antimyco"), drop = FALSE]), 1, tolerance = 0.5) + expect_equal(ncol(example_isolates[, amr_selector(name %like% "trim"), drop = FALSE]), 2, tolerance = 0.5) + expect_equal(ncol(example_isolates[, aminoglycosides(), drop = FALSE]), 4, tolerance = 0.5) + expect_equal(ncol(example_isolates[, aminopenicillins(), drop = FALSE]), 2, tolerance = 0.5) + expect_equal(ncol(example_isolates[, betalactams(), drop = FALSE]), 16, tolerance = 0.5) + expect_equal(ncol(example_isolates[, carbapenems(), drop = FALSE]), 2, tolerance = 0.5) + expect_equal(ncol(example_isolates[, cephalosporins(), drop = FALSE]), 7, tolerance = 0.5) + expect_equal(ncol(example_isolates[, cephalosporins_1st(), drop = FALSE]), 1, tolerance = 0.5) + expect_equal(ncol(example_isolates[, cephalosporins_2nd(), drop = FALSE]), 2, tolerance = 0.5) + expect_equal(ncol(example_isolates[, cephalosporins_3rd(), drop = FALSE]), 3, tolerance = 0.5) + expect_equal(ncol(example_isolates[, cephalosporins_4th(), drop = FALSE]), 1, tolerance = 0.5) + expect_equal(ncol(example_isolates[, cephalosporins_5th(), drop = FALSE]), 0, tolerance = 0.5) + expect_equal(ncol(example_isolates[, fluoroquinolones(), drop = FALSE]), 2, tolerance = 0.5) + expect_equal(ncol(example_isolates[, glycopeptides(), drop = FALSE]), 2, tolerance = 0.5) + expect_equal(ncol(example_isolates[, isoxazolylpenicillins(), drop = FALSE]), 2, tolerance = 0.5) + expect_equal(ncol(example_isolates[, lincosamides(), drop = FALSE]), 1, tolerance = 0.5) + expect_equal(ncol(example_isolates[, lipoglycopeptides(), drop = FALSE]), 0, tolerance = 0.5) + expect_equal(ncol(example_isolates[, macrolides(), drop = FALSE]), 2, tolerance = 0.5) + expect_equal(ncol(example_isolates[, monobactams(), drop = FALSE]), 0, tolerance = 0.5) + expect_equal(ncol(example_isolates[, nitrofurans(), drop = FALSE]), 1, tolerance = 0.5) + expect_equal(ncol(example_isolates[, oxazolidinones(), drop = FALSE]), 1, tolerance = 0.5) + expect_equal(ncol(example_isolates[, penicillins(), drop = FALSE]), 7, tolerance = 0.5) + expect_equal(ncol(example_isolates[, phenicols(), drop = FALSE]), 1, tolerance = 0.5) + expect_equal(ncol(example_isolates[, polymyxins(), drop = FALSE]), 1, tolerance = 0.5) + expect_equal(ncol(example_isolates[, rifamycins(), drop = FALSE]), 1, tolerance = 0.5) + expect_equal(ncol(example_isolates[, streptogramins(), drop = FALSE]), 0, tolerance = 0.5) + expect_equal(ncol(example_isolates[, quinolones(), drop = FALSE]), 2, tolerance = 0.5) + expect_equal(ncol(example_isolates[, tetracyclines(), drop = FALSE]), 3, tolerance = 0.5) + expect_equal(ncol(example_isolates[, trimethoprims(), drop = FALSE]), 2, tolerance = 0.5) + expect_equal(ncol(example_isolates[, ureidopenicillins(), drop = FALSE]), 1, tolerance = 0.5) -expect_message(expect_stdout(print(carbapenems()))) -expect_error(administrable_per_os()) + expect_message(expect_output(print(carbapenems()))) + expect_error(administrable_per_os()) -# Examples: + # Examples: -# select columns 'mo', 'AMK', 'GEN', 'KAN' and 'TOB' -expect_equal(ncol(example_isolates[, c("mo", aminoglycosides())]), 5, tolerance = 0.5) + # select columns 'mo', 'AMK', 'GEN', 'KAN' and 'TOB' + expect_equal(ncol(example_isolates[, c("mo", aminoglycosides())]), 5, tolerance = 0.5) -expect_equal(ncol(example_isolates[, c(administrable_per_os() & penicillins())]), 5, tolerance = 0.5) -expect_equal(ncol(example_isolates[, c(administrable_iv() & penicillins())]), 7, tolerance = 0.5) -expect_equal(ncol(example_isolates[, c(administrable_iv() | penicillins())]), 37, tolerance = 0.5) + expect_equal(ncol(example_isolates[, c(administrable_per_os() & penicillins())]), 5, tolerance = 0.5) + expect_equal(ncol(example_isolates[, c(administrable_iv() & penicillins())]), 7, tolerance = 0.5) + expect_equal(ncol(example_isolates[, c(administrable_iv() | penicillins())]), 37, tolerance = 0.5) -# filter using any() or all() -expect_equal(nrow(example_isolates[any(carbapenems() == "R"), ]), 55, tolerance = 0.5) -expect_equal(nrow(subset(example_isolates, any(carbapenems() == "R"))), 55, tolerance = 0.5) + # filter using any() or all() + expect_equal(nrow(example_isolates[any(carbapenems() == "R"), ]), 55, tolerance = 0.5) + expect_equal(nrow(subset(example_isolates, any(carbapenems() == "R"))), 55, tolerance = 0.5) -# filter on any or all results in the carbapenem columns (i.e., IPM, MEM): -expect_equal(nrow(example_isolates[any(carbapenems()), ]), 962, tolerance = 0.5) -expect_equal(nrow(example_isolates[all(carbapenems()), ]), 756, tolerance = 0.5) -expect_equal(nrow(example_isolates[any(carbapenems() == "R"), ]), 55, tolerance = 0.5) -expect_equal(nrow(example_isolates[any(carbapenems() != "R"), ]), 910, tolerance = 0.5) -expect_equal(nrow(example_isolates[carbapenems() != "R", ]), 704, tolerance = 0.5) + # filter on any or all results in the carbapenem columns (i.e., IPM, MEM): + expect_equal(nrow(example_isolates[any(carbapenems()), ]), 962, tolerance = 0.5) + expect_equal(nrow(example_isolates[all(carbapenems()), ]), 756, tolerance = 0.5) + expect_equal(nrow(example_isolates[any(carbapenems() == "R"), ]), 55, tolerance = 0.5) + expect_equal(nrow(example_isolates[any(carbapenems() != "R"), ]), 910, tolerance = 0.5) + expect_equal(nrow(example_isolates[carbapenems() != "R", ]), 704, tolerance = 0.5) -# filter with multiple antibiotic selectors using c() -expect_equal(nrow(example_isolates[all(c(carbapenems(), aminoglycosides()) == "R"), ]), 26, tolerance = 0.5) + # filter with multiple antibiotic selectors using c() + expect_equal(nrow(example_isolates[all(c(carbapenems(), aminoglycosides()) == "R"), ]), 26, tolerance = 0.5) -# filter + select in one go: get penicillins in carbapenems-resistant strains -expect_equal(nrow(example_isolates[any(carbapenems() == "R"), penicillins()]), 55, tolerance = 0.5) -expect_equal(ncol(example_isolates[any(carbapenems() == "R"), penicillins()]), 7, tolerance = 0.5) + # filter + select in one go: get penicillins in carbapenems-resistant strains + expect_equal(nrow(example_isolates[any(carbapenems() == "R"), penicillins()]), 55, tolerance = 0.5) + expect_equal(ncol(example_isolates[any(carbapenems() == "R"), penicillins()]), 7, tolerance = 0.5) -x <- data.frame( - x = 0, - mo = 0, - gen = "S", - genta = "S", - J01GB03 = "S", - tobra = "S", - Tobracin = "S" -) -# should have the first hits -expect_identical( - colnames(x[, aminoglycosides(return_all = FALSE)]), - c("gen", "tobra") -) -expect_identical( - colnames(x[, aminoglycosides()]), - c("gen", "genta", "J01GB03", "tobra", "Tobracin") -) + x <- data.frame( + x = 0, + mo = 0, + gen = "S", + genta = "S", + J01GB03 = "S", + tobra = "S", + Tobracin = "S" + ) + # should have the first hits + expect_identical( + colnames(x[, aminoglycosides(return_all = FALSE)]), + c("gen", "tobra") + ) + expect_identical( + colnames(x[, aminoglycosides()]), + c("gen", "genta", "J01GB03", "tobra", "Tobracin") + ) -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_equal(example_isolates %>% select(administrable_per_os() & penicillins()) %>% ncol(), 5, tolerance = 0.5) - expect_equal(example_isolates %>% select(administrable_iv() & penicillins()) %>% ncol(), 7, tolerance = 0.5) - expect_equal(example_isolates %>% select(administrable_iv() | penicillins()) %>% ncol(), 37, tolerance = 0.5) - # expect_warning(example_isolates %>% select(GEH = GEN) %>% select(aminoglycosides(only_treatable = TRUE))) -} + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_equal(example_isolates %>% select(administrable_per_os() & penicillins()) %>% ncol(), 5, tolerance = 0.5) + expect_equal(example_isolates %>% select(administrable_iv() & penicillins()) %>% ncol(), 7, tolerance = 0.5) + expect_equal(example_isolates %>% select(administrable_iv() | penicillins()) %>% ncol(), 37, tolerance = 0.5) + # expect_warning(example_isolates %>% select(GEH = GEN) %>% select(aminoglycosides(only_treatable = TRUE))) + } +}) diff --git a/tests/testthat/test-antibiogram.R b/tests/testthat/test-antibiogram.R index ae64cc127..09adef1f0 100644 --- a/tests/testthat/test-antibiogram.R +++ b/tests/testthat/test-antibiogram.R @@ -27,130 +27,131 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # +test_that("antibiogram works", { + # Traditional antibiogram ---------------------------------------------- -# Traditional antibiogram ---------------------------------------------- + ab1 <- antibiogram(example_isolates, + antibiotics = c(aminoglycosides(), carbapenems()) + ) -ab1 <- antibiogram(example_isolates, - antibiotics = c(aminoglycosides(), carbapenems()) -) + ab2 <- antibiogram(example_isolates, + antibiotics = aminoglycosides(), + ab_transform = "atc", + mo_transform = "gramstain", + add_total_n = TRUE + ) -ab2 <- antibiogram(example_isolates, - antibiotics = aminoglycosides(), - ab_transform = "atc", - mo_transform = "gramstain", - add_total_n = TRUE -) + ab3 <- antibiogram(example_isolates, + antibiotics = carbapenems(), + ab_transform = "ab", + mo_transform = "name", + formatting_type = 1 + ) -ab3 <- antibiogram(example_isolates, - antibiotics = carbapenems(), - ab_transform = "ab", - mo_transform = "name", - formatting_type = 1 -) + expect_inherits(ab1, "antibiogram") + expect_inherits(ab2, "antibiogram") + expect_inherits(ab3, "antibiogram") + expect_equal(colnames(ab1), c("Pathogen", "Amikacin", "Gentamicin", "Imipenem", "Kanamycin", "Meropenem", "Tobramycin")) + expect_equal(colnames(ab2), c("Pathogen (N min-max)", "J01GB01", "J01GB03", "J01GB04", "J01GB06")) + expect_equal(colnames(ab3), c("Pathogen", "IPM", "MEM")) + expect_equal(ab3$MEM, c(52, NA, 100, 100, NA)) -expect_inherits(ab1, "antibiogram") -expect_inherits(ab2, "antibiogram") -expect_inherits(ab3, "antibiogram") -expect_equal(colnames(ab1), c("Pathogen", "Amikacin", "Gentamicin", "Imipenem", "Kanamycin", "Meropenem", "Tobramycin")) -expect_equal(colnames(ab2), c("Pathogen (N min-max)", "J01GB01", "J01GB03", "J01GB04", "J01GB06")) -expect_equal(colnames(ab3), c("Pathogen", "IPM", "MEM")) -expect_equal(ab3$MEM, c(52, NA, 100, 100, NA)) + # Combined antibiogram ------------------------------------------------- -# Combined antibiogram ------------------------------------------------- + # combined antibiotics yield higher empiric coverage + ab4 <- antibiogram(example_isolates, + antibiotics = c("TZP", "TZP+TOB", "TZP+GEN"), + mo_transform = "gramstain" + ) -# combined antibiotics yield higher empiric coverage -ab4 <- antibiogram(example_isolates, - antibiotics = c("TZP", "TZP+TOB", "TZP+GEN"), - mo_transform = "gramstain" -) + ab5 <- antibiogram(example_isolates, + antibiotics = c("TZP", "TZP+TOB"), + mo_transform = "gramstain", + ab_transform = "name", + sep = " & ", + add_total_n = FALSE + ) -ab5 <- antibiogram(example_isolates, - antibiotics = c("TZP", "TZP+TOB"), - mo_transform = "gramstain", - ab_transform = "name", - sep = " & ", - add_total_n = FALSE -) + expect_inherits(ab4, "antibiogram") + expect_inherits(ab5, "antibiogram") + expect_equal(colnames(ab4), c("Pathogen", "Piperacillin/tazobactam", "Piperacillin/tazobactam + Gentamicin", "Piperacillin/tazobactam + Tobramycin")) + expect_equal(colnames(ab5), c("Pathogen", "Piperacillin/tazobactam", "Piperacillin/tazobactam & Tobramycin")) -expect_inherits(ab4, "antibiogram") -expect_inherits(ab5, "antibiogram") -expect_equal(colnames(ab4), c("Pathogen", "Piperacillin/tazobactam", "Piperacillin/tazobactam + Gentamicin", "Piperacillin/tazobactam + Tobramycin")) -expect_equal(colnames(ab5), c("Pathogen", "Piperacillin/tazobactam", "Piperacillin/tazobactam & Tobramycin")) + # Syndromic antibiogram ------------------------------------------------ -# Syndromic antibiogram ------------------------------------------------ + # the data set could contain a filter for e.g. respiratory specimens + ab6 <- antibiogram(example_isolates, + antibiotics = c(aminoglycosides(), carbapenems()), + syndromic_group = "ward", + ab_transform = NULL + ) -# the data set could contain a filter for e.g. respiratory specimens -ab6 <- antibiogram(example_isolates, - antibiotics = c(aminoglycosides(), carbapenems()), - syndromic_group = "ward", - ab_transform = NULL -) + # with a custom language, though this will be determined automatically + # (i.e., this table will be in Dutch on Dutch systems) + ex1 <- example_isolates[which(mo_genus() == "Escherichia"), ] + ab7 <- antibiogram(ex1, + antibiotics = aminoglycosides(), + ab_transform = "name", + syndromic_group = ifelse(ex1$ward == "ICU", + "IC", "Geen IC" + ), + language = "nl", + add_total_n = TRUE + ) -# with a custom language, though this will be determined automatically -# (i.e., this table will be in Dutch on Dutch systems) -ex1 <- example_isolates[which(mo_genus() == "Escherichia"), ] -ab7 <- antibiogram(ex1, - antibiotics = aminoglycosides(), - ab_transform = "name", - syndromic_group = ifelse(ex1$ward == "ICU", - "IC", "Geen IC" - ), - language = "nl", - add_total_n = TRUE -) + expect_inherits(ab6, "antibiogram") + expect_inherits(ab7, "antibiogram") + expect_equal(colnames(ab6), c("Syndromic Group", "Pathogen", "AMK", "GEN", "IPM", "KAN", "MEM", "TOB")) + expect_equal(colnames(ab7), c("Syndroomgroep", "Pathogeen (N min-max)", "Amikacine", "Gentamicine", "Tobramycine")) -expect_inherits(ab6, "antibiogram") -expect_inherits(ab7, "antibiogram") -expect_equal(colnames(ab6), c("Syndromic Group", "Pathogen", "AMK", "GEN", "IPM", "KAN", "MEM", "TOB")) -expect_equal(colnames(ab7), c("Syndroomgroep", "Pathogeen (N min-max)", "Amikacine", "Gentamicine", "Tobramycine")) + # Weighted-incidence syndromic combination antibiogram (WISCA) --------- -# Weighted-incidence syndromic combination antibiogram (WISCA) --------- + # the data set could contain a filter for e.g. respiratory specimens + ab8 <- suppressWarnings(antibiogram(example_isolates, + antibiotics = c("TZP", "TZP+TOB", "TZP+GEN"), + wisca = TRUE + )) -# the data set could contain a filter for e.g. respiratory specimens -ab8 <- suppressWarnings(antibiogram(example_isolates, - antibiotics = c("TZP", "TZP+TOB", "TZP+GEN"), - wisca = TRUE -)) + expect_inherits(ab8, "antibiogram") + expect_equal(colnames(ab8), c("Piperacillin/tazobactam", "Piperacillin/tazobactam + Gentamicin", "Piperacillin/tazobactam + Tobramycin")) -expect_inherits(ab8, "antibiogram") -expect_equal(colnames(ab8), c("Piperacillin/tazobactam", "Piperacillin/tazobactam + Gentamicin", "Piperacillin/tazobactam + Tobramycin")) + # grouped tibbles -# grouped tibbles - -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - ab9 <- example_isolates %>% - group_by(ward, gender) %>% - wisca(antibiotics = c("TZP", "TZP+TOB", "TZP+GEN")) - expect_equal(colnames(ab9), c("ward", "gender", "Piperacillin/tazobactam", "Piperacillin/tazobactam + Gentamicin", "Piperacillin/tazobactam + Tobramycin")) -} - - -# Generate plots with ggplot2 or base R -------------------------------- - -pdf(NULL) # prevent Rplots.pdf being created - -expect_silent(plot(ab1)) -expect_silent(plot(ab2)) -expect_silent(plot(ab3)) -expect_silent(plot(ab4)) -expect_silent(plot(ab5)) -expect_silent(plot(ab6)) -expect_silent(plot(ab7)) -expect_silent(plot(ab8)) -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_silent(plot(ab9)) -} - -if (AMR:::pkg_is_available("ggplot2")) { - expect_inherits(ggplot2::autoplot(ab1), "gg") - expect_inherits(ggplot2::autoplot(ab2), "gg") - expect_inherits(ggplot2::autoplot(ab3), "gg") - expect_inherits(ggplot2::autoplot(ab4), "gg") - expect_inherits(ggplot2::autoplot(ab5), "gg") - expect_inherits(ggplot2::autoplot(ab6), "gg") - expect_inherits(ggplot2::autoplot(ab7), "gg") - expect_inherits(ggplot2::autoplot(ab8), "gg") if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_inherits(ggplot2::autoplot(ab9), "gg") + ab9 <- example_isolates %>% + group_by(ward, gender) %>% + wisca(antibiotics = c("TZP", "TZP+TOB", "TZP+GEN")) + expect_equal(colnames(ab9), c("ward", "gender", "Piperacillin/tazobactam", "Piperacillin/tazobactam + Gentamicin", "Piperacillin/tazobactam + Tobramycin")) } -} + + + # Generate plots with ggplot2 or base R -------------------------------- + + pdf(NULL) # prevent Rplots.pdf being created + + expect_silent(plot(ab1)) + expect_silent(plot(ab2)) + expect_silent(plot(ab3)) + expect_silent(plot(ab4)) + expect_silent(plot(ab5)) + expect_silent(plot(ab6)) + expect_silent(plot(ab7)) + expect_silent(plot(ab8)) + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_silent(plot(ab9)) + } + + if (AMR:::pkg_is_available("ggplot2")) { + expect_inherits(ggplot2::autoplot(ab1), "gg") + expect_inherits(ggplot2::autoplot(ab2), "gg") + expect_inherits(ggplot2::autoplot(ab3), "gg") + expect_inherits(ggplot2::autoplot(ab4), "gg") + expect_inherits(ggplot2::autoplot(ab5), "gg") + expect_inherits(ggplot2::autoplot(ab6), "gg") + expect_inherits(ggplot2::autoplot(ab7), "gg") + expect_inherits(ggplot2::autoplot(ab8), "gg") + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_inherits(ggplot2::autoplot(ab9), "gg") + } + } +}) diff --git a/tests/testthat/test-atc_online.R b/tests/testthat/test-atc_online.R index 81aa0f418..7e9d49539 100644 --- a/tests/testthat/test-atc_online.R +++ b/tests/testthat/test-atc_online.R @@ -27,12 +27,14 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -if (AMR:::pkg_is_available("curl") && - AMR:::pkg_is_available("rvest") && - AMR:::pkg_is_available("xml2") && - tryCatch(curl::has_internet(), error = function(e) FALSE)) { - expect_true(length(atc_online_groups(ab_atc("AMX"))) >= 1) - expect_equal(atc_online_ddd(ab_atc("AMX"), administration = "O"), 1.5) - expect_equal(atc_online_ddd(ab_atc("AMX"), administration = "P"), 3) - expect_equal(atc_online_ddd_units("AMX", administration = "P"), "g") -} +test_that("atc_online works", { + if (AMR:::pkg_is_available("curl") && + AMR:::pkg_is_available("rvest") && + AMR:::pkg_is_available("xml2") && + tryCatch(curl::has_internet(), error = function(e) FALSE)) { + expect_true(length(atc_online_groups(ab_atc("AMX"))) >= 1) + expect_equal(atc_online_ddd(ab_atc("AMX"), administration = "O"), 1.5) + expect_equal(atc_online_ddd(ab_atc("AMX"), administration = "P"), 3) + expect_equal(atc_online_ddd_units("AMX", administration = "P"), "g") + } +}) diff --git a/tests/testthat/test-av.R b/tests/testthat/test-av.R index 9e2a287e0..47c16718f 100755 --- a/tests/testthat/test-av.R +++ b/tests/testthat/test-av.R @@ -27,54 +27,56 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_equal( - as.character(as.av(c( - "J05AB01", - "J 05 AB 01", - "Aciclovir", - "aciclo", - " aciclo 123", - "ACICL", - "ACI", - "Virorax", - "Zovirax" - ))), - rep("ACI", 9) -) +test_that("av works", { + expect_equal( + as.character(as.av(c( + "J05AB01", + "J 05 AB 01", + "Aciclovir", + "aciclo", + " aciclo 123", + "ACICL", + "ACI", + "Virorax", + "Zovirax" + ))), + rep("ACI", 9) + ) -expect_identical(class(as.av("acic")), c("av", "character")) -expect_identical(class(antivirals$av), c("av", "character")) -expect_true(is.av(as.av("acic"))) -expect_stdout(print(as.av("acic"))) -expect_stdout(print(data.frame(a = as.av("acic")))) + expect_identical(class(as.av("acic")), c("av", "character")) + expect_identical(class(antivirals$av), c("av", "character")) + expect_true(is.av(as.av("acic"))) + expect_output(print(as.av("acic"))) + expect_output(print(data.frame(a = as.av("acic")))) -# expect_warning(as.av("J00AA00")) # ATC not yet available in data set -# expect_warning(as.av("UNKNOWN")) + # expect_warning(as.av("J00AA00")) # ATC not yet available in data set + # expect_warning(as.av("UNKNOWN")) -expect_stdout(print(as.av("acic"))) + expect_output(print(as.av("acic"))) -expect_equal( - as.character(as.av("zovirax")), - "ACI" -) + expect_equal( + as.character(as.av("zovirax")), + "ACI" + ) -expect_equal( - as.character(as.av(c("Abacaivr", "Celvudine"))), - c("ABA", "CLE") -) + expect_equal( + as.character(as.av(c("Abacaivr", "Celvudine"))), + c("ABA", "CLE") + ) -# expect_warning(as.av("Abacavir Clevudine")) + # expect_warning(as.av("Abacavir Clevudine")) -# based on Levenshtein distance -expect_identical(av_name("adevofir dypifo", language = NULL), "Adefovir dipivoxil") + # based on Levenshtein distance + expect_identical(av_name("adevofir dypifo", language = NULL), "Adefovir dipivoxil") -# assigning and subsetting -x <- antivirals$av -expect_inherits(x[1], "av") -expect_inherits(x[[1]], "av") -expect_inherits(c(x[1], x[9]), "av") -expect_inherits(unique(x[1], x[9]), "av") -expect_inherits(rep(x[1], 2), "av") -# expect_warning(x[1] <- "invalid code") -# expect_warning(x[[1]] <- "invalid code") -# expect_warning(c(x[1], "test")) + # assigning and subsetting + x <- antivirals$av + expect_inherits(x[1], "av") + expect_inherits(x[[1]], "av") + expect_inherits(c(x[1], x[9]), "av") + expect_inherits(unique(x[1], x[9]), "av") + expect_inherits(rep(x[1], 2), "av") + # expect_warning(x[1] <- "invalid code") + # expect_warning(x[[1]] <- "invalid code") + # expect_warning(c(x[1], "test")) +}) diff --git a/tests/testthat/test-av_from_text.R b/tests/testthat/test-av_from_text.R index b2cbb1bbe..4fd6d900a 100644 --- a/tests/testthat/test-av_from_text.R +++ b/tests/testthat/test-av_from_text.R @@ -27,32 +27,34 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_identical( - av_from_text("28/03/2020 regular aciclovir 500mg po tds")[[1]], - as.av("Aciclovir") -) -expect_identical( - av_from_text("28/03/2020 regular aciclovir 500mg po tds", thorough_search = TRUE)[[1]], - as.av("Aciclovir") -) -expect_identical( - av_from_text("28/03/2020 regular aciclovir 500mg po tds", thorough_search = FALSE)[[1]], - as.av("Aciclovir") -) -expect_identical( - av_from_text("28/03/2020 regular aciclovir 500mg po tds", translate_av = TRUE)[[1]], - "Aciclovir" -) -expect_identical( - av_from_text("administered aciclo and valaciclo", collapse = ", ")[[1]], - "ACI, VALA" -) +test_that("av_from_text works", { + expect_identical( + av_from_text("28/03/2020 regular aciclovir 500mg po tds")[[1]], + as.av("Aciclovir") + ) + expect_identical( + av_from_text("28/03/2020 regular aciclovir 500mg po tds", thorough_search = TRUE)[[1]], + as.av("Aciclovir") + ) + expect_identical( + av_from_text("28/03/2020 regular aciclovir 500mg po tds", thorough_search = FALSE)[[1]], + as.av("Aciclovir") + ) + expect_identical( + av_from_text("28/03/2020 regular aciclovir 500mg po tds", translate_av = TRUE)[[1]], + "Aciclovir" + ) + expect_identical( + av_from_text("administered aciclo and valaciclo", collapse = ", ")[[1]], + "ACI, VALA" + ) -expect_identical( - av_from_text("28/03/2020 regular aciclo 500mg po tds", type = "dose")[[1]], - 500 -) -expect_identical( - av_from_text("28/03/2020 regular aciclo 500mg po tds", type = "admin")[[1]], - "oral" -) + expect_identical( + av_from_text("28/03/2020 regular aciclo 500mg po tds", type = "dose")[[1]], + 500 + ) + expect_identical( + av_from_text("28/03/2020 regular aciclo 500mg po tds", type = "admin")[[1]], + "oral" + ) +}) diff --git a/tests/testthat/test-av_property.R b/tests/testthat/test-av_property.R index ae113af9d..d7abd14e4 100644 --- a/tests/testthat/test-av_property.R +++ b/tests/testthat/test-av_property.R @@ -27,37 +27,39 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_identical(av_name("ACI", language = NULL), "Aciclovir") -expect_identical(av_atc("ACI"), "J05AB01") -expect_identical(av_cid("ACI"), as.integer(135398513)) +test_that("ab_property works", { + expect_identical(av_name("ACI", language = NULL), "Aciclovir") + expect_identical(av_atc("ACI"), "J05AB01") + expect_identical(av_cid("ACI"), as.integer(135398513)) -expect_inherits(av_tradenames("ACI"), "character") -expect_inherits(av_tradenames(c("ACI", "ACI")), "list") + expect_inherits(av_tradenames("ACI"), "character") + expect_inherits(av_tradenames(c("ACI", "ACI")), "list") -expect_identical(av_group("ACI", language = NULL), "Nucleosides and nucleotides excl. reverse transcriptase inhibitors") + expect_identical(av_group("ACI", language = NULL), "Nucleosides and nucleotides excl. reverse transcriptase inhibitors") -expect_identical(av_name(135398513, language = NULL), "Aciclovir") -expect_identical(av_name("J05AB01", language = NULL), "Aciclovir") + expect_identical(av_name(135398513, language = NULL), "Aciclovir") + expect_identical(av_name("J05AB01", language = NULL), "Aciclovir") -expect_identical(av_ddd("ACI", "oral"), 4) -expect_identical(av_ddd_units("ACI", "iv"), "g") -expect_identical(av_ddd("ACI", "iv"), 4) + expect_identical(av_ddd("ACI", "oral"), 4) + expect_identical(av_ddd_units("ACI", "iv"), "g") + expect_identical(av_ddd("ACI", "iv"), 4) -expect_identical( - av_name(x = c("ACI", "VALA"), tolower = TRUE, language = NULL), - c("aciclovir", "valaciclovir") -) + expect_identical( + av_name(x = c("ACI", "VALA"), tolower = TRUE, language = NULL), + c("aciclovir", "valaciclovir") + ) -expect_inherits(av_info("ACI"), "list") + expect_inherits(av_info("ACI"), "list") -expect_error(av_property("acic", "invalid property")) -expect_error(av_name("acic", language = "INVALID")) -expect_stdout(print(av_name("acic", language = NULL))) + expect_error(av_property("acic", "invalid property")) + expect_error(av_name("acic", language = "INVALID")) + expect_output(print(av_name("acic", language = NULL))) -expect_equal(av_name("29113-8", language = NULL), "Abacavir") -expect_equal( - av_loinc("Abacavir"), - c("29113-8", "30273-7", "30287-7", "30303-2", "78772-1", "78773-9", "79134-3", "80118-3") -) + expect_equal(av_name("29113-8", language = NULL), "Abacavir") + expect_equal( + av_loinc("Abacavir"), + c("29113-8", "30273-7", "30287-7", "30303-2", "78772-1", "78773-9", "79134-3", "80118-3") + ) -expect_true(av_url("ACI") %like% "fhi[.]no") + expect_true(av_url("ACI") %like% "fhi[.]no") +}) diff --git a/tests/testthat/test-availability.R b/tests/testthat/test-availability.R index edad5b0c3..a6e08f0b3 100644 --- a/tests/testthat/test-availability.R +++ b/tests/testthat/test-availability.R @@ -27,4 +27,6 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_inherits(availability(example_isolates), "data.frame") +test_that("availibility works", { + expect_inherits(availability(example_isolates), "data.frame") +}) diff --git a/tests/testthat/test-bug_drug_combinations.R b/tests/testthat/test-bug_drug_combinations.R index 966f2e5d0..c9b80697c 100644 --- a/tests/testthat/test-bug_drug_combinations.R +++ b/tests/testthat/test-bug_drug_combinations.R @@ -27,14 +27,16 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -b <- suppressWarnings(bug_drug_combinations(example_isolates)) -expect_inherits(b, "bug_drug_combinations") -expect_stdout(suppressMessages(print(b))) -expect_true(is.data.frame(format(b))) -expect_true(is.data.frame(format(b, add_ab_group = FALSE))) -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_true(example_isolates %>% - group_by(ward) %>% - bug_drug_combinations(FUN = mo_gramstain) %>% - is.data.frame()) -} +test_that("bug/drug works", { + b <- suppressWarnings(bug_drug_combinations(example_isolates)) + expect_inherits(b, "bug_drug_combinations") + expect_output(suppressMessages(print(b))) + expect_true(is.data.frame(format(b))) + expect_true(is.data.frame(format(b, add_ab_group = FALSE))) + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_true(example_isolates %>% + group_by(ward) %>% + bug_drug_combinations(FUN = mo_gramstain) %>% + is.data.frame()) + } +}) diff --git a/tests/testthat/test-count.R b/tests/testthat/test-count.R index 17401193b..061697674 100644 --- a/tests/testthat/test-count.R +++ b/tests/testthat/test-count.R @@ -27,83 +27,85 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_equal(count_resistant(example_isolates$AMX), count_R(example_isolates$AMX)) -expect_equal(count_susceptible(example_isolates$AMX), count_SI(example_isolates$AMX)) -expect_equal(count_all(example_isolates$AMX), n_sir(example_isolates$AMX)) +test_that("count works", { + expect_equal(count_resistant(example_isolates$AMX), count_R(example_isolates$AMX)) + expect_equal(count_susceptible(example_isolates$AMX), count_SI(example_isolates$AMX)) + expect_equal(count_all(example_isolates$AMX), n_sir(example_isolates$AMX)) -# AMX resistance in `example_isolates` -expect_equal(count_R(example_isolates$AMX), 804) -expect_equal(count_I(example_isolates$AMX), 3) -expect_equal(suppressWarnings(count_S(example_isolates$AMX)), 543) -expect_equal( - count_R(example_isolates$AMX) + count_I(example_isolates$AMX), - suppressWarnings(count_IR(example_isolates$AMX)) -) -expect_equal( - suppressWarnings(count_S(example_isolates$AMX)) + count_I(example_isolates$AMX), - count_SI(example_isolates$AMX) -) - -# warning for speed loss -# expect_warning(count_resistant(as.character(example_isolates$AMC))) - -# expect_warning(count_resistant(example_isolates$AMC, as.character(example_isolates$GEN))) - -# check for errors -expect_error(count_resistant("test", minimum = "test")) -expect_error(count_resistant("test", as_percent = "test")) -expect_error(count_susceptible("test", minimum = "test")) -expect_error(count_susceptible("test", as_percent = "test")) - -expect_error(count_df(c("A", "B", "C"))) -expect_error(count_df(example_isolates[, "date", drop = TRUE])) - -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_equal(example_isolates %>% count_susceptible(AMC), 1433) - expect_equal(example_isolates %>% count_susceptible(AMC, GEN, only_all_tested = TRUE), 1687) - expect_equal(example_isolates %>% count_susceptible(AMC, GEN, only_all_tested = FALSE), 1764) - expect_equal(example_isolates %>% count_all(AMC, GEN, only_all_tested = TRUE), 1798) - expect_equal(example_isolates %>% count_all(AMC, GEN, only_all_tested = FALSE), 1936) - expect_identical( - example_isolates %>% count_all(AMC, GEN, only_all_tested = TRUE), - example_isolates %>% count_susceptible(AMC, GEN, only_all_tested = TRUE) + - example_isolates %>% count_resistant(AMC, GEN, only_all_tested = TRUE) + # AMX resistance in `example_isolates` + expect_equal(count_R(example_isolates$AMX), 804) + expect_equal(count_I(example_isolates$AMX), 3) + expect_equal(suppressWarnings(count_S(example_isolates$AMX)), 543) + expect_equal( + count_R(example_isolates$AMX) + count_I(example_isolates$AMX), + suppressWarnings(count_IR(example_isolates$AMX)) + ) + expect_equal( + suppressWarnings(count_S(example_isolates$AMX)) + count_I(example_isolates$AMX), + count_SI(example_isolates$AMX) ) - # count of cases - expect_equal( - example_isolates %>% + # warning for speed loss + # expect_warning(count_resistant(as.character(example_isolates$AMC))) + + # expect_warning(count_resistant(example_isolates$AMC, as.character(example_isolates$GEN))) + + # check for errors + expect_error(count_resistant("test", minimum = "test")) + expect_error(count_resistant("test", as_percent = "test")) + expect_error(count_susceptible("test", minimum = "test")) + expect_error(count_susceptible("test", as_percent = "test")) + + expect_error(count_df(c("A", "B", "C"))) + expect_error(count_df(example_isolates[, "date", drop = TRUE])) + + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_equal(example_isolates %>% count_susceptible(AMC), 1433) + expect_equal(example_isolates %>% count_susceptible(AMC, GEN, only_all_tested = TRUE), 1687) + expect_equal(example_isolates %>% count_susceptible(AMC, GEN, only_all_tested = FALSE), 1764) + expect_equal(example_isolates %>% count_all(AMC, GEN, only_all_tested = TRUE), 1798) + expect_equal(example_isolates %>% count_all(AMC, GEN, only_all_tested = FALSE), 1936) + expect_identical( + example_isolates %>% count_all(AMC, GEN, only_all_tested = TRUE), + example_isolates %>% count_susceptible(AMC, GEN, only_all_tested = TRUE) + + example_isolates %>% count_resistant(AMC, GEN, only_all_tested = TRUE) + ) + + # count of cases + expect_equal( + example_isolates %>% + group_by(ward) %>% + summarise( + cipro = count_susceptible(CIP), + genta = count_susceptible(GEN), + combination = count_susceptible(CIP, GEN) + ) %>% + pull(combination), + c(946, 428, 94) + ) + + # count_df + expect_equal( + example_isolates %>% select(AMX) %>% count_df() %>% pull(value), + c( + example_isolates$AMX %>% count_susceptible(), + example_isolates$AMX %>% count_resistant() + ) + ) + expect_equal( + example_isolates %>% select(AMX) %>% count_df(combine_SI = FALSE) %>% pull(value), + c( + suppressWarnings(example_isolates$AMX %>% count_S()), + example_isolates$AMX %>% count_I(), + example_isolates$AMX %>% count_R() + ) + ) + + # grouping in sir_calc_df() (= backbone of sir_df()) + expect_true("ward" %in% (example_isolates %>% group_by(ward) %>% - summarise( - cipro = count_susceptible(CIP), - genta = count_susceptible(GEN), - combination = count_susceptible(CIP, GEN) - ) %>% - pull(combination), - c(946, 428, 94) - ) - - # count_df - expect_equal( - example_isolates %>% select(AMX) %>% count_df() %>% pull(value), - c( - example_isolates$AMX %>% count_susceptible(), - example_isolates$AMX %>% count_resistant() - ) - ) - expect_equal( - example_isolates %>% select(AMX) %>% count_df(combine_SI = FALSE) %>% pull(value), - c( - suppressWarnings(example_isolates$AMX %>% count_S()), - example_isolates$AMX %>% count_I(), - example_isolates$AMX %>% count_R() - ) - ) - - # grouping in sir_calc_df() (= backbone of sir_df()) - expect_true("ward" %in% (example_isolates %>% - group_by(ward) %>% - select(ward, AMX, CIP, gender) %>% - sir_df() %>% - colnames())) -} + select(ward, AMX, CIP, gender) %>% + sir_df() %>% + colnames())) + } +}) diff --git a/tests/testthat/test-custom_antimicrobials.R b/tests/testthat/test-custom_antimicrobials.R index 79006765c..121919ef0 100644 --- a/tests/testthat/test-custom_antimicrobials.R +++ b/tests/testthat/test-custom_antimicrobials.R @@ -27,20 +27,22 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -ab_reset_session() +test_that("custom ab works", { + ab_reset_session() -expect_message(as.ab("testab", info = TRUE)) + expect_message(as.ab("testab", info = TRUE)) -suppressMessages( - add_custom_antimicrobials( - data.frame( - ab = "TESTAB", - name = "Test Antibiotic", - group = "Test Group" + suppressMessages( + add_custom_antimicrobials( + data.frame( + ab = "TESTAB", + name = "Test Antibiotic", + group = "Test Group" + ) ) ) -) -expect_identical(as.character(as.ab("testab")), "TESTAB") -expect_identical(ab_name("testab"), "Test Antibiotic") -expect_identical(ab_group("testab"), "Test Group") + expect_identical(as.character(as.ab("testab")), "TESTAB") + expect_identical(ab_name("testab"), "Test Antibiotic") + expect_identical(ab_group("testab"), "Test Group") +}) diff --git a/tests/testthat/test-custom_microorganisms.R b/tests/testthat/test-custom_microorganisms.R index 3b44d80d5..1e3e1ff0a 100644 --- a/tests/testthat/test-custom_microorganisms.R +++ b/tests/testthat/test-custom_microorganisms.R @@ -27,33 +27,36 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_identical( - as.mo("Enterobacter asburiae/cloacae"), - as.mo("Enterobacter asburiae") -) -suppressMessages( - add_custom_microorganisms( - data.frame( - mo = "ENT_ASB_CLO", - genus = "Enterobacter", - species = "asburiae/cloacae" +test_that("custom mo works", { + expect_identical( + as.mo("Enterobacter asburiae/cloacae"), + as.mo("Enterobacter asburiae") + ) + + suppressMessages( + add_custom_microorganisms( + data.frame( + mo = "ENT_ASB_CLO", + genus = "Enterobacter", + species = "asburiae/cloacae" + ) ) ) -) -expect_identical(as.character(as.mo("ENT_ASB_CLO")), "ENT_ASB_CLO") -expect_identical(mo_name("ENT_ASB_CLO"), "Enterobacter asburiae/cloacae") -expect_identical(mo_gramstain("ENT_ASB_CLO", language = NULL), "Gram-negative") + expect_identical(as.character(as.mo("ENT_ASB_CLO")), "ENT_ASB_CLO") + expect_identical(mo_name("ENT_ASB_CLO"), "Enterobacter asburiae/cloacae") + expect_identical(mo_gramstain("ENT_ASB_CLO", language = NULL), "Gram-negative") -if (getRversion() >= "3.3.0") { - # until R 3.2, abbreviate() used a completely different algorithm, making these tests unreproducible - expect_identical( - paste("B", AMR:::abbreviate_mo("Klebsiella"), AMR:::abbreviate_mo("pneumoniae", 4), sep = "_"), - as.character(as.mo("Klebsiella pneumoniae")) - ) - expect_identical( - paste("B", AMR:::abbreviate_mo("Aerococcus"), AMR:::abbreviate_mo("urinae", 4), sep = "_"), - as.character(as.mo("Aerococcus urinae")) - ) -} + if (getRversion() >= "3.3.0") { + # until R 3.2, abbreviate() used a completely different algorithm, making these tests unreproducible + expect_identical( + paste("B", AMR:::abbreviate_mo("Klebsiella"), AMR:::abbreviate_mo("pneumoniae", 4), sep = "_"), + as.character(as.mo("Klebsiella pneumoniae")) + ) + expect_identical( + paste("B", AMR:::abbreviate_mo("Aerococcus"), AMR:::abbreviate_mo("urinae", 4), sep = "_"), + as.character(as.mo("Aerococcus urinae")) + ) + } +}) diff --git a/tests/testthat/test-data.R b/tests/testthat/test-data.R index ddf62c638..4a98bffa1 100644 --- a/tests/testthat/test-data.R +++ b/tests/testthat/test-data.R @@ -27,101 +27,103 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -# IDs should always be unique -expect_identical(nrow(microorganisms), length(unique(microorganisms$mo))) -expect_identical(class(microorganisms$mo), c("mo", "character")) -expect_identical(nrow(antibiotics), length(unique(antibiotics$ab))) -expect_true(all(is.na(antibiotics$atc[duplicated(antibiotics$atc)]))) -expect_identical(class(antibiotics$ab), c("ab", "character")) +test_that("data works", { + # IDs should always be unique + expect_identical(nrow(microorganisms), length(unique(microorganisms$mo))) + expect_identical(class(microorganisms$mo), c("mo", "character")) + expect_identical(nrow(antimicrobials), length(unique(AMR::antimicrobials$ab))) + expect_true(all(is.na(AMR::antimicrobials$atc[duplicated(AMR::antimicrobials$atc)]))) + expect_identical(class(AMR::antimicrobials$ab), c("ab", "character")) -# check cross table reference -expect_true(all(microorganisms.codes$mo %in% microorganisms$mo)) -expect_true(all(example_isolates$mo %in% microorganisms$mo)) -expect_true(all(microorganisms.groups$mo %in% microorganisms$mo)) -expect_true(all(microorganisms.groups$mo_group %in% microorganisms$mo)) -expect_true(all(clinical_breakpoints$mo %in% microorganisms$mo)) -expect_true(all(clinical_breakpoints$ab %in% antibiotics$ab)) -expect_true(all(intrinsic_resistant$mo %in% microorganisms$mo)) -expect_true(all(intrinsic_resistant$ab %in% antibiotics$ab)) -expect_false(any(is.na(microorganisms.codes$code))) -expect_false(any(is.na(microorganisms.codes$mo))) -expect_true(all(dosage$ab %in% antibiotics$ab)) -expect_true(all(dosage$name %in% antibiotics$name)) -# check valid disks/MICs -expect_false(any(is.na(as.mic(clinical_breakpoints[which(clinical_breakpoints$method == "MIC" & clinical_breakpoints$ref_tbl != "ECOFF"), "breakpoint_S", drop = TRUE])))) -expect_false(any(is.na(as.mic(clinical_breakpoints[which(clinical_breakpoints$method == "MIC" & clinical_breakpoints$ref_tbl != "ECOFF"), "breakpoint_R", drop = TRUE])))) -expect_false(any(is.na(as.disk(clinical_breakpoints[which(clinical_breakpoints$method == "DISK" & clinical_breakpoints$ref_tbl != "ECOFF"), "breakpoint_S", drop = TRUE])))) -expect_false(any(is.na(as.disk(clinical_breakpoints[which(clinical_breakpoints$method == "DISK" & clinical_breakpoints$ref_tbl != "ECOFF"), "breakpoint_R", drop = TRUE])))) + # check cross table reference + expect_true(all(microorganisms.codes$mo %in% microorganisms$mo)) + expect_true(all(example_isolates$mo %in% microorganisms$mo)) + expect_true(all(microorganisms.groups$mo %in% microorganisms$mo)) + expect_true(all(microorganisms.groups$mo_group %in% microorganisms$mo)) + expect_true(all(clinical_breakpoints$mo %in% microorganisms$mo)) + expect_true(all(clinical_breakpoints$ab %in% AMR::antimicrobials$ab)) + expect_true(all(intrinsic_resistant$mo %in% microorganisms$mo)) + expect_true(all(intrinsic_resistant$ab %in% AMR::antimicrobials$ab)) + expect_false(any(is.na(microorganisms.codes$code))) + expect_false(any(is.na(microorganisms.codes$mo))) + expect_true(all(dosage$ab %in% AMR::antimicrobials$ab)) + expect_true(all(dosage$name %in% AMR::antimicrobials$name)) + # check valid disks/MICs + expect_false(any(is.na(as.mic(clinical_breakpoints[which(clinical_breakpoints$method == "MIC" & clinical_breakpoints$ref_tbl != "ECOFF"), "breakpoint_S", drop = TRUE])))) + expect_false(any(is.na(as.mic(clinical_breakpoints[which(clinical_breakpoints$method == "MIC" & clinical_breakpoints$ref_tbl != "ECOFF"), "breakpoint_R", drop = TRUE])))) + expect_false(any(is.na(as.disk(clinical_breakpoints[which(clinical_breakpoints$method == "DISK" & clinical_breakpoints$ref_tbl != "ECOFF"), "breakpoint_S", drop = TRUE])))) + expect_false(any(is.na(as.disk(clinical_breakpoints[which(clinical_breakpoints$method == "DISK" & clinical_breakpoints$ref_tbl != "ECOFF"), "breakpoint_R", drop = TRUE])))) -# antibiotic names must always be coercible to their original AB code -expect_identical(as.ab(antibiotics$name), antibiotics$ab) + # antibiotic names must always be coercible to their original AB code + expect_identical(as.ab(AMR::antimicrobials$name), AMR::antimicrobials$ab) -if (AMR:::pkg_is_available("tibble")) { - # there should be no diacritics (i.e. non ASCII) characters in the datasets (CRAN policy) - datasets <- data(package = "AMR", envir = asNamespace("AMR"))$results[, "Item", drop = TRUE] - for (i in seq_len(length(datasets))) { - dataset <- get(datasets[i], envir = asNamespace("AMR")) - expect_identical(AMR:::dataset_UTF8_to_ASCII(dataset), dataset, info = datasets[i]) + if (AMR:::pkg_is_available("tibble")) { + # there should be no diacritics (i.e. non ASCII) characters in the datasets (CRAN policy) + datasets <- data(package = "AMR", envir = asNamespace("AMR"))$results[, "Item", drop = TRUE] + for (i in seq_len(length(datasets))) { + dataset <- get(datasets[i], envir = asNamespace("AMR")) + expect_identical(AMR:::dataset_UTF8_to_ASCII(dataset), dataset, info = datasets[i]) + } } -} -df <- AMR:::AMR_env$MO_lookup -expect_true(all(c( - "mo", "fullname", "status", "kingdom", "phylum", "class", "order", - "family", "genus", "species", "subspecies", "rank", "ref", "source", - "lpsn", "lpsn_parent", "lpsn_renamed_to", "gbif", "gbif_parent", "gbif_renamed_to", "prevalence", - "snomed", "kingdom_index", "fullname_lower", "full_first", "species_first" -) %in% colnames(df))) + df <- AMR:::AMR_env$MO_lookup + expect_true(all(c( + "mo", "fullname", "status", "kingdom", "phylum", "class", "order", + "family", "genus", "species", "subspecies", "rank", "ref", "source", + "lpsn", "lpsn_parent", "lpsn_renamed_to", "gbif", "gbif_parent", "gbif_renamed_to", "prevalence", + "snomed", "kingdom_index", "fullname_lower", "full_first", "species_first" + ) %in% colnames(df))) -expect_inherits(AMR:::MO_CONS, "mo") + expect_inherits(AMR:::MO_CONS, "mo") -uncategorised <- subset( - microorganisms, - genus == "Staphylococcus" & - !species %in% c("", "aureus") & - !mo %in% c(AMR:::MO_CONS, AMR:::MO_COPS) -) -expect_true(NROW(uncategorised) == 0, - info = ifelse(NROW(uncategorised) == 0, - "All staphylococcal species categorised as CoNS/CoPS.", - paste0( - "Staphylococcal species not categorised as CoNS/CoPS: S. ", - uncategorised$species, " (", uncategorised$mo, ")", - collapse = "\n" + uncategorised <- subset( + microorganisms, + genus == "Staphylococcus" & + !species %in% c("", "aureus") & + !mo %in% c(AMR:::MO_CONS, AMR:::MO_COPS) + ) + expect_true(NROW(uncategorised) == 0, + info = ifelse(NROW(uncategorised) == 0, + "All staphylococcal species categorised as CoNS/CoPS.", + paste0( + "Staphylococcal species not categorised as CoNS/CoPS: S. ", + uncategorised$species, " (", uncategorised$mo, ")", + collapse = "\n" + ) ) ) -) -# THIS WILL CHECK NON-ASCII STRINGS IN ALL FILES: + # THIS WILL CHECK NON-ASCII STRINGS IN ALL FILES: -# check_non_ascii <- function() { -# purrr::map_df( -# .id = "file", -# # list common text files -# .x = fs::dir_ls( -# recurse = TRUE, -# type = "file", -# # ignore images, compressed -# regexp = "\\.(png|ico|rda|ai|tar.gz|zip|xlsx|csv|pdf|psd)$", -# invert = TRUE -# ), -# .f = function(path) { -# x <- readLines(path, warn = FALSE) -# # from tools::showNonASCII() -# asc <- iconv(x, "latin1", "ASCII") -# ind <- is.na(asc) | asc != x -# # make data frame -# if (any(ind)) { -# tibble::tibble( -# row = which(ind), -# line = iconv(x[ind], "latin1", "ASCII", sub = "byte") -# ) -# } else { -# tibble::tibble() -# } -# } -# ) -# } -# x <- check_non_ascii() %>% -# filter(file %unlike% "^(data-raw|docs|git_)") + # check_non_ascii <- function() { + # purrr::map_df( + # .id = "file", + # # list common text files + # .x = fs::dir_ls( + # recurse = TRUE, + # type = "file", + # # ignore images, compressed + # regexp = "\\.(png|ico|rda|ai|tar.gz|zip|xlsx|csv|pdf|psd)$", + # invert = TRUE + # ), + # .f = function(path) { + # x <- readLines(path, warn = FALSE) + # # from tools::showNonASCII() + # asc <- iconv(x, "latin1", "ASCII") + # ind <- is.na(asc) | asc != x + # # make data frame + # if (any(ind)) { + # tibble::tibble( + # row = which(ind), + # line = iconv(x[ind], "latin1", "ASCII", sub = "byte") + # ) + # } else { + # tibble::tibble() + # } + # } + # ) + # } + # x <- check_non_ascii() %>% + # filter(file %unlike% "^(data-raw|docs|git_)") +}) diff --git a/tests/testthat/test-disk.R b/tests/testthat/test-disk.R index c30777ab2..395bc313e 100755 --- a/tests/testthat/test-disk.R +++ b/tests/testthat/test-disk.R @@ -27,33 +27,35 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_true(as.disk(8) == as.disk("8")) -expect_true(is.disk(as.disk(8))) +test_that("disk works", { + expect_true(as.disk(8) == as.disk("8")) + expect_true(is.disk(as.disk(8))) -expect_equal(suppressWarnings(as.logical(as.disk("INVALID VALUE"))), NA) + expect_equal(suppressWarnings(as.logical(as.disk("INVALID VALUE"))), NA) -# all levels should be valid disks -x <- as.disk(c(20, 40)) -expect_inherits(x[1], "disk") -expect_inherits(x[[1]], "disk") -expect_inherits(c(x[1], x[9]), "disk") -expect_inherits(unique(x[1], x[9]), "disk") -# expect_warning(as.disk("INVALID VALUE")) -x[2] <- 32 -expect_inherits(x, "disk") + # all levels should be valid disks + x <- as.disk(c(20, 40)) + expect_inherits(x[1], "disk") + expect_inherits(x[[1]], "disk") + expect_inherits(c(x[1], x[9]), "disk") + expect_inherits(unique(x[1], x[9]), "disk") + # expect_warning(as.disk("INVALID VALUE")) + x[2] <- 32 + expect_inherits(x, "disk") -pdf(NULL) # prevent Rplots.pdf being created -expect_silent(barplot(as.disk(c(10, 20, 40)))) -expect_silent(plot(as.disk(c(10, 20, 40)))) -expect_silent(plot(as.disk(c(10, 20, 40)), expand = FALSE)) -expect_silent(plot(as.disk(c(10, 20, 40)), mo = "Escherichia coli", ab = "cipr")) -if (AMR:::pkg_is_available("ggplot2")) { - expect_inherits(ggplot2::autoplot(as.disk(c(10, 20, 40))), "gg") - expect_inherits(ggplot2::autoplot(as.disk(c(10, 20, 40)), expand = FALSE), "gg") - expect_inherits(ggplot2::autoplot(as.disk(c(10, 20, 40)), mo = "Escherichia coli", ab = "cipr"), "gg") -} -expect_stdout(print(as.disk(12))) + pdf(NULL) # prevent Rplots.pdf being created + expect_silent(barplot(as.disk(c(10, 20, 40)))) + expect_silent(plot(as.disk(c(10, 20, 40)))) + expect_silent(plot(as.disk(c(10, 20, 40)), expand = FALSE)) + expect_silent(plot(as.disk(c(10, 20, 40)), mo = "Escherichia coli", ab = "cipr")) + if (AMR:::pkg_is_available("ggplot2")) { + expect_inherits(ggplot2::autoplot(as.disk(c(10, 20, 40))), "gg") + expect_inherits(ggplot2::autoplot(as.disk(c(10, 20, 40)), expand = FALSE), "gg") + expect_inherits(ggplot2::autoplot(as.disk(c(10, 20, 40)), mo = "Escherichia coli", ab = "cipr"), "gg") + } + expect_output(print(as.disk(12))) -if (AMR:::pkg_is_available("tibble")) { - expect_stdout(print(tibble::tibble(d = as.disk(12)))) -} + if (AMR:::pkg_is_available("tibble")) { + expect_output(print(tibble::tibble(d = as.disk(12)))) + } +}) diff --git a/tests/testthat/test-eucast_rules.R b/tests/testthat/test-eucast_rules.R index c36f7df18..f3ae05d23 100755 --- a/tests/testthat/test-eucast_rules.R +++ b/tests/testthat/test-eucast_rules.R @@ -27,198 +27,200 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -# thoroughly check input table -expect_equal( - colnames(AMR:::EUCAST_RULES_DF), - c( - "if_mo_property", "like.is.one_of", "this_value", - "and_these_antibiotics", "have_these_values", - "then_change_these_antibiotics", "to_value", - "reference.rule", "reference.rule_group", - "reference.version", - "note" +test_that("eucast_rules works", { + # thoroughly check input table + expect_equal( + colnames(AMR:::EUCAST_RULES_DF), + c( + "if_mo_property", "like.is.one_of", "this_value", + "and_these_antibiotics", "have_these_values", + "then_change_these_antibiotics", "to_value", + "reference.rule", "reference.rule_group", + "reference.version", + "note" + ) ) -) -MOs_mentioned <- unique(AMR:::EUCAST_RULES_DF$this_value) -MOs_mentioned <- sort(trimws(unlist(strsplit(MOs_mentioned[!AMR:::is_valid_regex(MOs_mentioned)], ",", fixed = TRUE)))) -MOs_test <- suppressWarnings(suppressMessages(mo_name(MOs_mentioned, keep_synonyms = TRUE, language = NULL))) -expect_true(length(MOs_mentioned[MOs_test != MOs_mentioned]) == 0) + MOs_mentioned <- unique(AMR:::EUCAST_RULES_DF$this_value) + MOs_mentioned <- sort(trimws(unlist(strsplit(MOs_mentioned[!AMR:::is_valid_regex(MOs_mentioned)], ",", fixed = TRUE)))) + MOs_test <- suppressWarnings(suppressMessages(mo_name(MOs_mentioned, keep_synonyms = TRUE, language = NULL))) + expect_true(length(MOs_mentioned[MOs_test != MOs_mentioned]) == 0) -expect_error(suppressWarnings(eucast_rules(example_isolates, col_mo = "Non-existing"))) -expect_error(eucast_rules(x = "text")) -expect_error(eucast_rules(data.frame(a = "test"))) -expect_error(eucast_rules(data.frame(mo = "test"), rules = "invalid rules set")) + expect_error(suppressWarnings(eucast_rules(example_isolates, col_mo = "Non-existing"))) + expect_error(eucast_rules(x = "text")) + expect_error(eucast_rules(data.frame(a = "test"))) + expect_error(eucast_rules(data.frame(mo = "test"), rules = "invalid rules set")) -# expect_warning(eucast_rules(data.frame(mo = "Escherichia coli", vancomycin = "S", stringsAsFactors = TRUE))) + # expect_warning(eucast_rules(data.frame(mo = "Escherichia coli", vancomycin = "S", stringsAsFactors = TRUE))) -expect_identical( - colnames(example_isolates), - colnames(suppressWarnings(eucast_rules(example_isolates, info = FALSE))) -) + expect_identical( + colnames(example_isolates), + colnames(suppressWarnings(eucast_rules(example_isolates, info = FALSE))) + ) -expect_stdout(suppressMessages(eucast_rules(example_isolates, info = TRUE))) + expect_output(suppressMessages(eucast_rules(example_isolates, info = TRUE))) -a <- data.frame( - mo = c( - "Klebsiella pneumoniae", - "Pseudomonas aeruginosa", - "Enterobacter cloacae" - ), - amox = "-", # Amoxicillin - stringsAsFactors = FALSE -) -b <- data.frame( - mo = c( - "Klebsiella pneumoniae", - "Pseudomonas aeruginosa", - "Enterobacter cloacae" - ), - amox = "R", # Amoxicillin - stringsAsFactors = FALSE -) -expect_identical(suppressWarnings(eucast_rules(a, "mo", info = FALSE)), b) -expect_stdout(suppressMessages(suppressWarnings(eucast_rules(a, "mo", info = TRUE)))) + a <- data.frame( + mo = c( + "Klebsiella pneumoniae", + "Pseudomonas aeruginosa", + "Enterobacter cloacae" + ), + amox = "-", # Amoxicillin + stringsAsFactors = FALSE + ) + b <- data.frame( + mo = c( + "Klebsiella pneumoniae", + "Pseudomonas aeruginosa", + "Enterobacter cloacae" + ), + amox = "R", # Amoxicillin + stringsAsFactors = FALSE + ) + expect_identical(suppressWarnings(eucast_rules(a, "mo", info = FALSE)), b) + expect_output(suppressMessages(suppressWarnings(eucast_rules(a, "mo", info = TRUE)))) -a <- data.frame( - mo = c( - "Staphylococcus aureus", - "Streptococcus group A" - ), - COL = "-", # Colistin - stringsAsFactors = FALSE -) -b <- data.frame( - mo = c( - "Staphylococcus aureus", - "Streptococcus group A" - ), - COL = "R", # Colistin - stringsAsFactors = FALSE -) -expect_equal(suppressWarnings(eucast_rules(a, "mo", info = FALSE)), b) + a <- data.frame( + mo = c( + "Staphylococcus aureus", + "Streptococcus group A" + ), + COL = "-", # Colistin + stringsAsFactors = FALSE + ) + b <- data.frame( + mo = c( + "Staphylococcus aureus", + "Streptococcus group A" + ), + COL = "R", # Colistin + stringsAsFactors = FALSE + ) + expect_equal(suppressWarnings(eucast_rules(a, "mo", info = FALSE)), b) -# piperacillin must be R in Enterobacteriaceae when tica is R -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + # piperacillin must be R in Enterobacteriaceae when tica is R + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_equal( + suppressWarnings( + example_isolates %>% + filter(mo_family(mo) == "Enterobacteriaceae") %>% + mutate( + TIC = as.sir("R"), + PIP = as.sir("S") + ) %>% + eucast_rules(col_mo = "mo", version_expertrules = 3.1, info = FALSE) %>% + pull(PIP) %>% + unique() %>% + as.character() + ), + "R" + ) + } + + # azithromycin and clarythromycin must be equal to Erythromycin + a <- suppressWarnings(as.sir(eucast_rules( + data.frame( + mo = example_isolates$mo, + ERY = example_isolates$ERY, + AZM = as.sir("R"), + CLR = factor("R"), + stringsAsFactors = FALSE + ), + version_expertrules = 3.1, + only_sir_columns = FALSE + )$CLR)) + b <- example_isolates$ERY + expect_identical( + a[!is.na(b)], + b[!is.na(b)] + ) + + # amox is inferred by benzylpenicillin in Kingella kingae expect_equal( suppressWarnings( - example_isolates %>% - filter(mo_family(mo) == "Enterobacteriaceae") %>% - mutate( - TIC = as.sir("R"), - PIP = as.sir("S") - ) %>% - eucast_rules(col_mo = "mo", version_expertrules = 3.1, info = FALSE) %>% - pull(PIP) %>% - unique() %>% - as.character() + as.list(eucast_rules( + data.frame( + mo = as.mo("Kingella kingae"), + PEN = "S", + AMX = "-", + stringsAsFactors = FALSE + ), + info = FALSE + ))$AMX ), - "R" + "S" ) -} -# azithromycin and clarythromycin must be equal to Erythromycin -a <- suppressWarnings(as.sir(eucast_rules( - data.frame( - mo = example_isolates$mo, - ERY = example_isolates$ERY, - AZM = as.sir("R"), - CLR = factor("R"), - stringsAsFactors = FALSE - ), - version_expertrules = 3.1, - only_sir_columns = FALSE -)$CLR)) -b <- example_isolates$ERY -expect_identical( - a[!is.na(b)], - b[!is.na(b)] -) + # also test norf + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_output(suppressWarnings(eucast_rules(example_isolates %>% mutate(NOR = "S", NAL = "S"), info = TRUE))) + } -# amox is inferred by benzylpenicillin in Kingella kingae -expect_equal( - suppressWarnings( - as.list(eucast_rules( + # check verbose output + expect_output(suppressWarnings(eucast_rules(example_isolates, verbose = TRUE, rules = "all", info = TRUE))) + + # AmpC de-repressed cephalo mutants + + expect_identical( + eucast_rules( data.frame( - mo = as.mo("Kingella kingae"), - PEN = "S", - AMX = "-", - stringsAsFactors = FALSE + mo = c("Escherichia coli", "Enterobacter cloacae"), + cefotax = as.sir(c("S", "S")) ), + ampc_cephalosporin_resistance = TRUE, info = FALSE - ))$AMX - ), - "S" -) + )$cefotax, + as.sir(c("S", "R")) + ) -# also test norf -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_stdout(suppressWarnings(eucast_rules(example_isolates %>% mutate(NOR = "S", NAL = "S"), info = TRUE))) -} + expect_identical( + eucast_rules( + data.frame( + mo = c("Escherichia coli", "Enterobacter cloacae"), + cefotax = as.sir(c("S", "S")) + ), + ampc_cephalosporin_resistance = NA, + info = FALSE + )$cefotax, + as.sir(c("S", NA)) + ) -# check verbose output -expect_stdout(suppressWarnings(eucast_rules(example_isolates, verbose = TRUE, rules = "all", info = TRUE))) + expect_identical( + eucast_rules( + data.frame( + mo = c("Escherichia coli", "Enterobacter cloacae"), + cefotax = as.sir(c("S", "S")) + ), + ampc_cephalosporin_resistance = NULL, + info = FALSE + )$cefotax, + as.sir(c("S", "S")) + ) -# AmpC de-repressed cephalo mutants - -expect_identical( - eucast_rules( - data.frame( - mo = c("Escherichia coli", "Enterobacter cloacae"), - cefotax = as.sir(c("S", "S")) - ), - ampc_cephalosporin_resistance = TRUE, - info = FALSE - )$cefotax, - as.sir(c("S", "R")) -) - -expect_identical( - eucast_rules( - data.frame( - mo = c("Escherichia coli", "Enterobacter cloacae"), - cefotax = as.sir(c("S", "S")) - ), - ampc_cephalosporin_resistance = NA, - info = FALSE - )$cefotax, - as.sir(c("S", NA)) -) - -expect_identical( - eucast_rules( - data.frame( - mo = c("Escherichia coli", "Enterobacter cloacae"), - cefotax = as.sir(c("S", "S")) - ), - ampc_cephalosporin_resistance = NULL, - info = FALSE - )$cefotax, - as.sir(c("S", "S")) -) - -# EUCAST dosage ----------------------------------------------------------- -expect_equal(nrow(eucast_dosage(c("tobra", "genta", "cipro"))), 3) -expect_inherits(eucast_dosage(c("tobra", "genta", "cipro")), "data.frame") + # EUCAST dosage ----------------------------------------------------------- + expect_equal(nrow(eucast_dosage(c("tobra", "genta", "cipro"))), 3) + expect_inherits(eucast_dosage(c("tobra", "genta", "cipro")), "data.frame") -x <- custom_eucast_rules( - AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R", - AMC == "I" & genus == "Klebsiella" ~ aminopenicillins == "I", - AMX == "S" ~ AMC == "S" -) -expect_stdout(print(x)) -expect_stdout(print(c(x, x))) -expect_stdout(print(as.list(x, x))) + x <- custom_eucast_rules( + AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R", + AMC == "I" & genus == "Klebsiella" ~ aminopenicillins == "I", + AMX == "S" ~ AMC == "S" + ) + expect_output(print(x)) + expect_output(print(c(x, x))) + expect_output(print(as.list(x, x))) -# this custom rules makes 8 changes -expect_equal( - nrow(eucast_rules(example_isolates, - rules = "custom", - custom_rules = x, - info = FALSE, - verbose = TRUE - )), - 8, - tolerance = 0.5 -) + # this custom rules makes 8 changes + expect_equal( + nrow(eucast_rules(example_isolates, + rules = "custom", + custom_rules = x, + info = FALSE, + verbose = TRUE + )), + 8, + tolerance = 0.5 + ) +}) diff --git a/tests/testthat/test-first_isolate.R b/tests/testthat/test-first_isolate.R index 59ef88959..d7564cf4a 100755 --- a/tests/testthat/test-first_isolate.R +++ b/tests/testthat/test-first_isolate.R @@ -27,234 +27,236 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -# all four methods -expect_equal( - sum(first_isolate(x = example_isolates, method = "isolate-based", info = TRUE), na.rm = TRUE), - 1984 -) -expect_equal( - sum(first_isolate(x = example_isolates, method = "patient-based", info = TRUE), na.rm = TRUE), - 1265 -) -expect_equal( - sum(first_isolate(x = example_isolates, method = "episode-based", info = TRUE), na.rm = TRUE), - 1300 -) -expect_equal( - sum(first_isolate(x = example_isolates, method = "phenotype-based", info = TRUE), na.rm = TRUE), - 1387 -) - -# for phenotype determination -expect_equal( - AMR:::duplicated_antibiogram("SSSS", points_threshold = 2, ignore_I = TRUE, type = "points"), - FALSE -) -expect_equal( - AMR:::duplicated_antibiogram(c("RRR", "SSS"), - points_threshold = 2, ignore_I = TRUE, type = "points" - ), - c(FALSE, FALSE) -) -expect_equal( - AMR:::duplicated_antibiogram(c("RRR", "RRR", "SSS"), - points_threshold = 2, ignore_I = TRUE, type = "points" - ), - c(FALSE, TRUE, FALSE) -) -expect_equal( - AMR:::duplicated_antibiogram(c("RRR", "RSS", "SSS", "RSS", "RRR", "RRR", "SSS", "RSS", "RSR", "RRR"), - points_threshold = 2, ignore_I = TRUE, type = "points" - ), - c(FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE) -) - -# Phenotype-based, using key antimicrobials -expect_equal( - sum(first_isolate( - x = example_isolates, - method = "phenotype-based", - type = "keyantimicrobials", - antifungal = NULL, info = TRUE - ), na.rm = TRUE), - 1383 -) -expect_equal( - sum(first_isolate( - x = example_isolates, - method = "phenotype-based", - type = "keyantimicrobials", - antifungal = NULL, info = TRUE, ignore_I = FALSE - ), na.rm = TRUE), - 1397 -) - - -# first non-ICU isolates -expect_true( - sum( - first_isolate(example_isolates, - col_mo = "mo", - col_date = "date", - col_patient_id = "patient", - col_icu = example_isolates$ward == "ICU", - info = TRUE, - icu_exclude = TRUE - ), - na.rm = TRUE - ) < 950 -) - -# set 1500 random observations to be of specimen type 'Urine' -random_rows <- sample(x = 1:2000, size = 1500, replace = FALSE) -x <- example_isolates -x$specimen <- "Other" -x[random_rows, "specimen"] <- "Urine" -expect_true( - sum(first_isolate( - x = x, - col_date = "date", - col_patient_id = "patient", - col_mo = "mo", - col_specimen = "specimen", - filter_specimen = "Urine", - info = TRUE - ), na.rm = TRUE) < 1400 -) -# same, but now exclude ICU -expect_true( - sum(first_isolate( - x = x, - col_date = "date", - col_patient_id = "patient", - col_mo = "mo", - col_specimen = "specimen", - filter_specimen = "Urine", - col_icu = x$ward == "ICU", - icu_exclude = TRUE, - info = TRUE - ), na.rm = TRUE) < 1000 -) - -# "No isolates found" -test_iso <- example_isolates -test_iso$specimen <- "test" -expect_message(first_isolate(test_iso, - "date", - "patient", - col_mo = "mo", - col_specimen = "specimen", - filter_specimen = "something_unexisting", - info = TRUE -)) - -# printing of exclusion message -expect_message(first_isolate(example_isolates, - col_date = "date", - col_mo = "mo", - col_patient_id = "patient", - col_testcode = "gender", - testcodes_exclude = "M", - info = TRUE -)) - -# errors -expect_error(first_isolate("date", "patient", col_mo = "mo")) -expect_error(first_isolate(example_isolates, - col_date = "non-existing col", - col_mo = "mo" -)) - -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - # if mo is not an mo class, result should be the same - expect_identical( - example_isolates %>% - mutate(mo = as.character(mo)) %>% - first_isolate( - col_date = "date", - col_mo = "mo", - col_patient_id = "patient", - info = FALSE - ), - example_isolates %>% - first_isolate( - col_date = "date", - col_mo = "mo", - col_patient_id = "patient", - info = FALSE - ) +test_that("first_isolate works", { + # all four methods + expect_equal( + sum(first_isolate(x = example_isolates, method = "isolate-based", info = TRUE), na.rm = TRUE), + 1984 + ) + expect_equal( + sum(first_isolate(x = example_isolates, method = "patient-based", info = TRUE), na.rm = TRUE), + 1265 + ) + expect_equal( + sum(first_isolate(x = example_isolates, method = "episode-based", info = TRUE), na.rm = TRUE), + 1300 + ) + expect_equal( + sum(first_isolate(x = example_isolates, method = "phenotype-based", info = TRUE), na.rm = TRUE), + 1387 ) - # support for WHONET - expect_message(example_isolates %>% - select(-patient) %>% - mutate( - `First name` = "test", - `Last name` = "test", - Sex = "Female" - ) %>% - first_isolate(info = TRUE)) + # for phenotype determination + expect_equal( + AMR:::duplicated_antibiogram("SSSS", points_threshold = 2, ignore_I = TRUE, type = "points"), + FALSE + ) + expect_equal( + AMR:::duplicated_antibiogram(c("RRR", "SSS"), + points_threshold = 2, ignore_I = TRUE, type = "points" + ), + c(FALSE, FALSE) + ) + expect_equal( + AMR:::duplicated_antibiogram(c("RRR", "RRR", "SSS"), + points_threshold = 2, ignore_I = TRUE, type = "points" + ), + c(FALSE, TRUE, FALSE) + ) + expect_equal( + AMR:::duplicated_antibiogram(c("RRR", "RSS", "SSS", "RSS", "RRR", "RRR", "SSS", "RSS", "RSR", "RRR"), + points_threshold = 2, ignore_I = TRUE, type = "points" + ), + c(FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE) + ) - # groups - x <- example_isolates %>% - group_by(ward) %>% - mutate(first = first_isolate()) - y <- example_isolates %>% - group_by(ward) %>% - mutate(first = first_isolate(.)) - expect_identical(x, y) -} + # Phenotype-based, using key antimicrobials + expect_equal( + sum(first_isolate( + x = example_isolates, + method = "phenotype-based", + type = "keyantimicrobials", + antifungal = NULL, info = TRUE + ), na.rm = TRUE), + 1383 + ) + expect_equal( + sum(first_isolate( + x = example_isolates, + method = "phenotype-based", + type = "keyantimicrobials", + antifungal = NULL, info = TRUE, ignore_I = FALSE + ), na.rm = TRUE), + 1397 + ) -# missing dates should be no problem -df <- example_isolates -df[1:100, "date"] <- NA -expect_equal( - sum( - first_isolate( - x = df, + + # first non-ICU isolates + expect_true( + sum( + first_isolate(example_isolates, + col_mo = "mo", + col_date = "date", + col_patient_id = "patient", + col_icu = example_isolates$ward == "ICU", + info = TRUE, + icu_exclude = TRUE + ), + na.rm = TRUE + ) < 950 + ) + + # set 1500 random observations to be of specimen type 'Urine' + random_rows <- sample(x = 1:2000, size = 1500, replace = FALSE) + x <- example_isolates + x$specimen <- "Other" + x[random_rows, "specimen"] <- "Urine" + expect_true( + sum(first_isolate( + x = x, col_date = "date", col_patient_id = "patient", col_mo = "mo", + col_specimen = "specimen", + filter_specimen = "Urine", info = TRUE + ), na.rm = TRUE) < 1400 + ) + # same, but now exclude ICU + expect_true( + sum(first_isolate( + x = x, + col_date = "date", + col_patient_id = "patient", + col_mo = "mo", + col_specimen = "specimen", + filter_specimen = "Urine", + col_icu = x$ward == "ICU", + icu_exclude = TRUE, + info = TRUE + ), na.rm = TRUE) < 1000 + ) + + # "No isolates found" + test_iso <- example_isolates + test_iso$specimen <- "test" + expect_message(first_isolate(test_iso, + "date", + "patient", + col_mo = "mo", + col_specimen = "specimen", + filter_specimen = "something_unexisting", + info = TRUE + )) + + # printing of exclusion message + expect_message(first_isolate(example_isolates, + col_date = "date", + col_mo = "mo", + col_patient_id = "patient", + col_testcode = "gender", + testcodes_exclude = "M", + info = TRUE + )) + + # errors + expect_error(first_isolate("date", "patient", col_mo = "mo")) + expect_error(first_isolate(example_isolates, + col_date = "non-existing col", + col_mo = "mo" + )) + + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + # if mo is not an mo class, result should be the same + expect_identical( + example_isolates %>% + mutate(mo = as.character(mo)) %>% + first_isolate( + col_date = "date", + col_mo = "mo", + col_patient_id = "patient", + info = FALSE + ), + example_isolates %>% + first_isolate( + col_date = "date", + col_mo = "mo", + col_patient_id = "patient", + info = FALSE + ) + ) + + # support for WHONET + expect_message(example_isolates %>% + select(-patient) %>% + mutate( + `First name` = "test", + `Last name` = "test", + Sex = "Female" + ) %>% + first_isolate(info = TRUE)) + + # groups + x <- example_isolates %>% + group_by(ward) %>% + mutate(first = first_isolate()) + y <- example_isolates %>% + group_by(ward) %>% + mutate(first = first_isolate(.)) + expect_identical(x, y) + } + + # missing dates should be no problem + df <- example_isolates + df[1:100, "date"] <- NA + expect_equal( + sum( + first_isolate( + x = df, + col_date = "date", + col_patient_id = "patient", + col_mo = "mo", + info = TRUE + ), + na.rm = TRUE ), - na.rm = TRUE - ), - 1390 -) + 1390 + ) -# unknown MOs -test_unknown <- example_isolates -test_unknown$mo <- ifelse(test_unknown$mo == "B_ESCHR_COLI", "UNKNOWN", test_unknown$mo) -expect_equal( - sum(first_isolate(test_unknown, include_unknown = FALSE)), - 1116 -) -expect_equal( - sum(first_isolate(test_unknown, include_unknown = TRUE)), - 1599 -) + # unknown MOs + test_unknown <- example_isolates + test_unknown$mo <- ifelse(test_unknown$mo == "B_ESCHR_COLI", "UNKNOWN", test_unknown$mo) + expect_equal( + sum(first_isolate(test_unknown, include_unknown = FALSE)), + 1116 + ) + expect_equal( + sum(first_isolate(test_unknown, include_unknown = TRUE)), + 1599 + ) -test_unknown$mo <- ifelse(test_unknown$mo == "UNKNOWN", NA, test_unknown$mo) -expect_equal( - sum(first_isolate(test_unknown)), - 1116 -) + test_unknown$mo <- ifelse(test_unknown$mo == "UNKNOWN", NA, test_unknown$mo) + expect_equal( + sum(first_isolate(test_unknown)), + 1116 + ) -# empty sir results -expect_equal( - sum(first_isolate(example_isolates, include_untested_sir = FALSE)), - 1374 -) + # empty sir results + expect_equal( + sum(first_isolate(example_isolates, include_untested_sir = FALSE)), + 1374 + ) -# shortcuts -expect_identical( - filter_first_isolate(example_isolates), - subset(example_isolates, first_isolate(example_isolates)) -) + # shortcuts + expect_identical( + filter_first_isolate(example_isolates), + subset(example_isolates, first_isolate(example_isolates)) + ) -# notice that all mo's are distinct, so all are TRUE -expect_true(all(first_isolate(AMR:::pm_distinct(example_isolates, mo, .keep_all = TRUE), info = TRUE) == TRUE)) + # notice that all mo's are distinct, so all are TRUE + expect_true(all(first_isolate(AMR:::pm_distinct(example_isolates, mo, .keep_all = TRUE), info = TRUE) == TRUE)) -# only one isolate, so return fast -expect_true(first_isolate(data.frame(mo = "Escherichia coli", date = Sys.Date(), patient = "patient"), info = TRUE)) + # only one isolate, so return fast + expect_true(first_isolate(data.frame(mo = "Escherichia coli", date = Sys.Date(), patient = "patient"), info = TRUE)) +}) diff --git a/tests/testthat/test-g.test.R b/tests/testthat/test-g.test.R index cf68d7c01..f5e54064c 100644 --- a/tests/testthat/test-g.test.R +++ b/tests/testthat/test-g.test.R @@ -27,43 +27,45 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -# GOODNESS-OF-FIT +test_that("g.test works", { + # GOODNESS-OF-FIT -# example 1: clearfield rice vs. red rice -x <- c(772, 1611, 737) -expect_equal(g.test(x, p = c(0.25, 0.50, 0.25))$p.value, - 0.12574, - tolerance = 0.0001 -) - -# example 2: red crossbills -x <- c(1752, 1895) -expect_equal(g.test(x)$p.value, - 0.017873, - tolerance = 0.0001 -) - -expect_error(g.test(0)) -expect_error(g.test(c(0, 1), 0)) -expect_error(g.test(c(1, 2, 3, 4), p = c(0.25, 0.25))) -expect_error(g.test(c(1, 2, 3, 4), p = c(0.25, 0.25, 0.25, 0.24))) -# expect_warning(g.test(c(1, 2, 3, 4), p = c(0.25, 0.25, 0.25, 0.24), rescale.p = TRUE)) - -# INDEPENDENCE - -x <- as.data.frame( - matrix( - data = round(runif(4) * 100000, 0), - ncol = 2, - byrow = TRUE + # example 1: clearfield rice vs. red rice + x <- c(772, 1611, 737) + expect_equal(g.test(x, p = c(0.25, 0.50, 0.25))$p.value, + 0.12574, + tolerance = 0.0001 ) -) -# fisher.test() is always better for 2x2 tables: -# expect_warning(g.test(x)) -expect_true(suppressWarnings(g.test(x)$p.value) < 1) + # example 2: red crossbills + x <- c(1752, 1895) + expect_equal(g.test(x)$p.value, + 0.017873, + tolerance = 0.0001 + ) -# expect_warning(g.test(x = c(772, 1611, 737), y = c(780, 1560, 780), rescale.p = TRUE)) + expect_error(g.test(0)) + expect_error(g.test(c(0, 1), 0)) + expect_error(g.test(c(1, 2, 3, 4), p = c(0.25, 0.25))) + expect_error(g.test(c(1, 2, 3, 4), p = c(0.25, 0.25, 0.25, 0.24))) + # expect_warning(g.test(c(1, 2, 3, 4), p = c(0.25, 0.25, 0.25, 0.24), rescale.p = TRUE)) -expect_error(g.test(matrix(data = c(-1, -2, -3, -4), ncol = 2, byrow = TRUE))) -expect_error(g.test(matrix(data = c(0, 0, 0, 0), ncol = 2, byrow = TRUE))) + # INDEPENDENCE + + x <- as.data.frame( + matrix( + data = round(runif(4) * 100000, 0), + ncol = 2, + byrow = TRUE + ) + ) + + # fisher.test() is always better for 2x2 tables: + # expect_warning(g.test(x)) + expect_true(suppressWarnings(g.test(x)$p.value) < 1) + + # expect_warning(g.test(x = c(772, 1611, 737), y = c(780, 1560, 780), rescale.p = TRUE)) + + expect_error(g.test(matrix(data = c(-1, -2, -3, -4), ncol = 2, byrow = TRUE))) + expect_error(g.test(matrix(data = c(0, 0, 0, 0), ncol = 2, byrow = TRUE))) +}) diff --git a/tests/testthat/test-get_episode.R b/tests/testthat/test-get_episode.R index 18b70af2d..2c8d37f93 100644 --- a/tests/testthat/test-get_episode.R +++ b/tests/testthat/test-get_episode.R @@ -27,51 +27,53 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -x <- data.frame(dates = as.Date(c("2021-01-01", "2021-01-02", "2021-01-05", "2021-01-08", "2021-02-21", "2021-02-22", "2021-02-23", "2021-02-24", "2021-03-01", "2021-03-01"))) -x$absolute <- get_episode(x$dates, episode_days = 7) -x$relative <- get_episode(x$dates, case_free_days = 7) -expect_equal(x$absolute, c(1, 1, 1, 2, 3, 3, 3, 3, 4, 4)) -expect_equal(x$relative, c(1, 1, 1, 1, 2, 2, 2, 2, 2, 2)) -expect_equal(get_episode(as.Date(c("2022-01-01", "2020-01-01")), 365), c(2, 1)) -expect_equal(get_episode(as.Date(c("2020-01-01", "2022-01-01")), 365), c(1, 2)) +test_that("get_episode works", { + x <- data.frame(dates = as.Date(c("2021-01-01", "2021-01-02", "2021-01-05", "2021-01-08", "2021-02-21", "2021-02-22", "2021-02-23", "2021-02-24", "2021-03-01", "2021-03-01"))) + x$absolute <- get_episode(x$dates, episode_days = 7) + x$relative <- get_episode(x$dates, case_free_days = 7) + expect_equal(x$absolute, c(1, 1, 1, 2, 3, 3, 3, 3, 4, 4)) + expect_equal(x$relative, c(1, 1, 1, 1, 2, 2, 2, 2, 2, 2)) + expect_equal(get_episode(as.Date(c("2022-01-01", "2020-01-01")), 365), c(2, 1)) + expect_equal(get_episode(as.Date(c("2020-01-01", "2022-01-01")), 365), c(1, 2)) -test_df <- rbind( - data.frame( - date = as.Date(c("2015-01-01", "2015-10-01", "2016-02-04", "2016-12-31", "2017-01-01", "2017-02-01", "2017-02-05", "2020-01-01")), - patient_id = "A" - ), - data.frame( - date = as.Date(c("2015-01-01", "2016-02-01", "2016-12-31", "2017-01-01", "2017-02-03")), - patient_id = "B" - ) -) - -expect_equal( - get_episode(test_df$date, 365), - c(1, 1, 2, 2, 2, 3, 3, 4, 1, 2, 2, 2, 3) -) -expect_equal( - get_episode(test_df$date[which(test_df$patient_id == "A")], 365), - c(1, 1, 2, 2, 2, 2, 3, 4) -) -expect_equal( - get_episode(test_df$date[which(test_df$patient_id == "B")], 365), - c(1, 2, 2, 2, 3) -) - -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_identical( - test_df %>% group_by(patient_id) %>% mutate(f = is_new_episode(date, 365)) %>% pull(f), - c(TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE) + test_df <- rbind( + data.frame( + date = as.Date(c("2015-01-01", "2015-10-01", "2016-02-04", "2016-12-31", "2017-01-01", "2017-02-01", "2017-02-05", "2020-01-01")), + patient_id = "A" + ), + data.frame( + date = as.Date(c("2015-01-01", "2016-02-01", "2016-12-31", "2017-01-01", "2017-02-03")), + patient_id = "B" + ) ) - suppressMessages( - x <- example_isolates %>% - mutate(out = first_isolate(., include_unknown = TRUE, method = "episode-based", info = FALSE)) + expect_equal( + get_episode(test_df$date, 365), + c(1, 1, 2, 2, 2, 3, 3, 4, 1, 2, 2, 2, 3) + ) + expect_equal( + get_episode(test_df$date[which(test_df$patient_id == "A")], 365), + c(1, 1, 2, 2, 2, 2, 3, 4) + ) + expect_equal( + get_episode(test_df$date[which(test_df$patient_id == "B")], 365), + c(1, 2, 2, 2, 3) ) - y <- example_isolates %>% - group_by(patient, mo) %>% - mutate(out = is_new_episode(date, 365)) - expect_identical(which(x$out), which(y$out)) -} + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_identical( + test_df %>% group_by(patient_id) %>% mutate(f = is_new_episode(date, 365)) %>% pull(f), + c(TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE) + ) + + suppressMessages( + x <- example_isolates %>% + mutate(out = first_isolate(., include_unknown = TRUE, method = "episode-based", info = FALSE)) + ) + y <- example_isolates %>% + group_by(patient, mo) %>% + mutate(out = is_new_episode(date, 365)) + + expect_identical(which(x$out), which(y$out)) + } +}) diff --git a/tests/testthat/test-ggplot_sir.R b/tests/testthat/test-ggplot_sir.R index 346dbe191..6f482fef2 100644 --- a/tests/testthat/test-ggplot_sir.R +++ b/tests/testthat/test-ggplot_sir.R @@ -27,111 +27,113 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE) && - AMR:::pkg_is_available("ggplot2", also_load = TRUE)) { - pdf(NULL) # prevent Rplots.pdf being created +test_that("ggplot_sir works", { + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE) && + AMR:::pkg_is_available("ggplot2", also_load = TRUE)) { + pdf(NULL) # prevent Rplots.pdf being created - # data should be equal - expect_equal( - (example_isolates %>% - select(AMC, CIP) %>% - ggplot_sir())$data %>% - summarise_all(resistance) %>% - as.double(), - example_isolates %>% - select(AMC, CIP) %>% - summarise_all(resistance) %>% - as.double() - ) + # data should be equal + expect_equal( + (example_isolates %>% + select(AMC, CIP) %>% + ggplot_sir())$data %>% + summarise_all(resistance) %>% + as.double(), + example_isolates %>% + select(AMC, CIP) %>% + summarise_all(resistance) %>% + as.double() + ) - expect_inherits( - example_isolates %>% - select(AMC, CIP) %>% - ggplot_sir(x = "interpretation", facet = "antibiotic"), - "gg" - ) - expect_inherits( - example_isolates %>% - select(AMC, CIP) %>% - ggplot_sir(x = "antibiotic", facet = "interpretation"), - "gg" - ) + expect_inherits( + example_isolates %>% + select(AMC, CIP) %>% + ggplot_sir(x = "interpretation", facet = "antibiotic"), + "gg" + ) + expect_inherits( + example_isolates %>% + select(AMC, CIP) %>% + ggplot_sir(x = "antibiotic", facet = "interpretation"), + "gg" + ) - expect_equal( - (example_isolates %>% - select(AMC, CIP) %>% - ggplot_sir(x = "interpretation", facet = "antibiotic"))$data %>% - summarise_all(resistance) %>% - as.double(), - example_isolates %>% - select(AMC, CIP) %>% - summarise_all(resistance) %>% - as.double() - ) + expect_equal( + (example_isolates %>% + select(AMC, CIP) %>% + ggplot_sir(x = "interpretation", facet = "antibiotic"))$data %>% + summarise_all(resistance) %>% + as.double(), + example_isolates %>% + select(AMC, CIP) %>% + summarise_all(resistance) %>% + as.double() + ) - expect_equal( - (example_isolates %>% - select(AMC, CIP) %>% - ggplot_sir(x = "antibiotic", facet = "interpretation"))$data %>% - summarise_all(resistance) %>% - as.double(), - example_isolates %>% - select(AMC, CIP) %>% - summarise_all(resistance) %>% - as.double() - ) + expect_equal( + (example_isolates %>% + select(AMC, CIP) %>% + ggplot_sir(x = "antibiotic", facet = "interpretation"))$data %>% + summarise_all(resistance) %>% + as.double(), + example_isolates %>% + select(AMC, CIP) %>% + summarise_all(resistance) %>% + as.double() + ) - expect_equal( - (example_isolates %>% - select(AMC, CIP) %>% - ggplot_sir(x = "antibiotic", facet = "interpretation"))$data %>% - summarise_all(count_resistant) %>% - as.double(), - example_isolates %>% - select(AMC, CIP) %>% - summarise_all(count_resistant) %>% - as.double() - ) + expect_equal( + (example_isolates %>% + select(AMC, CIP) %>% + ggplot_sir(x = "antibiotic", facet = "interpretation"))$data %>% + summarise_all(count_resistant) %>% + as.double(), + example_isolates %>% + select(AMC, CIP) %>% + summarise_all(count_resistant) %>% + as.double() + ) - # support for scale_type ab and mo - expect_inherits( - (data.frame( - mo = as.mo(c("e. coli", "s aureus")), - n = c(40, 100) - ) %>% - ggplot(aes(x = mo, y = n)) + - geom_col())$data, - "data.frame" - ) - expect_inherits( - (data.frame( - ab = as.ab(c("amx", "amc")), - n = c(40, 100) - ) %>% - ggplot(aes(x = ab, y = n)) + - geom_col())$data, - "data.frame" - ) + # support for scale_type ab and mo + expect_inherits( + (data.frame( + mo = as.mo(c("e. coli", "s aureus")), + n = c(40, 100) + ) %>% + ggplot(aes(x = mo, y = n)) + + geom_col())$data, + "data.frame" + ) + expect_inherits( + (data.frame( + ab = as.ab(c("amx", "amc")), + n = c(40, 100) + ) %>% + ggplot(aes(x = ab, y = n)) + + geom_col())$data, + "data.frame" + ) - expect_inherits( - (data.frame( - ab = as.ab(c("amx", "amc")), - n = c(40, 100) - ) %>% - ggplot(aes(x = ab, y = n)) + - geom_col())$data, - "data.frame" - ) + expect_inherits( + (data.frame( + ab = as.ab(c("amx", "amc")), + n = c(40, 100) + ) %>% + ggplot(aes(x = ab, y = n)) + + geom_col())$data, + "data.frame" + ) - # support for manual colours - expect_inherits( - suppressWarnings((ggplot(data.frame( - x = c("Value1", "Value2", "Value3"), - y = c(1, 2, 3), - z = c("Value4", "Value5", "Value6") - )) + - geom_col(aes(x = x, y = y, fill = z)) + - scale_sir_colours(aesthetics = "fill", Value4 = "S", Value5 = "I", Value6 = "R"))$data), - "data.frame" - ) -} + # support for manual colours + expect_inherits( + suppressWarnings((ggplot(data.frame( + x = c("Value1", "Value2", "Value3"), + y = c(1, 2, 3), + z = c("Value4", "Value5", "Value6") + )) + + geom_col(aes(x = x, y = y, fill = z)) + + scale_sir_colours(aesthetics = "fill", Value4 = "S", Value5 = "I", Value6 = "R"))$data), + "data.frame" + ) + } +}) diff --git a/tests/testthat/test-guess_ab_col.R b/tests/testthat/test-guess_ab_col.R index 72220bad5..5a03b36cc 100644 --- a/tests/testthat/test-guess_ab_col.R +++ b/tests/testthat/test-guess_ab_col.R @@ -27,36 +27,38 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_equal( - guess_ab_col(example_isolates, "amox"), - "AMX" -) -expect_equal( - guess_ab_col(example_isolates, "amoxicillin"), - "AMX" -) -expect_equal( - guess_ab_col(example_isolates, "J01AA07"), - "TCY" -) -expect_equal( - guess_ab_col(example_isolates, "tetracycline"), - "TCY" -) -expect_equal( - guess_ab_col(example_isolates, "TETR"), - "TCY" -) +test_that("guess_ab_col works", { + expect_equal( + guess_ab_col(example_isolates, "amox"), + "AMX" + ) + expect_equal( + guess_ab_col(example_isolates, "amoxicillin"), + "AMX" + ) + expect_equal( + guess_ab_col(example_isolates, "J01AA07"), + "TCY" + ) + expect_equal( + guess_ab_col(example_isolates, "tetracycline"), + "TCY" + ) + expect_equal( + guess_ab_col(example_isolates, "TETR"), + "TCY" + ) -df <- data.frame( - AMP_ND10 = "R", - AMC_ED20 = "S" -) -expect_equal( - guess_ab_col(df, "ampicillin"), - "AMP_ND10" -) -expect_equal( - guess_ab_col(df, "J01CR02"), - "AMC_ED20" -) + df <- data.frame( + AMP_ND10 = "R", + AMC_ED20 = "S" + ) + expect_equal( + guess_ab_col(df, "ampicillin"), + "AMP_ND10" + ) + expect_equal( + guess_ab_col(df, "J01CR02"), + "AMC_ED20" + ) +}) diff --git a/tests/testthat/test-italicise_taxonomy.R b/tests/testthat/test-italicise_taxonomy.R index de6fc9437..5c16a1216 100644 --- a/tests/testthat/test-italicise_taxonomy.R +++ b/tests/testthat/test-italicise_taxonomy.R @@ -27,21 +27,23 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_identical( - italicise_taxonomy("test for E. coli"), - "test for *E. coli*" -) -expect_identical( - italicise_taxonomy("test for E. coli"), - italicize_taxonomy("test for E. coli") -) -if (AMR:::has_colour()) { +test_that("italicise_taxonomy works", { expect_identical( - italicise_taxonomy("test for E. coli", type = "ansi"), - "test for \033[3mE. coli\033[23m" + italicise_taxonomy("test for E. coli"), + "test for *E. coli*" ) -} -expect_identical( - italicise_taxonomy("test for E. coli", "html"), - "test for E. coli" -) + expect_identical( + italicise_taxonomy("test for E. coli"), + italicize_taxonomy("test for E. coli") + ) + if (AMR:::has_colour()) { + expect_identical( + italicise_taxonomy("test for E. coli", type = "ansi"), + "test for \033[3mE. coli\033[23m" + ) + } + expect_identical( + italicise_taxonomy("test for E. coli", "html"), + "test for E. coli" + ) +}) diff --git a/tests/testthat/test-join_microorganisms.R b/tests/testthat/test-join_microorganisms.R index 21779f908..47261712a 100755 --- a/tests/testthat/test-join_microorganisms.R +++ b/tests/testthat/test-join_microorganisms.R @@ -27,35 +27,37 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -unjoined <- example_isolates -inner <- inner_join_microorganisms(example_isolates) -left <- left_join_microorganisms(example_isolates) -semi <- semi_join_microorganisms(example_isolates) -anti <- anti_join_microorganisms(example_isolates) -suppressWarnings(right <- right_join_microorganisms(example_isolates)) -suppressWarnings(full <- full_join_microorganisms(example_isolates)) +test_that("join_microorganisms works", { + unjoined <- example_isolates + inner <- inner_join_microorganisms(example_isolates) + left <- left_join_microorganisms(example_isolates) + semi <- semi_join_microorganisms(example_isolates) + anti <- anti_join_microorganisms(example_isolates) + suppressWarnings(right <- right_join_microorganisms(example_isolates)) + suppressWarnings(full <- full_join_microorganisms(example_isolates)) -expect_true(ncol(unjoined) < ncol(inner)) -expect_true(nrow(unjoined) == nrow(inner)) + expect_true(ncol(unjoined) < ncol(inner)) + expect_true(nrow(unjoined) == nrow(inner)) -expect_true(ncol(unjoined) < ncol(left)) -expect_true(nrow(unjoined) == nrow(left)) + expect_true(ncol(unjoined) < ncol(left)) + expect_true(nrow(unjoined) == nrow(left)) -expect_true(ncol(semi) == ncol(semi)) -expect_true(nrow(semi) == nrow(semi)) + expect_true(ncol(semi) == ncol(semi)) + expect_true(nrow(semi) == nrow(semi)) -expect_true(nrow(anti) == 0) + expect_true(nrow(anti) == 0) -expect_true(nrow(unjoined) < nrow(right)) -expect_true(nrow(unjoined) < nrow(full)) + expect_true(nrow(unjoined) < nrow(right)) + expect_true(nrow(unjoined) < nrow(full)) -expect_equal(nrow(inner_join_microorganisms("B_ESCHR_COLI")), 1) -expect_equal(nrow(inner_join_microorganisms("B_ESCHR_COLI", by = c("mo" = "mo"))), 1) + expect_equal(nrow(inner_join_microorganisms("B_ESCHR_COLI")), 1) + expect_equal(nrow(inner_join_microorganisms("B_ESCHR_COLI", by = c("mo" = "mo"))), 1) -expect_equal(nrow(left_join_microorganisms("B_ESCHR_COLI")), 1) + expect_equal(nrow(left_join_microorganisms("B_ESCHR_COLI")), 1) -expect_equal(nrow(semi_join_microorganisms("B_ESCHR_COLI")), 1) -expect_equal(nrow(anti_join_microorganisms("B_ESCHR_COLI")), 0) + expect_equal(nrow(semi_join_microorganisms("B_ESCHR_COLI")), 1) + expect_equal(nrow(anti_join_microorganisms("B_ESCHR_COLI")), 0) -# expect_warning(right_join_microorganisms("B_ESCHR_COLI")) -# expect_warning(full_join_microorganisms("B_ESCHR_COLI")) + # expect_warning(right_join_microorganisms("B_ESCHR_COLI")) + # expect_warning(full_join_microorganisms("B_ESCHR_COLI")) +}) diff --git a/tests/testthat/test-key_antimicrobials.R b/tests/testthat/test-key_antimicrobials.R index 4f978e678..5c2a0a8e6 100644 --- a/tests/testthat/test-key_antimicrobials.R +++ b/tests/testthat/test-key_antimicrobials.R @@ -27,14 +27,16 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_equal(length(key_antimicrobials(example_isolates, antifungal = NULL)), nrow(example_isolates)) -expect_false(all(is.na(key_antimicrobials(example_isolates, antifungal = NULL)))) -expect_true(antimicrobials_equal("SSS", "SSS", type = "points")) -expect_false(antimicrobials_equal("SSS", "SRS", type = "keyantimicrobials")) -expect_true(antimicrobials_equal("SSS", "SRS", type = "points")) -expect_true(antimicrobials_equal("SSS", "SIS", ignore_I = TRUE, type = "keyantimicrobials")) -expect_false(antimicrobials_equal("SSS", "SIS", ignore_I = FALSE, type = "keyantimicrobials")) -expect_true(antimicrobials_equal(".SS", "SI.", ignore_I = TRUE, type = "keyantimicrobials")) -expect_false(antimicrobials_equal(".SS", "SI.", ignore_I = FALSE, type = "keyantimicrobials")) +test_that("key_antimicrobials works", { + expect_equal(length(key_antimicrobials(example_isolates, antifungal = NULL)), nrow(example_isolates)) + expect_false(all(is.na(key_antimicrobials(example_isolates, antifungal = NULL)))) + expect_true(antimicrobials_equal("SSS", "SSS", type = "points")) + expect_false(antimicrobials_equal("SSS", "SRS", type = "keyantimicrobials")) + expect_true(antimicrobials_equal("SSS", "SRS", type = "points")) + expect_true(antimicrobials_equal("SSS", "SIS", ignore_I = TRUE, type = "keyantimicrobials")) + expect_false(antimicrobials_equal("SSS", "SIS", ignore_I = FALSE, type = "keyantimicrobials")) + expect_true(antimicrobials_equal(".SS", "SI.", ignore_I = TRUE, type = "keyantimicrobials")) + expect_false(antimicrobials_equal(".SS", "SI.", ignore_I = FALSE, type = "keyantimicrobials")) -# expect_warning(key_antimicrobials(example_isolates[rep(1, 10), , drop = FALSE])) + # expect_warning(key_antimicrobials(example_isolates[rep(1, 10), , drop = FALSE])) +}) diff --git a/tests/testthat/test-kurtosis.R b/tests/testthat/test-kurtosis.R index f146a846e..425c1a3a0 100644 --- a/tests/testthat/test-kurtosis.R +++ b/tests/testthat/test-kurtosis.R @@ -27,25 +27,27 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_equal(kurtosis(example_isolates$age), - 5.227999, - tolerance = 0.00001 -) +test_that("kurtosis works", { + expect_equal(kurtosis(example_isolates$age), + 5.227999, + tolerance = 0.00001 + ) -expect_equal(unname(kurtosis(data.frame(example_isolates$age))), - 5.227999, - tolerance = 0.00001 -) -expect_equal(unname(kurtosis(data.frame(example_isolates$age), excess = TRUE)), - 2.227999, - tolerance = 0.00001 -) + expect_equal(unname(kurtosis(data.frame(example_isolates$age))), + 5.227999, + tolerance = 0.00001 + ) + expect_equal(unname(kurtosis(data.frame(example_isolates$age), excess = TRUE)), + 2.227999, + tolerance = 0.00001 + ) -expect_equal(kurtosis(matrix(example_isolates$age)), - 5.227999, - tolerance = 0.00001 -) -expect_equal(kurtosis(matrix(example_isolates$age), excess = TRUE), - 2.227999, - tolerance = 0.00001 -) + expect_equal(kurtosis(matrix(example_isolates$age)), + 5.227999, + tolerance = 0.00001 + ) + expect_equal(kurtosis(matrix(example_isolates$age), excess = TRUE), + 2.227999, + tolerance = 0.00001 + ) +}) diff --git a/tests/testthat/test-like.R b/tests/testthat/test-like.R index f370368c4..16192836c 100644 --- a/tests/testthat/test-like.R +++ b/tests/testthat/test-like.R @@ -27,24 +27,26 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_true(sum("test" %like% c("^t", "^s")) == 1) +test_that("like works", { + expect_true(sum("test" %like% c("^t", "^s")) == 1) -expect_true("test" %like% "test") -expect_false("test" %like_case% "TEST") -expect_true(factor("test") %like% factor("t")) -expect_true(factor("test") %like% "t") -expect_true("test" %like% factor("t")) + expect_true("test" %like% "test") + expect_false("test" %like_case% "TEST") + expect_true(factor("test") %like% factor("t")) + expect_true(factor("test") %like% "t") + expect_true("test" %like% factor("t")) -expect_true(as.factor("test") %like% "TEST") -expect_identical( - factor(c("Test case", "Something different", "Yet another thing")) %like% c("case", "diff", "yet"), - c(TRUE, TRUE, TRUE) -) -expect_identical( - "test" %like% c("t", "e", "s", "t"), - c(TRUE, TRUE, TRUE, TRUE) -) -expect_identical( - factor("test") %like% factor(c("t", "e", "s", "t")), - c(TRUE, TRUE, TRUE, TRUE) -) + expect_true(as.factor("test") %like% "TEST") + expect_identical( + factor(c("Test case", "Something different", "Yet another thing")) %like% c("case", "diff", "yet"), + c(TRUE, TRUE, TRUE) + ) + expect_identical( + "test" %like% c("t", "e", "s", "t"), + c(TRUE, TRUE, TRUE, TRUE) + ) + expect_identical( + factor("test") %like% factor(c("t", "e", "s", "t")), + c(TRUE, TRUE, TRUE, TRUE) + ) +}) diff --git a/tests/testthat/test-mdro.R b/tests/testthat/test-mdro.R index 31d0fc0b0..08f6b1dae 100755 --- a/tests/testthat/test-mdro.R +++ b/tests/testthat/test-mdro.R @@ -27,260 +27,262 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_error(mdro(example_isolates, guideline = c("BRMO", "MRGN"), info = TRUE)) -expect_error(mdro(example_isolates, col_mo = "invalid", info = TRUE)) +test_that("mdro works", { + expect_error(mdro(example_isolates, guideline = c("BRMO", "MRGN"), info = TRUE)) + expect_error(mdro(example_isolates, col_mo = "invalid", info = TRUE)) -expect_stdout(suppressMessages(suppressWarnings(mdro(example_isolates, info = TRUE)))) -expect_stdout(suppressMessages(suppressWarnings(mdro(example_isolates, "eucast3.1", info = TRUE)))) -expect_stdout(suppressMessages(suppressWarnings(mdro(example_isolates, "eucast3.2", info = TRUE)))) -expect_stdout(suppressMessages(suppressWarnings(mdro(example_isolates, "eucast3.3", info = TRUE)))) -expect_stdout(outcome <- suppressMessages(suppressWarnings(eucast_exceptional_phenotypes(example_isolates, info = TRUE)))) -# check class -expect_identical(class(outcome), c("ordered", "factor")) + expect_output(suppressMessages(suppressWarnings(mdro(example_isolates, info = TRUE)))) + expect_output(suppressMessages(suppressWarnings(mdro(example_isolates, "eucast3.1", info = TRUE)))) + expect_output(suppressMessages(suppressWarnings(mdro(example_isolates, "eucast3.2", info = TRUE)))) + expect_output(suppressMessages(suppressWarnings(mdro(example_isolates, "eucast3.3", info = TRUE)))) + expect_output(outcome <- suppressMessages(suppressWarnings(eucast_exceptional_phenotypes(example_isolates, info = TRUE)))) + # check class + expect_identical(class(outcome), c("ordered", "factor")) -expect_stdout(outcome <- mdro(example_isolates, "nl", info = TRUE)) -# check class -expect_identical(class(outcome), c("ordered", "factor")) + expect_output(outcome <- mdro(example_isolates, "nl", info = TRUE)) + # check class + expect_identical(class(outcome), c("ordered", "factor")) -# example_isolates should have these finding using Dutch guidelines -expect_equal( - as.double(table(outcome)), - c(1977, 23, 0) -) + # example_isolates should have these finding using Dutch guidelines + expect_equal( + as.double(table(outcome)), + c(1977, 23, 0) + ) -expect_equal( - brmo(example_isolates, info = FALSE), - mdro(example_isolates, guideline = "BRMO", info = FALSE) -) + expect_equal( + brmo(example_isolates, info = FALSE), + mdro(example_isolates, guideline = "BRMO", info = FALSE) + ) -# test Dutch P. aeruginosa MDRO -expect_equal( - as.character(mdro( - data.frame( - mo = as.mo("P. aeruginosa"), - cfta = "S", - cipr = "S", - mero = "S", - imip = "S", - gent = "S", - tobr = "S", - pita = "S" - ), - guideline = "BRMO", - col_mo = "mo", - info = FALSE - )), - "Negative" -) -expect_equal( - as.character(mdro( - data.frame( - mo = as.mo("P. aeruginosa"), - cefta = "R", - cipr = "R", - mero = "R", - imip = "R", - gent = "R", - tobr = "R", - pita = "R" - ), - guideline = "BRMO", - col_mo = "mo", - info = FALSE - )), - "Positive" -) - -# German 3MRGN and 4MRGN -expect_equal( - as.character(mrgn( - data.frame( - mo = c( - "E. coli", "E. coli", "K. pneumoniae", "E. coli", - "A. baumannii", "A. baumannii", "A. baumannii", - "P. aeruginosa", "P. aeruginosa", "P. aeruginosa" + # test Dutch P. aeruginosa MDRO + expect_equal( + as.character(mdro( + data.frame( + mo = as.mo("P. aeruginosa"), + cfta = "S", + cipr = "S", + mero = "S", + imip = "S", + gent = "S", + tobr = "S", + pita = "S" ), - PIP = c( - "S", "R", "R", "S", - "S", "R", "R", - "S", "R", "R" + guideline = "BRMO", + col_mo = "mo", + info = FALSE + )), + "Negative" + ) + expect_equal( + as.character(mdro( + data.frame( + mo = as.mo("P. aeruginosa"), + cefta = "R", + cipr = "R", + mero = "R", + imip = "R", + gent = "R", + tobr = "R", + pita = "R" ), - CTX = c( - "S", "R", "R", "S", - "R", "R", "R", - "R", "R", "R" - ), - IPM = c( - "S", "R", "S", "R", - "R", "R", "S", - "S", "R", "R" - ), - CIP = c( - "S", "R", "R", "S", - "R", "R", "R", - "R", "S", "R" - ), - stringsAsFactors = FALSE - ) - )), - c("Negative", "4MRGN", "3MRGN", "4MRGN", "4MRGN", "4MRGN", "3MRGN", "Negative", "3MRGN", "4MRGN") -) + guideline = "BRMO", + col_mo = "mo", + info = FALSE + )), + "Positive" + ) -# MDR TB -expect_equal( - # select only rifampicine, mo will be determined automatically (as M. tuberculosis), - # number of mono-resistant strains should be equal to number of rifampicine-resistant strains - as.double(table(mdr_tb(example_isolates[, "RIF", drop = FALSE])))[2], - count_R(example_isolates$RIF) -) + # German 3MRGN and 4MRGN + expect_equal( + as.character(mrgn( + data.frame( + mo = c( + "E. coli", "E. coli", "K. pneumoniae", "E. coli", + "A. baumannii", "A. baumannii", "A. baumannii", + "P. aeruginosa", "P. aeruginosa", "P. aeruginosa" + ), + PIP = c( + "S", "R", "R", "S", + "S", "R", "R", + "S", "R", "R" + ), + CTX = c( + "S", "R", "R", "S", + "R", "R", "R", + "R", "R", "R" + ), + IPM = c( + "S", "R", "S", "R", + "R", "R", "S", + "S", "R", "R" + ), + CIP = c( + "S", "R", "R", "S", + "R", "R", "R", + "R", "S", "R" + ), + stringsAsFactors = FALSE + ) + )), + c("Negative", "4MRGN", "3MRGN", "4MRGN", "4MRGN", "4MRGN", "3MRGN", "Negative", "3MRGN", "4MRGN") + ) -x <- data.frame( - rifampicin = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), - inh = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), - gatifloxacin = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), - eth = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), - pza = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), - MFX = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), - KAN = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)) -) -expect_true(length(unique(mdr_tb(x))) > 2) + # MDR TB + expect_equal( + # select only rifampicine, mo will be determined automatically (as M. tuberculosis), + # number of mono-resistant strains should be equal to number of rifampicine-resistant strains + as.double(table(mdr_tb(example_isolates[, "RIF", drop = FALSE])))[2], + count_R(example_isolates$RIF) + ) -# check the guideline by Magiorakos et al. (2012), the default guideline -stau <- data.frame( - mo = c("S. aureus", "S. aureus", "S. aureus", "S. aureus"), - GEN = c("R", "R", "S", "R"), - RIF = c("S", "R", "S", "R"), - CPT = c("S", "R", "R", "R"), - OXA = c("S", "R", "R", "R"), - CIP = c("S", "S", "R", "R"), - MFX = c("S", "S", "R", "R"), - SXT = c("S", "S", "R", "R"), - FUS = c("S", "S", "R", "R"), - VAN = c("S", "S", "R", "R"), - TEC = c("S", "S", "R", "R"), - TLV = c("S", "S", "R", "R"), - TGC = c("S", "S", "R", "R"), - CLI = c("S", "S", "R", "R"), - DAP = c("S", "S", "R", "R"), - ERY = c("S", "S", "R", "R"), - LNZ = c("S", "S", "R", "R"), - CHL = c("S", "S", "R", "R"), - FOS = c("S", "S", "R", "R"), - QDA = c("S", "S", "R", "R"), - TCY = c("S", "S", "R", "R"), - DOX = c("S", "S", "R", "R"), - MNO = c("S", "S", "R", "R"), - stringsAsFactors = FALSE -) -expect_equal(as.integer(mdro(stau)), c(1:4)) -expect_inherits(mdro(stau, verbose = TRUE), "data.frame") + x <- data.frame( + rifampicin = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), + inh = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), + gatifloxacin = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), + eth = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), + pza = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), + MFX = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)), + KAN = random_sir(5000, prob_sir = c(0.4, 0.1, 0.5)) + ) + expect_true(length(unique(mdr_tb(x))) > 2) -ente <- data.frame( - mo = c("Enterococcus", "Enterococcus", "Enterococcus", "Enterococcus"), - GEH = c("R", "R", "S", "R"), - STH = c("S", "R", "S", "R"), - IPM = c("S", "R", "R", "R"), - MEM = c("S", "R", "R", "R"), - DOR = c("S", "S", "R", "R"), - CIP = c("S", "S", "R", "R"), - LVX = c("S", "S", "R", "R"), - MFX = c("S", "S", "R", "R"), - VAN = c("S", "S", "R", "R"), - TEC = c("S", "S", "R", "R"), - TGC = c("S", "S", "R", "R"), - DAP = c("S", "S", "R", "R"), - LNZ = c("S", "S", "R", "R"), - AMP = c("S", "S", "R", "R"), - QDA = c("S", "S", "R", "R"), - DOX = c("S", "S", "R", "R"), - MNO = c("S", "S", "R", "R"), - stringsAsFactors = FALSE -) -expect_equal(as.integer(mdro(ente)), c(1:4)) -expect_inherits(mdro(ente, verbose = TRUE), "data.frame") + # check the guideline by Magiorakos et al. (2012), the default guideline + stau <- data.frame( + mo = c("S. aureus", "S. aureus", "S. aureus", "S. aureus"), + GEN = c("R", "R", "S", "R"), + RIF = c("S", "R", "S", "R"), + CPT = c("S", "R", "R", "R"), + OXA = c("S", "R", "R", "R"), + CIP = c("S", "S", "R", "R"), + MFX = c("S", "S", "R", "R"), + SXT = c("S", "S", "R", "R"), + FUS = c("S", "S", "R", "R"), + VAN = c("S", "S", "R", "R"), + TEC = c("S", "S", "R", "R"), + TLV = c("S", "S", "R", "R"), + TGC = c("S", "S", "R", "R"), + CLI = c("S", "S", "R", "R"), + DAP = c("S", "S", "R", "R"), + ERY = c("S", "S", "R", "R"), + LNZ = c("S", "S", "R", "R"), + CHL = c("S", "S", "R", "R"), + FOS = c("S", "S", "R", "R"), + QDA = c("S", "S", "R", "R"), + TCY = c("S", "S", "R", "R"), + DOX = c("S", "S", "R", "R"), + MNO = c("S", "S", "R", "R"), + stringsAsFactors = FALSE + ) + expect_equal(as.integer(mdro(stau)), c(1:4)) + expect_inherits(mdro(stau, verbose = TRUE), "data.frame") -entero <- data.frame( - mo = c("E. coli", "E. coli", "E. coli", "E. coli"), - GEN = c("R", "R", "S", "R"), TOB = c("S", "R", "S", "R"), - AMK = c("S", "R", "R", "R"), NET = c("S", "R", "R", "R"), - CPT = c("S", "R", "R", "R"), TCC = c("S", "R", "R", "R"), - TZP = c("S", "S", "R", "R"), ETP = c("S", "S", "R", "R"), - IPM = c("S", "S", "R", "R"), MEM = c("S", "S", "R", "R"), - DOR = c("S", "S", "R", "R"), CZO = c("S", "S", "R", "R"), - CXM = c("S", "S", "R", "R"), CTX = c("S", "S", "R", "R"), - CAZ = c("S", "S", "R", "R"), FEP = c("S", "S", "R", "R"), - FOX = c("S", "S", "R", "R"), CTT = c("S", "S", "R", "R"), - CIP = c("S", "S", "R", "R"), SXT = c("S", "S", "R", "R"), - TGC = c("S", "S", "R", "R"), ATM = c("S", "S", "R", "R"), - AMP = c("S", "S", "R", "R"), AMC = c("S", "S", "R", "R"), - SAM = c("S", "S", "R", "R"), CHL = c("S", "S", "R", "R"), - FOS = c("S", "S", "R", "R"), COL = c("S", "S", "R", "R"), - TCY = c("S", "S", "R", "R"), DOX = c("S", "S", "R", "R"), - MNO = c("S", "S", "R", "R"), - stringsAsFactors = FALSE -) -expect_equal(as.integer(mdro(entero)), c(1:4)) -expect_inherits(mdro(entero, verbose = TRUE), "data.frame") + ente <- data.frame( + mo = c("Enterococcus", "Enterococcus", "Enterococcus", "Enterococcus"), + GEH = c("R", "R", "S", "R"), + STH = c("S", "R", "S", "R"), + IPM = c("S", "R", "R", "R"), + MEM = c("S", "R", "R", "R"), + DOR = c("S", "S", "R", "R"), + CIP = c("S", "S", "R", "R"), + LVX = c("S", "S", "R", "R"), + MFX = c("S", "S", "R", "R"), + VAN = c("S", "S", "R", "R"), + TEC = c("S", "S", "R", "R"), + TGC = c("S", "S", "R", "R"), + DAP = c("S", "S", "R", "R"), + LNZ = c("S", "S", "R", "R"), + AMP = c("S", "S", "R", "R"), + QDA = c("S", "S", "R", "R"), + DOX = c("S", "S", "R", "R"), + MNO = c("S", "S", "R", "R"), + stringsAsFactors = FALSE + ) + expect_equal(as.integer(mdro(ente)), c(1:4)) + expect_inherits(mdro(ente, verbose = TRUE), "data.frame") -pseud <- data.frame( - mo = c("P. aeruginosa", "P. aeruginosa", "P. aeruginosa", "P. aeruginosa"), - GEN = c("R", "R", "S", "R"), TOB = c("S", "S", "S", "R"), - AMK = c("S", "S", "R", "R"), NET = c("S", "S", "R", "R"), - IPM = c("S", "R", "R", "R"), MEM = c("S", "S", "R", "R"), - DOR = c("S", "S", "R", "R"), CAZ = c("S", "S", "R", "R"), - FEP = c("S", "R", "R", "R"), CIP = c("S", "S", "R", "R"), - LVX = c("S", "S", "R", "R"), TCC = c("S", "S", "R", "R"), - TZP = c("S", "S", "R", "R"), ATM = c("S", "S", "R", "R"), - FOS = c("S", "S", "R", "R"), COL = c("S", "S", "R", "R"), - PLB = c("S", "S", "R", "R"), - stringsAsFactors = FALSE -) -expect_equal(as.integer(mdro(pseud)), c(1:4)) -expect_inherits(mdro(pseud, verbose = TRUE), "data.frame") + entero <- data.frame( + mo = c("E. coli", "E. coli", "E. coli", "E. coli"), + GEN = c("R", "R", "S", "R"), TOB = c("S", "R", "S", "R"), + AMK = c("S", "R", "R", "R"), NET = c("S", "R", "R", "R"), + CPT = c("S", "R", "R", "R"), TCC = c("S", "R", "R", "R"), + TZP = c("S", "S", "R", "R"), ETP = c("S", "S", "R", "R"), + IPM = c("S", "S", "R", "R"), MEM = c("S", "S", "R", "R"), + DOR = c("S", "S", "R", "R"), CZO = c("S", "S", "R", "R"), + CXM = c("S", "S", "R", "R"), CTX = c("S", "S", "R", "R"), + CAZ = c("S", "S", "R", "R"), FEP = c("S", "S", "R", "R"), + FOX = c("S", "S", "R", "R"), CTT = c("S", "S", "R", "R"), + CIP = c("S", "S", "R", "R"), SXT = c("S", "S", "R", "R"), + TGC = c("S", "S", "R", "R"), ATM = c("S", "S", "R", "R"), + AMP = c("S", "S", "R", "R"), AMC = c("S", "S", "R", "R"), + SAM = c("S", "S", "R", "R"), CHL = c("S", "S", "R", "R"), + FOS = c("S", "S", "R", "R"), COL = c("S", "S", "R", "R"), + TCY = c("S", "S", "R", "R"), DOX = c("S", "S", "R", "R"), + MNO = c("S", "S", "R", "R"), + stringsAsFactors = FALSE + ) + expect_equal(as.integer(mdro(entero)), c(1:4)) + expect_inherits(mdro(entero, verbose = TRUE), "data.frame") -acin <- data.frame( - mo = c("A. baumannii", "A. baumannii", "A. baumannii", "A. baumannii"), - GEN = c("R", "R", "S", "R"), TOB = c("S", "R", "S", "R"), - AMK = c("S", "R", "R", "R"), NET = c("S", "R", "R", "R"), - IPM = c("S", "S", "R", "R"), MEM = c("S", "R", "R", "R"), - DOR = c("S", "S", "R", "R"), CIP = c("S", "S", "R", "R"), - LVX = c("S", "S", "R", "R"), TZP = c("S", "S", "R", "R"), - TCC = c("S", "S", "R", "R"), CTX = c("S", "S", "R", "R"), - CRO = c("S", "S", "R", "R"), CAZ = c("S", "S", "R", "R"), - FEP = c("S", "R", "R", "R"), SXT = c("S", "S", "R", "R"), - SAM = c("S", "S", "R", "R"), COL = c("S", "S", "R", "R"), - PLB = c("S", "S", "R", "R"), TCY = c("S", "S", "R", "R"), - DOX = c("S", "S", "R", "R"), MNO = c("S", "S", "R", "R"), - stringsAsFactors = FALSE -) -expect_equal(as.integer(mdro(acin)), c(1:4)) -expect_inherits(mdro(acin, verbose = TRUE), "data.frame") + pseud <- data.frame( + mo = c("P. aeruginosa", "P. aeruginosa", "P. aeruginosa", "P. aeruginosa"), + GEN = c("R", "R", "S", "R"), TOB = c("S", "S", "S", "R"), + AMK = c("S", "S", "R", "R"), NET = c("S", "S", "R", "R"), + IPM = c("S", "R", "R", "R"), MEM = c("S", "S", "R", "R"), + DOR = c("S", "S", "R", "R"), CAZ = c("S", "S", "R", "R"), + FEP = c("S", "R", "R", "R"), CIP = c("S", "S", "R", "R"), + LVX = c("S", "S", "R", "R"), TCC = c("S", "S", "R", "R"), + TZP = c("S", "S", "R", "R"), ATM = c("S", "S", "R", "R"), + FOS = c("S", "S", "R", "R"), COL = c("S", "S", "R", "R"), + PLB = c("S", "S", "R", "R"), + stringsAsFactors = FALSE + ) + expect_equal(as.integer(mdro(pseud)), c(1:4)) + expect_inherits(mdro(pseud, verbose = TRUE), "data.frame") -# custom rules -custom <- custom_mdro_guideline("CIP == 'R' & age > 60" ~ "Elderly Type A", - "ERY == 'R' & age > 60" ~ "Elderly Type B", - as_factor = TRUE -) -expect_stdout(print(custom)) -expect_stdout(print(c(custom, custom))) -expect_stdout(print(as.list(custom, custom))) + acin <- data.frame( + mo = c("A. baumannii", "A. baumannii", "A. baumannii", "A. baumannii"), + GEN = c("R", "R", "S", "R"), TOB = c("S", "R", "S", "R"), + AMK = c("S", "R", "R", "R"), NET = c("S", "R", "R", "R"), + IPM = c("S", "S", "R", "R"), MEM = c("S", "R", "R", "R"), + DOR = c("S", "S", "R", "R"), CIP = c("S", "S", "R", "R"), + LVX = c("S", "S", "R", "R"), TZP = c("S", "S", "R", "R"), + TCC = c("S", "S", "R", "R"), CTX = c("S", "S", "R", "R"), + CRO = c("S", "S", "R", "R"), CAZ = c("S", "S", "R", "R"), + FEP = c("S", "R", "R", "R"), SXT = c("S", "S", "R", "R"), + SAM = c("S", "S", "R", "R"), COL = c("S", "S", "R", "R"), + PLB = c("S", "S", "R", "R"), TCY = c("S", "S", "R", "R"), + DOX = c("S", "S", "R", "R"), MNO = c("S", "S", "R", "R"), + stringsAsFactors = FALSE + ) + expect_equal(as.integer(mdro(acin)), c(1:4)) + expect_inherits(mdro(acin, verbose = TRUE), "data.frame") -expect_stdout(x <- mdro(example_isolates, guideline = custom, info = TRUE)) -expect_equal(as.double(table(x)), c(1070, 198, 732)) + # custom rules + custom <- custom_mdro_guideline("CIP == 'R' & age > 60" ~ "Elderly Type A", + "ERY == 'R' & age > 60" ~ "Elderly Type B", + as_factor = TRUE + ) + expect_output(print(custom)) + expect_output(print(c(custom, custom))) + expect_output(print(as.list(custom, custom))) -expect_stdout(print(custom_mdro_guideline(AMX == "R" ~ "test", as_factor = FALSE))) -expect_error(custom_mdro_guideline()) -expect_error(custom_mdro_guideline("test")) -expect_error(custom_mdro_guideline("test" ~ c(1:3))) -expect_error(custom_mdro_guideline("test" ~ A)) -# expect_warning(mdro(example_isolates, -# # since `test` gives an error, it will be ignored with a warning -# guideline = custom_mdro_guideline(test ~ "A"), -# info = FALSE -# )) + expect_output(x <- mdro(example_isolates, guideline = custom, info = TRUE)) + expect_equal(as.double(table(x)), c(1070, 198, 732)) -# print groups -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_stdout(x <- mdro(example_isolates %>% group_by(ward), info = TRUE, pct_required_classes = 0)) - expect_stdout(x <- mdro(example_isolates %>% group_by(ward), guideline = custom, info = TRUE)) -} + expect_output(print(custom_mdro_guideline(AMX == "R" ~ "test", as_factor = FALSE))) + expect_error(custom_mdro_guideline()) + expect_error(custom_mdro_guideline("test")) + expect_error(custom_mdro_guideline("test" ~ c(1:3))) + expect_error(custom_mdro_guideline("test" ~ A)) + # expect_warning(mdro(example_isolates, + # # since `test` gives an error, it will be ignored with a warning + # guideline = custom_mdro_guideline(test ~ "A"), + # info = FALSE + # )) + + # print groups + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_output(x <- mdro(example_isolates %>% group_by(ward), info = TRUE, pct_required_classes = 0)) + expect_output(x <- mdro(example_isolates %>% group_by(ward), guideline = custom, info = TRUE)) + } +}) diff --git a/tests/testthat/test-mean_amr_distance.R b/tests/testthat/test-mean_amr_distance.R index 53ae6be32..52a4f1dc2 100644 --- a/tests/testthat/test-mean_amr_distance.R +++ b/tests/testthat/test-mean_amr_distance.R @@ -27,37 +27,39 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -vctr_disk <- as.disk(c(20:25)) -vctr_mic <- as.mic(2^c(0:5)) -vctr_sir <- as.sir(c("S", "S", "I", "I", "R", "R")) +test_that("mean_amr_distance works", { + vctr_disk <- as.disk(c(20:25)) + vctr_mic <- as.mic(2^c(0:5)) + vctr_sir <- as.sir(c("S", "S", "I", "I", "R", "R")) -expect_identical( - mean_amr_distance(vctr_disk), - (as.double(vctr_disk) - mean(as.double(vctr_disk))) / sd(as.double(vctr_disk)) -) + expect_identical( + mean_amr_distance(vctr_disk), + (as.double(vctr_disk) - mean(as.double(vctr_disk))) / sd(as.double(vctr_disk)) + ) -expect_identical( - mean_amr_distance(vctr_mic), - (log2(vctr_mic) - mean(log2(vctr_mic))) / sd(log2(vctr_mic)) -) + expect_identical( + mean_amr_distance(vctr_mic), + (log2(vctr_mic) - mean(log2(vctr_mic))) / sd(log2(vctr_mic)) + ) -expect_identical( - mean_amr_distance(vctr_sir, combine_SI = FALSE), - (c(1, 1, 2, 2, 3, 3) - mean(c(1, 1, 2, 2, 3, 3))) / sd(c(1, 1, 2, 2, 3, 3)) -) -expect_identical( - mean_amr_distance(vctr_sir, combine_SI = TRUE), - (c(1, 1, 1, 1, 3, 3) - mean(c(1, 1, 1, 1, 3, 3))) / sd(c(1, 1, 1, 1, 3, 3)) -) + expect_identical( + mean_amr_distance(vctr_sir, combine_SI = FALSE), + (c(1, 1, 2, 2, 3, 3) - mean(c(1, 1, 2, 2, 3, 3))) / sd(c(1, 1, 2, 2, 3, 3)) + ) + expect_identical( + mean_amr_distance(vctr_sir, combine_SI = TRUE), + (c(1, 1, 1, 1, 3, 3) - mean(c(1, 1, 1, 1, 3, 3))) / sd(c(1, 1, 1, 1, 3, 3)) + ) -expect_equal( - mean_amr_distance(data.frame(AMX = vctr_mic, GEN = vctr_sir, TOB = vctr_disk)), - c(-1.10603655, -0.74968823, -0.39333990, -0.03699158, 0.96485397, 1.32120229), - tolerance = 0.00001 -) + expect_equal( + mean_amr_distance(data.frame(AMX = vctr_mic, GEN = vctr_sir, TOB = vctr_disk)), + c(-1.10603655, -0.74968823, -0.39333990, -0.03699158, 0.96485397, 1.32120229), + tolerance = 0.00001 + ) -expect_equal( - mean_amr_distance(data.frame(AMX = vctr_mic, GEN = vctr_sir, TOB = vctr_disk), 2:3), - c(-0.9909017, -0.7236405, -0.4563792, -0.1891180, 1.0463891, 1.3136503), - tolerance = 0.00001 -) + expect_equal( + mean_amr_distance(data.frame(AMX = vctr_mic, GEN = vctr_sir, TOB = vctr_disk), 2:3), + c(-0.9909017, -0.7236405, -0.4563792, -0.1891180, 1.0463891, 1.3136503), + tolerance = 0.00001 + ) +}) diff --git a/tests/testthat/test-mic.R b/tests/testthat/test-mic.R index 9453a57bf..44d08cba3 100755 --- a/tests/testthat/test-mic.R +++ b/tests/testthat/test-mic.R @@ -27,152 +27,154 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -# used in multiple functions, also in plotting -expect_true(all(as.mic(AMR:::COMMON_MIC_VALUES) %in% AMR:::VALID_MIC_LEVELS)) -expect_true(all(paste0("<=", as.mic(AMR:::COMMON_MIC_VALUES)) %in% AMR:::VALID_MIC_LEVELS)) -expect_true(all(paste0(">=", as.mic(AMR:::COMMON_MIC_VALUES)) %in% AMR:::VALID_MIC_LEVELS)) +test_that("mic works", { + # used in multiple functions, also in plotting + expect_true(all(as.mic(AMR:::COMMON_MIC_VALUES) %in% AMR:::VALID_MIC_LEVELS)) + expect_true(all(paste0("<=", as.mic(AMR:::COMMON_MIC_VALUES)) %in% AMR:::VALID_MIC_LEVELS)) + expect_true(all(paste0(">=", as.mic(AMR:::COMMON_MIC_VALUES)) %in% AMR:::VALID_MIC_LEVELS)) -expect_true(as.mic(8) == as.mic("8")) -expect_true(as.mic("1") > as.mic("<=0.0625")) -expect_true(as.mic("1") < as.mic(">=32")) -expect_true(is.mic(as.mic(8))) + expect_true(as.mic(8) == as.mic("8")) + expect_true(as.mic("1") > as.mic("<=0.0625")) + expect_true(as.mic("1") < as.mic(">=32")) + expect_true(is.mic(as.mic(8))) -expect_equal(as.double(as.mic(">=32")), 32) -expect_equal(as.numeric(as.mic(">=32")), 32) -expect_equal( - as.integer(as.mic(">=32")), # should be factor level, not the MIC - as.integer(factor(as.character(">=32"), - levels = levels(as.mic(">=32")) - )) -) -expect_equal(suppressWarnings(as.logical(as.mic("INVALID VALUE"))), NA) + expect_equal(as.double(as.mic(">=32")), 32) + expect_equal(as.numeric(as.mic(">=32")), 32) + expect_equal( + as.integer(as.mic(">=32")), # should be factor level, not the MIC + as.integer(factor(as.character(">=32"), + levels = levels(as.mic(">=32")) + )) + ) + expect_equal(suppressWarnings(as.logical(as.mic("INVALID VALUE"))), NA) -# all levels should be valid MICs -x <- as.mic(c(2, 4)) -expect_inherits(x[1], "mic") -expect_inherits(x[[1]], "mic") -expect_inherits(c(x[1], x[9]), "mic") -expect_inherits(unique(x[1], x[9]), "mic") -expect_inherits(droplevels(c(x[1], x[9]), as.mic = TRUE), "factor") -expect_inherits(droplevels(c(x[1], x[9]), as.mic = TRUE), "mic") -x[2] <- 32 -expect_inherits(x, "mic") -# expect_warning(as.mic("INVALID VALUE")) + # all levels should be valid MICs + x <- as.mic(c(2, 4)) + expect_inherits(x[1], "mic") + expect_inherits(x[[1]], "mic") + expect_inherits(c(x[1], x[9]), "mic") + expect_inherits(unique(x[1], x[9]), "mic") + expect_inherits(droplevels(c(x[1], x[9]), as.mic = TRUE), "factor") + expect_inherits(droplevels(c(x[1], x[9]), as.mic = TRUE), "mic") + x[2] <- 32 + expect_inherits(x, "mic") + # expect_warning(as.mic("INVALID VALUE")) -pdf(NULL) # prevent Rplots.pdf being created -expect_silent(barplot(as.mic(c(1, 2, 4, 8)))) -expect_silent(plot(as.mic(c(1, 2, 4, 8)))) -expect_silent(plot(as.mic(c(1, 2, 4, 8)), expand = FALSE)) -expect_silent(plot(as.mic(c(1, 2, 4, 8)), mo = "Escherichia coli", ab = "cipr")) -if (AMR:::pkg_is_available("ggplot2")) { - expect_inherits(ggplot2::autoplot(as.mic(c(1, 2, 4, 8))), "gg") - expect_inherits(ggplot2::autoplot(as.mic(c(1, 2, 4, 8)), expand = FALSE), "gg") - expect_inherits(ggplot2::autoplot(as.mic(c(1, 2, 4, 8, 32)), mo = "Escherichia coli", ab = "cipr"), "gg") -} -expect_stdout(print(as.mic(c(1, 2, 4, 8)))) + pdf(NULL) # prevent Rplots.pdf being created + expect_silent(barplot(as.mic(c(1, 2, 4, 8)))) + expect_silent(plot(as.mic(c(1, 2, 4, 8)))) + expect_silent(plot(as.mic(c(1, 2, 4, 8)), expand = FALSE)) + expect_silent(plot(as.mic(c(1, 2, 4, 8)), mo = "Escherichia coli", ab = "cipr")) + if (AMR:::pkg_is_available("ggplot2")) { + expect_inherits(ggplot2::autoplot(as.mic(c(1, 2, 4, 8))), "gg") + expect_inherits(ggplot2::autoplot(as.mic(c(1, 2, 4, 8)), expand = FALSE), "gg") + expect_inherits(ggplot2::autoplot(as.mic(c(1, 2, 4, 8, 32)), mo = "Escherichia coli", ab = "cipr"), "gg") + } + expect_output(print(as.mic(c(1, 2, 4, 8)))) -expect_inherits(summary(as.mic(c(2, 8))), c("summaryDefault", "table")) + expect_inherits(summary(as.mic(c(2, 8))), c("summaryDefault", "table")) -if (AMR:::pkg_is_available("tibble")) { - expect_stdout(print(tibble::tibble(m = as.mic(2:4)))) -} + if (AMR:::pkg_is_available("tibble")) { + expect_output(print(tibble::tibble(m = as.mic(2:4)))) + } -# all mathematical operations -x <- random_mic(50) -x_double <- as.double(gsub("[<=>]+", "", as.character(x))) -suppressWarnings(expect_identical(mean(x), mean(x_double))) -suppressWarnings(expect_identical(median(x), median(x_double))) -suppressWarnings(expect_identical(quantile(x), quantile(x_double))) -suppressWarnings(expect_identical(abs(x), abs(x_double))) -suppressWarnings(expect_identical(sign(x), sign(x_double))) -suppressWarnings(expect_identical(sqrt(x), sqrt(x_double))) -suppressWarnings(expect_identical(floor(x), floor(x_double))) -suppressWarnings(expect_identical(ceiling(x), ceiling(x_double))) -suppressWarnings(expect_identical(trunc(x), trunc(x_double))) -suppressWarnings(expect_identical(round(x), round(x_double))) -suppressWarnings(expect_identical(signif(x), signif(x_double))) -suppressWarnings(expect_identical(exp(x), exp(x_double))) -suppressWarnings(expect_identical(log(x), log(x_double))) -suppressWarnings(expect_identical(log10(x), log10(x_double))) -suppressWarnings(expect_identical(log2(x), log2(x_double))) -suppressWarnings(expect_identical(expm1(x), expm1(x_double))) -suppressWarnings(expect_identical(log1p(x), log1p(x_double))) -suppressWarnings(expect_identical(cos(x), cos(x_double))) -suppressWarnings(expect_identical(sin(x), sin(x_double))) -suppressWarnings(expect_identical(tan(x), tan(x_double))) -if (getRversion() >= "3.1") { - suppressWarnings(expect_identical(cospi(x), cospi(x_double))) - suppressWarnings(expect_identical(sinpi(x), sinpi(x_double))) - suppressWarnings(expect_identical(tanpi(x), tanpi(x_double))) -} -suppressWarnings(expect_identical(acos(x), acos(x_double))) -suppressWarnings(expect_identical(asin(x), asin(x_double))) -suppressWarnings(expect_identical(atan(x), atan(x_double))) -suppressWarnings(expect_identical(cosh(x), cosh(x_double))) -suppressWarnings(expect_identical(sinh(x), sinh(x_double))) -suppressWarnings(expect_identical(tanh(x), tanh(x_double))) -suppressWarnings(expect_identical(acosh(x), acosh(x_double))) -suppressWarnings(expect_identical(asinh(x), asinh(x_double))) -suppressWarnings(expect_identical(atanh(x), atanh(x_double))) -suppressWarnings(expect_identical(lgamma(x), lgamma(x_double))) -suppressWarnings(expect_identical(gamma(x), gamma(x_double))) -suppressWarnings(expect_identical(digamma(x), digamma(x_double))) -suppressWarnings(expect_identical(trigamma(x), trigamma(x_double))) -suppressWarnings(expect_identical(cumsum(x), cumsum(x_double))) -suppressWarnings(expect_identical(cumprod(x), cumprod(x_double))) -suppressWarnings(expect_identical(cummax(x), cummax(x_double))) -suppressWarnings(expect_identical(cummin(x), cummin(x_double))) -suppressWarnings(expect_identical(!x, !x_double)) + # all mathematical operations + x <- random_mic(50) + x_double <- as.double(gsub("[<=>]+", "", as.character(x))) + suppressWarnings(expect_identical(mean(x), mean(x_double))) + suppressWarnings(expect_identical(median(x), median(x_double))) + suppressWarnings(expect_identical(quantile(x), quantile(x_double))) + suppressWarnings(expect_identical(abs(x), abs(x_double))) + suppressWarnings(expect_identical(sign(x), sign(x_double))) + suppressWarnings(expect_identical(sqrt(x), sqrt(x_double))) + suppressWarnings(expect_identical(floor(x), floor(x_double))) + suppressWarnings(expect_identical(ceiling(x), ceiling(x_double))) + suppressWarnings(expect_identical(trunc(x), trunc(x_double))) + suppressWarnings(expect_identical(round(x), round(x_double))) + suppressWarnings(expect_identical(signif(x), signif(x_double))) + suppressWarnings(expect_identical(exp(x), exp(x_double))) + suppressWarnings(expect_identical(log(x), log(x_double))) + suppressWarnings(expect_identical(log10(x), log10(x_double))) + suppressWarnings(expect_identical(log2(x), log2(x_double))) + suppressWarnings(expect_identical(expm1(x), expm1(x_double))) + suppressWarnings(expect_identical(log1p(x), log1p(x_double))) + suppressWarnings(expect_identical(cos(x), cos(x_double))) + suppressWarnings(expect_identical(sin(x), sin(x_double))) + suppressWarnings(expect_identical(tan(x), tan(x_double))) + if (getRversion() >= "3.1") { + suppressWarnings(expect_identical(cospi(x), cospi(x_double))) + suppressWarnings(expect_identical(sinpi(x), sinpi(x_double))) + suppressWarnings(expect_identical(tanpi(x), tanpi(x_double))) + } + suppressWarnings(expect_identical(acos(x), acos(x_double))) + suppressWarnings(expect_identical(asin(x), asin(x_double))) + suppressWarnings(expect_identical(atan(x), atan(x_double))) + suppressWarnings(expect_identical(cosh(x), cosh(x_double))) + suppressWarnings(expect_identical(sinh(x), sinh(x_double))) + suppressWarnings(expect_identical(tanh(x), tanh(x_double))) + suppressWarnings(expect_identical(acosh(x), acosh(x_double))) + suppressWarnings(expect_identical(asinh(x), asinh(x_double))) + suppressWarnings(expect_identical(atanh(x), atanh(x_double))) + suppressWarnings(expect_identical(lgamma(x), lgamma(x_double))) + suppressWarnings(expect_identical(gamma(x), gamma(x_double))) + suppressWarnings(expect_identical(digamma(x), digamma(x_double))) + suppressWarnings(expect_identical(trigamma(x), trigamma(x_double))) + suppressWarnings(expect_identical(cumsum(x), cumsum(x_double))) + suppressWarnings(expect_identical(cumprod(x), cumprod(x_double))) + suppressWarnings(expect_identical(cummax(x), cummax(x_double))) + suppressWarnings(expect_identical(cummin(x), cummin(x_double))) + suppressWarnings(expect_identical(!x, !x_double)) -suppressWarnings(expect_identical(all(x), all(x_double))) -suppressWarnings(expect_identical(any(x), any(x_double))) -suppressWarnings(expect_identical(sum(x), sum(x_double))) -suppressWarnings(expect_identical(prod(x), prod(x_double))) -suppressWarnings(expect_identical(min(x), min(x_double))) -suppressWarnings(expect_identical(max(x), max(x_double))) -suppressWarnings(expect_identical(range(x), range(x_double))) + suppressWarnings(expect_identical(all(x), all(x_double))) + suppressWarnings(expect_identical(any(x), any(x_double))) + suppressWarnings(expect_identical(sum(x), sum(x_double))) + suppressWarnings(expect_identical(prod(x), prod(x_double))) + suppressWarnings(expect_identical(min(x), min(x_double))) + suppressWarnings(expect_identical(max(x), max(x_double))) + suppressWarnings(expect_identical(range(x), range(x_double))) -el1 <- random_mic(50) -el1_double <- as.double(gsub("[<=>]+", "", as.character(el1))) -el2 <- random_mic(50) -el2_double <- as.double(gsub("[<=>]+", "", as.character(el2))) -suppressWarnings(expect_identical(el1 + el2, el1_double + el2_double)) -suppressWarnings(expect_identical(el1 - el2, el1_double - el2_double)) -suppressWarnings(expect_identical(el1 * el2, el1_double * el2_double)) -suppressWarnings(expect_identical(el1 / el2, el1_double / el2_double)) -suppressWarnings(expect_identical(el1^el2, el1_double^el2_double)) -suppressWarnings(expect_identical(el1 %% el2, el1_double %% el2_double)) -suppressWarnings(expect_identical(el1 %/% el2, el1_double %/% el2_double)) -suppressWarnings(expect_identical(el1 & el2, el1_double & el2_double)) + el1 <- random_mic(50) + el1_double <- as.double(gsub("[<=>]+", "", as.character(el1))) + el2 <- random_mic(50) + el2_double <- as.double(gsub("[<=>]+", "", as.character(el2))) + suppressWarnings(expect_identical(el1 + el2, el1_double + el2_double)) + suppressWarnings(expect_identical(el1 - el2, el1_double - el2_double)) + suppressWarnings(expect_identical(el1 * el2, el1_double * el2_double)) + suppressWarnings(expect_identical(el1 / el2, el1_double / el2_double)) + suppressWarnings(expect_identical(el1^el2, el1_double^el2_double)) + suppressWarnings(expect_identical(el1 %% el2, el1_double %% el2_double)) + suppressWarnings(expect_identical(el1 %/% el2, el1_double %/% el2_double)) + suppressWarnings(expect_identical(el1 & el2, el1_double & el2_double)) -# for comparison operators, be more strict: -expect_true(as.mic(">32") > as.mic(32)) -expect_true(as.mic(">32") >= as.mic(32)) -expect_true(as.mic(">32") >= as.mic("<32")) -expect_true(as.mic(">32") >= as.mic("<=32")) -expect_true(as.mic(">32") > as.mic("<=32")) + # for comparison operators, be more strict: + expect_true(as.mic(">32") > as.mic(32)) + expect_true(as.mic(">32") >= as.mic(32)) + expect_true(as.mic(">32") >= as.mic("<32")) + expect_true(as.mic(">32") >= as.mic("<=32")) + expect_true(as.mic(">32") > as.mic("<=32")) -expect_false(as.mic("32") > as.mic(32)) -expect_true(as.mic("32") >= as.mic(32)) -expect_true(as.mic("32") >= as.mic("<32")) -expect_true(as.mic("32") >= as.mic("<=32")) -expect_false(as.mic("32") > as.mic("<=32")) + expect_false(as.mic("32") > as.mic(32)) + expect_true(as.mic("32") >= as.mic(32)) + expect_true(as.mic("32") >= as.mic("<32")) + expect_true(as.mic("32") >= as.mic("<=32")) + expect_false(as.mic("32") > as.mic("<=32")) -expect_true(as.mic("32") == as.mic(32)) -expect_true(as.mic("32") == as.mic(32)) -expect_false(as.mic("32") == as.mic("<32")) -expect_true(as.mic("32") == as.mic("<=32")) -expect_true(as.mic("32") == as.mic("<=32")) + expect_true(as.mic("32") == as.mic(32)) + expect_true(as.mic("32") == as.mic(32)) + expect_false(as.mic("32") == as.mic("<32")) + expect_true(as.mic("32") == as.mic("<=32")) + expect_true(as.mic("32") == as.mic("<=32")) -expect_false(as.mic(">32") < as.mic(32)) -expect_false(as.mic(">32") <= as.mic(32)) -expect_false(as.mic(">32") <= as.mic("<32")) -expect_false(as.mic(">32") <= as.mic("<=32")) -expect_false(as.mic(">32") < as.mic("<=32")) + expect_false(as.mic(">32") < as.mic(32)) + expect_false(as.mic(">32") <= as.mic(32)) + expect_false(as.mic(">32") <= as.mic("<32")) + expect_false(as.mic(">32") <= as.mic("<=32")) + expect_false(as.mic(">32") < as.mic("<=32")) -expect_false(as.mic("32") < as.mic(32)) -expect_true(as.mic("32") <= as.mic(32)) -expect_false(as.mic("32") <= as.mic("<32")) -expect_true(as.mic("32") <= as.mic("<=32")) -expect_false(as.mic("32") < as.mic("<=32")) + expect_false(as.mic("32") < as.mic(32)) + expect_true(as.mic("32") <= as.mic(32)) + expect_false(as.mic("32") <= as.mic("<32")) + expect_true(as.mic("32") <= as.mic("<=32")) + expect_false(as.mic("32") < as.mic("<=32")) +}) diff --git a/tests/testthat/test-mo.R b/tests/testthat/test-mo.R index c3d386c17..a3dc10ca6 100644 --- a/tests/testthat/test-mo.R +++ b/tests/testthat/test-mo.R @@ -27,294 +27,296 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -MOs <- subset(microorganisms, !is.na(mo) & nchar(mo) > 3) -expect_identical(as.character(MOs$mo), as.character(as.mo(MOs$mo, keep_synonyms = TRUE))) +test_that("mo works", { + MOs <- subset(microorganisms, !is.na(mo) & nchar(mo) > 3) + expect_identical(as.character(MOs$mo), as.character(as.mo(MOs$mo, keep_synonyms = TRUE))) -expect_identical( - as.character(as.mo(c("E. coli", "H. influenzae"), keep_synonyms = FALSE)), - c("B_ESCHR_COLI", "B_HMPHL_INFL") -) - -expect_equal(as.character(as.mo("Escherichia coli")), "B_ESCHR_COLI") -expect_equal(as.character(as.mo("Escherichia coli")), "B_ESCHR_COLI") -expect_equal(as.character(as.mo(112283007)), "B_ESCHR_COLI") -expect_equal(as.character(as.mo("Escherichia species")), "B_ESCHR") -expect_equal(as.character(as.mo("Escherichia")), "B_ESCHR") -expect_equal(as.character(as.mo("Eschr spp.")), "B_ESCHR") -expect_equal(as.character(as.mo(" B_ESCHR_COLI ")), "B_ESCHR_COLI") -expect_equal(as.character(as.mo("e coli")), "B_ESCHR_COLI") # not Campylobacter -expect_equal(as.character(as.mo("klpn")), "B_KLBSL_PNMN") -expect_equal(as.character(as.mo("Klebsiella")), "B_KLBSL") -expect_equal(as.character(as.mo("K. pneumo rhino")), "B_KLBSL_PNMN_RHNS") # K. pneumoniae subspp. rhinoscleromatis -expect_equal(as.character(as.mo("Bartonella")), "B_BRTNL") -expect_equal(as.character(as.mo("C. difficile")), "B_CRDDS_DFFC") -expect_equal(as.character(as.mo("L. pneumophila")), "B_LGNLL_PNMP") -expect_equal(as.character(as.mo("Streptococcus")), "B_STRPT") # not Peptostreptoccus -expect_equal(as.character(as.mo("Estreptococos grupo B")), "B_STRPT_GRPB") -expect_equal(as.character(as.mo("Group B Streptococci")), "B_STRPT_GRPB") - -expect_equal(as.character(as.mo(c("GAS", "GBS", "haemoly strep"))), c("B_STRPT_GRPA", "B_STRPT_GRPB", "B_STRPT_HAEM")) - - -expect_equal(as.character(as.mo("S. pyo")), "B_STRPT_PYGN") # not Actinomyces pyogenes - -# GLIMS -expect_equal(as.character(as.mo("bctfgr")), "B_BCTRD_FRGL") - -expect_equal(as.character(as.mo("MRSE")), "B_STPHY_EPDR") -expect_equal(as.character(as.mo("VRE")), "B_ENTRC") -expect_equal(as.character(as.mo("MRPA")), "B_PSDMN_AERG") -expect_equal(as.character(as.mo("PISP")), "B_STRPT_PNMN") -expect_equal(as.character(as.mo("PRSP")), "B_STRPT_PNMN") -expect_equal(as.character(as.mo("VISP")), "B_STRPT_PNMN") -expect_equal(as.character(as.mo("VRSP")), "B_STRPT_PNMN") - -expect_equal(as.character(as.mo("CNS")), "B_STPHY_CONS") -expect_equal(as.character(as.mo("CoNS")), "B_STPHY_CONS") -expect_equal(as.character(as.mo("CPS")), "B_STPHY_COPS") -expect_equal(as.character(as.mo("CoPS")), "B_STPHY_COPS") -expect_equal(as.character(as.mo("VGS")), "B_STRPT_VIRI") -expect_equal(as.character(as.mo("streptococcus milleri")), "B_STRPT_MILL") - - -expect_equal(as.character(as.mo(c("Gram negative", "Gram positive"))), c("B_GRAMN", "B_GRAMP")) - -# expect_warning(as.mo("Acinetobacter calcoaceticus/baumannii complex")) - -# prevalent MO -expect_identical( - suppressWarnings(as.character( - as.mo(c( - "stau", # WHONET code - "STAU", - "staaur", - "S. aureus", - "S aureus", - "Sthafilokkockus aureus", # handles incorrect spelling - "Staphylococcus aureus (MRSA)", - "MRSA", # Methicillin Resistant S. aureus - "VISA", # Vancomycin Intermediate S. aureus - "VRSA", # Vancomycin Resistant S. aureus - 115329001 # SNOMED CT code - )) - )), - rep("B_STPHY_AURS", 11) -) -expect_identical( - as.character( - as.mo(c("EHEC", "EPEC", "EIEC", "STEC", "ATEC", "UPEC")) - ), - rep("B_ESCHR_COLI", 6) -) -# unprevalent MO -expect_identical( - as.character( - as.mo(c( - "parnod", - "Paraburkholderia nodosa" - )) - ), - rep("B_PRBRK_NODS", 2) -) - -# empty values -expect_identical(as.character(as.mo(c("", " ", NA, NaN))), rep(NA_character_, 4)) -expect_identical(as.character(as.mo(" ")), NA_character_) -# too few characters -# expect_warning(as.mo("ab")) - -expect_identical( - suppressWarnings(as.character(as.mo(c("Qq species", "MRSA", "K. pneu rhino", "esco")))), - c("UNKNOWN", "B_STPHY_AURS", "B_KLBSL_PNMN_RHNS", "B_ESCHR_COLI") -) - -# check for Becker classification -expect_identical(as.character(as.mo("S. epidermidis", Becker = FALSE)), "B_STPHY_EPDR") -expect_identical(as.character(as.mo("S. epidermidis", Becker = TRUE)), "B_STPHY_CONS") -expect_identical(as.character(as.mo("STAEPI", Becker = TRUE)), "B_STPHY_CONS") -expect_identical(as.character(as.mo("Sta intermedius", Becker = FALSE)), "B_STPHY_INTR") -expect_identical(as.character(as.mo("Sta intermedius", Becker = TRUE)), "B_STPHY_COPS") -expect_identical(as.character(as.mo("STAINT", Becker = TRUE)), "B_STPHY_COPS") -# aureus must only be influenced if Becker = "all" -expect_identical(as.character(as.mo("STAAUR", Becker = FALSE)), "B_STPHY_AURS") -expect_identical(as.character(as.mo("STAAUR", Becker = TRUE)), "B_STPHY_AURS") -expect_identical(as.character(as.mo("STAAUR", Becker = "all")), "B_STPHY_COPS") - -# check for Lancefield classification -expect_identical(as.character(as.mo("S. pyogenes", Lancefield = FALSE)), "B_STRPT_PYGN") -expect_identical(as.character(as.mo("S. pyogenes", Lancefield = TRUE)), "B_STRPT_GRPA") -expect_identical(as.character(as.mo("STCPYO", Lancefield = TRUE)), "B_STRPT_GRPA") # group A -expect_identical(as.character(as.mo("S. agalactiae", Lancefield = FALSE)), "B_STRPT_AGLC") -expect_identical(as.character(as.mo("S. agalactiae", Lancefield = TRUE)), "B_STRPT_GRPB") # group B -expect_identical(as.character(suppressWarnings(as.mo("estreptococos grupo B"))), "B_STRPT_GRPB") -expect_identical(as.character(as.mo("S. equi", Lancefield = FALSE)), "B_STRPT_EQUI") -expect_identical(as.character(as.mo("S. equi", Lancefield = TRUE)), "B_STRPT_GRPC") # group C -# Enterococci must only be influenced if Lancefield = "all" -expect_identical(as.character(as.mo("E. faecium", Lancefield = FALSE)), "B_ENTRC_FACM") -expect_identical(as.character(as.mo("E. faecium", Lancefield = TRUE)), "B_ENTRC_FACM") -expect_identical(as.character(as.mo("E. faecium", Lancefield = "all")), "B_STRPT_GRPD") # group D -expect_identical(as.character(as.mo("S. anginosus", Lancefield = FALSE)), "B_STRPT_ANGN") -expect_identical(as.character(as.mo("S. anginosus", Lancefield = TRUE)), "B_STRPT_GRPF") # group F -expect_identical(as.character(as.mo("S. sanguinis", Lancefield = FALSE)), "B_STRPT_SNGN") -expect_identical(as.character(as.mo("S. sanguinis", Lancefield = TRUE)), "B_STRPT_GRPH") # group H -expect_identical(as.character(as.mo("S. salivarius", Lancefield = FALSE)), "B_STRPT_SLVR") -expect_identical(as.character(as.mo("S. salivarius", Lancefield = TRUE)), "B_STRPT_GRPK") # group K - -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - # select with one column expect_identical( - example_isolates %>% - slice(1:10) %>% - left_join_microorganisms() %>% - select(genus) %>% - as.mo() %>% - as.character(), - c( - "B_ESCHR", "B_ESCHR", "B_STPHY", "B_STPHY", "B_STPHY", - "B_STPHY", "B_STPHY", "B_STPHY", "B_STPHY", "B_STPHY" + as.character(as.mo(c("E. coli", "H. influenzae"), keep_synonyms = FALSE)), + c("B_ESCHR_COLI", "B_HMPHL_INFL") + ) + + expect_equal(as.character(as.mo("Escherichia coli")), "B_ESCHR_COLI") + expect_equal(as.character(as.mo("Escherichia coli")), "B_ESCHR_COLI") + expect_equal(as.character(as.mo(112283007)), "B_ESCHR_COLI") + expect_equal(as.character(as.mo("Escherichia species")), "B_ESCHR") + expect_equal(as.character(as.mo("Escherichia")), "B_ESCHR") + expect_equal(as.character(as.mo("Eschr spp.")), "B_ESCHR") + expect_equal(as.character(as.mo(" B_ESCHR_COLI ")), "B_ESCHR_COLI") + expect_equal(as.character(as.mo("e coli")), "B_ESCHR_COLI") # not Campylobacter + expect_equal(as.character(as.mo("klpn")), "B_KLBSL_PNMN") + expect_equal(as.character(as.mo("Klebsiella")), "B_KLBSL") + expect_equal(as.character(as.mo("K. pneumo rhino")), "B_KLBSL_PNMN_RHNS") # K. pneumoniae subspp. rhinoscleromatis + expect_equal(as.character(as.mo("Bartonella")), "B_BRTNL") + expect_equal(as.character(as.mo("C. difficile")), "B_CRDDS_DFFC") + expect_equal(as.character(as.mo("L. pneumophila")), "B_LGNLL_PNMP") + expect_equal(as.character(as.mo("Streptococcus")), "B_STRPT") # not Peptostreptoccus + expect_equal(as.character(as.mo("Estreptococos grupo B")), "B_STRPT_GRPB") + expect_equal(as.character(as.mo("Group B Streptococci")), "B_STRPT_GRPB") + + expect_equal(as.character(as.mo(c("GAS", "GBS", "haemoly strep"))), c("B_STRPT_GRPA", "B_STRPT_GRPB", "B_STRPT_HAEM")) + + + expect_equal(as.character(as.mo("S. pyo")), "B_STRPT_PYGN") # not Actinomyces pyogenes + + # GLIMS + expect_equal(as.character(as.mo("bctfgr")), "B_BCTRD_FRGL") + + expect_equal(as.character(as.mo("MRSE")), "B_STPHY_EPDR") + expect_equal(as.character(as.mo("VRE")), "B_ENTRC") + expect_equal(as.character(as.mo("MRPA")), "B_PSDMN_AERG") + expect_equal(as.character(as.mo("PISP")), "B_STRPT_PNMN") + expect_equal(as.character(as.mo("PRSP")), "B_STRPT_PNMN") + expect_equal(as.character(as.mo("VISP")), "B_STRPT_PNMN") + expect_equal(as.character(as.mo("VRSP")), "B_STRPT_PNMN") + + expect_equal(as.character(as.mo("CNS")), "B_STPHY_CONS") + expect_equal(as.character(as.mo("CoNS")), "B_STPHY_CONS") + expect_equal(as.character(as.mo("CPS")), "B_STPHY_COPS") + expect_equal(as.character(as.mo("CoPS")), "B_STPHY_COPS") + expect_equal(as.character(as.mo("VGS")), "B_STRPT_VIRI") + expect_equal(as.character(as.mo("streptococcus milleri")), "B_STRPT_MILL") + + + expect_equal(as.character(as.mo(c("Gram negative", "Gram positive"))), c("B_GRAMN", "B_GRAMP")) + + # expect_warning(as.mo("Acinetobacter calcoaceticus/baumannii complex")) + + # prevalent MO + expect_identical( + suppressWarnings(as.character( + as.mo(c( + "stau", # WHONET code + "STAU", + "staaur", + "S. aureus", + "S aureus", + "Sthafilokkockus aureus", # handles incorrect spelling + "Staphylococcus aureus (MRSA)", + "MRSA", # Methicillin Resistant S. aureus + "VISA", # Vancomycin Intermediate S. aureus + "VRSA", # Vancomycin Resistant S. aureus + 115329001 # SNOMED CT code + )) + )), + rep("B_STPHY_AURS", 11) + ) + expect_identical( + as.character( + as.mo(c("EHEC", "EPEC", "EIEC", "STEC", "ATEC", "UPEC")) + ), + rep("B_ESCHR_COLI", 6) + ) + # unprevalent MO + expect_identical( + as.character( + as.mo(c( + "parnod", + "Paraburkholderia nodosa" + )) + ), + rep("B_PRBRK_NODS", 2) + ) + + # empty values + expect_identical(as.character(as.mo(c("", " ", NA, NaN))), rep(NA_character_, 4)) + expect_identical(as.character(as.mo(" ")), NA_character_) + # too few characters + # expect_warning(as.mo("ab")) + + expect_identical( + suppressWarnings(as.character(as.mo(c("Qq species", "MRSA", "K. pneu rhino", "esco")))), + c("UNKNOWN", "B_STPHY_AURS", "B_KLBSL_PNMN_RHNS", "B_ESCHR_COLI") + ) + + # check for Becker classification + expect_identical(as.character(as.mo("S. epidermidis", Becker = FALSE)), "B_STPHY_EPDR") + expect_identical(as.character(as.mo("S. epidermidis", Becker = TRUE)), "B_STPHY_CONS") + expect_identical(as.character(as.mo("STAEPI", Becker = TRUE)), "B_STPHY_CONS") + expect_identical(as.character(as.mo("Sta intermedius", Becker = FALSE)), "B_STPHY_INTR") + expect_identical(as.character(as.mo("Sta intermedius", Becker = TRUE)), "B_STPHY_COPS") + expect_identical(as.character(as.mo("STAINT", Becker = TRUE)), "B_STPHY_COPS") + # aureus must only be influenced if Becker = "all" + expect_identical(as.character(as.mo("STAAUR", Becker = FALSE)), "B_STPHY_AURS") + expect_identical(as.character(as.mo("STAAUR", Becker = TRUE)), "B_STPHY_AURS") + expect_identical(as.character(as.mo("STAAUR", Becker = "all")), "B_STPHY_COPS") + + # check for Lancefield classification + expect_identical(as.character(as.mo("S. pyogenes", Lancefield = FALSE)), "B_STRPT_PYGN") + expect_identical(as.character(as.mo("S. pyogenes", Lancefield = TRUE)), "B_STRPT_GRPA") + expect_identical(as.character(as.mo("STCPYO", Lancefield = TRUE)), "B_STRPT_GRPA") # group A + expect_identical(as.character(as.mo("S. agalactiae", Lancefield = FALSE)), "B_STRPT_AGLC") + expect_identical(as.character(as.mo("S. agalactiae", Lancefield = TRUE)), "B_STRPT_GRPB") # group B + expect_identical(as.character(suppressWarnings(as.mo("estreptococos grupo B"))), "B_STRPT_GRPB") + expect_identical(as.character(as.mo("S. equi", Lancefield = FALSE)), "B_STRPT_EQUI") + expect_identical(as.character(as.mo("S. equi", Lancefield = TRUE)), "B_STRPT_GRPC") # group C + # Enterococci must only be influenced if Lancefield = "all" + expect_identical(as.character(as.mo("E. faecium", Lancefield = FALSE)), "B_ENTRC_FACM") + expect_identical(as.character(as.mo("E. faecium", Lancefield = TRUE)), "B_ENTRC_FACM") + expect_identical(as.character(as.mo("E. faecium", Lancefield = "all")), "B_STRPT_GRPD") # group D + expect_identical(as.character(as.mo("S. anginosus", Lancefield = FALSE)), "B_STRPT_ANGN") + expect_identical(as.character(as.mo("S. anginosus", Lancefield = TRUE)), "B_STRPT_GRPF") # group F + expect_identical(as.character(as.mo("S. sanguinis", Lancefield = FALSE)), "B_STRPT_SNGN") + expect_identical(as.character(as.mo("S. sanguinis", Lancefield = TRUE)), "B_STRPT_GRPH") # group H + expect_identical(as.character(as.mo("S. salivarius", Lancefield = FALSE)), "B_STRPT_SLVR") + expect_identical(as.character(as.mo("S. salivarius", Lancefield = TRUE)), "B_STRPT_GRPK") # group K + + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + # select with one column + expect_identical( + example_isolates %>% + slice(1:10) %>% + left_join_microorganisms() %>% + select(genus) %>% + as.mo() %>% + as.character(), + c( + "B_ESCHR", "B_ESCHR", "B_STPHY", "B_STPHY", "B_STPHY", + "B_STPHY", "B_STPHY", "B_STPHY", "B_STPHY", "B_STPHY" + ) ) - ) - # select with two columns - expect_identical( - example_isolates %>% - slice(1:10) %>% - pull(mo), - example_isolates %>% - slice(1:10) %>% - left_join_microorganisms() %>% - select(genus, species) %>% - as.mo() - ) + # select with two columns + expect_identical( + example_isolates %>% + slice(1:10) %>% + pull(mo), + example_isolates %>% + slice(1:10) %>% + left_join_microorganisms() %>% + select(genus, species) %>% + as.mo() + ) - # too many columns - expect_error(example_isolates %>% select(1:3) %>% as.mo()) + # too many columns + expect_error(example_isolates %>% select(1:3) %>% as.mo()) - # test pull + # test pull + expect_equal( + nrow(example_isolates %>% mutate(mo = as.mo(mo))), + 2000 + ) + expect_true(example_isolates %>% pull(mo) %>% is.mo()) + } + + # print + expect_output(print(as.mo(c("B_ESCHR_COLI", NA)))) + + # test data.frame expect_equal( - nrow(example_isolates %>% mutate(mo = as.mo(mo))), - 2000 + nrow(data.frame(test = as.mo("B_ESCHR_COLI"))), + 1 ) - expect_true(example_isolates %>% pull(mo) %>% is.mo()) -} -# print -expect_stdout(print(as.mo(c("B_ESCHR_COLI", NA)))) + # check empty values + expect_equal( + as.character(as.mo("")), + NA_character_ + ) -# test data.frame -expect_equal( - nrow(data.frame(test = as.mo("B_ESCHR_COLI"))), - 1 -) + # check less prevalent MOs + expect_equal(as.character(as.mo("Actinosynnema pretiosum auranticum")), "B_ANNMA_PRTS_ARNT") + # expect_equal(as.character(as.mo("Actinosynnema preti aura")), "B_ANNMA_PRTS_ARNT") + # expect_equal(as.character(as.mo("A pre aur")), "B_ANNMA_PRTS_ARNT") + expect_equal(as.character(as.mo("Actinosynnema pretiosum")), "B_ANNMA_PRTS") + expect_equal(as.character(as.mo("Actinosynnema")), "B_ANNMA") + expect_equal(as.character(as.mo(" B_ANNMA_PRTS ")), "B_ANNMA_PRTS") -# check empty values -expect_equal( - as.character(as.mo("")), - NA_character_ -) + # check old names + expect_equal(suppressMessages(as.character(as.mo("Escherichia blattae"))), "B_SHMWL_BLTT") + expect_equal(suppressMessages(as.character(as.mo(c("E. coli", "Chlamydo psittaci")))), c("B_ESCHR_COLI", "B_CHLMY_PSTT")) + expect_equal(suppressMessages(mo_name("eubcom")), "Clostridium combesii") -# check less prevalent MOs -expect_equal(as.character(as.mo("Actinosynnema pretiosum auranticum")), "B_ANNMA_PRTS_ARNT") -# expect_equal(as.character(as.mo("Actinosynnema preti aura")), "B_ANNMA_PRTS_ARNT") -# expect_equal(as.character(as.mo("A pre aur")), "B_ANNMA_PRTS_ARNT") -expect_equal(as.character(as.mo("Actinosynnema pretiosum")), "B_ANNMA_PRTS") -expect_equal(as.character(as.mo("Actinosynnema")), "B_ANNMA") -expect_equal(as.character(as.mo(" B_ANNMA_PRTS ")), "B_ANNMA_PRTS") + # predefined reference_df + expect_equal( + as.character(as.mo("TestingOwnID", + reference_df = data.frame(mycol = "TestingOwnID", mo = "B_ESCHR_COLI") + )), + "B_ESCHR_COLI" + ) + expect_equal( + as.character(as.mo(c("TestingOwnID", "E. coli"), + reference_df = data.frame(mycol = "TestingOwnID", mo = "B_ESCHR_COLI") + )), + c("B_ESCHR_COLI", "B_ESCHR_COLI") + ) + # # expect_warning(as.mo("TestingOwnID", reference_df = NULL)) + expect_error(as.mo("E. coli", reference_df = data.frame(mycol = "TestingOwnID"))) -# check old names -expect_equal(suppressMessages(as.character(as.mo("Escherichia blattae"))), "B_SHMWL_BLTT") -expect_equal(suppressMessages(as.character(as.mo(c("E. coli", "Chlamydo psittaci")))), c("B_ESCHR_COLI", "B_CHLMY_PSTT")) -expect_equal(suppressMessages(mo_name("eubcom")), "Clostridium combesii") + # combination of existing mo and other code + expect_identical( + suppressWarnings(as.character(as.mo(c("B_ESCHR_COL", "ESCCOL")))), + c("B_ESCHR_COLI", "B_ESCHR_COLI") + ) -# predefined reference_df -expect_equal( - as.character(as.mo("TestingOwnID", - reference_df = data.frame(mycol = "TestingOwnID", mo = "B_ESCHR_COLI") - )), - "B_ESCHR_COLI" -) -expect_equal( - as.character(as.mo(c("TestingOwnID", "E. coli"), - reference_df = data.frame(mycol = "TestingOwnID", mo = "B_ESCHR_COLI") - )), - c("B_ESCHR_COLI", "B_ESCHR_COLI") -) -# # expect_warning(as.mo("TestingOwnID", reference_df = NULL)) -expect_error(as.mo("E. coli", reference_df = data.frame(mycol = "TestingOwnID"))) + # from different sources + expect_equal( + as.character(as.mo( + c("PRTMIR", "bclcer", "B_ESCHR_COLI") + )), + c("B_PROTS_MRBL", "B_BCLLS_CERS", "B_ESCHR_COLI") + ) -# combination of existing mo and other code -expect_identical( - suppressWarnings(as.character(as.mo(c("B_ESCHR_COL", "ESCCOL")))), - c("B_ESCHR_COLI", "B_ESCHR_COLI") -) + # hard to find + expect_equal( + as.character(suppressMessages(as.mo( + c( + "Microbacterium paraoxidans", + "Streptococcus suis (bovis gr)", + "Raoultella (here some text) terrigena" + ) + ))), + c("B_MCRBC_PRXY", "B_STRPT_SUIS", "B_KLBSL_TRRG") + ) + expect_output(print(mo_uncertainties())) + x <- as.mo("Sta. aur") + # many hits + expect_output(print(mo_uncertainties())) -# from different sources -expect_equal( - as.character(as.mo( - c("PRTMIR", "bclcer", "B_ESCHR_COLI") - )), - c("B_PROTS_MRBL", "B_BCLLS_CERS", "B_ESCHR_COLI") -) + # no viruses + expect_equal(suppressWarnings(as.mo("Virus")), as.mo("UNKNOWN")) -# hard to find -expect_equal( - as.character(suppressMessages(as.mo( - c( - "Microbacterium paraoxidans", - "Streptococcus suis (bovis gr)", - "Raoultella (here some text) terrigena" - ) - ))), - c("B_MCRBC_PRXY", "B_STRPT_SUIS", "B_KLBSL_TRRG") -) -expect_stdout(print(mo_uncertainties())) -x <- as.mo("Sta. aur") -# many hits -expect_stdout(print(mo_uncertainties())) + # summary + expect_equal(length(summary(example_isolates$mo)), 6) -# no viruses -expect_equal(suppressWarnings(as.mo("Virus")), as.mo("UNKNOWN")) + # WHONET codes and NA/NaN + expect_true(all(is.na(as.mo(c("xxx", "na", "nan"))))) + expect_equal(as.character(as.mo(c("con", "eco"))), c("UNKNOWN", "B_ESCHR_COLI")) + expect_equal( + as.character(suppressWarnings(as.mo(c("other", "none", "unknown")))), + rep("UNKNOWN", 3) + ) -# summary -expect_equal(length(summary(example_isolates$mo)), 6) + # ..coccus + expect_equal( + as.character(as.mo(c("meningococ", "gonococ", "pneumococ"))), + c("B_NESSR_MNNG", "B_NESSR_GNRR", "B_STRPT_PNMN") + ) + # yeasts and fungi + expect_equal( + suppressWarnings(as.character(as.mo(c("yeasts", "fungi")))), + c("F_YEAST", "F_FUNGUS") + ) -# WHONET codes and NA/NaN -expect_true(all(is.na(as.mo(c("xxx", "na", "nan"))))) -expect_equal(as.character(as.mo(c("con", "eco"))), c("UNKNOWN", "B_ESCHR_COLI")) -expect_equal( - as.character(suppressWarnings(as.mo(c("other", "none", "unknown")))), - rep("UNKNOWN", 3) -) + if (AMR:::pkg_is_available("tibble")) { + # print tibble + expect_output(print(tibble::tibble(mo = as.mo("B_ESCHR_COLI")))) + } -# ..coccus -expect_equal( - as.character(as.mo(c("meningococ", "gonococ", "pneumococ"))), - c("B_NESSR_MNNG", "B_NESSR_GNRR", "B_STRPT_PNMN") -) -# yeasts and fungi -expect_equal( - suppressWarnings(as.character(as.mo(c("yeasts", "fungi")))), - c("F_YEAST", "F_FUNGUS") -) + # assigning and subsetting + x <- example_isolates$mo + expect_inherits(x[1], "mo") + expect_inherits(x[[1]], "mo") + expect_inherits(c(x[1], x[9]), "mo") + # expect_warning(x[1] <- "invalid code") + # expect_warning(x[[1]] <- "invalid code") + # expect_warning(c(x[1], "test")) -if (AMR:::pkg_is_available("tibble")) { - # print tibble - expect_stdout(print(tibble::tibble(mo = as.mo("B_ESCHR_COLI")))) -} + # ignoring patterns + expect_true(is.na(as.mo("E. coli ignorethis", ignore_pattern = "this"))) -# assigning and subsetting -x <- example_isolates$mo -expect_inherits(x[1], "mo") -expect_inherits(x[[1]], "mo") -expect_inherits(c(x[1], x[9]), "mo") -# expect_warning(x[1] <- "invalid code") -# expect_warning(x[[1]] <- "invalid code") -# expect_warning(c(x[1], "test")) - -# ignoring patterns -expect_true(is.na(as.mo("E. coli ignorethis", ignore_pattern = "this"))) - -# frequency tables -if (AMR:::pkg_is_available("cleaner")) { - expect_inherits(cleaner::freq(example_isolates$mo), "freq") -} + # frequency tables + if (AMR:::pkg_is_available("cleaner")) { + expect_inherits(cleaner::freq(example_isolates$mo), "freq") + } +}) diff --git a/tests/testthat/test-mo_property.R b/tests/testthat/test-mo_property.R index a32aa56c2..9c0490696 100644 --- a/tests/testthat/test-mo_property.R +++ b/tests/testthat/test-mo_property.R @@ -27,212 +27,214 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_equal(mo_kingdom("Escherichia coli"), "Bacteria") -expect_equal(mo_kingdom("Escherichia coli"), mo_domain("Escherichia coli")) -expect_equal(mo_phylum("Escherichia coli"), "Pseudomonadota") -expect_equal(mo_class("Escherichia coli"), "Gammaproteobacteria") -expect_equal(mo_order("Escherichia coli"), "Enterobacterales") -expect_equal(mo_family("Escherichia coli"), "Enterobacteriaceae") -expect_equal(mo_fullname("Escherichia coli"), "Escherichia coli") -expect_equal(mo_genus("Escherichia coli"), "Escherichia") -expect_equal(mo_name("Escherichia coli"), "Escherichia coli") -expect_equal(mo_shortname("Escherichia coli"), "E. coli") -expect_equal(mo_shortname("Escherichia"), "Escherichia") -expect_equal(mo_shortname("Staphylococcus aureus"), "S. aureus") -expect_equal(mo_shortname("Staphylococcus aureus", Becker = TRUE), "S. aureus") -expect_equal(mo_shortname("Staphylococcus aureus", Becker = "all", language = "en"), "CoPS") -expect_equal(mo_shortname("Streptococcus agalactiae"), "S. agalactiae") -expect_equal(mo_shortname("Streptococcus agalactiae", Lancefield = TRUE), "GBS") +test_that("mo_property works", { + expect_equal(mo_kingdom("Escherichia coli"), "Bacteria") + expect_equal(mo_kingdom("Escherichia coli"), mo_domain("Escherichia coli")) + expect_equal(mo_phylum("Escherichia coli"), "Pseudomonadota") + expect_equal(mo_class("Escherichia coli"), "Gammaproteobacteria") + expect_equal(mo_order("Escherichia coli"), "Enterobacterales") + expect_equal(mo_family("Escherichia coli"), "Enterobacteriaceae") + expect_equal(mo_fullname("Escherichia coli"), "Escherichia coli") + expect_equal(mo_genus("Escherichia coli"), "Escherichia") + expect_equal(mo_name("Escherichia coli"), "Escherichia coli") + expect_equal(mo_shortname("Escherichia coli"), "E. coli") + expect_equal(mo_shortname("Escherichia"), "Escherichia") + expect_equal(mo_shortname("Staphylococcus aureus"), "S. aureus") + expect_equal(mo_shortname("Staphylococcus aureus", Becker = TRUE), "S. aureus") + expect_equal(mo_shortname("Staphylococcus aureus", Becker = "all", language = "en"), "CoPS") + expect_equal(mo_shortname("Streptococcus agalactiae"), "S. agalactiae") + expect_equal(mo_shortname("Streptococcus agalactiae", Lancefield = TRUE), "GBS") -# check gram stain determination, to prevent we lag after a taxonomic renaming -current_grampos_phyla <- c( - "Actinomycetota", # since 2021, old name was Actinobacteria - "Chloroflexota", # since 2021, old name was Chloroflexi - "Bacillota", # since 2021, old name was Firmicutes - "Mycoplasmatota" # since 2021, old name was Tenericutes -) -expect_true(all(current_grampos_phyla %in% microorganisms$phylum, na.rm = TRUE)) -current_grampos_classes <- c( - "", - "Acidimicrobiia", - "Actinomycetes", - "Anaerolineae", - "Ardenticatenia", - "Bacilli", - "Caldilineae", - "Chloroflexia", - "Clostridia", - "Coriobacteriia", - "Culicoidibacteria", - "Dehalococcoidia", - "Erysipelotrichia", - "Ktedonobacteria", - "Limnochordia", - "Limnocylindria", - "Mollicutes", - "Negativicutes", - "Nitriliruptoria", - "Rubrobacteria", - "Tepidiformia", - "Thermoflexia", - "Thermoleophilia", - "Thermolithobacteria" -) -expect_identical( - sort(unique(microorganisms[which(microorganisms$phylum %in% current_grampos_phyla), "class", drop = TRUE])), - current_grampos_classes -) - -expect_equal(mo_species("Escherichia coli"), "coli") -expect_equal(mo_subspecies("Escherichia coli"), "") -expect_equal(mo_type("Escherichia coli", language = "en"), "Bacteria") -expect_equal(mo_gramstain("Escherichia coli", language = "en"), "Gram-negative") -expect_inherits(mo_taxonomy("Escherichia coli"), "list") -expect_equal(names(mo_taxonomy("Escherichia coli")), c( - "kingdom", "phylum", "class", "order", - "family", "genus", "species", "subspecies" -)) -expect_equal(mo_synonyms("Escherichia coli"), NULL) -expect_true(length(mo_synonyms("Candida albicans")) > 1) -expect_inherits(mo_synonyms(c("Candida albicans", "Escherichia coli")), "list") -expect_equal(names(mo_info("Escherichia coli")), c( - "mo", "rank", - "kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies", - "status", "synonyms", "gramstain", "oxygen_tolerance", - "url", "ref", "snomed", "lpsn", "mycobank", "gbif", "group_members" -)) -expect_inherits(mo_info(c("Escherichia coli", "Staphylococcus aureus")), "list") -expect_true(length(mo_group_members("B_HACEK")) > 1) -expect_inherits(mo_group_members(c("Candida albicans", "Escherichia coli")), "list") - -expect_identical( - mo_oxygen_tolerance(c("Klebsiella pneumoniae", "Clostridioides difficile")), - c("facultative anaerobe", "anaerobe") -) - -expect_equal( - as.character(table(mo_pathogenicity(example_isolates$mo))), - c("1911", "72", "1", "16") -) - -expect_equal(mo_ref("Escherichia coli"), "Castellani et al., 1919") -expect_equal(mo_authors("Escherichia coli"), "Castellani et al.") -expect_equal(mo_year("Escherichia coli"), 1919) - -expect_true(mo_url("Amoeba dysenteriae") %like% "gbif.org") -expect_true(mo_url("Candida albicans") %like% "mycobank.org") -expect_true(mo_url("Escherichia coli") %like% "lpsn.dsmz.de") - -# test integrity of getting back full names -expect_identical( - microorganisms$fullname[microorganisms$fullname %unlike% "(Fungi|{)"], - suppressWarnings(mo_fullname(microorganisms$fullname[microorganisms$fullname %unlike% "(Fungi|{)"], language = "en", keep_synonyms = TRUE)) -) - -# check languages -expect_equal(mo_type("Escherichia coli", language = "de"), "Bakterien") -expect_equal(mo_gramstain("Escherichia coli", language = "nl"), "Gram-negatief") - -gr <- mo_gramstain("Escherichia coli", language = NULL) -for (l in AMR:::LANGUAGES_SUPPORTED[-1]) { - expect_false(mo_gramstain("Escherichia coli", language = l) == gr, info = paste("Gram-stain in language", l)) -} - -# test languages -expect_error(mo_gramstain("Escherichia coli", language = "UNKNOWN")) -fullnames <- microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi|[(]class[)]|[{]")] -to_dutch <- suppressWarnings(mo_name(fullnames, language = "nl", keep_synonyms = TRUE)) -back_to_english <- suppressWarnings(mo_name(to_dutch, language = NULL, keep_synonyms = TRUE)) -diffs <- paste0('"', fullnames[fullnames != back_to_english], '"', collapse = ", ") -expect_identical(fullnames, back_to_english, info = diffs) # gigantic test - will run ALL names - - -# manual property function -expect_error(mo_property("Escherichia coli", property = c("genus", "fullname"))) -expect_error(mo_property("Escherichia coli", property = "UNKNOWN")) -expect_identical( - mo_property("Escherichia coli", property = "fullname"), - mo_fullname("Escherichia coli") -) -expect_identical( - mo_property("Escherichia coli", property = "genus"), - mo_genus("Escherichia coli") -) -expect_identical( - mo_property("Escherichia coli", property = "species"), - mo_species("Escherichia coli") -) -expect_identical( - mo_property("Escherichia coli", property = "lpsn"), - mo_lpsn("Escherichia coli") -) -expect_identical( - mo_property("Escherichia coli", property = "gbif"), - mo_gbif("Escherichia coli") -) -expect_identical( - mo_property("Absidia abundans", property = "mycobank"), - mo_mycobank("Absidia abundans") -) - -expect_true("Escherichia blattae" %in% mo_synonyms("Shimwellia blattae")) -expect_true(is.list(mo_synonyms(rep("Shimwellia blattae", 2)))) -expect_identical( - mo_current(c("Escherichia blattae", "Escherichia coli")), - c("Shimwellia blattae", "Escherichia coli") -) - -expect_identical(mo_ref("Chlamydia psittaci"), "Garcia-Lopez et al., 2019") -expect_identical(mo_ref("Chlamydophila psittaci", keep_synonyms = TRUE), "Everett et al., 1999") - -expect_true(112283007 %in% mo_snomed("Escherichia coli")[[1]]) -# outcome of mo_fullname must always return the fullname from the data set -x <- data.frame( - mo = microorganisms$mo, - # fullname from the original data: - f1 = microorganisms$fullname, - # newly created fullname based on MO code: - f2 = mo_fullname(microorganisms$mo, language = "en", keep_synonyms = TRUE), - stringsAsFactors = FALSE -) -expect_equal(nrow(subset(x, f1 != f2)), 0) -# is gram pos/neg (also return FALSE for all non-bacteria) -expect_equal( - mo_is_gram_negative(c("Escherichia coli", "Staphylococcus aureus", "Candida albicans")), - c(TRUE, FALSE, FALSE) -) -expect_equal( - mo_is_gram_positive(c("Escherichia coli", "Staphylococcus aureus", "Candida albicans")), - c(FALSE, TRUE, FALSE) -) -expect_equal( - mo_is_yeast(c("Candida", "Trichophyton", "Klebsiella")), - c(TRUE, FALSE, FALSE) -) -# is intrinsic resistant -expect_equal( - mo_is_intrinsic_resistant( - c("Escherichia coli", "Staphylococcus aureus", "Candida albicans"), - "vanco" - ), - c(TRUE, FALSE, FALSE) -) -# with reference data -expect_equal( - mo_name("test", reference_df = data.frame(col1 = "test", mo = "B_ESCHR_COLI")), - "Escherichia coli" -) -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_equal(example_isolates %>% filter(mo_is_gram_negative()) %>% nrow(), - 730, - tolerance = 0.5 + # check gram stain determination, to prevent we lag after a taxonomic renaming + current_grampos_phyla <- c( + "Actinomycetota", # since 2021, old name was Actinobacteria + "Chloroflexota", # since 2021, old name was Chloroflexi + "Bacillota", # since 2021, old name was Firmicutes + "Mycoplasmatota" # since 2021, old name was Tenericutes ) - expect_equal(example_isolates %>% filter(mo_is_gram_positive()) %>% nrow(), - 1238, - tolerance = 0.5 + expect_true(all(current_grampos_phyla %in% microorganisms$phylum, na.rm = TRUE)) + current_grampos_classes <- c( + "", + "Acidimicrobiia", + "Actinomycetes", + "Anaerolineae", + "Ardenticatenia", + "Bacilli", + "Caldilineae", + "Chloroflexia", + "Clostridia", + "Coriobacteriia", + "Culicoidibacteria", + "Dehalococcoidia", + "Erysipelotrichia", + "Ktedonobacteria", + "Limnochordia", + "Limnocylindria", + "Mollicutes", + "Negativicutes", + "Nitriliruptoria", + "Rubrobacteria", + "Tepidiformia", + "Thermoflexia", + "Thermoleophilia", + "Thermolithobacteria" ) - expect_equal(example_isolates %>% filter(mo_is_intrinsic_resistant(ab = "Vancomycin")) %>% nrow(), - 710, - tolerance = 0.5 + expect_identical( + sort(unique(microorganisms[which(microorganisms$phylum %in% current_grampos_phyla), "class", drop = TRUE])), + current_grampos_classes ) -} + + expect_equal(mo_species("Escherichia coli"), "coli") + expect_equal(mo_subspecies("Escherichia coli"), "") + expect_equal(mo_type("Escherichia coli", language = "en"), "Bacteria") + expect_equal(mo_gramstain("Escherichia coli", language = "en"), "Gram-negative") + expect_inherits(mo_taxonomy("Escherichia coli"), "list") + expect_equal(names(mo_taxonomy("Escherichia coli")), c( + "kingdom", "phylum", "class", "order", + "family", "genus", "species", "subspecies" + )) + expect_equal(mo_synonyms("Escherichia coli"), NULL) + expect_true(length(mo_synonyms("Candida albicans")) > 1) + expect_inherits(mo_synonyms(c("Candida albicans", "Escherichia coli")), "list") + expect_equal(names(mo_info("Escherichia coli")), c( + "mo", "rank", + "kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies", + "status", "synonyms", "gramstain", "oxygen_tolerance", + "url", "ref", "snomed", "lpsn", "mycobank", "gbif", "group_members" + )) + expect_inherits(mo_info(c("Escherichia coli", "Staphylococcus aureus")), "list") + expect_true(length(mo_group_members("B_HACEK")) > 1) + expect_inherits(mo_group_members(c("Candida albicans", "Escherichia coli")), "list") + + expect_identical( + mo_oxygen_tolerance(c("Klebsiella pneumoniae", "Clostridioides difficile")), + c("facultative anaerobe", "anaerobe") + ) + + expect_equal( + as.character(table(mo_pathogenicity(example_isolates$mo))), + c("1911", "72", "1", "16") + ) + + expect_equal(mo_ref("Escherichia coli"), "Castellani et al., 1919") + expect_equal(mo_authors("Escherichia coli"), "Castellani et al.") + expect_equal(mo_year("Escherichia coli"), 1919) + + expect_true(mo_url("Amoeba dysenteriae") %like% "gbif.org") + expect_true(mo_url("Candida albicans") %like% "mycobank.org") + expect_true(mo_url("Escherichia coli") %like% "lpsn.dsmz.de") + + # test integrity of getting back full names + expect_identical( + microorganisms$fullname[microorganisms$fullname %unlike% "(Fungi|{)"], + suppressWarnings(mo_fullname(microorganisms$fullname[microorganisms$fullname %unlike% "(Fungi|{)"], language = "en", keep_synonyms = TRUE)) + ) + + # check languages + expect_equal(mo_type("Escherichia coli", language = "de"), "Bakterien") + expect_equal(mo_gramstain("Escherichia coli", language = "nl"), "Gram-negatief") + + gr <- mo_gramstain("Escherichia coli", language = NULL) + for (l in AMR:::LANGUAGES_SUPPORTED[-1]) { + expect_false(mo_gramstain("Escherichia coli", language = l) == gr, info = paste("Gram-stain in language", l)) + } + + # test languages + expect_error(mo_gramstain("Escherichia coli", language = "UNKNOWN")) + fullnames <- microorganisms$fullname[which(microorganisms$fullname %unlike% "unknown|coagulase|Fungi|[(]class[)]|[{]")] + to_dutch <- suppressWarnings(mo_name(fullnames, language = "nl", keep_synonyms = TRUE)) + back_to_english <- suppressWarnings(mo_name(to_dutch, language = NULL, keep_synonyms = TRUE)) + diffs <- paste0('"', fullnames[fullnames != back_to_english], '"', collapse = ", ") + expect_identical(fullnames, back_to_english, info = diffs) # gigantic test - will run ALL names + + + # manual property function + expect_error(mo_property("Escherichia coli", property = c("genus", "fullname"))) + expect_error(mo_property("Escherichia coli", property = "UNKNOWN")) + expect_identical( + mo_property("Escherichia coli", property = "fullname"), + mo_fullname("Escherichia coli") + ) + expect_identical( + mo_property("Escherichia coli", property = "genus"), + mo_genus("Escherichia coli") + ) + expect_identical( + mo_property("Escherichia coli", property = "species"), + mo_species("Escherichia coli") + ) + expect_identical( + mo_property("Escherichia coli", property = "lpsn"), + mo_lpsn("Escherichia coli") + ) + expect_identical( + mo_property("Escherichia coli", property = "gbif"), + mo_gbif("Escherichia coli") + ) + expect_identical( + mo_property("Absidia abundans", property = "mycobank"), + mo_mycobank("Absidia abundans") + ) + + expect_true("Escherichia blattae" %in% mo_synonyms("Shimwellia blattae")) + expect_true(is.list(mo_synonyms(rep("Shimwellia blattae", 2)))) + expect_identical( + mo_current(c("Escherichia blattae", "Escherichia coli")), + c("Shimwellia blattae", "Escherichia coli") + ) + + expect_identical(mo_ref("Chlamydia psittaci"), "Garcia-Lopez et al., 2019") + expect_identical(mo_ref("Chlamydophila psittaci", keep_synonyms = TRUE), "Everett et al., 1999") + + expect_true(112283007 %in% mo_snomed("Escherichia coli")[[1]]) + # outcome of mo_fullname must always return the fullname from the data set + x <- data.frame( + mo = microorganisms$mo, + # fullname from the original data: + f1 = microorganisms$fullname, + # newly created fullname based on MO code: + f2 = mo_fullname(microorganisms$mo, language = "en", keep_synonyms = TRUE), + stringsAsFactors = FALSE + ) + expect_equal(nrow(subset(x, f1 != f2)), 0) + # is gram pos/neg (also return FALSE for all non-bacteria) + expect_equal( + mo_is_gram_negative(c("Escherichia coli", "Staphylococcus aureus", "Candida albicans")), + c(TRUE, FALSE, FALSE) + ) + expect_equal( + mo_is_gram_positive(c("Escherichia coli", "Staphylococcus aureus", "Candida albicans")), + c(FALSE, TRUE, FALSE) + ) + expect_equal( + mo_is_yeast(c("Candida", "Trichophyton", "Klebsiella")), + c(TRUE, FALSE, FALSE) + ) + # is intrinsic resistant + expect_equal( + mo_is_intrinsic_resistant( + c("Escherichia coli", "Staphylococcus aureus", "Candida albicans"), + "vanco" + ), + c(TRUE, FALSE, FALSE) + ) + # with reference data + expect_equal( + mo_name("test", reference_df = data.frame(col1 = "test", mo = "B_ESCHR_COLI")), + "Escherichia coli" + ) + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_equal(example_isolates %>% filter(mo_is_gram_negative()) %>% nrow(), + 730, + tolerance = 0.5 + ) + expect_equal(example_isolates %>% filter(mo_is_gram_positive()) %>% nrow(), + 1238, + tolerance = 0.5 + ) + expect_equal(example_isolates %>% filter(mo_is_intrinsic_resistant(ab = "Vancomycin")) %>% nrow(), + 710, + tolerance = 0.5 + ) + } +}) diff --git a/tests/testthat/test-pca.R b/tests/testthat/test-pca.R index f0122cd0b..482caa450 100644 --- a/tests/testthat/test-pca.R +++ b/tests/testthat/test-pca.R @@ -27,51 +27,53 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -resistance_data <- structure( - list( - order = c("Bacillales", "Enterobacterales", "Enterobacterales"), - genus = c("Staphylococcus", "Escherichia", "Klebsiella"), - AMC = c(0.00425, 0.13062, 0.10344), - CXM = c(0.00425, 0.05376, 0.10344), - CTX = c(0.00000, 0.02396, 0.05172), - TOB = c(0.02325, 0.02597, 0.10344), - TMP = c(0.08387, 0.39141, 0.18367) - ), - class = c("grouped_df", "tbl_df", "tbl", "data.frame"), - row.names = c(NA, -3L), - groups = structure( +test_that("pca works", { + resistance_data <- structure( list( - order = c("Bacillales", "Enterobacterales"), - .rows = list(1L, 2:3) + order = c("Bacillales", "Enterobacterales", "Enterobacterales"), + genus = c("Staphylococcus", "Escherichia", "Klebsiella"), + AMC = c(0.00425, 0.13062, 0.10344), + CXM = c(0.00425, 0.05376, 0.10344), + CTX = c(0.00000, 0.02396, 0.05172), + TOB = c(0.02325, 0.02597, 0.10344), + TMP = c(0.08387, 0.39141, 0.18367) ), - row.names = c(NA, -2L), - class = c("tbl_df", "tbl", "data.frame"), - .drop = TRUE + class = c("grouped_df", "tbl_df", "tbl", "data.frame"), + row.names = c(NA, -3L), + groups = structure( + list( + order = c("Bacillales", "Enterobacterales"), + .rows = list(1L, 2:3) + ), + row.names = c(NA, -2L), + class = c("tbl_df", "tbl", "data.frame"), + .drop = TRUE + ) ) -) -pca_model <- pca(resistance_data) -expect_inherits(pca_model, "pca") + pca_model <- pca(resistance_data) + expect_inherits(pca_model, "pca") -pdf(NULL) # prevent Rplots.pdf being created - -if (AMR:::pkg_is_available("ggplot2")) { - ggplot_pca(pca_model, ellipse = TRUE) - ggplot_pca(pca_model, arrows_textangled = FALSE) -} - -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - resistance_data <- example_isolates %>% - group_by( - order = mo_order(mo), - genus = mo_genus(mo) - ) %>% - summarise_if(is.sir, resistance, minimum = 0) - pca_result <- resistance_data %>% - pca(AMC, CXM, CTX, CAZ, GEN, TOB, TMP, "SXT") - expect_inherits(pca_result, "prcomp") + pdf(NULL) # prevent Rplots.pdf being created if (AMR:::pkg_is_available("ggplot2")) { - ggplot_pca(pca_result, ellipse = TRUE) - ggplot_pca(pca_result, ellipse = FALSE, arrows_textangled = FALSE, scale = FALSE) + ggplot_pca(pca_model, ellipse = TRUE) + ggplot_pca(pca_model, arrows_textangled = FALSE) } -} + + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + resistance_data <- example_isolates %>% + group_by( + order = mo_order(mo), + genus = mo_genus(mo) + ) %>% + summarise_if(is.sir, resistance, minimum = 0) + pca_result <- resistance_data %>% + pca(AMC, CXM, CTX, CAZ, GEN, TOB, TMP, "SXT") + expect_inherits(pca_result, "prcomp") + + if (AMR:::pkg_is_available("ggplot2")) { + ggplot_pca(pca_result, ellipse = TRUE) + ggplot_pca(pca_result, ellipse = FALSE, arrows_textangled = FALSE, scale = FALSE) + } + } +}) diff --git a/tests/testthat/test-plotting.R b/tests/testthat/test-plotting.R index 668b0e42a..85fdb0101 100644 --- a/tests/testthat/test-plotting.R +++ b/tests/testthat/test-plotting.R @@ -27,88 +27,90 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -if (AMR:::pkg_is_available("ggplot2", also_load = TRUE)) { - pdf(NULL) # prevent Rplots.pdf being created +test_that("plotting works", { + if (AMR:::pkg_is_available("ggplot2", also_load = TRUE)) { + pdf(NULL) # prevent Rplots.pdf being created - # scale_*_mic - aesthetics <- c("x", "y", "colour", "fill") - expected_methods <- c("transform", "transform_df", "breaks", "labels", "limits") - for (aest in aesthetics) { - scale_fn_name <- paste0("scale_", aest, "_continuous") - scale_obj <- getExportedValue("ggplot2", scale_fn_name)() + # scale_*_mic + aesthetics <- c("x", "y", "colour", "fill") + expected_methods <- c("transform", "transform_df", "breaks", "labels", "limits") + for (aest in aesthetics) { + scale_fn_name <- paste0("scale_", aest, "_continuous") + scale_obj <- getExportedValue("ggplot2", scale_fn_name)() + for (method in expected_methods) { + expect_true(is.function(scale_obj[[method]]) || method %in% names(scale_obj), + info = paste0("Method '", method, "' is missing in ggplot2::", scale_fn_name) + ) + } + } + + # scale_*_sir + aesthetics <- c("colour", "fill") + expected_methods <- c("transform", "transform_df", "labels", "limits") + for (aest in aesthetics) { + scale_fn_name <- "scale_discrete_manual" + scale_obj <- getExportedValue("ggplot2", scale_fn_name)(aesthetics = aest) + for (method in expected_methods) { + expect_true(is.function(scale_obj[[method]]) || method %in% names(scale_obj), + info = paste0("Method '", method, "' is missing in ggplot2::", scale_fn_name) + ) + } + } for (method in expected_methods) { - expect_true(is.function(scale_obj[[method]]) || method %in% names(scale_obj), - info = paste0("Method '", method, "' is missing in ggplot2::", scale_fn_name) + expect_true(is.function(ggplot2::scale_x_discrete()[[method]]) || method %in% names(ggplot2::scale_x_discrete()), + info = paste0("Method '", method, "' is missing in ggplot2::", "scale_x_discrete") ) } - } - # scale_*_sir - aesthetics <- c("colour", "fill") - expected_methods <- c("transform", "transform_df", "labels", "limits") - for (aest in aesthetics) { - scale_fn_name <- "scale_discrete_manual" - scale_obj <- getExportedValue("ggplot2", scale_fn_name)(aesthetics = aest) - for (method in expected_methods) { - expect_true(is.function(scale_obj[[method]]) || method %in% names(scale_obj), - info = paste0("Method '", method, "' is missing in ggplot2::", scale_fn_name) - ) - } - } - for (method in expected_methods) { - expect_true(is.function(ggplot2::scale_x_discrete()[[method]]) || method %in% names(ggplot2::scale_x_discrete()), - info = paste0("Method '", method, "' is missing in ggplot2::", "scale_x_discrete") + expect_inherits( + ggplot( + data.frame( + count = c(1, 2, 3, 4), + sir = c("S", "I", "R", "SDD") + ), + aes(x = sir, y = count, fill = sir) + ) + + geom_col() + + scale_x_sir(eucast_I = F, language = "el") + + scale_fill_sir(eucast_I = T, language = "nl"), + "gg" + ) + expect_inherits( + ggplot( + data.frame( + mic = as.mic(c(2, 4, 8, 16)), + sir = as.sir(c("S", "I", "R", "SDD")) + ), + aes(x = sir, y = mic) + ) + + geom_point() + + scale_y_mic(), + "gg" + ) + expect_inherits( + ggplot( + data.frame( + mic = as.mic(c(2, 4, 8, 16)), + sir = as.sir(c("S", "I", "R", "SDD")) + ), + aes(x = sir, y = mic) + ) + + geom_col() + + scale_y_mic(), + "gg" + ) + expect_inherits( + ggplot( + data.frame( + mic = as.mic(c(2, 4, 8, 16)), + sir = as.sir(c("S", "I", "R", "SDD")) + ), + aes(x = sir, y = mic) + ) + + geom_col() + + scale_y_mic(mic_range = c(4, 16)) + + scale_x_sir(), + "gg" ) } - - expect_inherits( - ggplot( - data.frame( - count = c(1, 2, 3, 4), - sir = c("S", "I", "R", "SDD") - ), - aes(x = sir, y = count, fill = sir) - ) + - geom_col() + - scale_x_sir(eucast_I = F, language = "el") + - scale_fill_sir(eucast_I = T, language = "nl"), - "gg" - ) - expect_inherits( - ggplot( - data.frame( - mic = as.mic(c(2, 4, 8, 16)), - sir = as.sir(c("S", "I", "R", "SDD")) - ), - aes(x = sir, y = mic) - ) + - geom_point() + - scale_y_mic(), - "gg" - ) - expect_inherits( - ggplot( - data.frame( - mic = as.mic(c(2, 4, 8, 16)), - sir = as.sir(c("S", "I", "R", "SDD")) - ), - aes(x = sir, y = mic) - ) + - geom_col() + - scale_y_mic(), - "gg" - ) - expect_inherits( - ggplot( - data.frame( - mic = as.mic(c(2, 4, 8, 16)), - sir = as.sir(c("S", "I", "R", "SDD")) - ), - aes(x = sir, y = mic) - ) + - geom_col() + - scale_y_mic(mic_range = c(4, 16)) + - scale_x_sir(), - "gg" - ) -} +}) diff --git a/tests/testthat/test-proportion.R b/tests/testthat/test-proportion.R index 79efe463c..d67da1e2b 100755 --- a/tests/testthat/test-proportion.R +++ b/tests/testthat/test-proportion.R @@ -27,131 +27,133 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_equal(proportion_R(example_isolates$AMX), resistance(example_isolates$AMX)) -expect_equal(proportion_SI(example_isolates$AMX), susceptibility(example_isolates$AMX)) -# AMX resistance in `example_isolates` -expect_equal(proportion_R(example_isolates$AMX), 0.5955556, tolerance = 0.0001) -expect_equal(proportion_I(example_isolates$AMX), 0.002222222, tolerance = 0.0001) -expect_equal(sir_confidence_interval(example_isolates$AMX)[1], 0.5688204, tolerance = 0.0001) -expect_equal(sir_confidence_interval(example_isolates$AMX)[2], 0.6218738, tolerance = 0.0001) -expect_equal( - 1 - proportion_R(example_isolates$AMX) - proportion_I(example_isolates$AMX), - proportion_S(example_isolates$AMX) -) -expect_equal( - proportion_R(example_isolates$AMX) + proportion_I(example_isolates$AMX), - proportion_IR(example_isolates$AMX) -) -expect_equal( - proportion_S(example_isolates$AMX) + proportion_I(example_isolates$AMX), - proportion_SI(example_isolates$AMX) -) - -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_equal(example_isolates %>% proportion_SI(AMC), - 0.7626397, - tolerance = 0.0001 - ) - expect_equal(example_isolates %>% proportion_SI(AMC, GEN), - 0.9408, - tolerance = 0.0001 - ) - expect_equal(example_isolates %>% proportion_SI(AMC, GEN, only_all_tested = TRUE), - 0.9382647, - tolerance = 0.0001 - ) - - # percentages +test_that("proportion works", { + expect_equal(proportion_R(example_isolates$AMX), resistance(example_isolates$AMX)) + expect_equal(proportion_SI(example_isolates$AMX), susceptibility(example_isolates$AMX)) + # AMX resistance in `example_isolates` + expect_equal(proportion_R(example_isolates$AMX), 0.5955556, tolerance = 0.0001) + expect_equal(proportion_I(example_isolates$AMX), 0.002222222, tolerance = 0.0001) + expect_equal(sir_confidence_interval(example_isolates$AMX)[1], 0.5688204, tolerance = 0.0001) + expect_equal(sir_confidence_interval(example_isolates$AMX)[2], 0.6218738, tolerance = 0.0001) expect_equal( - example_isolates %>% - group_by(ward) %>% - summarise( - R = proportion_R(CIP, as_percent = TRUE), - I = proportion_I(CIP, as_percent = TRUE), - S = proportion_S(CIP, as_percent = TRUE), - n = n_sir(CIP), - total = n() - ) %>% - pull(n) %>% - sum(), - 1409 + 1 - proportion_R(example_isolates$AMX) - proportion_I(example_isolates$AMX), + proportion_S(example_isolates$AMX) + ) + expect_equal( + proportion_R(example_isolates$AMX) + proportion_I(example_isolates$AMX), + proportion_IR(example_isolates$AMX) + ) + expect_equal( + proportion_S(example_isolates$AMX) + proportion_I(example_isolates$AMX), + proportion_SI(example_isolates$AMX) ) - # count of cases - expect_equal( - example_isolates %>% - group_by(ward) %>% - summarise( - cipro_p = proportion_SI(CIP, as_percent = TRUE), - cipro_n = n_sir(CIP), - genta_p = proportion_SI(GEN, as_percent = TRUE), - genta_n = n_sir(GEN), - combination_p = proportion_SI(CIP, GEN, as_percent = TRUE), - combination_n = n_sir(CIP, GEN) - ) %>% - pull(combination_n), - c(1181, 577, 116) - ) - - # proportion_df - expect_equal( - example_isolates %>% select(AMX) %>% proportion_df() %>% pull(value), - c( - example_isolates$AMX %>% proportion_SI(), - example_isolates$AMX %>% proportion_R() + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_equal(example_isolates %>% proportion_SI(AMC), + 0.7626397, + tolerance = 0.0001 ) - ) - expect_equal( - example_isolates %>% select(AMX) %>% proportion_df(combine_SI = FALSE) %>% pull(value), - c( - example_isolates$AMX %>% proportion_S(), - example_isolates$AMX %>% proportion_I(), - example_isolates$AMX %>% proportion_R() + expect_equal(example_isolates %>% proportion_SI(AMC, GEN), + 0.9408, + tolerance = 0.0001 ) + expect_equal(example_isolates %>% proportion_SI(AMC, GEN, only_all_tested = TRUE), + 0.9382647, + tolerance = 0.0001 + ) + + # percentages + expect_equal( + example_isolates %>% + group_by(ward) %>% + summarise( + R = proportion_R(CIP, as_percent = TRUE), + I = proportion_I(CIP, as_percent = TRUE), + S = proportion_S(CIP, as_percent = TRUE), + n = n_sir(CIP), + total = n() + ) %>% + pull(n) %>% + sum(), + 1409 + ) + + # count of cases + expect_equal( + example_isolates %>% + group_by(ward) %>% + summarise( + cipro_p = proportion_SI(CIP, as_percent = TRUE), + cipro_n = n_sir(CIP), + genta_p = proportion_SI(GEN, as_percent = TRUE), + genta_n = n_sir(GEN), + combination_p = proportion_SI(CIP, GEN, as_percent = TRUE), + combination_n = n_sir(CIP, GEN) + ) %>% + pull(combination_n), + c(1181, 577, 116) + ) + + # proportion_df + expect_equal( + example_isolates %>% select(AMX) %>% proportion_df() %>% pull(value), + c( + example_isolates$AMX %>% proportion_SI(), + example_isolates$AMX %>% proportion_R() + ) + ) + expect_equal( + example_isolates %>% select(AMX) %>% proportion_df(combine_SI = FALSE) %>% pull(value), + c( + example_isolates$AMX %>% proportion_S(), + example_isolates$AMX %>% proportion_I(), + example_isolates$AMX %>% proportion_R() + ) + ) + + # expect_warning(example_isolates %>% group_by(ward) %>% summarise(across(KAN, sir_confidence_interval))) + } + + # expect_warning(proportion_R(as.character(example_isolates$AMC))) + # expect_warning(proportion_S(as.character(example_isolates$AMC))) + # expect_warning(proportion_S(as.character(example_isolates$AMC, example_isolates$GEN))) + + # expect_warning(n_sir(as.character(example_isolates$AMC, example_isolates$GEN))) + expect_equal( + suppressWarnings(n_sir(as.character( + example_isolates$AMC, + example_isolates$GEN + ))), + 1879 ) - # expect_warning(example_isolates %>% group_by(ward) %>% summarise(across(KAN, sir_confidence_interval))) -} + # check for errors + expect_error(proportion_IR("test", minimum = "test")) + expect_error(proportion_IR("test", as_percent = "test")) + expect_error(proportion_I("test", minimum = "test")) + expect_error(proportion_I("test", as_percent = "test")) + expect_error(proportion_S("test", minimum = "test")) + expect_error(proportion_S("test", as_percent = "test")) + expect_error(proportion_S("test", also_single_tested = TRUE)) -# expect_warning(proportion_R(as.character(example_isolates$AMC))) -# expect_warning(proportion_S(as.character(example_isolates$AMC))) -# expect_warning(proportion_S(as.character(example_isolates$AMC, example_isolates$GEN))) + # check too low amount of isolates + expect_identical( + suppressWarnings(proportion_R(example_isolates$AMX, minimum = nrow(example_isolates) + 1)), + NA_real_ + ) + expect_identical( + suppressWarnings(proportion_I(example_isolates$AMX, minimum = nrow(example_isolates) + 1)), + NA_real_ + ) + expect_identical( + suppressWarnings(proportion_S(example_isolates$AMX, minimum = nrow(example_isolates) + 1)), + NA_real_ + ) -# expect_warning(n_sir(as.character(example_isolates$AMC, example_isolates$GEN))) -expect_equal( - suppressWarnings(n_sir(as.character( - example_isolates$AMC, - example_isolates$GEN - ))), - 1879 -) - -# check for errors -expect_error(proportion_IR("test", minimum = "test")) -expect_error(proportion_IR("test", as_percent = "test")) -expect_error(proportion_I("test", minimum = "test")) -expect_error(proportion_I("test", as_percent = "test")) -expect_error(proportion_S("test", minimum = "test")) -expect_error(proportion_S("test", as_percent = "test")) -expect_error(proportion_S("test", also_single_tested = TRUE)) - -# check too low amount of isolates -expect_identical( - suppressWarnings(proportion_R(example_isolates$AMX, minimum = nrow(example_isolates) + 1)), - NA_real_ -) -expect_identical( - suppressWarnings(proportion_I(example_isolates$AMX, minimum = nrow(example_isolates) + 1)), - NA_real_ -) -expect_identical( - suppressWarnings(proportion_S(example_isolates$AMX, minimum = nrow(example_isolates) + 1)), - NA_real_ -) - -# warning for speed loss -# expect_warning(proportion_R(as.character(example_isolates$GEN))) -# expect_warning(proportion_I(as.character(example_isolates$GEN))) -# expect_warning(proportion_S(example_isolates$AMC, as.character(example_isolates$GEN))) -expect_error(proportion_df(c("A", "B", "C"))) -expect_error(proportion_df(example_isolates[, "date", drop = TRUE])) + # warning for speed loss + # expect_warning(proportion_R(as.character(example_isolates$GEN))) + # expect_warning(proportion_I(as.character(example_isolates$GEN))) + # expect_warning(proportion_S(example_isolates$AMC, as.character(example_isolates$GEN))) + expect_error(proportion_df(c("A", "B", "C"))) + expect_error(proportion_df(example_isolates[, "date", drop = TRUE])) +}) diff --git a/tests/testthat/test-random.R b/tests/testthat/test-random.R index b668ab481..039c200ad 100644 --- a/tests/testthat/test-random.R +++ b/tests/testthat/test-random.R @@ -27,14 +27,16 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_inherits(random_mic(100), "mic") -expect_inherits(random_mic(100, mo = "Klebsiella pneumoniae"), "mic") -expect_inherits(random_mic(100, mo = "Klebsiella pneumoniae", ab = "meropenem"), "mic") -expect_inherits(random_mic(100, ab = "meropenem"), "mic") -# no normal factors of 2 -expect_inherits(random_mic(100, "Haemophilus influenzae", "ceftaroline"), "mic") -expect_inherits(random_disk(100), "disk") -expect_inherits(random_disk(100, mo = "Klebsiella pneumoniae"), "disk") -expect_inherits(random_disk(100, mo = "Klebsiella pneumoniae", ab = "meropenem"), "disk") -expect_inherits(random_disk(100, ab = "meropenem"), "disk") -expect_inherits(random_sir(100), "sir") +test_that("random works", { + expect_inherits(random_mic(100), "mic") + expect_inherits(random_mic(100, mo = "Klebsiella pneumoniae"), "mic") + expect_inherits(random_mic(100, mo = "Klebsiella pneumoniae", ab = "meropenem"), "mic") + expect_inherits(random_mic(100, ab = "meropenem"), "mic") + # no normal factors of 2 + expect_inherits(random_mic(100, "Haemophilus influenzae", "ceftaroline"), "mic") + expect_inherits(random_disk(100), "disk") + expect_inherits(random_disk(100, mo = "Klebsiella pneumoniae"), "disk") + expect_inherits(random_disk(100, mo = "Klebsiella pneumoniae", ab = "meropenem"), "disk") + expect_inherits(random_disk(100, ab = "meropenem"), "disk") + expect_inherits(random_sir(100), "sir") +}) diff --git a/tests/testthat/test-resistance_predict.R b/tests/testthat/test-resistance_predict.R index bd64a8ad3..ad878805f 100644 --- a/tests/testthat/test-resistance_predict.R +++ b/tests/testthat/test-resistance_predict.R @@ -27,94 +27,96 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_stdout(AMX_R <- example_isolates %>% - filter(mo == "B_ESCHR_COLI") %>% - sir_predict( - col_ab = "AMX", - col_date = "date", - model = "binomial", - minimum = 10, - info = TRUE - ) %>% - pull("value")) - # AMX resistance will increase according to data set `example_isolates` - expect_true(AMX_R[3] < AMX_R[20]) -} +test_that("resistance_predict works", { + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_output(AMX_R <- example_isolates %>% + filter(mo == "B_ESCHR_COLI") %>% + sir_predict( + col_ab = "AMX", + col_date = "date", + model = "binomial", + minimum = 10, + info = TRUE + ) %>% + pull("value")) + # AMX resistance will increase according to data set `example_isolates` + expect_true(AMX_R[3] < AMX_R[20]) + } -expect_stdout(x <- suppressMessages(resistance_predict(example_isolates, - col_ab = "AMX", - year_min = 2010, - model = "binomial", - info = TRUE -))) -pdf(NULL) # prevent Rplots.pdf being created -expect_silent(plot(x)) -if (AMR:::pkg_is_available("ggplot2")) { - expect_silent(ggplot_sir_predict(x)) - expect_silent(ggplot2::autoplot(x)) - expect_error(ggplot_sir_predict(example_isolates)) -} -expect_stdout(sir_predict( - x = subset(example_isolates, mo == "B_ESCHR_COLI"), - model = "binomial", - col_ab = "AMX", - col_date = "date", - info = TRUE -)) -expect_stdout(sir_predict( - x = subset(example_isolates, mo == "B_ESCHR_COLI"), - model = "loglin", - col_ab = "AMX", - col_date = "date", - info = TRUE -)) -expect_stdout(sir_predict( - x = subset(example_isolates, mo == "B_ESCHR_COLI"), - model = "lin", - col_ab = "AMX", - col_date = "date", - info = TRUE -)) + expect_output(x <- suppressMessages(resistance_predict(example_isolates, + col_ab = "AMX", + year_min = 2010, + model = "binomial", + info = TRUE + ))) + pdf(NULL) # prevent Rplots.pdf being created + expect_silent(plot(x)) + if (AMR:::pkg_is_available("ggplot2")) { + expect_silent(ggplot_sir_predict(x)) + expect_silent(ggplot2::autoplot(x)) + expect_error(ggplot_sir_predict(example_isolates)) + } + expect_output(sir_predict( + x = subset(example_isolates, mo == "B_ESCHR_COLI"), + model = "binomial", + col_ab = "AMX", + col_date = "date", + info = TRUE + )) + expect_output(sir_predict( + x = subset(example_isolates, mo == "B_ESCHR_COLI"), + model = "loglin", + col_ab = "AMX", + col_date = "date", + info = TRUE + )) + expect_output(sir_predict( + x = subset(example_isolates, mo == "B_ESCHR_COLI"), + model = "lin", + col_ab = "AMX", + col_date = "date", + info = TRUE + )) -expect_error(sir_predict( - x = subset(example_isolates, mo == "B_ESCHR_COLI"), - model = "INVALID MODEL", - col_ab = "AMX", - col_date = "date", - info = TRUE -)) -expect_error(sir_predict( - x = subset(example_isolates, mo == "B_ESCHR_COLI"), - model = "binomial", - col_ab = "NOT EXISTING COLUMN", - col_date = "date", - info = TRUE -)) -expect_error(sir_predict( - x = subset(example_isolates, mo == "B_ESCHR_COLI"), - model = "binomial", - col_ab = "AMX", - col_date = "NOT EXISTING COLUMN", - info = TRUE -)) -expect_error(sir_predict( - x = subset(example_isolates, mo == "B_ESCHR_COLI"), - col_ab = "AMX", - col_date = "NOT EXISTING COLUMN", - info = TRUE -)) -expect_error(sir_predict( - x = subset(example_isolates, mo == "B_ESCHR_COLI"), - col_ab = "AMX", - col_date = "date", - info = TRUE -)) -# almost all E. coli are MEM S in the Netherlands :) -expect_error(resistance_predict( - x = subset(example_isolates, mo == "B_ESCHR_COLI"), - model = "binomial", - col_ab = "MEM", - col_date = "date", - info = TRUE -)) + expect_error(sir_predict( + x = subset(example_isolates, mo == "B_ESCHR_COLI"), + model = "INVALID MODEL", + col_ab = "AMX", + col_date = "date", + info = TRUE + )) + expect_error(sir_predict( + x = subset(example_isolates, mo == "B_ESCHR_COLI"), + model = "binomial", + col_ab = "NOT EXISTING COLUMN", + col_date = "date", + info = TRUE + )) + expect_error(sir_predict( + x = subset(example_isolates, mo == "B_ESCHR_COLI"), + model = "binomial", + col_ab = "AMX", + col_date = "NOT EXISTING COLUMN", + info = TRUE + )) + expect_error(sir_predict( + x = subset(example_isolates, mo == "B_ESCHR_COLI"), + col_ab = "AMX", + col_date = "NOT EXISTING COLUMN", + info = TRUE + )) + expect_error(sir_predict( + x = subset(example_isolates, mo == "B_ESCHR_COLI"), + col_ab = "AMX", + col_date = "date", + info = TRUE + )) + # almost all E. coli are MEM S in the Netherlands :) + expect_error(resistance_predict( + x = subset(example_isolates, mo == "B_ESCHR_COLI"), + model = "binomial", + col_ab = "MEM", + col_date = "date", + info = TRUE + )) +}) diff --git a/tests/testthat/test-sir.R b/tests/testthat/test-sir.R index e88c917ed..7b8f0d264 100644 --- a/tests/testthat/test-sir.R +++ b/tests/testthat/test-sir.R @@ -27,356 +27,357 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # +test_that("sir works", { + # Existing SIR ------------------------------------------------------------ -# Existing SIR ------------------------------------------------------------ + # we must only have EUCAST and CLSI, because otherwise the rules in as.sir() will fail + expect_identical( + unique(gsub("[^A-Z]", "", AMR::clinical_breakpoints$guideline)), + c("EUCAST", "CLSI") + ) + # no missing SDDs + expect_identical(sum(is.na(AMR::clinical_breakpoints$is_SDD)), 0L) -# we must only have EUCAST and CLSI, because otherwise the rules in as.sir() will fail -expect_identical( - unique(gsub("[^A-Z]", "", AMR::clinical_breakpoints$guideline)), - c("EUCAST", "CLSI") -) -# no missing SDDs -expect_identical(sum(is.na(AMR::clinical_breakpoints$is_SDD)), 0L) - -expect_true(as.sir("S") < as.sir("I")) -expect_true(as.sir("I") < as.sir("R")) -expect_true(is.sir(as.sir("S"))) -x <- example_isolates$AMX -expect_inherits(x[1], "sir") -expect_inherits(x[[1]], "sir") -expect_inherits(c(x[1], x[9]), "sir") -expect_inherits(unique(x[1], x[9]), "sir") -pdf(NULL) # prevent Rplots.pdf being created -expect_silent(barplot(as.sir(c("S", "SDD", "I", "R", "NI")))) -expect_silent(plot(as.sir(c("S", "SDD", "I", "R", "NI")))) -if (AMR:::pkg_is_available("ggplot2")) { - expect_inherits(ggplot2::autoplot(as.sir(c("S", "SDD", "I", "R", "NI"))), "gg") -} -expect_stdout(print(as.sir(c("S", "SDD", "I", "R", "NI")))) -expect_equal(as.character(as.sir(c(1:3))), c("S", "I", "R")) -expect_equal(as.character(as.sir(c(1:3))), c("S", "I", "R")) -expect_equal(suppressWarnings(as.logical(as.sir("INVALID VALUE"))), NA) -expect_equal( - summary(as.sir(c("S", "R"))), - structure(c( - "Class" = "sir", - "%S" = "50.0% (n=1)", - "%SDD" = " 0.0% (n=0)", - "%I" = " 0.0% (n=0)", - "%R" = "50.0% (n=1)", - "%NI" = " 0.0% (n=0)" - ), class = c("summaryDefault", "table")) -) -expect_identical( - as.logical(lapply(example_isolates, is_sir_eligible)), - as.logical(lapply(example_isolates, is.sir)) -) -expect_error(as.sir.mic(as.mic(16))) -expect_error(as.sir.disk(as.disk(16))) -expect_error(get_guideline("this one does not exist")) - -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - # 40 sir columns + expect_true(as.sir("S") < as.sir("I")) + expect_true(as.sir("I") < as.sir("R")) + expect_true(is.sir(as.sir("S"))) + x <- example_isolates$AMX + expect_inherits(x[1], "sir") + expect_inherits(x[[1]], "sir") + expect_inherits(c(x[1], x[9]), "sir") + expect_inherits(unique(x[1], x[9]), "sir") + pdf(NULL) # prevent Rplots.pdf being created + expect_silent(barplot(as.sir(c("S", "SDD", "I", "R", "NI")))) + expect_silent(plot(as.sir(c("S", "SDD", "I", "R", "NI")))) + if (AMR:::pkg_is_available("ggplot2")) { + expect_inherits(ggplot2::autoplot(as.sir(c("S", "SDD", "I", "R", "NI"))), "gg") + } + expect_output(print(as.sir(c("S", "SDD", "I", "R", "NI")))) + expect_equal(as.character(as.sir(c(1:3))), c("S", "I", "R")) + expect_equal(as.character(as.sir(c(1:3))), c("S", "I", "R")) + expect_equal(suppressWarnings(as.logical(as.sir("INVALID VALUE"))), NA) expect_equal( - example_isolates %>% - mutate_at(vars(PEN:RIF), as.character) %>% - lapply(is_sir_eligible) %>% - as.logical() %>% - sum(), - 40 + summary(as.sir(c("S", "R"))), + structure(c( + "Class" = "sir", + "%S" = "50.0% (n=1)", + "%SDD" = " 0.0% (n=0)", + "%I" = " 0.0% (n=0)", + "%R" = "50.0% (n=1)", + "%NI" = " 0.0% (n=0)" + ), class = c("summaryDefault", "table")) ) - expect_equal(sum(is.sir(example_isolates)), 40) - - expect_stdout(print(tibble(ab = as.sir("S")))) - - expect_true(example_isolates %>% - select(AMC, MEM) %>% - mutate(MEM = as.sir(ifelse(AMC == "S", "S", MEM))) %>% - pull(MEM) %>% - is.sir()) - - expect_true(example_isolates %>% - select(AMC, MEM) %>% - mutate(MEM = if_else(AMC == "S", "S", MEM)) %>% - pull(MEM) %>% - is.sir()) -} -if (AMR:::pkg_is_available("skimr", min_version = "2.0.0", also_load = TRUE)) { - expect_inherits( - skim(example_isolates), - "data.frame" + expect_identical( + as.logical(lapply(example_isolates, is_sir_eligible)), + as.logical(lapply(example_isolates, is.sir)) ) + expect_error(as.sir.mic(as.mic(16))) + expect_error(as.sir.disk(as.disk(16))) + expect_error(get_guideline("this one does not exist")) + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_inherits( + # 40 sir columns + expect_equal( example_isolates %>% - mutate( - m = as.mic(2), - d = as.disk(20) - ) %>% - skim(), + mutate_at(vars(PEN:RIF), as.character) %>% + lapply(is_sir_eligible) %>% + as.logical() %>% + sum(), + 40 + ) + expect_equal(sum(is.sir(example_isolates)), 40) + + expect_output(print(tibble(ab = as.sir("S")))) + + expect_true(example_isolates %>% + select(AMC, MEM) %>% + mutate(MEM = as.sir(ifelse(AMC == "S", "S", MEM))) %>% + pull(MEM) %>% + is.sir()) + + expect_true(example_isolates %>% + select(AMC, MEM) %>% + mutate(MEM = if_else(AMC == "S", "S", MEM)) %>% + pull(MEM) %>% + is.sir()) + } + if (AMR:::pkg_is_available("skimr", min_version = "2.0.0", also_load = TRUE)) { + expect_inherits( + skim(example_isolates), "data.frame" ) + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_inherits( + example_isolates %>% + mutate( + m = as.mic(2), + d = as.disk(20) + ) %>% + skim(), + "data.frame" + ) + } } -} -expect_equal(as.sir(c("", "-", NA, "NULL")), c(NA_sir_, NA_sir_, NA_sir_, NA_sir_)) + expect_equal(as.sir(c("", "-", NA, "NULL")), c(NA_sir_, NA_sir_, NA_sir_, NA_sir_)) -# Human ------------------------------------------------------------------- + # Human ------------------------------------------------------------------- -mics <- as.mic(2^c(-4:6)) # 0.0625 to 64 in factors of 2 -expect_identical( - as.character(as.sir(mics, - mo = "Enterobacterales", ab = "AMC", guideline = "EUCAST 2022", - uti = FALSE, include_PKPD = FALSE - )), - c("S", "S", "S", "S", "S", "S", "S", "S", "R", "R", "R") -) -expect_identical( - as.character(as.sir(mics, - mo = "Enterobacterales", ab = "AMC", guideline = "EUCAST 2022", - uti = TRUE, include_PKPD = FALSE - )), - c("S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "R") -) -expect_identical( - as.character(as.sir(mics, - mo = "Escherichia coli", ab = "AMC", guideline = "EUCAST 2022", - uti = FALSE, include_PKPD = FALSE - )), - c("S", "S", "S", "S", "S", "S", "S", "S", "R", "R", "R") -) + mics <- as.mic(2^c(-4:6)) # 0.0625 to 64 in factors of 2 + expect_identical( + as.character(as.sir(mics, + mo = "Enterobacterales", ab = "AMC", guideline = "EUCAST 2022", + uti = FALSE, include_PKPD = FALSE + )), + c("S", "S", "S", "S", "S", "S", "S", "S", "R", "R", "R") + ) + expect_identical( + as.character(as.sir(mics, + mo = "Enterobacterales", ab = "AMC", guideline = "EUCAST 2022", + uti = TRUE, include_PKPD = FALSE + )), + c("S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "R") + ) + expect_identical( + as.character(as.sir(mics, + mo = "Escherichia coli", ab = "AMC", guideline = "EUCAST 2022", + uti = FALSE, include_PKPD = FALSE + )), + c("S", "S", "S", "S", "S", "S", "S", "S", "R", "R", "R") + ) -# test SIR using dplyr's mutate_if(...) and mutate(across(...)) -out1 <- as.sir(as.mic(c(0.256, 0.5, 1, 2)), mo = "Escherichia coli", ab = "ertapenem", guideline = "EUCAST 2023") -expect_identical(out1, as.sir(c("S", "S", "R", "R"))) -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - out2 <- data.frame( - mo = "Escherichia coli", - ab = "ertapenem", - some_mics = as.mic(c(0.256, 0.5, 1, 2)) - ) %>% - mutate(across(where(is.mic), function(x) as.sir(x, mo = "mo", ab = "ab", guideline = "EUCAST 2023"))) %>% - pull(some_mics) - out3 <- data.frame( - mo = "Escherichia coli", - ab = "ertapenem", - some_mics = as.mic(c(0.256, 0.5, 1, 2)) - ) %>% - mutate_if(is.mic, as.sir, mo = "mo", ab = "ab", guideline = "EUCAST 2023") %>% - pull(some_mics) + # test SIR using dplyr's mutate_if(...) and mutate(across(...)) + out1 <- as.sir(as.mic(c(0.256, 0.5, 1, 2)), mo = "Escherichia coli", ab = "ertapenem", guideline = "EUCAST 2023") + expect_identical(out1, as.sir(c("S", "S", "R", "R"))) + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + out2 <- data.frame( + mo = "Escherichia coli", + ab = "ertapenem", + some_mics = as.mic(c(0.256, 0.5, 1, 2)) + ) %>% + mutate(across(where(is.mic), function(x) as.sir(x, mo = "mo", ab = "ab", guideline = "EUCAST 2023"))) %>% + pull(some_mics) + out3 <- data.frame( + mo = "Escherichia coli", + ab = "ertapenem", + some_mics = as.mic(c(0.256, 0.5, 1, 2)) + ) %>% + mutate_if(is.mic, as.sir, mo = "mo", ab = "ab", guideline = "EUCAST 2023") %>% + pull(some_mics) - expect_identical(out1, out2) - expect_identical(out1, out3) -} + expect_identical(out1, out2) + expect_identical(out1, out3) + } -# S. pneumoniae/ampicillin in EUCAST 2020: 0.5-2 ug/ml (R is only > 2) -expect_equal( - suppressMessages( + # S. pneumoniae/ampicillin in EUCAST 2020: 0.5-2 ug/ml (R is only > 2) + expect_equal( + suppressMessages( + as.character( + as.sir( + x = as.mic(c(0.125, 0.5, 1, 2, 4)), + mo = "B_STRPT_PNMN", + ab = "AMP", + guideline = "EUCAST 2020" + ) + ) + ), + c("S", "S", "I", "I", "R") + ) + # S. pneumoniae/amoxicillin in CLSI 2019: 2-8 ug/ml (R is 8 and > 8) + expect_equal( + suppressMessages( + as.character( + as.sir( + x = as.mic(c(1, 2, 4, 8, 16)), + mo = "B_STRPT_PNMN", + ab = "AMX", + guideline = "CLSI 2019" + ) + ) + ), + c("S", "S", "I", "R", "R") + ) + + expect_true(is.data.frame(sir_interpretation_history(clean = FALSE))) + expect_true(is.data.frame(sir_interpretation_history(clean = TRUE))) + expect_true(NROW(sir_interpretation_history()) == 0) + + # cutoffs at MIC = 8 + expect_equal( + suppressMessages(as.sir(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020")), + as.sir("S") + ) + expect_equal( + suppressMessages(as.sir(as.mic(32), "E. coli", "ampicillin", guideline = "EUCAST 2020")), + as.sir("R") + ) + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_true(suppressWarnings(example_isolates %>% + mutate(amox_mic = as.mic(2)) %>% + select(mo, amox_mic) %>% + as.sir() %>% + pull(amox_mic) %>% + is.sir())) + } + + expect_equal( as.character( as.sir( - x = as.mic(c(0.125, 0.5, 1, 2, 4)), + x = as.disk(22), mo = "B_STRPT_PNMN", - ab = "AMP", - guideline = "EUCAST 2020" + ab = "ERY", + guideline = "CLSI" ) - ) - ), - c("S", "S", "I", "I", "R") -) -# S. pneumoniae/amoxicillin in CLSI 2019: 2-8 ug/ml (R is 8 and > 8) -expect_equal( - suppressMessages( + ), + "S" + ) + expect_equal( as.character( as.sir( - x = as.mic(c(1, 2, 4, 8, 16)), + x = as.disk(18), mo = "B_STRPT_PNMN", - ab = "AMX", - guideline = "CLSI 2019" + ab = "ERY", + guideline = "CLSI" ) - ) - ), - c("S", "S", "I", "R", "R") -) - -expect_true(is.data.frame(sir_interpretation_history(clean = FALSE))) -expect_true(is.data.frame(sir_interpretation_history(clean = TRUE))) -expect_true(NROW(sir_interpretation_history()) == 0) - -# cutoffs at MIC = 8 -expect_equal( - suppressMessages(as.sir(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020")), - as.sir("S") -) -expect_equal( - suppressMessages(as.sir(as.mic(32), "E. coli", "ampicillin", guideline = "EUCAST 2020")), - as.sir("R") -) -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_true(suppressWarnings(example_isolates %>% - mutate(amox_mic = as.mic(2)) %>% - select(mo, amox_mic) %>% - as.sir() %>% - pull(amox_mic) %>% - is.sir())) -} - -expect_equal( - as.character( - as.sir( - x = as.disk(22), - mo = "B_STRPT_PNMN", - ab = "ERY", - guideline = "CLSI" - ) - ), - "S" -) -expect_equal( - as.character( - as.sir( - x = as.disk(18), - mo = "B_STRPT_PNMN", - ab = "ERY", - guideline = "CLSI" - ) - ), - "I" -) -expect_equal( - as.character( - as.sir( - x = as.disk(10), - mo = "B_STRPT_PNMN", - ab = "ERY", - guideline = "CLSI" - ) - ), - "R" -) -if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { - expect_true(example_isolates %>% - mutate(amox_disk = as.disk(15)) %>% - select(mo, amox_disk) %>% - as.sir(guideline = "CLSI") %>% - pull(amox_disk) %>% - is.sir()) - - # used by group_by() on sir_calc_df(), check some internals to see if grouped calculation without tidyverse works - groups <- example_isolates %>% - group_by(mo) %>% - attributes() %>% - .$groups - expect_equal( - nrow(groups), - 90 + ), + "I" ) expect_equal( - class(groups$.rows), - c("vctrs_list_of", "vctrs_vctr", "list") + as.character( + as.sir( + x = as.disk(10), + mo = "B_STRPT_PNMN", + ab = "ERY", + guideline = "CLSI" + ) + ), + "R" ) - expect_equal( - groups$.rows[[1]], - c(101, 524, 1368) - ) - expect_equal( - example_isolates[c(101, 524, 1368), "mo", drop = TRUE], - rep(groups$mo[1], 3) - ) -} -# frequency tables -if (AMR:::pkg_is_available("cleaner")) { - expect_inherits(cleaner::freq(example_isolates$AMX), "freq") -} + if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) { + expect_true(example_isolates %>% + mutate(amox_disk = as.disk(15)) %>% + select(mo, amox_disk) %>% + as.sir(guideline = "CLSI") %>% + pull(amox_disk) %>% + is.sir()) + + # used by group_by() on sir_calc_df(), check some internals to see if grouped calculation without tidyverse works + groups <- example_isolates %>% + group_by(mo) %>% + attributes() %>% + .$groups + expect_equal( + nrow(groups), + 90 + ) + expect_equal( + class(groups$.rows), + c("vctrs_list_of", "vctrs_vctr", "list") + ) + expect_equal( + groups$.rows[[1]], + c(101, 524, 1368) + ) + expect_equal( + example_isolates[c(101, 524, 1368), "mo", drop = TRUE], + rep(groups$mo[1], 3) + ) + } + # frequency tables + if (AMR:::pkg_is_available("cleaner")) { + expect_inherits(cleaner::freq(example_isolates$AMX), "freq") + } -df <- data.frame( - microorganism = "Escherichia coli", - AMP = as.mic(8), - CIP = as.mic(0.256), - GEN = as.disk(18), - TOB = as.disk(16), - ERY = "R", # note about assigning class - CLR = "V" -) # note about cleaning -expect_inherits( - suppressWarnings(as.sir(df)), - "data.frame" -) -expect_inherits( - suppressWarnings(as.sir(data.frame( - mo = "Escherichia coli", - amoxi = c("S", "SDD", "I", "R", "NI", "invalid") - ))$amoxi), - "sir" -) -# expect_warning(as.sir(data.frame(mo = "E. coli", NIT = c("<= 2", 32)))) -expect_message(as.sir(data.frame( - mo = "E. coli", - NIT = c("<= 2", 32), - uti = TRUE -))) -expect_message(as.sir(data.frame( - mo = "E. coli", - NIT = c("<= 2", 32), - specimen = c("urine", "blood") -))) + df <- data.frame( + microorganism = "Escherichia coli", + AMP = as.mic(8), + CIP = as.mic(0.256), + GEN = as.disk(18), + TOB = as.disk(16), + ERY = "R", # note about assigning class + CLR = "V" + ) # note about cleaning + expect_inherits( + suppressWarnings(as.sir(df)), + "data.frame" + ) + expect_inherits( + suppressWarnings(as.sir(data.frame( + mo = "Escherichia coli", + amoxi = c("S", "SDD", "I", "R", "NI", "invalid") + ))$amoxi), + "sir" + ) + # expect_warning(as.sir(data.frame(mo = "E. coli", NIT = c("<= 2", 32)))) + expect_message(as.sir(data.frame( + mo = "E. coli", + NIT = c("<= 2", 32), + uti = TRUE + ))) + expect_message(as.sir(data.frame( + mo = "E. coli", + NIT = c("<= 2", 32), + specimen = c("urine", "blood") + ))) -# SDD vs I in CLSI 2024 -expect_identical( - as.sir(as.mic(2^c(-2:4)), mo = "Enterococcus faecium", ab = "Dapto", guideline = "CLSI 2024"), - as.sir(c("SDD", "SDD", "SDD", "SDD", "SDD", "R", "R")) -) -expect_identical( - as.sir(as.mic(2^c(-2:2)), mo = "Enterococcus faecium", ab = "Cipro + # SDD vs I in CLSI 2024 + expect_identical( + as.sir(as.mic(2^c(-2:4)), mo = "Enterococcus faecium", ab = "Dapto", guideline = "CLSI 2024"), + as.sir(c("SDD", "SDD", "SDD", "SDD", "SDD", "R", "R")) + ) + expect_identical( + as.sir(as.mic(2^c(-2:2)), mo = "Enterococcus faecium", ab = "Cipro ", guideline = "CLSI 2024"), - as.sir(c("S", "S", "S", "I", "R")) -) - - -# Veterinary -------------------------------------------------------------- - -sir_history <- sir_interpretation_history(clean = TRUE) - -mics <- as.mic(2^c(-4:6)) # 0.0625 to 64 in factors of 2 -vet <- data.frame( - animal = c(rep("cat", 3), rep("dogs", 3), "canine", "equine", "horse", "cattle", "bird"), - PRA = mics, - FLR = mics, - mo = mo_name(rep(c("B_ESCHR_COLI", "B_PSTRL_MLTC", "B_MNNHM_HMLY"), 4)[-1]) -) - -out_vet <- as.sir(vet, host = vet$animal, guideline = "CLSI 2023") -# host column name instead of values -expect_identical( - out_vet, - as.sir(vet, host = "animal", guideline = "CLSI 2023") -) - -# check outcomes -expect_identical(out_vet$PRA, as.sir(c("S", NA, "S", NA, NA, "R", NA, NA, NA, "I", NA))) -expect_identical(out_vet$FLR, as.sir(c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "R", NA))) - -out_vet <- as.sir(vet, host = "animal", guideline = "EUCAST 2023") -expect_identical(out_vet$PRA, rep(NA_sir_, 11)) -expect_identical(out_vet$FLR, as.sir(c("S", "S", NA, "S", "S", NA, "I", "R", NA, "R", "R"))) - -sir_history <- sir_interpretation_history() -expect_identical( - sort(sir_history$host), - c( - "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", - "cats", "cats", "cats", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "dogs", - "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", - "horse", "horse", "horse", "horse", "horse", "horse", "horse", "horse", "horse", "poultry", "poultry", "poultry", "poultry" + as.sir(c("S", "S", "S", "I", "R")) ) -) -# ECOFF ------------------------------------------------------------------- -expect_equal( - suppressMessages(as.sir(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020", breakpoint_type = "ECOFF")), - as.sir("S") -) -# old method -expect_warning(as.sir(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020", ecoff = TRUE)) + # Veterinary -------------------------------------------------------------- + + sir_history <- sir_interpretation_history(clean = TRUE) + + mics <- as.mic(2^c(-4:6)) # 0.0625 to 64 in factors of 2 + vet <- data.frame( + animal = c(rep("cat", 3), rep("dogs", 3), "canine", "equine", "horse", "cattle", "bird"), + PRA = mics, + FLR = mics, + mo = mo_name(rep(c("B_ESCHR_COLI", "B_PSTRL_MLTC", "B_MNNHM_HMLY"), 4)[-1]) + ) + + out_vet <- as.sir(vet, host = vet$animal, guideline = "CLSI 2023") + # host column name instead of values + expect_identical( + out_vet, + as.sir(vet, host = "animal", guideline = "CLSI 2023") + ) + + # check outcomes + expect_identical(out_vet$PRA, as.sir(c("S", NA, "S", NA, NA, "R", NA, NA, NA, "I", NA))) + expect_identical(out_vet$FLR, as.sir(c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "R", NA))) + + out_vet <- as.sir(vet, host = "animal", guideline = "EUCAST 2023") + expect_identical(out_vet$PRA, rep(NA_sir_, 11)) + expect_identical(out_vet$FLR, as.sir(c("S", "S", NA, "S", "S", NA, "I", "R", NA, "R", "R"))) + + sir_history <- sir_interpretation_history() + expect_identical( + sort(sir_history$host), + c( + "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", + "cats", "cats", "cats", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "dogs", + "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", "dogs", + "horse", "horse", "horse", "horse", "horse", "horse", "horse", "horse", "horse", "poultry", "poultry", "poultry", "poultry" + ) + ) + + # ECOFF ------------------------------------------------------------------- + + expect_equal( + suppressMessages(as.sir(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020", breakpoint_type = "ECOFF")), + as.sir("S") + ) + # old method + expect_warning(as.sir(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020", ecoff = TRUE)) +}) diff --git a/tests/testthat/test-skewness.R b/tests/testthat/test-skewness.R index 8aa31a522..294e2aa92 100644 --- a/tests/testthat/test-skewness.R +++ b/tests/testthat/test-skewness.R @@ -27,15 +27,17 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_equal(skewness(example_isolates$age), - -1.212888, - tolerance = 0.00001 -) -expect_equal(unname(skewness(data.frame(example_isolates$age))), - -1.212888, - tolerance = 0.00001 -) -expect_equal(skewness(matrix(example_isolates$age)), - -1.212888, - tolerance = 0.00001 -) +test_that("skewness works", { + expect_equal(skewness(example_isolates$age), + -1.212888, + tolerance = 0.00001 + ) + expect_equal(unname(skewness(data.frame(example_isolates$age))), + -1.212888, + tolerance = 0.00001 + ) + expect_equal(skewness(matrix(example_isolates$age)), + -1.212888, + tolerance = 0.00001 + ) +}) diff --git a/tests/testthat/test-top_n_microorganisms.R b/tests/testthat/test-top_n_microorganisms.R index af43a1892..09fdebf98 100644 --- a/tests/testthat/test-top_n_microorganisms.R +++ b/tests/testthat/test-top_n_microorganisms.R @@ -27,17 +27,19 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -out1 <- top_n_microorganisms(example_isolates, n = 3) -out2 <- top_n_microorganisms(example_isolates, n = 5, property = "genus") -out3 <- top_n_microorganisms(example_isolates, n = 5, property = "genus", n_for_each = 3) +test_that("top_n_microorganisms works", { + out1 <- top_n_microorganisms(example_isolates, n = 3) + out2 <- top_n_microorganisms(example_isolates, n = 5, property = "genus") + out3 <- top_n_microorganisms(example_isolates, n = 5, property = "genus", n_for_each = 3) -expect_equal(NROW(out1), 1015, tolerance = 0.5) -expect_equal(NROW(out2), 1742, tolerance = 0.5) -expect_equal(NROW(out3), 1497, tolerance = 0.5) + expect_equal(NROW(out1), 1015, tolerance = 0.5) + expect_equal(NROW(out2), 1742, tolerance = 0.5) + expect_equal(NROW(out3), 1497, tolerance = 0.5) -expect_equal(length(table(out1$mo)), 3, tolerance = 0.5) -expect_equal(length(table(out2$mo)), 39, tolerance = 0.5) -expect_equal(length(table(out3$mo)), 13, tolerance = 0.5) + expect_equal(length(table(out1$mo)), 3, tolerance = 0.5) + expect_equal(length(table(out2$mo)), 39, tolerance = 0.5) + expect_equal(length(table(out3$mo)), 13, tolerance = 0.5) -expect_equal(length(unique(mo_genus(out2$mo))), 5, tolerance = 0.5) -expect_equal(length(unique(mo_genus(out3$mo))), 5, tolerance = 0.5) + expect_equal(length(unique(mo_genus(out2$mo))), 5, tolerance = 0.5) + expect_equal(length(unique(mo_genus(out3$mo))), 5, tolerance = 0.5) +}) diff --git a/tests/testthat/test-translate.R b/tests/testthat/test-translate.R index 9864e66a2..50740393d 100644 --- a/tests/testthat/test-translate.R +++ b/tests/testthat/test-translate.R @@ -27,27 +27,29 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -expect_identical(mo_genus("B_GRAMP", language = "pt"), "(gênero desconhecido)") +test_that("translate works", { + expect_identical(mo_genus("B_GRAMP", language = "pt"), "(gênero desconhecido)") -expect_identical(mo_fullname("CoNS", "cs"), "Koaguláza-negativní stafylokok (KNS)") -expect_identical(mo_fullname("CoNS", "da"), "Koagulase-negative stafylokokker (KNS)") -expect_identical(mo_fullname("CoNS", "de"), "Koagulase-negative Staphylococcus (KNS)") -expect_identical(mo_fullname("CoNS", "el"), "Σταφυλόκοκκος με αρνητική πηκτικότητα (CoNS)") -expect_identical(mo_fullname("CoNS", "en"), "Coagulase-negative Staphylococcus (CoNS)") -expect_identical(mo_fullname("CoNS", "es"), "Staphylococcus coagulasa negativo (SCN)") -expect_identical(mo_fullname("CoNS", "fi"), "Koagulaasinegatiivinen stafylokokki (KNS)") -expect_identical(mo_fullname("CoNS", "fr"), "Staphylococcus à coagulase négative (CoNS)") -expect_identical(mo_fullname("CoNS", "it"), "Staphylococcus negativo coagulasi (CoNS)") -expect_identical(mo_fullname("CoNS", "ja"), "コアグラーゼ陰性ブドウ球菌 (グラム陰性)") -expect_identical(mo_fullname("CoNS", "nl"), "Coagulase-negatieve Staphylococcus (CNS)") -expect_identical(mo_fullname("CoNS", "no"), "Koagulase-negative stafylokokker (KNS)") -expect_identical(mo_fullname("CoNS", "pl"), "Staphylococcus koagulazoujemny (CoNS)") -expect_identical(mo_fullname("CoNS", "pt"), "Staphylococcus coagulase negativo (CoNS)") -expect_identical(mo_fullname("CoNS", "ro"), "Stafilococ coagulazo-negativ (SCN)") -expect_identical(mo_fullname("CoNS", "ru"), "Коагулазоотрицательный стафилококк (КОС)") -expect_identical(mo_fullname("CoNS", "sv"), "Koagulasnegativa stafylokocker (KNS)") -expect_identical(mo_fullname("CoNS", "tr"), "Koagülaz-negatif Stafilokok (KNS)") -expect_identical(mo_fullname("CoNS", "uk"), "Коагулазонегативний стафілокок (КНС)") -expect_identical(mo_fullname("CoNS", "zh"), "凝固酶阴性葡萄球菌 (CoNS)") + expect_identical(mo_fullname("CoNS", "cs"), "Koaguláza-negativní stafylokok (KNS)") + expect_identical(mo_fullname("CoNS", "da"), "Koagulase-negative stafylokokker (KNS)") + expect_identical(mo_fullname("CoNS", "de"), "Koagulase-negative Staphylococcus (KNS)") + expect_identical(mo_fullname("CoNS", "el"), "Σταφυλόκοκκος με αρνητική πηκτικότητα (CoNS)") + expect_identical(mo_fullname("CoNS", "en"), "Coagulase-negative Staphylococcus (CoNS)") + expect_identical(mo_fullname("CoNS", "es"), "Staphylococcus coagulasa negativo (SCN)") + expect_identical(mo_fullname("CoNS", "fi"), "Koagulaasinegatiivinen stafylokokki (KNS)") + expect_identical(mo_fullname("CoNS", "fr"), "Staphylococcus à coagulase négative (CoNS)") + expect_identical(mo_fullname("CoNS", "it"), "Staphylococcus negativo coagulasi (CoNS)") + expect_identical(mo_fullname("CoNS", "ja"), "コアグラーゼ陰性ブドウ球菌 (グラム陰性)") + expect_identical(mo_fullname("CoNS", "nl"), "Coagulase-negatieve Staphylococcus (CNS)") + expect_identical(mo_fullname("CoNS", "no"), "Koagulase-negative stafylokokker (KNS)") + expect_identical(mo_fullname("CoNS", "pl"), "Staphylococcus koagulazoujemny (CoNS)") + expect_identical(mo_fullname("CoNS", "pt"), "Staphylococcus coagulase negativo (CoNS)") + expect_identical(mo_fullname("CoNS", "ro"), "Stafilococ coagulazo-negativ (SCN)") + expect_identical(mo_fullname("CoNS", "ru"), "Коагулазоотрицательный стафилококк (КОС)") + expect_identical(mo_fullname("CoNS", "sv"), "Koagulasnegativa stafylokocker (KNS)") + expect_identical(mo_fullname("CoNS", "tr"), "Koagülaz-negatif Stafilokok (KNS)") + expect_identical(mo_fullname("CoNS", "uk"), "Коагулазонегативний стафілокок (КНС)") + expect_identical(mo_fullname("CoNS", "zh"), "凝固酶阴性葡萄球菌 (CoNS)") -expect_error(mo_fullname("CoNS", "aa")) + expect_error(mo_fullname("CoNS", "aa")) +}) diff --git a/tests/testthat/test-vctrs.R b/tests/testthat/test-vctrs.R index 910268a8f..944e2b346 100755 --- a/tests/testthat/test-vctrs.R +++ b/tests/testthat/test-vctrs.R @@ -27,31 +27,33 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -# extra tests for {vctrs} pkg support -if (AMR:::pkg_is_available("tibble")) { - test <- tibble::tibble( - ab = as.ab("CIP"), - mo = as.mo("Escherichia coli"), - mic = as.mic(2), - disk = as.disk(20), - sir = as.sir("S") - ) - check1 <- lapply(test, class) - test[1, "ab"] <- "GEN" - test[1, "mo"] <- "B_KLBSL_PNMN" - test[1, "mic"] <- ">=32" - test[1, "mic"] <- 32 - test[1, "disk"] <- "35" - test[1, "disk"] <- 25 - test[1, "disk"] <- 26L - test[1, "sir"] <- "R" - check2 <- lapply(test, class) - expect_identical(check1, check2) +test_that("vctrs works", { + # extra tests for {vctrs} pkg support + if (AMR:::pkg_is_available("tibble")) { + test <- tibble::tibble( + ab = as.ab("CIP"), + mo = as.mo("Escherichia coli"), + mic = as.mic(2), + disk = as.disk(20), + sir = as.sir("S") + ) + check1 <- lapply(test, class) + test[1, "ab"] <- "GEN" + test[1, "mo"] <- "B_KLBSL_PNMN" + test[1, "mic"] <- ">=32" + test[1, "mic"] <- 32 + test[1, "disk"] <- "35" + test[1, "disk"] <- 25 + test[1, "disk"] <- 26L + test[1, "sir"] <- "R" + check2 <- lapply(test, class) + expect_identical(check1, check2) - test <- tibble::tibble( - cipro = as.sir("S"), - variable = "test" - ) - expect_equal(nrow(test[quinolones() == "S", ]), 1) - expect_equal(nrow(test[quinolones() == "R", ]), 0) -} + test <- tibble::tibble( + cipro = as.sir("S"), + variable = "test" + ) + expect_equal(nrow(test[quinolones() == "S", ]), 1) + expect_equal(nrow(test[quinolones() == "R", ]), 0) + } +}) diff --git a/tests/testthat/test-zzz.R b/tests/testthat/test-zzz.R index 6115d0efe..476ea70d9 100644 --- a/tests/testthat/test-zzz.R +++ b/tests/testthat/test-zzz.R @@ -27,150 +27,152 @@ # how to conduct AMR data analysis: https://msberends.github.io/AMR/ # # ==================================================================== # -# Check if these functions still exist in their package (all are in Suggests field) -# Since GitHub Actions runs every night, we will get emailed when a dependency fails based on this unit test +test_that("zzz works", { + # Check if these functions still exist in their package (all are in Suggests field) + # Since GitHub Actions runs every night, we will get emailed when a dependency fails based on this unit test -# functions used by import_fn() -import_functions <- c( - "%chin%" = "data.table", - "anti_join" = "dplyr", - "as.data.table" = "data.table", - "as_tibble" = "tibble", - "chmatch" = "data.table", - "cli_abort" = "cli", - "cur_column" = "dplyr", - "cur_group" = "dplyr", - "document_position" = "rstudioapi", - "document_range" = "rstudioapi", - "full_join" = "dplyr", - "getActiveDocumentContext" = "rstudioapi", - "has_color" = "crayon", - "has_internet" = "curl", - "html_attr" = "rvest", - "html_children" = "rvest", - "html_node" = "rvest", - "html_nodes" = "rvest", - "html_table" = "rvest", - "html_text" = "rvest", - "inner_join" = "dplyr", - "insertText" = "rstudioapi", - "left_join" = "dplyr", - "modifyRange" = "rstudioapi", - "new_pillar_shaft_simple" = "pillar", - "progress_bar" = "progress", - "read_html" = "xml2", - "right_join" = "dplyr", - "semi_join" = "dplyr", - "showQuestion" = "rstudioapi", - "symbol" = "cli", - "tibble" = "tibble", - "write.xlsx" = "openxlsx" -) - -# functions that are called directly with :: -call_functions <- c( - # cleaner - "freq" = "cleaner", - "freq.default" = "cleaner", - "percentage" = "cleaner", - # cli - "symbol" = "cli", - # curl - "has_internet" = "curl", - # ggplot2 - "aes" = "ggplot2", - "arrow" = "ggplot2", - "autoplot" = "ggplot2", - "element_blank" = "ggplot2", - "element_line" = "ggplot2", - "element_text" = "ggplot2", - "expand_limits" = "ggplot2", - "facet_wrap" = "ggplot2", - "fortify" = "ggplot2", - "geom_col" = "ggplot2", - "geom_errorbar" = "ggplot2", - "geom_path" = "ggplot2", - "geom_point" = "ggplot2", - "geom_ribbon" = "ggplot2", - "geom_segment" = "ggplot2", - "geom_text" = "ggplot2", - "ggplot" = "ggplot2", - "labs" = "ggplot2", - "position_dodge2" = "ggplot2", - "position_fill" = "ggplot2", - "scale_colour_discrete" = "ggplot2", - "scale_discrete_manual" = "ggplot2", - "scale_fill_discrete" = "ggplot2", - "scale_fill_manual" = "ggplot2", - "scale_x_discrete" = "ggplot2", - "scale_y_continuous" = "ggplot2", - "scale_y_discrete" = "ggplot2", - "theme" = "ggplot2", - "theme_minimal" = "ggplot2", - "unit" = "ggplot2", - "xlab" = "ggplot2", - "ylab" = "ggplot2", - # knitr - "asis_output" = "knitr", - "kable" = "knitr", - "knit_print" = "knitr", - "opts_chunk" = "knitr", - # pillar - "pillar_shaft" = "pillar", - "tbl_format_footer" = "pillar", - "tbl_sum" = "pillar", - "type_sum" = "pillar", - # readxl - "read_excel" = "readxl", - # rmarkdown - "html_vignette" = "rmarkdown", - # skimr - "get_skimmers" = "skimr", - "inline_hist" = "skimr", - "sfl" = "skimr", - # tibble - "tibble" = "tibble", - # vctrs - "vec_arith" = "vctrs", - "vec_cast" = "vctrs", - "vec_math" = "vctrs", - "vec_ptype2" = "vctrs", - "vec_ptype_abbr" = "vctrs", - "vec_ptype_full" = "vctrs" -) - -import_functions <- c(import_functions, call_functions) - -suggests <- strsplit(utils::packageDescription("AMR")$Suggests, "[,\n ]+")[[1]] -for (i in seq_len(length(import_functions))) { - fn <- names(import_functions)[i] - pkg <- unname(import_functions[i]) - expect_true(pkg %in% suggests, - info = paste0("package `", pkg, "` is not in Suggests") + # functions used by import_fn() + import_functions <- c( + "%chin%" = "data.table", + "anti_join" = "dplyr", + "as.data.table" = "data.table", + "as_tibble" = "tibble", + "chmatch" = "data.table", + "cli_abort" = "cli", + "cur_column" = "dplyr", + "cur_group" = "dplyr", + "document_position" = "rstudioapi", + "document_range" = "rstudioapi", + "full_join" = "dplyr", + "getActiveDocumentContext" = "rstudioapi", + "has_color" = "crayon", + "has_internet" = "curl", + "html_attr" = "rvest", + "html_children" = "rvest", + "html_node" = "rvest", + "html_nodes" = "rvest", + "html_table" = "rvest", + "html_text" = "rvest", + "inner_join" = "dplyr", + "insertText" = "rstudioapi", + "left_join" = "dplyr", + "modifyRange" = "rstudioapi", + "new_pillar_shaft_simple" = "pillar", + "progress_bar" = "progress", + "read_html" = "xml2", + "right_join" = "dplyr", + "semi_join" = "dplyr", + "showQuestion" = "rstudioapi", + "symbol" = "cli", + "tibble" = "tibble", + "write.xlsx" = "openxlsx" ) - # function should exist in foreign pkg namespace - if (AMR:::pkg_is_available(pkg, - also_load = FALSE, - min_version = if (pkg == "dplyr") "1.0.0" else NULL - )) { - expect_true(!is.null(AMR:::import_fn(name = fn, pkg = pkg, error_on_fail = FALSE)), - info = paste0("Function does not exist (anymore): function `", pkg, "::", fn, "()`") - ) - } else if (pkg != "rstudioapi") { - warning("Package '", pkg, "' not available") - } -} -if (AMR:::pkg_is_available("cli")) { - expect_true(!is.null(cli::symbol$bullet) && is.character(cli::symbol$bullet) && length(cli::symbol$bullet) == 1) - expect_true(!is.null(cli::symbol$ellipsis) && is.character(cli::symbol$ellipsis) && length(cli::symbol$ellipsis) == 1) - expect_true(!is.null(cli::symbol$info) && is.character(cli::symbol$info) && length(cli::symbol$info) == 1) - expect_true(!is.null(cli::symbol$sup_1) && is.character(cli::symbol$sup_1) && length(cli::symbol$sup_1) == 1) -} -if (AMR:::pkg_is_available("ggplot2")) { - # the scale_*_mic() functions rely on these - expect_true(is.function(ggplot2::scale_x_discrete()$transform)) - expect_true(is.function(ggplot2::scale_y_discrete()$transform)) - expect_true(is.function(ggplot2::scale_colour_discrete()$transform)) - expect_true(is.function(ggplot2::scale_fill_discrete()$transform)) -} + # functions that are called directly with :: + call_functions <- c( + # cleaner + "freq" = "cleaner", + "freq.default" = "cleaner", + "percentage" = "cleaner", + # cli + "symbol" = "cli", + # curl + "has_internet" = "curl", + # ggplot2 + "aes" = "ggplot2", + "arrow" = "ggplot2", + "autoplot" = "ggplot2", + "element_blank" = "ggplot2", + "element_line" = "ggplot2", + "element_text" = "ggplot2", + "expand_limits" = "ggplot2", + "facet_wrap" = "ggplot2", + "fortify" = "ggplot2", + "geom_col" = "ggplot2", + "geom_errorbar" = "ggplot2", + "geom_path" = "ggplot2", + "geom_point" = "ggplot2", + "geom_ribbon" = "ggplot2", + "geom_segment" = "ggplot2", + "geom_text" = "ggplot2", + "ggplot" = "ggplot2", + "labs" = "ggplot2", + "position_dodge2" = "ggplot2", + "position_fill" = "ggplot2", + "scale_colour_discrete" = "ggplot2", + "scale_discrete_manual" = "ggplot2", + "scale_fill_discrete" = "ggplot2", + "scale_fill_manual" = "ggplot2", + "scale_x_discrete" = "ggplot2", + "scale_y_continuous" = "ggplot2", + "scale_y_discrete" = "ggplot2", + "theme" = "ggplot2", + "theme_minimal" = "ggplot2", + "unit" = "ggplot2", + "xlab" = "ggplot2", + "ylab" = "ggplot2", + # knitr + "asis_output" = "knitr", + "kable" = "knitr", + "knit_print" = "knitr", + "opts_chunk" = "knitr", + # pillar + "pillar_shaft" = "pillar", + "tbl_format_footer" = "pillar", + "tbl_sum" = "pillar", + "type_sum" = "pillar", + # readxl + "read_excel" = "readxl", + # rmarkdown + "html_vignette" = "rmarkdown", + # skimr + "get_skimmers" = "skimr", + "inline_hist" = "skimr", + "sfl" = "skimr", + # tibble + "tibble" = "tibble", + # vctrs + "vec_arith" = "vctrs", + "vec_cast" = "vctrs", + "vec_math" = "vctrs", + "vec_ptype2" = "vctrs", + "vec_ptype_abbr" = "vctrs", + "vec_ptype_full" = "vctrs" + ) + + import_functions <- c(import_functions, call_functions) + + suggests <- strsplit(utils::packageDescription("AMR")$Suggests, "[,\n ]+")[[1]] + for (i in seq_len(length(import_functions))) { + fn <- names(import_functions)[i] + pkg <- unname(import_functions[i]) + expect_true(pkg %in% suggests, + info = paste0("package `", pkg, "` is not in Suggests") + ) + # function should exist in foreign pkg namespace + if (AMR:::pkg_is_available(pkg, + also_load = FALSE, + min_version = if (pkg == "dplyr") "1.0.0" else NULL + )) { + expect_true(!is.null(AMR:::import_fn(name = fn, pkg = pkg, error_on_fail = FALSE)), + info = paste0("Function does not exist (anymore): function `", pkg, "::", fn, "()`") + ) + } else if (pkg != "rstudioapi") { + warning("Package '", pkg, "' not available") + } + } + + if (AMR:::pkg_is_available("cli")) { + expect_true(!is.null(cli::symbol$bullet) && is.character(cli::symbol$bullet) && length(cli::symbol$bullet) == 1) + expect_true(!is.null(cli::symbol$ellipsis) && is.character(cli::symbol$ellipsis) && length(cli::symbol$ellipsis) == 1) + expect_true(!is.null(cli::symbol$info) && is.character(cli::symbol$info) && length(cli::symbol$info) == 1) + expect_true(!is.null(cli::symbol$sup_1) && is.character(cli::symbol$sup_1) && length(cli::symbol$sup_1) == 1) + } + if (AMR:::pkg_is_available("ggplot2")) { + # the scale_*_mic() functions rely on these + expect_true(is.function(ggplot2::scale_x_discrete()$transform)) + expect_true(is.function(ggplot2::scale_y_discrete()$transform)) + expect_true(is.function(ggplot2::scale_colour_discrete()$transform)) + expect_true(is.function(ggplot2::scale_fill_discrete()$transform)) + } +}) diff --git a/tests/tinytest.R.old b/tests/tinytest.R.old index 4af748093..97953c53e 100644 --- a/tests/tinytest.R.old +++ b/tests/tinytest.R.old @@ -39,6 +39,11 @@ if (identical(Sys.getenv("R_RUN_TINYTEST"), "true")) { # load the package library(AMR) + test_that <- function(desc, code) { + code + } + expect_output <- tinytest::expect_stdout + # set language set_AMR_locale("English") diff --git a/vignettes/AMR_for_Python.Rmd b/vignettes/AMR_for_Python.Rmd index de26a764e..ccb62fe0a 100755 --- a/vignettes/AMR_for_Python.Rmd +++ b/vignettes/AMR_for_Python.Rmd @@ -147,7 +147,7 @@ In this example, we generate an antibiogram by selecting various antibiotics. ## Taxonomic Data Sets Now in Python! -As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antibiotics`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames: +As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antimicrobials`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames: ```python AMR.microorganisms @@ -168,7 +168,7 @@ AMR.microorganisms | F_ZYZYG | Zyzygomyces | unknown | Fungi | None | 7581 | None | 2.0 | ```python -AMR.antibiotics +AMR.antimicrobials ``` | ab | cid | name | group | oral_ddd | oral_units | iv_ddd | iv_units | diff --git a/vignettes/AMR_with_tidymodels.Rmd b/vignettes/AMR_with_tidymodels.Rmd index 0db0a5e81..fc775cf11 100644 --- a/vignettes/AMR_with_tidymodels.Rmd +++ b/vignettes/AMR_with_tidymodels.Rmd @@ -63,7 +63,7 @@ data <- example_isolates %>% **Explanation:** -- `aminoglycosides()` and `betalactams()` dynamically select columns for antibiotics in these classes. +- `aminoglycosides()` and `betalactams()` dynamically select columns for antimicrobials in these classes. - `drop_na()` ensures the model receives complete cases for training. ### **Defining the Workflow** diff --git a/vignettes/EUCAST.Rmd b/vignettes/EUCAST.Rmd index 438248ff6..87b0c2a0a 100644 --- a/vignettes/EUCAST.Rmd +++ b/vignettes/EUCAST.Rmd @@ -51,7 +51,7 @@ oops eucast_rules(oops, info = FALSE) ``` -A more convenient function is `mo_is_intrinsic_resistant()` that uses the same guideline, but allows to check for one or more specific microorganisms or antibiotics: +A more convenient function is `mo_is_intrinsic_resistant()` that uses the same guideline, but allows to check for one or more specific microorganisms or antimicrobials: ```{r, warning = FALSE, message = FALSE} mo_is_intrinsic_resistant( diff --git a/vignettes/datasets.Rmd b/vignettes/datasets.Rmd index 61f68ab13..0a8f2929e 100644 --- a/vignettes/datasets.Rmd +++ b/vignettes/datasets.Rmd @@ -40,7 +40,7 @@ download_txt <- function(filename) { msg <- paste0( "It was last updated on ", trimws(format(file.mtime(paste0("../data/", filename, ".rda")), "%e %B %Y %H:%M:%S %Z", tz = "UTC")), - ". Find more info about the structure of this data set [here](https://msberends.github.io/AMR/reference/", ifelse(filename == "antivirals", "antibiotics", filename), ".html).\n" + ". Find more info about the structure of this data set [here](https://msberends.github.io/AMR/reference/", ifelse(filename == "antivirals", "antimicrobials", filename), ".html).\n" ) github_base <- "https://github.com/msberends/AMR/raw/main/data-raw/" filename <- paste0("../data-raw/", filename) @@ -111,7 +111,7 @@ print_df <- function(x, rows = 6) { } ``` -All reference data (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) in this `AMR` package are reliable, up-to-date and freely available. We continually export our data sets to formats for use in R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. +All reference data (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) in this `AMR` package are reliable, up-to-date and freely available. We continually export our data sets to formats for use in R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata. We also provide tab-separated text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. On this page, we explain how to download them and how the structure of the data sets look like. @@ -158,13 +158,13 @@ microorganisms %>% ``` -## `antibiotics`: Antibiotic (+Antifungal) Drugs +## `antimicrobials`: Antibiotic and Antifungal Drugs -`r structure_txt(antibiotics)` +`r structure_txt(antimicrobials)` -This data set is in R available as `antibiotics`, after you load the `AMR` package. +This data set is in R available as `antimicrobials`, after you load the `AMR` package. -`r download_txt("antibiotics")` +`r download_txt("antimicrobials")` The tab-separated text, Microsoft Excel, SPSS, and Stata files all contain the ATC codes, common abbreviations, trade names and LOINC codes as comma separated values. @@ -180,7 +180,7 @@ This data set contains all EARS-Net and ATC codes gathered from WHO and WHONET, ### Example content ```{r, echo = FALSE} -antibiotics %>% +antimicrobials %>% filter(ab %in% colnames(example_isolates)) %>% print_df() ``` diff --git a/vignettes/welcome_to_AMR.Rmd b/vignettes/welcome_to_AMR.Rmd index 1932336b1..49cd25c07 100644 --- a/vignettes/welcome_to_AMR.Rmd +++ b/vignettes/welcome_to_AMR.Rmd @@ -30,7 +30,7 @@ The `AMR` package is a [free and open-source](https://msberends.github.io/AMR/#c This work was published in the Journal of Statistical Software (Volume 104(3); [DOI 10.18637/jss.v104.i03](https://doi.org/10.18637/jss.v104.i03)) and formed the basis of two PhD theses ([DOI 10.33612/diss.177417131](https://doi.org/10.33612/diss.177417131) and [DOI 10.33612/diss.192486375](https://doi.org/10.33612/diss.192486375)). -After installing this package, R knows `r AMR:::format_included_data_number(AMR::microorganisms)` distinct microbial species and all `r AMR:::format_included_data_number(rbind(AMR::antibiotics[, "atc", drop = FALSE], AMR::antivirals[, "atc", drop = FALSE]))` 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 breakpoint guidelines from CLSI and EUCAST are included from the last 10 years. It supports and can read any data format, including WHONET data. +After installing this package, R knows `r AMR:::format_included_data_number(AMR::microorganisms)` distinct microbial species and all `r AMR:::format_included_data_number(rbind(AMR::antimicrobials[, "atc", drop = FALSE], AMR::antivirals[, "atc", drop = FALSE]))` 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 breakpoint guidelines from CLSI and EUCAST are included from the last 10 years. It supports and can read any data format, including WHONET data. With the help of contributors from all corners of the world, the `AMR` package is available in English, Czech, Chinese, 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. @@ -55,7 +55,7 @@ This package can be used for: * Machine reading the EUCAST and CLSI guidelines from 2011-2020 to translate MIC values and disk diffusion diameters to SIR * Principal component analysis for AMR -All reference data sets (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) in this `AMR` package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find [all download links on our website](https://msberends.github.io/AMR/articles/datasets.html), which is automatically updated with every code change. +All reference data sets (about microorganisms, antimicrobials, SIR interpretation, EUCAST rules, etc.) in this `AMR` package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find [all download links on our website](https://msberends.github.io/AMR/articles/datasets.html), which is automatically updated with every code change. This R package was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the [University of Groningen](https://www.rug.nl), in collaboration with non-profit organisations [Certe Medical Diagnostics and Advice Foundation](https://www.certe.nl) and [University Medical Center Groningen](https://www.umcg.nl), and is being [actively and durably maintained](https://msberends.github.io/AMR/news/) by two public healthcare organisations in the Netherlands.