mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 22:41:52 +02:00
Compare commits
25 Commits
v2.0.0
...
1d9ee39cc7
Author | SHA1 | Date | |
---|---|---|---|
1d9ee39cc7 | |||
f065945d7b | |||
9591688811 | |||
e1966503ee | |||
766db4e21f | |||
c6135d2082 | |||
0bcf55d3b6 | |||
3018fb87a9 | |||
5f9769a4f7 | |||
8179092c57 | |||
91fa73dedf | |||
bf08d136a0 | |||
9de19fdc49 | |||
9148a2dcf4 | |||
2758615cd0 | |||
02322ac2ee | |||
cabffb22fd | |||
ad3061c754 | |||
1a02d302d4 | |||
ed70f95380 | |||
147f9112e9 | |||
549790c2a6 | |||
c28cfa3a77 | |||
dd7cc86485 | |||
68aa98f294 |
@ -30,6 +30,7 @@
|
|||||||
^vignettes/datasets\.Rmd$
|
^vignettes/datasets\.Rmd$
|
||||||
^vignettes/EUCAST\.Rmd$
|
^vignettes/EUCAST\.Rmd$
|
||||||
^vignettes/MDR\.Rmd$
|
^vignettes/MDR\.Rmd$
|
||||||
|
^vignettes/other_pkg.*\.Rmd$
|
||||||
^vignettes/PCA\.Rmd$
|
^vignettes/PCA\.Rmd$
|
||||||
^vignettes/resistance_predict\.Rmd$
|
^vignettes/resistance_predict\.Rmd$
|
||||||
^vignettes/SPSS\.Rmd$
|
^vignettes/SPSS\.Rmd$
|
||||||
|
2
.github/prehooks/pre-commit
vendored
2
.github/prehooks/pre-commit
vendored
@ -11,7 +11,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
5
.github/workflows/check-old.yaml
vendored
5
.github/workflows/check-old.yaml
vendored
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -48,7 +48,8 @@ jobs:
|
|||||||
config:
|
config:
|
||||||
# Test all old versions of R >= 3.0, we support them all!
|
# Test all old versions of R >= 3.0, we support them all!
|
||||||
# For these old versions, dependencies and vignettes will not be checked.
|
# For these old versions, dependencies and vignettes will not be checked.
|
||||||
# For recent R versions, see check-recent.yaml (r-lib and tidyverse support the latest 5 major R versions).
|
# For recent R versions, see check-recent.yaml (r-lib and tidyverse support the latest 5 major R releases).
|
||||||
|
- {os: windows-latest, r: '3.5', allowfail: true}
|
||||||
- {os: ubuntu-latest, r: '3.4', allowfail: false}
|
- {os: ubuntu-latest, r: '3.4', allowfail: false}
|
||||||
- {os: ubuntu-latest, r: '3.3', allowfail: false}
|
- {os: ubuntu-latest, r: '3.3', allowfail: false}
|
||||||
- {os: ubuntu-latest, r: '3.2', allowfail: false}
|
- {os: ubuntu-latest, r: '3.2', allowfail: false}
|
||||||
|
16
.github/workflows/check-recent.yaml
vendored
16
.github/workflows/check-recent.yaml
vendored
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -52,21 +52,21 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
config:
|
||||||
# current development version:
|
# current development version, check all major OSes:
|
||||||
- {os: macOS-latest, r: 'devel', allowfail: false}
|
- {os: macOS-latest, r: 'devel', allowfail: false}
|
||||||
- {os: windows-latest, r: 'devel', allowfail: false}
|
- {os: windows-latest, r: 'devel', allowfail: false}
|
||||||
- {os: ubuntu-latest, r: 'devel', allowfail: false}
|
- {os: ubuntu-latest, r: 'devel', allowfail: false}
|
||||||
|
|
||||||
# current 'release' version:
|
# current 'release' version, check all major OSes:
|
||||||
- {os: macOS-latest, r: '4.2', allowfail: false}
|
- {os: macOS-latest, r: '4.3', allowfail: false}
|
||||||
- {os: windows-latest, r: '4.2', allowfail: false}
|
- {os: windows-latest, r: '4.3', allowfail: false}
|
||||||
- {os: ubuntu-latest, r: '4.2', allowfail: false}
|
- {os: ubuntu-latest, r: '4.3', allowfail: false}
|
||||||
|
|
||||||
# older versions (see also check-old.yaml for even older versions):
|
# older versions (see also check-old.yaml for even older versions):
|
||||||
|
- {os: ubuntu-latest, r: '4.2', allowfail: false}
|
||||||
- {os: ubuntu-latest, r: '4.1', allowfail: false}
|
- {os: ubuntu-latest, r: '4.1', allowfail: false}
|
||||||
- {os: ubuntu-latest, r: '4.0', allowfail: false}
|
- {os: ubuntu-latest, r: '4.0', allowfail: false}
|
||||||
- {os: ubuntu-latest, r: '3.6', allowfail: false}
|
- {os: ubuntu-latest, r: '3.6', allowfail: false} # when a new R releases, this one has to move to check-old.yaml
|
||||||
- {os: ubuntu-latest, r: '3.5', allowfail: false} # when a new R releases, this one has to move to check-old.yaml
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
2
.github/workflows/codecovr.yaml
vendored
2
.github/workflows/codecovr.yaml
vendored
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
2
.github/workflows/lintr.yaml
vendored
2
.github/workflows/lintr.yaml
vendored
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
8
.github/workflows/website.yaml
vendored
8
.github/workflows/website.yaml
vendored
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -65,7 +65,11 @@ jobs:
|
|||||||
- name: Set up R dependencies
|
- name: Set up R dependencies
|
||||||
uses: r-lib/actions/setup-r-dependencies@v2
|
uses: r-lib/actions/setup-r-dependencies@v2
|
||||||
with:
|
with:
|
||||||
extra-packages: any::pkgdown
|
# add extra packages for website articles:
|
||||||
|
extra-packages: |
|
||||||
|
any::pkgdown
|
||||||
|
any::tidymodels
|
||||||
|
any::data.table
|
||||||
|
|
||||||
# Send updates to repo using GH Actions bot
|
# Send updates to repo using GH Actions bot
|
||||||
- name: Create website in separate branch
|
- name: Create website in separate branch
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 2.0.0
|
Version: 2.0.0.9025
|
||||||
Date: 2023-03-12
|
Date: 2023-06-22
|
||||||
Title: Antimicrobial Resistance Data Analysis
|
Title: Antimicrobial Resistance Data Analysis
|
||||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||||
data analysis and to work with microbial and antimicrobial properties by
|
data analysis and to work with microbial and antimicrobial properties by
|
||||||
|
@ -330,6 +330,7 @@ export(mo_gbif)
|
|||||||
export(mo_genus)
|
export(mo_genus)
|
||||||
export(mo_gramstain)
|
export(mo_gramstain)
|
||||||
export(mo_info)
|
export(mo_info)
|
||||||
|
export(mo_is_anaerobic)
|
||||||
export(mo_is_gram_negative)
|
export(mo_is_gram_negative)
|
||||||
export(mo_is_gram_positive)
|
export(mo_is_gram_positive)
|
||||||
export(mo_is_intrinsic_resistant)
|
export(mo_is_intrinsic_resistant)
|
||||||
@ -339,6 +340,7 @@ export(mo_lpsn)
|
|||||||
export(mo_matching_score)
|
export(mo_matching_score)
|
||||||
export(mo_name)
|
export(mo_name)
|
||||||
export(mo_order)
|
export(mo_order)
|
||||||
|
export(mo_oxygen_tolerance)
|
||||||
export(mo_pathogenicity)
|
export(mo_pathogenicity)
|
||||||
export(mo_phylum)
|
export(mo_phylum)
|
||||||
export(mo_property)
|
export(mo_property)
|
||||||
|
26
NEWS.md
26
NEWS.md
@ -1,3 +1,29 @@
|
|||||||
|
# AMR 2.0.0.9025
|
||||||
|
|
||||||
|
## New
|
||||||
|
* Clinical breakpoints and intrinsic resistance of EUCAST 2023 and CLSI 2023 have been added for `as.sir()`. EUCAST 2023 (v13.0) is now the new default guideline for all MIC and disks diffusion interpretations, and for `eucast_rules()` to apply EUCAST Expert Rules.
|
||||||
|
* The EUCAST dosage guideline of v13.0 has been added to the `dosage` data set
|
||||||
|
* ECOFF: the `clinical_breakpoints` data set now contains the new column `ecoff`, in which the epidemiological cut-off (ECOFF) are available. These ECOFFs can be used for MIC/disk interpretation using `as.sir(..., ecoff = TRUE)`, which is an important new addition for veterinary microbiology.
|
||||||
|
* Added oxygen tolerance from BacDive to over 25,000 bacteria in the `microorganisms` data set
|
||||||
|
* Added `mo_oxygen_tolerance()` to retrieve the values
|
||||||
|
* Added `mo_is_anaerobic()` to determine which genera/species are obligate anaerobic bacteria
|
||||||
|
* Added LPSN and GBIF identifiers, and oxygen tolerance to `mo_info()`
|
||||||
|
* Added SAS Transport files (file extension `.xpt`) to [our download page](https://msberends.github.io/AMR/articles/datasets.html) to use in SAS software
|
||||||
|
* Added microbial codes for Gram-negative/positive anaerobic bacteria
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
* `mo_rank()` now returns `NA` for 'unknown' microorganisms (`B_ANAER`, `B_ANAER-NEG`, `B_ANAER-POS`, `B_GRAMN`, `B_GRAMP`, `F_FUNGUS`, `F_YEAST`, and `UNKNOWN`)
|
||||||
|
* Fixed formatting for `sir_interpretation_history()`
|
||||||
|
* Fixed some WHONET codes for microorganisms and consequently a couple of entries in `clinical_breakpoints`
|
||||||
|
* Fixed a bug for `as.mo()` that led to coercion of `NA` values when using custom microorganism codes
|
||||||
|
* Fixed usage of `icu_exclude` in `first_isolates()`
|
||||||
|
* Improved `as.mo()` algorithm:
|
||||||
|
* Now allows searching on only species names
|
||||||
|
* Fix for using the `keep_synonyms` argument when using MO codes as input
|
||||||
|
* Fix for using the `minimum_matching_score` argument
|
||||||
|
* Updated the code table in `microorganisms.codes`
|
||||||
|
|
||||||
|
|
||||||
# AMR 2.0.0
|
# AMR 2.0.0
|
||||||
|
|
||||||
This is a new major release of the AMR package, with great new additions but also some breaking changes for current users. These are all listed below.
|
This is a new major release of the AMR package, with great new additions but also some breaking changes for current users. These are all listed below.
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -36,7 +36,7 @@
|
|||||||
#'
|
#'
|
||||||
#' This work was published in the Journal of Statistical Software (Volume 104(3); \doi{jss.v104.i03}) and formed the basis of two PhD theses (\doi{10.33612/diss.177417131} and \doi{10.33612/diss.192486375}).
|
#' This work was published in the Journal of Statistical Software (Volume 104(3); \doi{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 breakpoint guidelines from CLSI and EUCAST are included from the last 10 years. 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 [**`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 [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.
|
#' 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:
|
#' @section Reference Data Publicly Available:
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -30,6 +30,12 @@
|
|||||||
# add new version numbers here, and add the rules themselves to "data-raw/eucast_rules.tsv" and clinical_breakpoints
|
# add new version numbers here, and add the rules themselves to "data-raw/eucast_rules.tsv" and clinical_breakpoints
|
||||||
# (sourcing "data-raw/_pre_commit_hook.R" will process the TSV file)
|
# (sourcing "data-raw/_pre_commit_hook.R" will process the TSV file)
|
||||||
EUCAST_VERSION_BREAKPOINTS <- list(
|
EUCAST_VERSION_BREAKPOINTS <- list(
|
||||||
|
"13.0" = list(
|
||||||
|
version_txt = "v13.0",
|
||||||
|
year = 2023,
|
||||||
|
title = "'EUCAST Clinical Breakpoint Tables'",
|
||||||
|
url = "https://www.eucast.org/clinical_breakpoints/"
|
||||||
|
),
|
||||||
"12.0" = list(
|
"12.0" = list(
|
||||||
version_txt = "v12.0",
|
version_txt = "v12.0",
|
||||||
year = 2022,
|
year = 2022,
|
||||||
@ -50,10 +56,10 @@ EUCAST_VERSION_BREAKPOINTS <- list(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
EUCAST_VERSION_EXPERT_RULES <- list(
|
EUCAST_VERSION_EXPERT_RULES <- list(
|
||||||
"3.1" = list(
|
"3.3" = list(
|
||||||
version_txt = "v3.1",
|
version_txt = "v3.3",
|
||||||
year = 2016,
|
year = 2021,
|
||||||
title = "'EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes'",
|
title = "'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes'",
|
||||||
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes/"
|
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes/"
|
||||||
),
|
),
|
||||||
"3.2" = list(
|
"3.2" = list(
|
||||||
@ -62,10 +68,18 @@ EUCAST_VERSION_EXPERT_RULES <- list(
|
|||||||
title = "'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes'",
|
title = "'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes'",
|
||||||
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes/"
|
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes/"
|
||||||
),
|
),
|
||||||
"3.3" = list(
|
"3.1" = list(
|
||||||
version_txt = "v3.3",
|
version_txt = "v3.1",
|
||||||
year = 2021,
|
year = 2016,
|
||||||
title = "'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes'",
|
title = "'EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes'",
|
||||||
|
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes/"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
EUCAST_VERSION_RESISTANTPHENOTYPES <- list(
|
||||||
|
"1.2" = list(
|
||||||
|
version_txt = "v1.2",
|
||||||
|
year = 2023,
|
||||||
|
title = "'Expected Resistant Phenotypes'",
|
||||||
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes/"
|
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes/"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -81,6 +95,11 @@ TAXONOMY_VERSION <- list(
|
|||||||
citation = "Parte, AC *et al.* (2020). **List of Prokaryotic names with Standing in Nomenclature (LPSN) moves to the DSMZ.** International Journal of Systematic and Evolutionary Microbiology, 70, 5607-5612; \\doi{10.1099/ijsem.0.004332}.",
|
citation = "Parte, AC *et al.* (2020). **List of Prokaryotic names with Standing in Nomenclature (LPSN) moves to the DSMZ.** International Journal of Systematic and Evolutionary Microbiology, 70, 5607-5612; \\doi{10.1099/ijsem.0.004332}.",
|
||||||
url = "https://lpsn.dsmz.de"
|
url = "https://lpsn.dsmz.de"
|
||||||
),
|
),
|
||||||
|
BacDive = list(
|
||||||
|
accessed_date = as.Date("2023-05-12"),
|
||||||
|
citation = "Reimer, LC *et al.* (2022). ***BacDive* in 2022: the knowledge base for standardized bacterial and archaeal data.** Nucleic Acids Res., 50(D1):D741-D74; \\doi{10.1093/nar/gkab961}.",
|
||||||
|
url = "https://bacdive.dsmz.de"
|
||||||
|
),
|
||||||
SNOMED = list(
|
SNOMED = list(
|
||||||
accessed_date = as.Date("2021-07-01"),
|
accessed_date = as.Date("2021-07-01"),
|
||||||
citation = "Public Health Information Network Vocabulary Access and Distribution System (PHIN VADS). US Edition of SNOMED CT from 1 September 2020. Value Set Name 'Microoganism', OID 2.16.840.1.114222.4.11.1009 (v12).",
|
citation = "Public Health Information Network Vocabulary Access and Distribution System (PHIN VADS). US Edition of SNOMED CT from 1 September 2020. Value Set Name 'Microoganism', OID 2.16.840.1.114222.4.11.1009 (v12).",
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -629,7 +629,12 @@ dataset_UTF8_to_ASCII <- function(df) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
documentation_date <- function(d) {
|
documentation_date <- function(d) {
|
||||||
paste0(trimws(format(d, "%e")), " ", month.name[as.integer(format(d, "%m"))], ", ", format(d, "%Y"))
|
day <- as.integer(format(d, "%e"))
|
||||||
|
suffix <- rep("th", length(day))
|
||||||
|
suffix[day %in% c(1, 21, 31)] <- "st"
|
||||||
|
suffix[day %in% c(2, 22)] <- "nd"
|
||||||
|
suffix[day %in% c(3, 23)] <- "rd"
|
||||||
|
paste0(month.name[as.integer(format(d, "%m"))], " ", day, suffix, ", ", format(d, "%Y"))
|
||||||
}
|
}
|
||||||
|
|
||||||
format_included_data_number <- function(data) {
|
format_included_data_number <- function(data) {
|
||||||
@ -644,10 +649,13 @@ format_included_data_number <- function(data) {
|
|||||||
rounder <- -3 # round on thousands
|
rounder <- -3 # round on thousands
|
||||||
} else if (n > 1000) {
|
} else if (n > 1000) {
|
||||||
rounder <- -2 # round on hundreds
|
rounder <- -2 # round on hundreds
|
||||||
|
} else if (n < 50) {
|
||||||
|
# do not round
|
||||||
|
rounder <- 0
|
||||||
} else {
|
} else {
|
||||||
rounder <- -1 # round on tens
|
rounder <- -1 # round on tens
|
||||||
}
|
}
|
||||||
paste0("~", format(round(n, rounder), decimal.mark = ".", big.mark = " "))
|
paste0(ifelse(rounder == 0, "", "~"), format(round(n, rounder), decimal.mark = ".", big.mark = " "))
|
||||||
}
|
}
|
||||||
|
|
||||||
# for eucast_rules() and mdro(), creates markdown output with URLs and names
|
# for eucast_rules() and mdro(), creates markdown output with URLs and names
|
||||||
@ -670,10 +678,15 @@ create_eucast_ab_documentation <- function() {
|
|||||||
atcs <- ab_atc(ab, only_first = TRUE)
|
atcs <- ab_atc(ab, only_first = TRUE)
|
||||||
# only keep ABx with an ATC code:
|
# only keep ABx with an ATC code:
|
||||||
ab <- ab[!is.na(atcs)]
|
ab <- ab[!is.na(atcs)]
|
||||||
|
atcs <- atcs[!is.na(atcs)]
|
||||||
|
|
||||||
|
# sort all vectors on name:
|
||||||
ab_names <- ab_name(ab, language = NULL, tolower = TRUE)
|
ab_names <- ab_name(ab, language = NULL, tolower = TRUE)
|
||||||
ab <- ab[order(ab_names)]
|
ab <- ab[order(ab_names)]
|
||||||
|
atcs <- atcs[order(ab_names)]
|
||||||
ab_names <- ab_names[order(ab_names)]
|
ab_names <- ab_names[order(ab_names)]
|
||||||
atc_txt <- paste0("[", atcs[!is.na(atcs)], "](", ab_url(ab), ")")
|
# create the text:
|
||||||
|
atc_txt <- paste0("[", atcs, "](", ab_url(ab), ")")
|
||||||
out <- paste0(ab_names, " (`", ab, "`, ", atc_txt, ")", collapse = ", ")
|
out <- paste0(ab_names, " (`", ab, "`, ", atc_txt, ")", collapse = ", ")
|
||||||
substr(out, 1, 1) <- toupper(substr(out, 1, 1))
|
substr(out, 1, 1) <- toupper(substr(out, 1, 1))
|
||||||
out
|
out
|
||||||
@ -996,7 +1009,7 @@ get_current_column <- function() {
|
|||||||
|
|
||||||
# cur_column() doesn't always work (only allowed for certain conditions set by dplyr), but it's probably still possible:
|
# cur_column() doesn't always work (only allowed for certain conditions set by dplyr), but it's probably still possible:
|
||||||
frms <- lapply(sys.frames(), function(env) {
|
frms <- lapply(sys.frames(), function(env) {
|
||||||
if (!is.null(env$i)) {
|
if (tryCatch(!is.null(env$i), error = function(e) FALSE)) {
|
||||||
if (!is.null(env$tibble_vars)) {
|
if (!is.null(env$tibble_vars)) {
|
||||||
# for mutate_if()
|
# for mutate_if()
|
||||||
env$tibble_vars[env$i]
|
env$tibble_vars[env$i]
|
||||||
@ -1504,6 +1517,10 @@ trimws2 <- function(..., whitespace = "[\u0009\u000A\u000B\u000C\u000D\u0020\u00
|
|||||||
trimws(..., whitespace = whitespace)
|
trimws(..., whitespace = whitespace)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
totitle <- function(x) {
|
||||||
|
gsub("^(.)", "\\U\\1", x, perl = TRUE)
|
||||||
|
}
|
||||||
|
|
||||||
readRDS_AMR <- function(file, refhook = NULL) {
|
readRDS_AMR <- function(file, refhook = NULL) {
|
||||||
# this is readRDS with remote file support
|
# this is readRDS with remote file support
|
||||||
con <- file(file)
|
con <- file(file)
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -37,6 +37,7 @@
|
|||||||
#' * `AMR_guideline` \cr Used for setting the default guideline for interpreting MIC values and disk diffusion diameters with [as.sir()]. Can be only the guideline name (e.g., `"CLSI"`) or the name with a year (e.g. `"CLSI 2019"`). The default to the latest implemented EUCAST guideline, currently \code{"`r clinical_breakpoints$guideline[1]`"}. Supported guideline are currently EUCAST (`r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`) and CLSI (`r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`).
|
#' * `AMR_guideline` \cr Used for setting the default guideline for interpreting MIC values and disk diffusion diameters with [as.sir()]. Can be only the guideline name (e.g., `"CLSI"`) or the name with a year (e.g. `"CLSI 2019"`). The default to the latest implemented EUCAST guideline, currently \code{"`r clinical_breakpoints$guideline[1]`"}. Supported guideline are currently EUCAST (`r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`) and CLSI (`r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`).
|
||||||
#' * `AMR_ignore_pattern` \cr A [regular expression][base::regex] to ignore (i.e., make `NA`) any match given in [as.mo()] and all [`mo_*`][mo_property()] functions.
|
#' * `AMR_ignore_pattern` \cr A [regular expression][base::regex] to ignore (i.e., make `NA`) any match given in [as.mo()] and all [`mo_*`][mo_property()] functions.
|
||||||
#' * `AMR_include_PKPD` \cr A [logical] to use in [as.sir()], to indicate that PK/PD clinical breakpoints must be applied as a last resort - the default is `TRUE`.
|
#' * `AMR_include_PKPD` \cr A [logical] to use in [as.sir()], to indicate that PK/PD clinical breakpoints must be applied as a last resort - the default is `TRUE`.
|
||||||
|
#' * `AMR_ecoff` \cr A [logical] use in [as.sir()], to indicate that ECOFF (Epidemiological Cut-Off) values must be used - the default is `FALSE`.
|
||||||
#' * `AMR_include_screening` \cr A [logical] to use in [as.sir()], to indicate that clinical breakpoints for screening are allowed - the default is `FALSE`.
|
#' * `AMR_include_screening` \cr A [logical] to use in [as.sir()], to indicate that clinical breakpoints for screening are allowed - the default is `FALSE`.
|
||||||
#' * `AMR_keep_synonyms` \cr A [logical] to use in [as.mo()] and all [`mo_*`][mo_property()] functions, to indicate if old, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. The default is `FALSE`.
|
#' * `AMR_keep_synonyms` \cr A [logical] to use in [as.mo()] and all [`mo_*`][mo_property()] functions, to indicate if old, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. The default is `FALSE`.
|
||||||
#' * `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_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".
|
||||||
|
2
R/ab.R
2
R/ab.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -69,7 +69,7 @@
|
|||||||
#' ab_atc_group2("AMX")
|
#' ab_atc_group2("AMX")
|
||||||
#' ab_url("AMX")
|
#' ab_url("AMX")
|
||||||
#'
|
#'
|
||||||
#' # smart lowercase tranformation
|
#' # smart lowercase transformation
|
||||||
#' ab_name(x = c("AMC", "PLB"))
|
#' ab_name(x = c("AMC", "PLB"))
|
||||||
#' ab_name(x = c("AMC", "PLB"), tolower = TRUE)
|
#' ab_name(x = c("AMC", "PLB"), tolower = TRUE)
|
||||||
#'
|
#'
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -620,7 +620,7 @@ administrable_iv <- function(only_sir_columns = FALSE, ...) {
|
|||||||
|
|
||||||
#' @rdname antibiotic_class_selectors
|
#' @rdname antibiotic_class_selectors
|
||||||
#' @inheritParams eucast_rules
|
#' @inheritParams eucast_rules
|
||||||
#' @details The [not_intrinsic_resistant()] function can be used to only select antibiotic columns 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 *E. coli* and *K. pneumoniae* and contains a column "vancomycin", this column will be removed (or rather, unselected) using this function. It currently applies `r format_eucast_version_nr(names(EUCAST_VERSION_EXPERT_RULES[length(EUCAST_VERSION_EXPERT_RULES)]))` to determine intrinsic resistance, using the [eucast_rules()] function internally. Because of this determination, this function is quite slow in terms of performance.
|
#' @details The [not_intrinsic_resistant()] function can be used to only select antibiotic columns 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 *E. coli* and *K. pneumoniae* and contains a column "vancomycin", this column will be removed (or rather, unselected) using this function. It currently applies `r format_eucast_version_nr(names(EUCAST_VERSION_EXPERT_RULES[1]))` to determine intrinsic resistance, using the [eucast_rules()] function internally. Because of this determination, this function is quite slow in terms of performance.
|
||||||
#' @export
|
#' @export
|
||||||
not_intrinsic_resistant <- function(only_sir_columns = FALSE, col_mo = NULL, version_expertrules = 3.3, ...) {
|
not_intrinsic_resistant <- function(only_sir_columns = FALSE, col_mo = NULL, version_expertrules = 3.3, ...) {
|
||||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||||
|
2
R/age.R
2
R/age.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -224,7 +224,7 @@
|
|||||||
#' # in an Rmd file, you would just need to return `ureido` in a chunk,
|
#' # in an Rmd file, you would just need to return `ureido` in a chunk,
|
||||||
#' # but to be explicit here:
|
#' # but to be explicit here:
|
||||||
#' if (requireNamespace("knitr")) {
|
#' if (requireNamespace("knitr")) {
|
||||||
#' knitr::knit_print(ureido)
|
#' cat(knitr::knit_print(ureido))
|
||||||
#' }
|
#' }
|
||||||
#'
|
#'
|
||||||
#'
|
#'
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
2
R/av.R
2
R/av.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -61,7 +61,7 @@
|
|||||||
#' av_group("ACI")
|
#' av_group("ACI")
|
||||||
#' av_url("ACI")
|
#' av_url("ACI")
|
||||||
#'
|
#'
|
||||||
#' # smart lowercase tranformation
|
#' # lowercase transformation
|
||||||
#' av_name(x = c("ACI", "VALA"))
|
#' av_name(x = c("ACI", "VALA"))
|
||||||
#' av_name(x = c("ACI", "VALA"), tolower = TRUE)
|
#' av_name(x = c("ACI", "VALA"), tolower = TRUE)
|
||||||
#'
|
#'
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -71,7 +71,8 @@
|
|||||||
#' @examples
|
#' @examples
|
||||||
#' \donttest{
|
#' \donttest{
|
||||||
#' # a combination of species is not formal taxonomy, so
|
#' # a combination of species is not formal taxonomy, so
|
||||||
#' # this will result in only "Enterobacter asburiae":
|
#' # this will result in "Enterobacter cloacae cloacae",
|
||||||
|
#' # since it resembles the input best:
|
||||||
#' mo_name("Enterobacter asburiae/cloacae")
|
#' mo_name("Enterobacter asburiae/cloacae")
|
||||||
#'
|
#'
|
||||||
#' # now add a custom entry - it will be considered by as.mo() and
|
#' # now add a custom entry - it will be considered by as.mo() and
|
||||||
@ -109,7 +110,7 @@
|
|||||||
#' mo_name("BACTEROIDES / PARABACTEROIDES")
|
#' mo_name("BACTEROIDES / PARABACTEROIDES")
|
||||||
#' mo_rank("BACTEROIDES / PARABACTEROIDES")
|
#' mo_rank("BACTEROIDES / PARABACTEROIDES")
|
||||||
#'
|
#'
|
||||||
#' # taxonomy still works, although a slashline genus was given as input:
|
#' # taxonomy still works, even though a slashline genus was given as input:
|
||||||
#' mo_family("Bacteroides/Parabacteroides")
|
#' mo_family("Bacteroides/Parabacteroides")
|
||||||
#'
|
#'
|
||||||
#'
|
#'
|
||||||
@ -247,17 +248,12 @@ add_custom_microorganisms <- function(x) {
|
|||||||
"CUSTOM",
|
"CUSTOM",
|
||||||
seq.int(from = current + 1, to = current + nrow(x), by = 1),
|
seq.int(from = current + 1, to = current + nrow(x), by = 1),
|
||||||
"_",
|
"_",
|
||||||
toupper(unname(abbreviate(
|
trimws(
|
||||||
gsub(
|
paste(abbreviate_mo(x$genus, 5),
|
||||||
" +", " _ ",
|
abbreviate_mo(x$species, 4, hyphen_as_space = TRUE),
|
||||||
gsub(
|
abbreviate_mo(x$subspecies, 4, hyphen_as_space = TRUE),
|
||||||
"[^A-Za-z0-9-]", " ",
|
sep = "_"),
|
||||||
trimws2(paste(x$genus, x$species, x$subspecies))
|
whitespace = "_"))
|
||||||
)
|
|
||||||
),
|
|
||||||
minlength = 10
|
|
||||||
)))
|
|
||||||
)
|
|
||||||
stop_if(anyDuplicated(c(as.character(AMR_env$MO_lookup$mo), x$mo)), "MO codes must be unique and not match existing MO codes of the AMR package")
|
stop_if(anyDuplicated(c(as.character(AMR_env$MO_lookup$mo), x$mo)), "MO codes must be unique and not match existing MO codes of the AMR package")
|
||||||
|
|
||||||
# add to package ----
|
# add to package ----
|
||||||
@ -306,3 +302,26 @@ clear_custom_microorganisms <- function() {
|
|||||||
AMR_env$mo_uncertainties <- AMR_env$mo_uncertainties[0, , drop = FALSE]
|
AMR_env$mo_uncertainties <- AMR_env$mo_uncertainties[0, , drop = FALSE]
|
||||||
message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal `microorganisms` data set.")
|
message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal `microorganisms` data set.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abbreviate_mo <- function(x, minlength = 5, prefix = "", hyphen_as_space = FALSE, ...) {
|
||||||
|
if (hyphen_as_space == TRUE) {
|
||||||
|
x <- gsub("-", " ", x, fixed = TRUE)
|
||||||
|
}
|
||||||
|
# keep a starting Latin ae
|
||||||
|
suppressWarnings(
|
||||||
|
gsub("(\u00C6|\u00E6)+",
|
||||||
|
"AE",
|
||||||
|
toupper(
|
||||||
|
paste0(prefix,
|
||||||
|
abbreviate(
|
||||||
|
gsub("^ae",
|
||||||
|
"\u00E6\u00E6",
|
||||||
|
x,
|
||||||
|
ignore.case = TRUE),
|
||||||
|
minlength = minlength,
|
||||||
|
use.classes = TRUE,
|
||||||
|
method = "both.sides",
|
||||||
|
...
|
||||||
|
))))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
28
R/data.R
28
R/data.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -93,6 +93,7 @@
|
|||||||
#' - `rank`\cr Text of the taxonomic rank of the microorganism, such as `"species"` or `"genus"`
|
#' - `rank`\cr Text of the taxonomic rank of the microorganism, such as `"species"` or `"genus"`
|
||||||
#' - `ref`\cr Author(s) and year of related scientific publication. This contains only the *first surname* and year of the *latest* authors, e.g. "Wallis *et al.* 2006 *emend.* Smith and Jones 2018" becomes "Smith *et al.*, 2018". This field is directly retrieved from the source specified in the column `source`. Moreover, accents were removed to comply with CRAN that only allows ASCII characters, e.g. "V`r "\u00e1\u0148ov\u00e1"`" becomes "Vanova".
|
#' - `ref`\cr Author(s) and year of related scientific publication. This contains only the *first surname* and year of the *latest* authors, e.g. "Wallis *et al.* 2006 *emend.* Smith and Jones 2018" becomes "Smith *et al.*, 2018". This field is directly retrieved from the source specified in the column `source`. Moreover, accents were removed to comply with CRAN that only allows ASCII characters, e.g. "V`r "\u00e1\u0148ov\u00e1"`" becomes "Vanova".
|
||||||
#' - `lpsn`\cr Identifier ('Record number') of the List of Prokaryotic names with Standing in Nomenclature (LPSN). This will be the first/highest LPSN identifier to keep one identifier per row. For example, *Acetobacter ascendens* has LPSN Record number 7864 and 11011. Only the first is available in the `microorganisms` data set.
|
#' - `lpsn`\cr Identifier ('Record number') of the List of Prokaryotic names with Standing in Nomenclature (LPSN). This will be the first/highest LPSN identifier to keep one identifier per row. For example, *Acetobacter ascendens* has LPSN Record number 7864 and 11011. Only the first is available in the `microorganisms` data set.
|
||||||
|
#' - `oxygen_tolerance` \cr Oxygen tolerance, either `r vector_or(microorganisms$oxygen_tolerance)`. These data were retrieved from BacDive (see *Source*). Items that contain "likely" are missing from BacDive and were extrapolated from other species within the same genus to guess the oxygen tolerance. Currently `r round(length(microorganisms$oxygen_tolerance[which(!is.na(microorganisms$oxygen_tolerance))]) / nrow(microorganisms[which(microorganisms$kingdom == "Bacteria"), ]) * 100, 1)`% of all `r format_included_data_number(nrow(microorganisms[which(microorganisms$kingdom == "Bacteria"), ]))` bacteria in the data set contain an oxygen tolerance.
|
||||||
#' - `lpsn_parent`\cr LPSN identifier of the parent taxon
|
#' - `lpsn_parent`\cr LPSN identifier of the parent taxon
|
||||||
#' - `lpsn_renamed_to`\cr LPSN identifier of the currently valid taxon
|
#' - `lpsn_renamed_to`\cr LPSN identifier of the currently valid taxon
|
||||||
#' - `gbif`\cr Identifier ('taxonID') of the Global Biodiversity Information Facility (GBIF)
|
#' - `gbif`\cr Identifier ('taxonID') of the Global Biodiversity Information Facility (GBIF)
|
||||||
@ -120,12 +121,12 @@
|
|||||||
#' ### Manual additions
|
#' ### Manual additions
|
||||||
#' For convenience, some entries were added manually:
|
#' For convenience, some entries were added manually:
|
||||||
#'
|
#'
|
||||||
#' - `r format_included_data_number(which(microorganisms$genus == "Salmonella" & microorganisms$species == "enterica" & microorganisms$source == "manually added"))` entries for the city-like serovars of *Salmonellae*
|
#' - `r format_included_data_number(microorganisms[which(microorganisms$source == "manually added" & microorganisms$genus == "Salmonella"), , drop = FALSE])` entries of *Salmonella*, such as the city-like serovars and groups A to H
|
||||||
#' - 11 entries of *Streptococcus* (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)
|
#' - `r format_included_data_number(microorganisms[which(microorganisms$source == "manually added" & microorganisms$genus == "Streptococcus"), , drop = FALSE])` entries of *Streptococcus*, such as the beta-haemolytic groups A to K, viridans, and milleri
|
||||||
#' - 2 entries of *Staphylococcus* (coagulase-negative (CoNS) and coagulase-positive (CoPS))
|
#' - 2 entries of *Staphylococcus* (coagulase-negative (CoNS) and coagulase-positive (CoPS))
|
||||||
#' - 1 entry of *Blastocystis* (*B. hominis*), although it officially does not exist (Noel *et al.* 2005, PMID 15634993)
|
#' - 1 entry of *Blastocystis* (*B. hominis*), although it officially does not exist (Noel *et al.* 2005, PMID 15634993)
|
||||||
#' - 1 entry of *Moraxella* (*M. catarrhalis*), which was formally named *Branhamella catarrhalis* (Catlin, 1970) though this change was never accepted within the field of clinical microbiology
|
#' - 1 entry of *Moraxella* (*M. catarrhalis*), which was formally named *Branhamella catarrhalis* (Catlin, 1970) though this change was never accepted within the field of clinical microbiology
|
||||||
#' - 6 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast, unknown fungus, and unknown anaerobic bacteria)
|
#' - 8 other 'undefined' entries (unknown, unknown Gram-negatives, unknown Gram-positives, unknown yeast, unknown fungus, and unknown anaerobic Gram-pos/Gram-neg bacteria)
|
||||||
#'
|
#'
|
||||||
#' The syntax used to transform the original data to a cleansed \R format, can be found here: <https://github.com/msberends/AMR/blob/main/data-raw/reproduction_of_microorganisms.R>.
|
#' The syntax used to transform the original data to a cleansed \R format, can be found here: <https://github.com/msberends/AMR/blob/main/data-raw/reproduction_of_microorganisms.R>.
|
||||||
#'
|
#'
|
||||||
@ -140,6 +141,8 @@
|
|||||||
#'
|
#'
|
||||||
#' * `r TAXONOMY_VERSION$GBIF$citation` Accessed from <`r TAXONOMY_VERSION$GBIF$url`> on `r documentation_date(TAXONOMY_VERSION$GBIF$accessed_date)`.
|
#' * `r TAXONOMY_VERSION$GBIF$citation` Accessed from <`r TAXONOMY_VERSION$GBIF$url`> on `r documentation_date(TAXONOMY_VERSION$GBIF$accessed_date)`.
|
||||||
#'
|
#'
|
||||||
|
#' * `r TAXONOMY_VERSION$BacDive$citation` Accessed from <`r TAXONOMY_VERSION$BacDive$url`> on `r documentation_date(TAXONOMY_VERSION$BacDive$accessed_date)`.
|
||||||
|
#'
|
||||||
#' * `r TAXONOMY_VERSION$SNOMED$citation` URL: <`r TAXONOMY_VERSION$SNOMED$url`>
|
#' * `r TAXONOMY_VERSION$SNOMED$citation` URL: <`r TAXONOMY_VERSION$SNOMED$url`>
|
||||||
#'
|
#'
|
||||||
#' * Grimont *et al.* (2007). Antigenic Formulae of the Salmonella Serovars, 9th Edition. WHO Collaborating Centre for Reference and Research on *Salmonella* (WHOCC-SALM).
|
#' * Grimont *et al.* (2007). Antigenic Formulae of the Salmonella Serovars, 9th Edition. WHO Collaborating Centre for Reference and Research on *Salmonella* (WHOCC-SALM).
|
||||||
@ -161,6 +164,15 @@
|
|||||||
#' @seealso [as.mo()] [microorganisms]
|
#' @seealso [as.mo()] [microorganisms]
|
||||||
#' @examples
|
#' @examples
|
||||||
#' microorganisms.codes
|
#' microorganisms.codes
|
||||||
|
#'
|
||||||
|
#' # 'ECO' or 'eco' is the WHONET code for E. coli:
|
||||||
|
#' microorganisms.codes[microorganisms.codes$code == "ECO", ]
|
||||||
|
#'
|
||||||
|
#' # and therefore, 'eco' will be understood as E. coli in this package:
|
||||||
|
#' mo_info("eco")
|
||||||
|
#'
|
||||||
|
#' # works for all AMR functions:
|
||||||
|
#' mo_is_intrinsic_resistant("eco", ab = "vancomycin")
|
||||||
"microorganisms.codes"
|
"microorganisms.codes"
|
||||||
|
|
||||||
#' Data Set with `r format(nrow(example_isolates), big.mark = " ")` Example Isolates
|
#' Data Set with `r format(nrow(example_isolates), big.mark = " ")` Example Isolates
|
||||||
@ -245,8 +257,11 @@
|
|||||||
#' - `disk_dose`\cr Dose of the used disk diffusion method
|
#' - `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"
|
#' - `breakpoint_S`\cr Lowest MIC value or highest number of millimetres that leads to "S"
|
||||||
#' - `breakpoint_R`\cr Highest MIC value or lowest number of millimetres that leads to "R"
|
#' - `breakpoint_R`\cr Highest MIC value or lowest number of millimetres that leads to "R"
|
||||||
|
#' - `ecoff`\cr Epidemiological cut-off (ECOFF) value, used in antimicrobial susceptibility testing to differentiate between wild-type and non-wild-type strains of bacteria or fungi (use [`as.sir(..., ecoff = TRUE)`][as.sir()] to interpret raw data using ECOFF values)
|
||||||
#' - `uti`\cr A [logical] value (`TRUE`/`FALSE`) to indicate whether the rule applies to a urinary tract infection (UTI)
|
#' - `uti`\cr A [logical] value (`TRUE`/`FALSE`) to indicate whether the rule applies to a urinary tract infection (UTI)
|
||||||
#' @details
|
#' @details
|
||||||
|
#' Clinical breakpoints are validated through [WHONET](https://whonet.org), a free desktop Windows application developed and supported by the WHO Collaborating Centre for Surveillance of Antimicrobial Resistance. More can be read on [their website](https://whonet.org).
|
||||||
|
#'
|
||||||
#' 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, SAS, 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).
|
#' 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, SAS, 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).
|
||||||
#'
|
#'
|
||||||
#' They **allow for machine reading EUCAST and CLSI guidelines**, which is almost impossible with the MS Excel and PDF files distributed by EUCAST and CLSI.
|
#' They **allow for machine reading EUCAST and CLSI guidelines**, which is almost impossible with the MS Excel and PDF files distributed by EUCAST and CLSI.
|
||||||
@ -284,11 +299,8 @@
|
|||||||
#' - `administration`\cr Route of administration, either `r vector_or(dosage$administration)`
|
#' - `administration`\cr Route of administration, either `r vector_or(dosage$administration)`
|
||||||
#' - `notes`\cr Additional dosage notes
|
#' - `notes`\cr Additional dosage notes
|
||||||
#' - `original_txt`\cr Original text in the PDF file of EUCAST
|
#' - `original_txt`\cr Original text in the PDF file of EUCAST
|
||||||
#' - `eucast_version`\cr Version number of the EUCAST Clinical Breakpoints guideline to which these dosages apply
|
#' - `eucast_version`\cr Version number of the EUCAST Clinical Breakpoints guideline to which these dosages apply, either `r vector_or(dosage$eucast_version, quotes = FALSE, sort = TRUE, reverse = TRUE)`
|
||||||
#' @details
|
#' @details
|
||||||
#' This data set is based on `r format_eucast_version_nr(12.0)` and `r format_eucast_version_nr(11.0)`.
|
|
||||||
#'
|
|
||||||
#' ### Direct download
|
|
||||||
#' 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, SAS, 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).
|
#' 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, SAS, 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
|
#' @examples
|
||||||
#' dosage
|
#' dosage
|
||||||
|
2
R/disk.R
2
R/disk.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -63,8 +63,9 @@ format_eucast_version_nr <- function(version, markdown = TRUE) {
|
|||||||
#' @param info a [logical] to indicate whether progress should be printed to the console - the default is only print while in interactive sessions
|
#' @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-options] [`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 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-options] [`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.
|
#' @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.
|
||||||
#' @param version_breakpoints the version number to use for the EUCAST Clinical Breakpoints guideline. Can be either `r vector_or(names(EUCAST_VERSION_BREAKPOINTS), reverse = TRUE)`.
|
#' @param version_breakpoints the version number to use for the EUCAST Clinical Breakpoints guideline. Can be `r vector_or(names(EUCAST_VERSION_BREAKPOINTS), reverse = TRUE)`.
|
||||||
#' @param version_expertrules the version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be either `r vector_or(names(EUCAST_VERSION_EXPERT_RULES), reverse = 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 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 ... 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 ab any (vector of) text that can be coerced to a valid antibiotic drug code with [as.ab()]
|
||||||
@ -167,6 +168,7 @@ eucast_rules <- function(x,
|
|||||||
verbose = FALSE,
|
verbose = FALSE,
|
||||||
version_breakpoints = 12.0,
|
version_breakpoints = 12.0,
|
||||||
version_expertrules = 3.3,
|
version_expertrules = 3.3,
|
||||||
|
version_resistant_phenotypes = 1.2,
|
||||||
ampc_cephalosporin_resistance = NA,
|
ampc_cephalosporin_resistance = NA,
|
||||||
only_sir_columns = FALSE,
|
only_sir_columns = FALSE,
|
||||||
custom_rules = NULL,
|
custom_rules = NULL,
|
||||||
@ -178,6 +180,7 @@ eucast_rules <- function(x,
|
|||||||
meet_criteria(verbose, allow_class = "logical", has_length = 1)
|
meet_criteria(verbose, allow_class = "logical", has_length = 1)
|
||||||
meet_criteria(version_breakpoints, allow_class = c("numeric", "integer"), has_length = 1, is_in = as.double(names(EUCAST_VERSION_BREAKPOINTS)))
|
meet_criteria(version_breakpoints, allow_class = c("numeric", "integer"), has_length = 1, is_in = as.double(names(EUCAST_VERSION_BREAKPOINTS)))
|
||||||
meet_criteria(version_expertrules, allow_class = c("numeric", "integer"), has_length = 1, is_in = as.double(names(EUCAST_VERSION_EXPERT_RULES)))
|
meet_criteria(version_expertrules, allow_class = c("numeric", "integer"), has_length = 1, is_in = as.double(names(EUCAST_VERSION_EXPERT_RULES)))
|
||||||
|
meet_criteria(version_resistant_phenotypes, allow_class = c("numeric", "integer"), has_length = 1, is_in = as.double(names(EUCAST_VERSION_RESISTANTPHENOTYPES)))
|
||||||
meet_criteria(ampc_cephalosporin_resistance, allow_class = c("logical", "character", "sir"), has_length = 1, allow_NA = TRUE, allow_NULL = TRUE)
|
meet_criteria(ampc_cephalosporin_resistance, allow_class = c("logical", "character", "sir"), has_length = 1, allow_NA = TRUE, allow_NULL = TRUE)
|
||||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||||
meet_criteria(custom_rules, allow_class = "custom_eucast_rules", allow_NULL = TRUE)
|
meet_criteria(custom_rules, allow_class = "custom_eucast_rules", allow_NULL = TRUE)
|
||||||
@ -205,6 +208,7 @@ eucast_rules <- function(x,
|
|||||||
|
|
||||||
breakpoints_info <- EUCAST_VERSION_BREAKPOINTS[[which(as.double(names(EUCAST_VERSION_BREAKPOINTS)) == version_breakpoints)]]
|
breakpoints_info <- EUCAST_VERSION_BREAKPOINTS[[which(as.double(names(EUCAST_VERSION_BREAKPOINTS)) == version_breakpoints)]]
|
||||||
expertrules_info <- EUCAST_VERSION_EXPERT_RULES[[which(as.double(names(EUCAST_VERSION_EXPERT_RULES)) == version_expertrules)]]
|
expertrules_info <- EUCAST_VERSION_EXPERT_RULES[[which(as.double(names(EUCAST_VERSION_EXPERT_RULES)) == version_expertrules)]]
|
||||||
|
resistantphenotypes_info <- EUCAST_VERSION_RESISTANTPHENOTYPES[[which(as.double(names(EUCAST_VERSION_RESISTANTPHENOTYPES)) == version_resistant_phenotypes)]]
|
||||||
|
|
||||||
# support old setting (until AMR v1.3.0)
|
# support old setting (until AMR v1.3.0)
|
||||||
if (missing(rules) && !is.null(getOption("AMR.eucast_rules"))) {
|
if (missing(rules) && !is.null(getOption("AMR.eucast_rules"))) {
|
||||||
@ -1185,7 +1189,7 @@ edit_sir <- function(x,
|
|||||||
|
|
||||||
#' @rdname eucast_rules
|
#' @rdname eucast_rules
|
||||||
#' @export
|
#' @export
|
||||||
eucast_dosage <- function(ab, administration = "iv", version_breakpoints = 12.0) {
|
eucast_dosage <- function(ab, administration = "iv", version_breakpoints = 13.0) {
|
||||||
meet_criteria(ab, allow_class = c("character", "numeric", "integer", "factor"))
|
meet_criteria(ab, allow_class = c("character", "numeric", "integer", "factor"))
|
||||||
meet_criteria(administration, allow_class = "character", is_in = dosage$administration[!is.na(dosage$administration)], has_length = 1)
|
meet_criteria(administration, allow_class = "character", is_in = dosage$administration[!is.na(dosage$administration)], has_length = 1)
|
||||||
meet_criteria(version_breakpoints, allow_class = c("numeric", "integer"), has_length = 1, is_in = as.double(names(EUCAST_VERSION_BREAKPOINTS)))
|
meet_criteria(version_breakpoints, allow_class = c("numeric", "integer"), has_length = 1, is_in = as.double(names(EUCAST_VERSION_BREAKPOINTS)))
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -191,13 +191,14 @@ first_isolate <- function(x = NULL,
|
|||||||
}
|
}
|
||||||
meet_criteria(col_specimen, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
meet_criteria(col_specimen, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||||
if (is.logical(col_icu)) {
|
if (is.logical(col_icu)) {
|
||||||
meet_criteria(col_icu, allow_class = "logical", has_length = c(1, nrow(x)), allow_NULL = TRUE)
|
meet_criteria(col_icu, allow_class = "logical", has_length = c(1, nrow(x)), allow_NA = TRUE, allow_NULL = TRUE)
|
||||||
if (length(col_icu) == 1) {
|
x$newvar_is_icu <- col_icu
|
||||||
col_icu <- rep(col_icu, nrow(x))
|
} else if (!is.null(col_icu)) {
|
||||||
}
|
# add "logical" to the allowed classes here, since it may give an error in certain user input, and should then also say that logicals can be used too
|
||||||
} else {
|
|
||||||
meet_criteria(col_icu, allow_class = c("character", "logical"), has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
meet_criteria(col_icu, allow_class = c("character", "logical"), has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||||
col_icu <- x[, col_icu, drop = TRUE]
|
x$newvar_is_icu <- x[, col_icu, drop = TRUE]
|
||||||
|
} else {
|
||||||
|
x$newvar_is_icu <- NA
|
||||||
}
|
}
|
||||||
# method
|
# method
|
||||||
method <- coerce_method(method)
|
method <- coerce_method(method)
|
||||||
@ -251,14 +252,13 @@ first_isolate <- function(x = NULL,
|
|||||||
"Determining first isolates ",
|
"Determining first isolates ",
|
||||||
ifelse(method %in% c("episode-based", "phenotype-based"),
|
ifelse(method %in% c("episode-based", "phenotype-based"),
|
||||||
ifelse(is.infinite(episode_days),
|
ifelse(is.infinite(episode_days),
|
||||||
"without a specified episode length",
|
paste(font_bold("without"), " a specified episode length"),
|
||||||
paste("using an episode length of", episode_days, "days")
|
paste("using an episode length of", font_bold(paste(episode_days, "days")))
|
||||||
),
|
),
|
||||||
""
|
""
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
as_note = FALSE,
|
add_fn = font_red
|
||||||
add_fn = font_black
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,8 +358,7 @@ first_isolate <- function(x = NULL,
|
|||||||
# remove testcodes
|
# remove testcodes
|
||||||
if (!is.null(testcodes_exclude) && isTRUE(info) && message_not_thrown_before("first_isolate", "excludingtestcodes")) {
|
if (!is.null(testcodes_exclude) && isTRUE(info) && message_not_thrown_before("first_isolate", "excludingtestcodes")) {
|
||||||
message_("Excluding test codes: ", vector_and(testcodes_exclude, quotes = TRUE),
|
message_("Excluding test codes: ", vector_and(testcodes_exclude, quotes = TRUE),
|
||||||
add_fn = font_black,
|
add_fn = font_red
|
||||||
as_note = FALSE
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,8 +371,7 @@ first_isolate <- function(x = NULL,
|
|||||||
check_columns_existance(col_specimen, x)
|
check_columns_existance(col_specimen, x)
|
||||||
if (isTRUE(info) && message_not_thrown_before("first_isolate", "excludingspecimen")) {
|
if (isTRUE(info) && message_not_thrown_before("first_isolate", "excludingspecimen")) {
|
||||||
message_("Excluding other than specimen group '", specimen_group, "'",
|
message_("Excluding other than specimen group '", specimen_group, "'",
|
||||||
add_fn = font_black,
|
add_fn = font_red
|
||||||
as_note = FALSE
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -455,15 +453,13 @@ first_isolate <- function(x = NULL,
|
|||||||
message_("Basing inclusion on key antimicrobials, ",
|
message_("Basing inclusion on key antimicrobials, ",
|
||||||
ifelse(ignore_I == FALSE, "not ", ""),
|
ifelse(ignore_I == FALSE, "not ", ""),
|
||||||
"ignoring I",
|
"ignoring I",
|
||||||
add_fn = font_black,
|
add_fn = font_red
|
||||||
as_note = FALSE
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (type == "points") {
|
if (type == "points") {
|
||||||
message_("Basing inclusion on all antimicrobial results, using a points threshold of ",
|
message_("Basing inclusion on all antimicrobial results, using a points threshold of ",
|
||||||
points_threshold,
|
points_threshold,
|
||||||
add_fn = font_black,
|
add_fn = font_red
|
||||||
as_note = FALSE
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -506,33 +502,27 @@ first_isolate <- function(x = NULL,
|
|||||||
(x$other_pat_or_mo | x$more_than_episode_ago)
|
(x$other_pat_or_mo | x$more_than_episode_ago)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
decimal.mark <- getOption("OutDec")
|
||||||
|
big.mark <- ifelse(decimal.mark != ",", ",", " ")
|
||||||
|
|
||||||
# first one as TRUE
|
# first one as TRUE
|
||||||
x[row.start, "newvar_first_isolate"] <- TRUE
|
x[row.start, "newvar_first_isolate"] <- TRUE
|
||||||
# no tests that should be included, or ICU
|
# no tests that should be included, or ICU
|
||||||
if (!is.null(col_testcode)) {
|
if (!is.null(col_testcode)) {
|
||||||
x[which(x[, col_testcode] %in% tolower(testcodes_exclude)), "newvar_first_isolate"] <- FALSE
|
x[which(x[, col_testcode] %in% tolower(testcodes_exclude)), "newvar_first_isolate"] <- FALSE
|
||||||
}
|
}
|
||||||
|
if (any(!is.na(x$newvar_is_icu)) && any(x$newvar_is_icu == TRUE, na.rm = TRUE)) {
|
||||||
if (!is.null(col_icu)) {
|
|
||||||
if (icu_exclude == TRUE) {
|
if (icu_exclude == TRUE) {
|
||||||
if (isTRUE(info)) {
|
if (isTRUE(info)) {
|
||||||
message_("Excluding ", format(sum(col_icu, na.rm = TRUE), big.mark = " "), " isolates from ICU.",
|
message_("Excluding ", format(sum(x$newvar_is_icu, na.rm = TRUE), decimal.mark = decimal.mark, big.mark = big.mark), " isolates from ICU.",
|
||||||
add_fn = font_black,
|
add_fn = font_red)
|
||||||
as_note = FALSE
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
x[which(col_icu), "newvar_first_isolate"] <- FALSE
|
x[which(x$newvar_is_icu), "newvar_first_isolate"] <- FALSE
|
||||||
} else if (isTRUE(info)) {
|
} else if (isTRUE(info)) {
|
||||||
message_("Including isolates from ICU.",
|
message_("Including isolates from ICU.")
|
||||||
add_fn = font_black,
|
|
||||||
as_note = FALSE
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
decimal.mark <- getOption("OutDec")
|
|
||||||
big.mark <- ifelse(decimal.mark != ",", ",", " ")
|
|
||||||
|
|
||||||
if (isTRUE(info)) {
|
if (isTRUE(info)) {
|
||||||
# print group name if used in dplyr::group_by()
|
# print group name if used in dplyr::group_by()
|
||||||
cur_group <- import_fn("cur_group", "dplyr", error_on_fail = FALSE)
|
cur_group <- import_fn("cur_group", "dplyr", error_on_fail = FALSE)
|
||||||
@ -560,11 +550,12 @@ first_isolate <- function(x = NULL,
|
|||||||
# handle empty microorganisms
|
# handle empty microorganisms
|
||||||
if (any(x$newvar_mo == "UNKNOWN", na.rm = TRUE) && isTRUE(info)) {
|
if (any(x$newvar_mo == "UNKNOWN", na.rm = TRUE) && isTRUE(info)) {
|
||||||
message_(
|
message_(
|
||||||
ifelse(include_unknown == TRUE, "Included ", "Excluded "),
|
ifelse(include_unknown == TRUE, "Including ", "Excluding "),
|
||||||
format(sum(x$newvar_mo == "UNKNOWN", na.rm = TRUE),
|
format(sum(x$newvar_mo == "UNKNOWN", na.rm = TRUE),
|
||||||
decimal.mark = decimal.mark, big.mark = big.mark
|
decimal.mark = decimal.mark, big.mark = big.mark
|
||||||
),
|
),
|
||||||
" isolates with a microbial ID 'UNKNOWN' (in column '", font_bold(col_mo), "')"
|
" isolates with a microbial ID 'UNKNOWN' (in column '", font_bold(col_mo), "')",
|
||||||
|
add_fn = font_red
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
x[which(x$newvar_mo == "UNKNOWN"), "newvar_first_isolate"] <- include_unknown
|
x[which(x$newvar_mo == "UNKNOWN"), "newvar_first_isolate"] <- include_unknown
|
||||||
@ -572,10 +563,11 @@ first_isolate <- function(x = NULL,
|
|||||||
# exclude all NAs
|
# exclude all NAs
|
||||||
if (anyNA(x$newvar_mo) && isTRUE(info)) {
|
if (anyNA(x$newvar_mo) && isTRUE(info)) {
|
||||||
message_(
|
message_(
|
||||||
"Excluded ", format(sum(is.na(x$newvar_mo), na.rm = TRUE),
|
"Excluding ", format(sum(is.na(x$newvar_mo), na.rm = TRUE),
|
||||||
decimal.mark = decimal.mark, big.mark = big.mark
|
decimal.mark = decimal.mark, big.mark = big.mark
|
||||||
),
|
),
|
||||||
" isolates with a microbial ID 'NA' (in column '", font_bold(col_mo), "')"
|
" isolates with a microbial ID `NA` (in column '", font_bold(col_mo), "')",
|
||||||
|
add_fn = font_red
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
x[which(is.na(x$newvar_mo)), "newvar_first_isolate"] <- FALSE
|
x[which(is.na(x$newvar_mo)), "newvar_first_isolate"] <- FALSE
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -57,7 +57,7 @@ italicise_taxonomy <- function(string, type = c("markdown", "ansi")) {
|
|||||||
before <- "*"
|
before <- "*"
|
||||||
after <- "*"
|
after <- "*"
|
||||||
} else if (type == "ansi") {
|
} else if (type == "ansi") {
|
||||||
if (!has_colour()) {
|
if (!has_colour() && !identical(Sys.getenv("IN_PKGDOWN"), "true")) {
|
||||||
return(string)
|
return(string)
|
||||||
}
|
}
|
||||||
before <- "\033[3m"
|
before <- "\033[3m"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
5
R/like.R
5
R/like.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -49,6 +49,9 @@
|
|||||||
#' @seealso [grepl()]
|
#' @seealso [grepl()]
|
||||||
|
|
||||||
#' @examples
|
#' @examples
|
||||||
|
#' # data.table has a more limited version of %like%, so unload it:
|
||||||
|
#' try(detach("package:data.table", unload = TRUE), silent = TRUE)
|
||||||
|
#'
|
||||||
#' a <- "This is a test"
|
#' a <- "This is a test"
|
||||||
#' b <- "TEST"
|
#' b <- "TEST"
|
||||||
#' a %like% b
|
#' a %like% b
|
||||||
|
2
R/mdro.R
2
R/mdro.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
2
R/mic.R
2
R/mic.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
139
R/mo.R
139
R/mo.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -95,13 +95,14 @@
|
|||||||
#' 1. Berends MS *et al.* (2022). **AMR: An R Package for Working with Antimicrobial Resistance Data**. *Journal of Statistical Software*, 104(3), 1-31; \doi{10.18637/jss.v104.i03}
|
#' 1. Berends MS *et al.* (2022). **AMR: An R Package for Working with Antimicrobial Resistance Data**. *Journal of Statistical Software*, 104(3), 1-31; \doi{10.18637/jss.v104.i03}
|
||||||
#' 2. Becker K *et al.* (2014). **Coagulase-Negative Staphylococci.** *Clin Microbiol Rev.* 27(4): 870-926; \doi{10.1128/CMR.00109-13}
|
#' 2. Becker K *et al.* (2014). **Coagulase-Negative Staphylococci.** *Clin Microbiol Rev.* 27(4): 870-926; \doi{10.1128/CMR.00109-13}
|
||||||
#' 3. Becker K *et al.* (2019). **Implications of identifying the recently defined members of the *S. aureus* complex, *S. argenteus* and *S. schweitzeri*: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).** *Clin Microbiol Infect*; \doi{10.1016/j.cmi.2019.02.028}
|
#' 3. Becker K *et al.* (2019). **Implications of identifying the recently defined members of the *S. aureus* complex, *S. argenteus* and *S. schweitzeri*: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).** *Clin Microbiol Infect*; \doi{10.1016/j.cmi.2019.02.028}
|
||||||
#' 4. Becker K *et al.* (2020). **Emergence of coagulase-negative staphylococci** *Expert Rev Anti Infect Ther.* 18(4):349-366; \doi{10.1080/14787210.2020.1730813}
|
#' 4. Becker K *et al.* (2020). **Emergence of coagulase-negative staphylococci.** *Expert Rev Anti Infect Ther.* 18(4):349-366; \doi{10.1080/14787210.2020.1730813}
|
||||||
#' 5. Lancefield RC (1933). **A serological differentiation of human and other groups of hemolytic streptococci**. *J Exp Med.* 57(4): 571-95; \doi{10.1084/jem.57.4.571}
|
#' 5. Lancefield RC (1933). **A serological differentiation of human and other groups of hemolytic streptococci.** *J Exp Med.* 57(4): 571-95; \doi{10.1084/jem.57.4.571}
|
||||||
#' 6. Berends MS *et al.* (2022). **Trends in Occurrence and Phenotypic Resistance of Coagulase-Negative Staphylococci (CoNS) Found in Human Blood in the Northern Netherlands between 2013 and 2019** *Microorganisms* 10(9), 1801; \doi{10.3390/microorganisms10091801}
|
#' 6. Berends MS *et al.* (2022). **Trends in Occurrence and Phenotypic Resistance of Coagulase-Negative Staphylococci (CoNS) Found in Human Blood in the Northern Netherlands between 2013 and 2019/** *Micro.rganisms* 10(9), 1801; \doi{10.3390/microorganisms10091801}
|
||||||
#' 7. `r TAXONOMY_VERSION$LPSN$citation` Accessed from <`r TAXONOMY_VERSION$LPSN$url`> on `r documentation_date(TAXONOMY_VERSION$LPSN$accessed_date)`.
|
#' 7. `r TAXONOMY_VERSION$LPSN$citation` Accessed from <`r TAXONOMY_VERSION$LPSN$url`> on `r documentation_date(TAXONOMY_VERSION$LPSN$accessed_date)`.
|
||||||
#' 8. `r TAXONOMY_VERSION$GBIF$citation` Accessed from <`r TAXONOMY_VERSION$GBIF$url`> on `r documentation_date(TAXONOMY_VERSION$GBIF$accessed_date)`.
|
#' 8. `r TAXONOMY_VERSION$GBIF$citation` Accessed from <`r TAXONOMY_VERSION$GBIF$url`> on `r documentation_date(TAXONOMY_VERSION$GBIF$accessed_date)`.
|
||||||
#' 9. `r TAXONOMY_VERSION$SNOMED$citation` URL: <`r TAXONOMY_VERSION$SNOMED$url`>
|
#' 9. `r TAXONOMY_VERSION$BacDive$citation` Accessed from <`r TAXONOMY_VERSION$BacDive$url`> on `r documentation_date(TAXONOMY_VERSION$BacDive$accessed_date)`.
|
||||||
#' 10. Bartlett A *et al.* (2022). **A comprehensive list of bacterial pathogens infecting humans** *Microbiology* 168:001269; \doi{10.1099/mic.0.001269}
|
#' 10. `r TAXONOMY_VERSION$SNOMED$citation` URL: <`r TAXONOMY_VERSION$SNOMED$url`>
|
||||||
|
#' 11. Bartlett A *et al.* (2022). **A comprehensive list of bacterial pathogens infecting humans** *Microbiology* 168:001269; \doi{10.1099/mic.0.001269}
|
||||||
#' @export
|
#' @export
|
||||||
#' @return A [character] [vector] with additional class [`mo`]
|
#' @return A [character] [vector] with additional class [`mo`]
|
||||||
#' @seealso [microorganisms] for the [data.frame] that is being used to determine ID's.
|
#' @seealso [microorganisms] for the [data.frame] that is being used to determine ID's.
|
||||||
@ -171,9 +172,10 @@ as.mo <- function(x,
|
|||||||
|
|
||||||
add_MO_lookup_to_AMR_env()
|
add_MO_lookup_to_AMR_env()
|
||||||
|
|
||||||
if (tryCatch(all(x %in% c(AMR_env$MO_lookup$mo, NA)) &&
|
if (tryCatch(all(x %in% c(AMR_env$MO_lookup$mo, NA)), error = function(e) FALSE) &&
|
||||||
isFALSE(Becker) &&
|
isFALSE(Becker) &&
|
||||||
isFALSE(Lancefield), error = function(e) FALSE)) {
|
isFALSE(Lancefield) &&
|
||||||
|
isTRUE(keep_synonyms)) {
|
||||||
# don't look into valid MO codes, just return them
|
# don't look into valid MO codes, just return them
|
||||||
# is.mo() won't work - MO codes might change between package versions
|
# is.mo() won't work - MO codes might change between package versions
|
||||||
return(set_clean_class(x, new_class = c("mo", "character")))
|
return(set_clean_class(x, new_class = c("mo", "character")))
|
||||||
@ -214,10 +216,10 @@ as.mo <- function(x,
|
|||||||
# From known codes ----
|
# From known codes ----
|
||||||
out[is.na(out) & toupper(x) %in% AMR::microorganisms.codes$code] <- AMR::microorganisms.codes$mo[match(toupper(x)[is.na(out) & toupper(x) %in% AMR::microorganisms.codes$code], AMR::microorganisms.codes$code)]
|
out[is.na(out) & toupper(x) %in% AMR::microorganisms.codes$code] <- AMR::microorganisms.codes$mo[match(toupper(x)[is.na(out) & toupper(x) %in% AMR::microorganisms.codes$code], AMR::microorganisms.codes$code)]
|
||||||
# From SNOMED ----
|
# From SNOMED ----
|
||||||
if (any(is.na(out) & !is.na(x)) && any(is.na(out) & x %in% unlist(AMR_env$MO_lookup$snomed), na.rm = TRUE)) {
|
# based on this extremely fast gem: https://stackoverflow.com/a/11002456/4575331
|
||||||
# found this extremely fast gem here: https://stackoverflow.com/a/11002456/4575331
|
snomeds <- unlist(AMR_env$MO_lookup$snomed)
|
||||||
out[is.na(out) & x %in% unlist(AMR_env$MO_lookup$snomed)] <- AMR_env$MO_lookup$mo[rep(seq_along(AMR_env$MO_lookup$snomed), vapply(FUN.VALUE = double(1), AMR_env$MO_lookup$snomed, length))[match(x[is.na(out) & x %in% unlist(AMR_env$MO_lookup$snomed)], unlist(AMR_env$MO_lookup$snomed))]]
|
snomeds <- snomeds[!is.na(snomeds)]
|
||||||
}
|
out[is.na(out) & x %in% snomeds] <- AMR_env$MO_lookup$mo[rep(seq_along(AMR_env$MO_lookup$snomed), vapply(FUN.VALUE = double(1), AMR_env$MO_lookup$snomed, length))[match(x[is.na(out) & x %in% snomeds], snomeds)]]
|
||||||
# From other familiar output ----
|
# From other familiar output ----
|
||||||
# such as Salmonella groups, colloquial names, etc.
|
# such as Salmonella groups, colloquial names, etc.
|
||||||
out[is.na(out)] <- convert_colloquial_input(x[is.na(out)])
|
out[is.na(out)] <- convert_colloquial_input(x[is.na(out)])
|
||||||
@ -265,6 +267,8 @@ as.mo <- function(x,
|
|||||||
x_out <- trimws2(gsub(" +", " ", x_out, perl = TRUE))
|
x_out <- trimws2(gsub(" +", " ", x_out, perl = TRUE))
|
||||||
x_search_cleaned <- x_out
|
x_search_cleaned <- x_out
|
||||||
x_out <- tolower(x_out)
|
x_out <- tolower(x_out)
|
||||||
|
# when x_search_cleaned are only capitals (such as in codes), make them lowercase to increase matching score
|
||||||
|
x_search_cleaned[x_search_cleaned == toupper(x_search_cleaned)] <- x_out[x_search_cleaned == toupper(x_search_cleaned)]
|
||||||
|
|
||||||
# first check if cleaning led to an exact result, case-insensitive
|
# first check if cleaning led to an exact result, case-insensitive
|
||||||
if (x_out %in% AMR_env$MO_lookup$fullname_lower) {
|
if (x_out %in% AMR_env$MO_lookup$fullname_lower) {
|
||||||
@ -282,22 +286,39 @@ as.mo <- function(x,
|
|||||||
# do a pre-match on first character (and if it contains a space, first chars of first two terms)
|
# do a pre-match on first character (and if it contains a space, first chars of first two terms)
|
||||||
if (length(x_parts) %in% c(2, 3)) {
|
if (length(x_parts) %in% c(2, 3)) {
|
||||||
# for genus + species + subspecies
|
# for genus + species + subspecies
|
||||||
filtr <- which(AMR_env$MO_lookup$full_first == substr(x_parts[1], 1, 1) & (AMR_env$MO_lookup$species_first == substr(x_parts[2], 1, 1) | AMR_env$MO_lookup$subspecies_first == substr(x_parts[2], 1, 1)))
|
if (nchar(gsub("[^a-z]", "", x_parts[1], perl = TRUE)) <= 3) {
|
||||||
|
filtr <- which(AMR_env$MO_lookup$full_first == substr(x_parts[1], 1, 1) &
|
||||||
|
(AMR_env$MO_lookup$species_first == substr(x_parts[2], 1, 1) |
|
||||||
|
AMR_env$MO_lookup$subspecies_first == substr(x_parts[2], 1, 1) |
|
||||||
|
AMR_env$MO_lookup$subspecies_first == substr(x_parts[3], 1, 1)))
|
||||||
|
} else {
|
||||||
|
filtr <- which(AMR_env$MO_lookup$full_first == substr(x_parts[1], 1, 1) |
|
||||||
|
AMR_env$MO_lookup$species_first == substr(x_parts[2], 1, 1) |
|
||||||
|
AMR_env$MO_lookup$subspecies_first == substr(x_parts[2], 1, 1) |
|
||||||
|
AMR_env$MO_lookup$subspecies_first == substr(x_parts[3], 1, 1))
|
||||||
|
}
|
||||||
} else if (length(x_parts) > 3) {
|
} else if (length(x_parts) > 3) {
|
||||||
first_chars <- paste0("(^| )", "[", paste(substr(x_parts, 1, 1), collapse = ""), "]")
|
first_chars <- paste0("(^| )[", paste(substr(x_parts, 1, 1), collapse = ""), "]")
|
||||||
filtr <- which(AMR_env$MO_lookup$full_first %like_case% first_chars)
|
filtr <- which(AMR_env$MO_lookup$full_first %like_case% first_chars)
|
||||||
|
} else if (nchar(x_out) == 3) {
|
||||||
|
# no space and 3 characters - probably a code such as SAU or ECO
|
||||||
|
msg <<- c(msg, paste0("Input \"", x_search, "\" was assumed to be a microorganism code - tried to match on \"", totitle(substr(x_out, 1, 1)), AMR_env$dots, " ", substr(x_out, 2, 3), AMR_env$dots, "\""))
|
||||||
|
filtr <- which(AMR_env$MO_lookup$fullname_lower %like_case% paste0("(^| )", substr(x_out, 1, 1), ".* ", substr(x_out, 2, 3)))
|
||||||
} else if (nchar(x_out) == 4) {
|
} else if (nchar(x_out) == 4) {
|
||||||
# no space and 4 characters - probably a code such as STAU or ESCO
|
# no space and 4 characters - probably a code such as STAU or ESCO
|
||||||
msg <- c(msg, paste0("Input \"", x_search, "\" was assumed to be a microorganism code - tried to match on ", vector_and(c(substr(x_out, 1, 2), substr(x_out, 3, 4)), sort = FALSE)))
|
msg <<- c(msg, paste0("Input \"", x_search, "\" was assumed to be a microorganism code - tried to match on \"", totitle(substr(x_out, 1, 2)), AMR_env$dots, " ", substr(x_out, 3, 4), AMR_env$dots, "\""))
|
||||||
filtr <- which(AMR_env$MO_lookup$fullname_lower %like_case% paste0("(^| )", substr(x_out, 1, 2), ".* ", substr(x_out, 3, 4)))
|
filtr <- which(AMR_env$MO_lookup$fullname_lower %like_case% paste0("(^| )", substr(x_out, 1, 2), ".* ", substr(x_out, 3, 4)))
|
||||||
} else if (nchar(x_out) <= 6) {
|
} else if (nchar(x_out) <= 6) {
|
||||||
# no space and 5-6 characters - probably a code such as STAAUR or ESCCOL
|
# no space and 5-6 characters - probably a code such as STAAUR or ESCCOL
|
||||||
first_part <- paste0(substr(x_out, 1, 2), "[a-z]*", substr(x_out, 3, 3))
|
first_part <- paste0(substr(x_out, 1, 2), "[a-z]*", substr(x_out, 3, 3))
|
||||||
second_part <- substr(x_out, 4, nchar(x_out))
|
second_part <- substr(x_out, 4, nchar(x_out))
|
||||||
msg <- c(msg, paste0("Input \"", x_search, "\" was assumed to be a microorganism code - tried to match on ", vector_and(c(gsub("[a-z]*", "(...)", first_part, fixed = TRUE), second_part), sort = FALSE)))
|
msg <<- c(msg, paste0("Input \"", x_search, "\" was assumed to be a microorganism code - tried to match on \"", gsub("[a-z]*", AMR_env$dots, totitle(first_part), fixed = TRUE), " ", second_part, AMR_env$dots, "\""))
|
||||||
filtr <- which(AMR_env$MO_lookup$fullname_lower %like_case% paste0("(^| )", first_part, ".* ", second_part))
|
filtr <- which(AMR_env$MO_lookup$fullname_lower %like_case% paste0("(^| )", first_part, ".* ", second_part))
|
||||||
} else {
|
} else {
|
||||||
filtr <- which(AMR_env$MO_lookup$full_first == substr(x_out, 1, 1))
|
# for genus or species or subspecies
|
||||||
|
filtr <- which(AMR_env$MO_lookup$full_first == substr(x_parts, 1, 1) |
|
||||||
|
AMR_env$MO_lookup$species_first == substr(x_parts, 1, 1) |
|
||||||
|
AMR_env$MO_lookup$subspecies_first == substr(x_parts, 1, 1))
|
||||||
}
|
}
|
||||||
if (length(filtr) == 0) {
|
if (length(filtr) == 0) {
|
||||||
mo_to_search <- AMR_env$MO_lookup$fullname
|
mo_to_search <- AMR_env$MO_lookup$fullname
|
||||||
@ -314,13 +335,17 @@ as.mo <- function(x,
|
|||||||
minimum_matching_score_current <- minimum_matching_score_current / AMR_env$MO_lookup$prevalence[match(mo_to_search, AMR_env$MO_lookup$fullname)]
|
minimum_matching_score_current <- minimum_matching_score_current / AMR_env$MO_lookup$prevalence[match(mo_to_search, AMR_env$MO_lookup$fullname)]
|
||||||
# correct back for kingdom
|
# correct back for kingdom
|
||||||
minimum_matching_score_current <- minimum_matching_score_current / AMR_env$MO_lookup$kingdom_index[match(mo_to_search, AMR_env$MO_lookup$fullname)]
|
minimum_matching_score_current <- minimum_matching_score_current / AMR_env$MO_lookup$kingdom_index[match(mo_to_search, AMR_env$MO_lookup$fullname)]
|
||||||
} else {
|
minimum_matching_score_current <- pmax(minimum_matching_score_current, m)
|
||||||
minimum_matching_score_current <- minimum_matching_score
|
if (length(x_parts) > 1 && all(m <= 0.55, na.rm = TRUE)) {
|
||||||
|
# if the highest score is 0.5, we have nothing serious - 0.5 is the lowest for pathogenic group 1
|
||||||
|
# make everything NA so the results will get removed below
|
||||||
|
# (we added length(x_parts) > 1 to exclude microbial codes from this rule, such as "STAU")
|
||||||
|
m[seq_len(length(m))] <- NA_real_
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
if (sum(m >= minimum_matching_score_current) > 10) {
|
# minimum_matching_score was set, so remove everything below it
|
||||||
# at least 10 are left over, make the ones under `m` NA
|
m[m < minimum_matching_score] <- NA_real_
|
||||||
m[m < minimum_matching_score_current] <- NA_real_
|
minimum_matching_score_current <- minimum_matching_score
|
||||||
}
|
}
|
||||||
|
|
||||||
top_hits <- mo_to_search[order(m, decreasing = TRUE, na.last = NA)] # na.last = NA will remove the NAs
|
top_hits <- mo_to_search[order(m, decreasing = TRUE, na.last = NA)] # na.last = NA will remove the NAs
|
||||||
@ -547,7 +572,7 @@ mo_cleaning_regex <- function() {
|
|||||||
"|",
|
"|",
|
||||||
"([({]|\\[).+([})]|\\])",
|
"([({]|\\[).+([})]|\\])",
|
||||||
"|",
|
"|",
|
||||||
"(^| )(e?spp|e?ssp|e?ss|e?sp|e?subsp|sube?species|biovar|biotype|serovar|serogr.?up|e?species)[.]*( |$|(complex|group)$))"
|
"(^| )(e?spp|e?ssp|e?ss|e?sp|e?subsp|sube?species|biovar|biotype|serovar|var|serogr.?up|e?species)[.]*( |$|(complex|group)$))"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -799,9 +824,13 @@ rep.mo <- function(x, ...) {
|
|||||||
#' @export
|
#' @export
|
||||||
#' @noRd
|
#' @noRd
|
||||||
print.mo_uncertainties <- function(x, n = 10, ...) {
|
print.mo_uncertainties <- function(x, n = 10, ...) {
|
||||||
|
more_than_50 <- FALSE
|
||||||
if (NROW(x) == 0) {
|
if (NROW(x) == 0) {
|
||||||
cat(word_wrap("No uncertainties to show. Only uncertainties of the last call of `as.mo()` or any `mo_*()` function are stored.\n\n", add_fn = font_blue))
|
cat(word_wrap("No uncertainties to show. Only uncertainties of the last call to `as.mo()` or any `mo_*()` function are stored.\n\n", add_fn = font_blue))
|
||||||
return(invisible(NULL))
|
return(invisible(NULL))
|
||||||
|
} else if (NROW(x) > 50) {
|
||||||
|
more_than_50 <- TRUE
|
||||||
|
x <- x[1:50, , drop = FALSE]
|
||||||
}
|
}
|
||||||
|
|
||||||
cat(word_wrap("Matching scores are based on the resemblance between the input and the full taxonomic name, and the pathogenicity in humans. See `?mo_matching_score`.\n\n", add_fn = font_blue))
|
cat(word_wrap("Matching scores are based on the resemblance between the input and the full taxonomic name, and the pathogenicity in humans. See `?mo_matching_score`.\n\n", add_fn = font_blue))
|
||||||
@ -815,20 +844,20 @@ print.mo_uncertainties <- function(x, n = 10, ...) {
|
|||||||
|
|
||||||
if (has_colour()) {
|
if (has_colour()) {
|
||||||
cat(word_wrap("Colour keys: ",
|
cat(word_wrap("Colour keys: ",
|
||||||
col_red(" 0.000-0.499 "),
|
col_red(" 0.000-0.549 "),
|
||||||
col_orange(" 0.500-0.599 "),
|
col_orange(" 0.550-0.649 "),
|
||||||
col_yellow(" 0.600-0.699 "),
|
col_yellow(" 0.650-0.749 "),
|
||||||
col_green(" 0.700-1.000"),
|
col_green(" 0.750-1.000"),
|
||||||
add_fn = font_blue
|
add_fn = font_blue
|
||||||
), font_green_bg(" "), "\n", sep = "")
|
), font_green_bg(" "), "\n", sep = "")
|
||||||
}
|
}
|
||||||
|
|
||||||
score_set_colour <- function(text, scores) {
|
score_set_colour <- function(text, scores) {
|
||||||
# set colours to scores
|
# set colours to scores
|
||||||
text[scores >= 0.7] <- col_green(text[scores >= 0.7])
|
text[scores >= 0.75] <- col_green(text[scores >= 0.75])
|
||||||
text[scores >= 0.6 & scores < 0.7] <- col_yellow(text[scores >= 0.6 & scores < 0.7])
|
text[scores >= 0.65 & scores < 0.75] <- col_yellow(text[scores >= 0.65 & scores < 0.75])
|
||||||
text[scores >= 0.5 & scores < 0.6] <- col_orange(text[scores >= 0.5 & scores < 0.6])
|
text[scores >= 0.55 & scores < 0.65] <- col_orange(text[scores >= 0.55 & scores < 0.65])
|
||||||
text[scores < 0.5] <- col_red(text[scores < 0.5])
|
text[scores < 0.55] <- col_red(text[scores < 0.55])
|
||||||
text
|
text
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -888,8 +917,6 @@ print.mo_uncertainties <- function(x, n = 10, ...) {
|
|||||||
),
|
),
|
||||||
collapse = "\n"
|
collapse = "\n"
|
||||||
),
|
),
|
||||||
# Add "Based on {input}" text if it differs from the original input
|
|
||||||
ifelse(x[i, ]$original_input != x[i, ]$input, paste0(strrep(" ", nchar(x[i, ]$original_input) + 6), "Based on input \"", x[i, ]$input, "\""), ""),
|
|
||||||
# Add note if result was coerced to accepted taxonomic name
|
# Add note if result was coerced to accepted taxonomic name
|
||||||
ifelse(x[i, ]$keep_synonyms == FALSE & x[i, ]$mo %in% AMR_env$MO_lookup$mo[which(AMR_env$MO_lookup$status == "synonym")],
|
ifelse(x[i, ]$keep_synonyms == FALSE & x[i, ]$mo %in% AMR_env$MO_lookup$mo[which(AMR_env$MO_lookup$status == "synonym")],
|
||||||
paste0(
|
paste0(
|
||||||
@ -911,6 +938,9 @@ print.mo_uncertainties <- function(x, n = 10, ...) {
|
|||||||
if (isTRUE(any_maxed_out)) {
|
if (isTRUE(any_maxed_out)) {
|
||||||
cat(font_blue(word_wrap("\nOnly the first ", n, " other matches of each record are shown. Run `print(mo_uncertainties(), n = ...)` to view more entries, or save `mo_uncertainties()` to an object.")))
|
cat(font_blue(word_wrap("\nOnly the first ", n, " other matches of each record are shown. Run `print(mo_uncertainties(), n = ...)` to view more entries, or save `mo_uncertainties()` to an object.")))
|
||||||
}
|
}
|
||||||
|
if (isTRUE(more_than_50)) {
|
||||||
|
cat(font_blue(word_wrap("\nOnly the first 50 uncertainties are shown. Run `View(mo_uncertainties())` to view all entries, or save `mo_uncertainties()` to an object.")))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @method print mo_renamed
|
#' @method print mo_renamed
|
||||||
@ -947,25 +977,25 @@ convert_colloquial_input <- function(x) {
|
|||||||
out <- rep(NA_character_, length(x))
|
out <- rep(NA_character_, length(x))
|
||||||
|
|
||||||
# Streptococci, like GBS = Group B Streptococci (B_STRPT_GRPB)
|
# Streptococci, like GBS = Group B Streptococci (B_STRPT_GRPB)
|
||||||
out[x %like_case% "^g[abcdfghkl]s$"] <- gsub("g([abcdfghkl])s",
|
out[x %like_case% "^g[abcdefghijkl]s$"] <- gsub("g([abcdefghijkl])s",
|
||||||
"B_STRPT_GRP\\U\\1",
|
"B_STRPT_GRP\\U\\1",
|
||||||
x[x %like_case% "^g[abcdfghkl]s$"],
|
x[x %like_case% "^g[abcdefghijkl]s$"],
|
||||||
perl = TRUE
|
perl = TRUE
|
||||||
)
|
)
|
||||||
# Streptococci in different languages, like "estreptococos grupo B"
|
# Streptococci in different languages, like "estreptococos grupo B"
|
||||||
out[x %like_case% "strepto[ck]o[ck].* [abcdfghkl]$"] <- gsub(".*e?strepto[ck]o[ck].* ([abcdfghkl])$",
|
out[x %like_case% "strepto[ck]o[ck].* [abcdefghijkl]$"] <- gsub(".*e?strepto[ck]o[ck].* ([abcdefghijkl])$",
|
||||||
"B_STRPT_GRP\\U\\1",
|
"B_STRPT_GRP\\U\\1",
|
||||||
x[x %like_case% "strepto[ck]o[ck].* [abcdfghkl]$"],
|
x[x %like_case% "strepto[ck]o[ck].* [abcdefghijkl]$"],
|
||||||
perl = TRUE
|
perl = TRUE
|
||||||
)
|
)
|
||||||
out[x %like_case% "strep[a-z]* group [abcdfghkl]$"] <- gsub(".* ([abcdfghkl])$",
|
out[x %like_case% "strep[a-z]* group [abcdefghijkl]$"] <- gsub(".* ([abcdefghijkl])$",
|
||||||
"B_STRPT_GRP\\U\\1",
|
"B_STRPT_GRP\\U\\1",
|
||||||
x[x %like_case% "strep[a-z]* group [abcdfghkl]$"],
|
x[x %like_case% "strep[a-z]* group [abcdefghijkl]$"],
|
||||||
perl = TRUE
|
perl = TRUE
|
||||||
)
|
)
|
||||||
out[x %like_case% "group [abcdfghkl] strepto[ck]o[ck]"] <- gsub(".*group ([abcdfghkl]) strepto[ck]o[ck].*",
|
out[x %like_case% "group [abcdefghijkl] strepto[ck]o[ck]"] <- gsub(".*group ([abcdefghijkl]) strepto[ck]o[ck].*",
|
||||||
"B_STRPT_GRP\\U\\1",
|
"B_STRPT_GRP\\U\\1",
|
||||||
x[x %like_case% "group [abcdfghkl] strepto[ck]o[ck]"],
|
x[x %like_case% "group [abcdefghijkl] strepto[ck]o[ck]"],
|
||||||
perl = TRUE
|
perl = TRUE
|
||||||
)
|
)
|
||||||
out[x %like_case% "ha?emoly.*strep"] <- "B_STRPT_HAEM"
|
out[x %like_case% "ha?emoly.*strep"] <- "B_STRPT_HAEM"
|
||||||
@ -975,14 +1005,14 @@ convert_colloquial_input <- function(x) {
|
|||||||
out[x %like_case% "(viridans.* (strepto|^s).*|^vgs[^a-z]*$)"] <- "B_STRPT_VIRI"
|
out[x %like_case% "(viridans.* (strepto|^s).*|^vgs[^a-z]*$)"] <- "B_STRPT_VIRI"
|
||||||
|
|
||||||
# Salmonella in different languages, like "Salmonella grupo B"
|
# Salmonella in different languages, like "Salmonella grupo B"
|
||||||
out[x %like_case% "salmonella.* [abcd]$"] <- gsub(".*salmonella.* ([abcd])$",
|
out[x %like_case% "salmonella.* [abcdefgh]$"] <- gsub(".*salmonella.* ([abcdefgh])$",
|
||||||
"B_SLMNL_GRP\\U\\1",
|
"B_SLMNL_GRP\\U\\1",
|
||||||
x[x %like_case% "salmonella.* [abcd]$"],
|
x[x %like_case% "salmonella.* [abcdefgh]$"],
|
||||||
perl = TRUE
|
perl = TRUE
|
||||||
)
|
)
|
||||||
out[x %like_case% "group [abcd] salmonella"] <- gsub(".*group ([abcd]) salmonella*",
|
out[x %like_case% "group [abcdefgh] salmonella"] <- gsub(".*group ([abcdefgh]) salmonella*",
|
||||||
"B_SLMNL_GRP\\U\\1",
|
"B_SLMNL_GRP\\U\\1",
|
||||||
x[x %like_case% "group [abcd] salmonella"],
|
x[x %like_case% "group [abcdefgh] salmonella"],
|
||||||
perl = TRUE
|
perl = TRUE
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -995,6 +1025,8 @@ convert_colloquial_input <- function(x) {
|
|||||||
out[x %like_case% "( |^)gram[-]( |$)"] <- "B_GRAMN"
|
out[x %like_case% "( |^)gram[-]( |$)"] <- "B_GRAMN"
|
||||||
out[x %like_case% "gram[ -]?pos.*"] <- "B_GRAMP"
|
out[x %like_case% "gram[ -]?pos.*"] <- "B_GRAMP"
|
||||||
out[x %like_case% "( |^)gram[+]( |$)"] <- "B_GRAMP"
|
out[x %like_case% "( |^)gram[+]( |$)"] <- "B_GRAMP"
|
||||||
|
out[x %like_case% "anaerob[a-z]+ .*gram[ -]?neg.*"] <- "B_ANAER-NEG"
|
||||||
|
out[x %like_case% "anaerob[a-z]+ .*gram[ -]?pos.*"] <- "B_ANAER-POS"
|
||||||
out[is.na(out) & x %like_case% "anaerob[a-z]+ (micro)?.*organism"] <- "B_ANAER"
|
out[is.na(out) & x %like_case% "anaerob[a-z]+ (micro)?.*organism"] <- "B_ANAER"
|
||||||
|
|
||||||
# yeasts and fungi
|
# yeasts and fungi
|
||||||
@ -1006,7 +1038,7 @@ convert_colloquial_input <- function(x) {
|
|||||||
out[x %like_case% "gono[ck]o[ck]"] <- "B_NESSR_GNRR"
|
out[x %like_case% "gono[ck]o[ck]"] <- "B_NESSR_GNRR"
|
||||||
out[x %like_case% "pneumo[ck]o[ck]"] <- "B_STRPT_PNMN"
|
out[x %like_case% "pneumo[ck]o[ck]"] <- "B_STRPT_PNMN"
|
||||||
|
|
||||||
# unexisting names (xxx and con are WHONET codes)
|
# unexisting names (con is the WHONET code for contamination)
|
||||||
out[x %in% c("con", "other", "none", "unknown") | x %like_case% "virus"] <- "UNKNOWN"
|
out[x %in% c("con", "other", "none", "unknown") | x %like_case% "virus"] <- "UNKNOWN"
|
||||||
|
|
||||||
# WHONET has a lot of E. coli and Vibrio cholerae names
|
# WHONET has a lot of E. coli and Vibrio cholerae names
|
||||||
@ -1017,18 +1049,23 @@ convert_colloquial_input <- function(x) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
italicise <- function(x) {
|
italicise <- function(x) {
|
||||||
|
if (!has_colour()) {
|
||||||
|
return(x)
|
||||||
|
}
|
||||||
out <- font_italic(x, collapse = NULL)
|
out <- font_italic(x, collapse = NULL)
|
||||||
|
# city-like serovars of Salmonella (start with a capital)
|
||||||
out[x %like_case% "Salmonella [A-Z]"] <- paste(
|
out[x %like_case% "Salmonella [A-Z]"] <- paste(
|
||||||
font_italic("Salmonella"),
|
font_italic("Salmonella"),
|
||||||
gsub("Salmonella ", "", x[x %like_case% "Salmonella [A-Z]"])
|
gsub("Salmonella ", "", x[x %like_case% "Salmonella [A-Z]"])
|
||||||
)
|
)
|
||||||
|
# streptococcal groups
|
||||||
out[x %like_case% "Streptococcus [A-Z]"] <- paste(
|
out[x %like_case% "Streptococcus [A-Z]"] <- paste(
|
||||||
font_italic("Streptococcus"),
|
font_italic("Streptococcus"),
|
||||||
gsub("Streptococcus ", "", x[x %like_case% "Streptococcus [A-Z]"])
|
gsub("Streptococcus ", "", x[x %like_case% "Streptococcus [A-Z]"])
|
||||||
)
|
)
|
||||||
if (has_colour()) {
|
# be sure not to make these italic
|
||||||
out <- gsub("(Group|group|Complex|complex)(\033\\[23m)?", "\033[23m\\1", out, perl = TRUE)
|
out <- gsub("([ -]*)(Group|group|Complex|complex)(\033\\[23m)?", "\033[23m\\1\\2", out, perl = TRUE)
|
||||||
}
|
out <- gsub("(\033\\[3m)?(Beta[-]haemolytic|Coagulase[-](postive|negative)) ", "\\2 \033[3m", out, perl = TRUE)
|
||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -54,6 +54,8 @@
|
|||||||
#'
|
#'
|
||||||
#' 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 antibiotics).
|
||||||
#'
|
#'
|
||||||
|
#' 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.
|
||||||
|
#'
|
||||||
#' The function [mo_url()] will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
|
#' The function [mo_url()] will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
|
||||||
#'
|
#'
|
||||||
#' SNOMED codes ([mo_snomed()]) are from the version of `r documentation_date(TAXONOMY_VERSION$SNOMED$accessed_date)`. See *Source* and the [microorganisms] data set for more info.
|
#' SNOMED codes ([mo_snomed()]) are from the version of `r documentation_date(TAXONOMY_VERSION$SNOMED$accessed_date)`. See *Source* and the [microorganisms] data set for more info.
|
||||||
@ -480,7 +482,7 @@ mo_gramstain <- function(x, language = get_AMR_locale(), keep_synonyms = getOpti
|
|||||||
# but class Negativicutes (of phylum Bacillota) are Gram-negative!
|
# but class Negativicutes (of phylum Bacillota) are Gram-negative!
|
||||||
mo_class(x.mo, language = NULL, keep_synonyms = keep_synonyms) != "Negativicutes")
|
mo_class(x.mo, language = NULL, keep_synonyms = keep_synonyms) != "Negativicutes")
|
||||||
# and of course our own ID for Gram-positives
|
# and of course our own ID for Gram-positives
|
||||||
| x.mo == "B_GRAMP"] <- "Gram-positive"
|
| x.mo %in% c("B_GRAMP", "B_ANAER-POS")] <- "Gram-positive"
|
||||||
|
|
||||||
load_mo_uncertainties(metadata)
|
load_mo_uncertainties(metadata)
|
||||||
translate_into_language(x, language = language, only_unknown = FALSE)
|
translate_into_language(x, language = language, only_unknown = FALSE)
|
||||||
@ -589,6 +591,40 @@ mo_is_intrinsic_resistant <- function(x, ab, language = get_AMR_locale(), keep_s
|
|||||||
paste(x, ab) %in% AMR_env$intrinsic_resistant
|
paste(x, ab) %in% AMR_env$intrinsic_resistant
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#' @rdname mo_property
|
||||||
|
#' @export
|
||||||
|
mo_oxygen_tolerance <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) {
|
||||||
|
if (missing(x)) {
|
||||||
|
# this tries to find the data and an 'mo' column
|
||||||
|
x <- find_mo_col(fn = "mo_oxygen_tolerance")
|
||||||
|
}
|
||||||
|
meet_criteria(x, allow_NA = TRUE)
|
||||||
|
language <- validate_language(language)
|
||||||
|
meet_criteria(keep_synonyms, allow_class = "logical", has_length = 1)
|
||||||
|
|
||||||
|
mo_validate(x = x, property = "oxygen_tolerance", language = language, keep_synonyms = keep_synonyms, ...)
|
||||||
|
}
|
||||||
|
|
||||||
|
#' @rdname mo_property
|
||||||
|
#' @export
|
||||||
|
mo_is_anaerobic <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) {
|
||||||
|
if (missing(x)) {
|
||||||
|
# this tries to find the data and an 'mo' column
|
||||||
|
x <- find_mo_col(fn = "mo_is_anaerobic")
|
||||||
|
}
|
||||||
|
meet_criteria(x, allow_NA = TRUE)
|
||||||
|
language <- validate_language(language)
|
||||||
|
meet_criteria(keep_synonyms, allow_class = "logical", has_length = 1)
|
||||||
|
|
||||||
|
x.mo <- as.mo(x, language = language, keep_synonyms = keep_synonyms, ...)
|
||||||
|
metadata <- get_mo_uncertainties()
|
||||||
|
oxygen <- mo_oxygen_tolerance(x.mo, language = NULL, keep_synonyms = keep_synonyms)
|
||||||
|
load_mo_uncertainties(metadata)
|
||||||
|
out <- oxygen == "anaerobe" & !is.na(oxygen)
|
||||||
|
out[x.mo %in% c(NA_character_, "UNKNOWN")] <- NA
|
||||||
|
out
|
||||||
|
}
|
||||||
|
|
||||||
#' @rdname mo_property
|
#' @rdname mo_property
|
||||||
#' @export
|
#' @export
|
||||||
mo_snomed <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) {
|
mo_snomed <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) {
|
||||||
@ -791,9 +827,12 @@ mo_info <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("A
|
|||||||
status = mo_status(y, language = language, keep_synonyms = keep_synonyms),
|
status = mo_status(y, language = language, keep_synonyms = keep_synonyms),
|
||||||
synonyms = mo_synonyms(y, keep_synonyms = keep_synonyms),
|
synonyms = mo_synonyms(y, keep_synonyms = keep_synonyms),
|
||||||
gramstain = mo_gramstain(y, language = language, keep_synonyms = keep_synonyms),
|
gramstain = mo_gramstain(y, language = language, keep_synonyms = keep_synonyms),
|
||||||
|
oxygen_tolerance = mo_oxygen_tolerance(y, language = language, keep_synonyms = keep_synonyms),
|
||||||
url = unname(mo_url(y, open = FALSE, keep_synonyms = keep_synonyms)),
|
url = unname(mo_url(y, open = FALSE, keep_synonyms = keep_synonyms)),
|
||||||
ref = mo_ref(y, keep_synonyms = keep_synonyms),
|
ref = mo_ref(y, keep_synonyms = keep_synonyms),
|
||||||
snomed = unlist(mo_snomed(y, keep_synonyms = keep_synonyms))
|
snomed = unlist(mo_snomed(y, keep_synonyms = keep_synonyms)),
|
||||||
|
lpsn = mo_lpsn(y, language = language, keep_synonyms = keep_synonyms),
|
||||||
|
gbif = mo_gbif(y, language = language, keep_synonyms = keep_synonyms)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
2
R/pca.R
2
R/pca.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
2
R/plot.R
2
R/plot.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
10
R/random.R
10
R/random.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -136,11 +136,11 @@ random_exec <- function(type, size, mo = NULL, ab = NULL) {
|
|||||||
# get highest/lowest +/- random 1 to 3 higher factors of two
|
# get highest/lowest +/- random 1 to 3 higher factors of two
|
||||||
max_range <- mic_range[min(
|
max_range <- mic_range[min(
|
||||||
length(mic_range),
|
length(mic_range),
|
||||||
which(mic_range == max(df$breakpoint_R)) + sample(c(1:3), 1)
|
which(mic_range == max(df$breakpoint_R, na.rm = TRUE)) + sample(c(1:3), 1)
|
||||||
)]
|
)]
|
||||||
min_range <- mic_range[max(
|
min_range <- mic_range[max(
|
||||||
1,
|
1,
|
||||||
which(mic_range == min(df$breakpoint_S)) - sample(c(1:3), 1)
|
which(mic_range == min(df$breakpoint_S, na.rm = TRUE)) - sample(c(1:3), 1)
|
||||||
)]
|
)]
|
||||||
|
|
||||||
mic_range_new <- mic_range[mic_range <= max_range & mic_range >= min_range]
|
mic_range_new <- mic_range[mic_range <= max_range & mic_range >= min_range]
|
||||||
@ -158,8 +158,8 @@ random_exec <- function(type, size, mo = NULL, ab = NULL) {
|
|||||||
return(out)
|
return(out)
|
||||||
} else if (type == "DISK") {
|
} else if (type == "DISK") {
|
||||||
set_range <- seq(
|
set_range <- seq(
|
||||||
from = as.integer(min(df$breakpoint_R) / 1.25),
|
from = as.integer(min(df$breakpoint_R, na.rm = TRUE) / 1.25),
|
||||||
to = as.integer(max(df$breakpoint_S) * 1.25),
|
to = as.integer(max(df$breakpoint_S, na.rm = TRUE) * 1.25),
|
||||||
by = 1
|
by = 1
|
||||||
)
|
)
|
||||||
out <- sample(set_range, size = size, replace = TRUE)
|
out <- sample(set_range, size = size, replace = TRUE)
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
35
R/sir.R
35
R/sir.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -43,6 +43,7 @@
|
|||||||
#' @param add_intrinsic_resistance *(only useful when using a EUCAST guideline)* a [logical] to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in *Klebsiella* species. Determination is based on the [intrinsic_resistant] data set, that itself is based on `r format_eucast_version_nr(3.3)`.
|
#' @param add_intrinsic_resistance *(only useful when using a EUCAST guideline)* a [logical] to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in *Klebsiella* species. Determination is based on the [intrinsic_resistant] data set, that itself is based on `r format_eucast_version_nr(3.3)`.
|
||||||
#' @param include_screening a [logical] to indicate that clinical breakpoints for screening are allowed - the default is `FALSE`. Can also be set with the [package option][AMR-options] [`AMR_include_screening`][AMR-options].
|
#' @param include_screening a [logical] to indicate that clinical breakpoints for screening are allowed - the default is `FALSE`. Can also be set with the [package option][AMR-options] [`AMR_include_screening`][AMR-options].
|
||||||
#' @param include_PKPD a [logical] to indicate that PK/PD clinical breakpoints must be applied as a last resort - the default is `TRUE`. Can also be set with the [package option][AMR-options] [`AMR_include_PKPD`][AMR-options].
|
#' @param include_PKPD a [logical] to indicate that PK/PD clinical breakpoints must be applied as a last resort - the default is `TRUE`. Can also be set with the [package option][AMR-options] [`AMR_include_PKPD`][AMR-options].
|
||||||
|
#' @param ecoff a [logical] to indicate that ECOFF (Epidemiological Cut-Off) values must be used **instead** of other clinical breakpoints - the default is `FALSE`. Can also be set with the [package option][AMR-options] [`AMR_ecoff`][AMR-options].
|
||||||
#' @param reference_data a [data.frame] to be used for interpretation, which defaults to the [clinical_breakpoints] data set. Changing this argument allows for using own interpretation guidelines. This argument must contain a data set that is equal in structure to the [clinical_breakpoints] data set (same column names and column types). Please note that the `guideline` argument will be ignored when `reference_data` is manually set.
|
#' @param reference_data a [data.frame] to be used for interpretation, which defaults to the [clinical_breakpoints] data set. Changing this argument allows for using own interpretation guidelines. This argument must contain a data set that is equal in structure to the [clinical_breakpoints] data set (same column names and column types). Please note that the `guideline` argument will be ignored when `reference_data` is manually set.
|
||||||
#' @param threshold maximum fraction of invalid antimicrobial interpretations of `x`, see *Examples*
|
#' @param threshold maximum fraction of invalid antimicrobial interpretations of `x`, see *Examples*
|
||||||
#' @param ... for using on a [data.frame]: names of columns to apply [as.sir()] on (supports tidy selection such as `column1:column4`). Otherwise: arguments passed on to methods.
|
#' @param ... for using on a [data.frame]: names of columns to apply [as.sir()] on (supports tidy selection such as `column1:column4`). Otherwise: arguments passed on to methods.
|
||||||
@ -428,6 +429,7 @@ as.sir.mic <- function(x,
|
|||||||
reference_data = AMR::clinical_breakpoints,
|
reference_data = AMR::clinical_breakpoints,
|
||||||
include_screening = getOption("AMR_include_screening", FALSE),
|
include_screening = getOption("AMR_include_screening", FALSE),
|
||||||
include_PKPD = getOption("AMR_include_PKPD", TRUE),
|
include_PKPD = getOption("AMR_include_PKPD", TRUE),
|
||||||
|
ecoff = getOption("AMR_ecoff", FALSE),
|
||||||
...) {
|
...) {
|
||||||
as_sir_method(
|
as_sir_method(
|
||||||
method_short = "mic",
|
method_short = "mic",
|
||||||
@ -442,6 +444,7 @@ as.sir.mic <- function(x,
|
|||||||
reference_data = reference_data,
|
reference_data = reference_data,
|
||||||
include_screening = include_screening,
|
include_screening = include_screening,
|
||||||
include_PKPD = include_PKPD,
|
include_PKPD = include_PKPD,
|
||||||
|
ecoff = ecoff,
|
||||||
...
|
...
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -457,6 +460,7 @@ as.sir.disk <- function(x,
|
|||||||
reference_data = AMR::clinical_breakpoints,
|
reference_data = AMR::clinical_breakpoints,
|
||||||
include_screening = getOption("AMR_include_screening", FALSE),
|
include_screening = getOption("AMR_include_screening", FALSE),
|
||||||
include_PKPD = getOption("AMR_include_PKPD", TRUE),
|
include_PKPD = getOption("AMR_include_PKPD", TRUE),
|
||||||
|
ecoff = getOption("AMR_ecoff", FALSE),
|
||||||
...) {
|
...) {
|
||||||
as_sir_method(
|
as_sir_method(
|
||||||
method_short = "disk",
|
method_short = "disk",
|
||||||
@ -471,6 +475,7 @@ as.sir.disk <- function(x,
|
|||||||
reference_data = reference_data,
|
reference_data = reference_data,
|
||||||
include_screening = include_screening,
|
include_screening = include_screening,
|
||||||
include_PKPD = include_PKPD,
|
include_PKPD = include_PKPD,
|
||||||
|
ecoff = ecoff,
|
||||||
...
|
...
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -486,7 +491,8 @@ as.sir.data.frame <- function(x,
|
|||||||
add_intrinsic_resistance = FALSE,
|
add_intrinsic_resistance = FALSE,
|
||||||
reference_data = AMR::clinical_breakpoints,
|
reference_data = AMR::clinical_breakpoints,
|
||||||
include_screening = getOption("AMR_include_screening", FALSE),
|
include_screening = getOption("AMR_include_screening", FALSE),
|
||||||
include_PKPD = getOption("AMR_include_PKPD", TRUE)) {
|
include_PKPD = getOption("AMR_include_PKPD", TRUE),
|
||||||
|
ecoff = getOption("AMR_ecoff", FALSE)) {
|
||||||
meet_criteria(x, allow_class = "data.frame") # will also check for dimensions > 0
|
meet_criteria(x, allow_class = "data.frame") # will also check for dimensions > 0
|
||||||
meet_criteria(col_mo, allow_class = "character", is_in = colnames(x), allow_NULL = TRUE)
|
meet_criteria(col_mo, allow_class = "character", is_in = colnames(x), allow_NULL = TRUE)
|
||||||
meet_criteria(guideline, allow_class = "character", has_length = 1)
|
meet_criteria(guideline, allow_class = "character", has_length = 1)
|
||||||
@ -494,6 +500,9 @@ as.sir.data.frame <- function(x,
|
|||||||
meet_criteria(conserve_capped_values, allow_class = "logical", has_length = 1)
|
meet_criteria(conserve_capped_values, allow_class = "logical", has_length = 1)
|
||||||
meet_criteria(add_intrinsic_resistance, allow_class = "logical", has_length = 1)
|
meet_criteria(add_intrinsic_resistance, allow_class = "logical", has_length = 1)
|
||||||
meet_criteria(reference_data, allow_class = "data.frame")
|
meet_criteria(reference_data, allow_class = "data.frame")
|
||||||
|
meet_criteria(include_screening, allow_class = "logical", has_length = 1)
|
||||||
|
meet_criteria(include_PKPD, allow_class = "logical", has_length = 1)
|
||||||
|
meet_criteria(ecoff, allow_class = "logical", has_length = 1)
|
||||||
|
|
||||||
x.bak <- x
|
x.bak <- x
|
||||||
for (i in seq_len(ncol(x))) {
|
for (i in seq_len(ncol(x))) {
|
||||||
@ -625,6 +634,7 @@ as.sir.data.frame <- function(x,
|
|||||||
reference_data = reference_data,
|
reference_data = reference_data,
|
||||||
include_screening = include_screening,
|
include_screening = include_screening,
|
||||||
include_PKPD = include_PKPD,
|
include_PKPD = include_PKPD,
|
||||||
|
ecoff = ecoff,
|
||||||
is_data.frame = TRUE
|
is_data.frame = TRUE
|
||||||
)
|
)
|
||||||
} else if (types[i] == "disk") {
|
} else if (types[i] == "disk") {
|
||||||
@ -642,6 +652,7 @@ as.sir.data.frame <- function(x,
|
|||||||
reference_data = reference_data,
|
reference_data = reference_data,
|
||||||
include_screening = include_screening,
|
include_screening = include_screening,
|
||||||
include_PKPD = include_PKPD,
|
include_PKPD = include_PKPD,
|
||||||
|
ecoff = ecoff,
|
||||||
is_data.frame = TRUE
|
is_data.frame = TRUE
|
||||||
)
|
)
|
||||||
} else if (types[i] == "sir") {
|
} else if (types[i] == "sir") {
|
||||||
@ -711,6 +722,7 @@ as_sir_method <- function(method_short,
|
|||||||
reference_data,
|
reference_data,
|
||||||
include_screening,
|
include_screening,
|
||||||
include_PKPD,
|
include_PKPD,
|
||||||
|
ecoff,
|
||||||
...) {
|
...) {
|
||||||
meet_criteria(x, allow_NA = TRUE, .call_depth = -2)
|
meet_criteria(x, allow_NA = TRUE, .call_depth = -2)
|
||||||
meet_criteria(mo, allow_class = c("mo", "character"), allow_NULL = TRUE, .call_depth = -2)
|
meet_criteria(mo, allow_class = c("mo", "character"), allow_NULL = TRUE, .call_depth = -2)
|
||||||
@ -722,6 +734,7 @@ as_sir_method <- function(method_short,
|
|||||||
meet_criteria(reference_data, allow_class = "data.frame", .call_depth = -2)
|
meet_criteria(reference_data, allow_class = "data.frame", .call_depth = -2)
|
||||||
meet_criteria(include_screening, allow_class = "logical", has_length = 1, .call_depth = -2)
|
meet_criteria(include_screening, allow_class = "logical", has_length = 1, .call_depth = -2)
|
||||||
meet_criteria(include_PKPD, allow_class = "logical", has_length = 1, .call_depth = -2)
|
meet_criteria(include_PKPD, allow_class = "logical", has_length = 1, .call_depth = -2)
|
||||||
|
meet_criteria(ecoff, allow_class = "logical", has_length = 1, .call_depth = -2)
|
||||||
check_reference_data(reference_data, .call_depth = -2)
|
check_reference_data(reference_data, .call_depth = -2)
|
||||||
|
|
||||||
# for dplyr's across()
|
# for dplyr's across()
|
||||||
@ -759,7 +772,7 @@ as_sir_method <- function(method_short,
|
|||||||
if (is.null(mo)) {
|
if (is.null(mo)) {
|
||||||
stop_("No information was supplied about the microorganisms (missing argument `mo` and no column of class 'mo' found). See ?as.sir.\n\n",
|
stop_("No information was supplied about the microorganisms (missing argument `mo` and no column of class 'mo' found). See ?as.sir.\n\n",
|
||||||
"To transform certain columns with e.g. mutate(), use `data %>% mutate(across(..., as.sir, mo = x))`, where x is your column with microorganisms.\n",
|
"To transform certain columns with e.g. mutate(), use `data %>% mutate(across(..., as.sir, mo = x))`, where x is your column with microorganisms.\n",
|
||||||
"To tranform all ", method_long, " in a data set, use `data %>% as.sir()` or `data %>% mutate_if(is.", method_short, ", as.sir)`.",
|
"To transform all ", method_long, " in a data set, use `data %>% as.sir()` or `data %>% mutate_if(is.", method_short, ", as.sir)`.",
|
||||||
call = FALSE
|
call = FALSE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -820,7 +833,11 @@ as_sir_method <- function(method_short,
|
|||||||
message_("=> Interpreting ", method_long, " of ", ifelse(isTRUE(list(...)$is_data.frame), "column ", ""),
|
message_("=> Interpreting ", method_long, " of ", ifelse(isTRUE(list(...)$is_data.frame), "column ", ""),
|
||||||
agent_formatted,
|
agent_formatted,
|
||||||
mo_var_found,
|
mo_var_found,
|
||||||
" according to ", ifelse(identical(reference_data, AMR::clinical_breakpoints),
|
" according to ",
|
||||||
|
ifelse(isTRUE(ecoff),
|
||||||
|
"ECOFF values of ",
|
||||||
|
""),
|
||||||
|
ifelse(identical(reference_data, AMR::clinical_breakpoints),
|
||||||
font_bold(guideline_coerced),
|
font_bold(guideline_coerced),
|
||||||
"manually defined 'reference_data'"
|
"manually defined 'reference_data'"
|
||||||
),
|
),
|
||||||
@ -887,6 +904,16 @@ as_sir_method <- function(method_short,
|
|||||||
breakpoints <- breakpoints %pm>%
|
breakpoints <- breakpoints %pm>%
|
||||||
subset(mo != "UNKNOWN" & ref_tbl %unlike% "PK.*PD")
|
subset(mo != "UNKNOWN" & ref_tbl %unlike% "PK.*PD")
|
||||||
}
|
}
|
||||||
|
if (isFALSE(ecoff)) {
|
||||||
|
# remove ECOFF interpretations from the breakpoints table
|
||||||
|
breakpoints <- breakpoints %pm>%
|
||||||
|
subset(ref_tbl != "ECOFF")
|
||||||
|
} else {
|
||||||
|
# keep only ECOFF interpretations from the breakpoints table
|
||||||
|
breakpoints <- breakpoints %pm>%
|
||||||
|
subset(ref_tbl == "ECOFF") %pm>%
|
||||||
|
pm_mutate(breakpoint_S = ecoff, breakpoint_R = ecoff)
|
||||||
|
}
|
||||||
|
|
||||||
msgs <- character(0)
|
msgs <- character(0)
|
||||||
if (nrow(breakpoints) == 0) {
|
if (nrow(breakpoints) == 0) {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
BIN
R/sysdata.rda
BIN
R/sysdata.rda
Binary file not shown.
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
13
R/zzz.R
13
R/zzz.R
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -59,16 +59,15 @@ AMR_env$sir_interpretation_history <- data.frame(
|
|||||||
datetime = Sys.time()[0],
|
datetime = Sys.time()[0],
|
||||||
index = integer(0),
|
index = integer(0),
|
||||||
ab_input = character(0),
|
ab_input = character(0),
|
||||||
ab_considered = character(0),
|
ab_guideline = set_clean_class(character(0), c("ab", "character")),
|
||||||
mo_input = character(0),
|
mo_input = character(0),
|
||||||
mo_considered = character(0),
|
mo_guideline = set_clean_class(character(0), c("mo", "character")),
|
||||||
guideline = character(0),
|
guideline = character(0),
|
||||||
ref_table = character(0),
|
ref_table = character(0),
|
||||||
method = character(0),
|
method = character(0),
|
||||||
breakpoint_S = double(0),
|
|
||||||
breakpoint_R = double(0),
|
|
||||||
input = double(0),
|
input = double(0),
|
||||||
interpretation = character(0),
|
outcome = NA_sir_[0],
|
||||||
|
breakpoint_S_R = character(0),
|
||||||
stringsAsFactors = FALSE
|
stringsAsFactors = FALSE
|
||||||
)
|
)
|
||||||
AMR_env$custom_ab_codes <- character(0)
|
AMR_env$custom_ab_codes <- character(0)
|
||||||
@ -84,9 +83,11 @@ if (utf8_supported && !is_latex) {
|
|||||||
# \u2139 is a symbol officially named 'information source'
|
# \u2139 is a symbol officially named 'information source'
|
||||||
AMR_env$info_icon <- "\u2139"
|
AMR_env$info_icon <- "\u2139"
|
||||||
AMR_env$bullet_icon <- "\u2022"
|
AMR_env$bullet_icon <- "\u2022"
|
||||||
|
AMR_env$dots <- "\u2026"
|
||||||
} else {
|
} else {
|
||||||
AMR_env$info_icon <- "i"
|
AMR_env$info_icon <- "i"
|
||||||
AMR_env$bullet_icon <- "*"
|
AMR_env$bullet_icon <- "*"
|
||||||
|
AMR_env$dots <- "..."
|
||||||
}
|
}
|
||||||
|
|
||||||
.onLoad <- function(lib, pkg) {
|
.onLoad <- function(lib, pkg) {
|
||||||
|
31
_pkgdown.yml
31
_pkgdown.yml
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -70,9 +70,9 @@ home:
|
|||||||
navbar:
|
navbar:
|
||||||
title: "AMR (for R)"
|
title: "AMR (for R)"
|
||||||
left:
|
left:
|
||||||
- text: "Home"
|
# - text: "Home"
|
||||||
icon: "fa-home"
|
# icon: "fa-home"
|
||||||
href: "index.html"
|
# href: "index.html"
|
||||||
- text: "How to"
|
- text: "How to"
|
||||||
icon: "fa-question-circle"
|
icon: "fa-question-circle"
|
||||||
menu:
|
menu:
|
||||||
@ -100,9 +100,9 @@ navbar:
|
|||||||
- text: "Work with WHONET Data"
|
- text: "Work with WHONET Data"
|
||||||
icon: "fa-globe-americas"
|
icon: "fa-globe-americas"
|
||||||
href: "articles/WHONET.html"
|
href: "articles/WHONET.html"
|
||||||
- text: "Import Data From SPSS/SAS/Stata"
|
# - text: "Import Data From SPSS/SAS/Stata"
|
||||||
icon: "fa-file-upload"
|
# icon: "fa-file-upload"
|
||||||
href: "articles/SPSS.html"
|
# href: "articles/SPSS.html"
|
||||||
- text: "Apply Eucast Rules"
|
- text: "Apply Eucast Rules"
|
||||||
icon: "fa-exchange-alt"
|
icon: "fa-exchange-alt"
|
||||||
href: "articles/EUCAST.html"
|
href: "articles/EUCAST.html"
|
||||||
@ -115,16 +115,31 @@ navbar:
|
|||||||
- text: "Get Properties of an Antiviral Drug"
|
- text: "Get Properties of an Antiviral Drug"
|
||||||
icon: "fa-capsules"
|
icon: "fa-capsules"
|
||||||
href: "reference/av_property.html" # reference instead of an article
|
href: "reference/av_property.html" # reference instead of an article
|
||||||
|
- text: "With other pkgs"
|
||||||
|
icon: "fa-layer-group"
|
||||||
|
menu:
|
||||||
|
- text: "AMR & dplyr/tidyverse"
|
||||||
|
icon: "fa-layer-group"
|
||||||
|
href: "articles/other_pkg.html"
|
||||||
|
- text: "AMR & data.table"
|
||||||
|
icon: "fa-layer-group"
|
||||||
|
href: "articles/other_pkg.html"
|
||||||
|
- text: "AMR & tidymodels"
|
||||||
|
icon: "fa-layer-group"
|
||||||
|
href: "articles/other_pkg.html"
|
||||||
|
- text: "AMR & base R"
|
||||||
|
icon: "fa-layer-group"
|
||||||
|
href: "articles/other_pkg.html"
|
||||||
- text: "Manual"
|
- text: "Manual"
|
||||||
icon: "fa-book-open"
|
icon: "fa-book-open"
|
||||||
href: "reference/index.html"
|
href: "reference/index.html"
|
||||||
- text: "Authors"
|
- text: "Authors"
|
||||||
icon: "fa-users"
|
icon: "fa-users"
|
||||||
href: "authors.html"
|
href: "authors.html"
|
||||||
|
right:
|
||||||
- text: "Changelog"
|
- text: "Changelog"
|
||||||
icon: "far fa-newspaper"
|
icon: "far fa-newspaper"
|
||||||
href: "news/index.html"
|
href: "news/index.html"
|
||||||
right:
|
|
||||||
- text: "Source Code"
|
- text: "Source Code"
|
||||||
icon: "fab fa-github"
|
icon: "fab fa-github"
|
||||||
href: "https://github.com/msberends/AMR"
|
href: "https://github.com/msberends/AMR"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
BIN
data-raw/Dosages_v_13.0_Breakpoint_Tables.pdf
Normal file
BIN
data-raw/Dosages_v_13.0_Breakpoint_Tables.pdf
Normal file
Binary file not shown.
BIN
data-raw/Dosages_v_13.0_Breakpoint_Tables.xlsx
Normal file
BIN
data-raw/Dosages_v_13.0_Breakpoint_Tables.xlsx
Normal file
Binary file not shown.
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
@ -31,6 +31,7 @@
|
|||||||
# source("data-raw/_pre_commit_hook.R")
|
# source("data-raw/_pre_commit_hook.R")
|
||||||
|
|
||||||
library(dplyr, warn.conflicts = FALSE)
|
library(dplyr, warn.conflicts = FALSE)
|
||||||
|
try(detach("package:data.table", unload = TRUE), silent = TRUE) # to prevent like() to precede over AMR::like
|
||||||
devtools::load_all(quiet = TRUE)
|
devtools::load_all(quiet = TRUE)
|
||||||
|
|
||||||
suppressMessages(set_AMR_locale("English"))
|
suppressMessages(set_AMR_locale("English"))
|
||||||
@ -164,12 +165,12 @@ MO_PREVALENT_GENERA <- c(
|
|||||||
"Halococcus", "Hendersonula", "Heterophyes", "Histomonas", "Histoplasma", "Hymenolepis", "Hypomyces",
|
"Halococcus", "Hendersonula", "Heterophyes", "Histomonas", "Histoplasma", "Hymenolepis", "Hypomyces",
|
||||||
"Hysterothylacium", "Leishmania", "Malassezia", "Malbranchea", "Metagonimus", "Meyerozyma", "Microsporidium",
|
"Hysterothylacium", "Leishmania", "Malassezia", "Malbranchea", "Metagonimus", "Meyerozyma", "Microsporidium",
|
||||||
"Microsporum", "Mortierella", "Mucor", "Mycocentrospora", "Necator", "Nectria", "Ochroconis", "Oesophagostomum",
|
"Microsporum", "Mortierella", "Mucor", "Mycocentrospora", "Necator", "Nectria", "Ochroconis", "Oesophagostomum",
|
||||||
"Oidiodendron", "Opisthorchis", "Pediculus", "Phlebotomus", "Phoma", "Pichia", "Piedraia", "Pithomyces",
|
"Oidiodendron", "Opisthorchis", "Pediculus", "Penicillium", "Phlebotomus", "Phoma", "Pichia", "Piedraia", "Pithomyces",
|
||||||
"Pityrosporum", "Pneumocystis", "Pseudallescheria", "Pseudoterranova", "Pulex", "Rhizomucor", "Rhizopus",
|
"Pityrosporum", "Pneumocystis", "Pseudallescheria", "Pseudoterranova", "Pulex", "Rhizomucor", "Rhizopus",
|
||||||
"Rhodotorula", "Saccharomyces", "Sarcoptes", "Scolecobasidium", "Scopulariopsis", "Scytalidium", "Spirometra",
|
"Rhodotorula", "Saccharomyces", "Sarcoptes", "Scolecobasidium", "Scopulariopsis", "Scytalidium", "Spirometra",
|
||||||
"Sporobolomyces", "Stachybotrys", "Strongyloides", "Syngamus", "Taenia", "Toxocara", "Trichinella", "Trichobilharzia",
|
"Sporobolomyces", "Stachybotrys", "Strongyloides", "Syngamus", "Taenia", "Talaromyces", "Toxocara", "Trichinella",
|
||||||
"Trichoderma", "Trichomonas", "Trichophyton", "Trichosporon", "Trichostrongylus", "Trichuris", "Tritirachium",
|
"Trichobilharzia", "Trichoderma", "Trichomonas", "Trichophyton", "Trichosporon", "Trichostrongylus", "Trichuris",
|
||||||
"Trombicula", "Trypanosoma", "Tunga", "Wuchereria"
|
"Tritirachium", "Trombicula", "Trypanosoma", "Tunga", "Wuchereria"
|
||||||
)
|
)
|
||||||
|
|
||||||
# antibiotic groups
|
# antibiotic groups
|
||||||
@ -365,7 +366,7 @@ if (changed_md5(clin_break)) {
|
|||||||
write_md5(clin_break)
|
write_md5(clin_break)
|
||||||
try(saveRDS(clin_break, "data-raw/clinical_breakpoints.rds", version = 2, compress = "xz"), silent = TRUE)
|
try(saveRDS(clin_break, "data-raw/clinical_breakpoints.rds", version = 2, compress = "xz"), silent = TRUE)
|
||||||
try(write.table(clin_break, "data-raw/clinical_breakpoints.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
|
try(write.table(clin_break, "data-raw/clinical_breakpoints.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
|
||||||
try(haven::write_sas(clin_break, "data-raw/clinical_breakpoints.sas"), silent = TRUE)
|
try(haven::write_xpt(clin_break, "data-raw/clinical_breakpoints.xpt"), silent = TRUE)
|
||||||
try(haven::write_sav(clin_break, "data-raw/clinical_breakpoints.sav"), silent = TRUE)
|
try(haven::write_sav(clin_break, "data-raw/clinical_breakpoints.sav"), silent = TRUE)
|
||||||
try(haven::write_dta(clin_break, "data-raw/clinical_breakpoints.dta"), silent = TRUE)
|
try(haven::write_dta(clin_break, "data-raw/clinical_breakpoints.dta"), silent = TRUE)
|
||||||
try(openxlsx::write.xlsx(clin_break, "data-raw/clinical_breakpoints.xlsx"), silent = TRUE)
|
try(openxlsx::write.xlsx(clin_break, "data-raw/clinical_breakpoints.xlsx"), silent = TRUE)
|
||||||
@ -381,7 +382,7 @@ if (changed_md5(microorganisms)) {
|
|||||||
mo <- microorganisms
|
mo <- microorganisms
|
||||||
mo$snomed <- max_50_snomed
|
mo$snomed <- max_50_snomed
|
||||||
mo <- dplyr::mutate_if(mo, ~ !is.numeric(.), as.character)
|
mo <- dplyr::mutate_if(mo, ~ !is.numeric(.), as.character)
|
||||||
try(haven::write_sas(mo, "data-raw/microorganisms.sas"), silent = TRUE)
|
try(haven::write_xpt(mo, "data-raw/microorganisms.xpt"), silent = TRUE)
|
||||||
try(haven::write_sav(mo, "data-raw/microorganisms.sav"), silent = TRUE)
|
try(haven::write_sav(mo, "data-raw/microorganisms.sav"), silent = TRUE)
|
||||||
try(haven::write_dta(mo, "data-raw/microorganisms.dta"), silent = TRUE)
|
try(haven::write_dta(mo, "data-raw/microorganisms.dta"), silent = TRUE)
|
||||||
mo_all_snomed <- microorganisms %>% mutate_if(is.list, function(x) sapply(x, paste, collapse = ","))
|
mo_all_snomed <- microorganisms %>% mutate_if(is.list, function(x) sapply(x, paste, collapse = ","))
|
||||||
@ -396,7 +397,7 @@ 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('antibiotics')} to {usethis::ui_value('data-raw/')}"))
|
||||||
write_md5(ab)
|
write_md5(ab)
|
||||||
try(saveRDS(antibiotics, "data-raw/antibiotics.rds", version = 2, compress = "xz"), silent = TRUE)
|
try(saveRDS(antibiotics, "data-raw/antibiotics.rds", version = 2, compress = "xz"), silent = TRUE)
|
||||||
try(haven::write_sas(ab, "data-raw/antibiotics.sas"), silent = TRUE)
|
try(haven::write_xpt(ab, "data-raw/antibiotics.xpt"), silent = TRUE)
|
||||||
try(haven::write_sav(ab, "data-raw/antibiotics.sav"), silent = TRUE)
|
try(haven::write_sav(ab, "data-raw/antibiotics.sav"), silent = TRUE)
|
||||||
try(haven::write_dta(ab, "data-raw/antibiotics.dta"), 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 = ","))
|
ab_lists <- antibiotics %>% mutate_if(is.list, function(x) sapply(x, paste, collapse = ","))
|
||||||
@ -411,7 +412,7 @@ if (changed_md5(av)) {
|
|||||||
usethis::ui_info(paste0("Saving {usethis::ui_value('antivirals')} to {usethis::ui_value('data-raw/')}"))
|
usethis::ui_info(paste0("Saving {usethis::ui_value('antivirals')} to {usethis::ui_value('data-raw/')}"))
|
||||||
write_md5(av)
|
write_md5(av)
|
||||||
try(saveRDS(antivirals, "data-raw/antivirals.rds", version = 2, compress = "xz"), silent = TRUE)
|
try(saveRDS(antivirals, "data-raw/antivirals.rds", version = 2, compress = "xz"), silent = TRUE)
|
||||||
try(haven::write_sas(av, "data-raw/antivirals.sas"), silent = TRUE)
|
try(haven::write_xpt(av, "data-raw/antivirals.xpt"), silent = TRUE)
|
||||||
try(haven::write_sav(av, "data-raw/antivirals.sav"), silent = TRUE)
|
try(haven::write_sav(av, "data-raw/antivirals.sav"), silent = TRUE)
|
||||||
try(haven::write_dta(av, "data-raw/antivirals.dta"), silent = TRUE)
|
try(haven::write_dta(av, "data-raw/antivirals.dta"), silent = TRUE)
|
||||||
av_lists <- antivirals %>% mutate_if(is.list, function(x) sapply(x, paste, collapse = ","))
|
av_lists <- antivirals %>% mutate_if(is.list, function(x) sapply(x, paste, collapse = ","))
|
||||||
@ -432,7 +433,7 @@ if (changed_md5(intrinsicR)) {
|
|||||||
write_md5(intrinsicR)
|
write_md5(intrinsicR)
|
||||||
try(saveRDS(intrinsicR, "data-raw/intrinsic_resistant.rds", version = 2, compress = "xz"), silent = TRUE)
|
try(saveRDS(intrinsicR, "data-raw/intrinsic_resistant.rds", version = 2, compress = "xz"), silent = TRUE)
|
||||||
try(write.table(intrinsicR, "data-raw/intrinsic_resistant.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
|
try(write.table(intrinsicR, "data-raw/intrinsic_resistant.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
|
||||||
try(haven::write_sas(intrinsicR, "data-raw/intrinsic_resistant.sas"), silent = TRUE)
|
try(haven::write_xpt(intrinsicR, "data-raw/intrinsic_resistant.xpt"), silent = TRUE)
|
||||||
try(haven::write_sav(intrinsicR, "data-raw/intrinsic_resistant.sav"), silent = TRUE)
|
try(haven::write_sav(intrinsicR, "data-raw/intrinsic_resistant.sav"), silent = TRUE)
|
||||||
try(haven::write_dta(intrinsicR, "data-raw/intrinsic_resistant.dta"), silent = TRUE)
|
try(haven::write_dta(intrinsicR, "data-raw/intrinsic_resistant.dta"), silent = TRUE)
|
||||||
try(openxlsx::write.xlsx(intrinsicR, "data-raw/intrinsic_resistant.xlsx"), silent = TRUE)
|
try(openxlsx::write.xlsx(intrinsicR, "data-raw/intrinsic_resistant.xlsx"), silent = TRUE)
|
||||||
@ -445,7 +446,7 @@ if (changed_md5(dosage)) {
|
|||||||
write_md5(dosage)
|
write_md5(dosage)
|
||||||
try(saveRDS(dosage, "data-raw/dosage.rds", version = 2, compress = "xz"), silent = TRUE)
|
try(saveRDS(dosage, "data-raw/dosage.rds", version = 2, compress = "xz"), silent = TRUE)
|
||||||
try(write.table(dosage, "data-raw/dosage.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
|
try(write.table(dosage, "data-raw/dosage.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
|
||||||
try(haven::write_sas(dosage, "data-raw/dosage.sas"), silent = TRUE)
|
try(haven::write_xpt(dosage, "data-raw/dosage.xpt"), silent = TRUE)
|
||||||
try(haven::write_sav(dosage, "data-raw/dosage.sav"), silent = TRUE)
|
try(haven::write_sav(dosage, "data-raw/dosage.sav"), silent = TRUE)
|
||||||
try(haven::write_dta(dosage, "data-raw/dosage.dta"), silent = TRUE)
|
try(haven::write_dta(dosage, "data-raw/dosage.dta"), silent = TRUE)
|
||||||
try(openxlsx::write.xlsx(dosage, "data-raw/dosage.xlsx"), silent = TRUE)
|
try(openxlsx::write.xlsx(dosage, "data-raw/dosage.xlsx"), silent = TRUE)
|
||||||
|
BIN
data-raw/antibiotics.xpt
Normal file
BIN
data-raw/antibiotics.xpt
Normal file
Binary file not shown.
BIN
data-raw/antivirals.xpt
Normal file
BIN
data-raw/antivirals.xpt
Normal file
Binary file not shown.
19616
data-raw/bacdive.csv
Normal file
19616
data-raw/bacdive.csv
Normal file
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
|||||||
68467f5179638ac5622281df53a5ea75
|
10fb049c5071ca255d99c848dc498245
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
BIN
data-raw/clinical_breakpoints.xpt
Normal file
BIN
data-raw/clinical_breakpoints.xpt
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
|||||||
9a9fad0100acf4738f3f66b25ed3d8ef
|
cf0833ed69cfd2b6afb5b6d18cf2df26
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,171 @@
|
|||||||
"ab" "name" "type" "dose" "dose_times" "administration" "notes" "original_txt" "eucast_version"
|
"ab" "name" "type" "dose" "dose_times" "administration" "notes" "original_txt" "eucast_version"
|
||||||
|
"AMK" "Amikacin" "standard_dosage" "25-30 mg/kg" 1 "iv" "" "25-30 mg/kg x 1 iv" 13
|
||||||
|
"AMX" "Amoxicillin" "high_dosage" "2 g" 6 "iv" "" "2 g x 6 iv" 13
|
||||||
|
"AMX" "Amoxicillin" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3-4 iv" 13
|
||||||
|
"AMX" "Amoxicillin" "high_dosage" "0.75-1 g" 3 "oral" "" "0.75-1 g x 3 oral" 13
|
||||||
|
"AMX" "Amoxicillin" "standard_dosage" "0.5 g" 3 "oral" "" "0.5 g x 3 oral" 13
|
||||||
|
"AMX" "Amoxicillin" "uncomplicated_uti" "0.5 g" 3 "oral" "" "0.5 g x 3 oral" 13
|
||||||
|
"AMC" "Amoxicillin/clavulanic acid" "high_dosage" "2 g + 0.2 g" 3 "iv" "" "(2 g amoxicillin + 0.2 g clavulanic acid) x 3 iv" 13
|
||||||
|
"AMC" "Amoxicillin/clavulanic acid" "standard_dosage" "1 g + 0.2 g" 3 "iv" "" "(1 g amoxicillin + 0.2 g clavulanic acid) x 3-4 iv" 13
|
||||||
|
"AMC" "Amoxicillin/clavulanic acid" "high_dosage" "0.875 g + 0.125 g" 3 "oral" "" "(0.875 g amoxicillin + 0.125 g clavulanic acid) x 3 oral" 13
|
||||||
|
"AMC" "Amoxicillin/clavulanic acid" "standard_dosage" "0.5 g + 0.125 g" 3 "oral" "" "(0.5 g amoxicillin + 0.125 g clavulanic acid) x 3 oral" 13
|
||||||
|
"AMC" "Amoxicillin/clavulanic acid" "uncomplicated_uti" "0.5 g + 0.125 g" 3 "oral" "" "(0.5 g amoxicillin + 0.125 g clavulanic acid) x 3 oral" 13
|
||||||
|
"AMP" "Ampicillin" "high_dosage" "2 g" 4 "iv" "" "2 g x 4 iv" 13
|
||||||
|
"AMP" "Ampicillin" "standard_dosage" "2 g" 3 "iv" "" "2 g x 3 iv" 13
|
||||||
|
"SAM" "Ampicillin/sulbactam" "high_dosage" "2 g + 1 g" 4 "iv" "" "(2 g ampicillin + 1 g sulbactam) x 4 iv" 13
|
||||||
|
"SAM" "Ampicillin/sulbactam" "standard_dosage" "2 g + 1 g" 3 "iv" "" "(2 g ampicillin + 1 g sulbactam) x 3 iv" 13
|
||||||
|
"AZM" "Azithromycin" "standard_dosage" "0.5 g" 1 "iv" "" "0.5 g x 1 iv" 13
|
||||||
|
"AZM" "Azithromycin" "standard_dosage" "0.5 g" 1 "oral" "" "0.5 g x 1 oral" 13
|
||||||
|
"ATM" "Aztreonam" "high_dosage" "2 g" 4 "iv" "" "2 g x 4 iv" 13
|
||||||
|
"ATM" "Aztreonam" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3 iv" 13
|
||||||
|
"PEN" "Benzylpenicillin" "high_dosage" "1.2 g" 4 "iv" "" "1.2 g (2 MU) x 4-6 iv" 13
|
||||||
|
"PEN" "Benzylpenicillin" "standard_dosage" "0.6 g" 4 "iv" "" "0.6 g (1 MU) x 4 iv" 13
|
||||||
|
"CEC" "Cefaclor" "high_dosage" "1 g" 3 "oral" "" "1 g x 3 oral" 13
|
||||||
|
"CEC" "Cefaclor" "standard_dosage" "0.25-0.5 g" 3 "oral" "" "0.25-0.5 g x 3 oral" 13
|
||||||
|
"CFR" "Cefadroxil" "standard_dosage" "0.5-1 g" 2 "oral" "" "0.5-1 g x 2 oral" 13
|
||||||
|
"CFR" "Cefadroxil" "uncomplicated_uti" "0.5-1 g" 2 "oral" "" "0.5-1 g x 2 oral" 13
|
||||||
|
"LEX" "Cefalexin" "standard_dosage" "0.25-1 g" 2 "oral" "" "0.25-1 g x 2-3 oral" 13
|
||||||
|
"LEX" "Cefalexin" "uncomplicated_uti" "0.25-1 g" 2 "oral" "" "0.25-1 g x 2-3 oral" 13
|
||||||
|
"CZO" "Cefazolin" "high_dosage" "2 g" 3 "iv" "" "2 g x 3 iv" 13
|
||||||
|
"CZO" "Cefazolin" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3 iv" 13
|
||||||
|
"FEP" "Cefepime" "high_dosage" "2 g" 3 "iv" "" "2 g x 3 iv" 13
|
||||||
|
"FEP" "Cefepime" "standard_dosage" "2 g" 2 "iv" "" "2 g x 2 iv" 13
|
||||||
|
"FDC" "Cefiderocol" "standard_dosage" "2 g" 3 "iv" "over 3 hours" "2 g x 3 iv over 3 hours" 13
|
||||||
|
"CFM" "Cefixime" "standard_dosage" "0.2-0.4 g" 2 "oral" "" "0.2-0.4 g x 2 oral" 13
|
||||||
|
"CFM" "Cefixime" "uncomplicated_uti" "0.2-0.4 g" 2 "oral" "" "0.2-0.4 g x 2 oral" 13
|
||||||
|
"CTX" "Cefotaxime" "high_dosage" "2 g" 3 "iv" "" "2 g x 3 iv" 13
|
||||||
|
"CTX" "Cefotaxime" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3 iv" 13
|
||||||
|
"CPD" "Cefpodoxime" "standard_dosage" "0.1-0.2 g" 2 "oral" "" "0.1-0.2 g x 2 oral" 13
|
||||||
|
"CPD" "Cefpodoxime" "uncomplicated_uti" "0.1-0.2 g" 2 "oral" "" "0.1-0.2 g x 2 oral" 13
|
||||||
|
"CPT" "Ceftaroline" "high_dosage" "0.6 g" 3 "iv" "over 2 hours" "0.6 g x 3 iv over 2 hours" 13
|
||||||
|
"CPT" "Ceftaroline" "standard_dosage" "0.6 g" 2 "iv" "over 1 hour" "0.6 g x 2 iv over 1 hour" 13
|
||||||
|
"CAZ" "Ceftazidime" "high_dosage" "1 g" 6 "iv" "" "1 g x 6 iv" 13
|
||||||
|
"CAZ" "Ceftazidime" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3 iv" 13
|
||||||
|
"CZA" "Ceftazidime/avibactam" "standard_dosage" "2 g + 0.5 g" 3 "iv" "over 2 hours" "(2 g ceftazidime + 0.5 g avibactam) x 3 iv over 2 hours" 13
|
||||||
|
"CTB" "Ceftibuten" "standard_dosage" "0.4 g" 1 "oral" "" "0.4 g x 1 oral" 13
|
||||||
|
"BPR" "Ceftobiprole" "standard_dosage" "0.5 g" 3 "iv" "over 2 hours" "0.5 g x 3 iv over 2 hours" 13
|
||||||
|
"CZT" "Ceftolozane/tazobactam" "standard_dosage" "1 g + 0.5 g" 3 "iv" "over 1 hour" "(1 g ceftolozane + 0.5 g tazobactam) x 3 iv over 1 hour" 13
|
||||||
|
"CZT" "Ceftolozane/tazobactam" "standard_dosage" "2 g + 1 g" 3 "iv" "over 1 hour" "(2 g ceftolozane + 1 g tazobactam) x 3 iv over 1 hour" 13
|
||||||
|
"CRO" "Ceftriaxone" "high_dosage" "4 g" 1 "iv" "" "4 g x 1 iv" 13
|
||||||
|
"CRO" "Ceftriaxone" "standard_dosage" "2 g" 1 "iv" "" "2 g x 1 iv" 13
|
||||||
|
"CXM" "Cefuroxime" "high_dosage" "1.5 g" 3 "iv" "" "1.5 g x 3 iv" 13
|
||||||
|
"CXM" "Cefuroxime" "standard_dosage" "0.75 g" 3 "iv" "" "0.75 g x 3 iv" 13
|
||||||
|
"CXM" "Cefuroxime" "high_dosage" "0.5 g" 2 "oral" "" "0.5 g x 2 oral" 13
|
||||||
|
"CXM" "Cefuroxime" "standard_dosage" "0.25 g" 2 "oral" "" "0.25 g x 2 oral" 13
|
||||||
|
"CXM" "Cefuroxime" "uncomplicated_uti" "0.25 g" 2 "oral" "" "0.25 g x 2 oral" 13
|
||||||
|
"CHL" "Chloramphenicol" "high_dosage" "2 g" 4 "iv" "" "2 g x 4 iv" 13
|
||||||
|
"CHL" "Chloramphenicol" "standard_dosage" "1 g" 4 "iv" "" "1 g x 4 iv" 13
|
||||||
|
"CHL" "Chloramphenicol" "high_dosage" "2 g" 4 "oral" "" "2 g x 4 oral" 13
|
||||||
|
"CHL" "Chloramphenicol" "standard_dosage" "1 g" 4 "oral" "" "1 g x 4 oral" 13
|
||||||
|
"CIP" "Ciprofloxacin" "high_dosage" "0.4 g" 3 "iv" "" "0.4 g x 3 iv" 13
|
||||||
|
"CIP" "Ciprofloxacin" "standard_dosage" "0.4 g" 2 "iv" "" "0.4 g x 2 iv" 13
|
||||||
|
"CIP" "Ciprofloxacin" "high_dosage" "0.75 g" 2 "oral" "" "0.75 g x 2 oral" 13
|
||||||
|
"CIP" "Ciprofloxacin" "standard_dosage" "0.5 g" 2 "oral" "" "0.5 g x 2 oral" 13
|
||||||
|
"CLR" "Clarithromycin" "high_dosage" "0.5 g" 2 "oral" "" "0.5 g x 2 oral" 13
|
||||||
|
"CLR" "Clarithromycin" "standard_dosage" "0.25 g" 2 "oral" "" "0.25 g x 2 oral" 13
|
||||||
|
"CLI" "Clindamycin" "high_dosage" "0.9 g" 3 "iv" "" "0.9 g x 3 iv" 13
|
||||||
|
"CLI" "Clindamycin" "standard_dosage" "0.6 g" 3 "iv" "" "0.6 g x 3 iv" 13
|
||||||
|
"CLI" "Clindamycin" "high_dosage" "0.3 g" 4 "oral" "" "0.3 g x 4 oral" 13
|
||||||
|
"CLI" "Clindamycin" "standard_dosage" "0.3 g" 2 "oral" "" "0.3 g x 2 oral" 13
|
||||||
|
"CLO" "Cloxacillin" "high_dosage" "2 g" 6 "iv" "" "2 g x 6 iv" 13
|
||||||
|
"CLO" "Cloxacillin" "standard_dosage" "1 g" 4 "iv" "" "1 g x 4 iv" 13
|
||||||
|
"CLO" "Cloxacillin" "high_dosage" "1 g" 4 "oral" "" "1 g x 4 oral" 13
|
||||||
|
"CLO" "Cloxacillin" "standard_dosage" "0.5 g" 4 "oral" "" "0.5 g x 4 oral" 13
|
||||||
|
"COL" "Colistin" "standard_dosage" "4.5 MU" 2 "iv" "loading dose of 9 MU" "4.5 MU x 2 iv with a loading dose of 9 MU" 13
|
||||||
|
"DAL" "Dalbavancin" "standard_dosage" "1 g" 1 "iv" "over 30 minutes on day 8" "1 g x 1 iv over 30 minutes on day 1 If needed, 0.5 g x 1 iv over 30 minutes on day 8" 13
|
||||||
|
"DAP" "Daptomycin" "standard_dosage" "4 mg/kg" 1 "iv" "" "4 mg/kg x 1 iv" 13
|
||||||
|
"DAP" "Daptomycin" "standard_dosage" "6 mg/kg" 1 "iv" "" "6 mg/kg x 1 iv" 13
|
||||||
|
"DFX" "Delafloxacin" "standard_dosage" "0.3 g" 2 "iv" "" "0.3 g x 2 iv" 13
|
||||||
|
"DFX" "Delafloxacin" "standard_dosage" "0.45 g" 2 "oral" "" "0.45 g x 2 oral" 13
|
||||||
|
"DIC" "Dicloxacillin" "high_dosage" "2 g" 6 "iv" "" "2 g x 6 iv" 13
|
||||||
|
"DIC" "Dicloxacillin" "standard_dosage" "1 g" 4 "iv" "" "1 g x 4 iv" 13
|
||||||
|
"DIC" "Dicloxacillin" "high_dosage" "2 g" 4 "oral" "" "2 g x 4 oral" 13
|
||||||
|
"DIC" "Dicloxacillin" "standard_dosage" "0.5-1 g" 4 "oral" "" "0.5-1 g x 4 oral" 13
|
||||||
|
"DOR" "Doripenem" "high_dosage" "1 g" 3 "iv" "over 1 hour" "1 g x 3 iv over 1 hour" 13
|
||||||
|
"DOR" "Doripenem" "standard_dosage" "0.5 g" 3 "iv" "over 1 hour" "0.5 g x 3 iv over 1 hour" 13
|
||||||
|
"DOX" "Doxycycline" "high_dosage" "0.2 g" 1 "oral" "" "0.2 g x 1 oral" 13
|
||||||
|
"DOX" "Doxycycline" "standard_dosage" "0.1 g" 1 "oral" "" "0.1 g x 1 oral" 13
|
||||||
|
"ERV" "Eravacycline" "standard_dosage" "1 mg/kg" 2 "iv" "" "1 mg/kg x 2 iv" 13
|
||||||
|
"ETP" "Ertapenem" "standard_dosage" "1 g" 1 "iv" "over 30 minutes" "1 g x 1 iv over 30 minutes" 13
|
||||||
|
"ERY" "Erythromycin" "high_dosage" "1 g" 4 "iv" "" "1 g x 4 iv" 13
|
||||||
|
"ERY" "Erythromycin" "standard_dosage" "0.5 g" 2 "iv" "" "0.5 g x 2-4 iv" 13
|
||||||
|
"ERY" "Erythromycin" "high_dosage" "1 g" 4 "oral" "" "1 g x 4 oral" 13
|
||||||
|
"ERY" "Erythromycin" "standard_dosage" "0.5 g" 2 "oral" "" "0.5 g x 2-4 oral" 13
|
||||||
|
"FDX" "Fidaxomicin" "standard_dosage" "0.2 g" 2 "oral" "" "0.2 g x 2 oral" 13
|
||||||
|
"FLC" "Flucloxacillin" "high_dosage" "2 g" 6 "iv" "" "2 g x 6 iv" 13
|
||||||
|
"FLC" "Flucloxacillin" "standard_dosage" "2 g" 4 "iv" "" "2 g x 4 iv (or 1 g x 6 iv)" 13
|
||||||
|
"FLC" "Flucloxacillin" "high_dosage" "1 g" 4 "oral" "" "1 g x 4 oral" 13
|
||||||
|
"FLC" "Flucloxacillin" "standard_dosage" "1 g" 3 "oral" "" "1 g x 3 oral" 13
|
||||||
|
"FOS" "Fosfomycin" "high_dosage" "8 g" 3 "iv" "" "8 g x 3 iv" 13
|
||||||
|
"FOS" "Fosfomycin" "standard_dosage" "4 g" 3 "iv" "" "4 g x 3 iv" 13
|
||||||
|
"FUS" "Fusidic acid" "high_dosage" "0.5 g" 3 "iv" "" "0.5 g x 3 iv" 13
|
||||||
|
"FUS" "Fusidic acid" "standard_dosage" "0.5 g" 2 "iv" "" "0.5 g x 2 iv" 13
|
||||||
|
"FUS" "Fusidic acid" "high_dosage" "0.5 g" 3 "oral" "" "0.5 g x 3 oral" 13
|
||||||
|
"FUS" "Fusidic acid" "standard_dosage" "0.5 g" 2 "oral" "" "0.5 g x 2 oral" 13
|
||||||
|
"GEN" "Gentamicin" "standard_dosage" "6-7 mg/kg" 1 "iv" "" "6-7 mg/kg x 1 iv" 13
|
||||||
|
"IPM" "Imipenem" "high_dosage" "1 g" 4 "iv" "over 30 minutes" "1 g x 4 iv over 30 minutes" 13
|
||||||
|
"IPM" "Imipenem" "standard_dosage" "0.5 g" 4 "iv" "over 30 minutes" "0.5 g x 4 iv over 30 minutes" 13
|
||||||
|
"IMR" "Imipenem/relebactam" "standard_dosage" "0.5 g + 0.25 g" 4 "iv" "over 30 minutes" "(0.5 g imipenem + 0.25 g relebactam) x 4 iv over 30 minutes" 13
|
||||||
|
"IMR" "Imipenem/relebactam" "standard_dosage" "0.5 g + 0.25 g" 4 "iv" "over 30 minutes" "(0.5 g imipenem + 0.25 g relebactam) x 4 iv over 30 minutes" 13
|
||||||
|
"LMU" "Lefamulin" "standard_dosage" "0.15 g" 2 "iv" "or 0.6 g x 2 oral" "0.15 g x 2 iv or 0.6 g x 2 oral" 13
|
||||||
|
"LMU" "Lefamulin" "standard_dosage" "0.6 g" 2 "oral" "" "0.6 g x 2 oral" 13
|
||||||
|
"LVX" "Levofloxacin" "high_dosage" "0.5 g" 2 "iv" "" "0.5 g x 2 iv" 13
|
||||||
|
"LVX" "Levofloxacin" "standard_dosage" "0.5 g" 1 "iv" "" "0.5 g x 1 iv" 13
|
||||||
|
"LVX" "Levofloxacin" "high_dosage" "0.5 g" 2 "oral" "" "0.5 g x 2 oral" 13
|
||||||
|
"LVX" "Levofloxacin" "standard_dosage" "0.5 g" 1 "oral" "" "0.5 g x 1 oral" 13
|
||||||
|
"LNZ" "Linezolid" "standard_dosage" "0.6 g" 2 "iv" "" "0.6 g x 2 iv" 13
|
||||||
|
"LNZ" "Linezolid" "standard_dosage" "0.6 g" 2 "oral" "" "0.6 g x 2 oral" 13
|
||||||
|
"MEM" "Meropenem" "high_dosage" "2 g" 3 "iv" "over 3 hours" "2 g x 3 iv over 3 hours" 13
|
||||||
|
"MEM" "Meropenem" "standard_dosage" "1 g" 3 "iv" "over 30 minutes" "1 g x 3 iv over 30 minutes" 13
|
||||||
|
"MEV" "Meropenem/vaborbactam" "standard_dosage" "2 g + 2 g" 3 "iv" "over 3 hours" "(2 g meropenem + 2 g vaborbactam) x 3 iv over 3 hours" 13
|
||||||
|
"MTR" "Metronidazole" "high_dosage" "0.5 g" 3 "iv" "" "0.5 g x 3 iv" 13
|
||||||
|
"MTR" "Metronidazole" "standard_dosage" "0.4 g" 3 "iv" "" "0.4 g x 3 iv" 13
|
||||||
|
"MTR" "Metronidazole" "high_dosage" "0.5 g" 3 "oral" "" "0.5 g x 3 oral" 13
|
||||||
|
"MTR" "Metronidazole" "standard_dosage" "0.4 g" 3 "oral" "" "0.4 g x 3 oral" 13
|
||||||
|
"MNO" "Minocycline" "standard_dosage" "0.1 g" 2 "oral" "" "0.1 g x 2 oral" 13
|
||||||
|
"MFX" "Moxifloxacin" "standard_dosage" "0.4 g" 1 "iv" "" "0.4 g x 1 iv" 13
|
||||||
|
"MFX" "Moxifloxacin" "standard_dosage" "0.4 g" 1 "oral" "" "0.4 g x 1 oral" 13
|
||||||
|
"OFX" "Ofloxacin" "high_dosage" "0.4 g" 2 "iv" "" "0.4 g x 2 iv" 13
|
||||||
|
"OFX" "Ofloxacin" "standard_dosage" "0.2 g" 2 "iv" "" "0.2 g x 2 iv" 13
|
||||||
|
"OFX" "Ofloxacin" "high_dosage" "0.4 g" 2 "oral" "" "0.4 g x 2 oral" 13
|
||||||
|
"OFX" "Ofloxacin" "standard_dosage" "0.2 g" 2 "oral" "" "0.2 g x 2 oral" 13
|
||||||
|
"ORI" "Oritavancin" "standard_dosage" "1.2 g" 1 "iv" "" "1.2 g x 1 (single dose) iv over 3 hours" 13
|
||||||
|
"OXA" "Oxacillin" "high_dosage" "1 g" 6 "iv" "" "1 g x 6 iv" 13
|
||||||
|
"OXA" "Oxacillin" "standard_dosage" "1 g" 4 "iv" "" "1 g x 4 iv" 13
|
||||||
|
"PHN" "Phenoxymethylpenicillin" "standard_dosage" "0.5-2 g" 3 "oral" "" "0.5-2 g x 3-4 oral" 13
|
||||||
|
"PIP" "Piperacillin" "high_dosage" "4 g" 4 "iv" "" "4 g x 4 iv by extended 3-hour infusion" 13
|
||||||
|
"PIP" "Piperacillin" "standard_dosage" "4 g" 4 "iv" "" "4 g x 4 iv" 13
|
||||||
|
"TZP" "Piperacillin/tazobactam" "high_dosage" "4 g + 0.5 g" 4 "iv" "" "(4 g piperacillin + 0.5 g tazobactam) x 4 iv by extended 3-hour infusion" 13
|
||||||
|
"TZP" "Piperacillin/tazobactam" "standard_dosage" "4 g + 0.5 g" 4 "iv" "" "(4 g piperacillin + 0.5 g tazobactam) x 4 iv 30-minute infusion or x 3 iv by extended 4-hour infusion" 13
|
||||||
|
"QDA" "Quinupristin/dalfopristin" "high_dosage" "7.5 mg/kg" 3 "iv" "" "7.5 mg/kg x 3 iv" 13
|
||||||
|
"QDA" "Quinupristin/dalfopristin" "standard_dosage" "7.5 mg/kg" 2 "iv" "" "7.5 mg/kg x 2 iv" 13
|
||||||
|
"RIF" "Rifampicin" "standard_dosage" "0.6 g" 1 "iv" "" "0.6 g x 1 iv" 13
|
||||||
|
"RIF" "Rifampicin" "standard_dosage" "0.6 g" 1 "oral" "" "0.6 g x 1 oral" 13
|
||||||
|
"RXT" "Roxithromycin" "standard_dosage" "0.15 g" 2 "oral" "" "0.15 g x 2 oral" 13
|
||||||
|
"SPT" "Spectinomycin" "standard_dosage" "2 g" 1 "im" "" "2 g x 1 im" 13
|
||||||
|
"TZD" "Tedizolid" "standard_dosage" "0.2 g" 1 "iv" "" "0.2 g x 1 iv" 13
|
||||||
|
"TZD" "Tedizolid" "standard_dosage" "0.2 g" 1 "oral" "" "0.2 g x 1 oral" 13
|
||||||
|
"TEC" "Teicoplanin" "high_dosage" "0.8 g" 1 "iv" "" "0.8 g x 1 iv" 13
|
||||||
|
"TEC" "Teicoplanin" "standard_dosage" "0.4 g" 1 "iv" "" "0.4 g x 1 iv" 13
|
||||||
|
"TLV" "Telavancin" "standard_dosage" "10 mg/kg" 1 "iv" "over 1 hour" "10 mg/kg x 1 iv over 1 hour" 13
|
||||||
|
"TLT" "Telithromycin" "standard_dosage" "0.8 g" 1 "oral" "" "0.8 g x 1 oral" 13
|
||||||
|
"TEM" "Temocillin" "high_dosage" "2 g" 3 "iv" "" "2 g x 3 iv" 13
|
||||||
|
"TEM" "Temocillin" "standard_dosage" "2 g" 2 "iv" "" "2 g x 2 iv" 13
|
||||||
|
"TCY" "Tetracycline" "high_dosage" "0.5 g" 4 "oral" "" "0.5 g x 4 oral" 13
|
||||||
|
"TCY" "Tetracycline" "standard_dosage" "0.25 g" 4 "oral" "" "0.25 g x 4 oral" 13
|
||||||
|
"TIC" "Ticarcillin" "high_dosage" "3 g" 6 "iv" "" "3 g x 6 iv" 13
|
||||||
|
"TIC" "Ticarcillin" "standard_dosage" "3 g" 4 "iv" "" "3 g x 4 iv" 13
|
||||||
|
"TCC" "Ticarcillin/clavulanic acid" "high_dosage" "3 g + 0.1 g" 6 "iv" "" "(3 g ticarcillin + 0.1 g clavulanic acid) x 6 iv" 13
|
||||||
|
"TCC" "Ticarcillin/clavulanic acid" "standard_dosage" "3 g + 0.1-0.2 g" 4 "iv" "" "(3 g ticarcillin + 0.1-0.2 g clavulanic acid) x 4 iv" 13
|
||||||
|
"TGC" "Tigecycline" "standard_dosage" "0.1 g" "loading dose followed by 50 mg x 2 iv" "0.1 g loading dose followed by 50 mg x 2 iv" 13
|
||||||
|
"TOB" "Tobramycin" "standard_dosage" "6-7 mg/kg" 1 "iv" "" "6-7 mg/kg x 1 iv" 13
|
||||||
|
"SXT" "Trimethoprim/sulfamethoxazole" "high_dosage" "0.24 g + 1.2 g" 2 "oral" "" "(0.24 g trimethoprim + 1.2 g sulfamethoxazole) x 2 oral" 13
|
||||||
|
"SXT" "Trimethoprim/sulfamethoxazole" "high_dosage" "0.24 g + 1.2 g" 2 "oral" "" "(0.24 g trimethoprim + 1.2 g sulfamethoxazole) x 2 oral or (0.24 g trimethoprim + 1.2 g sulfamethoxazole) x 2 iv" 13
|
||||||
|
"SXT" "Trimethoprim/sulfamethoxazole" "standard_dosage" "0.16 g + 0.8 g" 2 "oral" "" "(0.16 g trimethoprim + 0.8 g sulfamethoxazole) x 2 oral" 13
|
||||||
|
"SXT" "Trimethoprim/sulfamethoxazole" "standard_dosage" "0.16 g + 0.8 g" 2 "oral" "" "(0.16 g trimethoprim + 0.8 g sulfamethoxazole) x 2 oral or (0.16 g trimethoprim + 0.8 g sulfamethoxazole) x 2 iv" 13
|
||||||
|
"SXT" "Trimethoprim/sulfamethoxazole" "uncomplicated_uti" "0.16 g + 0.8 g" 2 "oral" "" "(0.16 g trimethoprim + 0.8 g sulfamethoxazole) x 2 oral" 13
|
||||||
|
"SXT" "Trimethoprim/sulfamethoxazole" "uncomplicated_uti" "0.16 g + 0.8 g" 2 "oral" "" "(0.16 g trimethoprim + 0.8 g sulfamethoxazole) x 2 oral" 13
|
||||||
|
"VAN" "Vancomycin" "standard_dosage" "1 g" 2 "iv" "" "1 g x 2 iv or 2 g x 1 by continuous infusion" 13
|
||||||
"AMK" "Amikacin" "standard_dosage" "25-30 mg/kg" 1 "iv" "" "25-30 mg/kg x 1 iv" 12
|
"AMK" "Amikacin" "standard_dosage" "25-30 mg/kg" 1 "iv" "" "25-30 mg/kg x 1 iv" 12
|
||||||
"AMX" "Amoxicillin" "high_dosage" "2 g" 6 "iv" "" "2 g x 6 iv" 12
|
"AMX" "Amoxicillin" "high_dosage" "2 g" 6 "iv" "" "2 g x 6 iv" 12
|
||||||
"AMX" "Amoxicillin" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3-4 iv" 12
|
"AMX" "Amoxicillin" "standard_dosage" "1 g" 3 "iv" "" "1 g x 3-4 iv" 12
|
||||||
|
Binary file not shown.
BIN
data-raw/dosage.xpt
Normal file
BIN
data-raw/dosage.xpt
Normal file
Binary file not shown.
BIN
data-raw/intrinsic_resistant.xpt
Normal file
BIN
data-raw/intrinsic_resistant.xpt
Normal file
Binary file not shown.
@ -9,7 +9,7 @@
|
|||||||
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
# Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C #
|
||||||
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
# (2022). AMR: An R Package for Working with Antimicrobial Resistance #
|
||||||
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
# Data. Journal of Statistical Software, 104(3), 1-31. #
|
||||||
# doi:10.18637/jss.v104.i03 #
|
# https://doi.org/10.18637/jss.v104.i03 #
|
||||||
# #
|
# #
|
||||||
# Developed at the University of Groningen and the University Medical #
|
# Developed at the University of Groningen and the University Medical #
|
||||||
# Center Groningen in The Netherlands, in collaboration with many #
|
# Center Groningen in The Netherlands, in collaboration with many #
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
|||||||
7846247d4113c4e8f550cfd2cb87467f
|
63cc9e5166dc50c7b474bb809557c392
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user