mirror of
https://github.com/msberends/AMR.git
synced 2026-09-21 00:30:55 +02:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e522cd988 |
@@ -1,32 +0,0 @@
|
||||
^.*\.Rproj$
|
||||
^\.Renviron$
|
||||
^\.Rprofile$
|
||||
^\.Rproj\.user$
|
||||
^\.travis\.yml$
|
||||
^\.zenodo\.json$
|
||||
^_noinclude$
|
||||
^_pkgdown\.yml$
|
||||
^appveyor\.yml$
|
||||
^codecov\.yml$
|
||||
^cran-comments\.md$
|
||||
^CRAN-RELEASE$
|
||||
^\.github$
|
||||
^doc$
|
||||
^docs$
|
||||
^git_.*\.sh$
|
||||
^index\.md$
|
||||
^installed_deps$
|
||||
^Meta$
|
||||
^pkgdown$
|
||||
^public$
|
||||
^data-raw$
|
||||
^\.lintr$
|
||||
^tests/testthat/_snaps$
|
||||
^vignettes/AMR.Rmd$
|
||||
^vignettes/benchmarks.Rmd$
|
||||
^vignettes/EUCAST.Rmd$
|
||||
^vignettes/MDR.Rmd$
|
||||
^vignettes/PCA.Rmd$
|
||||
^vignettes/resistance_predict.Rmd$
|
||||
^vignettes/SPSS.Rmd$
|
||||
^vignettes/WHONET.Rmd$
|
||||
@@ -1,174 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- premaster
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
# run a schedule everyday at 3 AM.
|
||||
# this is to check that all dependencies are still available (see R/zzz.R)
|
||||
- cron: '0 3 * * *'
|
||||
|
||||
name: R-code-check
|
||||
|
||||
jobs:
|
||||
R-code-check:
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
|
||||
continue-on-error: ${{ matrix.config.allowfail }}
|
||||
|
||||
name: ${{ matrix.config.os }} (R-${{ matrix.config.r }})
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {os: macOS-latest, r: 'devel', allowfail: false}
|
||||
- {os: macOS-latest, r: 'release', allowfail: false}
|
||||
- {os: macOS-latest, r: 'oldrel', allowfail: false}
|
||||
- {os: windows-latest, r: 'devel', allowfail: false}
|
||||
- {os: windows-latest, r: 'release', allowfail: false}
|
||||
- {os: windows-latest, r: 'oldrel', allowfail: false}
|
||||
- {os: ubuntu-20.04, r: 'devel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-20.04, r: 'release', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-20.04, r: 'oldrel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-20.04, r: '4.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-20.04, r: '3.6', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-20.04, r: '3.5', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-20.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-20.04, r: '3.3', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-20.04, r: '3.2', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-20.04, r: '3.1', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-20.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
|
||||
- {os: ubuntu-16.04, r: 'devel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: ubuntu-16.04, r: 'release', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: ubuntu-16.04, r: 'oldrel', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: ubuntu-16.04, r: '4.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: ubuntu-16.04, r: '3.6', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: ubuntu-16.04, r: '3.5', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: ubuntu-16.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: ubuntu-16.04, r: '3.3', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: ubuntu-16.04, r: '3.2', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: ubuntu-16.04, r: '3.1', allowfail: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
- {os: ubuntu-16.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
|
||||
|
||||
env:
|
||||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
|
||||
RSPM: ${{ matrix.config.rspm }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: r-lib/actions/setup-r@master
|
||||
with:
|
||||
r-version: ${{ matrix.config.r }}
|
||||
|
||||
- uses: r-lib/actions/setup-pandoc@master
|
||||
|
||||
- name: Query dependencies
|
||||
if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
|
||||
run: |
|
||||
install.packages('remotes')
|
||||
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Cache R packages
|
||||
if: runner.os != 'Windows' && matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.R_LIBS_USER }}
|
||||
key: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-3-${{ hashFiles('.github/depends.Rds') }}
|
||||
restore-keys: ${{ matrix.config.os }}-r-${{ matrix.config.r }}-3-
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: runner.os == 'Linux' && matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
|
||||
env:
|
||||
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
|
||||
run: |
|
||||
Rscript -e "remotes::install_github('r-hub/sysreqs')"
|
||||
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
|
||||
sudo -s eval "$sysreqs"
|
||||
|
||||
- name: Install Linux dependencies on old R versions
|
||||
if: matrix.config.r == '3.0' || matrix.config.r == '3.1' || matrix.config.r == '3.2'
|
||||
env:
|
||||
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
|
||||
# update the below with sysreqs::sysreqs("DESCRIPTION") and check the "DEB" entries (for Ubuntu).
|
||||
# we don't want to depend on the sysreqs pkg here, as it requires a quite new R version
|
||||
run: |
|
||||
sudo apt install -y libssl-dev pandoc pandoc-citeproc libxml2-dev libicu-dev libcurl4-openssl-dev
|
||||
|
||||
- name: Install macOS dependencies
|
||||
if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel'
|
||||
run: |
|
||||
brew install mariadb-connector-c
|
||||
|
||||
- name: Install package dependencies
|
||||
if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
|
||||
run: |
|
||||
remotes::install_deps(dependencies = TRUE)
|
||||
remotes::install_cran("rcmdcheck")
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Session info
|
||||
run: |
|
||||
options(width = 100)
|
||||
utils::sessionInfo()
|
||||
as.data.frame(utils::installed.packages())[, "Version", drop = FALSE]
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Run R CMD check
|
||||
if: matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2'
|
||||
env:
|
||||
_R_CHECK_CRAN_INCOMING_: false
|
||||
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Run R CMD check on older R versions
|
||||
if: matrix.config.r == '3.0' || matrix.config.r == '3.1' || matrix.config.r == '3.2'
|
||||
env:
|
||||
_R_CHECK_CRAN_INCOMING_: false
|
||||
_R_CHECK_FORCE_SUGGESTS_: false
|
||||
_R_CHECK_LENGTH_1_CONDITION_: verbose
|
||||
_R_CHECK_LENGTH_1_LOGIC2_: verbose
|
||||
run: |
|
||||
R CMD check data-raw/AMR_*.tar.gz --no-manual --no-build-vignettes
|
||||
|
||||
- name: Show testthat output
|
||||
if: always()
|
||||
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
|
||||
shell: bash
|
||||
|
||||
- name: Upload check results
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
|
||||
path: check
|
||||
@@ -1,71 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
name: code-tested
|
||||
|
||||
jobs:
|
||||
code-tested:
|
||||
runs-on: macOS-latest
|
||||
env:
|
||||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: r-lib/actions/setup-r@master
|
||||
|
||||
- uses: r-lib/actions/setup-pandoc@master
|
||||
|
||||
- name: Query dependencies
|
||||
run: |
|
||||
install.packages('remotes')
|
||||
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
|
||||
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Cache R packages
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.R_LIBS_USER }}
|
||||
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
|
||||
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
install.packages(c("remotes"))
|
||||
remotes::install_deps(dependencies = TRUE)
|
||||
remotes::install_cran("covr")
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Test coverage
|
||||
run: covr::codecov(line_exclusions = list("R/atc_online.R", "R/mo_source.R", "R/translate.R", "R/resistance_predict.R", "R/aa_helper_functions.R", "R/aa_helper_pm_functions.R", "R/zzz.R"), quiet = FALSE)
|
||||
shell: Rscript {0}
|
||||
@@ -1,70 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation.
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- premaster
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
name: lintr
|
||||
|
||||
jobs:
|
||||
lintr:
|
||||
runs-on: macOS-latest
|
||||
env:
|
||||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: r-lib/actions/setup-r@master
|
||||
|
||||
- name: Query dependencies
|
||||
run: |
|
||||
install.packages('remotes')
|
||||
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
|
||||
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Cache R packages
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ env.R_LIBS_USER }}
|
||||
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
|
||||
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
install.packages(c("remotes"))
|
||||
remotes::install_deps(dependencies = TRUE)
|
||||
remotes::install_cran("lintr")
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Lint
|
||||
run: lintr::lint_package(linters = lintr::with_defaults(line_length_linter = NULL, trailing_whitespace_linter = NULL, object_name_linter = NULL, cyclocomp_linter = NULL, object_length_linter = lintr::object_length_linter(length = 50L)), exclusions = list("R/aa_helper_pm_functions.R"))
|
||||
shell: Rscript {0}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
Meta
|
||||
doc
|
||||
.Renviron
|
||||
.Rproj.user
|
||||
.Rhistory
|
||||
.RData
|
||||
.Ruserdata
|
||||
AMR.Rproj
|
||||
tests/testthat/Rplots.pdf
|
||||
inst/doc
|
||||
/src/*.o
|
||||
/src/*.o-*
|
||||
/src/*.d
|
||||
/src/*.so
|
||||
_noinclude
|
||||
*.dll
|
||||
vignettes/*.R
|
||||
.DS_Store
|
||||
.Rprofile
|
||||
^CRAN-RELEASE$
|
||||
packrat/lib*/
|
||||
packrat/src/
|
||||
data-raw/taxa.txt
|
||||
data-raw/taxon.tab
|
||||
data-raw/DSMZ_bactnames.xlsx
|
||||
data-raw/country_analysis_url_token.R
|
||||
data-raw/country_analysis2.R
|
||||
@@ -0,0 +1,254 @@
|
||||
Metadata-Version: 2.4
|
||||
Name: AMR
|
||||
Version: 3.0.1.9091
|
||||
Summary: A Python wrapper for the AMR R package
|
||||
Home-page: https://github.com/msberends/AMR
|
||||
Author: Matthijs Berends
|
||||
Author-email: m.s.berends@umcg.nl
|
||||
License: GPL 2
|
||||
Project-URL: Bug Tracker, https://github.com/msberends/AMR/issues
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Operating System :: OS Independent
|
||||
Requires-Python: >=3.6
|
||||
Description-Content-Type: text/markdown
|
||||
Requires-Dist: rpy2
|
||||
Requires-Dist: numpy
|
||||
Requires-Dist: pandas
|
||||
Dynamic: author
|
||||
Dynamic: author-email
|
||||
Dynamic: classifier
|
||||
Dynamic: description
|
||||
Dynamic: description-content-type
|
||||
Dynamic: home-page
|
||||
Dynamic: license
|
||||
Dynamic: project-url
|
||||
Dynamic: requires-dist
|
||||
Dynamic: requires-python
|
||||
Dynamic: summary
|
||||
|
||||
|
||||
The `AMR` package for R is a powerful tool for antimicrobial resistance (AMR) analysis. It provides extensive features for handling microbial and antimicrobial data. However, for those who work primarily in Python, we now have a more intuitive option available: the [`AMR` Python package](https://pypi.org/project/AMR/).
|
||||
|
||||
This Python package is a wrapper around the `AMR` R package. It uses the `rpy2` package internally. Despite the need to have R installed, Python users can now easily work with AMR data directly through Python code.
|
||||
|
||||
# Prerequisites
|
||||
|
||||
This package was only tested with a [virtual environment (venv)](https://docs.python.org/3/library/venv.html). You can set up such an environment by running:
|
||||
|
||||
```python
|
||||
# linux and macOS:
|
||||
python -m venv /path/to/new/virtual/environment
|
||||
|
||||
# Windows:
|
||||
python -m venv C:\path\to\new\virtual\environment
|
||||
```
|
||||
|
||||
Then you can [activate the environment](https://docs.python.org/3/library/venv.html#how-venvs-work), after which the venv is ready to work with.
|
||||
|
||||
# Install AMR
|
||||
|
||||
1. Since the Python package is available on the official [Python Package Index](https://pypi.org/project/AMR/), you can just run:
|
||||
|
||||
```bash
|
||||
pip install AMR
|
||||
```
|
||||
|
||||
2. Make sure you have R installed. There is **no need to install the `AMR` R package**, as it will be installed automatically.
|
||||
|
||||
For Linux:
|
||||
|
||||
```bash
|
||||
# Ubuntu / Debian
|
||||
sudo apt install r-base
|
||||
# Fedora:
|
||||
sudo dnf install R
|
||||
# CentOS/RHEL
|
||||
sudo yum install R
|
||||
```
|
||||
|
||||
For macOS (using [Homebrew](https://brew.sh)):
|
||||
|
||||
```bash
|
||||
brew install r
|
||||
```
|
||||
|
||||
For Windows, visit the [CRAN download page](https://cran.r-project.org) to download and install R.
|
||||
|
||||
# Examples of Usage
|
||||
|
||||
## Cleaning Taxonomy
|
||||
|
||||
Here’s an example that demonstrates how to clean microorganism and drug names using the `AMR` Python package:
|
||||
|
||||
```python
|
||||
import pandas as pd
|
||||
import AMR
|
||||
|
||||
# Sample data
|
||||
data = {
|
||||
"MOs": ['E. coli', 'ESCCOL', 'esco', 'Esche coli'],
|
||||
"Drug": ['Cipro', 'CIP', 'J01MA02', 'Ciproxin']
|
||||
}
|
||||
df = pd.DataFrame(data)
|
||||
|
||||
# Use AMR functions to clean microorganism and drug names
|
||||
df['MO_clean'] = AMR.mo_name(df['MOs'])
|
||||
df['Drug_clean'] = AMR.ab_name(df['Drug'])
|
||||
|
||||
# Display the results
|
||||
print(df)
|
||||
```
|
||||
|
||||
| MOs | Drug | MO_clean | Drug_clean |
|
||||
|-------------|-----------|--------------------|---------------|
|
||||
| E. coli | Cipro | Escherichia coli | Ciprofloxacin |
|
||||
| ESCCOL | CIP | Escherichia coli | Ciprofloxacin |
|
||||
| esco | J01MA02 | Escherichia coli | Ciprofloxacin |
|
||||
| Esche coli | Ciproxin | Escherichia coli | Ciprofloxacin |
|
||||
|
||||
### Explanation
|
||||
|
||||
* **mo_name:** This function standardises microorganism names. Here, different variations of *Escherichia coli* (such as "E. coli", "ESCCOL", "esco", and "Esche coli") are all converted into the correct, standardised form, "Escherichia coli".
|
||||
|
||||
* **ab_name**: Similarly, this function standardises antimicrobial names. The different representations of ciprofloxacin (e.g., "Cipro", "CIP", "J01MA02", and "Ciproxin") are all converted to the standard name, "Ciprofloxacin".
|
||||
|
||||
## Calculating AMR
|
||||
|
||||
```python
|
||||
import AMR
|
||||
import pandas as pd
|
||||
|
||||
df = AMR.example_isolates
|
||||
result = AMR.resistance(df["AMX"])
|
||||
print(result)
|
||||
```
|
||||
|
||||
```
|
||||
[0.59555556]
|
||||
```
|
||||
|
||||
## Generating Antibiograms
|
||||
|
||||
One of the core functions of the `AMR` package is generating an antibiogram, a table that summarises the antimicrobial susceptibility of bacterial isolates. Here’s how you can generate an antibiogram from Python:
|
||||
|
||||
```python
|
||||
result2a = AMR.antibiogram(df[["mo", "AMX", "CIP", "TZP"]])
|
||||
print(result2a)
|
||||
```
|
||||
|
||||
| Pathogen | Amoxicillin | Ciprofloxacin | Piperacillin/tazobactam |
|
||||
|-----------------|-----------------|-----------------|--------------------------|
|
||||
| CoNS | 7% (10/142) | 73% (183/252) | 30% (10/33) |
|
||||
| E. coli | 50% (196/392) | 88% (399/456) | 94% (393/416) |
|
||||
| K. pneumoniae | 0% (0/58) | 96% (53/55) | 89% (47/53) |
|
||||
| P. aeruginosa | 0% (0/30) | 100% (30/30) | None |
|
||||
| P. mirabilis | None | 94% (34/36) | None |
|
||||
| S. aureus | 6% (8/131) | 90% (171/191) | None |
|
||||
| S. epidermidis | 1% (1/91) | 64% (87/136) | None |
|
||||
| S. hominis | None | 80% (56/70) | None |
|
||||
| S. pneumoniae | 100% (112/112) | None | 100% (112/112) |
|
||||
|
||||
|
||||
```python
|
||||
result2b = AMR.antibiogram(df[["mo", "AMX", "CIP", "TZP"]], mo_transform = "gramstain")
|
||||
print(result2b)
|
||||
```
|
||||
|
||||
| Pathogen | Amoxicillin | Ciprofloxacin | Piperacillin/tazobactam |
|
||||
|----------------|-----------------|------------------|--------------------------|
|
||||
| Gram-negative | 36% (226/631) | 91% (621/684) | 88% (565/641) |
|
||||
| Gram-positive | 43% (305/703) | 77% (560/724) | 86% (296/345) |
|
||||
|
||||
|
||||
In this example, we generate an antibiogram by selecting various antibiotics.
|
||||
|
||||
## Taxonomic Data Sets Now in Python!
|
||||
|
||||
As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antimicrobials`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames:
|
||||
|
||||
```python
|
||||
AMR.microorganisms
|
||||
```
|
||||
|
||||
| mo | fullname | status | kingdom | gbif | gbif_parent | gbif_renamed_to | prevalence |
|
||||
|--------------|------------------------------------|----------|----------|-----------|-------------|-----------------|------------|
|
||||
| B_GRAMN | (unknown Gram-negatives) | unknown | Bacteria | None | None | None | 2.0 |
|
||||
| B_GRAMP | (unknown Gram-positives) | unknown | Bacteria | None | None | None | 2.0 |
|
||||
| B_ANAER-NEG | (unknown anaerobic Gram-negatives) | unknown | Bacteria | None | None | None | 2.0 |
|
||||
| B_ANAER-POS | (unknown anaerobic Gram-positives) | unknown | Bacteria | None | None | None | 2.0 |
|
||||
| B_ANAER | (unknown anaerobic bacteria) | unknown | Bacteria | None | None | None | 2.0 |
|
||||
| ... | ... | ... | ... | ... | ... | ... | ... |
|
||||
| B_ZYMMN_POMC | Zymomonas pomaceae | accepted | Bacteria | 10744418 | 3221412 | None | 2.0 |
|
||||
| B_ZYMPH | Zymophilus | synonym | Bacteria | None | 9475166 | None | 2.0 |
|
||||
| B_ZYMPH_PCVR | Zymophilus paucivorans | synonym | Bacteria | None | None | None | 2.0 |
|
||||
| B_ZYMPH_RFFN | Zymophilus raffinosivorans | synonym | Bacteria | None | None | None | 2.0 |
|
||||
| F_ZYZYG | Zyzygomyces | unknown | Fungi | None | 7581 | None | 2.0 |
|
||||
|
||||
```python
|
||||
AMR.antimicrobials
|
||||
```
|
||||
|
||||
| ab | cid | name | group | oral_ddd | oral_units | iv_ddd | iv_units |
|
||||
|-----|-------------|----------------------|----------------------------|----------|------------|--------|----------|
|
||||
| AMA | 4649.0 | 4-aminosalicylic acid| Antimycobacterials | 12.00 | g | NaN | None |
|
||||
| ACM | 6450012.0 | Acetylmidecamycin | Macrolides/lincosamides | NaN | None | NaN | None |
|
||||
| ASP | 49787020.0 | Acetylspiramycin | Macrolides/lincosamides | NaN | None | NaN | None |
|
||||
| ALS | 8954.0 | Aldesulfone sodium | Other antibacterials | 0.33 | g | NaN | None |
|
||||
| AMK | 37768.0 | Amikacin | Aminoglycosides | NaN | None | 1.0 | g |
|
||||
| ... | ... | ... | ... | ... | ... | ... | ... |
|
||||
| VIR | 11979535.0 | Virginiamycine | Other antibacterials | NaN | None | NaN | None |
|
||||
| VOR | 71616.0 | Voriconazole | Antifungals/antimycotics | 0.40 | g | 0.4 | g |
|
||||
| XBR | 72144.0 | Xibornol | Other antibacterials | NaN | None | NaN | None |
|
||||
| ZID | 77846445.0 | Zidebactam | Other antibacterials | NaN | None | NaN | None |
|
||||
| ZFD | NaN | Zoliflodacin | None | NaN | None | NaN | None |
|
||||
|
||||
|
||||
# Installation Channels
|
||||
|
||||
## Stable Release (CRAN)
|
||||
|
||||
The default `AMR` Python package uses the latest stable version of the `AMR` R package, published on CRAN. After running `pip install AMR`, import it as usual:
|
||||
|
||||
```python
|
||||
import AMR
|
||||
|
||||
AMR.example_isolates
|
||||
```
|
||||
|
||||
## Development Version (GitHub)
|
||||
|
||||
To use the latest development version of the `AMR` R package (sourced directly from GitHub), import the `beta` sub-package and alias it as `AMR`:
|
||||
|
||||
```python
|
||||
import AMR.beta as AMR
|
||||
|
||||
AMR.example_isolates
|
||||
```
|
||||
|
||||
Aliasing with `as AMR` keeps all downstream code identical to the stable import. Switching between the stable release and the development version requires changing only the import line — nothing else in your script needs to change.
|
||||
|
||||
# SIR Classification with `as_sir()`
|
||||
|
||||
## Using `enforce_method`
|
||||
|
||||
The `as_sir()` function in R uses S3 method dispatch to select the correct calculation method based on the input class: `<mic>` for MIC values and `<disk>` for disk diffusion values. Because Python objects do not carry R class attributes through the `rpy2` bridge, this automatic dispatch may not resolve correctly.
|
||||
|
||||
To explicitly specify the input type, use the `enforce_method` argument:
|
||||
|
||||
```python
|
||||
# Treat the column as MIC values — maps to R's as.sir.mic()
|
||||
AMR.as_sir(df["MIC_col"], mo="E. coli", ab="AMX", guideline="EUCAST", enforce_method="mic")
|
||||
|
||||
# Treat the column as disk diffusion values — maps to R's as.sir.disk()
|
||||
AMR.as_sir(df["disk_col"], mo="E. coli", ab="AMX", guideline="EUCAST", enforce_method="disk")
|
||||
```
|
||||
|
||||
Without `enforce_method`, R falls back to class-based dispatch on the raw Python input, which may fail or return unexpected results. Always supply `enforce_method` when calling `as_sir()` from Python.
|
||||
|
||||
# Conclusion
|
||||
|
||||
With the `AMR` Python package, Python users can now effortlessly call R functions from the `AMR` R package. This eliminates the need for complex `rpy2` configurations and provides a clean, easy-to-use interface for antimicrobial resistance analysis. The examples provided above demonstrate how this can be applied to typical workflows, such as standardising microorganism and antimicrobial names or calculating resistance.
|
||||
|
||||
By just running `import AMR`, users can seamlessly integrate the robust features of the R `AMR` package into Python workflows.
|
||||
|
||||
Whether you're cleaning data or analysing resistance patterns, the `AMR` Python package makes it easy to work with AMR data in Python.
|
||||
@@ -0,0 +1,12 @@
|
||||
README.md
|
||||
setup.py
|
||||
AMR/__init__.py
|
||||
AMR/_engine.py
|
||||
AMR/beta.py
|
||||
AMR/datasets.py
|
||||
AMR/functions.py
|
||||
AMR.egg-info/PKG-INFO
|
||||
AMR.egg-info/SOURCES.txt
|
||||
AMR.egg-info/dependency_links.txt
|
||||
AMR.egg-info/requires.txt
|
||||
AMR.egg-info/top_level.txt
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
rpy2
|
||||
numpy
|
||||
pandas
|
||||
@@ -0,0 +1 @@
|
||||
AMR
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
import sys
|
||||
|
||||
_DATASETS = frozenset({
|
||||
'example_isolates', 'microorganisms',
|
||||
'antimicrobials', 'clinical_breakpoints'
|
||||
})
|
||||
|
||||
class _AMRModule(type(sys.modules[__name__])):
|
||||
"""Lazy-loading module: nothing runs until an attribute is accessed."""
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name in _DATASETS:
|
||||
from .datasets import get
|
||||
return get(name, source="cran")
|
||||
try:
|
||||
from . import functions
|
||||
return getattr(functions, name)
|
||||
except AttributeError:
|
||||
raise AttributeError(
|
||||
f"module 'AMR' has no attribute '{name}'")
|
||||
|
||||
sys.modules[__name__].__class__ = _AMRModule
|
||||
from .functions import custom_eucast_rules
|
||||
from .functions import ab_class
|
||||
from .functions import ab_selector
|
||||
from .functions import ab_from_text
|
||||
from .functions import ab_name
|
||||
from .functions import ab_cid
|
||||
from .functions import ab_synonyms
|
||||
from .functions import ab_tradenames
|
||||
from .functions import ab_group
|
||||
from .functions import ab_atc
|
||||
from .functions import ab_atc_group1
|
||||
from .functions import ab_atc_group2
|
||||
from .functions import ab_loinc
|
||||
from .functions import ab_ddd
|
||||
from .functions import ab_ddd_units
|
||||
from .functions import ab_info
|
||||
from .functions import ab_url
|
||||
from .functions import ab_property
|
||||
from .functions import add_custom_antimicrobials
|
||||
from .functions import clear_custom_antimicrobials
|
||||
from .functions import add_custom_microorganisms
|
||||
from .functions import clear_custom_microorganisms
|
||||
from .functions import age
|
||||
from .functions import age_groups
|
||||
from .functions import all_sir
|
||||
from .functions import all_sir_predictors
|
||||
from .functions import all_mic
|
||||
from .functions import all_mic_predictors
|
||||
from .functions import all_disk
|
||||
from .functions import all_disk_predictors
|
||||
from .functions import step_mic_log2
|
||||
from .functions import step_sir_numeric
|
||||
from .functions import amr_course
|
||||
from .functions import wisca
|
||||
from .functions import antibiogram
|
||||
from .functions import retrieve_wisca_parameters
|
||||
from .functions import wisca_plot
|
||||
from .functions import aminoglycosides
|
||||
from .functions import aminopenicillins
|
||||
from .functions import antifungals
|
||||
from .functions import antimycobacterials
|
||||
from .functions import betalactams
|
||||
from .functions import betalactams_with_inhibitor
|
||||
from .functions import carbapenems
|
||||
from .functions import cephalosporins
|
||||
from .functions import cephalosporins_1st
|
||||
from .functions import cephalosporins_2nd
|
||||
from .functions import cephalosporins_3rd
|
||||
from .functions import cephalosporins_4th
|
||||
from .functions import cephalosporins_5th
|
||||
from .functions import fluoroquinolones
|
||||
from .functions import glycopeptides
|
||||
from .functions import ionophores
|
||||
from .functions import isoxazolylpenicillins
|
||||
from .functions import lincosamides
|
||||
from .functions import lipoglycopeptides
|
||||
from .functions import macrolides
|
||||
from .functions import monobactams
|
||||
from .functions import nitrofurans
|
||||
from .functions import oxazolidinones
|
||||
from .functions import penicillins
|
||||
from .functions import peptides
|
||||
from .functions import phenicols
|
||||
from .functions import phosphonics
|
||||
from .functions import polymyxins
|
||||
from .functions import quinolones
|
||||
from .functions import rifamycins
|
||||
from .functions import spiropyrimidinetriones
|
||||
from .functions import streptogramins
|
||||
from .functions import sulfonamides
|
||||
from .functions import tetracyclines
|
||||
from .functions import trimethoprims
|
||||
from .functions import ureidopenicillins
|
||||
from .functions import amr_class
|
||||
from .functions import amr_selector
|
||||
from .functions import administrable_per_os
|
||||
from .functions import administrable_iv
|
||||
from .functions import not_intrinsic_resistant
|
||||
from .functions import as_ab
|
||||
from .functions import is_ab
|
||||
from .functions import ab_reset_session
|
||||
from .functions import as_av
|
||||
from .functions import is_av
|
||||
from .functions import as_disk
|
||||
from .functions import is_disk
|
||||
from .functions import as_mic
|
||||
from .functions import is_mic
|
||||
from .functions import rescale_mic
|
||||
from .functions import mic_p50
|
||||
from .functions import mic_p90
|
||||
from .functions import as_mo
|
||||
from .functions import is_mo
|
||||
from .functions import mo_uncertainties
|
||||
from .functions import mo_renamed
|
||||
from .functions import mo_failures
|
||||
from .functions import mo_reset_session
|
||||
from .functions import mo_cleaning_regex
|
||||
from .functions import as_sir
|
||||
from .functions import is_sir
|
||||
from .functions import is_sir_eligible
|
||||
from .functions import sir_interpretation_history
|
||||
from .functions import atc_online_property
|
||||
from .functions import atc_online_groups
|
||||
from .functions import atc_online_ddd
|
||||
from .functions import atc_online_ddd_units
|
||||
from .functions import av_from_text
|
||||
from .functions import av_name
|
||||
from .functions import av_cid
|
||||
from .functions import av_synonyms
|
||||
from .functions import av_tradenames
|
||||
from .functions import av_group
|
||||
from .functions import av_atc
|
||||
from .functions import av_loinc
|
||||
from .functions import av_ddd
|
||||
from .functions import av_ddd_units
|
||||
from .functions import av_info
|
||||
from .functions import av_url
|
||||
from .functions import av_property
|
||||
from .functions import availability
|
||||
from .functions import bug_drug_combinations
|
||||
from .functions import count_resistant
|
||||
from .functions import count_susceptible
|
||||
from .functions import count_S
|
||||
from .functions import count_SI
|
||||
from .functions import count_I
|
||||
from .functions import count_IR
|
||||
from .functions import count_R
|
||||
from .functions import count_all
|
||||
from .functions import n_sir
|
||||
from .functions import count_df
|
||||
from .functions import custom_interpretive_rules
|
||||
from .functions import custom_mdro_guideline
|
||||
from .functions import export_ncbi_biosample
|
||||
from .functions import first_isolate
|
||||
from .functions import filter_first_isolate
|
||||
from .functions import g_test
|
||||
from .functions import is_new_episode
|
||||
from .functions import ggplot_pca
|
||||
from .functions import ggplot_sir
|
||||
from .functions import geom_sir
|
||||
from .functions import guess_ab_col
|
||||
from .functions import interpretive_rules
|
||||
from .functions import eucast_rules
|
||||
from .functions import clsi_rules
|
||||
from .functions import eucast_dosage
|
||||
from .functions import italicise_taxonomy
|
||||
from .functions import italicize_taxonomy
|
||||
from .functions import inner_join_microorganisms
|
||||
from .functions import left_join_microorganisms
|
||||
from .functions import right_join_microorganisms
|
||||
from .functions import full_join_microorganisms
|
||||
from .functions import semi_join_microorganisms
|
||||
from .functions import anti_join_microorganisms
|
||||
from .functions import key_antimicrobials
|
||||
from .functions import all_antimicrobials
|
||||
from .functions import kurtosis
|
||||
from .functions import like
|
||||
from .functions import mdro
|
||||
from .functions import brmo
|
||||
from .functions import mrgn
|
||||
from .functions import mdr_tb
|
||||
from .functions import mdr_cmi2012
|
||||
from .functions import eucast_exceptional_phenotypes
|
||||
from .functions import mean_amr_distance
|
||||
from .functions import amr_distance_from_row
|
||||
from .functions import mo_matching_score
|
||||
from .functions import mo_name
|
||||
from .functions import mo_fullname
|
||||
from .functions import mo_shortname
|
||||
from .functions import mo_subspecies
|
||||
from .functions import mo_species
|
||||
from .functions import mo_genus
|
||||
from .functions import mo_family
|
||||
from .functions import mo_order
|
||||
from .functions import mo_class
|
||||
from .functions import mo_phylum
|
||||
from .functions import mo_kingdom
|
||||
from .functions import mo_domain
|
||||
from .functions import mo_type
|
||||
from .functions import mo_status
|
||||
from .functions import mo_pathogenicity
|
||||
from .functions import mo_gramstain
|
||||
from .functions import mo_is_gram_negative
|
||||
from .functions import mo_is_gram_positive
|
||||
from .functions import mo_is_yeast
|
||||
from .functions import mo_is_intrinsic_resistant
|
||||
from .functions import mo_oxygen_tolerance
|
||||
from .functions import mo_is_anaerobic
|
||||
from .functions import mo_morphology
|
||||
from .functions import mo_snomed
|
||||
from .functions import mo_ref
|
||||
from .functions import mo_authors
|
||||
from .functions import mo_year
|
||||
from .functions import mo_lpsn
|
||||
from .functions import mo_mycobank
|
||||
from .functions import mo_gbif
|
||||
from .functions import mo_rank
|
||||
from .functions import mo_taxonomy
|
||||
from .functions import mo_synonyms
|
||||
from .functions import mo_current
|
||||
from .functions import mo_group_members
|
||||
from .functions import mo_info
|
||||
from .functions import mo_url
|
||||
from .functions import mo_property
|
||||
from .functions import pca
|
||||
from .functions import theme_sir
|
||||
from .functions import labels_sir_count
|
||||
from .functions import resistance
|
||||
from .functions import susceptibility
|
||||
from .functions import sir_confidence_interval
|
||||
from .functions import proportion_R
|
||||
from .functions import proportion_IR
|
||||
from .functions import proportion_I
|
||||
from .functions import proportion_SI
|
||||
from .functions import proportion_S
|
||||
from .functions import proportion_df
|
||||
from .functions import sir_df
|
||||
from .functions import random_mic
|
||||
from .functions import random_disk
|
||||
from .functions import random_sir
|
||||
from .functions import resistance_predict
|
||||
from .functions import sir_predict
|
||||
from .functions import ggplot_sir_predict
|
||||
from .functions import skewness
|
||||
from .functions import top_n_microorganisms
|
||||
from .functions import reset_AMR_locale
|
||||
from .functions import translate_AMR
|
||||
@@ -0,0 +1,93 @@
|
||||
import os
|
||||
import sys
|
||||
import importlib.metadata as metadata
|
||||
|
||||
# Get the path to the virtual environment
|
||||
venv_path = sys.prefix
|
||||
r_lib_path = os.path.join(venv_path, "R_libs")
|
||||
os.makedirs(r_lib_path, exist_ok=True)
|
||||
|
||||
# Set environment variable before importing rpy2
|
||||
os.environ['R_LIBS_SITE'] = r_lib_path
|
||||
|
||||
from rpy2 import robjects
|
||||
from rpy2.robjects.vectors import StrVector
|
||||
from rpy2.robjects.packages import importr, isinstalled
|
||||
|
||||
# Import base and utils once
|
||||
base = importr('base')
|
||||
utils = importr('utils')
|
||||
|
||||
# Silence R console output entirely
|
||||
robjects.r('suppressMessages(suppressWarnings(sink(tempfile())))')
|
||||
base._libPaths(r_lib_path)
|
||||
|
||||
_installed_source = None
|
||||
|
||||
def _r_version():
|
||||
"""Return the currently installed AMR R package version, or None."""
|
||||
try:
|
||||
return str(robjects.r(
|
||||
f'as.character(packageVersion("AMR", lib.loc = "{r_lib_path}"))')[0])
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
def _py_version():
|
||||
"""Return the Python AMR package version from metadata, or empty string."""
|
||||
try:
|
||||
return str(metadata.version('AMR'))
|
||||
except metadata.PackageNotFoundError:
|
||||
return ''
|
||||
|
||||
def _install_cran():
|
||||
"""Install AMR from CRAN into the isolated library."""
|
||||
print("AMR: Installing from CRAN...", flush=True)
|
||||
utils.install_packages(
|
||||
'AMR',
|
||||
repos='https://cloud.r-project.org',
|
||||
lib=r_lib_path,
|
||||
quiet=True
|
||||
)
|
||||
|
||||
def _install_github():
|
||||
"""Install AMR development version from GitHub into the isolated library."""
|
||||
print("AMR: Installing development version from GitHub...", flush=True)
|
||||
utils.install_packages(
|
||||
StrVector(['remotes', 'desc']),
|
||||
repos='https://cloud.r-project.org',
|
||||
lib=r_lib_path,
|
||||
quiet=True
|
||||
)
|
||||
remotes = importr('remotes', lib_loc=r_lib_path)
|
||||
remotes.install_github('msberends/AMR', lib=r_lib_path, quiet=True)
|
||||
|
||||
def ensure_amr(source="cran"):
|
||||
"""Ensure AMR is installed from the requested source. Idempotent per source."""
|
||||
global _installed_source
|
||||
|
||||
if _installed_source == source:
|
||||
return
|
||||
|
||||
install_fn = _install_github if source == "github" else _install_cran
|
||||
|
||||
if not isinstalled('AMR', lib_loc=r_lib_path):
|
||||
install_fn()
|
||||
else:
|
||||
# Check for version mismatch and update if needed
|
||||
r_ver = _r_version()
|
||||
py_ver = _py_version()
|
||||
if r_ver != py_ver:
|
||||
try:
|
||||
install_fn()
|
||||
except Exception as e:
|
||||
print(f"AMR: Could not update ({e})", flush=True)
|
||||
|
||||
print(f"AMR: R package version {_r_version()} ready.", flush=True)
|
||||
_installed_source = source
|
||||
|
||||
def restore_sink():
|
||||
"""Restore R console output after setup is complete."""
|
||||
try:
|
||||
robjects.r('sink()')
|
||||
except Exception:
|
||||
pass
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
import sys
|
||||
|
||||
_DATASETS = frozenset({
|
||||
'example_isolates', 'microorganisms',
|
||||
'antimicrobials', 'clinical_breakpoints'
|
||||
})
|
||||
|
||||
class _BetaModule(type(sys.modules[__name__])):
|
||||
"""Lazy-loading module: installs AMR from GitHub on first access."""
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name in _DATASETS:
|
||||
from .datasets import get
|
||||
return get(name, source="github")
|
||||
try:
|
||||
from . import functions
|
||||
return getattr(functions, name)
|
||||
except AttributeError:
|
||||
raise AttributeError(
|
||||
f"module 'AMR.beta' has no attribute '{name}'")
|
||||
|
||||
sys.modules[__name__].__class__ = _BetaModule
|
||||
@@ -0,0 +1,54 @@
|
||||
import pandas as pd
|
||||
from rpy2 import robjects
|
||||
from rpy2.robjects.conversion import localconverter
|
||||
from rpy2.robjects import default_converter, numpy2ri, pandas2ri
|
||||
|
||||
from ._engine import ensure_amr, restore_sink
|
||||
|
||||
_cache = {}
|
||||
_loaded_source = None
|
||||
|
||||
def _load_datasets(source="cran"):
|
||||
"""Load all AMR datasets into the module cache."""
|
||||
global _loaded_source
|
||||
|
||||
if _cache and _loaded_source == source:
|
||||
return
|
||||
|
||||
if _cache and _loaded_source != source:
|
||||
_cache.clear()
|
||||
|
||||
ensure_amr(source)
|
||||
|
||||
with localconverter(default_converter + numpy2ri.converter + pandas2ri.converter):
|
||||
_cache['example_isolates'] = _load_example_isolates()
|
||||
_cache['microorganisms'] = robjects.r(
|
||||
'AMR::microorganisms[, !sapply(AMR::microorganisms, is.list)]')
|
||||
_cache['antimicrobials'] = robjects.r(
|
||||
'AMR::antimicrobials[, !sapply(AMR::antimicrobials, is.list)]')
|
||||
_cache['clinical_breakpoints'] = robjects.r(
|
||||
'AMR::clinical_breakpoints[, !sapply(AMR::clinical_breakpoints, is.list)]')
|
||||
|
||||
restore_sink()
|
||||
_loaded_source = source
|
||||
|
||||
def _load_example_isolates():
|
||||
df = robjects.r('''
|
||||
df <- AMR::example_isolates
|
||||
df[] <- lapply(df, function(x) {
|
||||
if (inherits(x, c("Date", "POSIXt", "factor"))) {
|
||||
as.character(x)
|
||||
} else {
|
||||
x
|
||||
}
|
||||
})
|
||||
df <- df[, !sapply(df, is.list)]
|
||||
df
|
||||
''')
|
||||
df['date'] = pd.to_datetime(df['date'])
|
||||
return df
|
||||
|
||||
def get(name, source="cran"):
|
||||
"""Retrieve a dataset by name, installing AMR if needed."""
|
||||
_load_datasets(source)
|
||||
return _cache[name]
|
||||
@@ -0,0 +1,984 @@
|
||||
import functools
|
||||
import rpy2.robjects as robjects
|
||||
from rpy2.robjects.packages import importr
|
||||
from rpy2.robjects.vectors import StrVector, FactorVector, IntVector, FloatVector, DataFrame
|
||||
from rpy2.robjects.conversion import localconverter
|
||||
from rpy2.robjects import default_converter, numpy2ri, pandas2ri
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
|
||||
from ._engine import ensure_amr
|
||||
|
||||
# Ensure AMR is available before importing it in R
|
||||
ensure_amr("cran")
|
||||
amr_r = importr('AMR')
|
||||
|
||||
def convert_to_r(value):
|
||||
"""Convert Python lists/tuples to typed R vectors.
|
||||
|
||||
rpy2's default_converter passes Python lists to R as R lists, not as
|
||||
character/numeric vectors. This causes element-wise type-check functions
|
||||
such as is.mic(), is.sir(), and is.disk() to return a logical vector
|
||||
rather than a single logical, breaking R's scalar && operator.
|
||||
|
||||
This helper converts Python lists and tuples to the appropriate R vector
|
||||
type based on the element types, so R always receives a proper vector."""
|
||||
if isinstance(value, (list, tuple)):
|
||||
if len(value) == 0:
|
||||
return StrVector([])
|
||||
# bool must be checked before int because bool is a subclass of int
|
||||
if all(isinstance(v, bool) for v in value):
|
||||
return robjects.vectors.BoolVector(value)
|
||||
if all(isinstance(v, int) for v in value):
|
||||
return IntVector(value)
|
||||
if all(isinstance(v, float) for v in value):
|
||||
return FloatVector(value)
|
||||
if all(isinstance(v, str) for v in value):
|
||||
return StrVector(value)
|
||||
# Mixed types: coerce all to string
|
||||
return StrVector([str(v) for v in value])
|
||||
return value
|
||||
|
||||
def convert_to_python(r_output):
|
||||
# Check if it's a StrVector (R character vector)
|
||||
if isinstance(r_output, StrVector):
|
||||
return list(r_output) # Convert to a Python list of strings
|
||||
|
||||
# Check if it's a FactorVector (R factor)
|
||||
elif isinstance(r_output, FactorVector):
|
||||
return list(r_output) # Convert to a list of integers (factor levels)
|
||||
|
||||
# Check if it's an IntVector or FloatVector (numeric R vectors)
|
||||
elif isinstance(r_output, (IntVector, FloatVector)):
|
||||
return list(r_output) # Convert to a Python list of integers or floats
|
||||
|
||||
# Check if it's a pandas-compatible R data frame
|
||||
elif isinstance(r_output, (pd.DataFrame, DataFrame)):
|
||||
return r_output # Return as pandas DataFrame (already converted by pandas2ri)
|
||||
|
||||
# Check if the input is a NumPy array and has a string data type
|
||||
if isinstance(r_output, np.ndarray) and np.issubdtype(r_output.dtype, np.str_):
|
||||
return r_output.tolist() # Convert to a regular Python list
|
||||
|
||||
# Fall-back
|
||||
return r_output
|
||||
|
||||
def r_to_python(r_func):
|
||||
"""Decorator that converts Python list/tuple inputs to typed R vectors,
|
||||
runs the rpy2 function under a localconverter, and converts the output
|
||||
to a Python type."""
|
||||
@functools.wraps(r_func)
|
||||
def wrapper(*args, **kwargs):
|
||||
args = tuple(convert_to_r(a) for a in args)
|
||||
kwargs = {k: convert_to_r(v) for k, v in kwargs.items()}
|
||||
with localconverter(default_converter + numpy2ri.converter + pandas2ri.converter):
|
||||
return convert_to_python(r_func(*args, **kwargs))
|
||||
return wrapper
|
||||
@r_to_python
|
||||
def custom_eucast_rules(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.custom_eucast_rules(*args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_class(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_class(*args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_selector(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_selector(*args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_from_text(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_from_text(*args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_name(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_name(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_cid(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_cid(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_synonyms(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_synonyms(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_tradenames(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_tradenames(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_group(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_group(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_atc(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_atc(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_atc_group1(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_atc_group1(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_atc_group2(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_atc_group2(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_loinc(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_loinc(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_ddd(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_ddd(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_ddd_units(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_ddd_units(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_info(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_info(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_url(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_url(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ab_property(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_property(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def add_custom_antimicrobials(x):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.add_custom_antimicrobials(x)
|
||||
@r_to_python
|
||||
def clear_custom_antimicrobials(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.clear_custom_antimicrobials(*args, **kwargs)
|
||||
@r_to_python
|
||||
def add_custom_microorganisms(x):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.add_custom_microorganisms(x)
|
||||
@r_to_python
|
||||
def clear_custom_microorganisms(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.clear_custom_microorganisms(*args, **kwargs)
|
||||
@r_to_python
|
||||
def age(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.age(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def age_groups(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.age_groups(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def all_sir(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.all_sir(*args, **kwargs)
|
||||
@r_to_python
|
||||
def all_sir_predictors(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.all_sir_predictors(*args, **kwargs)
|
||||
@r_to_python
|
||||
def all_mic(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.all_mic(*args, **kwargs)
|
||||
@r_to_python
|
||||
def all_mic_predictors(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.all_mic_predictors(*args, **kwargs)
|
||||
@r_to_python
|
||||
def all_disk(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.all_disk(*args, **kwargs)
|
||||
@r_to_python
|
||||
def all_disk_predictors(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.all_disk_predictors(*args, **kwargs)
|
||||
@r_to_python
|
||||
def step_mic_log2(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.step_mic_log2(*args, **kwargs)
|
||||
@r_to_python
|
||||
def step_sir_numeric(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.step_sir_numeric(*args, **kwargs)
|
||||
@r_to_python
|
||||
def amr_course(github_repo, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.amr_course(github_repo, *args, **kwargs)
|
||||
@r_to_python
|
||||
def wisca(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.wisca(*args, **kwargs)
|
||||
@r_to_python
|
||||
def antibiogram(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.antibiogram(*args, **kwargs)
|
||||
@r_to_python
|
||||
def retrieve_wisca_parameters(wisca_model, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.retrieve_wisca_parameters(wisca_model, *args, **kwargs)
|
||||
@r_to_python
|
||||
def wisca_plot(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.wisca_plot(*args, **kwargs)
|
||||
@r_to_python
|
||||
def aminoglycosides(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.aminoglycosides(*args, **kwargs)
|
||||
@r_to_python
|
||||
def aminopenicillins(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.aminopenicillins(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def antifungals(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.antifungals(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def antimycobacterials(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.antimycobacterials(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def betalactams(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.betalactams(*args, **kwargs)
|
||||
@r_to_python
|
||||
def betalactams_with_inhibitor(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.betalactams_with_inhibitor(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def carbapenems(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.carbapenems(*args, **kwargs)
|
||||
@r_to_python
|
||||
def cephalosporins(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.cephalosporins(*args, **kwargs)
|
||||
@r_to_python
|
||||
def cephalosporins_1st(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.cephalosporins_1st(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def cephalosporins_2nd(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.cephalosporins_2nd(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def cephalosporins_3rd(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.cephalosporins_3rd(*args, **kwargs)
|
||||
@r_to_python
|
||||
def cephalosporins_4th(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.cephalosporins_4th(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def cephalosporins_5th(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.cephalosporins_5th(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def fluoroquinolones(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.fluoroquinolones(*args, **kwargs)
|
||||
@r_to_python
|
||||
def glycopeptides(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.glycopeptides(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ionophores(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ionophores(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def isoxazolylpenicillins(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.isoxazolylpenicillins(*args, **kwargs)
|
||||
@r_to_python
|
||||
def lincosamides(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.lincosamides(*args, **kwargs)
|
||||
@r_to_python
|
||||
def lipoglycopeptides(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.lipoglycopeptides(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def macrolides(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.macrolides(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def monobactams(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.monobactams(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def nitrofurans(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.nitrofurans(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def oxazolidinones(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.oxazolidinones(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def penicillins(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.penicillins(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def peptides(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.peptides(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def phenicols(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.phenicols(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def phosphonics(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.phosphonics(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def polymyxins(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.polymyxins(*args, **kwargs)
|
||||
@r_to_python
|
||||
def quinolones(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.quinolones(*args, **kwargs)
|
||||
@r_to_python
|
||||
def rifamycins(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.rifamycins(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def spiropyrimidinetriones(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.spiropyrimidinetriones(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def streptogramins(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.streptogramins(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def sulfonamides(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.sulfonamides(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def tetracyclines(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.tetracyclines(*args, **kwargs)
|
||||
@r_to_python
|
||||
def trimethoprims(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.trimethoprims(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ureidopenicillins(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ureidopenicillins(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def amr_class(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.amr_class(*args, **kwargs)
|
||||
@r_to_python
|
||||
def amr_selector(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.amr_selector(*args, **kwargs)
|
||||
@r_to_python
|
||||
def administrable_per_os(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.administrable_per_os(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def administrable_iv(only_sir_columns = False, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.administrable_iv(only_sir_columns = False, *args, **kwargs)
|
||||
@r_to_python
|
||||
def not_intrinsic_resistant(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.not_intrinsic_resistant(*args, **kwargs)
|
||||
@r_to_python
|
||||
def as_ab(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.as_ab(*args, **kwargs)
|
||||
@r_to_python
|
||||
def is_ab(x):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.is_ab(x)
|
||||
@r_to_python
|
||||
def ab_reset_session(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ab_reset_session(*args, **kwargs)
|
||||
@r_to_python
|
||||
def as_av(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.as_av(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def is_av(x):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.is_av(x)
|
||||
@r_to_python
|
||||
def as_disk(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.as_disk(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def is_disk(x):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.is_disk(x)
|
||||
@r_to_python
|
||||
def as_mic(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.as_mic(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def is_mic(x):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.is_mic(x)
|
||||
@r_to_python
|
||||
def rescale_mic(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.rescale_mic(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mic_p50(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mic_p50(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def mic_p90(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mic_p90(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def as_mo(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.as_mo(*args, **kwargs)
|
||||
@r_to_python
|
||||
def is_mo(x):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.is_mo(x)
|
||||
@r_to_python
|
||||
def mo_uncertainties(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_uncertainties(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_renamed(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_renamed(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_failures(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_failures(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_reset_session(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_reset_session(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_cleaning_regex(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_cleaning_regex(*args, **kwargs)
|
||||
@r_to_python
|
||||
def as_sir(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.as_sir(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def is_sir(x):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.is_sir(x)
|
||||
@r_to_python
|
||||
def is_sir_eligible(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.is_sir_eligible(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def sir_interpretation_history(clean):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.sir_interpretation_history(clean)
|
||||
@r_to_python
|
||||
def atc_online_property(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.atc_online_property(*args, **kwargs)
|
||||
@r_to_python
|
||||
def atc_online_groups(atc_code, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.atc_online_groups(atc_code, *args, **kwargs)
|
||||
@r_to_python
|
||||
def atc_online_ddd(atc_code, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.atc_online_ddd(atc_code, *args, **kwargs)
|
||||
@r_to_python
|
||||
def atc_online_ddd_units(atc_code, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.atc_online_ddd_units(atc_code, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_from_text(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_from_text(*args, **kwargs)
|
||||
@r_to_python
|
||||
def av_name(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_name(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_cid(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_cid(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_synonyms(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_synonyms(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_tradenames(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_tradenames(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_group(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_group(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_atc(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_atc(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_loinc(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_loinc(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_ddd(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_ddd(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_ddd_units(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_ddd_units(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_info(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_info(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_url(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_url(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def av_property(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.av_property(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def availability(tbl, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.availability(tbl, *args, **kwargs)
|
||||
@r_to_python
|
||||
def bug_drug_combinations(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.bug_drug_combinations(*args, **kwargs)
|
||||
@r_to_python
|
||||
def count_resistant(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.count_resistant(*args, **kwargs)
|
||||
@r_to_python
|
||||
def count_susceptible(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.count_susceptible(*args, **kwargs)
|
||||
@r_to_python
|
||||
def count_S(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.count_S(*args, **kwargs)
|
||||
@r_to_python
|
||||
def count_SI(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.count_SI(*args, **kwargs)
|
||||
@r_to_python
|
||||
def count_I(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.count_I(*args, **kwargs)
|
||||
@r_to_python
|
||||
def count_IR(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.count_IR(*args, **kwargs)
|
||||
@r_to_python
|
||||
def count_R(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.count_R(*args, **kwargs)
|
||||
@r_to_python
|
||||
def count_all(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.count_all(*args, **kwargs)
|
||||
@r_to_python
|
||||
def n_sir(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.n_sir(*args, **kwargs)
|
||||
@r_to_python
|
||||
def count_df(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.count_df(*args, **kwargs)
|
||||
@r_to_python
|
||||
def custom_interpretive_rules(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.custom_interpretive_rules(*args, **kwargs)
|
||||
@r_to_python
|
||||
def custom_mdro_guideline(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.custom_mdro_guideline(*args, **kwargs)
|
||||
@r_to_python
|
||||
def export_ncbi_biosample(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.export_ncbi_biosample(*args, **kwargs)
|
||||
@r_to_python
|
||||
def first_isolate(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.first_isolate(*args, **kwargs)
|
||||
@r_to_python
|
||||
def filter_first_isolate(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.filter_first_isolate(*args, **kwargs)
|
||||
@r_to_python
|
||||
def g_test(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.g_test(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def is_new_episode(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.is_new_episode(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def ggplot_pca(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ggplot_pca(*args, **kwargs)
|
||||
@r_to_python
|
||||
def ggplot_sir(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ggplot_sir(*args, **kwargs)
|
||||
@r_to_python
|
||||
def geom_sir(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.geom_sir(*args, **kwargs)
|
||||
@r_to_python
|
||||
def guess_ab_col(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.guess_ab_col(*args, **kwargs)
|
||||
@r_to_python
|
||||
def interpretive_rules(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.interpretive_rules(*args, **kwargs)
|
||||
@r_to_python
|
||||
def eucast_rules(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.eucast_rules(*args, **kwargs)
|
||||
@r_to_python
|
||||
def clsi_rules(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.clsi_rules(*args, **kwargs)
|
||||
@r_to_python
|
||||
def eucast_dosage(ab, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.eucast_dosage(ab, *args, **kwargs)
|
||||
@r_to_python
|
||||
def italicise_taxonomy(string, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.italicise_taxonomy(string, *args, **kwargs)
|
||||
@r_to_python
|
||||
def italicize_taxonomy(string, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.italicize_taxonomy(string, *args, **kwargs)
|
||||
@r_to_python
|
||||
def inner_join_microorganisms(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.inner_join_microorganisms(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def left_join_microorganisms(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.left_join_microorganisms(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def right_join_microorganisms(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.right_join_microorganisms(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def full_join_microorganisms(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.full_join_microorganisms(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def semi_join_microorganisms(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.semi_join_microorganisms(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def anti_join_microorganisms(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.anti_join_microorganisms(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def key_antimicrobials(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.key_antimicrobials(*args, **kwargs)
|
||||
@r_to_python
|
||||
def all_antimicrobials(x = None, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.all_antimicrobials(x = None, *args, **kwargs)
|
||||
@r_to_python
|
||||
def kurtosis(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.kurtosis(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def like(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.like(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def mdro(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mdro(*args, **kwargs)
|
||||
@r_to_python
|
||||
def brmo(x = None, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.brmo(x = None, *args, **kwargs)
|
||||
@r_to_python
|
||||
def mrgn(x = None, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mrgn(x = None, *args, **kwargs)
|
||||
@r_to_python
|
||||
def mdr_tb(x = None, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mdr_tb(x = None, *args, **kwargs)
|
||||
@r_to_python
|
||||
def mdr_cmi2012(x = None, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mdr_cmi2012(x = None, *args, **kwargs)
|
||||
@r_to_python
|
||||
def eucast_exceptional_phenotypes(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.eucast_exceptional_phenotypes(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mean_amr_distance(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mean_amr_distance(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def amr_distance_from_row(amr_distance, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.amr_distance_from_row(amr_distance, *args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_matching_score(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_matching_score(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_name(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_name(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_fullname(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_fullname(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_shortname(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_shortname(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_subspecies(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_subspecies(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_species(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_species(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_genus(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_genus(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_family(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_family(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_order(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_order(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_class(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_class(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_phylum(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_phylum(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_kingdom(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_kingdom(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_domain(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_domain(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_type(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_type(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_status(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_status(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_pathogenicity(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_pathogenicity(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_gramstain(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_gramstain(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_is_gram_negative(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_is_gram_negative(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_is_gram_positive(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_is_gram_positive(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_is_yeast(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_is_yeast(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_is_intrinsic_resistant(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_is_intrinsic_resistant(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_oxygen_tolerance(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_oxygen_tolerance(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_is_anaerobic(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_is_anaerobic(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_morphology(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_morphology(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_snomed(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_snomed(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_ref(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_ref(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_authors(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_authors(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_year(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_year(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_lpsn(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_lpsn(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_mycobank(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_mycobank(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_gbif(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_gbif(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_rank(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_rank(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_taxonomy(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_taxonomy(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_synonyms(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_synonyms(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_current(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_current(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_group_members(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_group_members(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_info(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_info(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_url(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_url(*args, **kwargs)
|
||||
@r_to_python
|
||||
def mo_property(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.mo_property(*args, **kwargs)
|
||||
@r_to_python
|
||||
def pca(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.pca(*args, **kwargs)
|
||||
@r_to_python
|
||||
def theme_sir(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.theme_sir(*args, **kwargs)
|
||||
@r_to_python
|
||||
def labels_sir_count(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.labels_sir_count(*args, **kwargs)
|
||||
@r_to_python
|
||||
def resistance(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.resistance(*args, **kwargs)
|
||||
@r_to_python
|
||||
def susceptibility(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.susceptibility(*args, **kwargs)
|
||||
@r_to_python
|
||||
def sir_confidence_interval(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.sir_confidence_interval(*args, **kwargs)
|
||||
@r_to_python
|
||||
def proportion_R(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.proportion_R(*args, **kwargs)
|
||||
@r_to_python
|
||||
def proportion_IR(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.proportion_IR(*args, **kwargs)
|
||||
@r_to_python
|
||||
def proportion_I(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.proportion_I(*args, **kwargs)
|
||||
@r_to_python
|
||||
def proportion_SI(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.proportion_SI(*args, **kwargs)
|
||||
@r_to_python
|
||||
def proportion_S(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.proportion_S(*args, **kwargs)
|
||||
@r_to_python
|
||||
def proportion_df(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.proportion_df(*args, **kwargs)
|
||||
@r_to_python
|
||||
def sir_df(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.sir_df(*args, **kwargs)
|
||||
@r_to_python
|
||||
def random_mic(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.random_mic(*args, **kwargs)
|
||||
@r_to_python
|
||||
def random_disk(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.random_disk(*args, **kwargs)
|
||||
@r_to_python
|
||||
def random_sir(size = None, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.random_sir(size = None, *args, **kwargs)
|
||||
@r_to_python
|
||||
def resistance_predict(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.resistance_predict(*args, **kwargs)
|
||||
@r_to_python
|
||||
def sir_predict(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.sir_predict(*args, **kwargs)
|
||||
@r_to_python
|
||||
def ggplot_sir_predict(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.ggplot_sir_predict(*args, **kwargs)
|
||||
@r_to_python
|
||||
def skewness(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.skewness(x, *args, **kwargs)
|
||||
@r_to_python
|
||||
def top_n_microorganisms(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.top_n_microorganisms(*args, **kwargs)
|
||||
@r_to_python
|
||||
def reset_AMR_locale(*args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.reset_AMR_locale(*args, **kwargs)
|
||||
@r_to_python
|
||||
def translate_AMR(x, *args, **kwargs):
|
||||
"""Please see our website of the R package for the full manual: https://amr-for-r.org"""
|
||||
return amr_r.translate_AMR(x, *args, **kwargs)
|
||||
-68
@@ -1,68 +0,0 @@
|
||||
Package: AMR
|
||||
Version: 1.5.0.9002
|
||||
Date: 2021-01-14
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
person(role = c("aut", "cre"),
|
||||
family = "Berends", given = c("Matthijs", "S."), email = "m.s.berends@umcg.nl", comment = c(ORCID = "0000-0001-7620-1800")),
|
||||
person(role = c("aut", "ctb"),
|
||||
family = "Luz", given = c("Christian", "F."), email = "c.f.luz@umcg.nl", comment = c(ORCID = "0000-0001-5809-5995")),
|
||||
person(role = c("aut", "ths"),
|
||||
family = "Friedrich", given = c("Alexander", "W."), email = "alex.friedrich@umcg.nl", comment = c(ORCID = "0000-0003-4881-038X")),
|
||||
person(role = c("aut", "ths"),
|
||||
family = "Sinha", given = c("Bhanu", "N.", "M."), email = "b.sinha@umcg.nl", comment = c(ORCID = "0000-0003-1634-0010")),
|
||||
person(role = c("aut", "ths"),
|
||||
family = "Albers", given = c("Casper", "J."), email = "c.j.albers@rug.nl", comment = c(ORCID = "0000-0002-9213-6743")),
|
||||
person(role = c("aut", "ths"),
|
||||
family = "Glasner", given = "Corinna", email = "c.glasner@umcg.nl", comment = c(ORCID = "0000-0003-1241-1328")),
|
||||
person(role = "ctb",
|
||||
family = "Fonville", given = c("Judith", "M."), email = "j.fonville@pamm.nl"),
|
||||
person(role = "ctb",
|
||||
family = "Hassing", given = c("Erwin", "E.", "A."), email = "e.hassing@certe.nl"),
|
||||
person(role = "ctb",
|
||||
family = "Hazenberg", given = c("Eric", "H.", "L.", "C.", "M."), email = "e.hazenberg@jbz.nl"),
|
||||
person(role = "ctb",
|
||||
family = "Knight", given = "Gwen", email = "gwen.knight@lshtm.ac.uk"),
|
||||
person(role = "ctb",
|
||||
family = "Lenglet", given = "Annick", email = "annick.lenglet@amsterdam.msf.org"),
|
||||
person(role = "ctb",
|
||||
family = "Meijer", given = c("Bart", "C."), email = "b.meijerg@certe.nl"),
|
||||
person(role = "ctb",
|
||||
family = "Ny", given = "Sofia", email = "sofia.ny@folkhalsomyndigheten.se"),
|
||||
person(role = "ctb",
|
||||
family = "Schade", given = c("Rogier", "P."), email = "r.schade@amsterdamumc.nl"),
|
||||
person(role = "ctb",
|
||||
family = "Souverein", given = "Dennis", email = "d.souvereing@streeklabhaarlem.nl"),
|
||||
person(role = "ctb",
|
||||
family = "Underwood", given = "Anthony", email = "au3@sanger.ac.uk"))
|
||||
Description: Functions to simplify the analysis and prediction of Antimicrobial
|
||||
Resistance (AMR) and to work with microbial and antimicrobial properties by
|
||||
using evidence-based methods, like those defined by Leclercq et al. (2013)
|
||||
<doi:10.1111/j.1469-0691.2011.03703.x> and the Clinical and Laboratory
|
||||
Standards Institute (2014) <isbn: 1-56238-899-1>.
|
||||
Depends:
|
||||
R (>= 3.0.0)
|
||||
Suggests:
|
||||
cleaner,
|
||||
curl,
|
||||
dplyr,
|
||||
ggplot2,
|
||||
knitr,
|
||||
microbenchmark,
|
||||
pillar,
|
||||
readxl,
|
||||
rmarkdown,
|
||||
rstudioapi,
|
||||
rvest,
|
||||
skimr,
|
||||
testthat,
|
||||
tidyr,
|
||||
xml2
|
||||
VignetteBuilder: knitr,rmarkdown
|
||||
URL: https://msberends.github.io/AMR/, https://github.com/msberends/AMR
|
||||
BugReports: https://github.com/msberends/AMR/issues
|
||||
License: GPL-2 | file LICENSE
|
||||
Encoding: UTF-8
|
||||
LazyData: true
|
||||
RoxygenNote: 7.1.1
|
||||
Roxygen: list(markdown = TRUE)
|
||||
@@ -1,248 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
A SUMMARY OF THIS LICENSE BY THE ORIGINAL AUTHORS OF THE AMR R PACKAGE
|
||||
|
||||
This R package, with package name 'AMR':
|
||||
- May be used for commercial purposes
|
||||
- May be used for private purposes
|
||||
- May NOT be used for patent purposes
|
||||
- May be modified, although:
|
||||
- Modifications MUST be released under the same license when distributing the package
|
||||
- Changes made to the code MUST be documented
|
||||
- May be distributed, although:
|
||||
- Source code MUST be made available when the package is distributed
|
||||
- A copy of the license and copyright notice MUST be included with the package.
|
||||
- Comes with a LIMITATION of liability
|
||||
- Comes with NO warranty
|
||||
|
||||
END OF THE SUMMARY
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
@@ -1,248 +0,0 @@
|
||||
# Generated by roxygen2: do not edit by hand
|
||||
|
||||
S3method("[",ab)
|
||||
S3method("[",disk)
|
||||
S3method("[",isolate_identifier)
|
||||
S3method("[",mic)
|
||||
S3method("[",mo)
|
||||
S3method("[<-",ab)
|
||||
S3method("[<-",disk)
|
||||
S3method("[<-",isolate_identifier)
|
||||
S3method("[<-",mic)
|
||||
S3method("[<-",mo)
|
||||
S3method("[<-",rsi)
|
||||
S3method("[[",ab)
|
||||
S3method("[[",disk)
|
||||
S3method("[[",isolate_identifier)
|
||||
S3method("[[",mic)
|
||||
S3method("[[",mo)
|
||||
S3method("[[<-",ab)
|
||||
S3method("[[<-",disk)
|
||||
S3method("[[<-",isolate_identifier)
|
||||
S3method("[[<-",mic)
|
||||
S3method("[[<-",mo)
|
||||
S3method("[[<-",rsi)
|
||||
S3method(as.data.frame,ab)
|
||||
S3method(as.data.frame,mo)
|
||||
S3method(as.double,mic)
|
||||
S3method(as.integer,mic)
|
||||
S3method(as.numeric,mic)
|
||||
S3method(as.rsi,data.frame)
|
||||
S3method(as.rsi,default)
|
||||
S3method(as.rsi,disk)
|
||||
S3method(as.rsi,mic)
|
||||
S3method(barplot,mic)
|
||||
S3method(barplot,rsi)
|
||||
S3method(c,ab)
|
||||
S3method(c,disk)
|
||||
S3method(c,isolate_identifier)
|
||||
S3method(c,mic)
|
||||
S3method(c,mo)
|
||||
S3method(c,rsi)
|
||||
S3method(droplevels,mic)
|
||||
S3method(droplevels,rsi)
|
||||
S3method(format,bug_drug_combinations)
|
||||
S3method(kurtosis,data.frame)
|
||||
S3method(kurtosis,default)
|
||||
S3method(kurtosis,matrix)
|
||||
S3method(plot,disk)
|
||||
S3method(plot,mic)
|
||||
S3method(plot,resistance_predict)
|
||||
S3method(plot,rsi)
|
||||
S3method(print,ab)
|
||||
S3method(print,bug_drug_combinations)
|
||||
S3method(print,catalogue_of_life_version)
|
||||
S3method(print,disk)
|
||||
S3method(print,isolate_identifier)
|
||||
S3method(print,mic)
|
||||
S3method(print,mo)
|
||||
S3method(print,mo_renamed)
|
||||
S3method(print,mo_uncertainties)
|
||||
S3method(print,rsi)
|
||||
S3method(skewness,data.frame)
|
||||
S3method(skewness,default)
|
||||
S3method(skewness,matrix)
|
||||
S3method(summary,mic)
|
||||
S3method(summary,mo)
|
||||
S3method(summary,rsi)
|
||||
S3method(unique,ab)
|
||||
S3method(unique,disk)
|
||||
S3method(unique,isolate_identifier)
|
||||
S3method(unique,mic)
|
||||
S3method(unique,mo)
|
||||
S3method(unique,rsi)
|
||||
export("%like%")
|
||||
export("%like_case%")
|
||||
export(ab_atc)
|
||||
export(ab_atc_group1)
|
||||
export(ab_atc_group2)
|
||||
export(ab_cid)
|
||||
export(ab_class)
|
||||
export(ab_ddd)
|
||||
export(ab_from_text)
|
||||
export(ab_group)
|
||||
export(ab_info)
|
||||
export(ab_loinc)
|
||||
export(ab_name)
|
||||
export(ab_property)
|
||||
export(ab_synonyms)
|
||||
export(ab_tradenames)
|
||||
export(ab_url)
|
||||
export(age)
|
||||
export(age_groups)
|
||||
export(aminoglycosides)
|
||||
export(anti_join_microorganisms)
|
||||
export(as.ab)
|
||||
export(as.disk)
|
||||
export(as.mic)
|
||||
export(as.mo)
|
||||
export(as.rsi)
|
||||
export(atc_online_ddd)
|
||||
export(atc_online_groups)
|
||||
export(atc_online_property)
|
||||
export(availability)
|
||||
export(brmo)
|
||||
export(bug_drug_combinations)
|
||||
export(carbapenems)
|
||||
export(catalogue_of_life_version)
|
||||
export(cephalosporins)
|
||||
export(cephalosporins_1st)
|
||||
export(cephalosporins_2nd)
|
||||
export(cephalosporins_3rd)
|
||||
export(cephalosporins_4th)
|
||||
export(cephalosporins_5th)
|
||||
export(count_I)
|
||||
export(count_IR)
|
||||
export(count_R)
|
||||
export(count_S)
|
||||
export(count_SI)
|
||||
export(count_all)
|
||||
export(count_df)
|
||||
export(count_resistant)
|
||||
export(count_susceptible)
|
||||
export(eucast_dosage)
|
||||
export(eucast_exceptional_phenotypes)
|
||||
export(eucast_rules)
|
||||
export(facet_rsi)
|
||||
export(filter_1st_cephalosporins)
|
||||
export(filter_2nd_cephalosporins)
|
||||
export(filter_3rd_cephalosporins)
|
||||
export(filter_4th_cephalosporins)
|
||||
export(filter_5th_cephalosporins)
|
||||
export(filter_ab_class)
|
||||
export(filter_aminoglycosides)
|
||||
export(filter_carbapenems)
|
||||
export(filter_cephalosporins)
|
||||
export(filter_first_isolate)
|
||||
export(filter_first_weighted_isolate)
|
||||
export(filter_fluoroquinolones)
|
||||
export(filter_glycopeptides)
|
||||
export(filter_macrolides)
|
||||
export(filter_penicillins)
|
||||
export(filter_tetracyclines)
|
||||
export(first_isolate)
|
||||
export(fluoroquinolones)
|
||||
export(full_join_microorganisms)
|
||||
export(g.test)
|
||||
export(geom_rsi)
|
||||
export(get_episode)
|
||||
export(get_locale)
|
||||
export(get_mo_source)
|
||||
export(ggplot_pca)
|
||||
export(ggplot_rsi)
|
||||
export(ggplot_rsi_predict)
|
||||
export(glycopeptides)
|
||||
export(guess_ab_col)
|
||||
export(inner_join_microorganisms)
|
||||
export(is.ab)
|
||||
export(is.disk)
|
||||
export(is.mic)
|
||||
export(is.mo)
|
||||
export(is.rsi)
|
||||
export(is.rsi.eligible)
|
||||
export(is_new_episode)
|
||||
export(isolate_identifier)
|
||||
export(key_antibiotics)
|
||||
export(key_antibiotics_equal)
|
||||
export(kurtosis)
|
||||
export(labels_rsi_count)
|
||||
export(left_join_microorganisms)
|
||||
export(like)
|
||||
export(macrolides)
|
||||
export(mdr_cmi2012)
|
||||
export(mdr_tb)
|
||||
export(mdro)
|
||||
export(mo_authors)
|
||||
export(mo_class)
|
||||
export(mo_domain)
|
||||
export(mo_failures)
|
||||
export(mo_family)
|
||||
export(mo_fullname)
|
||||
export(mo_genus)
|
||||
export(mo_gramstain)
|
||||
export(mo_info)
|
||||
export(mo_is_gram_negative)
|
||||
export(mo_is_gram_positive)
|
||||
export(mo_is_intrinsic_resistant)
|
||||
export(mo_is_yeast)
|
||||
export(mo_kingdom)
|
||||
export(mo_matching_score)
|
||||
export(mo_name)
|
||||
export(mo_order)
|
||||
export(mo_phylum)
|
||||
export(mo_property)
|
||||
export(mo_rank)
|
||||
export(mo_ref)
|
||||
export(mo_renamed)
|
||||
export(mo_shortname)
|
||||
export(mo_snomed)
|
||||
export(mo_species)
|
||||
export(mo_subspecies)
|
||||
export(mo_synonyms)
|
||||
export(mo_taxonomy)
|
||||
export(mo_type)
|
||||
export(mo_uncertainties)
|
||||
export(mo_url)
|
||||
export(mo_year)
|
||||
export(mrgn)
|
||||
export(n_rsi)
|
||||
export(p_symbol)
|
||||
export(pca)
|
||||
export(penicillins)
|
||||
export(proportion_I)
|
||||
export(proportion_IR)
|
||||
export(proportion_R)
|
||||
export(proportion_S)
|
||||
export(proportion_SI)
|
||||
export(proportion_df)
|
||||
export(random_disk)
|
||||
export(random_mic)
|
||||
export(random_rsi)
|
||||
export(resistance)
|
||||
export(resistance_predict)
|
||||
export(right_join_microorganisms)
|
||||
export(rsi_df)
|
||||
export(rsi_predict)
|
||||
export(scale_rsi_colours)
|
||||
export(scale_y_percent)
|
||||
export(semi_join_microorganisms)
|
||||
export(set_mo_source)
|
||||
export(skewness)
|
||||
export(susceptibility)
|
||||
export(tetracyclines)
|
||||
export(theme_rsi)
|
||||
importFrom(graphics,arrows)
|
||||
importFrom(graphics,axis)
|
||||
importFrom(graphics,barplot)
|
||||
importFrom(graphics,par)
|
||||
importFrom(graphics,plot)
|
||||
importFrom(graphics,points)
|
||||
importFrom(graphics,text)
|
||||
importFrom(stats,complete.cases)
|
||||
importFrom(stats,glm)
|
||||
importFrom(stats,lm)
|
||||
importFrom(stats,pchisq)
|
||||
importFrom(stats,prcomp)
|
||||
importFrom(stats,predict)
|
||||
importFrom(stats,qchisq)
|
||||
importFrom(stats,var)
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,586 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Transform input to an antibiotic ID
|
||||
#'
|
||||
#' Use this function to determine the antibiotic code of one or more antibiotics. The data set [antibiotics] will be searched for abbreviations, official names and synonyms (brand names).
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x character vector to determine to antibiotic ID
|
||||
#' @param flag_multiple_results logical to indicate whether a note should be printed to the console that probably more than one antibiotic code or name can be retrieved from a single input value.
|
||||
#' @param info logical to indicate whether a progress bar should be printed
|
||||
#' @param ... arguments passed on to internal functions
|
||||
#' @rdname as.ab
|
||||
#' @inheritSection WHOCC WHOCC
|
||||
#' @details All entries in the [antibiotics] data set have three different identifiers: a human readable EARS-Net code (column `ab`, used by ECDC and WHONET), an ATC code (column `atc`, used by WHO), and a CID code (column `cid`, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.
|
||||
#'
|
||||
#' All these properties will be searched for the user input. The [as.ab()] can correct for different forms of misspelling:
|
||||
#'
|
||||
#' * Wrong spelling of drug names (such as "tobramicin" or "gentamycin"), which corrects for most audible similarities such as f/ph, x/ks, c/z/s, t/th, etc.
|
||||
#' * Too few or too many vowels or consonants
|
||||
#' * Switching two characters (such as "mreopenem", often the case in clinical data, when doctors typed too fast)
|
||||
#' * Digitalised paper records, leaving artefacts like 0/o/O (zero and O's), B/8, n/r, etc.
|
||||
#'
|
||||
#' Use the [`ab_*`][ab_property()] functions to get properties based on the returned antibiotic ID, see Examples.
|
||||
#'
|
||||
#' Note: the [as.ab()] and [`ab_*`][ab_property()] functions may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems.
|
||||
#' @section Source:
|
||||
#' World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/}
|
||||
#'
|
||||
#' WHONET 2019 software: \url{http://www.whonet.org/software.html}
|
||||
#'
|
||||
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}
|
||||
#' @aliases ab
|
||||
#' @return A [character] [vector] with additional class [`ab`]
|
||||
#' @seealso
|
||||
#' * [antibiotics] for the [data.frame] that is being used to determine ATCs
|
||||
#' * [ab_from_text()] for a function to retrieve antimicrobial drugs from clinical text (from health care records)
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @export
|
||||
#' @examples
|
||||
#' # these examples all return "ERY", the ID of erythromycin:
|
||||
#' as.ab("J01FA01")
|
||||
#' as.ab("J 01 FA 01")
|
||||
#' as.ab("Erythromycin")
|
||||
#' as.ab("eryt")
|
||||
#' as.ab(" eryt 123")
|
||||
#' as.ab("ERYT")
|
||||
#' as.ab("ERY")
|
||||
#' as.ab("eritromicine") # spelled wrong, yet works
|
||||
#' as.ab("Erythrocin") # trade name
|
||||
#' as.ab("Romycin") # trade name
|
||||
#'
|
||||
#' # spelling from different languages and dyslexia are no problem
|
||||
#' ab_atc("ceftriaxon")
|
||||
#' ab_atc("cephtriaxone") # small spelling error
|
||||
#' ab_atc("cephthriaxone") # or a bit more severe
|
||||
#' ab_atc("seephthriaaksone") # and even this works
|
||||
#'
|
||||
#' # use ab_* functions to get a specific properties (see ?ab_property);
|
||||
#' # they use as.ab() internally:
|
||||
#' ab_name("J01FA01") # "Erythromycin"
|
||||
#' ab_name("eryt") # "Erythromycin"
|
||||
#'
|
||||
#' if (require("dplyr")) {
|
||||
#'
|
||||
#' # you can quickly rename <rsi> columns using dplyr >= 1.0.0:
|
||||
#' example_isolates %>%
|
||||
#' rename_with(as.ab, where(is.rsi))
|
||||
#'
|
||||
#' }
|
||||
as.ab <- function(x, flag_multiple_results = TRUE, info = TRUE, ...) {
|
||||
meet_criteria(x, allow_class = c("character", "numeric", "integer", "factor"), allow_NA = TRUE)
|
||||
meet_criteria(flag_multiple_results, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(info, allow_class = "logical", has_length = 1)
|
||||
|
||||
check_dataset_integrity()
|
||||
|
||||
if (is.ab(x)) {
|
||||
return(x)
|
||||
}
|
||||
|
||||
initial_search <- is.null(list(...)$initial_search)
|
||||
already_regex <- isTRUE(list(...)$already_regex)
|
||||
|
||||
if (all(toupper(x) %in% antibiotics$ab)) {
|
||||
# valid AB code, but not yet right class
|
||||
return(set_clean_class(toupper(x),
|
||||
new_class = c("ab", "character")))
|
||||
}
|
||||
|
||||
x_bak <- x
|
||||
x <- toupper(x)
|
||||
# remove diacritics
|
||||
x <- iconv(x, from = "UTF-8", to = "ASCII//TRANSLIT")
|
||||
x <- gsub('"', "", x, fixed = TRUE)
|
||||
x <- gsub("(specimen|specimen date|specimen_date|spec_date)", "", x, ignore.case = TRUE, perl = TRUE)
|
||||
x_bak_clean <- x
|
||||
if (already_regex == FALSE) {
|
||||
x_bak_clean <- generalise_antibiotic_name(x_bak_clean)
|
||||
}
|
||||
|
||||
x <- unique(x_bak_clean) # this means that every x is in fact generalise_antibiotic_name(x)
|
||||
x_new <- rep(NA_character_, length(x))
|
||||
x_unknown <- character(0)
|
||||
|
||||
note_if_more_than_one_found <- function(found, index, from_text) {
|
||||
if (initial_search == TRUE & isTRUE(length(from_text) > 1)) {
|
||||
abnames <- ab_name(from_text, tolower = TRUE, initial_search = FALSE)
|
||||
if (ab_name(found[1L], language = NULL) %like% "clavulanic acid") {
|
||||
abnames <- abnames[!abnames == "clavulanic acid"]
|
||||
}
|
||||
if (length(abnames) > 1) {
|
||||
message_("More than one result was found for item ", index, ": ",
|
||||
paste0(abnames, collapse = ", "))
|
||||
}
|
||||
}
|
||||
found[1L]
|
||||
}
|
||||
|
||||
if (initial_search == TRUE) {
|
||||
progress <- progress_ticker(n = length(x), n_min = ifelse(isTRUE(info), 25, length(x) + 1)) # start if n >= 25
|
||||
on.exit(close(progress))
|
||||
}
|
||||
|
||||
for (i in seq_len(length(x))) {
|
||||
if (initial_search == TRUE) {
|
||||
progress$tick()
|
||||
}
|
||||
|
||||
if (is.na(x[i]) | is.null(x[i])) {
|
||||
next
|
||||
}
|
||||
if (identical(x[i], "") |
|
||||
# no short names:
|
||||
nchar(x[i]) <= 2 |
|
||||
# prevent "bacteria" from coercing to TMP, since Bacterial is a brand name of it:
|
||||
identical(tolower(x[i]), "bacteria")) {
|
||||
x_unknown <- c(x_unknown, x_bak[x[i] == x_bak_clean][1])
|
||||
next
|
||||
}
|
||||
|
||||
if (isTRUE(flag_multiple_results) & x[i] %like% "[ ]") {
|
||||
from_text <- tryCatch(suppressWarnings(ab_from_text(x[i], initial_search = FALSE, translate_ab = FALSE)[[1]]),
|
||||
error = function(e) character(0))
|
||||
} else {
|
||||
from_text <- character(0)
|
||||
}
|
||||
|
||||
# old code for phenoxymethylpenicillin (Peni V)
|
||||
if (x[i] == "PNV") {
|
||||
x_new[i] <- "PHN"
|
||||
next
|
||||
}
|
||||
|
||||
# exact name
|
||||
found <- antibiotics[which(AB_lookup$generalised_name == x[i]), ]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
# exact AB code
|
||||
found <- antibiotics[which(antibiotics$ab == x[i]), ]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# exact ATC code
|
||||
found <- antibiotics[which(antibiotics$atc == x[i]), ]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# exact CID code
|
||||
found <- antibiotics[which(antibiotics$cid == x[i]), ]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# exact LOINC code
|
||||
loinc_found <- unlist(lapply(AB_lookup$generalised_loinc,
|
||||
function(s) x[i] %in% s))
|
||||
found <- antibiotics$ab[loinc_found == TRUE]
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# exact synonym
|
||||
synonym_found <- unlist(lapply(AB_lookup$generalised_synonyms,
|
||||
function(s) x[i] %in% s))
|
||||
found <- antibiotics$ab[synonym_found == TRUE]
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# exact abbreviation
|
||||
abbr_found <- unlist(lapply(AB_lookup$generalised_abbreviations,
|
||||
function(s) x[i] %in% s))
|
||||
found <- antibiotics$ab[abbr_found == TRUE]
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# allow characters that resemble others, but only continue when having more than 3 characters
|
||||
if (nchar(x[i]) <= 3) {
|
||||
x_unknown <- c(x_unknown, x_bak[x[i] == x_bak_clean][1])
|
||||
next
|
||||
}
|
||||
x_spelling <- x[i]
|
||||
if (already_regex == FALSE) {
|
||||
x_spelling <- gsub("[IY]+", "[IY]+", x_spelling, perl = TRUE)
|
||||
x_spelling <- gsub("(C|K|Q|QU|S|Z|X|KS)+", "(C|K|Q|QU|S|Z|X|KS)+", x_spelling, perl = TRUE)
|
||||
x_spelling <- gsub("(PH|F|V)+", "(PH|F|V)+", x_spelling, perl = TRUE)
|
||||
x_spelling <- gsub("(TH|T)+", "(TH|T)+", x_spelling, perl = TRUE)
|
||||
x_spelling <- gsub("A+", "A+", x_spelling, perl = TRUE)
|
||||
x_spelling <- gsub("E+", "E+", x_spelling, perl = TRUE)
|
||||
x_spelling <- gsub("O+", "O+", x_spelling, perl = TRUE)
|
||||
# allow any ending of -in/-ine and -im/-ime
|
||||
x_spelling <- gsub("(\\[IY\\]\\+(N|M)|\\[IY\\]\\+(N|M)E\\+)$", "[IY]+(N|M)E*", x_spelling, perl = TRUE)
|
||||
# allow any ending of -ol/-ole
|
||||
x_spelling <- gsub("(O\\+L|O\\+LE\\+)$", "O+LE*", x_spelling, perl = TRUE)
|
||||
# allow any ending of -on/-one
|
||||
x_spelling <- gsub("(O\\+N|O\\+NE\\+)$", "O+NE*", x_spelling, perl = TRUE)
|
||||
# replace multiple same characters to single one with '+', like "ll" -> "l+"
|
||||
x_spelling <- gsub("(.)\\1+", "\\1+", x_spelling, perl = TRUE)
|
||||
# replace spaces and slashes with a possibility on both
|
||||
x_spelling <- gsub("[ /]", "( .*|.*/)", x_spelling, perl = TRUE)
|
||||
# correct for digital reading text (OCR)
|
||||
x_spelling <- gsub("[NRD8B]", "[NRD8B]", x_spelling, perl = TRUE)
|
||||
x_spelling <- gsub("(O|0)", "(O|0)+", x_spelling, perl = TRUE)
|
||||
x_spelling <- gsub("++", "+", x_spelling, fixed = TRUE)
|
||||
}
|
||||
|
||||
# try if name starts with it
|
||||
found <- antibiotics[which(AB_lookup$generalised_name %like% paste0("^", x_spelling)), ]$ab
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
# try if name ends with it
|
||||
found <- antibiotics[which(AB_lookup$generalised_name %like% paste0(x_spelling, "$")), ]$ab
|
||||
if (nchar(x[i]) >= 4 & length(found) > 0) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# and try if any synonym starts with it
|
||||
synonym_found <- unlist(lapply(AB_lookup$generalised_synonyms,
|
||||
function(s) any(s %like% paste0("^", x_spelling))))
|
||||
found <- antibiotics$ab[synonym_found == TRUE]
|
||||
if (length(found) > 0) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# INITIAL SEARCH - More uncertain results ----
|
||||
|
||||
if (initial_search == TRUE) {
|
||||
# only run on first try
|
||||
|
||||
# try by removing all spaces
|
||||
if (x[i] %like% " ") {
|
||||
found <- suppressWarnings(as.ab(gsub(" +", "", x[i], perl = TRUE), initial_search = FALSE))
|
||||
if (length(found) > 0 & !is.na(found)) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
}
|
||||
|
||||
# try by removing all spaces and numbers
|
||||
if (x[i] %like% " " | x[i] %like% "[0-9]") {
|
||||
found <- suppressWarnings(as.ab(gsub("[ 0-9]", "", x[i], perl = TRUE), initial_search = FALSE))
|
||||
if (length(found) > 0 & !is.na(found)) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
}
|
||||
|
||||
# transform back from other languages and try again
|
||||
x_translated <- paste(lapply(strsplit(x[i], "[^A-Z0-9]"),
|
||||
function(y) {
|
||||
for (i in seq_len(length(y))) {
|
||||
y[i] <- ifelse(tolower(y[i]) %in% tolower(translations_file$replacement),
|
||||
translations_file[which(tolower(translations_file$replacement) == tolower(y[i]) &
|
||||
!isFALSE(translations_file$fixed)), "pattern"],
|
||||
y[i])
|
||||
}
|
||||
generalise_antibiotic_name(y)
|
||||
})[[1]],
|
||||
collapse = "/")
|
||||
x_translated_guess <- suppressWarnings(as.ab(x_translated, initial_search = FALSE))
|
||||
if (!is.na(x_translated_guess)) {
|
||||
x_new[i] <- x_translated_guess
|
||||
next
|
||||
}
|
||||
|
||||
# now also try to coerce brandname combinations like "Amoxy/clavulanic acid"
|
||||
x_translated <- paste(lapply(strsplit(x_translated, "[^A-Z0-9 ]"),
|
||||
function(y) {
|
||||
for (i in seq_len(length(y))) {
|
||||
y_name <- suppressWarnings(ab_name(y[i], language = NULL, initial_search = FALSE))
|
||||
y[i] <- ifelse(!is.na(y_name),
|
||||
y_name,
|
||||
y[i])
|
||||
}
|
||||
generalise_antibiotic_name(y)
|
||||
})[[1]],
|
||||
collapse = "/")
|
||||
x_translated_guess <- suppressWarnings(as.ab(x_translated, initial_search = FALSE))
|
||||
if (!is.na(x_translated_guess)) {
|
||||
x_new[i] <- x_translated_guess
|
||||
next
|
||||
}
|
||||
|
||||
# try by removing all trailing capitals
|
||||
if (x[i] %like_case% "[a-z]+[A-Z]+$") {
|
||||
found <- suppressWarnings(as.ab(gsub("[A-Z]+$", "", x[i], perl = TRUE), initial_search = FALSE))
|
||||
if (!is.na(found)) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
}
|
||||
|
||||
# keep only letters
|
||||
found <- suppressWarnings(as.ab(gsub("[^A-Z]", "", x[i], perl = TRUE), initial_search = FALSE))
|
||||
if (!is.na(found)) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# try from a bigger text, like from a health care record, see ?ab_from_text
|
||||
# already calculated above if flag_multiple_results = TRUE
|
||||
if (isTRUE(flag_multiple_results)) {
|
||||
found <- from_text[1L]
|
||||
} else {
|
||||
found <- tryCatch(suppressWarnings(ab_from_text(x[i], initial_search = FALSE, translate_ab = FALSE)[[1]][1L]),
|
||||
error = function(e) NA_character_)
|
||||
}
|
||||
if (!is.na(found)) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# first 5 except for cephalosporins, then first 7 (those cephalosporins all start quite the same!)
|
||||
found <- suppressWarnings(as.ab(substr(x[i], 1, 5), initial_search = FALSE))
|
||||
if (!is.na(found) && !ab_group(found, initial_search = FALSE) %like% "cephalosporins") {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
found <- suppressWarnings(as.ab(substr(x[i], 1, 7), initial_search = FALSE))
|
||||
if (!is.na(found)) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# make all consonants facultative
|
||||
search_str <- gsub("([BCDFGHJKLMNPQRSTVWXZ])", "\\1*", x[i], perl = TRUE)
|
||||
found <- suppressWarnings(as.ab(search_str, initial_search = FALSE, already_regex = TRUE))
|
||||
# keep at least 4 normal characters
|
||||
if (nchar(gsub(".\\*", "", search_str, perl = TRUE)) < 4) {
|
||||
found <- NA
|
||||
}
|
||||
if (!is.na(found)) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# make all vowels facultative
|
||||
search_str <- gsub("([AEIOUY])", "\\1*", x[i], perl = TRUE)
|
||||
found <- suppressWarnings(as.ab(search_str, initial_search = FALSE, already_regex = TRUE))
|
||||
# keep at least 5 normal characters
|
||||
if (nchar(gsub(".\\*", "", search_str, perl = TRUE)) < 5) {
|
||||
found <- NA
|
||||
}
|
||||
if (!is.na(found)) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# allow misspelling of vowels
|
||||
x_spelling <- gsub("A+", "[AEIOU]+", x_spelling, fixed = TRUE)
|
||||
x_spelling <- gsub("E+", "[AEIOU]+", x_spelling, fixed = TRUE)
|
||||
x_spelling <- gsub("I+", "[AEIOU]+", x_spelling, fixed = TRUE)
|
||||
x_spelling <- gsub("O+", "[AEIOU]+", x_spelling, fixed = TRUE)
|
||||
x_spelling <- gsub("U+", "[AEIOU]+", x_spelling, fixed = TRUE)
|
||||
found <- suppressWarnings(as.ab(x_spelling, initial_search = FALSE, already_regex = TRUE))
|
||||
if (!is.na(found)) {
|
||||
x_new[i] <- note_if_more_than_one_found(found, i, from_text)
|
||||
next
|
||||
}
|
||||
|
||||
# try with switched character, like "mreopenem"
|
||||
for (j in seq_len(nchar(x[i]))) {
|
||||
x_switched <- paste0(
|
||||
# beginning part:
|
||||
substr(x[i], 1, j - 1),
|
||||
# here is the switching of 2 characters:
|
||||
substr(x[i], j + 1, j + 1),
|
||||
substr(x[i], j, j),
|
||||
# ending part:
|
||||
substr(x[i], j + 2, nchar(x[i])))
|
||||
found <- suppressWarnings(as.ab(x_switched, initial_search = FALSE))
|
||||
if (!is.na(found)) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!is.na(found)) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
|
||||
} # end of initial_search = TRUE
|
||||
|
||||
# not found
|
||||
x_unknown <- c(x_unknown, x_bak[x[i] == x_bak_clean][1])
|
||||
}
|
||||
|
||||
if (initial_search == TRUE) {
|
||||
close(progress)
|
||||
}
|
||||
|
||||
# take failed ATC codes apart from rest
|
||||
x_unknown_ATCs <- x_unknown[x_unknown %like% "[A-Z][0-9][0-9][A-Z][A-Z][0-9][0-9]"]
|
||||
x_unknown <- x_unknown[!x_unknown %in% x_unknown_ATCs]
|
||||
if (length(x_unknown_ATCs) > 0) {
|
||||
warning_("These ATC codes are not (yet) in the antibiotics data set: ",
|
||||
paste('"', sort(unique(x_unknown_ATCs)), '"', sep = "", collapse = ", "),
|
||||
".",
|
||||
call = FALSE)
|
||||
}
|
||||
|
||||
if (length(x_unknown) > 0) {
|
||||
warning_("These values could not be coerced to a valid antimicrobial ID: ",
|
||||
paste('"', sort(unique(x_unknown)), '"', sep = "", collapse = ", "),
|
||||
".",
|
||||
call = FALSE)
|
||||
}
|
||||
|
||||
x_result <- data.frame(x = x_bak_clean, stringsAsFactors = FALSE) %pm>%
|
||||
pm_left_join(data.frame(x = x, x_new = x_new, stringsAsFactors = FALSE), by = "x") %pm>%
|
||||
pm_pull(x_new)
|
||||
|
||||
if (length(x_result) == 0) {
|
||||
x_result <- NA_character_
|
||||
}
|
||||
|
||||
set_clean_class(x_result,
|
||||
new_class = c("ab", "character"))
|
||||
}
|
||||
|
||||
#' @rdname as.ab
|
||||
#' @export
|
||||
is.ab <- function(x) {
|
||||
inherits(x, "ab")
|
||||
}
|
||||
|
||||
# will be exported using s3_register() in R/zzz.R
|
||||
pillar_shaft.ab <- function(x, ...) {
|
||||
out <- trimws(format(x))
|
||||
out[is.na(x)] <- font_na(NA)
|
||||
create_pillar_column(out, align = "left", min_width = 4)
|
||||
}
|
||||
|
||||
# will be exported using s3_register() in R/zzz.R
|
||||
type_sum.ab <- function(x, ...) {
|
||||
"ab"
|
||||
}
|
||||
|
||||
#' @method print ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.ab <- function(x, ...) {
|
||||
cat("Class <ab>\n")
|
||||
print(as.character(x), quote = FALSE)
|
||||
}
|
||||
|
||||
#' @method as.data.frame ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
as.data.frame.ab <- function(x, ...) {
|
||||
nm <- deparse1(substitute(x))
|
||||
if (!"nm" %in% names(list(...))) {
|
||||
as.data.frame.vector(as.ab(x), ..., nm = nm)
|
||||
} else {
|
||||
as.data.frame.vector(as.ab(x), ...)
|
||||
}
|
||||
}
|
||||
#' @method [ ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[.ab" <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
#' @method [[ ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[[.ab" <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
#' @method [<- ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[<-.ab" <- function(i, j, ..., value) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(i)
|
||||
class_integrity_check(y, "antimicrobial code", antibiotics$ab)
|
||||
}
|
||||
#' @method [[<- ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[[<-.ab" <- function(i, j, ..., value) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(i)
|
||||
class_integrity_check(y, "antimicrobial code", antibiotics$ab)
|
||||
}
|
||||
#' @method c ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
c.ab <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
class_integrity_check(y, "antimicrobial code", antibiotics$ab)
|
||||
}
|
||||
|
||||
#' @method unique ab
|
||||
#' @export
|
||||
#' @noRd
|
||||
unique.ab <- function(x, incomparables = FALSE, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
|
||||
generalise_antibiotic_name <- function(x) {
|
||||
x <- toupper(x)
|
||||
# remove suffices
|
||||
x <- gsub("_(MIC|RSI|DIS[CK])$", "", x, perl = TRUE)
|
||||
# remove disk concentrations, like LVX_NM -> LVX
|
||||
x <- gsub("_[A-Z]{2}[0-9_.]{0,3}$", "", x, perl = TRUE)
|
||||
# remove part between brackets if that's followed by another string
|
||||
x <- gsub("(.*)+ [(].*[)]", "\\1", x)
|
||||
# keep only max 1 space
|
||||
x <- trimws2(gsub(" +", " ", x, perl = TRUE))
|
||||
# non-character, space or number should be a slash
|
||||
x <- gsub("[^A-Z0-9 -]", "/", x, perl = TRUE)
|
||||
# spaces around non-characters must be removed: amox + clav -> amox/clav
|
||||
x <- gsub("(.*[A-Z0-9]) ([^A-Z0-9].*)", "\\1\\2", x, perl = TRUE)
|
||||
x <- gsub("(.*[^A-Z0-9]) ([A-Z0-9].*)", "\\1\\2", x, perl = TRUE)
|
||||
# remove hyphen after a starting "co"
|
||||
x <- gsub("^CO-", "CO", x, perl = TRUE)
|
||||
# replace operators with a space
|
||||
x <- gsub("(/| AND | WITH | W/|[+]|[-])+", " ", x, perl = TRUE)
|
||||
x
|
||||
}
|
||||
@@ -1,210 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Antibiotic class selectors
|
||||
#'
|
||||
#' These functions help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
|
||||
#' @inheritParams filter_ab_class
|
||||
#' @details \strong{\Sexpr{ifelse(as.double(R.Version()$major) + (as.double(R.Version()$minor) / 10) < 3.2, paste0("NOTE: THESE FUNCTIONS DO NOT WORK ON YOUR CURRENT R VERSION. These functions require R version 3.2 or later - you have ", R.version.string, "."), "")}}
|
||||
#'
|
||||
#' All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.) in the [antibiotics] data set. This means that a selector like e.g. [aminoglycosides()] will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @seealso [filter_ab_class()] for the `filter()` equivalent.
|
||||
#' @name antibiotic_class_selectors
|
||||
#' @export
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # `example_isolates` is a dataset available in the AMR package.
|
||||
#' # See ?example_isolates.
|
||||
#'
|
||||
#' # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
|
||||
#' example_isolates[, c(carbapenems())]
|
||||
#' # this will select columns 'mo', 'AMK', 'GEN', 'KAN' and 'TOB':
|
||||
#' example_isolates[, c("mo", aminoglycosides())]
|
||||
#'
|
||||
#' if (require("dplyr")) {
|
||||
#'
|
||||
#' # this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
|
||||
#' example_isolates %>%
|
||||
#' select(carbapenems())
|
||||
#'
|
||||
#' # this will select columns 'mo', 'AMK', 'GEN', 'KAN' and 'TOB':
|
||||
#' example_isolates %>%
|
||||
#' select(mo, aminoglycosides())
|
||||
#'
|
||||
#' # this will select columns 'mo' and all antimycobacterial drugs ('RIF'):
|
||||
#' example_isolates %>%
|
||||
#' select(mo, ab_class("mycobact"))
|
||||
#'
|
||||
#'
|
||||
#' # get bug/drug combinations for only macrolides in Gram-positives:
|
||||
#' example_isolates %>%
|
||||
#' filter(mo_is_gram_positive()) %>%
|
||||
#' select(mo, macrolides()) %>%
|
||||
#' bug_drug_combinations() %>%
|
||||
#' format()
|
||||
#'
|
||||
#'
|
||||
#' data.frame(some_column = "some_value",
|
||||
#' J01CA01 = "S") %>% # ATC code of ampicillin
|
||||
#' select(penicillins()) # only the 'J01CA01' column will be selected
|
||||
#'
|
||||
#'
|
||||
#' # with dplyr 1.0.0 and higher (that adds 'across()'), this is equal:
|
||||
#' # (though the row names on the first are more correct)
|
||||
#' example_isolates %>% filter_carbapenems("R", "all")
|
||||
#' example_isolates %>% filter(across(carbapenems(), ~. == "R"))
|
||||
#' }
|
||||
ab_class <- function(ab_class) {
|
||||
ab_selector(ab_class, function_name = "ab_class")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
aminoglycosides <- function() {
|
||||
ab_selector("aminoglycoside", function_name = "aminoglycosides")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
carbapenems <- function() {
|
||||
ab_selector("carbapenem", function_name = "carbapenems")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
cephalosporins <- function() {
|
||||
ab_selector("cephalosporin", function_name = "cephalosporins")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
cephalosporins_1st <- function() {
|
||||
ab_selector("cephalosporins.*1", function_name = "cephalosporins_1st")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
cephalosporins_2nd <- function() {
|
||||
ab_selector("cephalosporins.*2", function_name = "cephalosporins_2nd")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
cephalosporins_3rd <- function() {
|
||||
ab_selector("cephalosporins.*3", function_name = "cephalosporins_3rd")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
cephalosporins_4th <- function() {
|
||||
ab_selector("cephalosporins.*4", function_name = "cephalosporins_4th")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
cephalosporins_5th <- function() {
|
||||
ab_selector("cephalosporins.*5", function_name = "cephalosporins_5th")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
fluoroquinolones <- function() {
|
||||
ab_selector("fluoroquinolone", function_name = "fluoroquinolones")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
glycopeptides <- function() {
|
||||
ab_selector("glycopeptide", function_name = "glycopeptides")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
macrolides <- function() {
|
||||
ab_selector("macrolide", function_name = "macrolides")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
penicillins <- function() {
|
||||
ab_selector("penicillin", function_name = "penicillins")
|
||||
}
|
||||
|
||||
#' @rdname antibiotic_class_selectors
|
||||
#' @export
|
||||
tetracyclines <- function() {
|
||||
ab_selector("tetracycline", function_name = "tetracyclines")
|
||||
}
|
||||
|
||||
ab_selector <- function(ab_class, function_name) {
|
||||
meet_criteria(ab_class, allow_class = "character", has_length = 1, .call_depth = 1)
|
||||
meet_criteria(function_name, allow_class = "character", has_length = 1, .call_depth = 1)
|
||||
|
||||
if (as.double(R.Version()$major) + (as.double(R.Version()$minor) / 10) < 3.2) {
|
||||
warning_("antibiotic class selectors such as ", function_name,
|
||||
"() require R version 3.2 or later - you have ", R.version.string,
|
||||
call = FALSE)
|
||||
return(NULL)
|
||||
}
|
||||
|
||||
vars_df <- get_current_data(arg_name = NA, call = -3)
|
||||
ab_in_data <- get_column_abx(vars_df, info = FALSE)
|
||||
|
||||
if (length(ab_in_data) == 0) {
|
||||
message_("No antimicrobial agents found.")
|
||||
return(NULL)
|
||||
}
|
||||
|
||||
ab_reference <- subset(antibiotics,
|
||||
group %like% ab_class |
|
||||
atc_group1 %like% ab_class |
|
||||
atc_group2 %like% ab_class)
|
||||
ab_group <- find_ab_group(ab_class)
|
||||
if (ab_group == "") {
|
||||
ab_group <- paste0("'", ab_class, "'")
|
||||
examples <- ""
|
||||
} else {
|
||||
examples <- paste0(" (such as ", find_ab_names(ab_class, 2), ")")
|
||||
}
|
||||
# get the columns with a group names in the chosen ab class
|
||||
agents <- ab_in_data[names(ab_in_data) %in% ab_reference$ab]
|
||||
if (message_not_thrown_before(function_name)) {
|
||||
if (length(agents) == 0) {
|
||||
message_("No antimicrobial agents of class ", ab_group, " found", examples, ".")
|
||||
} else {
|
||||
agents_formatted <- paste0("column '", font_bold(agents, collapse = NULL), "'")
|
||||
agents_names <- ab_name(names(agents), tolower = TRUE, language = NULL)
|
||||
agents_formatted[agents != agents_names] <- paste0(agents_formatted[agents != agents_names],
|
||||
" (", agents_names[agents != agents_names], ")")
|
||||
message_("Selecting ", ab_group, ": ", paste(agents_formatted, collapse = ", "),
|
||||
as_note = FALSE,
|
||||
extra_indent = nchar(paste0("Selecting ", ab_group, ": ")))
|
||||
}
|
||||
remember_thrown_message(function_name)
|
||||
}
|
||||
unname(agents)
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Retrieve antimicrobial drug names and doses from clinical text
|
||||
#'
|
||||
#' Use this function on e.g. clinical texts from health care records. It returns a [list] with all antimicrobial drugs, doses and forms of administration found in the texts.
|
||||
#' @inheritSection lifecycle Maturing lifecycle
|
||||
#' @param text text to analyse
|
||||
#' @param type type of property to search for, either `"drug"`, `"dose"` or `"administration"`, see *Examples*
|
||||
#' @param collapse character to pass on to `paste(..., collapse = ...)` to only return one character per element of `text`, see *Examples*
|
||||
#' @param translate_ab if `type = "drug"`: a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()]. Defaults to `FALSE`. Using `TRUE` is equal to using "name".
|
||||
#' @param thorough_search logical to indicate whether the input must be extensively searched for misspelling and other faulty input values. Setting this to `TRUE` will take considerably more time than when using `FALSE`. At default, it will turn `TRUE` when all input elements contain a maximum of three words.
|
||||
#' @param ... arguments passed on to [as.ab()]
|
||||
#' @details This function is also internally used by [as.ab()], although it then only searches for the first drug name and will throw a note if more drug names could have been returned. Note: the [as.ab()] function may use very long regular expression to match brand names of antimicrobial agents. This may fail on some systems.
|
||||
#'
|
||||
#' ## Argument `type`
|
||||
#' At default, the function will search for antimicrobial drug names. All text elements will be searched for official names, ATC codes and brand names. As it uses [as.ab()] internally, it will correct for misspelling.
|
||||
#'
|
||||
#' With `type = "dose"` (or similar, like "dosing", "doses"), all text elements will be searched for numeric values that are higher than 100 and do not resemble years. The output will be numeric. It supports any unit (g, mg, IE, etc.) and multiple values in one clinical text, see *Examples*.
|
||||
#'
|
||||
#' With `type = "administration"` (or abbreviations, like "admin", "adm"), all text elements will be searched for a form of drug administration. It supports the following forms (including common abbreviations): buccal, implant, inhalation, instillation, intravenous, nasal, oral, parenteral, rectal, sublingual, transdermal and vaginal. Abbreviations for oral (such as 'po', 'per os') will become "oral", all values for intravenous (such as 'iv', 'intraven') will become "iv". It supports multiple values in one clinical text, see *Examples*.
|
||||
#'
|
||||
#' ## Argument `collapse`
|
||||
#' Without using `collapse`, this function will return a [list]. This can be convenient to use e.g. inside a `mutate()`):\cr
|
||||
#' `df %>% mutate(abx = ab_from_text(clinical_text))`
|
||||
#'
|
||||
#' The returned AB codes can be transformed to official names, groups, etc. with all [`ab_*`][ab_property()] functions such as [ab_name()] and [ab_group()], or by using the `translate_ab` argument.
|
||||
#'
|
||||
#' With using `collapse`, this function will return a [character]:\cr
|
||||
#' `df %>% mutate(abx = ab_from_text(clinical_text, collapse = "|"))`
|
||||
#' @export
|
||||
#' @return A [list], or a [character] if `collapse` is not `NULL`
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # mind the bad spelling of amoxicillin in this line,
|
||||
#' # straight from a true health care record:
|
||||
#' ab_from_text("28/03/2020 regular amoxicilliin 500mg po tds")
|
||||
#'
|
||||
#' ab_from_text("500 mg amoxi po and 400mg cipro iv")
|
||||
#' ab_from_text("500 mg amoxi po and 400mg cipro iv", type = "dose")
|
||||
#' ab_from_text("500 mg amoxi po and 400mg cipro iv", type = "admin")
|
||||
#'
|
||||
#' ab_from_text("500 mg amoxi po and 400mg cipro iv", collapse = ", ")
|
||||
#' \donttest{
|
||||
#' # if you want to know which antibiotic groups were administered, do e.g.:
|
||||
#' abx <- ab_from_text("500 mg amoxi po and 400mg cipro iv")
|
||||
#' ab_group(abx[[1]])
|
||||
#'
|
||||
#' if (require("dplyr")) {
|
||||
#' tibble(clinical_text = c("given 400mg cipro and 500 mg amox",
|
||||
#' "started on doxy iv today")) %>%
|
||||
#' mutate(abx_codes = ab_from_text(clinical_text),
|
||||
#' abx_doses = ab_from_text(clinical_text, type = "doses"),
|
||||
#' abx_admin = ab_from_text(clinical_text, type = "admin"),
|
||||
#' abx_coll = ab_from_text(clinical_text, collapse = "|"),
|
||||
#' abx_coll_names = ab_from_text(clinical_text,
|
||||
#' collapse = "|",
|
||||
#' translate_ab = "name"),
|
||||
#' abx_coll_doses = ab_from_text(clinical_text,
|
||||
#' type = "doses",
|
||||
#' collapse = "|"),
|
||||
#' abx_coll_admin = ab_from_text(clinical_text,
|
||||
#' type = "admin",
|
||||
#' collapse = "|"))
|
||||
#'
|
||||
#' }
|
||||
#' }
|
||||
ab_from_text <- function(text,
|
||||
type = c("drug", "dose", "administration"),
|
||||
collapse = NULL,
|
||||
translate_ab = FALSE,
|
||||
thorough_search = NULL,
|
||||
...) {
|
||||
if (missing(type)) {
|
||||
type <- type[1L]
|
||||
}
|
||||
|
||||
meet_criteria(text)
|
||||
meet_criteria(type, allow_class = "character", has_length = 1)
|
||||
meet_criteria(collapse, has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(translate_ab, allow_NULL = FALSE) # get_translate_ab() will be more informative about what's allowed
|
||||
meet_criteria(thorough_search, allow_class = "logical", has_length = 1, allow_NULL = TRUE)
|
||||
|
||||
type <- tolower(trimws(type))
|
||||
|
||||
text <- tolower(as.character(text))
|
||||
text_split_all <- strsplit(text, "[ ;.,:\\|]")
|
||||
progress <- progress_ticker(n = length(text_split_all), n_min = 5)
|
||||
on.exit(close(progress))
|
||||
|
||||
if (type %like% "(drug|ab|anti)") {
|
||||
|
||||
translate_ab <- get_translate_ab(translate_ab)
|
||||
|
||||
if (isTRUE(thorough_search) |
|
||||
(isTRUE(is.null(thorough_search)) & max(vapply(FUN.VALUE = double(1), text_split_all, length), na.rm = TRUE) <= 3)) {
|
||||
text_split_all <- text_split_all[nchar(text_split_all) >= 4 & grepl("[a-z]+", text_split_all)]
|
||||
result <- lapply(text_split_all, function(text_split) {
|
||||
progress$tick()
|
||||
suppressWarnings(
|
||||
out <- as.ab(text_split, ...)
|
||||
)
|
||||
})
|
||||
|
||||
} else {
|
||||
# no thorough search
|
||||
abbr <- unlist(antibiotics$abbreviations)
|
||||
abbr <- abbr[nchar(abbr) >= 4]
|
||||
names_atc <- substr(c(antibiotics$name, antibiotics$atc), 1, 5)
|
||||
synonyms <- unlist(antibiotics$synonyms)
|
||||
synonyms <- synonyms[nchar(synonyms) >= 4]
|
||||
# regular expression must not be too long, so split synonyms in two:
|
||||
synonyms_part1 <- synonyms[seq_len(0.5 * length(synonyms))]
|
||||
synonyms_part2 <- synonyms[!synonyms %in% synonyms_part1]
|
||||
to_regex <- function(x) {
|
||||
paste0("^(",
|
||||
paste0(unique(gsub("[^a-z0-9]+", "", sort(tolower(x)))), collapse = "|"),
|
||||
").*")
|
||||
}
|
||||
result <- lapply(text_split_all, function(text_split) {
|
||||
progress$tick()
|
||||
suppressWarnings(
|
||||
out <- as.ab(unique(c(text_split[text_split %like_case% to_regex(abbr)],
|
||||
text_split[text_split %like_case% to_regex(names_atc)],
|
||||
text_split[text_split %like_case% to_regex(synonyms_part1)],
|
||||
text_split[text_split %like_case% to_regex(synonyms_part2)])
|
||||
),
|
||||
...)
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
close(progress)
|
||||
|
||||
result <- lapply(result, function(out) {
|
||||
out <- out[!is.na(out)]
|
||||
if (length(out) == 0) {
|
||||
as.ab(NA)
|
||||
} else {
|
||||
if (!isFALSE(translate_ab)) {
|
||||
out <- ab_property(out, property = translate_ab, initial_search = FALSE)
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
} else if (type %like% "dos") {
|
||||
text_split_all <- strsplit(text, " ")
|
||||
result <- lapply(text_split_all, function(text_split) {
|
||||
text_split <- text_split[text_split %like% "^[0-9]{2,}(/[0-9]+)?[a-z]*$"]
|
||||
# only left part of "/", like 500 in "500/125"
|
||||
text_split <- gsub("/.*", "", text_split)
|
||||
text_split <- gsub(",", ".", text_split, fixed = TRUE) # foreign system using comma as decimal sep
|
||||
text_split <- as.double(gsub("[^0-9.]", "", text_split))
|
||||
# minimal 100 units/mg and no years that unlikely doses
|
||||
text_split <- text_split[text_split >= 100 & !text_split %in% c(1951:1999, 2001:2049)]
|
||||
|
||||
if (length(text_split) > 0) {
|
||||
text_split
|
||||
} else {
|
||||
NA_real_
|
||||
}
|
||||
})
|
||||
|
||||
} else if (type %like% "adm") {
|
||||
result <- lapply(text_split_all, function(text_split) {
|
||||
text_split <- text_split[text_split %like% "(^iv$|intraven|^po$|per os|oral|implant|inhal|instill|nasal|paren|rectal|sublingual|buccal|trans.*dermal|vaginal)"]
|
||||
if (length(text_split) > 0) {
|
||||
text_split <- gsub("(^po$|.*per os.*)", "oral", text_split)
|
||||
text_split <- gsub("(^iv$|.*intraven.*)", "iv", text_split)
|
||||
text_split
|
||||
} else {
|
||||
NA_character_
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
stop_("`type` must be either 'drug', 'dose' or 'administration'")
|
||||
}
|
||||
|
||||
# collapse text if needed
|
||||
if (!is.null(collapse)) {
|
||||
result <- vapply(FUN.VALUE = character(1), result, function(x) {
|
||||
if (length(x) == 1 & all(is.na(x))) {
|
||||
NA_character_
|
||||
} else {
|
||||
paste0(x, collapse = collapse)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
result
|
||||
|
||||
}
|
||||
-275
@@ -1,275 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Get properties of an antibiotic
|
||||
#'
|
||||
#' Use these functions to return a specific property of an antibiotic from the [antibiotics] data set. All input values will be evaluated internally with [as.ab()].
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x any (vector of) text that can be coerced to a valid antibiotic code with [as.ab()]
|
||||
#' @param tolower logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".
|
||||
#' @param property one of the column names of one of the [antibiotics] data set
|
||||
#' @param language language of the returned text, defaults to system language (see [get_locale()]) and can also be set with `getOption("AMR_locale")`. Use `language = NULL` or `language = ""` to prevent translation.
|
||||
#' @param administration way of administration, either `"oral"` or `"iv"`
|
||||
#' @param units a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples
|
||||
#' @param open browse the URL using [utils::browseURL()]
|
||||
#' @param ... other arguments passed on to [as.ab()]
|
||||
#' @details All output will be [translate]d where possible.
|
||||
#'
|
||||
#' The function [ab_url()] will return the direct URL to the official WHO website. A warning will be returned if the required ATC code is not available.
|
||||
#' @inheritSection as.ab Source
|
||||
#' @rdname ab_property
|
||||
#' @name ab_property
|
||||
#' @return
|
||||
#' - An [integer] in case of [ab_cid()]
|
||||
#' - A named [list] in case of [ab_info()] and multiple [ab_synonyms()]/[ab_tradenames()]
|
||||
#' - A [double] in case of [ab_ddd()]
|
||||
#' - A [character] in all other cases
|
||||
#' @export
|
||||
#' @seealso [antibiotics]
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # all properties:
|
||||
#' ab_name("AMX") # "Amoxicillin"
|
||||
#' ab_atc("AMX") # J01CA04 (ATC code from the WHO)
|
||||
#' ab_cid("AMX") # 33613 (Compound ID from PubChem)
|
||||
#' ab_synonyms("AMX") # a list with brand names of amoxicillin
|
||||
#' ab_tradenames("AMX") # same
|
||||
#' ab_group("AMX") # "Beta-lactams/penicillins"
|
||||
#' ab_atc_group1("AMX") # "Beta-lactam antibacterials, penicillins"
|
||||
#' ab_atc_group2("AMX") # "Penicillins with extended spectrum"
|
||||
#' ab_url("AMX") # link to the official WHO page
|
||||
#'
|
||||
#' # smart lowercase tranformation
|
||||
#' ab_name(x = c("AMC", "PLB")) # "Amoxicillin/clavulanic acid" "Polymyxin B"
|
||||
#' ab_name(x = c("AMC", "PLB"),
|
||||
#' tolower = TRUE) # "amoxicillin/clavulanic acid" "polymyxin B"
|
||||
#'
|
||||
#' # defined daily doses (DDD)
|
||||
#' ab_ddd("AMX", "oral") # 1
|
||||
#' ab_ddd("AMX", "oral", units = TRUE) # "g"
|
||||
#' ab_ddd("AMX", "iv") # 1
|
||||
#' ab_ddd("AMX", "iv", units = TRUE) # "g"
|
||||
#'
|
||||
#' ab_info("AMX") # all properties as a list
|
||||
#'
|
||||
#' # all ab_* functions use as.ab() internally, so you can go from 'any' to 'any':
|
||||
#' ab_atc("AMP") # ATC code of AMP (ampicillin)
|
||||
#' ab_group("J01CA01") # Drug group of ampicillins ATC code
|
||||
#' ab_loinc("ampicillin") # LOINC codes of ampicillin
|
||||
#' ab_name("21066-6") # "Ampicillin" (using LOINC)
|
||||
#' ab_name(6249) # "Ampicillin" (using CID)
|
||||
#' ab_name("J01CA01") # "Ampicillin" (using ATC)
|
||||
#'
|
||||
#' # spelling from different languages and dyslexia are no problem
|
||||
#' ab_atc("ceftriaxon")
|
||||
#' ab_atc("cephtriaxone")
|
||||
#' ab_atc("cephthriaxone")
|
||||
#' ab_atc("seephthriaaksone")
|
||||
ab_name <- function(x, language = get_locale(), tolower = FALSE, ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(tolower, allow_class = "logical", has_length = 1)
|
||||
|
||||
x <- translate_AMR(ab_validate(x = x, property = "name", ...), language = language)
|
||||
if (tolower == TRUE) {
|
||||
# use perl to only transform the first character
|
||||
# as we want "polymyxin B", not "polymyxin b"
|
||||
x <- gsub("^([A-Z])", "\\L\\1", x, perl = TRUE)
|
||||
}
|
||||
x
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @aliases ATC
|
||||
#' @export
|
||||
ab_atc <- function(x, ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
ab_validate(x = x, property = "atc", ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_cid <- function(x, ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
ab_validate(x = x, property = "cid", ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_synonyms <- function(x, ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
syns <- ab_validate(x = x, property = "synonyms", ...)
|
||||
names(syns) <- x
|
||||
if (length(syns) == 1) {
|
||||
unname(unlist(syns))
|
||||
} else {
|
||||
syns
|
||||
}
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_tradenames <- function(x, ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
ab_synonyms(x, ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_group <- function(x, language = get_locale(), ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
translate_AMR(ab_validate(x = x, property = "group", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_atc_group1 <- function(x, language = get_locale(), ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
translate_AMR(ab_validate(x = x, property = "atc_group1", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_atc_group2 <- function(x, language = get_locale(), ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
translate_AMR(ab_validate(x = x, property = "atc_group2", ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_loinc <- function(x, ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
loincs <- ab_validate(x = x, property = "loinc", ...)
|
||||
names(loincs) <- x
|
||||
if (length(loincs) == 1) {
|
||||
unname(unlist(loincs))
|
||||
} else {
|
||||
loincs
|
||||
}
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_ddd <- function(x, administration = "oral", units = FALSE, ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(administration, is_in = c("oral", "iv"), has_length = 1)
|
||||
meet_criteria(units, allow_class = "logical", has_length = 1)
|
||||
|
||||
ddd_prop <- administration
|
||||
if (units == TRUE) {
|
||||
ddd_prop <- paste0(ddd_prop, "_units")
|
||||
} else {
|
||||
ddd_prop <- paste0(ddd_prop, "_ddd")
|
||||
}
|
||||
ab_validate(x = x, property = ddd_prop, ...)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_info <- function(x, language = get_locale(), ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x <- as.ab(x, ...)
|
||||
list(ab = as.character(x),
|
||||
atc = ab_atc(x),
|
||||
cid = ab_cid(x),
|
||||
name = ab_name(x, language = language),
|
||||
group = ab_group(x, language = language),
|
||||
atc_group1 = ab_atc_group1(x, language = language),
|
||||
atc_group2 = ab_atc_group2(x, language = language),
|
||||
tradenames = ab_tradenames(x),
|
||||
ddd = list(oral = list(amount = ab_ddd(x, administration = "oral", units = FALSE),
|
||||
units = ab_ddd(x, administration = "oral", units = TRUE)),
|
||||
iv = list(amount = ab_ddd(x, administration = "iv", units = FALSE),
|
||||
units = ab_ddd(x, administration = "iv", units = TRUE))))
|
||||
}
|
||||
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_url <- function(x, open = FALSE, ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(open, allow_class = "logical", has_length = 1)
|
||||
|
||||
ab <- as.ab(x = x, ... = ...)
|
||||
u <- paste0("https://www.whocc.no/atc_ddd_index/?code=", ab_atc(ab), "&showdescription=no")
|
||||
u[is.na(ab_atc(ab))] <- NA_character_
|
||||
names(u) <- ab_name(ab)
|
||||
|
||||
NAs <- ab_name(ab, tolower = TRUE, language = NULL)[!is.na(ab) & is.na(ab_atc(ab))]
|
||||
if (length(NAs) > 0) {
|
||||
warning_("No ATC code available for ", paste0(NAs, collapse = ", "), ".")
|
||||
}
|
||||
|
||||
if (open == TRUE) {
|
||||
if (length(u) > 1 & !is.na(u[1L])) {
|
||||
warning_("Only the first URL will be opened, as `browseURL()` only suports one string.")
|
||||
}
|
||||
if (!is.na(u[1L])) {
|
||||
utils::browseURL(u[1L])
|
||||
}
|
||||
}
|
||||
u
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @export
|
||||
ab_property <- function(x, property = "name", language = get_locale(), ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(property, is_in = colnames(antibiotics), has_length = 1)
|
||||
meet_criteria(language, is_in = c(LANGUAGES_SUPPORTED, ""), has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
translate_AMR(ab_validate(x = x, property = property, ...), language = language)
|
||||
}
|
||||
|
||||
ab_validate <- function(x, property, ...) {
|
||||
|
||||
check_dataset_integrity()
|
||||
|
||||
# try to catch an error when inputting an invalid argument
|
||||
# so the 'call.' can be set to FALSE
|
||||
tryCatch(x[1L] %in% antibiotics[1, property],
|
||||
error = function(e) stop(e$message, call. = FALSE))
|
||||
x_bak <- x
|
||||
if (!all(x %in% antibiotics[, property])) {
|
||||
x <- data.frame(ab = as.ab(x, ...), stringsAsFactors = FALSE) %pm>%
|
||||
pm_left_join(antibiotics, by = "ab") %pm>%
|
||||
pm_pull(property)
|
||||
}
|
||||
if (property == "ab") {
|
||||
return(set_clean_class(x, new_class = c("ab", "character")))
|
||||
} else if (property == "cid") {
|
||||
return(as.integer(x))
|
||||
} else if (property %like% "ddd") {
|
||||
return(as.double(x))
|
||||
} else {
|
||||
x[is.na(x) & !is.na(x_bak)] <- NA
|
||||
return(x)
|
||||
}
|
||||
}
|
||||
@@ -1,199 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Age in years of individuals
|
||||
#'
|
||||
#' Calculates age in years based on a reference date, which is the sytem date at default.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x date(s), will be coerced with [as.POSIXlt()]
|
||||
#' @param reference reference date(s) (defaults to today), will be coerced with [as.POSIXlt()]
|
||||
#' @param exact a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of [year-to-date](https://en.wikipedia.org/wiki/Year-to-date) (YTD) of `x` by the number of days in the year of `reference` (either 365 or 366).
|
||||
#' @param na.rm a logical to indicate whether missing values should be removed
|
||||
#' @param ... arguments passed on to [as.POSIXlt()], such as `origin`
|
||||
#' @details Ages below 0 will be returned as `NA` with a warning. Ages above 120 will only give a warning.
|
||||
#' @return An [integer] (no decimals) if `exact = FALSE`, a [double] (with decimals) otherwise
|
||||
#' @seealso To split ages into groups, use the [age_groups()] function.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @export
|
||||
#' @examples
|
||||
#' # 10 random birth dates
|
||||
#' df <- data.frame(birth_date = Sys.Date() - runif(10) * 25000)
|
||||
#' # add ages
|
||||
#' df$age <- age(df$birth_date)
|
||||
#' # add exact ages
|
||||
#' df$age_exact <- age(df$birth_date, exact = TRUE)
|
||||
#'
|
||||
#' df
|
||||
age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...) {
|
||||
meet_criteria(x, allow_class = c("character", "Date", "POSIXt"))
|
||||
meet_criteria(reference, allow_class = c("character", "Date", "POSIXt"))
|
||||
meet_criteria(exact, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
|
||||
if (length(x) != length(reference)) {
|
||||
stop_if(length(reference) != 1, "`x` and `reference` must be of same length, or `reference` must be of length 1.")
|
||||
reference <- rep(reference, length(x))
|
||||
}
|
||||
x <- as.POSIXlt(x, ...)
|
||||
reference <- as.POSIXlt(reference, ...)
|
||||
|
||||
# from https://stackoverflow.com/a/25450756/4575331
|
||||
years_gap <- reference$year - x$year
|
||||
ages <- ifelse(reference$mon < x$mon | (reference$mon == x$mon & reference$mday < x$mday),
|
||||
as.integer(years_gap - 1),
|
||||
as.integer(years_gap))
|
||||
|
||||
# add decimals
|
||||
if (exact == TRUE) {
|
||||
# get dates of `x` when `x` would have the year of `reference`
|
||||
x_in_reference_year <- as.POSIXlt(paste0(format(reference, "%Y"), format(x, "-%m-%d")))
|
||||
# get differences in days
|
||||
n_days_x_rest <- as.double(difftime(reference, x_in_reference_year, units = "days"))
|
||||
# get numbers of days the years of `reference` has for a reliable denominator
|
||||
n_days_reference_year <- as.POSIXlt(paste0(format(reference, "%Y"), "-12-31"))$yday + 1
|
||||
# add decimal parts of year
|
||||
mod <- n_days_x_rest / n_days_reference_year
|
||||
# negative mods are cases where `x_in_reference_year` > `reference` - so 'add' a year
|
||||
mod[mod < 0] <- 1 + mod[mod < 0]
|
||||
# and finally add to ages
|
||||
ages <- ages + mod
|
||||
}
|
||||
|
||||
if (any(ages < 0, na.rm = TRUE)) {
|
||||
ages[ages < 0] <- NA
|
||||
warning_("NAs introduced for ages below 0.", call = TRUE)
|
||||
}
|
||||
if (any(ages > 120, na.rm = TRUE)) {
|
||||
warning_("Some ages are above 120.", call = TRUE)
|
||||
}
|
||||
|
||||
if (isTRUE(na.rm)) {
|
||||
ages <- ages[!is.na(ages)]
|
||||
}
|
||||
|
||||
ages
|
||||
}
|
||||
|
||||
#' Split ages into age groups
|
||||
#'
|
||||
#' Split ages into age groups defined by the `split` argument. This allows for easier demographic (antimicrobial resistance) analysis.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x age, e.g. calculated with [age()]
|
||||
#' @param split_at values to split `x` at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See Details.
|
||||
#' @param na.rm a [logical] to indicate whether missing values should be removed
|
||||
#' @details To split ages, the input for the `split_at` argument can be:
|
||||
#'
|
||||
#' * A numeric vector. A value of e.g. `c(10, 20)` will split `x` on 0-9, 10-19 and 20+. A value of only `50` will split `x` on 0-49 and 50+.
|
||||
#' The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).
|
||||
#' * A character:
|
||||
#' - `"children"` or `"kids"`, equivalent of: `c(0, 1, 2, 4, 6, 13, 18)`. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.
|
||||
#' - `"elderly"` or `"seniors"`, equivalent of: `c(65, 75, 85)`. This will split on 0-64, 65-74, 75-84, 85+.
|
||||
#' - `"fives"`, equivalent of: `1:20 * 5`. This will split on 0-4, 5-9, ..., 95-99, 100+.
|
||||
#' - `"tens"`, equivalent of: `1:10 * 10`. This will split on 0-9, 10-19, ..., 90-99, 100+.
|
||||
#' @return Ordered [factor]
|
||||
#' @seealso To determine ages, based on one or more reference dates, use the [age()] function.
|
||||
#' @export
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' ages <- c(3, 8, 16, 54, 31, 76, 101, 43, 21)
|
||||
#'
|
||||
#' # split into 0-49 and 50+
|
||||
#' age_groups(ages, 50)
|
||||
#'
|
||||
#' # split into 0-19, 20-49 and 50+
|
||||
#' age_groups(ages, c(20, 50))
|
||||
#'
|
||||
#' # split into groups of ten years
|
||||
#' age_groups(ages, 1:10 * 10)
|
||||
#' age_groups(ages, split_at = "tens")
|
||||
#'
|
||||
#' # split into groups of five years
|
||||
#' age_groups(ages, 1:20 * 5)
|
||||
#' age_groups(ages, split_at = "fives")
|
||||
#'
|
||||
#' # split specifically for children
|
||||
#' age_groups(ages, c(1, 2, 4, 6, 13, 17))
|
||||
#' age_groups(ages, "children")
|
||||
#'
|
||||
#' \donttest{
|
||||
#' # resistance of ciprofloxacin per age group
|
||||
#' if (require("dplyr")) {
|
||||
#' example_isolates %>%
|
||||
#' filter_first_isolate() %>%
|
||||
#' filter(mo == as.mo("E. coli")) %>%
|
||||
#' group_by(age_group = age_groups(age)) %>%
|
||||
#' select(age_group, CIP) %>%
|
||||
#' ggplot_rsi(x = "age_group", minimum = 0)
|
||||
#' }
|
||||
#' }
|
||||
age_groups <- function(x, split_at = c(12, 25, 55, 75), na.rm = FALSE) {
|
||||
meet_criteria(x, allow_class = c("numeric", "integer"))
|
||||
meet_criteria(split_at, allow_class = c("numeric", "integer", "character"))
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
|
||||
if (any(x < 0, na.rm = TRUE)) {
|
||||
x[x < 0] <- NA
|
||||
warning_("NAs introduced for ages below 0.", call = TRUE)
|
||||
}
|
||||
if (is.character(split_at)) {
|
||||
split_at <- split_at[1L]
|
||||
if (split_at %like% "^(child|kid|junior)") {
|
||||
split_at <- c(0, 1, 2, 4, 6, 13, 18)
|
||||
} else if (split_at %like% "^(elder|senior)") {
|
||||
split_at <- c(65, 75, 85)
|
||||
} else if (split_at %like% "^five") {
|
||||
split_at <- 1:20 * 5
|
||||
} else if (split_at %like% "^ten") {
|
||||
split_at <- 1:10 * 10
|
||||
}
|
||||
}
|
||||
split_at <- sort(unique(as.integer(split_at)))
|
||||
if (!split_at[1] == 0) {
|
||||
# add base number 0
|
||||
split_at <- c(0, split_at)
|
||||
}
|
||||
split_at <- split_at[!is.na(split_at)]
|
||||
stop_if(length(split_at) == 1, "invalid value for `split_at`") # only 0 is available
|
||||
|
||||
# turn input values to 'split_at' indices
|
||||
y <- x
|
||||
lbls <- split_at
|
||||
for (i in seq_len(length(split_at))) {
|
||||
y[x >= split_at[i]] <- i
|
||||
# create labels
|
||||
lbls[i - 1] <- paste0(unique(c(split_at[i - 1], split_at[i] - 1)), collapse = "-")
|
||||
}
|
||||
|
||||
# last category
|
||||
lbls[length(lbls)] <- paste0(split_at[length(split_at)], "+")
|
||||
|
||||
agegroups <- factor(lbls[y], levels = lbls, ordered = TRUE)
|
||||
|
||||
if (isTRUE(na.rm)) {
|
||||
agegroups <- agegroups[!is.na(agegroups)]
|
||||
}
|
||||
|
||||
agegroups
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' The `AMR` Package
|
||||
#'
|
||||
#' Welcome to the `AMR` package.
|
||||
#' @details
|
||||
#' `AMR` is a free, open-source and independent \R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. Our aim is to provide a standard for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.
|
||||
#'
|
||||
#' After installing this package, \R knows ~70,000 distinct microbial species and all ~550 antibiotic, antimycotic and antiviral drugs by name and code (including ATC, EARS-NET, LOINC and SNOMED CT), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data.
|
||||
#'
|
||||
#' This package is fully independent of any other \R package and works on Windows, macOS and Linux with all versions of \R since R-3.0.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, in collaboration with non-profit organisations Certe Medical Diagnostics and Advice and University Medical Center Groningen. This \R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation.
|
||||
#'
|
||||
#' This package can be used for:
|
||||
#' - Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the Catalogue of Life and List of Prokaryotic names with Standing in Nomenclature
|
||||
#' - Interpreting raw MIC and disk diffusion values, based on the latest CLSI or EUCAST guidelines
|
||||
#' - Retrieving antimicrobial drug names, doses and forms of administration from clinical health care records
|
||||
#' - Determining first isolates to be used for AMR analysis
|
||||
#' - Calculating antimicrobial resistance
|
||||
#' - Determining multi-drug resistance (MDR) / multi-drug resistant organisms (MDRO)
|
||||
#' - Calculating (empirical) susceptibility of both mono therapy and combination therapies
|
||||
#' - Predicting future antimicrobial resistance using regression models
|
||||
#' - Getting properties for any microorganism (such as Gram stain, species, genus or family)
|
||||
#' - Getting properties for any antibiotic (such as name, code of EARS-Net/ATC/LOINC/PubChem, defined daily dose or trade name)
|
||||
#' - Plotting antimicrobial resistance
|
||||
#' - Applying EUCAST expert rules
|
||||
#' - Getting SNOMED codes of a microorganism, or getting properties of a microorganism based on a SNOMED code
|
||||
#' - Getting LOINC codes of an antibiotic, or getting properties of an antibiotic based on a LOINC code
|
||||
#' - Machine reading the EUCAST and CLSI guidelines from 2011-2020 to translate MIC values and disk diffusion diameters to R/SI
|
||||
#' - Principal component analysis for AMR
|
||||
#'
|
||||
#' @section Reference data publicly available:
|
||||
#' All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this `AMR` package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find [all download links on our website](https://msberends.github.io/AMR/articles/datasets.html), which is automatically updated with every code change.
|
||||
#' @section Read more on our website!:
|
||||
#' On our website <https://msberends.github.io/AMR/> you can find [a comprehensive tutorial](https://msberends.github.io/AMR/articles/AMR.html) about how to conduct AMR analysis, the [complete documentation of all functions](https://msberends.github.io/AMR/reference/) and [an example analysis using WHONET data](https://msberends.github.io/AMR/articles/WHONET.html). As we would like to better understand the backgrounds and needs of our users, please [participate in our survey](https://msberends.github.io/AMR/survey.html)!
|
||||
#' @section Contact Us:
|
||||
#' For suggestions, comments or questions, please contact us at:
|
||||
#'
|
||||
#' Matthijs S. Berends \cr
|
||||
#' m.s.berends \[at\] umcg \[dot\] nl \cr
|
||||
#' University of Groningen
|
||||
#' Department of Medical Microbiology
|
||||
#' University Medical Center Groningen \cr
|
||||
#' Post Office Box 30001 \cr
|
||||
#' 9700 RB Groningen \cr
|
||||
#' The Netherlands
|
||||
#' <https://msberends.github.io/AMR/>
|
||||
#'
|
||||
#' If you have found a bug, please file a new issue at: \cr
|
||||
#' <https://github.com/msberends/AMR/issues>
|
||||
#' @name AMR
|
||||
#' @rdname AMR
|
||||
NULL
|
||||
|
||||
#' Plotting for classes `rsi`, `mic` and `disk`
|
||||
#'
|
||||
#' Functions to print classes of the `AMR` package.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @param ... Arguments passed on to functions
|
||||
#' @inheritParams base::plot
|
||||
#' @inheritParams graphics::barplot
|
||||
#' @name plot
|
||||
#' @rdname plot
|
||||
#' @keywords internal
|
||||
NULL
|
||||
-206
@@ -1,206 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Get ATC properties from WHOCC website
|
||||
#'
|
||||
#' Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic), such as the name, defined daily dose (DDD) or standard unit.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param atc_code a character or character vector with ATC code(s) of antibiotic(s)
|
||||
#' @param property property of an ATC code. Valid values are `"ATC"`, `"Name"`, `"DDD"`, `"U"` (`"unit"`), `"Adm.R"`, `"Note"` and `groups`. For this last option, all hierarchical groups of an ATC code will be returned, see Examples.
|
||||
#' @param administration type of administration when using `property = "Adm.R"`, see Details
|
||||
#' @param url url of website of the WHOCC. The sign `%s` can be used as a placeholder for ATC codes.
|
||||
#' @param url_vet url of website of the WHOCC for veterinary medicine. The sign `%s` can be used as a placeholder for ATC_vet codes (that all start with "Q").
|
||||
#' @param ... arguments to pass on to `atc_property`
|
||||
#' @details
|
||||
#' Options for argument `administration`:
|
||||
#'
|
||||
#' - `"Implant"` = Implant
|
||||
#' - `"Inhal"` = Inhalation
|
||||
#' - `"Instill"` = Instillation
|
||||
#' - `"N"` = nasal
|
||||
#' - `"O"` = oral
|
||||
#' - `"P"` = parenteral
|
||||
#' - `"R"` = rectal
|
||||
#' - `"SL"` = sublingual/buccal
|
||||
#' - `"TD"` = transdermal
|
||||
#' - `"V"` = vaginal
|
||||
#'
|
||||
#' Abbreviations of return values when using `property = "U"` (unit):
|
||||
#'
|
||||
#' - `"g"` = gram
|
||||
#' - `"mg"` = milligram
|
||||
#' - `"mcg"`` = microgram
|
||||
#' - `"U"` = unit
|
||||
#' - `"TU"` = thousand units
|
||||
#' - `"MU"` = million units
|
||||
#' - `"mmol"` = millimole
|
||||
#' - `"ml"` = milliliter (e.g. eyedrops)
|
||||
#'
|
||||
#' **N.B. This function requires an internet connection and only works if the following packages are installed: `curl`, `rvest`, `xml2`.**
|
||||
#' @export
|
||||
#' @rdname atc_online
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @source <https://www.whocc.no/atc_ddd_alterations__cumulative/ddd_alterations/abbrevations/>
|
||||
#' @examples
|
||||
#' \donttest{
|
||||
#' # oral DDD (Defined Daily Dose) of amoxicillin
|
||||
#' atc_online_property("J01CA04", "DDD", "O")
|
||||
#'
|
||||
#' # parenteral DDD (Defined Daily Dose) of amoxicillin
|
||||
#' atc_online_property("J01CA04", "DDD", "P")
|
||||
#'
|
||||
#' atc_online_property("J01CA04", property = "groups") # search hierarchical groups of amoxicillin
|
||||
#' }
|
||||
atc_online_property <- function(atc_code,
|
||||
property,
|
||||
administration = "O",
|
||||
url = "https://www.whocc.no/atc_ddd_index/?code=%s&showdescription=no",
|
||||
url_vet = "https://www.whocc.no/atcvet/atcvet_index/?code=%s&showdescription=no") {
|
||||
meet_criteria(atc_code, allow_class = "character")
|
||||
meet_criteria(property, allow_class = "character", has_length = 1, is_in = c("ATC", "Name", "DDD", "U", "Adm.R", "Note", "groups"), ignore.case = TRUE)
|
||||
meet_criteria(administration, allow_class = "character", has_length = 1)
|
||||
meet_criteria(url, allow_class = "character", has_length = 1, looks_like = "https?://")
|
||||
meet_criteria(url_vet, allow_class = "character", has_length = 1, looks_like = "https?://")
|
||||
|
||||
has_internet <- import_fn("has_internet", "curl")
|
||||
html_attr <- import_fn("html_attr", "rvest")
|
||||
html_children <- import_fn("html_children", "rvest")
|
||||
html_node <- import_fn("html_node", "rvest")
|
||||
html_nodes <- import_fn("html_nodes", "rvest")
|
||||
html_table <- import_fn("html_table", "rvest")
|
||||
html_text <- import_fn("html_text", "rvest")
|
||||
read_html <- import_fn("read_html", "xml2")
|
||||
|
||||
check_dataset_integrity()
|
||||
|
||||
if (!all(atc_code %in% antibiotics)) {
|
||||
atc_code <- as.character(ab_atc(atc_code))
|
||||
}
|
||||
|
||||
if (!has_internet()) {
|
||||
message_("There appears to be no internet connection, returning NA.",
|
||||
add_fn = font_red,
|
||||
as_note = FALSE)
|
||||
return(rep(NA, length(atc_code)))
|
||||
}
|
||||
|
||||
# also allow unit as property
|
||||
if (property %like% "unit") {
|
||||
property <- "U"
|
||||
}
|
||||
|
||||
property <- tolower(property)
|
||||
if (property == "ddd") {
|
||||
returnvalue <- rep(NA_real_, length(atc_code))
|
||||
} else if (property == "groups") {
|
||||
returnvalue <- list()
|
||||
} else {
|
||||
returnvalue <- rep(NA_character_, length(atc_code))
|
||||
}
|
||||
|
||||
progress <- progress_ticker(n = length(atc_code), 3)
|
||||
on.exit(close(progress))
|
||||
|
||||
for (i in seq_len(length(atc_code))) {
|
||||
|
||||
progress$tick()
|
||||
|
||||
if (atc_code[i] %like% "^Q") {
|
||||
# veterinary drugs, ATC_vet codes start with a "Q"
|
||||
atc_url <- url_vet
|
||||
} else {
|
||||
atc_url <- url
|
||||
}
|
||||
atc_url <- sub("%s", atc_code[i], atc_url, fixed = TRUE)
|
||||
|
||||
if (property == "groups") {
|
||||
tbl <- read_html(atc_url) %pm>%
|
||||
html_node("#content") %pm>%
|
||||
html_children() %pm>%
|
||||
html_node("a")
|
||||
|
||||
# get URLS of items
|
||||
hrefs <- tbl %pm>% html_attr("href")
|
||||
# get text of items
|
||||
texts <- tbl %pm>% html_text()
|
||||
# select only text items where URL like "code="
|
||||
texts <- texts[grepl("?code=", tolower(hrefs), fixed = TRUE)]
|
||||
# last one is antibiotics, skip it
|
||||
texts <- texts[seq_len(length(texts)) - 1]
|
||||
returnvalue <- c(list(texts), returnvalue)
|
||||
|
||||
} else {
|
||||
tbl <- read_html(atc_url) %pm>%
|
||||
html_nodes("table") %pm>%
|
||||
html_table(header = TRUE) %pm>%
|
||||
as.data.frame(stringsAsFactors = FALSE)
|
||||
|
||||
# case insensitive column names
|
||||
colnames(tbl) <- gsub("^atc.*", "atc", tolower(colnames(tbl)))
|
||||
|
||||
if (length(tbl) == 0) {
|
||||
warning_("ATC not found: ", atc_code[i], ". Please check ", atc_url, ".", call = FALSE)
|
||||
returnvalue[i] <- NA
|
||||
next
|
||||
}
|
||||
|
||||
if (property %in% c("atc", "name")) {
|
||||
# ATC and name are only in first row
|
||||
returnvalue[i] <- tbl[1, property]
|
||||
} else {
|
||||
if (!"adm.r" %in% colnames(tbl) | is.na(tbl[1, "adm.r"])) {
|
||||
returnvalue[i] <- NA
|
||||
next
|
||||
} else {
|
||||
for (j in seq_len(nrow(tbl))) {
|
||||
if (tbl[j, "adm.r"] == administration) {
|
||||
returnvalue[i] <- tbl[j, property]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (property == "groups" & length(returnvalue) == 1) {
|
||||
returnvalue <- returnvalue[[1]]
|
||||
}
|
||||
|
||||
returnvalue
|
||||
}
|
||||
|
||||
#' @rdname atc_online
|
||||
#' @export
|
||||
atc_online_groups <- function(atc_code, ...) {
|
||||
meet_criteria(atc_code, allow_class = "character")
|
||||
atc_online_property(atc_code = atc_code, property = "groups", ...)
|
||||
}
|
||||
|
||||
#' @rdname atc_online
|
||||
#' @export
|
||||
atc_online_ddd <- function(atc_code, ...) {
|
||||
meet_criteria(atc_code, allow_class = "character")
|
||||
atc_online_property(atc_code = atc_code, property = "ddd", ...)
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Check availability of columns
|
||||
#'
|
||||
#' Easy check for data availability of all columns in a data set. This makes it easy to get an idea of which antimicrobial combinations can be used for calculation with e.g. [susceptibility()] and [resistance()].
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param tbl a [data.frame] or [list]
|
||||
#' @param width number of characters to present the visual availability, defaults to filling the width of the console
|
||||
#' @details The function returns a [data.frame] with columns `"resistant"` and `"visual_resistance"`. The values in that columns are calculated with [resistance()].
|
||||
#' @return [data.frame] with column names of `tbl` as row names
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @export
|
||||
#' @examples
|
||||
#' availability(example_isolates)
|
||||
#'
|
||||
#' if (require("dplyr")) {
|
||||
#' example_isolates %>%
|
||||
#' filter(mo == as.mo("E. coli")) %>%
|
||||
#' select_if(is.rsi) %>%
|
||||
#' availability()
|
||||
#' }
|
||||
availability <- function(tbl, width = NULL) {
|
||||
meet_criteria(tbl, allow_class = "data.frame")
|
||||
meet_criteria(width, allow_class = "numeric", allow_NULL = TRUE)
|
||||
|
||||
x <- vapply(FUN.VALUE = double(1), tbl, function(x) {
|
||||
1 - sum(is.na(x)) / length(x)
|
||||
})
|
||||
n <- vapply(FUN.VALUE = double(1), tbl, function(x) length(x[!is.na(x)]))
|
||||
R <- vapply(FUN.VALUE = double(1), tbl, function(x) ifelse(is.rsi(x), resistance(x, minimum = 0), NA_real_))
|
||||
R_print <- character(length(R))
|
||||
R_print[!is.na(R)] <- percentage(R[!is.na(R)])
|
||||
R_print[is.na(R)] <- ""
|
||||
|
||||
if (is.null(width)) {
|
||||
width <- options()$width -
|
||||
(max(nchar(colnames(tbl))) +
|
||||
# count col
|
||||
8 +
|
||||
# available % column
|
||||
10 +
|
||||
# resistant % column
|
||||
10 +
|
||||
# extra margin
|
||||
5)
|
||||
width <- width / 2
|
||||
}
|
||||
|
||||
if (length(R[is.na(R)]) == ncol(tbl)) {
|
||||
width <- width * 2 + 10
|
||||
}
|
||||
|
||||
x_chars_R <- strrep("#", round(width * R, digits = 2))
|
||||
x_chars_SI <- strrep("-", width - nchar(x_chars_R))
|
||||
vis_resistance <- paste0("|", x_chars_R, x_chars_SI, "|")
|
||||
vis_resistance[is.na(R)] <- ""
|
||||
|
||||
x_chars <- strrep("#", round(x, digits = 2) / (1 / width))
|
||||
x_chars_empty <- strrep("-", width - nchar(x_chars))
|
||||
|
||||
df <- data.frame(count = n,
|
||||
available = percentage(x),
|
||||
visual_availabilty = paste0("|", x_chars, x_chars_empty, "|"),
|
||||
resistant = R_print,
|
||||
visual_resistance = vis_resistance,
|
||||
stringsAsFactors = FALSE)
|
||||
if (length(R[is.na(R)]) == ncol(tbl)) {
|
||||
df[, 1:3]
|
||||
} else {
|
||||
df
|
||||
}
|
||||
}
|
||||
@@ -1,253 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Determine bug-drug combinations
|
||||
#'
|
||||
#' Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use [format()] on the result to prettify it to a publicable/printable format, see Examples.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @inheritParams eucast_rules
|
||||
#' @param combine_IR logical to indicate whether values R and I should be summed
|
||||
#' @param add_ab_group logical to indicate where the group of the antimicrobials must be included as a first column
|
||||
#' @param remove_intrinsic_resistant logical to indicate that rows and columns with 100% resistance for all tested antimicrobials must be removed from the table
|
||||
#' @param FUN function to call on the `mo` column to transform the microorganism IDs, defaults to [mo_shortname()]
|
||||
#' @param translate_ab character of length 1 containing column names of the [antibiotics] data set
|
||||
#' @param ... arguments passed on to `FUN`
|
||||
#' @inheritParams rsi_df
|
||||
#' @inheritParams base::formatC
|
||||
#' @details The function [format()] calculates the resistance per bug-drug combination. Use `combine_IR = FALSE` (default) to test R vs. S+I and `combine_IR = TRUE` to test R+I vs. S.
|
||||
#' @export
|
||||
#' @rdname bug_drug_combinations
|
||||
#' @return The function [bug_drug_combinations()] returns a [data.frame] with columns "mo", "ab", "S", "I", "R" and "total".
|
||||
#' @source \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' \donttest{
|
||||
#' x <- bug_drug_combinations(example_isolates)
|
||||
#' x
|
||||
#' format(x, translate_ab = "name (atc)")
|
||||
#'
|
||||
#' # Use FUN to change to transformation of microorganism codes
|
||||
#' bug_drug_combinations(example_isolates,
|
||||
#' FUN = mo_gramstain)
|
||||
#'
|
||||
#' bug_drug_combinations(example_isolates,
|
||||
#' FUN = function(x) ifelse(x == as.mo("E. coli"),
|
||||
#' "E. coli",
|
||||
#' "Others"))
|
||||
#' }
|
||||
bug_drug_combinations <- function(x,
|
||||
col_mo = NULL,
|
||||
FUN = mo_shortname,
|
||||
...) {
|
||||
meet_criteria(x, allow_class = "data.frame", contains_column_class = "rsi")
|
||||
meet_criteria(col_mo, allow_class = "character", is_in = colnames(x), has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(FUN, allow_class = "function", has_length = 1)
|
||||
|
||||
# try to find columns based on type
|
||||
# -- mo
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(x = x, type = "mo")
|
||||
}
|
||||
stop_if(is.null(col_mo), "`col_mo` must be set")
|
||||
|
||||
x_class <- class(x)
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
x[, col_mo] <- FUN(x[, col_mo, drop = TRUE], ...)
|
||||
x <- x[, c(col_mo, names(which(vapply(FUN.VALUE = logical(1), x, is.rsi)))), drop = FALSE]
|
||||
|
||||
unique_mo <- sort(unique(x[, col_mo, drop = TRUE]))
|
||||
|
||||
out <- data.frame(mo = character(0),
|
||||
ab = character(0),
|
||||
S = integer(0),
|
||||
I = integer(0),
|
||||
R = integer(0),
|
||||
total = integer(0),
|
||||
stringsAsFactors = FALSE)
|
||||
|
||||
for (i in seq_len(length(unique_mo))) {
|
||||
# filter on MO group and only select R/SI columns
|
||||
x_mo_filter <- x[which(x[, col_mo, drop = TRUE] == unique_mo[i]), names(which(vapply(FUN.VALUE = logical(1), x, is.rsi))), drop = FALSE]
|
||||
# turn and merge everything
|
||||
pivot <- lapply(x_mo_filter, function(x) {
|
||||
m <- as.matrix(table(x))
|
||||
data.frame(S = m["S", ], I = m["I", ], R = m["R", ], stringsAsFactors = FALSE)
|
||||
})
|
||||
merged <- do.call(rbind, pivot)
|
||||
out_group <- data.frame(mo = unique_mo[i],
|
||||
ab = rownames(merged),
|
||||
S = merged$S,
|
||||
I = merged$I,
|
||||
R = merged$R,
|
||||
total = merged$S + merged$I + merged$R,
|
||||
stringsAsFactors = FALSE)
|
||||
out <- rbind(out, out_group, stringsAsFactors = FALSE)
|
||||
}
|
||||
|
||||
set_clean_class(out,
|
||||
new_class = c("bug_drug_combinations", x_class))
|
||||
}
|
||||
|
||||
#' @method format bug_drug_combinations
|
||||
#' @export
|
||||
#' @rdname bug_drug_combinations
|
||||
format.bug_drug_combinations <- function(x,
|
||||
translate_ab = "name (ab, atc)",
|
||||
language = get_locale(),
|
||||
minimum = 30,
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE,
|
||||
add_ab_group = TRUE,
|
||||
remove_intrinsic_resistant = FALSE,
|
||||
decimal.mark = getOption("OutDec"),
|
||||
big.mark = ifelse(decimal.mark == ",", ".", ","),
|
||||
...) {
|
||||
meet_criteria(x, allow_class = "data.frame")
|
||||
meet_criteria(translate_ab, allow_class = c("character", "logical"), has_length = 1, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(minimum, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(combine_SI, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(combine_IR, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(add_ab_group, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(remove_intrinsic_resistant, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(decimal.mark, allow_class = "character", has_length = 1)
|
||||
meet_criteria(big.mark, allow_class = "character", has_length = 1)
|
||||
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
x <- subset(x, total >= minimum)
|
||||
|
||||
if (remove_intrinsic_resistant == TRUE) {
|
||||
x <- subset(x, R != total)
|
||||
}
|
||||
if (combine_SI == TRUE | combine_IR == FALSE) {
|
||||
x$isolates <- x$R
|
||||
} else {
|
||||
x$isolates <- x$R + x$I
|
||||
}
|
||||
|
||||
give_ab_name <- function(ab, format, language) {
|
||||
format <- tolower(format)
|
||||
ab_txt <- rep(format, length(ab))
|
||||
for (i in seq_len(length(ab_txt))) {
|
||||
ab_txt[i] <- gsub("ab", as.character(as.ab(ab[i])), ab_txt[i])
|
||||
ab_txt[i] <- gsub("cid", ab_cid(ab[i]), ab_txt[i])
|
||||
ab_txt[i] <- gsub("group", ab_group(ab[i], language = language), ab_txt[i])
|
||||
ab_txt[i] <- gsub("atc_group1", ab_atc_group1(ab[i], language = language), ab_txt[i])
|
||||
ab_txt[i] <- gsub("atc_group2", ab_atc_group2(ab[i], language = language), ab_txt[i])
|
||||
ab_txt[i] <- gsub("atc", ab_atc(ab[i]), ab_txt[i])
|
||||
ab_txt[i] <- gsub("name", ab_name(ab[i], language = language), ab_txt[i])
|
||||
ab_txt[i]
|
||||
}
|
||||
ab_txt
|
||||
}
|
||||
|
||||
remove_NAs <- function(.data) {
|
||||
cols <- colnames(.data)
|
||||
.data <- as.data.frame(lapply(.data, function(x) ifelse(is.na(x), "", x)),
|
||||
stringsAsFactors = FALSE)
|
||||
colnames(.data) <- cols
|
||||
.data
|
||||
}
|
||||
|
||||
create_var <- function(.data, ...) {
|
||||
dots <- list(...)
|
||||
for (i in seq_len(length(dots))) {
|
||||
.data[, names(dots)[i]] <- dots[[i]]
|
||||
}
|
||||
.data
|
||||
}
|
||||
|
||||
y <- x %pm>%
|
||||
create_var(ab = as.ab(x$ab),
|
||||
ab_txt = give_ab_name(ab = x$ab, format = translate_ab, language = language)) %pm>%
|
||||
pm_group_by(ab, ab_txt, mo) %pm>%
|
||||
pm_summarise(isolates = sum(isolates, na.rm = TRUE),
|
||||
total = sum(total, na.rm = TRUE)) %pm>%
|
||||
pm_ungroup()
|
||||
|
||||
y <- y %pm>%
|
||||
create_var(txt = paste0(percentage(y$isolates / y$total, decimal.mark = decimal.mark, big.mark = big.mark),
|
||||
" (", trimws(format(y$isolates, big.mark = big.mark)), "/",
|
||||
trimws(format(y$total, big.mark = big.mark)), ")")) %pm>%
|
||||
pm_select(ab, ab_txt, mo, txt) %pm>%
|
||||
pm_arrange(mo)
|
||||
|
||||
# replace tidyr::pivot_wider() from here
|
||||
for (i in unique(y$mo)) {
|
||||
mo_group <- y[which(y$mo == i), c("ab", "txt")]
|
||||
colnames(mo_group) <- c("ab", i)
|
||||
rownames(mo_group) <- NULL
|
||||
y <- y %pm>%
|
||||
pm_left_join(mo_group, by = "ab")
|
||||
}
|
||||
y <- y %pm>%
|
||||
pm_distinct(ab, .keep_all = TRUE) %pm>%
|
||||
pm_select(-mo, -txt) %pm>%
|
||||
# replace tidyr::pivot_wider() until here
|
||||
remove_NAs()
|
||||
|
||||
select_ab_vars <- function(.data) {
|
||||
.data[, c("ab_group", "ab_txt", colnames(.data)[!colnames(.data) %in% c("ab_group", "ab_txt", "ab")])]
|
||||
}
|
||||
|
||||
y <- y %pm>%
|
||||
create_var(ab_group = ab_group(y$ab, language = language)) %pm>%
|
||||
select_ab_vars() %pm>%
|
||||
pm_arrange(ab_group, ab_txt)
|
||||
y <- y %pm>%
|
||||
create_var(ab_group = ifelse(y$ab_group != pm_lag(y$ab_group) | is.na(pm_lag(y$ab_group)), y$ab_group, ""))
|
||||
|
||||
if (add_ab_group == FALSE) {
|
||||
y <- y %pm>%
|
||||
pm_select(-ab_group) %pm>%
|
||||
pm_rename("Drug" = ab_txt)
|
||||
colnames(y)[1] <- translate_AMR(colnames(y)[1], language, only_unknown = FALSE)
|
||||
} else {
|
||||
y <- y %pm>%
|
||||
pm_rename("Group" = ab_group,
|
||||
"Drug" = ab_txt)
|
||||
}
|
||||
|
||||
if (!is.null(language)) {
|
||||
colnames(y) <- translate_AMR(colnames(y), language, only_unknown = FALSE)
|
||||
}
|
||||
|
||||
if (remove_intrinsic_resistant == TRUE) {
|
||||
y <- y[, !vapply(FUN.VALUE = logical(1), y, function(col) all(col %like% "100", na.rm = TRUE) & !any(is.na(col))), drop = FALSE]
|
||||
}
|
||||
|
||||
rownames(y) <- NULL
|
||||
y
|
||||
}
|
||||
|
||||
#' @method print bug_drug_combinations
|
||||
#' @export
|
||||
print.bug_drug_combinations <- function(x, ...) {
|
||||
x_class <- class(x)
|
||||
print(set_clean_class(x,
|
||||
new_class = x_class[x_class != "bug_drug_combinations"]),
|
||||
...)
|
||||
message_("Use 'format()' on this result to get a publishable/printable format.", as_note = FALSE)
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
format_included_data_number <- function(data) {
|
||||
if (is.data.frame(data)) {
|
||||
n <- nrow(data)
|
||||
} else {
|
||||
n <- length(unique(data))
|
||||
}
|
||||
if (n > 10000) {
|
||||
rounder <- -3 # round on thousands
|
||||
} else if (n > 1000) {
|
||||
rounder <- -2 # round on hundreds
|
||||
} else {
|
||||
rounder <- -1 # round on tens
|
||||
}
|
||||
paste0("~", format(round(n, rounder), decimal.mark = ".", big.mark = ","))
|
||||
}
|
||||
|
||||
#' The Catalogue of Life
|
||||
#'
|
||||
#' This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life.
|
||||
#' @section Catalogue of Life:
|
||||
#' \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
|
||||
#' This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (CoL, <http://www.catalogueoflife.org>). The CoL is the most comprehensive and authoritative global index of species currently available. Nonetheless, we supplemented the CoL data with data from the List of Prokaryotic names with Standing in Nomenclature (LPSN, [lpsn.dsmz.de](https://lpsn.dsmz.de)). This supplementation is needed until the [CoL+ project](https://github.com/CatalogueOfLife/general) is finished, which we await.
|
||||
#'
|
||||
#' [Click here][catalogue_of_life] for more information about the included taxa. Check which versions of the CoL and LSPN were included in this package with [catalogue_of_life_version()].
|
||||
#' @section Included taxa:
|
||||
#' Included are:
|
||||
#' - All `r format_included_data_number(microorganisms[which(microorganisms$kingdom %in% c("Archeae", "Bacteria", "Chromista", "Protozoa")), ])` (sub)species from the kingdoms of Archaea, Bacteria, Chromista and Protozoa
|
||||
#' - All `r format_included_data_number(microorganisms[which(microorganisms$kingdom == "Fungi" & microorganisms$order %in% c("Eurotiales", "Microascales", "Mucorales", "Onygenales", "Pneumocystales", "Saccharomycetales", "Schizosaccharomycetales", "Tremellales")), ])` (sub)species from these orders of the kingdom of Fungi: Eurotiales, Microascales, Mucorales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales, as well as `r format_included_data_number(microorganisms[which(microorganisms$kingdom == "Fungi" & !microorganisms$order %in% c("Eurotiales", "Microascales", "Mucorales", "Onygenales", "Pneumocystales", "Saccharomycetales", "Schizosaccharomycetales", "Tremellales")), ])` other fungal (sub)species. The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, like mushrooms). Because of this, not all fungi fit the scope of this package and including everything would tremendously slow down our algorithms too. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (such as all species of *Aspergillus*, *Candida*, *Cryptococcus*, *Histplasma*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*).
|
||||
#' - All `r format_included_data_number(microorganisms[which(microorganisms$kingdom == "Animalia"), ])` (sub)species from `r format_included_data_number(microorganisms[which(microorganisms$kingdom == "Animalia"), "genus"])` other relevant genera from the kingdom of Animalia (such as *Strongyloides* and *Taenia*)
|
||||
#' - All `r format_included_data_number(microorganisms.old)` previously accepted names of all included (sub)species (these were taxonomically renamed)
|
||||
#' - The complete taxonomic tree of all included (sub)species: from kingdom to subspecies
|
||||
#' - The responsible author(s) and year of scientific publication
|
||||
#'
|
||||
#' The Catalogue of Life (<http://www.catalogueoflife.org>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.9 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
|
||||
#'
|
||||
#' The syntax used to transform the original data to a cleansed \R format, can be found here: <https://github.com/msberends/AMR/blob/master/data-raw/reproduction_of_microorganisms.R>.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @name catalogue_of_life
|
||||
#' @rdname catalogue_of_life
|
||||
#' @seealso Data set [microorganisms] for the actual data. \cr
|
||||
#' Function [as.mo()] to use the data for intelligent determination of microorganisms.
|
||||
#' @examples
|
||||
#' # Get version info of included data set
|
||||
#' catalogue_of_life_version()
|
||||
#'
|
||||
#'
|
||||
#' # Get a note when a species was renamed
|
||||
#' mo_shortname("Chlamydophila psittaci")
|
||||
#' # Note: 'Chlamydophila psittaci' (Everett et al., 1999) was renamed back to
|
||||
#' # 'Chlamydia psittaci' (Page, 1968)
|
||||
#' #> [1] "C. psittaci"
|
||||
#'
|
||||
#' # Get any property from the entire taxonomic tree for all included species
|
||||
#' mo_class("E. coli")
|
||||
#' #> [1] "Gammaproteobacteria"
|
||||
#'
|
||||
#' mo_family("E. coli")
|
||||
#' #> [1] "Enterobacteriaceae"
|
||||
#'
|
||||
#' mo_gramstain("E. coli") # based on kingdom and phylum, see ?mo_gramstain
|
||||
#' #> [1] "Gram-negative"
|
||||
#'
|
||||
#' mo_ref("E. coli")
|
||||
#' #> [1] "Castellani et al., 1919"
|
||||
#'
|
||||
#' # Do not get mistaken - this package is about microorganisms
|
||||
#' mo_kingdom("C. elegans")
|
||||
#' #> [1] "Fungi" # Fungi?!
|
||||
#' mo_name("C. elegans")
|
||||
#' #> [1] "Cladosporium elegans" # Because a microorganism was found
|
||||
NULL
|
||||
|
||||
#' Version info of included Catalogue of Life
|
||||
#'
|
||||
#' This function returns information about the included data from the Catalogue of Life.
|
||||
#' @seealso [microorganisms]
|
||||
#' @details For DSMZ, see [microorganisms].
|
||||
#' @return a [list], which prints in pretty format
|
||||
#' @inheritSection catalogue_of_life Catalogue of Life
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @export
|
||||
catalogue_of_life_version <- function() {
|
||||
|
||||
check_dataset_integrity()
|
||||
|
||||
# see the `catalogue_of_life` list in R/data.R
|
||||
lst <- list(catalogue_of_life =
|
||||
list(version = gsub("{year}", catalogue_of_life$year, catalogue_of_life$version, fixed = TRUE),
|
||||
url = gsub("{year}", catalogue_of_life$year, catalogue_of_life$url_CoL, fixed = TRUE),
|
||||
n = nrow(pm_filter(microorganisms, source == "CoL"))),
|
||||
deutsche_sammlung_von_mikroorganismen_und_zellkulturen =
|
||||
list(version = "Prokaryotic Nomenclature Up-to-Date from DSMZ",
|
||||
url = catalogue_of_life$url_DSMZ,
|
||||
yearmonth = catalogue_of_life$yearmonth_DSMZ,
|
||||
n = nrow(pm_filter(microorganisms, source == "DSMZ"))),
|
||||
total_included =
|
||||
list(
|
||||
n_total_species = nrow(microorganisms),
|
||||
n_total_synonyms = nrow(microorganisms.old)))
|
||||
|
||||
set_clean_class(lst,
|
||||
new_class = c("catalogue_of_life_version", "list"))
|
||||
}
|
||||
|
||||
#' @method print catalogue_of_life_version
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.catalogue_of_life_version <- function(x, ...) {
|
||||
lst <- x
|
||||
cat(paste0(font_bold("Included in this AMR package are:\n\n"),
|
||||
font_underline(lst$catalogue_of_life$version), "\n",
|
||||
" Available at: ", lst$catalogue_of_life$url, "\n",
|
||||
" Number of included species: ", format(lst$catalogue_of_life$n, big.mark = ","), "\n",
|
||||
font_underline(paste0(lst$deutsche_sammlung_von_mikroorganismen_und_zellkulturen$version, " (",
|
||||
lst$deutsche_sammlung_von_mikroorganismen_und_zellkulturen$yearmonth, ")")), "\n",
|
||||
" Available at: ", lst$deutsche_sammlung_von_mikroorganismen_und_zellkulturen$url, "\n",
|
||||
" Number of included species: ", format(lst$deutsche_sammlung_von_mikroorganismen_und_zellkulturen$n, big.mark = ","), "\n\n",
|
||||
"=> Total number of species included: ", format(lst$total_included$n_total_species, big.mark = ","), "\n",
|
||||
"=> Total number of synonyms included: ", format(lst$total_included$n_total_synonyms, big.mark = ","), "\n\n",
|
||||
"See for more info ?microorganisms and ?catalogue_of_life.\n"))
|
||||
}
|
||||
@@ -1,205 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Count available isolates
|
||||
#'
|
||||
#' @description These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in `summarise()` from the `dplyr` package and also support grouped variables, please see *Examples*.
|
||||
#'
|
||||
#' [count_resistant()] should be used to count resistant isolates, [count_susceptible()] should be used to count susceptible isolates.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [as.rsi()] if needed.
|
||||
#' @inheritParams proportion
|
||||
#' @inheritSection as.rsi Interpretation of R and S/I
|
||||
#' @details These functions are meant to count isolates. Use the [resistance()]/[susceptibility()] functions to calculate microbial resistance/susceptibility.
|
||||
#'
|
||||
#' The function [count_resistant()] is equal to the function [count_R()]. The function [count_susceptible()] is equal to the function [count_SI()].
|
||||
#'
|
||||
#' The function [n_rsi()] is an alias of [count_all()]. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to `n_distinct()`. Their function is equal to `count_susceptible(...) + count_resistant(...)`.
|
||||
#'
|
||||
#' The function [count_df()] takes any variable from `data` that has an [`rsi`] class (created with [as.rsi()]) and counts the number of S's, I's and R's. It also supports grouped variables. The function [rsi_df()] works exactly like [count_df()], but adds the percentage of S, I and R.
|
||||
#' @inheritSection proportion Combination therapy
|
||||
#' @seealso [`proportion_*`][proportion] to calculate microbial resistance and susceptibility.
|
||||
#' @return An [integer]
|
||||
#' @rdname count
|
||||
#' @name count
|
||||
#' @export
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # example_isolates is a data set available in the AMR package.
|
||||
#' ?example_isolates
|
||||
#'
|
||||
#' count_resistant(example_isolates$AMX) # counts "R"
|
||||
#' count_susceptible(example_isolates$AMX) # counts "S" and "I"
|
||||
#' count_all(example_isolates$AMX) # counts "S", "I" and "R"
|
||||
#'
|
||||
#' # be more specific
|
||||
#' count_S(example_isolates$AMX)
|
||||
#' count_SI(example_isolates$AMX)
|
||||
#' count_I(example_isolates$AMX)
|
||||
#' count_IR(example_isolates$AMX)
|
||||
#' count_R(example_isolates$AMX)
|
||||
#'
|
||||
#' # Count all available isolates
|
||||
#' count_all(example_isolates$AMX)
|
||||
#' n_rsi(example_isolates$AMX)
|
||||
#'
|
||||
#' # n_rsi() is an alias of count_all().
|
||||
#' # Since it counts all available isolates, you can
|
||||
#' # calculate back to count e.g. susceptible isolates.
|
||||
#' # These results are the same:
|
||||
#' count_susceptible(example_isolates$AMX)
|
||||
#' susceptibility(example_isolates$AMX) * n_rsi(example_isolates$AMX)
|
||||
#'
|
||||
#'
|
||||
#' if (require("dplyr")) {
|
||||
#' example_isolates %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(R = count_R(CIP),
|
||||
#' I = count_I(CIP),
|
||||
#' S = count_S(CIP),
|
||||
#' n1 = count_all(CIP), # the actual total; sum of all three
|
||||
#' n2 = n_rsi(CIP), # same - analogous to n_distinct
|
||||
#' total = n()) # NOT the number of tested isolates!
|
||||
#'
|
||||
#' # Count co-resistance between amoxicillin/clav acid and gentamicin,
|
||||
#' # so we can see that combination therapy does a lot more than mono therapy.
|
||||
#' # Please mind that `susceptibility()` calculates percentages right away instead.
|
||||
#' example_isolates %>% count_susceptible(AMC) # 1433
|
||||
#' example_isolates %>% count_all(AMC) # 1879
|
||||
#'
|
||||
#' example_isolates %>% count_susceptible(GEN) # 1399
|
||||
#' example_isolates %>% count_all(GEN) # 1855
|
||||
#'
|
||||
#' example_isolates %>% count_susceptible(AMC, GEN) # 1764
|
||||
#' example_isolates %>% count_all(AMC, GEN) # 1936
|
||||
#'
|
||||
#' # Get number of S+I vs. R immediately of selected columns
|
||||
#' example_isolates %>%
|
||||
#' select(AMX, CIP) %>%
|
||||
#' count_df(translate = FALSE)
|
||||
#'
|
||||
#' # It also supports grouping variables
|
||||
#' example_isolates %>%
|
||||
#' select(hospital_id, AMX, CIP) %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' count_df(translate = FALSE)
|
||||
#' }
|
||||
count_resistant <- function(..., only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = "R",
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname count
|
||||
#' @export
|
||||
count_susceptible <- function(..., only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = c("S", "I"),
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname count
|
||||
#' @export
|
||||
count_R <- function(..., only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = "R",
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname count
|
||||
#' @export
|
||||
count_IR <- function(..., only_all_tested = FALSE) {
|
||||
if (message_not_thrown_before("count_IR")) {
|
||||
warning_("Using count_IR() is discouraged; use count_resistant() instead to not consider \"I\" being resistant.", call = FALSE)
|
||||
remember_thrown_message("count_IR")
|
||||
}
|
||||
rsi_calc(...,
|
||||
ab_result = c("I", "R"),
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname count
|
||||
#' @export
|
||||
count_I <- function(..., only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = "I",
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname count
|
||||
#' @export
|
||||
count_SI <- function(..., only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = c("S", "I"),
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname count
|
||||
#' @export
|
||||
count_S <- function(..., only_all_tested = FALSE) {
|
||||
if (message_not_thrown_before("count_S")) {
|
||||
warning_("Using count_S() is discouraged; use count_susceptible() instead to also consider \"I\" being susceptible.", call = FALSE)
|
||||
remember_thrown_message("count_S")
|
||||
}
|
||||
rsi_calc(...,
|
||||
ab_result = "S",
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname count
|
||||
#' @export
|
||||
count_all <- function(..., only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = c("S", "I", "R"),
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname count
|
||||
#' @export
|
||||
n_rsi <- count_all
|
||||
|
||||
#' @rdname count
|
||||
#' @export
|
||||
count_df <- function(data,
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE) {
|
||||
rsi_calc_df(type = "count",
|
||||
data = data,
|
||||
translate_ab = translate_ab,
|
||||
language = language,
|
||||
combine_SI = combine_SI,
|
||||
combine_IR = combine_IR,
|
||||
combine_SI_missing = missing(combine_SI))
|
||||
}
|
||||
@@ -1,296 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Data sets with `r format(nrow(antibiotics) + nrow(antivirals), big.mark = ",")` antimicrobials
|
||||
#'
|
||||
#' Two data sets containing all antibiotics/antimycotics and antivirals. Use [as.ab()] or one of the [`ab_*`][ab_property()] functions to retrieve values from the [antibiotics] data set. Three identifiers are included in this data set: an antibiotic ID (`ab`, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (`atc`) as defined by the WHO, and a Compound ID (`cid`) as found in PubChem. Other properties in this data set are derived from one or more of these codes.
|
||||
#' @format
|
||||
#' ### For the [antibiotics] data set: a [data.frame] with `r nrow(antibiotics)` observations and `r ncol(antibiotics)` variables:
|
||||
#' - `ab`\cr Antibiotic ID as used in this package (such as `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available
|
||||
#' - `atc`\cr ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like `J01CR02`
|
||||
#' - `cid`\cr Compound ID as found in PubChem
|
||||
#' - `name`\cr Official name as used by WHONET/EARS-Net or the WHO
|
||||
#' - `group`\cr A short and concise group name, based on WHONET and WHOCC definitions
|
||||
#' - `atc_group1`\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like `"Macrolides, lincosamides and streptogramins"`
|
||||
#' - `atc_group2`\cr Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like `"Macrolides"`
|
||||
#' - `abbr`\cr List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)
|
||||
#' - `synonyms`\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID
|
||||
#' - `oral_ddd`\cr Defined Daily Dose (DDD), oral treatment
|
||||
#' - `oral_units`\cr Units of `oral_ddd`
|
||||
#' - `iv_ddd`\cr Defined Daily Dose (DDD), parenteral treatment
|
||||
#' - `iv_units`\cr Units of `iv_ddd`
|
||||
#' - `loinc`\cr All LOINC codes (Logical Observation Identifiers Names and Codes) associated with the name of the antimicrobial agent. Use [ab_loinc()] to retrieve them quickly, see [ab_property()].
|
||||
#'
|
||||
#' ### For the [antivirals] data set: a [data.frame] with `r nrow(antivirals)` observations and `r ncol(antivirals)` variables:
|
||||
#' - `atc`\cr ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC
|
||||
#' - `cid`\cr Compound ID as found in PubChem
|
||||
#' - `name`\cr Official name as used by WHONET/EARS-Net or the WHO
|
||||
#' - `atc_group`\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC
|
||||
#' - `synonyms`\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID
|
||||
#' - `oral_ddd`\cr Defined Daily Dose (DDD), oral treatment
|
||||
#' - `oral_units`\cr Units of `oral_ddd`
|
||||
#' - `iv_ddd`\cr Defined Daily Dose (DDD), parenteral treatment
|
||||
#' - `iv_units`\cr Units of `iv_ddd`
|
||||
#' @details Properties that are based on an ATC code are only available when an ATC is available. These properties are: `atc_group1`, `atc_group2`, `oral_ddd`, `oral_units`, `iv_ddd` and `iv_units`.
|
||||
#'
|
||||
#' Synonyms (i.e. trade names) are derived from the Compound ID (`cid`) and consequently only available where a CID is available.
|
||||
#'
|
||||
#' ### Direct download
|
||||
#' These data sets are available as 'flat files' for use even without \R - you can find the files here:
|
||||
#'
|
||||
#' * <https://github.com/msberends/AMR/raw/master/data-raw/antibiotics.txt>
|
||||
#' * <https://github.com/msberends/AMR/raw/master/data-raw/antivirals.txt>
|
||||
#'
|
||||
#' Files in \R format (with preserved data structure) can be found here:
|
||||
#'
|
||||
#' * <https://github.com/msberends/AMR/raw/master/data/antibiotics.rda>
|
||||
#' * <https://github.com/msberends/AMR/raw/master/data/antivirals.rda>
|
||||
#' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): <https://www.whocc.no/atc_ddd_index/>
|
||||
#'
|
||||
#' WHONET 2019 software: <http://www.whonet.org/software.html>
|
||||
#'
|
||||
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: <http://ec.europa.eu/health/documents/community-register/html/atc.htm>
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection WHOCC WHOCC
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @seealso [microorganisms], [intrinsic_resistant]
|
||||
"antibiotics"
|
||||
|
||||
#' @rdname antibiotics
|
||||
"antivirals"
|
||||
|
||||
#' Data set with `r format(nrow(microorganisms), big.mark = ",")` microorganisms
|
||||
#'
|
||||
#' A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using [as.mo()].
|
||||
#' @inheritSection catalogue_of_life Catalogue of Life
|
||||
#' @format A [data.frame] with `r format(nrow(microorganisms), big.mark = ",")` observations and `r ncol(microorganisms)` variables:
|
||||
#' - `mo`\cr ID of microorganism as used by this package
|
||||
#' - `fullname`\cr Full name, like `"Escherichia coli"`
|
||||
#' - `kingdom`, `phylum`, `class`, `order`, `family`, `genus`, `species`, `subspecies`\cr Taxonomic rank of the microorganism
|
||||
#' - `rank`\cr Text of the taxonomic rank of the microorganism, like `"species"` or `"genus"`
|
||||
#' - `ref`\cr Author(s) and year of concerning scientific publication
|
||||
#' - `species_id`\cr ID of the species as used by the Catalogue of Life
|
||||
#' - `source`\cr Either "CoL", "DSMZ" (see Source) or "manually added"
|
||||
#' - `prevalence`\cr Prevalence of the microorganism, see [as.mo()]
|
||||
#' - `snomed`\cr SNOMED code of the microorganism. Use [mo_snomed()] to retrieve it quickly, see [mo_property()].
|
||||
#' @details
|
||||
#' Please note that entries are only based on the Catalogue of Life and the LPSN (see below). Since these sources incorporate entries based on (recent) publications in the International Journal of Systematic and Evolutionary Microbiology (IJSEM), it can happen that the year of publication is sometimes later than one might expect.
|
||||
#'
|
||||
#' For example, *Staphylococcus pettenkoferi* was newly named in Diagnostic Microbiology and Infectious Disease in 2002 (PMID 12106949), but it was not before 2007 that a publication in IJSEM followed (PMID 17625191). Consequently, the AMR package returns 2007 for `mo_year("S. pettenkoferi")`.
|
||||
#'
|
||||
#' ### Manually additions
|
||||
#' For convenience, some entries were added manually:
|
||||
#'
|
||||
#' - 11 entries of *Streptococcus* (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)
|
||||
#' - 2 entries of *Staphylococcus* (coagulase-negative (CoNS) and coagulase-positive (CoPS))
|
||||
#' - 3 entries of *Trichomonas* (*Trichomonas vaginalis*, and its family and genus)
|
||||
#' - 1 entry of *Candida* (*Candida krusei*), that is not (yet) in the Catalogue of Life
|
||||
#' - 1 entry of *Blastocystis* (*Blastocystis hominis*), although it officially does not exist (Noel *et al.* 2005, PMID 15634993)
|
||||
#' - 5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)
|
||||
#' - 6 families under the Enterobacterales order, according to Adeolu *et al.* (2016, PMID 27620848), that are not (yet) in the Catalogue of Life
|
||||
#' - `r format(nrow(subset(microorganisms, source == "DSMZ")), big.mark = ",")` species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications
|
||||
#'
|
||||
#' ### Direct download
|
||||
#' This data set is available as 'flat file' for use even without \R - you can find the file here:
|
||||
#'
|
||||
#' * <https://github.com/msberends/AMR/raw/master/data-raw/microorganisms.txt>
|
||||
#'
|
||||
#' The file in \R format (with preserved data structure) can be found here:
|
||||
#'
|
||||
#' * <https://github.com/msberends/AMR/raw/master/data/microorganisms.rda>
|
||||
#' @section About the records from DSMZ (see source):
|
||||
#' Names of prokaryotes are defined as being validly published by the International Code of Nomenclature of Bacteria. Validly published are all names which are included in the Approved Lists of Bacterial Names and the names subsequently published in the International Journal of Systematic Bacteriology (IJSB) and, from January 2000, in the International Journal of Systematic and Evolutionary Microbiology (IJSEM) as original articles or in the validation lists.
|
||||
#' *(from <https://www.dsmz.de/services/online-tools/prokaryotic-nomenclature-up-to-date>)*
|
||||
#'
|
||||
#' In February 2020, the DSMZ records were merged with the List of Prokaryotic names with Standing in Nomenclature (LPSN).
|
||||
#' @source Catalogue of Life: Annual Checklist (public online taxonomic database), <http://www.catalogueoflife.org> (check included annual version with [catalogue_of_life_version()]).
|
||||
#'
|
||||
#' Parte, A.C. (2018). LPSN — List of Prokaryotic names with Standing in Nomenclature (bacterio.net), 20 years on. International Journal of Systematic and Evolutionary Microbiology, 68, 1825-1829; \doi{10.1099/ijsem.0.002786}
|
||||
#'
|
||||
#' Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, <https://www.dsmz.de/services/online-tools/prokaryotic-nomenclature-up-to-date> and <https://lpsn.dsmz.de> (check included version with [catalogue_of_life_version()]).
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @seealso [as.mo()], [mo_property()], [microorganisms.codes], [intrinsic_resistant]
|
||||
"microorganisms"
|
||||
|
||||
catalogue_of_life <- list(
|
||||
year = 2019,
|
||||
version = "Catalogue of Life: {year} Annual Checklist",
|
||||
url_CoL = "http://www.catalogueoflife.org/col/",
|
||||
url_DSMZ = "https://lpsn.dsmz.de",
|
||||
yearmonth_DSMZ = "May 2020"
|
||||
)
|
||||
|
||||
#' Data set with previously accepted taxonomic names
|
||||
#'
|
||||
#' A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by [as.mo()].
|
||||
#' @inheritSection catalogue_of_life Catalogue of Life
|
||||
#' @format A [data.frame] with `r format(nrow(microorganisms.old), big.mark = ",")` observations and `r ncol(microorganisms.old)` variables:
|
||||
#' - `fullname`\cr Old full taxonomic name of the microorganism
|
||||
#' - `fullname_new`\cr New full taxonomic name of the microorganism
|
||||
#' - `ref`\cr Author(s) and year of concerning scientific publication
|
||||
#' - `prevalence`\cr Prevalence of the microorganism, see [as.mo()]
|
||||
#' @source Catalogue of Life: Annual Checklist (public online taxonomic database), <http://www.catalogueoflife.org> (check included annual version with [catalogue_of_life_version()]).
|
||||
#'
|
||||
#' Parte, A.C. (2018). LPSN — List of Prokaryotic names with Standing in Nomenclature (bacterio.net), 20 years on. International Journal of Systematic and Evolutionary Microbiology, 68, 1825-1829; \doi{10.1099/ijsem.0.002786}
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @seealso [as.mo()] [mo_property()] [microorganisms]
|
||||
"microorganisms.old"
|
||||
|
||||
#' Data set with `r format(nrow(microorganisms.codes), big.mark = ",")` common microorganism codes
|
||||
#'
|
||||
#' A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with [set_mo_source()]. They will all be searched when using [as.mo()] and consequently all the [`mo_*`][mo_property()] functions.
|
||||
#' @format A [data.frame] with `r format(nrow(microorganisms.codes), big.mark = ",")` observations and `r ncol(microorganisms.codes)` variables:
|
||||
#' - `code`\cr Commonly used code of a microorganism
|
||||
#' - `mo`\cr ID of the microorganism in the [microorganisms] data set
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection catalogue_of_life Catalogue of Life
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @seealso [as.mo()] [microorganisms]
|
||||
"microorganisms.codes"
|
||||
|
||||
#' Data set with `r format(nrow(example_isolates), big.mark = ",")` example isolates
|
||||
#'
|
||||
#' A data set containing `r format(nrow(example_isolates), big.mark = ",")` microbial isolates with their full antibiograms. The data set reflects reality and can be used to practice AMR analysis. For examples, please read [the tutorial on our website](https://msberends.github.io/AMR/articles/AMR.html).
|
||||
#' @format A [data.frame] with `r format(nrow(example_isolates), big.mark = ",")` observations and `r ncol(example_isolates)` variables:
|
||||
#' - `date`\cr date of receipt at the laboratory
|
||||
#' - `hospital_id`\cr ID of the hospital, from A to D
|
||||
#' - `ward_icu`\cr logical to determine if ward is an intensive care unit
|
||||
#' - `ward_clinical`\cr logical to determine if ward is a regular clinical ward
|
||||
#' - `ward_outpatient`\cr logical to determine if ward is an outpatient clinic
|
||||
#' - `age`\cr age of the patient
|
||||
#' - `gender`\cr gender of the patient
|
||||
#' - `patient_id`\cr ID of the patient
|
||||
#' - `mo`\cr ID of microorganism created with [as.mo()], see also [microorganisms]
|
||||
#' - `PEN:RIF`\cr `r sum(vapply(FUN.VALUE = logical(1), example_isolates, is.rsi))` different antibiotics with class [`rsi`] (see [as.rsi()]); these column names occur in the [antibiotics] data set and can be translated with [ab_name()]
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
"example_isolates"
|
||||
|
||||
#' Data set with unclean data
|
||||
#'
|
||||
#' A data set containing `r format(nrow(example_isolates_unclean), big.mark = ",")` microbial isolates that are not cleaned up and consequently not ready for AMR analysis. This data set can be used for practice.
|
||||
#' @format A [data.frame] with `r format(nrow(example_isolates_unclean), big.mark = ",")` observations and `r ncol(example_isolates_unclean)` variables:
|
||||
#' - `patient_id`\cr ID of the patient
|
||||
#' - `date`\cr date of receipt at the laboratory
|
||||
#' - `hospital`\cr ID of the hospital, from A to C
|
||||
#' - `bacteria`\cr info about microorganism that can be transformed with [as.mo()], see also [microorganisms]
|
||||
#' - `AMX:GEN`\cr 4 different antibiotics that have to be transformed with [as.rsi()]
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
"example_isolates_unclean"
|
||||
|
||||
#' Data set with `r format(nrow(WHONET), big.mark = ",")` isolates - WHONET example
|
||||
#'
|
||||
#' This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The antibiotic results are from our [example_isolates] data set. All patient names are created using online surname generators and are only in place for practice purposes.
|
||||
#' @format A [data.frame] with `r format(nrow(WHONET), big.mark = ",")` observations and `r ncol(WHONET)` variables:
|
||||
#' - `Identification number`\cr ID of the sample
|
||||
#' - `Specimen number`\cr ID of the specimen
|
||||
#' - `Organism`\cr Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using [as.mo()].
|
||||
#' - `Country`\cr Country of origin
|
||||
#' - `Laboratory`\cr Name of laboratory
|
||||
#' - `Last name`\cr Fictitious last name of patient
|
||||
#' - `First name`\cr Fictitious initial of patient
|
||||
#' - `Sex`\cr Fictitious gender of patient
|
||||
#' - `Age`\cr Fictitious age of patient
|
||||
#' - `Age category`\cr Age group, can also be looked up using [age_groups()]
|
||||
#' - `Date of admission`\cr Date of hospital admission
|
||||
#' - `Specimen date`\cr Date when specimen was received at laboratory
|
||||
#' - `Specimen type`\cr Specimen type or group
|
||||
#' - `Specimen type (Numeric)`\cr Translation of `"Specimen type"`
|
||||
#' - `Reason`\cr Reason of request with Differential Diagnosis
|
||||
#' - `Isolate number`\cr ID of isolate
|
||||
#' - `Organism type`\cr Type of microorganism, can also be looked up using [mo_type()]
|
||||
#' - `Serotype`\cr Serotype of microorganism
|
||||
#' - `Beta-lactamase`\cr Microorganism produces beta-lactamase?
|
||||
#' - `ESBL`\cr Microorganism produces extended spectrum beta-lactamase?
|
||||
#' - `Carbapenemase`\cr Microorganism produces carbapenemase?
|
||||
#' - `MRSA screening test`\cr Microorganism is possible MRSA?
|
||||
#' - `Inducible clindamycin resistance`\cr Clindamycin can be induced?
|
||||
#' - `Comment`\cr Other comments
|
||||
#' - `Date of data entry`\cr Date this data was entered in WHONET
|
||||
#' - `AMP_ND10:CIP_EE`\cr `r sum(vapply(FUN.VALUE = logical(1), WHONET, is.rsi))` different antibiotics. You can lookup the abbreviations in the [antibiotics] data set, or use e.g. [`ab_name("AMP")`][ab_name()] to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using [as.rsi()].
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
"WHONET"
|
||||
|
||||
#' Data set for R/SI interpretation
|
||||
#'
|
||||
#' Data set to interpret MIC and disk diffusion to R/SI values. Included guidelines are CLSI (`r min(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "CLSI")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "CLSI")$guideline)))`) and EUCAST (`r min(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "EUCAST")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(rsi_translation, guideline %like% "EUCAST")$guideline)))`). Use [as.rsi()] to transform MICs or disks measurements to R/SI values.
|
||||
#' @format A [data.frame] with `r format(nrow(rsi_translation), big.mark = ",")` observations and `r ncol(rsi_translation)` variables:
|
||||
#' - `guideline`\cr Name of the guideline
|
||||
#' - `method`\cr Either "MIC" or "DISK"
|
||||
#' - `site`\cr Body site, e.g. "Oral" or "Respiratory"
|
||||
#' - `mo`\cr Microbial ID, see [as.mo()]
|
||||
#' - `ab`\cr Antibiotic ID, see [as.ab()]
|
||||
#' - `ref_tbl`\cr Info about where the guideline rule can be found
|
||||
#' - `disk_dose`\cr Dose of the used disk diffusion method
|
||||
#' - `breakpoint_S`\cr Lowest MIC value or highest number of millimetres that leads to "S"
|
||||
#' - `breakpoint_R`\cr Highest MIC value or lowest number of millimetres that leads to "R"
|
||||
#' - `uti`\cr A logical value (`TRUE`/`FALSE`) to indicate whether the rule applies to a urinary tract infection (UTI)
|
||||
#' @details The repository of this `AMR` package contains a file comprising this exact data set: <https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt>. This file **allows for machine reading EUCAST and CLSI guidelines**, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. The file is updated automatically.
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @seealso [intrinsic_resistant]
|
||||
"rsi_translation"
|
||||
|
||||
#' Data set with bacterial intrinsic resistance
|
||||
#'
|
||||
#' Data set containing defined intrinsic resistance by EUCAST of all bug-drug combinations.
|
||||
#' @format A [data.frame] with `r format(nrow(intrinsic_resistant), big.mark = ",")` observations and `r ncol(intrinsic_resistant)` variables:
|
||||
#' - `microorganism`\cr Name of the microorganism
|
||||
#' - `antibiotic`\cr Name of the antibiotic drug
|
||||
#' @details The repository of this `AMR` package contains a file comprising this exact data set: <https://github.com/msberends/AMR/blob/master/data-raw/intrinsic_resistant.txt>. This file **allows for machine reading EUCAST guidelines about intrinsic resistance**, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically.
|
||||
#'
|
||||
#' This data set is based on `r format_eucast_version_nr(3.2)`.
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' if (require("dplyr")) {
|
||||
#' intrinsic_resistant %>%
|
||||
#' filter(antibiotic == "Vancomycin", microorganism %like% "Enterococcus") %>%
|
||||
#' pull(microorganism)
|
||||
#' # [1] "Enterococcus casseliflavus" "Enterococcus gallinarum"
|
||||
#' }
|
||||
"intrinsic_resistant"
|
||||
|
||||
#' Data set with treatment dosages as defined by EUCAST
|
||||
#'
|
||||
#' EUCAST breakpoints used in this package are based on the dosages in this data set. They can be retrieved with [eucast_dosage()].
|
||||
#' @format A [data.frame] with `r format(nrow(dosage), big.mark = ",")` observations and `r ncol(dosage)` variables:
|
||||
#' - `ab`\cr Antibiotic ID as used in this package (such as `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available
|
||||
#' - `name`\cr Official name of the antimicrobial agent as used by WHONET/EARS-Net or the WHO
|
||||
#' - `type`\cr Type of the dosage, either `r vector_or(dosage$type)`
|
||||
#' - `dose`\cr Dose, such as "2 g" or "25 mg/kg"
|
||||
#' - `dose_times`\cr Number of times a dose must be administered
|
||||
#' - `administration`\cr Route of administration, either `r vector_or(dosage$administration)`
|
||||
#' - `notes`\cr Additional dosage notes
|
||||
#' - `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
|
||||
#' @details `r format_eucast_version_nr(11.0)` are based on the dosages in this data set.
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
"dosage"
|
||||
@@ -1,47 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Deprecated functions
|
||||
#'
|
||||
#' These functions are so-called '[Deprecated]'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one).
|
||||
#' @inheritSection lifecycle Retired lifecycle
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @keywords internal
|
||||
#' @name AMR-deprecated
|
||||
#' @export
|
||||
p_symbol <- function(p, emptychar = " ") {
|
||||
.Deprecated(package = "AMR", new = "cleaner::p_symbol")
|
||||
|
||||
p <- as.double(p)
|
||||
s <- rep(NA_character_, length(p))
|
||||
|
||||
s[p <= 1] <- emptychar
|
||||
s[p <= 0.100] <- "."
|
||||
s[p <= 0.050] <- "*"
|
||||
s[p <= 0.010] <- "**"
|
||||
s[p <= 0.001] <- "***"
|
||||
|
||||
s
|
||||
}
|
||||
@@ -1,235 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Transform input to disk diffusion diameters
|
||||
#'
|
||||
#' This transforms a vector to a new class [`disk`], which is a disk diffusion growth zone size (around an antibiotic disk) in millimetres between 6 and 50.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @rdname as.disk
|
||||
#' @param x vector
|
||||
#' @param na.rm a logical indicating whether missing values should be removed
|
||||
#' @details Interpret disk values as RSI values with [as.rsi()]. It supports guidelines from EUCAST and CLSI.
|
||||
#' @return An [integer] with additional class [`disk`]
|
||||
#' @aliases disk
|
||||
#' @export
|
||||
#' @seealso [as.rsi()]
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' \donttest{
|
||||
#' # transform existing disk zones to the `disk` class
|
||||
#' df <- data.frame(microorganism = "E. coli",
|
||||
#' AMP = 20,
|
||||
#' CIP = 14,
|
||||
#' GEN = 18,
|
||||
#' TOB = 16)
|
||||
#' df[, 2:5] <- lapply(df[, 2:5], as.disk)
|
||||
#' # same with dplyr:
|
||||
#' # df %>% mutate(across(AMP:TOB, as.disk))
|
||||
#'
|
||||
#' # interpret disk values, see ?as.rsi
|
||||
#' as.rsi(x = as.disk(18),
|
||||
#' mo = "Strep pneu", # `mo` will be coerced with as.mo()
|
||||
#' ab = "ampicillin", # and `ab` with as.ab()
|
||||
#' guideline = "EUCAST")
|
||||
#'
|
||||
#' as.rsi(df)
|
||||
#' }
|
||||
as.disk <- function(x, na.rm = FALSE) {
|
||||
meet_criteria(x, allow_class = c("disk", "character", "numeric", "integer"), allow_NA = TRUE)
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
|
||||
if (!is.disk(x)) {
|
||||
x <- x %pm>% unlist()
|
||||
if (na.rm == TRUE) {
|
||||
x <- x[!is.na(x)]
|
||||
}
|
||||
x.bak <- x
|
||||
|
||||
na_before <- length(x[is.na(x)])
|
||||
|
||||
# heavily based on cleaner::clean_double():
|
||||
clean_double2 <- function(x, remove = "[^0-9.,-]", fixed = FALSE) {
|
||||
x <- gsub(",", ".", x)
|
||||
# remove ending dot/comma
|
||||
x <- gsub("[,.]$", "", x)
|
||||
# only keep last dot/comma
|
||||
reverse <- function(x) vapply(FUN.VALUE = character(1), lapply(strsplit(x, NULL), rev), paste, collapse = "")
|
||||
x <- sub("{{dot}}", ".",
|
||||
gsub(".", "",
|
||||
reverse(sub(".", "}}tod{{",
|
||||
reverse(x),
|
||||
fixed = TRUE)),
|
||||
fixed = TRUE),
|
||||
fixed = TRUE)
|
||||
x_clean <- gsub(remove, "", x, ignore.case = TRUE, fixed = fixed)
|
||||
# remove everything that is not a number or dot
|
||||
as.numeric(gsub("[^0-9.]+", "", x_clean))
|
||||
}
|
||||
|
||||
# round up and make it an integer
|
||||
x <- as.integer(ceiling(clean_double2(x)))
|
||||
|
||||
# disks can never be less than 6 mm (size of smallest disk) or more than 50 mm
|
||||
x[x < 6 | x > 50] <- NA_integer_
|
||||
na_after <- length(x[is.na(x)])
|
||||
|
||||
if (na_before != na_after) {
|
||||
list_missing <- x.bak[is.na(x) & !is.na(x.bak)] %pm>%
|
||||
unique() %pm>%
|
||||
sort()
|
||||
list_missing <- paste0('"', list_missing, '"', collapse = ", ")
|
||||
warning_(na_after - na_before, " results truncated (",
|
||||
round(((na_after - na_before) / length(x)) * 100),
|
||||
"%) that were invalid disk zones: ",
|
||||
list_missing, call = FALSE)
|
||||
}
|
||||
}
|
||||
set_clean_class(as.integer(x),
|
||||
new_class = c("disk", "integer"))
|
||||
}
|
||||
|
||||
all_valid_disks <- function(x) {
|
||||
if (!inherits(x, c("disk", "character", "numeric", "integer"))) {
|
||||
return(FALSE)
|
||||
}
|
||||
x_disk <- tryCatch(suppressWarnings(as.disk(x[!is.na(x)])),
|
||||
error = function(e) NA)
|
||||
!any(is.na(x_disk)) && !all(is.na(x))
|
||||
}
|
||||
|
||||
#' @rdname as.disk
|
||||
#' @export
|
||||
is.disk <- function(x) {
|
||||
inherits(x, "disk")
|
||||
}
|
||||
|
||||
# will be exported using s3_register() in R/zzz.R
|
||||
pillar_shaft.disk <- function(x, ...) {
|
||||
out <- trimws(format(x))
|
||||
out[is.na(x)] <- font_na(NA)
|
||||
create_pillar_column(out, align = "right", width = 2)
|
||||
}
|
||||
|
||||
# will be exported using s3_register() in R/zzz.R
|
||||
type_sum.disk <- function(x, ...) {
|
||||
"disk"
|
||||
}
|
||||
|
||||
#' @method print disk
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.disk <- function(x, ...) {
|
||||
cat("Class <disk>\n")
|
||||
print(as.integer(x), quote = FALSE)
|
||||
}
|
||||
|
||||
#' @method plot disk
|
||||
#' @export
|
||||
#' @importFrom graphics barplot axis
|
||||
#' @rdname plot
|
||||
plot.disk <- function(x,
|
||||
main = paste("Disk zones values of", deparse(substitute(x))),
|
||||
ylab = "Frequency",
|
||||
xlab = "Disk diffusion (mm)",
|
||||
axes = FALSE,
|
||||
...) {
|
||||
meet_criteria(main, allow_class = "character", has_length = 1)
|
||||
meet_criteria(ylab, allow_class = "character", has_length = 1)
|
||||
meet_criteria(xlab, allow_class = "character", has_length = 1)
|
||||
meet_criteria(axes, allow_class = "logical", has_length = 1)
|
||||
|
||||
barplot(table(x),
|
||||
ylab = ylab,
|
||||
xlab = xlab,
|
||||
axes = axes,
|
||||
main = main,
|
||||
...)
|
||||
axis(2, seq(0, max(table(x))))
|
||||
}
|
||||
|
||||
#' @method [ disk
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[.disk" <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
#' @method [[ disk
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[[.disk" <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
#' @method [<- disk
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[<-.disk" <- function(i, j, ..., value) {
|
||||
value <- as.disk(value)
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(i)
|
||||
y
|
||||
}
|
||||
#' @method [[<- disk
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[[<-.disk" <- function(i, j, ..., value) {
|
||||
value <- as.disk(value)
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(i)
|
||||
y
|
||||
}
|
||||
#' @method c disk
|
||||
#' @export
|
||||
#' @noRd
|
||||
c.disk <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
y <- as.disk(y)
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
|
||||
#' @method unique disk
|
||||
#' @export
|
||||
#' @noRd
|
||||
unique.disk <- function(x, incomparables = FALSE, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
|
||||
# will be exported using s3_register() in R/zzz.R
|
||||
get_skimmers.disk <- function(column) {
|
||||
skimr::sfl(
|
||||
skim_type = "disk",
|
||||
min = ~min(as.double(.), na.rm = TRUE),
|
||||
max = ~max(as.double(.), na.rm = TRUE),
|
||||
median = ~stats::median(as.double(.), na.rm = TRUE),
|
||||
n_unique = ~pm_n_distinct(., na.rm = TRUE),
|
||||
hist = ~skimr::inline_hist(stats::na.omit(as.double(.)))
|
||||
)
|
||||
}
|
||||
-182
@@ -1,182 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Determine (new) episodes for patients
|
||||
#'
|
||||
#' These functions determine which items in a vector can be considered (the start of) a new episode, based on the argument `episode_days`. This can be used to determine clinical episodes for any epidemiological analysis. The [get_episode()] function returns the index number of the episode per group, while the [is_new_episode()] function returns values `TRUE`/`FALSE` to indicate whether an item in a vector is the start of a new episode.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x vector of dates (class `Date` or `POSIXt`)
|
||||
#' @param episode_days length of the required episode in days, please see *Details*
|
||||
#' @param ... arguments passed on to [as.Date()]
|
||||
#' @details
|
||||
#' Dates are first sorted from old to new. The oldest date will mark the start of the first episode. After this date, the next date will be marked that is at least `episode_days` days later than the start of the first episode. From that second marked date on, the next date will be marked that is at least `episode_days` days later than the start of the second episode which will be the start of the third episode, and so on. Before the vector is being returned, the original order will be restored.
|
||||
#'
|
||||
#' The [first_isolate()] function is a wrapper around the [is_new_episode()] function, but is more efficient for data sets containing microorganism codes or names.
|
||||
#'
|
||||
#' The `dplyr` package is not required for these functions to work, but these functions support [variable grouping][dplyr::group_by()] and work conveniently inside `dplyr` verbs such as [`filter()`][dplyr::filter()], [`mutate()`][dplyr::mutate()] and [`summarise()`][dplyr::summarise()].
|
||||
#' @return
|
||||
#' * [get_episode()]: a [double] vector
|
||||
#' * [is_new_episode()]: a [logical] vector
|
||||
#' @seealso [first_isolate()]
|
||||
#' @rdname get_episode
|
||||
#' @export
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # `example_isolates` is a dataset available in the AMR package.
|
||||
#' # See ?example_isolates.
|
||||
#'
|
||||
#' get_episode(example_isolates$date, episode_days = 60)
|
||||
#' is_new_episode(example_isolates$date, episode_days = 60)
|
||||
#'
|
||||
#' # filter on results from the third 60-day episode only, using base R
|
||||
#' example_isolates[which(get_episode(example_isolates$date, 60) == 3), ]
|
||||
#'
|
||||
#' \donttest{
|
||||
#' if (require("dplyr")) {
|
||||
#' # is_new_episode() can also be used in dplyr verbs to determine patient
|
||||
#' # episodes based on any (combination of) grouping variables:
|
||||
#' example_isolates %>%
|
||||
#' mutate(condition = sample(x = c("A", "B", "C"),
|
||||
#' size = 2000,
|
||||
#' replace = TRUE)) %>%
|
||||
#' group_by(condition) %>%
|
||||
#' mutate(new_episode = is_new_episode(date, 365))
|
||||
#'
|
||||
#' example_isolates %>%
|
||||
#' group_by(hospital_id, patient_id) %>%
|
||||
#' transmute(date,
|
||||
#' patient_id,
|
||||
#' new_index = get_episode(date, 60),
|
||||
#' new_logical = is_new_episode(date, 60))
|
||||
#'
|
||||
#'
|
||||
#' example_isolates %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(patients = n_distinct(patient_id),
|
||||
#' n_episodes_365 = sum(is_new_episode(date, episode_days = 365)),
|
||||
#' n_episodes_60 = sum(is_new_episode(date, episode_days = 60)),
|
||||
#' n_episodes_30 = sum(is_new_episode(date, episode_days = 30)))
|
||||
#'
|
||||
#'
|
||||
#' # grouping on patients and microorganisms leads to the same results
|
||||
#' # as first_isolate():
|
||||
#' x <- example_isolates %>%
|
||||
#' filter(first_isolate(., include_unknown = TRUE))
|
||||
#'
|
||||
#' y <- example_isolates %>%
|
||||
#' group_by(patient_id, mo) %>%
|
||||
#' filter(is_new_episode(date, 365))
|
||||
#'
|
||||
#' identical(x$patient_id, y$patient_id)
|
||||
#'
|
||||
#' # but is_new_episode() has a lot more flexibility than first_isolate(),
|
||||
#' # since you can now group on anything that seems relevant:
|
||||
#' example_isolates %>%
|
||||
#' group_by(patient_id, mo, hospital_id, ward_icu) %>%
|
||||
#' mutate(flag_episode = is_new_episode(date, 365))
|
||||
#' }
|
||||
#' }
|
||||
get_episode <- function(x, episode_days, ...) {
|
||||
meet_criteria(x, allow_class = c("Date", "POSIXt"))
|
||||
meet_criteria(episode_days, allow_class = c("numeric", "double", "integer"), has_length = 1)
|
||||
|
||||
exec_episode(type = "sequential",
|
||||
x = x,
|
||||
episode_days = episode_days,
|
||||
... = ...)
|
||||
}
|
||||
|
||||
#' @rdname get_episode
|
||||
#' @export
|
||||
is_new_episode <- function(x, episode_days, ...) {
|
||||
meet_criteria(x, allow_class = c("Date", "POSIXt"))
|
||||
meet_criteria(episode_days, allow_class = c("numeric", "double", "integer"), has_length = 1)
|
||||
|
||||
exec_episode(type = "logical",
|
||||
x = x,
|
||||
episode_days = episode_days,
|
||||
... = ...)
|
||||
}
|
||||
|
||||
exec_episode <- function(type, x, episode_days, ...) {
|
||||
x <- as.double(as.Date(x, ...)) # as.Date() for POSIX classes
|
||||
if (length(x) == 1) {
|
||||
if (type == "logical") {
|
||||
return(TRUE)
|
||||
} else if (type == "sequential") {
|
||||
return(1)
|
||||
}
|
||||
} else if (length(x) == 2) {
|
||||
if (max(x) - min(x) >= episode_days) {
|
||||
if (type == "logical") {
|
||||
return(c(TRUE, TRUE))
|
||||
} else if (type == "sequential") {
|
||||
return(c(1, 2))
|
||||
}
|
||||
} else {
|
||||
if (type == "logical") {
|
||||
return(c(TRUE, FALSE))
|
||||
} else if (type == "sequential") {
|
||||
return(c(1, 1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# I asked on StackOverflow:
|
||||
# https://stackoverflow.com/questions/42122245/filter-one-row-every-year
|
||||
exec <- function(x, episode_days) {
|
||||
indices <- integer()
|
||||
start <- x[1]
|
||||
ind <- 1
|
||||
indices[1] <- 1
|
||||
for (i in 2:length(x)) {
|
||||
if (isTRUE((x[i] - start) >= episode_days)) {
|
||||
ind <- ind + 1
|
||||
if (type == "logical") {
|
||||
indices[ind] <- i
|
||||
}
|
||||
start <- x[i]
|
||||
}
|
||||
if (type == "sequential") {
|
||||
indices[i] <- ind
|
||||
}
|
||||
}
|
||||
if (type == "logical") {
|
||||
result <- rep(FALSE, length(x))
|
||||
result[indices] <- TRUE
|
||||
result
|
||||
} else if (type == "sequential") {
|
||||
indices
|
||||
}
|
||||
}
|
||||
|
||||
df <- data.frame(x = x,
|
||||
y = seq_len(length(x))) %pm>%
|
||||
pm_arrange(x)
|
||||
df$new <- exec(df$x, episode_days)
|
||||
df %pm>%
|
||||
pm_arrange(y) %pm>%
|
||||
pm_pull(new)
|
||||
}
|
||||
-1195
File diff suppressed because it is too large
Load Diff
@@ -1,385 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Filter isolates on result in antimicrobial class
|
||||
#'
|
||||
#' Filter isolates on results in specific antimicrobial classes. This makes it easy to filter on isolates that were tested for e.g. any aminoglycoside, or to filter on carbapenem-resistant isolates without the need to specify the drugs.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x a data set
|
||||
#' @param ab_class an antimicrobial class, like `"carbapenems"`. The columns `group`, `atc_group1` and `atc_group2` of the [antibiotics] data set will be searched (case-insensitive) for this value.
|
||||
#' @param result an antibiotic result: S, I or R (or a combination of more of them)
|
||||
#' @param scope the scope to check which variables to check, can be `"any"` (default) or `"all"`
|
||||
#' @param ... previously used when this package still depended on the `dplyr` package, now ignored
|
||||
#' @details All columns of `x` will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.). This means that a filter function like e.g. [filter_aminoglycosides()] will include column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
|
||||
#' @rdname filter_ab_class
|
||||
#' @seealso [antibiotic_class_selectors()] for the `select()` equivalent.
|
||||
#' @export
|
||||
#' @examples
|
||||
#' filter_aminoglycosides(example_isolates)
|
||||
#'
|
||||
#' \donttest{
|
||||
#' if (require("dplyr")) {
|
||||
#'
|
||||
#' # filter on isolates that have any result for any aminoglycoside
|
||||
#' example_isolates %>% filter_aminoglycosides()
|
||||
#' example_isolates %>% filter_ab_class("aminoglycoside")
|
||||
#'
|
||||
#' # this is essentially the same as (but without determination of column names):
|
||||
#' example_isolates %>%
|
||||
#' filter_at(.vars = vars(c("GEN", "TOB", "AMK", "KAN")),
|
||||
#' .vars_predicate = any_vars(. %in% c("S", "I", "R")))
|
||||
#'
|
||||
#'
|
||||
#' # filter on isolates that show resistance to ANY aminoglycoside
|
||||
#' example_isolates %>% filter_aminoglycosides("R", "any")
|
||||
#'
|
||||
#' # filter on isolates that show resistance to ALL aminoglycosides
|
||||
#' example_isolates %>% filter_aminoglycosides("R", "all")
|
||||
#'
|
||||
#' # filter on isolates that show resistance to
|
||||
#' # any aminoglycoside and any fluoroquinolone
|
||||
#' example_isolates %>%
|
||||
#' filter_aminoglycosides("R") %>%
|
||||
#' filter_fluoroquinolones("R")
|
||||
#'
|
||||
#' # filter on isolates that show resistance to
|
||||
#' # all aminoglycosides and all fluoroquinolones
|
||||
#' example_isolates %>%
|
||||
#' filter_aminoglycosides("R", "all") %>%
|
||||
#' filter_fluoroquinolones("R", "all")
|
||||
#'
|
||||
#' # with dplyr 1.0.0 and higher (that adds 'across()'), this is all equal:
|
||||
#' # (though the row names on the first are more correct)
|
||||
#' example_isolates %>% filter_carbapenems("R", "all")
|
||||
#' example_isolates %>% filter(across(carbapenems(), ~. == "R"))
|
||||
#' example_isolates %>% filter(across(carbapenems(), function(x) x == "R"))
|
||||
#' }
|
||||
#' }
|
||||
filter_ab_class <- function(x,
|
||||
ab_class,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
.call_depth <- list(...)$`.call_depth`
|
||||
if (is.null(.call_depth)) {
|
||||
.call_depth <- 0
|
||||
}
|
||||
meet_criteria(x, allow_class = "data.frame", .call_depth = .call_depth)
|
||||
meet_criteria(ab_class, allow_class = "character", has_length = 1, .call_depth = .call_depth)
|
||||
meet_criteria(result, allow_class = "character", has_length = c(1, 2, 3), allow_NULL = TRUE, .call_depth = .call_depth)
|
||||
meet_criteria(scope, allow_class = "character", has_length = 1, is_in = c("all", "any"), .call_depth = .call_depth)
|
||||
|
||||
check_dataset_integrity()
|
||||
|
||||
# save to return later
|
||||
x_class <- class(x)
|
||||
x.bak <- x
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
|
||||
if (is.null(result)) {
|
||||
result <- c("S", "I", "R")
|
||||
}
|
||||
# make result = "SI" works too:
|
||||
result <- unlist(strsplit(result, ""))
|
||||
|
||||
stop_ifnot(all(result %in% c("S", "I", "R")), "`result` must be one or more of: 'S', 'I', 'R'")
|
||||
stop_ifnot(all(scope %in% c("any", "all")), "`scope` must be one of: 'any', 'all'")
|
||||
|
||||
# get all columns in data with names that resemble antibiotics
|
||||
ab_in_data <- get_column_abx(x, info = FALSE)
|
||||
if (length(ab_in_data) == 0) {
|
||||
message_("No columns with class <rsi> found (see ?as.rsi), data left unchanged.")
|
||||
return(x.bak)
|
||||
}
|
||||
# get reference data
|
||||
ab_class.bak <- ab_class
|
||||
ab_class <- gsub("[^a-zA-Z0-9]+", ".*", ab_class)
|
||||
ab_class <- gsub("(ph|f)", "(ph|f)", ab_class)
|
||||
ab_class <- gsub("(t|th)", "(t|th)", ab_class)
|
||||
ab_reference <- subset(antibiotics,
|
||||
group %like% ab_class |
|
||||
atc_group1 %like% ab_class |
|
||||
atc_group2 %like% ab_class)
|
||||
ab_group <- find_ab_group(ab_class)
|
||||
if (ab_group == "") {
|
||||
message_("Unknown antimicrobial class '", ab_class.bak, "', data left unchanged.")
|
||||
return(x.bak)
|
||||
}
|
||||
# get the columns with a group names in the chosen ab class
|
||||
agents <- ab_in_data[names(ab_in_data) %in% ab_reference$ab]
|
||||
if (length(agents) == 0) {
|
||||
message_("no antimicrobial agents of class ", ab_group,
|
||||
" found (such as ", find_ab_names(ab_class, 2),
|
||||
"), data left unchanged.")
|
||||
return(x.bak)
|
||||
}
|
||||
|
||||
if (length(result) == 1) {
|
||||
operator <- " is "
|
||||
} else {
|
||||
operator <- " is one of "
|
||||
}
|
||||
if (scope == "any") {
|
||||
scope_txt <- " or "
|
||||
scope_fn <- any
|
||||
} else {
|
||||
scope_txt <- " and "
|
||||
scope_fn <- all
|
||||
if (length(agents) > 1) {
|
||||
operator <- gsub("is", "are", operator)
|
||||
}
|
||||
}
|
||||
if (length(agents) > 1) {
|
||||
scope <- paste(scope, "of columns ")
|
||||
} else {
|
||||
scope <- "column "
|
||||
}
|
||||
|
||||
# sort columns on official name
|
||||
agents <- agents[order(ab_name(names(agents), language = NULL))]
|
||||
|
||||
message_("Filtering on ", ab_group, ": ", scope,
|
||||
paste(paste0("`", font_bold(agents, collapse = NULL),
|
||||
"` (", ab_name(names(agents), tolower = TRUE, language = NULL), ")"),
|
||||
collapse = scope_txt),
|
||||
operator, toString(result), as_note = FALSE)
|
||||
x_transposed <- as.list(as.data.frame(t(x[, agents, drop = FALSE]), stringsAsFactors = FALSE))
|
||||
filtered <- vapply(FUN.VALUE = logical(1), x_transposed, function(y) scope_fn(y %in% result, na.rm = TRUE))
|
||||
x <- x[which(filtered), , drop = FALSE]
|
||||
class(x) <- x_class
|
||||
x
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_aminoglycosides <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "aminoglycoside",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_carbapenems <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "carbapenem",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_cephalosporins <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "cephalosporin",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_1st_cephalosporins <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "cephalosporins (1st gen.)",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_2nd_cephalosporins <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "cephalosporins (2nd gen.)",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_3rd_cephalosporins <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "cephalosporins (3rd gen.)",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_4th_cephalosporins <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "cephalosporins (4th gen.)",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_5th_cephalosporins <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "cephalosporins (5th gen.)",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_fluoroquinolones <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "fluoroquinolone",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_glycopeptides <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "glycopeptide",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_macrolides <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "macrolide",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_penicillins <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "penicillin",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
#' @rdname filter_ab_class
|
||||
#' @export
|
||||
filter_tetracyclines <- function(x,
|
||||
result = NULL,
|
||||
scope = "any",
|
||||
...) {
|
||||
filter_ab_class(x = x,
|
||||
ab_class = "tetracycline",
|
||||
result = result,
|
||||
scope = scope,
|
||||
.call_depth = 1,
|
||||
...)
|
||||
}
|
||||
|
||||
find_ab_group <- function(ab_class) {
|
||||
ab_class <- gsub("[^a-zA-Z0-9]", ".*", ab_class)
|
||||
ifelse(ab_class %in% c("aminoglycoside",
|
||||
"carbapenem",
|
||||
"cephalosporin",
|
||||
"fluoroquinolone",
|
||||
"glycopeptide",
|
||||
"macrolide",
|
||||
"tetracycline"),
|
||||
paste0(ab_class, "s"),
|
||||
antibiotics %pm>%
|
||||
subset(group %like% ab_class |
|
||||
atc_group1 %like% ab_class |
|
||||
atc_group2 %like% ab_class) %pm>%
|
||||
pm_pull(group) %pm>%
|
||||
unique() %pm>%
|
||||
tolower() %pm>%
|
||||
sort() %pm>%
|
||||
paste(collapse = "/")
|
||||
)
|
||||
}
|
||||
|
||||
find_ab_names <- function(ab_group, n = 3) {
|
||||
ab_group <- gsub("[^a-zA-Z0-9]", ".*", ab_group)
|
||||
drugs <- antibiotics[which(antibiotics$group %like% ab_group & !antibiotics$ab %like% "[0-9]$"), ]$name
|
||||
paste0(sort(ab_name(sample(drugs, size = min(n, length(drugs)), replace = FALSE),
|
||||
tolower = TRUE, language = NULL)),
|
||||
collapse = ", ")
|
||||
}
|
||||
@@ -1,527 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Determine first (weighted) isolates
|
||||
#'
|
||||
#' Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. To determine patient episodes not necessarily based on microorganisms, use [is_new_episode()] that also supports grouping with the `dplyr` package.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x a [data.frame] containing isolates. Can be left blank for automatic determination.
|
||||
#' @param col_date column name of the result date (or date that is was received on the lab), defaults to the first column with a date class
|
||||
#' @param col_patient_id column name of the unique IDs of the patients, defaults to the first column that starts with 'patient' or 'patid' (case insensitive)
|
||||
#' @param col_mo column name of the IDs of the microorganisms (see [as.mo()]), defaults to the first column of class [`mo`]. Values will be coerced using [as.mo()].
|
||||
#' @param col_testcode column name of the test codes. Use `col_testcode = NULL` to **not** exclude certain test codes (such as test codes for screening). In that case `testcodes_exclude` will be ignored.
|
||||
#' @param col_specimen column name of the specimen type or group
|
||||
#' @param col_icu column name of the logicals (`TRUE`/`FALSE`) whether a ward or department is an Intensive Care Unit (ICU)
|
||||
#' @param col_keyantibiotics column name of the key antibiotics to determine first *weighted* isolates, see [key_antibiotics()]. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Use `col_keyantibiotics = FALSE` to prevent this.
|
||||
#' @param episode_days episode in days after which a genus/species combination will be determined as 'first isolate' again. The default of 365 days is based on the guideline by CLSI, see Source.
|
||||
#' @param testcodes_exclude character vector with test codes that should be excluded (case-insensitive)
|
||||
#' @param icu_exclude logical whether ICU isolates should be excluded (rows with value `TRUE` in the column set with `col_icu`)
|
||||
#' @param specimen_group value in the column set with `col_specimen` to filter on
|
||||
#' @param type type to determine weighed isolates; can be `"keyantibiotics"` or `"points"`, see Details
|
||||
#' @param ignore_I logical to determine whether antibiotic interpretations with `"I"` will be ignored when `type = "keyantibiotics"`, see Details
|
||||
#' @param points_threshold points until the comparison of key antibiotics will lead to inclusion of an isolate when `type = "points"`, see Details
|
||||
#' @param info print progress
|
||||
#' @param include_unknown logical to determine whether 'unknown' microorganisms should be included too, i.e. microbial code `"UNKNOWN"`, which defaults to `FALSE`. For WHONET users, this means that all records with organism code `"con"` (*contamination*) will be excluded at default. Isolates with a microbial ID of `NA` will always be excluded as first isolate.
|
||||
#' @param ... arguments passed on to [first_isolate()] when using [filter_first_isolate()], or arguments passed on to [key_antibiotics()] when using [filter_first_weighted_isolate()]
|
||||
#' @details
|
||||
#' These functions are context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, please see *Examples*.
|
||||
#'
|
||||
#' The [first_isolate()] function is a wrapper around the [is_new_episode()] function, but more efficient for data sets containing microorganism codes or names.
|
||||
#'
|
||||
#' All isolates with a microbial ID of `NA` will be excluded as first isolate.
|
||||
#'
|
||||
#' ### Why this is so important
|
||||
#' To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode [(Hindler *et al.* 2007)](https://pubmed.ncbi.nlm.nih.gov/17304462/). If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all *S. aureus* isolates would be overestimated, because you included this MRSA more than once. It would be [selection bias](https://en.wikipedia.org/wiki/Selection_bias).
|
||||
#'
|
||||
#' ### `filter_*()` shortcuts
|
||||
#'
|
||||
#' The functions [filter_first_isolate()] and [filter_first_weighted_isolate()] are helper functions to quickly filter on first isolates.
|
||||
#'
|
||||
#' The function [filter_first_isolate()] is essentially equal to either:
|
||||
#'
|
||||
#' ```
|
||||
#' x[first_isolate(x, ...), ]
|
||||
#'
|
||||
#' x %>% filter(first_isolate(...))
|
||||
#' ```
|
||||
#'
|
||||
#' The function [filter_first_weighted_isolate()] is essentially equal to:
|
||||
#'
|
||||
#' ```
|
||||
#' x %>%
|
||||
#' mutate(keyab = key_antibiotics(.)) %>%
|
||||
#' mutate(only_weighted_firsts = first_isolate(x,
|
||||
#' col_keyantibiotics = "keyab", ...)) %>%
|
||||
#' filter(only_weighted_firsts == TRUE) %>%
|
||||
#' select(-only_weighted_firsts, -keyab)
|
||||
#' ```
|
||||
#' @section Key antibiotics:
|
||||
#' There are two ways to determine whether isolates can be included as first *weighted* isolates which will give generally the same results:
|
||||
#'
|
||||
#' 1. Using `type = "keyantibiotics"` and argument `ignore_I`
|
||||
#'
|
||||
#' Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With `ignore_I = FALSE`, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the [key_antibiotics()] function.
|
||||
#'
|
||||
#' 2. Using `type = "points"` and argument `points_threshold`
|
||||
#'
|
||||
#' A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds `points_threshold`, which default to `2`, an isolate will be (re)selected as a first weighted isolate.
|
||||
#' @rdname first_isolate
|
||||
#' @seealso [key_antibiotics()]
|
||||
#' @export
|
||||
#' @return A [`logical`] vector
|
||||
#' @source Methodology of this function is strictly based on:
|
||||
#'
|
||||
#' **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition**, 2014, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # `example_isolates` is a dataset available in the AMR package.
|
||||
#' # See ?example_isolates.
|
||||
#'
|
||||
#' # basic filtering on first isolates
|
||||
#' example_isolates[first_isolate(example_isolates), ]
|
||||
#'
|
||||
#' # filtering based on isolates ----------------------------------------------
|
||||
#' \donttest{
|
||||
#' if (require("dplyr")) {
|
||||
#' # filter on first isolates:
|
||||
#' example_isolates %>%
|
||||
#' mutate(first_isolate = first_isolate(.)) %>%
|
||||
#' filter(first_isolate == TRUE)
|
||||
#'
|
||||
#' # short-hand versions:
|
||||
#' example_isolates %>%
|
||||
#' filter(first_isolate())
|
||||
#' example_isolates %>%
|
||||
#' filter_first_isolate()
|
||||
#'
|
||||
#' example_isolates %>%
|
||||
#' filter_first_weighted_isolate()
|
||||
#'
|
||||
#' # now let's see if first isolates matter:
|
||||
#' A <- example_isolates %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(count = n_rsi(GEN), # gentamicin availability
|
||||
#' resistance = resistance(GEN)) # gentamicin resistance
|
||||
#'
|
||||
#' B <- example_isolates %>%
|
||||
#' filter_first_weighted_isolate() %>% # the 1st isolate filter
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(count = n_rsi(GEN), # gentamicin availability
|
||||
#' resistance = resistance(GEN)) # gentamicin resistance
|
||||
#'
|
||||
#' # Have a look at A and B.
|
||||
#' # B is more reliable because every isolate is counted only once.
|
||||
#' # Gentamicin resistance in hospital D appears to be 3.7% higher than
|
||||
#' # when you (erroneously) would have used all isolates for analysis.
|
||||
#' }
|
||||
#' }
|
||||
first_isolate <- function(x,
|
||||
col_date = NULL,
|
||||
col_patient_id = NULL,
|
||||
col_mo = NULL,
|
||||
col_testcode = NULL,
|
||||
col_specimen = NULL,
|
||||
col_icu = NULL,
|
||||
col_keyantibiotics = NULL,
|
||||
episode_days = 365,
|
||||
testcodes_exclude = NULL,
|
||||
icu_exclude = FALSE,
|
||||
specimen_group = NULL,
|
||||
type = "keyantibiotics",
|
||||
ignore_I = TRUE,
|
||||
points_threshold = 2,
|
||||
info = interactive(),
|
||||
include_unknown = FALSE,
|
||||
...) {
|
||||
if (missing(x)) {
|
||||
x <- get_current_data(arg_name = "x", call = -2)
|
||||
}
|
||||
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
||||
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
meet_criteria(col_patient_id, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
meet_criteria(col_mo, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
meet_criteria(col_testcode, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
if (isFALSE(col_specimen)) {
|
||||
col_specimen <- NULL
|
||||
}
|
||||
meet_criteria(col_specimen, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
meet_criteria(col_icu, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
if (isFALSE(col_keyantibiotics)) {
|
||||
col_keyantibiotics <- NULL
|
||||
}
|
||||
meet_criteria(col_keyantibiotics, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
meet_criteria(episode_days, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(testcodes_exclude, allow_class = "character", allow_NULL = TRUE)
|
||||
meet_criteria(icu_exclude, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(specimen_group, allow_class = "character", has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(type, allow_class = "character", has_length = 1)
|
||||
meet_criteria(ignore_I, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(points_threshold, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(info, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(include_unknown, allow_class = "logical", has_length = 1)
|
||||
|
||||
dots <- unlist(list(...))
|
||||
if (length(dots) != 0) {
|
||||
# backwards compatibility with old arguments
|
||||
dots.names <- dots %pm>% names()
|
||||
if ("filter_specimen" %in% dots.names) {
|
||||
specimen_group <- dots[which(dots.names == "filter_specimen")]
|
||||
}
|
||||
if ("tbl" %in% dots.names) {
|
||||
x <- dots[which(dots.names == "tbl")]
|
||||
}
|
||||
}
|
||||
|
||||
# remove data.table, grouping from tibbles, etc.
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
|
||||
# try to find columns based on type
|
||||
# -- mo
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(x = x, type = "mo")
|
||||
stop_if(is.null(col_mo), "`col_mo` must be set")
|
||||
stop_ifnot(col_mo %in% colnames(x), "column '", col_mo, "' (`col_mo`) not found")
|
||||
}
|
||||
|
||||
# -- date
|
||||
if (is.null(col_date)) {
|
||||
col_date <- search_type_in_df(x = x, type = "date")
|
||||
stop_if(is.null(col_date), "`col_date` must be set")
|
||||
}
|
||||
|
||||
# -- patient id
|
||||
if (is.null(col_patient_id)) {
|
||||
if (all(c("First name", "Last name", "Sex") %in% colnames(x))) {
|
||||
# WHONET support
|
||||
x$patient_id <- paste(x$`First name`, x$`Last name`, x$Sex)
|
||||
col_patient_id <- "patient_id"
|
||||
message_("Using combined columns '", font_bold("First name"), "', '", font_bold("Last name"), "' and '", font_bold("Sex"), "' as input for `col_patient_id`")
|
||||
} else {
|
||||
col_patient_id <- search_type_in_df(x = x, type = "patient_id")
|
||||
}
|
||||
stop_if(is.null(col_patient_id), "`col_patient_id` must be set")
|
||||
}
|
||||
|
||||
# -- key antibiotics
|
||||
if (is.null(col_keyantibiotics)) {
|
||||
col_keyantibiotics <- search_type_in_df(x = x, type = "keyantibiotics")
|
||||
}
|
||||
|
||||
# -- specimen
|
||||
if (is.null(col_specimen) & !is.null(specimen_group)) {
|
||||
col_specimen <- search_type_in_df(x = x, type = "specimen")
|
||||
}
|
||||
|
||||
# check if columns exist
|
||||
check_columns_existance <- function(column, tblname = x) {
|
||||
if (!is.null(column)) {
|
||||
stop_ifnot(column %in% colnames(tblname),
|
||||
"Column '", column, "' not found.", call = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
check_columns_existance(col_date)
|
||||
check_columns_existance(col_patient_id)
|
||||
check_columns_existance(col_mo)
|
||||
check_columns_existance(col_testcode)
|
||||
check_columns_existance(col_icu)
|
||||
check_columns_existance(col_keyantibiotics)
|
||||
|
||||
# convert dates to Date
|
||||
dates <- as.Date(x[, col_date, drop = TRUE])
|
||||
dates[is.na(dates)] <- as.Date("1970-01-01")
|
||||
x[, col_date] <- dates
|
||||
|
||||
# create original row index
|
||||
x$newvar_row_index <- seq_len(nrow(x))
|
||||
x$newvar_mo <- x[, col_mo, drop = TRUE]
|
||||
x$newvar_genus_species <- paste(mo_genus(x$newvar_mo), mo_species(x$newvar_mo))
|
||||
x$newvar_date <- x[, col_date, drop = TRUE]
|
||||
x$newvar_patient_id <- x[, col_patient_id, drop = TRUE]
|
||||
|
||||
if (is.null(col_testcode)) {
|
||||
testcodes_exclude <- NULL
|
||||
}
|
||||
# remove testcodes
|
||||
if (!is.null(testcodes_exclude) & info == TRUE) {
|
||||
message_("[Criterion] Exclude test codes: ", toString(paste0("'", testcodes_exclude, "'")),
|
||||
add_fn = font_black,
|
||||
as_note = FALSE)
|
||||
}
|
||||
|
||||
if (is.null(col_specimen)) {
|
||||
specimen_group <- NULL
|
||||
}
|
||||
|
||||
# filter on specimen group and keyantibiotics when they are filled in
|
||||
if (!is.null(specimen_group)) {
|
||||
check_columns_existance(col_specimen, x)
|
||||
if (info == TRUE) {
|
||||
message_("[Criterion] Exclude other than specimen group '", specimen_group, "'",
|
||||
add_fn = font_black,
|
||||
as_note = FALSE)
|
||||
}
|
||||
}
|
||||
if (!is.null(col_keyantibiotics)) {
|
||||
x$newvar_key_ab <- x[, col_keyantibiotics, drop = TRUE]
|
||||
}
|
||||
|
||||
if (is.null(testcodes_exclude)) {
|
||||
testcodes_exclude <- ""
|
||||
}
|
||||
|
||||
# arrange data to the right sorting
|
||||
if (is.null(specimen_group)) {
|
||||
x <- x[order(x$newvar_patient_id,
|
||||
x$newvar_genus_species,
|
||||
x$newvar_date), ]
|
||||
rownames(x) <- NULL
|
||||
row.start <- 1
|
||||
row.end <- nrow(x)
|
||||
} else {
|
||||
# filtering on specimen and only analyse these rows to save time
|
||||
x <- x[order(pm_pull(x, col_specimen),
|
||||
x$newvar_patient_id,
|
||||
x$newvar_genus_species,
|
||||
x$newvar_date), ]
|
||||
rownames(x) <- NULL
|
||||
suppressWarnings(
|
||||
row.start <- which(x %pm>% pm_pull(col_specimen) == specimen_group) %pm>% min(na.rm = TRUE)
|
||||
)
|
||||
suppressWarnings(
|
||||
row.end <- which(x %pm>% pm_pull(col_specimen) == specimen_group) %pm>% max(na.rm = TRUE)
|
||||
)
|
||||
}
|
||||
|
||||
# speed up - return immediately if obvious
|
||||
if (abs(row.start) == Inf | abs(row.end) == Inf) {
|
||||
if (info == TRUE) {
|
||||
message_("=> Found ", font_bold("no isolates"),
|
||||
add_fn = font_black,
|
||||
as_note = FALSE)
|
||||
}
|
||||
return(rep(FALSE, nrow(x)))
|
||||
}
|
||||
if (row.start == row.end) {
|
||||
if (info == TRUE) {
|
||||
message_("=> Found ", font_bold("1 isolate"), ", as the data only contained 1 row",
|
||||
add_fn = font_black,
|
||||
as_note = FALSE)
|
||||
}
|
||||
return(TRUE)
|
||||
}
|
||||
if (length(c(row.start:row.end)) == pm_n_distinct(x[c(row.start:row.end), col_mo, drop = TRUE])) {
|
||||
if (info == TRUE) {
|
||||
message_("=> Found ", font_bold(paste(length(c(row.start:row.end)), "isolates")),
|
||||
", as all isolates were different microorganisms",
|
||||
add_fn = font_black,
|
||||
as_note = FALSE)
|
||||
}
|
||||
return(rep(TRUE, length(c(row.start:row.end))))
|
||||
}
|
||||
|
||||
# did find some isolates - add new index numbers of rows
|
||||
x$newvar_row_index_sorted <- seq_len(nrow(x))
|
||||
|
||||
scope.size <- nrow(x[which(x$newvar_row_index_sorted %in% c(row.start + 1:row.end) &
|
||||
!is.na(x$newvar_mo)), , drop = FALSE])
|
||||
|
||||
# Analysis of first isolate ----
|
||||
x$other_pat_or_mo <- ifelse(x$newvar_patient_id == pm_lag(x$newvar_patient_id) &
|
||||
x$newvar_genus_species == pm_lag(x$newvar_genus_species),
|
||||
FALSE,
|
||||
TRUE)
|
||||
x$episode_group <- paste(x$newvar_patient_id, x$newvar_genus_species)
|
||||
x$more_than_episode_ago <- unlist(lapply(unique(x$episode_group),
|
||||
function(g,
|
||||
df = x,
|
||||
days = episode_days) {
|
||||
is_new_episode(x = df[which(df$episode_group == g), ]$newvar_date,
|
||||
episode_days = days)
|
||||
}))
|
||||
|
||||
weighted.notice <- ""
|
||||
if (!is.null(col_keyantibiotics)) {
|
||||
weighted.notice <- "weighted "
|
||||
if (info == TRUE) {
|
||||
if (type == "keyantibiotics") {
|
||||
message_("[Criterion] Base inclusion on key antibiotics, ",
|
||||
ifelse(ignore_I == FALSE, "not ", ""),
|
||||
"ignoring I",
|
||||
add_fn = font_black,
|
||||
as_note = FALSE)
|
||||
}
|
||||
if (type == "points") {
|
||||
message_("[Criterion] Base inclusion on key antibiotics, using points threshold of "
|
||||
, points_threshold,
|
||||
add_fn = font_black,
|
||||
as_note = FALSE)
|
||||
}
|
||||
}
|
||||
type_param <- type
|
||||
|
||||
x$other_key_ab <- !key_antibiotics_equal(y = x$newvar_key_ab,
|
||||
z = pm_lag(x$newvar_key_ab),
|
||||
type = type_param,
|
||||
ignore_I = ignore_I,
|
||||
points_threshold = points_threshold,
|
||||
info = info)
|
||||
# with key antibiotics
|
||||
x$newvar_first_isolate <- pm_if_else(x$newvar_row_index_sorted >= row.start &
|
||||
x$newvar_row_index_sorted <= row.end &
|
||||
x$newvar_genus_species != "" &
|
||||
(x$other_pat_or_mo | x$more_than_episode_ago | x$other_key_ab),
|
||||
TRUE,
|
||||
FALSE)
|
||||
|
||||
} else {
|
||||
# no key antibiotics
|
||||
x$newvar_first_isolate <- pm_if_else(x$newvar_row_index_sorted >= row.start &
|
||||
x$newvar_row_index_sorted <= row.end &
|
||||
x$newvar_genus_species != "" &
|
||||
(x$other_pat_or_mo | x$more_than_episode_ago),
|
||||
TRUE,
|
||||
FALSE)
|
||||
}
|
||||
|
||||
# first one as TRUE
|
||||
x[row.start, "newvar_first_isolate"] <- TRUE
|
||||
# no tests that should be included, or ICU
|
||||
if (!is.null(col_testcode)) {
|
||||
x[which(x[, col_testcode] %in% tolower(testcodes_exclude)), "newvar_first_isolate"] <- FALSE
|
||||
}
|
||||
if (!is.null(col_icu)) {
|
||||
if (icu_exclude == TRUE) {
|
||||
message_("[Criterion] Exclude isolates from ICU.",
|
||||
add_fn = font_black,
|
||||
as_note = FALSE)
|
||||
x[which(as.logical(x[, col_icu, drop = TRUE])), "newvar_first_isolate"] <- FALSE
|
||||
} else {
|
||||
message_("[Criterion] Include isolates from ICU.",
|
||||
add_fn = font_black,
|
||||
as_note = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
decimal.mark <- getOption("OutDec")
|
||||
big.mark <- ifelse(decimal.mark != ",", ",", ".")
|
||||
|
||||
# handle empty microorganisms
|
||||
if (any(x$newvar_mo == "UNKNOWN", na.rm = TRUE) & info == TRUE) {
|
||||
message_(ifelse(include_unknown == TRUE, "Included ", "Excluded "),
|
||||
format(sum(x$newvar_mo == "UNKNOWN", na.rm = TRUE),
|
||||
decimal.mark = decimal.mark, big.mark = big.mark),
|
||||
" isolates with a microbial ID 'UNKNOWN' (column '", font_bold(col_mo), "')")
|
||||
}
|
||||
x[which(x$newvar_mo == "UNKNOWN"), "newvar_first_isolate"] <- include_unknown
|
||||
|
||||
# exclude all NAs
|
||||
if (any(is.na(x$newvar_mo)) & info == TRUE) {
|
||||
message_("Excluded ", format(sum(is.na(x$newvar_mo), na.rm = TRUE),
|
||||
decimal.mark = decimal.mark, big.mark = big.mark),
|
||||
" isolates with a microbial ID 'NA' (column '", font_bold(col_mo), "')")
|
||||
}
|
||||
x[which(is.na(x$newvar_mo)), "newvar_first_isolate"] <- FALSE
|
||||
|
||||
# arrange back according to original sorting again
|
||||
x <- x[order(x$newvar_row_index), ]
|
||||
rownames(x) <- NULL
|
||||
|
||||
if (info == TRUE) {
|
||||
n_found <- sum(x$newvar_first_isolate, na.rm = TRUE)
|
||||
p_found_total <- percentage(n_found / nrow(x[which(!is.na(x$newvar_mo)), , drop = FALSE]), digits = 1)
|
||||
p_found_scope <- percentage(n_found / scope.size, digits = 1)
|
||||
if (!p_found_total %like% "[.]") {
|
||||
p_found_total <- gsub("%", ".0%", p_found_total, fixed = TRUE)
|
||||
}
|
||||
if (!p_found_scope %like% "[.]") {
|
||||
p_found_scope <- gsub("%", ".0%", p_found_scope, fixed = TRUE)
|
||||
}
|
||||
# mark up number of found
|
||||
n_found <- format(n_found, big.mark = big.mark, decimal.mark = decimal.mark)
|
||||
if (p_found_total != p_found_scope) {
|
||||
msg_txt <- paste0("=> Found ",
|
||||
font_bold(paste0(n_found, " first ", weighted.notice, "isolates")),
|
||||
" (", p_found_scope, " within scope and ", p_found_total, " of total where a microbial ID was available)")
|
||||
} else {
|
||||
msg_txt <- paste0("=> Found ",
|
||||
font_bold(paste0(n_found, " first ", weighted.notice, "isolates")),
|
||||
" (", p_found_total, " of total where a microbial ID was available)")
|
||||
}
|
||||
message_(msg_txt, add_fn = font_black, as_note = FALSE)
|
||||
}
|
||||
|
||||
x$newvar_first_isolate
|
||||
|
||||
}
|
||||
|
||||
#' @rdname first_isolate
|
||||
#' @export
|
||||
filter_first_isolate <- function(x,
|
||||
col_date = NULL,
|
||||
col_patient_id = NULL,
|
||||
col_mo = NULL,
|
||||
...) {
|
||||
meet_criteria(x, allow_class = "data.frame")
|
||||
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
meet_criteria(col_patient_id, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
meet_criteria(col_mo, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
subset(x, first_isolate(x = x,
|
||||
col_date = col_date,
|
||||
col_patient_id = col_patient_id,
|
||||
col_mo = col_mo,
|
||||
...))
|
||||
}
|
||||
|
||||
#' @rdname first_isolate
|
||||
#' @export
|
||||
filter_first_weighted_isolate <- function(x,
|
||||
col_date = NULL,
|
||||
col_patient_id = NULL,
|
||||
col_mo = NULL,
|
||||
col_keyantibiotics = NULL,
|
||||
...) {
|
||||
meet_criteria(x, allow_class = "data.frame")
|
||||
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
meet_criteria(col_patient_id, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
meet_criteria(col_mo, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
meet_criteria(col_keyantibiotics, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
y <- x
|
||||
if (is.null(col_keyantibiotics)) {
|
||||
# first try to look for it
|
||||
col_keyantibiotics <- search_type_in_df(x = x, type = "keyantibiotics")
|
||||
# still NULL? Then create it since we are calling filter_first_WEIGHTED_isolate()
|
||||
if (is.null(col_keyantibiotics)) {
|
||||
y$keyab <- suppressMessages(key_antibiotics(x,
|
||||
col_mo = col_mo,
|
||||
...))
|
||||
col_keyantibiotics <- "keyab"
|
||||
}
|
||||
}
|
||||
|
||||
subset(x, first_isolate(x = y,
|
||||
col_date = col_date,
|
||||
col_patient_id = col_patient_id))
|
||||
}
|
||||
-207
@@ -1,207 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' *G*-test for Count Data
|
||||
#'
|
||||
#' [g.test()] performs chi-squared contingency table tests and goodness-of-fit tests, just like [chisq.test()] but is more reliable (1). A *G*-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a ***G*-test of goodness-of-fit**), or to see whether the proportions of one variable are different for different values of the other variable (called a ***G*-test of independence**).
|
||||
#' @inheritSection lifecycle Questioning lifecycle
|
||||
#' @inherit stats::chisq.test params return
|
||||
#' @details If `x` is a matrix with one row or column, or if `x` is a vector and `y` is not given, then a *goodness-of-fit test* is performed (`x` is treated as a one-dimensional contingency table). The entries of `x` must be non-negative integers. In this case, the hypothesis tested is whether the population probabilities equal those in `p`, or are all equal if `p` is not given.
|
||||
#'
|
||||
#' If `x` is a matrix with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries of `x` must be non-negative integers. Otherwise, `x` and `y` must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals.
|
||||
#'
|
||||
#' The p-value is computed from the asymptotic chi-squared distribution of the test statistic.
|
||||
#'
|
||||
#' In the contingency table case simulation is done by random sampling from the set of all contingency tables with given marginals, and works only if the marginals are strictly positive. Note that this is not the usual sampling situation assumed for a chi-squared test (such as the *G*-test) but rather that for Fisher's exact test.
|
||||
#'
|
||||
#' In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by `p`, each sample being of size `n = sum(x)`. This simulation is done in \R and may be slow.
|
||||
#'
|
||||
#' ## *G*-test of goodness-of-fit (likelihood ratio test)
|
||||
#' Use the *G*-test of goodness-of-fit when you have one nominal variable with two or more values (such as male and female, or red, pink and white flowers). You compare the observed counts of numbers of observations in each category with the expected counts, which you calculate using some kind of theoretical expectation (such as a 1:1 sex ratio or a 1:2:1 ratio in a genetic cross).
|
||||
#'
|
||||
#' If the expected number of observations in any category is too small, the *G*-test may give inaccurate results, and you should use an exact test instead ([fisher.test()]).
|
||||
#'
|
||||
#' The *G*-test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit ([chisq.test()]); each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar.
|
||||
#'
|
||||
#' ## *G*-test of independence
|
||||
#' Use the *G*-test of independence when you have two nominal variables, each with two or more possible values. You want to know whether the proportions for one variable are different among values of the other variable.
|
||||
#'
|
||||
#' It is also possible to do a *G*-test of independence with more than two nominal variables. For example, Jackson et al. (2013) also had data for children under 3, so you could do an analysis of old vs. young, thigh vs. arm, and reaction vs. no reaction, all analyzed together.
|
||||
#'
|
||||
#' Fisher's exact test ([fisher.test()]) is an **exact** test, where the *G*-test is still only an **approximation**. For any 2x2 table, Fisher's Exact test may be slower but will still run in seconds, even if the sum of your observations is multiple millions.
|
||||
#'
|
||||
#' The *G*-test of independence is an alternative to the chi-square test of independence ([chisq.test()]), and they will give approximately the same results.
|
||||
#'
|
||||
#' ## How the test works
|
||||
#' Unlike the exact test of goodness-of-fit ([fisher.test()]), the *G*-test does not directly calculate the probability of obtaining the observed results or something more extreme. Instead, like almost all statistical tests, the *G*-test has an intermediate step; it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. You then use a mathematical relationship, in this case the chi-square distribution, to estimate the probability of obtaining that value of the test statistic.
|
||||
#'
|
||||
#' The *G*-test uses the log of the ratio of two likelihoods as the test statistic, which is why it is also called a likelihood ratio test or log-likelihood ratio test. The formula to calculate a *G*-statistic is:
|
||||
#'
|
||||
#' \eqn{G = 2 * sum(x * log(x / E))}
|
||||
#'
|
||||
#' where `E` are the expected values. Since this is chi-square distributed, the p value can be calculated in \R with:
|
||||
#' ```
|
||||
#' p <- stats::pchisq(G, df, lower.tail = FALSE)
|
||||
#' ```
|
||||
#' where `df` are the degrees of freedom.
|
||||
#'
|
||||
#' If there are more than two categories and you want to find out which ones are significantly different from their null expectation, you can use the same method of testing each category vs. the sum of all categories, with the Bonferroni correction. You use *G*-tests for each category, of course.
|
||||
#' @seealso [chisq.test()]
|
||||
#' @references 1. McDonald, J.H. 2014. **Handbook of Biological Statistics (3rd ed.)**. Sparky House Publishing, Baltimore, Maryland. <http://www.biostathandbook.com/gtestgof.html>.
|
||||
#' @source The code for this function is identical to that of [chisq.test()], except that:
|
||||
#' - The calculation of the statistic was changed to \eqn{2 * sum(x * log(x / E))}
|
||||
#' - Yates' continuity correction was removed as it does not apply to a *G*-test
|
||||
#' - The possibility to simulate p values with `simulate.p.value` was removed
|
||||
#' @export
|
||||
#' @importFrom stats pchisq complete.cases
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # = EXAMPLE 1 =
|
||||
#' # Shivrain et al. (2006) crossed clearfield rice (which are resistant
|
||||
#' # to the herbicide imazethapyr) with red rice (which are susceptible to
|
||||
#' # imazethapyr). They then crossed the hybrid offspring and examined the
|
||||
#' # F2 generation, where they found 772 resistant plants, 1611 moderately
|
||||
#' # resistant plants, and 737 susceptible plants. If resistance is controlled
|
||||
#' # by a single gene with two co-dominant alleles, you would expect a 1:2:1
|
||||
#' # ratio.
|
||||
#'
|
||||
#' x <- c(772, 1611, 737)
|
||||
#' G <- g.test(x, p = c(1, 2, 1) / 4)
|
||||
#' # G$p.value = 0.12574.
|
||||
#'
|
||||
#' # There is no significant difference from a 1:2:1 ratio.
|
||||
#' # Meaning: resistance controlled by a single gene with two co-dominant
|
||||
#' # alleles, is plausible.
|
||||
#'
|
||||
#'
|
||||
#' # = EXAMPLE 2 =
|
||||
#' # Red crossbills (Loxia curvirostra) have the tip of the upper bill either
|
||||
#' # right or left of the lower bill, which helps them extract seeds from pine
|
||||
#' # cones. Some have hypothesized that frequency-dependent selection would
|
||||
#' # keep the number of right and left-billed birds at a 1:1 ratio. Groth (1992)
|
||||
#' # observed 1752 right-billed and 1895 left-billed crossbills.
|
||||
#'
|
||||
#' x <- c(1752, 1895)
|
||||
#' g.test(x)
|
||||
#' # p = 0.01787343
|
||||
#'
|
||||
#' # There is a significant difference from a 1:1 ratio.
|
||||
#' # Meaning: there are significantly more left-billed birds.
|
||||
#'
|
||||
g.test <- function(x,
|
||||
y = NULL,
|
||||
# correct = TRUE,
|
||||
p = rep(1 / length(x), length(x)),
|
||||
rescale.p = FALSE) {
|
||||
DNAME <- deparse(substitute(x))
|
||||
if (is.data.frame(x))
|
||||
x <- as.matrix(x)
|
||||
if (is.matrix(x)) {
|
||||
if (min(dim(x)) == 1L)
|
||||
x <- as.vector(x)
|
||||
}
|
||||
if (!is.matrix(x) && !is.null(y)) {
|
||||
if (length(x) != length(y))
|
||||
stop("'x' and 'y' must have the same length")
|
||||
DNAME2 <- deparse(substitute(y))
|
||||
xname <- if (length(DNAME) > 1L || nchar(DNAME, "w") >
|
||||
30)
|
||||
""
|
||||
else DNAME
|
||||
yname <- if (length(DNAME2) > 1L || nchar(DNAME2, "w") >
|
||||
30)
|
||||
""
|
||||
else DNAME2
|
||||
OK <- complete.cases(x, y)
|
||||
x <- factor(x[OK])
|
||||
y <- factor(y[OK])
|
||||
if ((nlevels(x) < 2L) || (nlevels(y) < 2L))
|
||||
stop("'x' and 'y' must have at least 2 levels")
|
||||
x <- table(x, y)
|
||||
names(dimnames(x)) <- c(xname, yname)
|
||||
DNAME <- paste(paste(DNAME, collapse = "\n"), "and",
|
||||
paste(DNAME2, collapse = "\n"))
|
||||
}
|
||||
if (any(x < 0) || any(is.na((x)))) # this last one was anyNA, but only introduced in R 3.1.0
|
||||
stop("all entries of 'x' must be nonnegative and finite")
|
||||
if ((n <- sum(x)) == 0)
|
||||
stop("at least one entry of 'x' must be positive")
|
||||
|
||||
|
||||
if (is.matrix(x)) {
|
||||
METHOD <- "G-test of independence"
|
||||
nr <- as.integer(nrow(x))
|
||||
nc <- as.integer(ncol(x))
|
||||
if (is.na(nr) || is.na(nc) || is.na(nr * nc))
|
||||
stop("invalid nrow(x) or ncol(x)", domain = NA)
|
||||
# add fisher.test suggestion
|
||||
if (nr == 2 && nc == 2)
|
||||
warning("`fisher.test()` is always more reliable for 2x2 tables and although much slower, often only takes seconds.")
|
||||
sr <- rowSums(x)
|
||||
sc <- colSums(x)
|
||||
E <- outer(sr, sc, "*") / n
|
||||
v <- function(r, c, n) c * r * (n - r) * (n - c) / n ^ 3
|
||||
V <- outer(sr, sc, v, n)
|
||||
dimnames(E) <- dimnames(x)
|
||||
|
||||
STATISTIC <- 2 * sum(x * log(x / E)) # sum((abs(x - E) - YATES)^2/E) for chisq.test
|
||||
PARAMETER <- (nr - 1L) * (nc - 1L)
|
||||
PVAL <- pchisq(STATISTIC, PARAMETER, lower.tail = FALSE)
|
||||
|
||||
}
|
||||
else {
|
||||
if (length(dim(x)) > 2L)
|
||||
stop("invalid 'x'")
|
||||
if (length(x) == 1L)
|
||||
stop("'x' must at least have 2 elements")
|
||||
if (length(x) != length(p))
|
||||
stop("'x' and 'p' must have the same number of elements")
|
||||
if (any(p < 0))
|
||||
stop("probabilities must be non-negative.")
|
||||
if (abs(sum(p) - 1) > sqrt(.Machine$double.eps)) {
|
||||
if (rescale.p)
|
||||
p <- p / sum(p)
|
||||
else stop("probabilities must sum to 1.")
|
||||
}
|
||||
METHOD <- "G-test of goodness-of-fit (likelihood ratio test)"
|
||||
E <- n * p
|
||||
V <- n * p * (1 - p)
|
||||
STATISTIC <- 2 * sum(x * log(x / E)) # sum((x - E)^2/E) for chisq.test
|
||||
names(E) <- names(x)
|
||||
|
||||
PARAMETER <- length(x) - 1
|
||||
PVAL <- pchisq(STATISTIC, PARAMETER, lower.tail = FALSE)
|
||||
|
||||
}
|
||||
names(STATISTIC) <- "X-squared"
|
||||
names(PARAMETER) <- "df"
|
||||
if (any(E < 5) && is.finite(PARAMETER))
|
||||
warning("G-statistic approximation may be incorrect due to E < 5")
|
||||
|
||||
structure(list(statistic = STATISTIC, argument = PARAMETER,
|
||||
p.value = PVAL, method = METHOD, data.name = DNAME,
|
||||
observed = x, expected = E, residuals = (x - E) / sqrt(E),
|
||||
stdres = (x - E) / sqrt(V)), class = "htest")
|
||||
}
|
||||
-391
@@ -1,391 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' PCA biplot with `ggplot2`
|
||||
#'
|
||||
#' Produces a `ggplot2` variant of a so-called [biplot](https://en.wikipedia.org/wiki/Biplot) for PCA (principal component analysis), but is more flexible and more appealing than the base \R [biplot()] function.
|
||||
#' @inheritSection lifecycle Maturing lifecycle
|
||||
#' @param x an object returned by [pca()], [prcomp()] or [princomp()]
|
||||
#' @inheritParams stats::biplot.prcomp
|
||||
#' @param labels an optional vector of labels for the observations. If set, the labels will be placed below their respective points. When using the [pca()] function as input for `x`, this will be determined automatically based on the attribute `non_numeric_cols`, see [pca()].
|
||||
#' @param labels_textsize the size of the text used for the labels
|
||||
#' @param labels_text_placement adjustment factor the placement of the variable names (`>=1` means further away from the arrow head)
|
||||
#' @param groups an optional vector of groups for the labels, with the same length as `labels`. If set, the points and labels will be coloured according to these groups. When using the [pca()] function as input for `x`, this will be determined automatically based on the attribute `non_numeric_cols`, see [pca()].
|
||||
#' @param ellipse a logical to indicate whether a normal data ellipse should be drawn for each group (set with `groups`)
|
||||
#' @param ellipse_prob statistical size of the ellipse in normal probability
|
||||
#' @param ellipse_size the size of the ellipse line
|
||||
#' @param ellipse_alpha the alpha (transparency) of the ellipse line
|
||||
#' @param points_size the size of the points
|
||||
#' @param points_alpha the alpha (transparency) of the points
|
||||
#' @param arrows a logical to indicate whether arrows should be drawn
|
||||
#' @param arrows_textsize the size of the text for variable names
|
||||
#' @param arrows_colour the colour of the arrow and their text
|
||||
#' @param arrows_size the size (thickness) of the arrow lines
|
||||
#' @param arrows_textsize the size of the text at the end of the arrows
|
||||
#' @param arrows_textangled a logical whether the text at the end of the arrows should be angled
|
||||
#' @param arrows_alpha the alpha (transparency) of the arrows and their text
|
||||
#' @param base_textsize the text size for all plot elements except the labels and arrows
|
||||
#' @param ... Arguments passed on to functions
|
||||
#' @source The [ggplot_pca()] function is based on the `ggbiplot()` function from the `ggbiplot` package by Vince Vu, as found on GitHub: <https://github.com/vqv/ggbiplot> (retrieved: 2 March 2020, their latest commit: [`7325e88`](https://github.com/vqv/ggbiplot/commit/7325e880485bea4c07465a0304c470608fffb5d9); 12 February 2015).
|
||||
#'
|
||||
#' As per their GPL-2 licence that demands documentation of code changes, the changes made based on the source code were:
|
||||
#' 1. Rewritten code to remove the dependency on packages `plyr`, `scales` and `grid`
|
||||
#' 2. Parametrised more options, like arrow and ellipse settings
|
||||
#' 3. Hardened all input possibilities by defining the exact type of user input for every argument
|
||||
#' 4. Added total amount of explained variance as a caption in the plot
|
||||
#' 5. Cleaned all syntax based on the `lintr` package, fixed grammatical errors and added integrity checks
|
||||
#' 6. Updated documentation
|
||||
#' @details The colours for labels and points can be changed by adding another scale layer for colour, like `scale_colour_viridis_d()` or `scale_colour_brewer()`.
|
||||
#' @rdname ggplot_pca
|
||||
#' @export
|
||||
#' @examples
|
||||
#' # `example_isolates` is a dataset available in the AMR package.
|
||||
#' # See ?example_isolates.
|
||||
#'
|
||||
#' # See ?pca for more info about Principal Component Analysis (PCA).
|
||||
#' if (require("dplyr")) {
|
||||
#' pca_model <- example_isolates %>%
|
||||
#' filter(mo_genus(mo) == "Staphylococcus") %>%
|
||||
#' group_by(species = mo_shortname(mo)) %>%
|
||||
#' summarise_if (is.rsi, resistance) %>%
|
||||
#' pca(FLC, AMC, CXM, GEN, TOB, TMP, SXT, CIP, TEC, TCY, ERY)
|
||||
#'
|
||||
#' # old (base R)
|
||||
#' biplot(pca_model)
|
||||
#'
|
||||
#' # new
|
||||
#' ggplot_pca(pca_model)
|
||||
#'
|
||||
#' if (require("ggplot2")) {
|
||||
#' ggplot_pca(pca_model) +
|
||||
#' scale_colour_viridis_d() +
|
||||
#' labs(title = "Title here")
|
||||
#' }
|
||||
#' }
|
||||
ggplot_pca <- function(x,
|
||||
choices = 1:2,
|
||||
scale = 1,
|
||||
pc.biplot = TRUE,
|
||||
labels = NULL,
|
||||
labels_textsize = 3,
|
||||
labels_text_placement = 1.5,
|
||||
groups = NULL,
|
||||
ellipse = TRUE,
|
||||
ellipse_prob = 0.68,
|
||||
ellipse_size = 0.5,
|
||||
ellipse_alpha = 0.5,
|
||||
points_size = 2,
|
||||
points_alpha = 0.25,
|
||||
arrows = TRUE,
|
||||
arrows_colour = "darkblue",
|
||||
arrows_size = 0.5,
|
||||
arrows_textsize = 3,
|
||||
arrows_textangled = TRUE,
|
||||
arrows_alpha = 0.75,
|
||||
base_textsize = 10,
|
||||
...) {
|
||||
|
||||
stop_ifnot_installed("ggplot2")
|
||||
meet_criteria(x, allow_class = c("prcomp", "princomp", "PCA", "lda"))
|
||||
meet_criteria(choices, allow_class = c("numeric", "integer"), has_length = 2)
|
||||
meet_criteria(scale, allow_class = c("numeric", "integer", "logical"), has_length = 1)
|
||||
meet_criteria(pc.biplot, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(labels, allow_class = "character", allow_NULL = TRUE)
|
||||
meet_criteria(labels_textsize, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(labels_text_placement, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(groups, allow_class = "character", allow_NULL = TRUE)
|
||||
meet_criteria(ellipse, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(ellipse_prob, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(ellipse_size, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(ellipse_alpha, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(points_size, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(points_alpha, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(arrows, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(arrows_colour, allow_class = "character", has_length = 1)
|
||||
meet_criteria(arrows_size, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(arrows_textsize, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(arrows_textangled, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(arrows_alpha, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(base_textsize, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
|
||||
calculations <- pca_calculations(pca_model = x,
|
||||
groups = groups,
|
||||
groups_missing = missing(groups),
|
||||
labels = labels,
|
||||
labels_missing = missing(labels),
|
||||
choices = choices,
|
||||
scale = scale,
|
||||
pc.biplot = pc.biplot,
|
||||
ellipse_prob = ellipse_prob,
|
||||
labels_text_placement = labels_text_placement)
|
||||
choices <- calculations$choices
|
||||
df.u <- calculations$df.u
|
||||
df.v <- calculations$df.v
|
||||
ell <- calculations$ell
|
||||
groups <- calculations$groups
|
||||
group_name <- calculations$group_name
|
||||
labels <- calculations$labels
|
||||
|
||||
# Append the proportion of explained variance to the axis labels
|
||||
if ((1 - as.integer(scale)) == 0) {
|
||||
u.axis.labs <- paste0("Standardised PC", choices)
|
||||
} else {
|
||||
u.axis.labs <- paste0("PC", choices)
|
||||
}
|
||||
u.axis.labs <- paste0(u.axis.labs,
|
||||
paste0("\n(explained var: ",
|
||||
percentage(x$sdev[choices] ^ 2 / sum(x$sdev ^ 2)),
|
||||
")"))
|
||||
|
||||
# Score Labels
|
||||
if (!is.null(labels)) {
|
||||
df.u$labels <- labels
|
||||
}
|
||||
|
||||
# Grouping variable
|
||||
if (!is.null(groups)) {
|
||||
df.u$groups <- groups
|
||||
}
|
||||
|
||||
# Base plot
|
||||
g <- ggplot2::ggplot(data = df.u,
|
||||
ggplot2::aes(x = xvar, y = yvar)) +
|
||||
ggplot2::xlab(u.axis.labs[1]) +
|
||||
ggplot2::ylab(u.axis.labs[2]) +
|
||||
ggplot2::expand_limits(x = c(-1.15, 1.15),
|
||||
y = c(-1.15, 1.15))
|
||||
|
||||
# Draw either labels or points
|
||||
if (!is.null(df.u$labels)) {
|
||||
if (!is.null(df.u$groups)) {
|
||||
g <- g + ggplot2::geom_point(ggplot2::aes(colour = groups),
|
||||
alpha = points_alpha,
|
||||
size = points_size) +
|
||||
ggplot2::geom_text(ggplot2::aes(label = labels, colour = groups),
|
||||
nudge_y = -0.05,
|
||||
size = labels_textsize) +
|
||||
ggplot2::labs(colour = group_name)
|
||||
} else {
|
||||
g <- g + ggplot2::geom_point(alpha = points_alpha,
|
||||
size = points_size) +
|
||||
ggplot2::geom_text(ggplot2::aes(label = labels),
|
||||
nudge_y = -0.05,
|
||||
size = labels_textsize)
|
||||
}
|
||||
} else {
|
||||
if (!is.null(df.u$groups)) {
|
||||
g <- g + ggplot2::geom_point(ggplot2::aes(colour = groups),
|
||||
alpha = points_alpha,
|
||||
size = points_size) +
|
||||
ggplot2::labs(colour = group_name)
|
||||
} else {
|
||||
g <- g + ggplot2::geom_point(alpha = points_alpha,
|
||||
size = points_size)
|
||||
}
|
||||
}
|
||||
|
||||
# Overlay a concentration ellipse if there are groups
|
||||
if (!is.null(df.u$groups) & !is.null(ell) & isTRUE(ellipse)) {
|
||||
g <- g + ggplot2::geom_path(data = ell,
|
||||
ggplot2::aes(colour = groups, group = groups),
|
||||
size = ellipse_size,
|
||||
alpha = points_alpha)
|
||||
}
|
||||
|
||||
# Label the variable axes
|
||||
if (arrows == TRUE) {
|
||||
g <- g + ggplot2::geom_segment(data = df.v,
|
||||
ggplot2::aes(x = 0, y = 0, xend = xvar, yend = yvar),
|
||||
arrow = ggplot2::arrow(length = ggplot2::unit(0.5, "picas"),
|
||||
angle = 20,
|
||||
ends = "last",
|
||||
type = "open"),
|
||||
colour = arrows_colour,
|
||||
size = arrows_size,
|
||||
alpha = arrows_alpha)
|
||||
if (arrows_textangled == TRUE) {
|
||||
g <- g + ggplot2::geom_text(data = df.v,
|
||||
ggplot2::aes(label = varname, x = xvar, y = yvar, angle = angle, hjust = hjust),
|
||||
colour = arrows_colour,
|
||||
size = arrows_textsize,
|
||||
alpha = arrows_alpha)
|
||||
} else {
|
||||
g <- g + ggplot2::geom_text(data = df.v,
|
||||
ggplot2::aes(label = varname, x = xvar, y = yvar, hjust = hjust),
|
||||
colour = arrows_colour,
|
||||
size = arrows_textsize,
|
||||
alpha = arrows_alpha)
|
||||
}
|
||||
}
|
||||
|
||||
# Add caption label about total explained variance
|
||||
g <- g + ggplot2::labs(caption = paste0("Total explained variance: ",
|
||||
percentage(sum(x$sdev[choices] ^ 2 / sum(x$sdev ^ 2)))))
|
||||
|
||||
# mark-up nicely
|
||||
g <- g + ggplot2::theme_minimal(base_size = base_textsize) +
|
||||
ggplot2::theme(panel.grid.major = ggplot2::element_line(colour = "grey85"),
|
||||
panel.grid.minor = ggplot2::element_blank(),
|
||||
# centre title and subtitle
|
||||
plot.title = ggplot2::element_text(hjust = 0.5),
|
||||
plot.subtitle = ggplot2::element_text(hjust = 0.5))
|
||||
|
||||
g
|
||||
}
|
||||
|
||||
#' @importFrom stats qchisq var
|
||||
pca_calculations <- function(pca_model,
|
||||
groups = NULL,
|
||||
groups_missing = TRUE,
|
||||
labels = NULL,
|
||||
labels_missing = TRUE,
|
||||
choices = 1:2,
|
||||
scale = 1,
|
||||
pc.biplot = TRUE,
|
||||
ellipse_prob = 0.68,
|
||||
labels_text_placement = 1.5) {
|
||||
|
||||
non_numeric_cols <- attributes(pca_model)$non_numeric_cols
|
||||
if (groups_missing) {
|
||||
groups <- tryCatch(non_numeric_cols[[1]],
|
||||
error = function(e) NULL)
|
||||
group_name <- tryCatch(colnames(non_numeric_cols[1]),
|
||||
error = function(e) NULL)
|
||||
}
|
||||
if (labels_missing) {
|
||||
labels <- tryCatch(non_numeric_cols[[2]],
|
||||
error = function(e) NULL)
|
||||
}
|
||||
if (!is.null(groups) & is.null(labels)) {
|
||||
# turn them around
|
||||
labels <- groups
|
||||
groups <- NULL
|
||||
group_name <- NULL
|
||||
}
|
||||
|
||||
# Recover the SVD
|
||||
if (inherits(pca_model, "prcomp")) {
|
||||
nobs.factor <- sqrt(nrow(pca_model$x) - 1)
|
||||
d <- pca_model$sdev
|
||||
u <- sweep(pca_model$x, 2, 1 / (d * nobs.factor), FUN = "*")
|
||||
v <- pca_model$rotation
|
||||
} else if (inherits(pca_model, "princomp")) {
|
||||
nobs.factor <- sqrt(pca_model$n.obs)
|
||||
d <- pca_model$sdev
|
||||
u <- sweep(pca_model$scores, 2, 1 / (d * nobs.factor), FUN = "*")
|
||||
v <- pca_model$loadings
|
||||
} else if (inherits(pca_model, "PCA")) {
|
||||
nobs.factor <- sqrt(nrow(pca_model$call$X))
|
||||
d <- unlist(sqrt(pca_model$eig)[1])
|
||||
u <- sweep(pca_model$ind$coord, 2, 1 / (d * nobs.factor), FUN = "*")
|
||||
v <- sweep(pca_model$var$coord, 2, sqrt(pca_model$eig[seq_len(ncol(pca_model$var$coord)), 1]), FUN = "/")
|
||||
} else if (inherits(pca_model, "lda")) {
|
||||
nobs.factor <- sqrt(pca_model$N)
|
||||
d <- pca_model$svd
|
||||
u <- predict(pca_model)$x / nobs.factor
|
||||
v <- pca_model$scaling
|
||||
} else {
|
||||
stop("Expected an object of class prcomp, princomp, PCA, or lda")
|
||||
}
|
||||
|
||||
# Scores
|
||||
choices <- pmin(choices, ncol(u))
|
||||
obs.scale <- 1 - as.integer(scale)
|
||||
df.u <- as.data.frame(sweep(u[, choices], 2, d[choices] ^ obs.scale, FUN = "*"),
|
||||
stringsAsFactors = FALSE)
|
||||
|
||||
# Directions
|
||||
v <- sweep(v, 2, d ^ as.integer(scale), FUN = "*")
|
||||
df.v <- as.data.frame(v[, choices],
|
||||
stringsAsFactors = FALSE)
|
||||
|
||||
names(df.u) <- c("xvar", "yvar")
|
||||
names(df.v) <- names(df.u)
|
||||
|
||||
if (isTRUE(pc.biplot)) {
|
||||
df.u <- df.u * nobs.factor
|
||||
}
|
||||
|
||||
# Scale the radius of the correlation circle so that it corresponds to
|
||||
# a data ellipse for the standardized PC scores
|
||||
circle_prob <- 0.69
|
||||
r <- sqrt(qchisq(circle_prob, df = 2)) * prod(colMeans(df.u ^ 2)) ^ (0.25)
|
||||
|
||||
# Scale directions
|
||||
v.scale <- rowSums(v ^ 2)
|
||||
df.v <- r * df.v / sqrt(max(v.scale))
|
||||
|
||||
# Grouping variable
|
||||
if (!is.null(groups)) {
|
||||
df.u$groups <- groups
|
||||
}
|
||||
|
||||
df.v$varname <- rownames(v)
|
||||
|
||||
# Variables for text label placement
|
||||
df.v$angle <- with(df.v, (180 / pi) * atan(yvar / xvar))
|
||||
df.v$hjust <- with(df.v, (1 - labels_text_placement * sign(xvar)) / 2)
|
||||
|
||||
if (!is.null(df.u$groups)) {
|
||||
theta <- c(seq(-pi, pi, length = 50), seq(pi, -pi, length = 50))
|
||||
circle <- cbind(cos(theta), sin(theta))
|
||||
|
||||
df.groups <- lapply(unique(df.u$groups), function(g, df = df.u) {
|
||||
x <- df[which(df$groups == g), , drop = FALSE]
|
||||
if (nrow(x) <= 2) {
|
||||
return(data.frame(X1 = numeric(0),
|
||||
X2 = numeric(0),
|
||||
groups = character(0),
|
||||
stringsAsFactors = FALSE))
|
||||
}
|
||||
sigma <- var(cbind(x$xvar, x$yvar))
|
||||
mu <- c(mean(x$xvar), mean(x$yvar))
|
||||
ed <- sqrt(qchisq(ellipse_prob, df = 2))
|
||||
data.frame(sweep(circle %*% chol(sigma) * ed,
|
||||
MARGIN = 2,
|
||||
STATS = mu,
|
||||
FUN = "+"),
|
||||
groups = x$groups[1],
|
||||
stringsAsFactors = FALSE)
|
||||
})
|
||||
ell <- do.call(rbind, df.groups)
|
||||
if (NROW(ell) == 0) {
|
||||
ell <- NULL
|
||||
} else {
|
||||
names(ell)[1:2] <- c("xvar", "yvar")
|
||||
}
|
||||
} else {
|
||||
ell <- NULL
|
||||
}
|
||||
|
||||
list(choices = choices,
|
||||
df.u = df.u,
|
||||
df.v = df.v,
|
||||
ell = ell,
|
||||
groups = groups,
|
||||
group_name = group_name,
|
||||
labels = labels
|
||||
)
|
||||
}
|
||||
-453
@@ -1,453 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' AMR plots with `ggplot2`
|
||||
#'
|
||||
#' Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on [ggplot2][ggplot2::ggplot()] functions.
|
||||
#' @inheritSection lifecycle Maturing lifecycle
|
||||
#' @param data a [data.frame] with column(s) of class [`rsi`] (see [as.rsi()])
|
||||
#' @param position position adjustment of bars, either `"fill"`, `"stack"` or `"dodge"`
|
||||
#' @param x variable to show on x axis, either `"antibiotic"` (default) or `"interpretation"` or a grouping variable
|
||||
#' @param fill variable to categorise using the plots legend, either `"antibiotic"` (default) or `"interpretation"` or a grouping variable
|
||||
#' @param breaks numeric vector of positions
|
||||
#' @param limits numeric vector of length two providing limits of the scale, use `NA` to refer to the existing minimum or maximum
|
||||
#' @param facet variable to split plots by, either `"interpretation"` (default) or `"antibiotic"` or a grouping variable
|
||||
#' @inheritParams proportion
|
||||
#' @param nrow (when using `facet`) number of rows
|
||||
#' @param colours a named vector with colours for the bars. The names must be one or more of: S, SI, I, IR, R or be `FALSE` to use default [ggplot2][ggplot2::ggplot()] colours.
|
||||
#' @param datalabels show datalabels using [labels_rsi_count()]
|
||||
#' @param datalabels.size size of the datalabels
|
||||
#' @param datalabels.colour colour of the datalabels
|
||||
#' @param title text to show as title of the plot
|
||||
#' @param subtitle text to show as subtitle of the plot
|
||||
#' @param caption text to show as caption of the plot
|
||||
#' @param x.title text to show as x axis description
|
||||
#' @param y.title text to show as y axis description
|
||||
#' @param ... other arguments passed on to [geom_rsi()]
|
||||
#' @details At default, the names of antibiotics will be shown on the plots using [ab_name()]. This can be set with the `translate_ab` argument. See [count_df()].
|
||||
#'
|
||||
#' ## The functions
|
||||
#' [geom_rsi()] will take any variable from the data that has an [`rsi`] class (created with [as.rsi()]) using [rsi_df()] and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.
|
||||
#'
|
||||
#' [facet_rsi()] creates 2d plots (at default based on S/I/R) using [ggplot2::facet_wrap()].
|
||||
#'
|
||||
#' [scale_y_percent()] transforms the y axis to a 0 to 100% range using [ggplot2::scale_y_continuous()].
|
||||
#'
|
||||
#' [scale_rsi_colours()] sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, using [ggplot2::scale_fill_manual()].
|
||||
#'
|
||||
#' [theme_rsi()] is a [ggplot2 theme][[ggplot2::theme()] with minimal distraction.
|
||||
#'
|
||||
#' [labels_rsi_count()] print datalabels on the bars with percentage and amount of isolates using [ggplot2::geom_text()].
|
||||
#'
|
||||
#' [ggplot_rsi()] is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (`%>%`). See Examples.
|
||||
#' @rdname ggplot_rsi
|
||||
#' @export
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' if (require("ggplot2") & require("dplyr")) {
|
||||
#'
|
||||
#' # get antimicrobial results for drugs against a UTI:
|
||||
#' ggplot(example_isolates %>% select(AMX, NIT, FOS, TMP, CIP)) +
|
||||
#' geom_rsi()
|
||||
#'
|
||||
#' # prettify the plot using some additional functions:
|
||||
#' df <- example_isolates %>% select(AMX, NIT, FOS, TMP, CIP)
|
||||
#' ggplot(df) +
|
||||
#' geom_rsi() +
|
||||
#' scale_y_percent() +
|
||||
#' scale_rsi_colours() +
|
||||
#' labels_rsi_count() +
|
||||
#' theme_rsi()
|
||||
#'
|
||||
#' # or better yet, simplify this using the wrapper function - a single command:
|
||||
#' example_isolates %>%
|
||||
#' select(AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' ggplot_rsi()
|
||||
#'
|
||||
#' # get only proportions and no counts:
|
||||
#' example_isolates %>%
|
||||
#' select(AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' ggplot_rsi(datalabels = FALSE)
|
||||
#'
|
||||
#' # add other ggplot2 arguments as you like:
|
||||
#' example_isolates %>%
|
||||
#' select(AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' ggplot_rsi(width = 0.5,
|
||||
#' colour = "black",
|
||||
#' size = 1,
|
||||
#' linetype = 2,
|
||||
#' alpha = 0.25)
|
||||
#'
|
||||
#' example_isolates %>%
|
||||
#' select(AMX) %>%
|
||||
#' ggplot_rsi(colours = c(SI = "yellow"))
|
||||
#'
|
||||
#' }
|
||||
#'
|
||||
#' \donttest{
|
||||
#' # resistance of ciprofloxacine per age group
|
||||
#' example_isolates %>%
|
||||
#' mutate(first_isolate = first_isolate(.)) %>%
|
||||
#' filter(first_isolate == TRUE,
|
||||
#' mo == as.mo("E. coli")) %>%
|
||||
#' # age_groups() is also a function in this AMR package:
|
||||
#' group_by(age_group = age_groups(age)) %>%
|
||||
#' select(age_group,
|
||||
#' CIP) %>%
|
||||
#' ggplot_rsi(x = "age_group")
|
||||
#'
|
||||
#' # for colourblind mode, use divergent colours from the viridis package:
|
||||
#' example_isolates %>%
|
||||
#' select(AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' ggplot_rsi() +
|
||||
#' scale_fill_viridis_d()
|
||||
#' # a shorter version which also adjusts data label colours:
|
||||
#' example_isolates %>%
|
||||
#' select(AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' ggplot_rsi(colours = FALSE)
|
||||
#'
|
||||
#'
|
||||
#' # it also supports groups (don't forget to use the group var on `x` or `facet`):
|
||||
#' example_isolates %>%
|
||||
#' select(hospital_id, AMX, NIT, FOS, TMP, CIP) %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' ggplot_rsi(x = "hospital_id",
|
||||
#' facet = "antibiotic",
|
||||
#' nrow = 1,
|
||||
#' title = "AMR of Anti-UTI Drugs Per Hospital",
|
||||
#' x.title = "Hospital",
|
||||
#' datalabels = FALSE)
|
||||
#' }
|
||||
ggplot_rsi <- function(data,
|
||||
position = NULL,
|
||||
x = "antibiotic",
|
||||
fill = "interpretation",
|
||||
# params = list(),
|
||||
facet = NULL,
|
||||
breaks = seq(0, 1, 0.1),
|
||||
limits = NULL,
|
||||
translate_ab = "name",
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE,
|
||||
minimum = 30,
|
||||
language = get_locale(),
|
||||
nrow = NULL,
|
||||
colours = c(S = "#61a8ff",
|
||||
SI = "#61a8ff",
|
||||
I = "#61f7ff",
|
||||
IR = "#ff6961",
|
||||
R = "#ff6961"),
|
||||
datalabels = TRUE,
|
||||
datalabels.size = 2.5,
|
||||
datalabels.colour = "grey15",
|
||||
title = NULL,
|
||||
subtitle = NULL,
|
||||
caption = NULL,
|
||||
x.title = "Antimicrobial",
|
||||
y.title = "Proportion",
|
||||
...) {
|
||||
|
||||
stop_ifnot_installed("ggplot2")
|
||||
meet_criteria(data, allow_class = "data.frame", contains_column_class = "rsi")
|
||||
meet_criteria(position, allow_class = "character", has_length = 1, is_in = c("fill", "stack", "dodge"), allow_NULL = TRUE)
|
||||
meet_criteria(x, allow_class = "character", has_length = 1)
|
||||
meet_criteria(fill, allow_class = "character", has_length = 1)
|
||||
meet_criteria(facet, allow_class = "character", has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(breaks, allow_class = c("numeric", "integer"))
|
||||
meet_criteria(limits, allow_class = c("numeric", "integer"), has_length = 2, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(translate_ab, allow_class = c("character", "logical"), has_length = 1, allow_NA = TRUE)
|
||||
meet_criteria(combine_SI, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(combine_IR, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(minimum, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(nrow, allow_class = c("numeric", "integer"), has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(colours, allow_class = c("character", "logical"))
|
||||
meet_criteria(datalabels, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(datalabels.size, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(datalabels.colour, allow_class = "character", has_length = 1)
|
||||
meet_criteria(title, allow_class = "character", has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(subtitle, allow_class = "character", has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(caption, allow_class = "character", has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(x.title, allow_class = "character", has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(y.title, allow_class = "character", has_length = 1, allow_NULL = TRUE)
|
||||
|
||||
# we work with aes_string later on
|
||||
x_deparse <- deparse(substitute(x))
|
||||
if (x_deparse != "x") {
|
||||
x <- x_deparse
|
||||
}
|
||||
if (x %like% '".*"') {
|
||||
x <- substr(x, 2, nchar(x) - 1)
|
||||
}
|
||||
facet_deparse <- deparse(substitute(facet))
|
||||
if (facet_deparse != "facet") {
|
||||
facet <- facet_deparse
|
||||
}
|
||||
if (facet %like% '".*"') {
|
||||
facet <- substr(facet, 2, nchar(facet) - 1)
|
||||
}
|
||||
if (facet %in% c("NULL", "")) {
|
||||
facet <- NULL
|
||||
}
|
||||
|
||||
if (is.null(position)) {
|
||||
position <- "fill"
|
||||
}
|
||||
|
||||
p <- ggplot2::ggplot(data = data) +
|
||||
geom_rsi(position = position, x = x, fill = fill, translate_ab = translate_ab,
|
||||
minimum = minimum, language = language,
|
||||
combine_SI = combine_SI, combine_IR = combine_IR, ...) +
|
||||
theme_rsi()
|
||||
|
||||
if (fill == "interpretation") {
|
||||
# set RSI colours
|
||||
if (isFALSE(colours) & missing(datalabels.colour)) {
|
||||
# set datalabel colour to middle grey
|
||||
datalabels.colour <- "grey50"
|
||||
}
|
||||
p <- p + scale_rsi_colours(colours = colours)
|
||||
}
|
||||
|
||||
if (identical(position, "fill")) {
|
||||
# proportions, so use y scale with percentage
|
||||
p <- p + scale_y_percent(breaks = breaks, limits = limits)
|
||||
}
|
||||
|
||||
if (datalabels == TRUE) {
|
||||
p <- p + labels_rsi_count(position = position,
|
||||
x = x,
|
||||
translate_ab = translate_ab,
|
||||
minimum = minimum,
|
||||
language = language,
|
||||
combine_SI = combine_SI,
|
||||
combine_IR = combine_IR,
|
||||
datalabels.size = datalabels.size,
|
||||
datalabels.colour = datalabels.colour)
|
||||
}
|
||||
|
||||
if (!is.null(facet)) {
|
||||
p <- p + facet_rsi(facet = facet, nrow = nrow)
|
||||
}
|
||||
|
||||
p <- p + ggplot2::labs(title = title,
|
||||
subtitle = subtitle,
|
||||
caption = caption,
|
||||
x = x.title,
|
||||
y = y.title)
|
||||
|
||||
p
|
||||
}
|
||||
|
||||
#' @rdname ggplot_rsi
|
||||
#' @export
|
||||
geom_rsi <- function(position = NULL,
|
||||
x = c("antibiotic", "interpretation"),
|
||||
fill = "interpretation",
|
||||
translate_ab = "name",
|
||||
minimum = 30,
|
||||
language = get_locale(),
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE,
|
||||
...) {
|
||||
x <- x[1]
|
||||
stop_ifnot_installed("ggplot2")
|
||||
stop_if(is.data.frame(position), "`position` is invalid. Did you accidentally use '%>%' instead of '+'?")
|
||||
meet_criteria(position, allow_class = "character", has_length = 1, is_in = c("fill", "stack", "dodge"), allow_NULL = TRUE)
|
||||
meet_criteria(x, allow_class = "character", has_length = 1)
|
||||
meet_criteria(fill, allow_class = "character", has_length = 1)
|
||||
meet_criteria(translate_ab, allow_class = c("character", "logical"), has_length = 1, allow_NA = TRUE)
|
||||
meet_criteria(minimum, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(combine_SI, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(combine_IR, allow_class = "logical", has_length = 1)
|
||||
|
||||
y <- "value"
|
||||
if (missing(position) | is.null(position)) {
|
||||
position <- "fill"
|
||||
}
|
||||
|
||||
if (identical(position, "fill")) {
|
||||
position <- ggplot2::position_fill(vjust = 0.5, reverse = TRUE)
|
||||
}
|
||||
|
||||
# we work with aes_string later on
|
||||
x_deparse <- deparse(substitute(x))
|
||||
if (x_deparse != "x") {
|
||||
x <- x_deparse
|
||||
}
|
||||
if (x %like% '".*"') {
|
||||
x <- substr(x, 2, nchar(x) - 1)
|
||||
}
|
||||
|
||||
if (tolower(x) %in% tolower(c("ab", "abx", "antibiotics"))) {
|
||||
x <- "antibiotic"
|
||||
} else if (tolower(x) %in% tolower(c("SIR", "RSI", "interpretations", "result"))) {
|
||||
x <- "interpretation"
|
||||
}
|
||||
|
||||
ggplot2::layer(geom = "bar", stat = "identity", position = position,
|
||||
mapping = ggplot2::aes_string(x = x, y = y, fill = fill),
|
||||
params = list(...), data = function(x) {
|
||||
rsi_df(data = x,
|
||||
translate_ab = translate_ab,
|
||||
language = language,
|
||||
minimum = minimum,
|
||||
combine_SI = combine_SI,
|
||||
combine_IR = combine_IR)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
#' @rdname ggplot_rsi
|
||||
#' @export
|
||||
facet_rsi <- function(facet = c("interpretation", "antibiotic"), nrow = NULL) {
|
||||
facet <- facet[1]
|
||||
stop_ifnot_installed("ggplot2")
|
||||
meet_criteria(facet, allow_class = "character", has_length = 1)
|
||||
meet_criteria(nrow, allow_class = c("numeric", "integer"), has_length = 1, allow_NULL = TRUE)
|
||||
|
||||
# we work with aes_string later on
|
||||
facet_deparse <- deparse(substitute(facet))
|
||||
if (facet_deparse != "facet") {
|
||||
facet <- facet_deparse
|
||||
}
|
||||
if (facet %like% '".*"') {
|
||||
facet <- substr(facet, 2, nchar(facet) - 1)
|
||||
}
|
||||
|
||||
if (tolower(facet) %in% tolower(c("SIR", "RSI", "interpretations", "result"))) {
|
||||
facet <- "interpretation"
|
||||
} else if (tolower(facet) %in% tolower(c("ab", "abx", "antibiotics"))) {
|
||||
facet <- "antibiotic"
|
||||
}
|
||||
|
||||
ggplot2::facet_wrap(facets = facet, scales = "free_x", nrow = nrow)
|
||||
}
|
||||
|
||||
#' @rdname ggplot_rsi
|
||||
#' @export
|
||||
scale_y_percent <- function(breaks = seq(0, 1, 0.1), limits = NULL) {
|
||||
stop_ifnot_installed("ggplot2")
|
||||
meet_criteria(breaks, allow_class = c("numeric", "integer"))
|
||||
meet_criteria(limits, allow_class = c("numeric", "integer"), has_length = 2, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
if (all(breaks[breaks != 0] > 1)) {
|
||||
breaks <- breaks / 100
|
||||
}
|
||||
ggplot2::scale_y_continuous(breaks = breaks,
|
||||
labels = percentage(breaks),
|
||||
limits = limits)
|
||||
}
|
||||
|
||||
#' @rdname ggplot_rsi
|
||||
#' @export
|
||||
scale_rsi_colours <- function(colours = c(S = "#61a8ff",
|
||||
SI = "#61a8ff",
|
||||
I = "#61f7ff",
|
||||
IR = "#ff6961",
|
||||
R = "#ff6961")) {
|
||||
stop_ifnot_installed("ggplot2")
|
||||
meet_criteria(colours, allow_class = c("character", "logical"))
|
||||
|
||||
# previous colour: palette = "RdYlGn"
|
||||
# previous colours: values = c("#b22222", "#ae9c20", "#7cfc00")
|
||||
|
||||
if (!identical(colours, FALSE)) {
|
||||
original_cols <- c(S = "#61a8ff",
|
||||
SI = "#61a8ff",
|
||||
I = "#61f7ff",
|
||||
IR = "#ff6961",
|
||||
R = "#ff6961")
|
||||
colours <- replace(original_cols, names(colours), colours)
|
||||
ggplot2::scale_fill_manual(values = colours)
|
||||
}
|
||||
}
|
||||
|
||||
#' @rdname ggplot_rsi
|
||||
#' @export
|
||||
theme_rsi <- function() {
|
||||
stop_ifnot_installed("ggplot2")
|
||||
ggplot2::theme_minimal(base_size = 10) +
|
||||
ggplot2::theme(panel.grid.major.x = ggplot2::element_blank(),
|
||||
panel.grid.minor = ggplot2::element_blank(),
|
||||
panel.grid.major.y = ggplot2::element_line(colour = "grey75"),
|
||||
# center title and subtitle
|
||||
plot.title = ggplot2::element_text(hjust = 0.5),
|
||||
plot.subtitle = ggplot2::element_text(hjust = 0.5))
|
||||
}
|
||||
|
||||
#' @rdname ggplot_rsi
|
||||
#' @export
|
||||
labels_rsi_count <- function(position = NULL,
|
||||
x = "antibiotic",
|
||||
translate_ab = "name",
|
||||
minimum = 30,
|
||||
language = get_locale(),
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE,
|
||||
datalabels.size = 3,
|
||||
datalabels.colour = "grey15") {
|
||||
stop_ifnot_installed("ggplot2")
|
||||
meet_criteria(position, allow_class = "character", has_length = 1, is_in = c("fill", "stack", "dodge"), allow_NULL = TRUE)
|
||||
meet_criteria(x, allow_class = "character", has_length = 1)
|
||||
meet_criteria(translate_ab, allow_class = c("character", "logical"), has_length = 1, allow_NA = TRUE)
|
||||
meet_criteria(minimum, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(combine_SI, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(combine_IR, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(datalabels.size, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(datalabels.colour, allow_class = "character", has_length = 1)
|
||||
|
||||
if (is.null(position)) {
|
||||
position <- "fill"
|
||||
}
|
||||
if (identical(position, "fill")) {
|
||||
position <- ggplot2::position_fill(vjust = 0.5, reverse = TRUE)
|
||||
}
|
||||
x_name <- x
|
||||
ggplot2::geom_text(mapping = ggplot2::aes_string(label = "lbl",
|
||||
x = x,
|
||||
y = "value"),
|
||||
position = position,
|
||||
inherit.aes = FALSE,
|
||||
size = datalabels.size,
|
||||
colour = datalabels.colour,
|
||||
lineheight = 0.75,
|
||||
data = function(x) {
|
||||
transformed <- rsi_df(data = x,
|
||||
translate_ab = translate_ab,
|
||||
combine_SI = combine_SI,
|
||||
combine_IR = combine_IR,
|
||||
minimum = minimum,
|
||||
language = language)
|
||||
transformed$gr <- transformed[, x_name, drop = TRUE]
|
||||
transformed %pm>%
|
||||
pm_group_by(gr) %pm>%
|
||||
pm_mutate(lbl = paste0("n=", isolates)) %pm>%
|
||||
pm_ungroup() %pm>%
|
||||
pm_select(-gr)
|
||||
})
|
||||
}
|
||||
-85
@@ -1,85 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
globalVariables(c(".rowid",
|
||||
"ab",
|
||||
"ab_txt",
|
||||
"angle",
|
||||
"antibiotic",
|
||||
"antibiotics",
|
||||
"atc_group1",
|
||||
"atc_group2",
|
||||
"code",
|
||||
"data",
|
||||
"dosage",
|
||||
"dose",
|
||||
"dose_times",
|
||||
"fullname",
|
||||
"fullname_lower",
|
||||
"g_species",
|
||||
"genus",
|
||||
"gr",
|
||||
"group",
|
||||
"guideline",
|
||||
"hjust",
|
||||
"input",
|
||||
"intrinsic_resistant",
|
||||
"isolates",
|
||||
"lang",
|
||||
"language",
|
||||
"lookup",
|
||||
"method",
|
||||
"microorganism",
|
||||
"microorganisms",
|
||||
"microorganisms.codes",
|
||||
"microorganisms.old",
|
||||
"mo",
|
||||
"name",
|
||||
"new",
|
||||
"observations",
|
||||
"old",
|
||||
"old_name",
|
||||
"pattern",
|
||||
"R",
|
||||
"reference.rule",
|
||||
"reference.rule_group",
|
||||
"reference.version",
|
||||
"rsi_translation",
|
||||
"rowid",
|
||||
"rule_group",
|
||||
"rule_name",
|
||||
"se_max",
|
||||
"se_min",
|
||||
"species",
|
||||
"species_id",
|
||||
"total",
|
||||
"txt",
|
||||
"type",
|
||||
"value",
|
||||
"varname",
|
||||
"xvar",
|
||||
"y",
|
||||
"year",
|
||||
"yvar"))
|
||||
@@ -1,256 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Guess antibiotic column
|
||||
#'
|
||||
#' This tries to find a column name in a data set based on information from the [antibiotics] data set. Also supports WHONET abbreviations.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x a [data.frame]
|
||||
#' @param search_string a text to search `x` for, will be checked with [as.ab()] if this value is not a column in `x`
|
||||
#' @param verbose a logical to indicate whether additional info should be printed
|
||||
#' @details You can look for an antibiotic (trade) name or abbreviation and it will search `x` and the [antibiotics] data set for any column containing a name or code of that antibiotic. **Longer columns names take precedence over shorter column names.**
|
||||
#' @return A column name of `x`, or `NULL` when no result is found.
|
||||
#' @export
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' df <- data.frame(amox = "S",
|
||||
#' tetr = "R")
|
||||
#'
|
||||
#' guess_ab_col(df, "amoxicillin")
|
||||
#' # [1] "amox"
|
||||
#' guess_ab_col(df, "J01AA07") # ATC code of tetracycline
|
||||
#' # [1] "tetr"
|
||||
#'
|
||||
#' guess_ab_col(df, "J01AA07", verbose = TRUE)
|
||||
#' # NOTE: Using column 'tetr' as input for J01AA07 (tetracycline).
|
||||
#' # [1] "tetr"
|
||||
#'
|
||||
#' # WHONET codes
|
||||
#' df <- data.frame(AMP_ND10 = "R",
|
||||
#' AMC_ED20 = "S")
|
||||
#' guess_ab_col(df, "ampicillin")
|
||||
#' # [1] "AMP_ND10"
|
||||
#' guess_ab_col(df, "J01CR02")
|
||||
#' # [1] "AMC_ED20"
|
||||
#' guess_ab_col(df, as.ab("augmentin"))
|
||||
#' # [1] "AMC_ED20"
|
||||
#'
|
||||
#' # Longer names take precendence:
|
||||
#' df <- data.frame(AMP_ED2 = "S",
|
||||
#' AMP_ED20 = "S")
|
||||
#' guess_ab_col(df, "ampicillin")
|
||||
#' # [1] "AMP_ED20"
|
||||
guess_ab_col <- function(x = NULL, search_string = NULL, verbose = FALSE) {
|
||||
meet_criteria(x, allow_class = "data.frame", allow_NULL = TRUE)
|
||||
meet_criteria(search_string, allow_class = "character", has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(verbose, allow_class = "logical", has_length = 1)
|
||||
|
||||
if (is.null(x) & is.null(search_string)) {
|
||||
return(as.name("guess_ab_col"))
|
||||
}
|
||||
|
||||
if (search_string %in% colnames(x)) {
|
||||
ab_result <- search_string
|
||||
} else {
|
||||
search_string.ab <- suppressWarnings(as.ab(search_string))
|
||||
if (search_string.ab %in% colnames(x)) {
|
||||
ab_result <- colnames(x)[colnames(x) == search_string.ab][1L]
|
||||
|
||||
} else if (any(tolower(colnames(x)) %in% tolower(unlist(ab_property(search_string.ab, "abbreviations", language = NULL))))) {
|
||||
ab_result <- colnames(x)[tolower(colnames(x)) %in% tolower(unlist(ab_property(search_string.ab, "abbreviations", language = NULL)))][1L]
|
||||
|
||||
} else {
|
||||
# sort colnames on length - longest first
|
||||
cols <- colnames(x[, x %pm>% colnames() %pm>% nchar() %pm>% order() %pm>% rev()])
|
||||
df_trans <- data.frame(cols = cols,
|
||||
abs = suppressWarnings(as.ab(cols)),
|
||||
stringsAsFactors = FALSE)
|
||||
ab_result <- df_trans[which(df_trans$abs == search_string.ab), "cols"]
|
||||
ab_result <- ab_result[!is.na(ab_result)][1L]
|
||||
}
|
||||
}
|
||||
|
||||
if (length(ab_result) == 0) {
|
||||
if (verbose == TRUE) {
|
||||
message_("No column found as input for ", search_string,
|
||||
" (", ab_name(search_string, language = NULL, tolower = TRUE), ").",
|
||||
add_fn = font_black,
|
||||
as_note = FALSE)
|
||||
}
|
||||
return(NULL)
|
||||
} else {
|
||||
if (verbose == TRUE) {
|
||||
message_("Using column '", font_bold(ab_result), "' as input for ", search_string,
|
||||
" (", ab_name(search_string, language = NULL, tolower = TRUE), ").")
|
||||
}
|
||||
return(ab_result)
|
||||
}
|
||||
}
|
||||
|
||||
get_column_abx <- function(x,
|
||||
soft_dependencies = NULL,
|
||||
hard_dependencies = NULL,
|
||||
verbose = FALSE,
|
||||
info = TRUE,
|
||||
...) {
|
||||
meet_criteria(x, allow_class = "data.frame")
|
||||
meet_criteria(soft_dependencies, allow_class = "character", allow_NULL = TRUE)
|
||||
meet_criteria(hard_dependencies, allow_class = "character", allow_NULL = TRUE)
|
||||
meet_criteria(verbose, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(info, allow_class = "logical", has_length = 1)
|
||||
|
||||
if (info == TRUE) {
|
||||
message_("Auto-guessing columns suitable for analysis", appendLF = FALSE)
|
||||
}
|
||||
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
if (NROW(x) > 10000) {
|
||||
# only test maximum of 10,000 values per column
|
||||
if (info == TRUE) {
|
||||
message_(" (using only ", font_bold("the first 10,000 rows"), ")...",
|
||||
appendLF = FALSE,
|
||||
as_note = FALSE)
|
||||
}
|
||||
x <- x[1:10000, , drop = FALSE]
|
||||
} else if (info == TRUE) {
|
||||
message_("...", appendLF = FALSE, as_note = FALSE)
|
||||
}
|
||||
x_bak <- x
|
||||
# only check columns that are a valid AB code, ATC code, name, abbreviation or synonym,
|
||||
# or already have the <rsi> class (as.rsi)
|
||||
# and that they have no more than 50% invalid values
|
||||
vectr_antibiotics <- unique(toupper(unlist(antibiotics[, c("ab", "atc", "name", "abbreviations", "synonyms")])))
|
||||
vectr_antibiotics <- vectr_antibiotics[!is.na(vectr_antibiotics) & nchar(vectr_antibiotics) >= 3]
|
||||
x_columns <- vapply(FUN.VALUE = character(1), colnames(x), function(col, df = x_bak) {
|
||||
if (toupper(col) %in% vectr_antibiotics ||
|
||||
is.rsi(as.data.frame(df, stringsAsFactors = FALSE)[, col, drop = TRUE]) ||
|
||||
is.rsi.eligible(as.data.frame(df, stringsAsFactors = FALSE)[, col, drop = TRUE],
|
||||
threshold = 0.5)) {
|
||||
return(col)
|
||||
} else {
|
||||
return(NA_character_)
|
||||
}
|
||||
})
|
||||
x_columns <- x_columns[!is.na(x_columns)]
|
||||
x <- x[, x_columns, drop = FALSE] # without drop = TRUE, x will become a vector when x_columns is length 1
|
||||
|
||||
df_trans <- data.frame(colnames = colnames(x),
|
||||
abcode = suppressWarnings(as.ab(colnames(x), info = FALSE)),
|
||||
stringsAsFactors = FALSE)
|
||||
df_trans <- df_trans[!is.na(df_trans$abcode), , drop = FALSE]
|
||||
x <- as.character(df_trans$colnames)
|
||||
names(x) <- df_trans$abcode
|
||||
|
||||
# add from self-defined dots (...):
|
||||
# such as get_column_abx(example_isolates %pm>% rename(thisone = AMX), amox = "thisone")
|
||||
dots <- list(...)
|
||||
if (length(dots) > 0) {
|
||||
newnames <- suppressWarnings(as.ab(names(dots), info = FALSE))
|
||||
if (any(is.na(newnames))) {
|
||||
warning_("Invalid antibiotic reference(s): ", toString(names(dots)[is.na(newnames)]),
|
||||
call = FALSE,
|
||||
immediate = TRUE)
|
||||
}
|
||||
# turn all NULLs to NAs
|
||||
dots <- unlist(lapply(dots, function(x) if (is.null(x)) NA else x))
|
||||
names(dots) <- newnames
|
||||
dots <- dots[!is.na(names(dots))]
|
||||
# merge, but overwrite automatically determined ones by 'dots'
|
||||
x <- c(x[!x %in% dots & !names(x) %in% names(dots)], dots)
|
||||
# delete NAs, this will make e.g. eucast_rules(... TMP = NULL) work to prevent TMP from being used
|
||||
x <- x[!is.na(x)]
|
||||
}
|
||||
|
||||
if (length(x) == 0) {
|
||||
if (info == TRUE) {
|
||||
message_("No columns found.")
|
||||
}
|
||||
return(x)
|
||||
}
|
||||
|
||||
# sort on name
|
||||
x <- x[order(names(x), x)]
|
||||
duplicates <- c(x[duplicated(x)], x[duplicated(names(x))])
|
||||
duplicates <- duplicates[unique(names(duplicates))]
|
||||
x <- c(x[!names(x) %in% names(duplicates)], duplicates)
|
||||
x <- x[order(names(x), x)]
|
||||
|
||||
# succeeded with auto-guessing
|
||||
if (info == TRUE) {
|
||||
message_(" OK.", add_fn = list(font_green, font_bold), as_note = FALSE)
|
||||
}
|
||||
|
||||
for (i in seq_len(length(x))) {
|
||||
if (info == TRUE & verbose == TRUE & !names(x[i]) %in% names(duplicates)) {
|
||||
message_("Using column '", font_bold(x[i]), "' as input for ", names(x)[i],
|
||||
" (", ab_name(names(x)[i], tolower = TRUE, language = NULL), ").")
|
||||
}
|
||||
if (info == TRUE & names(x[i]) %in% names(duplicates)) {
|
||||
warning_(paste0("Using column '", font_bold(x[i]), "' as input for ", names(x)[i],
|
||||
" (", ab_name(names(x)[i], tolower = TRUE, language = NULL),
|
||||
"), although it was matched for multiple antibiotics or columns."),
|
||||
add_fn = font_red,
|
||||
call = FALSE,
|
||||
immediate = verbose)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!is.null(hard_dependencies)) {
|
||||
hard_dependencies <- unique(hard_dependencies)
|
||||
if (!all(hard_dependencies %in% names(x))) {
|
||||
# missing a hard dependency will return NA and consequently the data will not be analysed
|
||||
missing <- hard_dependencies[!hard_dependencies %in% names(x)]
|
||||
generate_warning_abs_missing(missing, any = FALSE)
|
||||
return(NA)
|
||||
}
|
||||
}
|
||||
if (!is.null(soft_dependencies)) {
|
||||
soft_dependencies <- unique(soft_dependencies)
|
||||
if (info == TRUE & !all(soft_dependencies %in% names(x))) {
|
||||
# missing a soft dependency may lower the reliability
|
||||
missing <- soft_dependencies[!soft_dependencies %in% names(x)]
|
||||
missing_msg <- paste(paste0(ab_name(missing, tolower = TRUE, language = NULL),
|
||||
" (", font_bold(missing, collapse = NULL), ")"),
|
||||
collapse = ", ")
|
||||
message_("Reliability would be improved if these antimicrobial results would be available too: ",
|
||||
missing_msg)
|
||||
}
|
||||
}
|
||||
x
|
||||
}
|
||||
|
||||
generate_warning_abs_missing <- function(missing, any = FALSE) {
|
||||
missing <- paste0(missing, " (", ab_name(missing, tolower = TRUE, language = NULL), ")")
|
||||
if (any == TRUE) {
|
||||
any_txt <- c(" any of", "is")
|
||||
} else {
|
||||
any_txt <- c("", "are")
|
||||
}
|
||||
warning_(paste0("Introducing NAs since", any_txt[1], " these antimicrobials ", any_txt[2], " required: ",
|
||||
paste(missing, collapse = ", ")),
|
||||
immediate = TRUE,
|
||||
call = FALSE)
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Create identifier of an isolate
|
||||
#'
|
||||
#' This function will paste the microorganism code with all antimicrobial results into one string for each row in a data set. This is useful to compare isolates, e.g. between institutions or regions, when there is no genotyping available.
|
||||
#' @inheritSection lifecycle Maturing lifecycle
|
||||
#' @inheritParams eucast_rules
|
||||
#' @param cols_ab a character vector of column names of `x`, or (a combination with) an [antibiotic selector function]([ab_class()]), such as [carbapenems()] and [aminoglycosides()]
|
||||
#' @export
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # automatic selection of microorganism and antibiotics (i.e., all <rsi> columns, see ?as.rsi)
|
||||
#' x <- isolate_identifier(example_isolates)
|
||||
#'
|
||||
#' # ignore microorganism codes, only use antimicrobial results
|
||||
#' x <- isolate_identifier(example_isolates, col_mo = FALSE, cols_ab = c("AMX", "TZP", "GEN", "TOB"))
|
||||
#'
|
||||
#' # select antibiotics from certain antibiotic classes
|
||||
#' x <- isolate_identifier(example_isolates, cols_ab = c(carbapenems(), aminoglycosides()))
|
||||
isolate_identifier <- function(x, col_mo = NULL, cols_ab = NULL) {
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(x, "mo")
|
||||
}
|
||||
if (isFALSE(col_mo)) {
|
||||
# is FALSE then ignore mo column
|
||||
x$col_mo <- ""
|
||||
col_mo <- "col_mo"
|
||||
} else if (!is.null(col_mo)) {
|
||||
x[, col_mo] <- paste0(as.mo(x[, col_mo, drop = TRUE]), "|")
|
||||
}
|
||||
|
||||
cols_ab <- deparse(substitute(cols_ab)) # support ab class selectors: isolate_identifier(x, cols_ab = carbapenems())
|
||||
if (identical(cols_ab, "NULL")) {
|
||||
cols_ab <- colnames(x)[vapply(FUN.VALUE = logical(1), x, is.rsi)]
|
||||
} else {
|
||||
cols_ab <- tryCatch(colnames(x[, eval(parse(text = cols_ab), envir = parent.frame())]),
|
||||
# tryCatch adds 4 calls, so total is -5
|
||||
error = function(e) stop_(e$message, call = -5))
|
||||
}
|
||||
if (length(cols_ab) == 0) {
|
||||
warning_("no columns with antimicrobial agents found", call = TRUE)
|
||||
}
|
||||
|
||||
out <- x[, c(col_mo, cols_ab), drop = FALSE]
|
||||
out <- do.call(paste, c(out, sep = ""))
|
||||
out <- gsub("NA", ".", out, fixed = TRUE)
|
||||
set_clean_class(out, new_class = c("isolate_identifier", "character"))
|
||||
}
|
||||
|
||||
#' @method print isolate_identifier
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.isolate_identifier <- function(x, ...) {
|
||||
print(as.character(x), ...)
|
||||
}
|
||||
|
||||
#' @method [ isolate_identifier
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[.isolate_identifier" <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
#' @method [[ isolate_identifier
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[[.isolate_identifier" <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
#' @method [<- isolate_identifier
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[<-.isolate_identifier" <- function(i, j, ..., value) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(i)
|
||||
y
|
||||
}
|
||||
#' @method [[<- isolate_identifier
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[[<-.isolate_identifier" <- function(i, j, ..., value) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(i)
|
||||
y
|
||||
}
|
||||
#' @method c isolate_identifier
|
||||
#' @export
|
||||
#' @noRd
|
||||
c.isolate_identifier <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
|
||||
#' @method unique isolate_identifier
|
||||
#' @export
|
||||
#' @noRd
|
||||
unique.isolate_identifier <- function(x, incomparables = FALSE, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
@@ -1,286 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Join [microorganisms] to a data set
|
||||
#'
|
||||
#' Join the data set [microorganisms] easily to an existing table or character vector.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @rdname join
|
||||
#' @name join
|
||||
#' @aliases join inner_join
|
||||
#' @param x existing table to join, or character vector
|
||||
#' @param by a variable to join by - if left empty will search for a column with class [`mo`] (created with [as.mo()]) or will be `"mo"` if that column name exists in `x`, could otherwise be a column name of `x` with values that exist in `microorganisms$mo` (such as `by = "bacteria_id"`), or another column in [microorganisms] (but then it should be named, like `by = c("bacteria_id" = "fullname")`)
|
||||
#' @param suffix if there are non-joined duplicate variables in `x` and `y`, these suffixes will be added to the output to disambiguate them. Should be a character vector of length 2.
|
||||
#' @param ... ignored
|
||||
#' @details **Note:** As opposed to the `join()` functions of `dplyr`, [character] vectors are supported and at default existing columns will get a suffix `"2"` and the newly joined columns will not get a suffix.
|
||||
#'
|
||||
#' If the `dplyr` package is installed, their join functions will be used. Otherwise, the much slower [merge()] function from base R will be used.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @export
|
||||
#' @examples
|
||||
#' left_join_microorganisms(as.mo("K. pneumoniae"))
|
||||
#' left_join_microorganisms("B_KLBSL_PNE")
|
||||
#'
|
||||
#' \donttest{
|
||||
#' if (require("dplyr")) {
|
||||
#' example_isolates %>%
|
||||
#' left_join_microorganisms() %>%
|
||||
#' colnames()
|
||||
#'
|
||||
#' df <- data.frame(date = seq(from = as.Date("2018-01-01"),
|
||||
#' to = as.Date("2018-01-07"),
|
||||
#' by = 1),
|
||||
#' bacteria = as.mo(c("S. aureus", "MRSA", "MSSA", "STAAUR",
|
||||
#' "E. coli", "E. coli", "E. coli")),
|
||||
#' stringsAsFactors = FALSE)
|
||||
#' colnames(df)
|
||||
#' df_joined <- left_join_microorganisms(df, "bacteria")
|
||||
#' colnames(df_joined)
|
||||
#' }
|
||||
#' }
|
||||
inner_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
|
||||
meet_criteria(x, allow_class = c("data.frame", "character"))
|
||||
meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
|
||||
meet_criteria(suffix, allow_class = "character", has_length = 2)
|
||||
|
||||
check_dataset_integrity()
|
||||
x <- check_groups_before_join(x, "inner_join_microorganisms")
|
||||
checked <- joins_check_df(x, by)
|
||||
x_class <- get_prejoined_class(x)
|
||||
x <- checked$x
|
||||
by <- checked$by
|
||||
# use dplyr if available - it's much faster
|
||||
dplyr_inner <- import_fn("inner_join", "dplyr", error_on_fail = FALSE)
|
||||
if (!is.null(dplyr_inner)) {
|
||||
join <- suppressWarnings(
|
||||
dplyr_inner(x = x, y = microorganisms, by = by, suffix = suffix, ...)
|
||||
)
|
||||
} else {
|
||||
join <- suppressWarnings(
|
||||
pm_inner_join(x = x, y = microorganisms, by = by, suffix = suffix, ...)
|
||||
)
|
||||
}
|
||||
if (NROW(join) > NROW(x)) {
|
||||
warning_("The newly joined tbl contains ", nrow(join) - nrow(x), " rows more that its original.")
|
||||
}
|
||||
class(join) <- x_class
|
||||
join
|
||||
}
|
||||
|
||||
#' @rdname join
|
||||
#' @export
|
||||
left_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
|
||||
meet_criteria(x, allow_class = c("data.frame", "character"))
|
||||
meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
|
||||
meet_criteria(suffix, allow_class = "character", has_length = 2)
|
||||
|
||||
check_dataset_integrity()
|
||||
x <- check_groups_before_join(x, "left_join_microorganisms")
|
||||
checked <- joins_check_df(x, by)
|
||||
x_class <- get_prejoined_class(x)
|
||||
x <- checked$x
|
||||
by <- checked$by
|
||||
# use dplyr if available - it's much faster
|
||||
dplyr_left <- import_fn("left_join", "dplyr", error_on_fail = FALSE)
|
||||
if (!is.null(dplyr_left)) {
|
||||
join <- suppressWarnings(
|
||||
dplyr_left(x = x, y = microorganisms, by = by, suffix = suffix, ...)
|
||||
)
|
||||
} else {
|
||||
join <- suppressWarnings(
|
||||
pm_left_join(x = x, y = microorganisms, by = by, suffix = suffix, ...)
|
||||
)
|
||||
}
|
||||
if (NROW(join) > NROW(x)) {
|
||||
warning_("The newly joined tbl contains ", nrow(join) - nrow(x), " rows more that its original.")
|
||||
}
|
||||
class(join) <- x_class
|
||||
join
|
||||
}
|
||||
|
||||
#' @rdname join
|
||||
#' @export
|
||||
right_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
|
||||
meet_criteria(x, allow_class = c("data.frame", "character"))
|
||||
meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
|
||||
meet_criteria(suffix, allow_class = "character", has_length = 2)
|
||||
|
||||
check_dataset_integrity()
|
||||
x <- check_groups_before_join(x, "right_join_microorganisms")
|
||||
checked <- joins_check_df(x, by)
|
||||
x_class <- get_prejoined_class(x)
|
||||
x <- checked$x
|
||||
by <- checked$by
|
||||
# use dplyr if available - it's much faster
|
||||
dplyr_right <- import_fn("right_join", "dplyr", error_on_fail = FALSE)
|
||||
if (!is.null(dplyr_right)) {
|
||||
join <- suppressWarnings(
|
||||
dplyr_right(x = x, y = microorganisms, by = by, suffix = suffix, ...)
|
||||
)
|
||||
} else {
|
||||
join <- suppressWarnings(
|
||||
pm_right_join(x = x, y = microorganisms, by = by, suffix = suffix, ...)
|
||||
)
|
||||
}
|
||||
if (NROW(join) > NROW(x)) {
|
||||
warning_("The newly joined tbl contains ", nrow(join) - nrow(x), " rows more that its original.")
|
||||
}
|
||||
class(join) <- x_class
|
||||
join
|
||||
}
|
||||
|
||||
#' @rdname join
|
||||
#' @export
|
||||
full_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
|
||||
meet_criteria(x, allow_class = c("data.frame", "character"))
|
||||
meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
|
||||
meet_criteria(suffix, allow_class = "character", has_length = 2)
|
||||
|
||||
check_dataset_integrity()
|
||||
x <- check_groups_before_join(x, "full_join_microorganisms")
|
||||
checked <- joins_check_df(x, by)
|
||||
x_class <- get_prejoined_class(x)
|
||||
x <- checked$x
|
||||
by <- checked$by
|
||||
# use dplyr if available - it's much faster
|
||||
dplyr_full <- import_fn("full_join", "dplyr", error_on_fail = FALSE)
|
||||
if (!is.null(dplyr_full)) {
|
||||
join <- suppressWarnings(
|
||||
dplyr_full(x = x, y = microorganisms, by = by, suffix = suffix, ...)
|
||||
)
|
||||
} else {
|
||||
join <- suppressWarnings(
|
||||
pm_full_join(x = x, y = microorganisms, by = by, suffix = suffix, ...)
|
||||
)
|
||||
}
|
||||
if (NROW(join) > NROW(x)) {
|
||||
warning_("The newly joined tbl contains ", nrow(join) - nrow(x), " rows more that its original.")
|
||||
}
|
||||
class(join) <- x_class
|
||||
join
|
||||
}
|
||||
|
||||
#' @rdname join
|
||||
#' @export
|
||||
semi_join_microorganisms <- function(x, by = NULL, ...) {
|
||||
meet_criteria(x, allow_class = c("data.frame", "character"))
|
||||
meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
|
||||
|
||||
check_dataset_integrity()
|
||||
x <- check_groups_before_join(x, "semi_join_microorganisms")
|
||||
x_class <- get_prejoined_class(x)
|
||||
checked <- joins_check_df(x, by)
|
||||
x <- checked$x
|
||||
by <- checked$by
|
||||
# use dplyr if available - it's much faster
|
||||
dplyr_semi <- import_fn("semi_join", "dplyr", error_on_fail = FALSE)
|
||||
if (!is.null(dplyr_semi)) {
|
||||
join <- suppressWarnings(
|
||||
dplyr_semi(x = x, y = microorganisms, by = by, ...)
|
||||
)
|
||||
} else {
|
||||
join <- suppressWarnings(
|
||||
pm_semi_join(x = x, y = microorganisms, by = by, ...)
|
||||
)
|
||||
}
|
||||
class(join) <- x_class
|
||||
join
|
||||
}
|
||||
|
||||
#' @rdname join
|
||||
#' @export
|
||||
anti_join_microorganisms <- function(x, by = NULL, ...) {
|
||||
meet_criteria(x, allow_class = c("data.frame", "character"))
|
||||
meet_criteria(by, allow_class = "character", allow_NULL = TRUE)
|
||||
|
||||
check_dataset_integrity()
|
||||
x <- check_groups_before_join(x, "anti_join_microorganisms")
|
||||
checked <- joins_check_df(x, by)
|
||||
x_class <- get_prejoined_class(x)
|
||||
x <- checked$x
|
||||
by <- checked$by
|
||||
# use dplyr if available - it's much faster
|
||||
dplyr_anti <- import_fn("anti_join", "dplyr", error_on_fail = FALSE)
|
||||
if (!is.null(dplyr_anti)) {
|
||||
join <- suppressWarnings(
|
||||
dplyr_anti(x = x, y = microorganisms, by = by, ...)
|
||||
)
|
||||
} else {
|
||||
join <- suppressWarnings(
|
||||
pm_anti_join(x = x, y = microorganisms, by = by, ...)
|
||||
)
|
||||
}
|
||||
class(join) <- x_class
|
||||
join
|
||||
}
|
||||
|
||||
joins_check_df <- function(x, by) {
|
||||
if (!any(class(x) %in% c("data.frame", "matrix"))) {
|
||||
x <- data.frame(mo = as.mo(x), stringsAsFactors = FALSE)
|
||||
if (is.null(by)) {
|
||||
by <- "mo"
|
||||
}
|
||||
}
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
if (is.null(by)) {
|
||||
# search for column with class `mo` and return first one found
|
||||
by <- colnames(x)[lapply(x, is.mo) == TRUE][1]
|
||||
if (is.na(by)) {
|
||||
if ("mo" %in% colnames(x)) {
|
||||
by <- "mo"
|
||||
x[, "mo"] <- as.mo(x[, "mo"])
|
||||
} else {
|
||||
stop("Cannot join - no column found with name 'mo' or with class <mo>.", call. = FALSE)
|
||||
}
|
||||
}
|
||||
message_('Joining, by = "', by, '"', add_fn = font_black, as_note = FALSE) # message same as dplyr::join functions
|
||||
}
|
||||
if (is.null(names(by))) {
|
||||
joinby <- colnames(microorganisms)[1]
|
||||
names(joinby) <- by
|
||||
} else {
|
||||
joinby <- by
|
||||
}
|
||||
list(x = x,
|
||||
by = joinby)
|
||||
}
|
||||
|
||||
get_prejoined_class <- function(x) {
|
||||
if (is.data.frame(x)) {
|
||||
class(x)
|
||||
} else {
|
||||
"data.frame"
|
||||
}
|
||||
}
|
||||
|
||||
check_groups_before_join <- function(x, fn) {
|
||||
if (is.data.frame(x) && !is.null(attributes(x)$groups)) {
|
||||
x <- pm_ungroup(x)
|
||||
attr(x, "groups") <- NULL
|
||||
class(x) <- class(x)[!class(x) %like% "group"]
|
||||
warning_("Groups are dropped, since the ", fn, "() function relies on merge() from base R.", call = FALSE)
|
||||
}
|
||||
x
|
||||
}
|
||||
@@ -1,372 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Key antibiotics for first *weighted* isolates
|
||||
#'
|
||||
#' These function can be used to determine first isolates (see [first_isolate()]). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates can then be called first *weighted* isolates.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x a [data.frame] with antibiotics columns, like `AMX` or `amox`. Can be left blank when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`.
|
||||
#' @param y,z character vectors to compare
|
||||
#' @inheritParams first_isolate
|
||||
#' @param universal_1,universal_2,universal_3,universal_4,universal_5,universal_6 column names of **broad-spectrum** antibiotics, case-insensitive. See details for which antibiotics will be used at default (which are guessed with [guess_ab_col()]).
|
||||
#' @param GramPos_1,GramPos_2,GramPos_3,GramPos_4,GramPos_5,GramPos_6 column names of antibiotics for **Gram-positives**, case-insensitive. See details for which antibiotics will be used at default (which are guessed with [guess_ab_col()]).
|
||||
#' @param GramNeg_1,GramNeg_2,GramNeg_3,GramNeg_4,GramNeg_5,GramNeg_6 column names of antibiotics for **Gram-negatives**, case-insensitive. See details for which antibiotics will be used at default (which are guessed with [guess_ab_col()]).
|
||||
#' @param warnings give a warning about missing antibiotic columns (they will be ignored)
|
||||
#' @param ... other arguments passed on to functions
|
||||
#' @details
|
||||
#' The [key_antibiotics()] function is context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the `x` argument can be left blank, please see *Examples*.
|
||||
#'
|
||||
#' The function [key_antibiotics()] returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using [key_antibiotics_equal()], to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (`"."`) by [key_antibiotics()] and ignored by [key_antibiotics_equal()].
|
||||
#'
|
||||
#' The [first_isolate()] function only uses this function on the same microbial species from the same patient. Using this, e.g. an MRSA will be included after a susceptible *S. aureus* (MSSA) is found within the same patient episode. Without key antibiotic comparison it would not. See [first_isolate()] for more info.
|
||||
#'
|
||||
#' At default, the antibiotics that are used for **Gram-positive bacteria** are:
|
||||
#' - Amoxicillin
|
||||
#' - Amoxicillin/clavulanic acid
|
||||
#' - Cefuroxime
|
||||
#' - Piperacillin/tazobactam
|
||||
#' - Ciprofloxacin
|
||||
#' - Trimethoprim/sulfamethoxazole
|
||||
#' - Vancomycin
|
||||
#' - Teicoplanin
|
||||
#' - Tetracycline
|
||||
#' - Erythromycin
|
||||
#' - Oxacillin
|
||||
#' - Rifampin
|
||||
#'
|
||||
#' At default the antibiotics that are used for **Gram-negative bacteria** are:
|
||||
#' - Amoxicillin
|
||||
#' - Amoxicillin/clavulanic acid
|
||||
#' - Cefuroxime
|
||||
#' - Piperacillin/tazobactam
|
||||
#' - Ciprofloxacin
|
||||
#' - Trimethoprim/sulfamethoxazole
|
||||
#' - Gentamicin
|
||||
#' - Tobramycin
|
||||
#' - Colistin
|
||||
#' - Cefotaxime
|
||||
#' - Ceftazidime
|
||||
#' - Meropenem
|
||||
#'
|
||||
#' The function [key_antibiotics_equal()] checks the characters returned by [key_antibiotics()] for equality, and returns a [`logical`] vector.
|
||||
#' @inheritSection first_isolate Key antibiotics
|
||||
#' @rdname key_antibiotics
|
||||
#' @export
|
||||
#' @seealso [first_isolate()]
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # `example_isolates` is a dataset available in the AMR package.
|
||||
#' # See ?example_isolates.
|
||||
#'
|
||||
#' # output of the `key_antibiotics()` function could be like this:
|
||||
#' strainA <- "SSSRR.S.R..S"
|
||||
#' strainB <- "SSSIRSSSRSSS"
|
||||
#'
|
||||
#' # those strings can be compared with:
|
||||
#' key_antibiotics_equal(strainA, strainB)
|
||||
#' # TRUE, because I is ignored (as well as missing values)
|
||||
#'
|
||||
#' key_antibiotics_equal(strainA, strainB, ignore_I = FALSE)
|
||||
#' # FALSE, because I is not ignored and so the 4th character differs
|
||||
#'
|
||||
#' \donttest{
|
||||
#' if (require("dplyr")) {
|
||||
#' # set key antibiotics to a new variable
|
||||
#' my_patients <- example_isolates %>%
|
||||
#' mutate(keyab = key_antibiotics()) %>% # no need to define `x`
|
||||
#' mutate(
|
||||
#' # now calculate first isolates
|
||||
#' first_regular = first_isolate(col_keyantibiotics = FALSE),
|
||||
#' # and first WEIGHTED isolates
|
||||
#' first_weighted = first_isolate(col_keyantibiotics = "keyab")
|
||||
#' )
|
||||
#'
|
||||
#' # Check the difference, in this data set it results in a lot more isolates:
|
||||
#' sum(my_patients$first_regular, na.rm = TRUE)
|
||||
#' sum(my_patients$first_weighted, na.rm = TRUE)
|
||||
#' }
|
||||
#' }
|
||||
key_antibiotics <- function(x,
|
||||
col_mo = NULL,
|
||||
universal_1 = guess_ab_col(x, "amoxicillin"),
|
||||
universal_2 = guess_ab_col(x, "amoxicillin/clavulanic acid"),
|
||||
universal_3 = guess_ab_col(x, "cefuroxime"),
|
||||
universal_4 = guess_ab_col(x, "piperacillin/tazobactam"),
|
||||
universal_5 = guess_ab_col(x, "ciprofloxacin"),
|
||||
universal_6 = guess_ab_col(x, "trimethoprim/sulfamethoxazole"),
|
||||
GramPos_1 = guess_ab_col(x, "vancomycin"),
|
||||
GramPos_2 = guess_ab_col(x, "teicoplanin"),
|
||||
GramPos_3 = guess_ab_col(x, "tetracycline"),
|
||||
GramPos_4 = guess_ab_col(x, "erythromycin"),
|
||||
GramPos_5 = guess_ab_col(x, "oxacillin"),
|
||||
GramPos_6 = guess_ab_col(x, "rifampin"),
|
||||
GramNeg_1 = guess_ab_col(x, "gentamicin"),
|
||||
GramNeg_2 = guess_ab_col(x, "tobramycin"),
|
||||
GramNeg_3 = guess_ab_col(x, "colistin"),
|
||||
GramNeg_4 = guess_ab_col(x, "cefotaxime"),
|
||||
GramNeg_5 = guess_ab_col(x, "ceftazidime"),
|
||||
GramNeg_6 = guess_ab_col(x, "meropenem"),
|
||||
warnings = TRUE,
|
||||
...) {
|
||||
if (missing(x)) {
|
||||
x <- get_current_data(arg_name = "x", call = -2)
|
||||
}
|
||||
meet_criteria(x, allow_class = "data.frame")
|
||||
meet_criteria(col_mo, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(universal_1, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(universal_2, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(universal_3, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(universal_4, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(universal_5, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(universal_6, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramPos_1, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramPos_2, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramPos_3, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramPos_4, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramPos_5, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramPos_6, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramNeg_1, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramNeg_2, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramNeg_3, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramNeg_4, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramNeg_5, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(GramNeg_6, allow_class = "character", has_length = 1, allow_NULL = TRUE, allow_NA = TRUE)
|
||||
meet_criteria(warnings, allow_class = "logical", has_length = 1)
|
||||
|
||||
dots <- unlist(list(...))
|
||||
if (length(dots) != 0) {
|
||||
# backwards compatibility with old arguments
|
||||
dots.names <- dots %pm>% names()
|
||||
if ("info" %in% dots.names) {
|
||||
warnings <- dots[which(dots.names == "info")]
|
||||
}
|
||||
}
|
||||
|
||||
# try to find columns based on type
|
||||
# -- mo
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(x = x, type = "mo")
|
||||
}
|
||||
stop_if(is.null(col_mo), "`col_mo` must be set")
|
||||
|
||||
# check columns
|
||||
col.list <- c(universal_1, universal_2, universal_3, universal_4, universal_5, universal_6,
|
||||
GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6,
|
||||
GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6)
|
||||
check_available_columns <- function(x, col.list, warnings = TRUE) {
|
||||
# check columns
|
||||
col.list <- col.list[!is.na(col.list) & !is.null(col.list)]
|
||||
names(col.list) <- col.list
|
||||
col.list.bak <- col.list
|
||||
# are they available as upper case or lower case then?
|
||||
for (i in seq_len(length(col.list))) {
|
||||
if (is.null(col.list[i]) | isTRUE(is.na(col.list[i]))) {
|
||||
col.list[i] <- NA
|
||||
} else if (toupper(col.list[i]) %in% colnames(x)) {
|
||||
col.list[i] <- toupper(col.list[i])
|
||||
} else if (tolower(col.list[i]) %in% colnames(x)) {
|
||||
col.list[i] <- tolower(col.list[i])
|
||||
} else if (!col.list[i] %in% colnames(x)) {
|
||||
col.list[i] <- NA
|
||||
}
|
||||
}
|
||||
if (!all(col.list %in% colnames(x))) {
|
||||
if (warnings == TRUE) {
|
||||
warning_("Some columns do not exist and will be ignored: ",
|
||||
col.list.bak[!(col.list %in% colnames(x))] %pm>% toString(),
|
||||
".\nTHIS MAY STRONGLY INFLUENCE THE OUTCOME.",
|
||||
immediate = TRUE,
|
||||
call = FALSE)
|
||||
}
|
||||
}
|
||||
col.list
|
||||
}
|
||||
|
||||
col.list <- check_available_columns(x = x, col.list = col.list, warnings = warnings)
|
||||
universal_1 <- col.list[universal_1]
|
||||
universal_2 <- col.list[universal_2]
|
||||
universal_3 <- col.list[universal_3]
|
||||
universal_4 <- col.list[universal_4]
|
||||
universal_5 <- col.list[universal_5]
|
||||
universal_6 <- col.list[universal_6]
|
||||
GramPos_1 <- col.list[GramPos_1]
|
||||
GramPos_2 <- col.list[GramPos_2]
|
||||
GramPos_3 <- col.list[GramPos_3]
|
||||
GramPos_4 <- col.list[GramPos_4]
|
||||
GramPos_5 <- col.list[GramPos_5]
|
||||
GramPos_6 <- col.list[GramPos_6]
|
||||
GramNeg_1 <- col.list[GramNeg_1]
|
||||
GramNeg_2 <- col.list[GramNeg_2]
|
||||
GramNeg_3 <- col.list[GramNeg_3]
|
||||
GramNeg_4 <- col.list[GramNeg_4]
|
||||
GramNeg_5 <- col.list[GramNeg_5]
|
||||
GramNeg_6 <- col.list[GramNeg_6]
|
||||
|
||||
universal <- c(universal_1, universal_2, universal_3,
|
||||
universal_4, universal_5, universal_6)
|
||||
|
||||
gram_positive <- c(universal,
|
||||
GramPos_1, GramPos_2, GramPos_3,
|
||||
GramPos_4, GramPos_5, GramPos_6)
|
||||
gram_positive <- gram_positive[!is.null(gram_positive)]
|
||||
gram_positive <- gram_positive[!is.na(gram_positive)]
|
||||
if (length(gram_positive) < 12) {
|
||||
warning_("Only using ", length(gram_positive), " different antibiotics as key antibiotics for Gram-positives. See ?key_antibiotics.", call = FALSE)
|
||||
}
|
||||
|
||||
gram_negative <- c(universal,
|
||||
GramNeg_1, GramNeg_2, GramNeg_3,
|
||||
GramNeg_4, GramNeg_5, GramNeg_6)
|
||||
gram_negative <- gram_negative[!is.null(gram_negative)]
|
||||
gram_negative <- gram_negative[!is.na(gram_negative)]
|
||||
if (length(gram_negative) < 12) {
|
||||
warning_("Only using ", length(gram_negative), " different antibiotics as key antibiotics for Gram-negatives. See ?key_antibiotics.", call = FALSE)
|
||||
}
|
||||
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
x[, col_mo] <- as.mo(x[, col_mo, drop = TRUE])
|
||||
x$gramstain <- mo_gramstain(x[, col_mo, drop = TRUE], language = NULL)
|
||||
x$key_ab <- NA_character_
|
||||
|
||||
# Gram +
|
||||
x$key_ab <- pm_if_else(x$gramstain == "Gram-positive",
|
||||
tryCatch(apply(X = x[, gram_positive],
|
||||
MARGIN = 1,
|
||||
FUN = function(x) paste(x, collapse = "")),
|
||||
error = function(e) paste0(rep(".", 12), collapse = "")),
|
||||
x$key_ab)
|
||||
|
||||
# Gram -
|
||||
x$key_ab <- pm_if_else(x$gramstain == "Gram-negative",
|
||||
tryCatch(apply(X = x[, gram_negative],
|
||||
MARGIN = 1,
|
||||
FUN = function(x) paste(x, collapse = "")),
|
||||
error = function(e) paste0(rep(".", 12), collapse = "")),
|
||||
x$key_ab)
|
||||
|
||||
# format
|
||||
key_abs <- toupper(gsub("[^SIR]", ".", gsub("(NA|NULL)", ".", x$key_ab)))
|
||||
|
||||
if (pm_n_distinct(key_abs) == 1) {
|
||||
warning_("No distinct key antibiotics determined.", call = FALSE)
|
||||
}
|
||||
|
||||
key_abs
|
||||
|
||||
}
|
||||
|
||||
#' @rdname key_antibiotics
|
||||
#' @export
|
||||
key_antibiotics_equal <- function(y,
|
||||
z,
|
||||
type = c("keyantibiotics", "points"),
|
||||
ignore_I = TRUE,
|
||||
points_threshold = 2,
|
||||
info = FALSE) {
|
||||
meet_criteria(y, allow_class = "character")
|
||||
meet_criteria(z, allow_class = "character")
|
||||
meet_criteria(type, allow_class = "character", has_length = c(1, 2))
|
||||
meet_criteria(ignore_I, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(points_threshold, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(info, allow_class = "logical", has_length = 1)
|
||||
|
||||
stop_ifnot(length(y) == length(z), "length of `y` and `z` must be equal")
|
||||
# y is active row, z is lag
|
||||
x <- y
|
||||
y <- z
|
||||
|
||||
type <- type[1]
|
||||
|
||||
# only show progress bar on points or when at least 5000 isolates
|
||||
info_needed <- info == TRUE & (type == "points" | length(x) > 5000)
|
||||
|
||||
result <- logical(length(x))
|
||||
|
||||
if (info_needed == TRUE) {
|
||||
p <- progress_ticker(length(x))
|
||||
on.exit(close(p))
|
||||
}
|
||||
|
||||
for (i in seq_len(length(x))) {
|
||||
|
||||
if (info_needed == TRUE) {
|
||||
p$tick()
|
||||
}
|
||||
|
||||
if (is.na(x[i])) {
|
||||
x[i] <- ""
|
||||
}
|
||||
if (is.na(y[i])) {
|
||||
y[i] <- ""
|
||||
}
|
||||
|
||||
if (x[i] == y[i]) {
|
||||
|
||||
result[i] <- TRUE
|
||||
|
||||
} else if (nchar(x[i]) != nchar(y[i])) {
|
||||
|
||||
result[i] <- FALSE
|
||||
|
||||
} else {
|
||||
|
||||
x_split <- strsplit(x[i], "")[[1]]
|
||||
y_split <- strsplit(y[i], "")[[1]]
|
||||
|
||||
if (type == "keyantibiotics") {
|
||||
|
||||
if (ignore_I == TRUE) {
|
||||
x_split[x_split == "I"] <- "."
|
||||
y_split[y_split == "I"] <- "."
|
||||
}
|
||||
|
||||
y_split[x_split == "."] <- "."
|
||||
x_split[y_split == "."] <- "."
|
||||
|
||||
result[i] <- all(x_split == y_split)
|
||||
|
||||
} else if (type == "points") {
|
||||
# count points for every single character:
|
||||
# - no change is 0 points
|
||||
# - I <-> S|R is 0.5 point
|
||||
# - S|R <-> R|S is 1 point
|
||||
# use the levels of as.rsi (S = 1, I = 2, R = 3)
|
||||
|
||||
suppressWarnings(x_split <- x_split %pm>% as.rsi() %pm>% as.double())
|
||||
suppressWarnings(y_split <- y_split %pm>% as.rsi() %pm>% as.double())
|
||||
|
||||
points <- (x_split - y_split) %pm>% abs() %pm>% sum(na.rm = TRUE) / 2
|
||||
result[i] <- points >= points_threshold
|
||||
|
||||
} else {
|
||||
stop("`", type, '` is not a valid value for type, must be "points" or "keyantibiotics". See ?key_antibiotics')
|
||||
}
|
||||
}
|
||||
}
|
||||
if (info_needed == TRUE) {
|
||||
close(p)
|
||||
}
|
||||
result
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Kurtosis of the sample
|
||||
#'
|
||||
#' @description Kurtosis is a measure of the "tailedness" of the probability distribution of a real-valued random variable. A normal distribution has a kurtosis of 3 and a excess kurtosis of 0.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x a vector of values, a [matrix] or a [data.frame]
|
||||
#' @param na.rm a logical to indicate whether `NA` values should be stripped before the computation proceeds
|
||||
#' @param excess a logical to indicate whether the *excess kurtosis* should be returned, defined as the kurtosis minus 3.
|
||||
#' @seealso [skewness()]
|
||||
#' @rdname kurtosis
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @export
|
||||
kurtosis <- function(x, na.rm = FALSE, excess = FALSE) {
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(excess, allow_class = "logical", has_length = 1)
|
||||
UseMethod("kurtosis")
|
||||
}
|
||||
|
||||
#' @method kurtosis default
|
||||
#' @rdname kurtosis
|
||||
#' @export
|
||||
kurtosis.default <- function(x, na.rm = FALSE, excess = FALSE) {
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(excess, allow_class = "logical", has_length = 1)
|
||||
x <- as.vector(x)
|
||||
if (na.rm == TRUE) {
|
||||
x <- x[!is.na(x)]
|
||||
}
|
||||
n <- length(x)
|
||||
k <- n * sum((x - mean(x, na.rm = na.rm))^4, na.rm = na.rm) /
|
||||
(sum((x - mean(x, na.rm = na.rm))^2, na.rm = na.rm)^2)
|
||||
k - ifelse(excess, 3, 0)
|
||||
}
|
||||
|
||||
#' @method kurtosis matrix
|
||||
#' @rdname kurtosis
|
||||
#' @export
|
||||
kurtosis.matrix <- function(x, na.rm = FALSE, excess = FALSE) {
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(excess, allow_class = "logical", has_length = 1)
|
||||
apply(x, 2, kurtosis.default, na.rm = na.rm, excess = excess)
|
||||
}
|
||||
|
||||
#' @method kurtosis data.frame
|
||||
#' @rdname kurtosis
|
||||
#' @export
|
||||
kurtosis.data.frame <- function(x, na.rm = FALSE, excess = FALSE) {
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(excess, allow_class = "logical", has_length = 1)
|
||||
vapply(FUN.VALUE = double(1), x, kurtosis.default, na.rm = na.rm, excess = excess)
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
###############
|
||||
# NOTE TO SELF: could also have done this with the 'lifecycle' package, but why add a package dependency for such an easy job??
|
||||
###############
|
||||
|
||||
#' Lifecycles of functions in the `AMR` package
|
||||
#' @name lifecycle
|
||||
#' @rdname lifecycle
|
||||
#' @description Functions in this `AMR` package are categorised using [the lifecycle circle of the Tidyverse as found on www.tidyverse.org/lifecycle](https://www.Tidyverse.org/lifecycle).
|
||||
#'
|
||||
#' \if{html}{\figure{lifecycle_tidyverse.svg}{options: height=200px style=margin-bottom:5px} \cr}
|
||||
#' This page contains a section for every lifecycle (with text borrowed from the aforementioned Tidyverse website), so they can be used in the manual pages of the functions.
|
||||
#' @section Experimental lifecycle:
|
||||
#' \if{html}{\figure{lifecycle_experimental.svg}{options: style=margin-bottom:5px} \cr}
|
||||
#' The [lifecycle][AMR::lifecycle] of this function is **experimental**. An experimental function is in early stages of development. The unlying code might be changing frequently. Experimental functions might be removed without deprecation, so you are generally best off waiting until a function is more mature before you use it in production code. Experimental functions are only available in development versions of this `AMR` package and will thus not be included in releases that are submitted to CRAN, since such functions have not yet matured enough.
|
||||
#' @section Maturing lifecycle:
|
||||
#' \if{html}{\figure{lifecycle_maturing.svg}{options: style=margin-bottom:5px} \cr}
|
||||
#' The [lifecycle][AMR::lifecycle] of this function is **maturing**. The unlying code of a maturing function has been roughed out, but finer details might still change. Since this function needs wider usage and more extensive testing, you are very welcome [to suggest changes at our repository](https://github.com/msberends/AMR/issues) or [write us an email (see section 'Contact Us')][AMR::AMR].
|
||||
#' @section Stable lifecycle:
|
||||
#' \if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr}
|
||||
#' The [lifecycle][AMR::lifecycle] of this function is **stable**. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
|
||||
#'
|
||||
#' If the unlying code needs breaking changes, they will occur gradually. For example, a argument will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
|
||||
#' @section Retired lifecycle:
|
||||
#' \if{html}{\figure{lifecycle_retired.svg}{options: style=margin-bottom:5px} \cr}
|
||||
#' The [lifecycle][AMR::lifecycle] of this function is **retired**. A retired function is no longer under active development, and (if appropiate) a better alternative is available. No new arguments will be added, and only the most critical bugs will be fixed. In a future version, this function will be removed.
|
||||
#' @section Questioning lifecycle:
|
||||
#' \if{html}{\figure{lifecycle_questioning.svg}{options: style=margin-bottom:5px} \cr}
|
||||
#' The [lifecycle][AMR::lifecycle] of this function is **questioning**. This function might be no longer be optimal approach, or is it questionable whether this function should be in this `AMR` package at all.
|
||||
NULL
|
||||
@@ -1,171 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Pattern matching with keyboard shortcut
|
||||
#'
|
||||
#' Convenient wrapper around [grep()] to match a pattern: `x %like% pattern`. It always returns a [`logical`] vector and is always case-insensitive (use `x %like_case% pattern` for case-sensitive matching). Also, `pattern` can be as long as `x` to compare items of each index in both vectors, or they both can have the same length to iterate over all cases.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x a character vector where matches are sought, or an object which can be coerced by [as.character()] to a character vector.
|
||||
#' @param pattern a character string containing a regular expression (or [character] string for `fixed = TRUE`) to be matched in the given character vector. Coerced by [as.character()] to a character string if possible. If a [character] vector of length 2 or more is supplied, the first element is used with a warning.
|
||||
#' @param ignore.case if `FALSE`, the pattern matching is *case sensitive* and if `TRUE`, case is ignored during matching.
|
||||
#' @return A [`logical`] vector
|
||||
#' @name like
|
||||
#' @rdname like
|
||||
#' @export
|
||||
#' @details
|
||||
#' The `%like%` function:
|
||||
#' * Is case-insensitive (use `%like_case%` for case-sensitive matching)
|
||||
#' * Supports multiple patterns
|
||||
#' * Checks if `pattern` is a regular expression and sets `fixed = TRUE` if not, to greatly improve speed
|
||||
#' * Tries again with `perl = TRUE` if regex fails
|
||||
#'
|
||||
#' Using RStudio? The text `%like%` can also be directly inserted in your code from the Addins menu and can have its own Keyboard Shortcut like `Ctrl+Shift+L` or `Cmd+Shift+L` (see `Tools` > `Modify Keyboard Shortcuts...`).
|
||||
#' @source Idea from the [`like` function from the `data.table` package](https://github.com/Rdatatable/data.table/blob/master/R/like.R)
|
||||
#' @seealso [grep()]
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # simple test
|
||||
#' a <- "This is a test"
|
||||
#' b <- "TEST"
|
||||
#' a %like% b
|
||||
#' #> TRUE
|
||||
#' b %like% a
|
||||
#' #> FALSE
|
||||
#'
|
||||
#' # also supports multiple patterns, length must be equal to x
|
||||
#' a <- c("Test case", "Something different", "Yet another thing")
|
||||
#' b <- c( "case", "diff", "yet")
|
||||
#' a %like% b
|
||||
#' #> TRUE TRUE TRUE
|
||||
#'
|
||||
#' # get isolates whose name start with 'Ent' or 'ent'
|
||||
#' \donttest{
|
||||
#' if (require("dplyr")) {
|
||||
#' example_isolates %>%
|
||||
#' filter(mo_name(mo) %like% "^ent")
|
||||
#' }
|
||||
#' }
|
||||
like <- function(x, pattern, ignore.case = TRUE) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(pattern, allow_NA = FALSE)
|
||||
meet_criteria(ignore.case, allow_class = "logical", has_length = 1)
|
||||
|
||||
# set to fixed if no regex found
|
||||
fixed <- !any(is_possibly_regex(pattern))
|
||||
if (ignore.case == TRUE) {
|
||||
# set here, otherwise if fixed = TRUE, this warning will be thrown: argument `ignore.case = TRUE` will be ignored
|
||||
x <- tolower(x)
|
||||
pattern <- tolower(pattern)
|
||||
}
|
||||
|
||||
if (length(pattern) > 1 & length(x) == 1) {
|
||||
x <- rep(x, length(pattern))
|
||||
}
|
||||
|
||||
if (all(is.na(x))) {
|
||||
return(rep(FALSE, length(x)))
|
||||
}
|
||||
|
||||
if (length(pattern) > 1) {
|
||||
res <- vector(length = length(pattern))
|
||||
if (length(x) != length(pattern)) {
|
||||
if (length(x) == 1) {
|
||||
x <- rep(x, length(pattern))
|
||||
}
|
||||
# return TRUE for every 'x' that matches any 'pattern', FALSE otherwise
|
||||
for (i in seq_len(length(res))) {
|
||||
if (is.factor(x[i])) {
|
||||
res[i] <- as.integer(x[i]) %in% grep(pattern[i], levels(x[i]), ignore.case = FALSE, fixed = fixed)
|
||||
} else {
|
||||
res[i] <- grepl(pattern[i], x[i], ignore.case = FALSE, fixed = fixed)
|
||||
}
|
||||
}
|
||||
res <- vapply(FUN.VALUE = logical(1), pattern, function(pttrn) grepl(pttrn, x, ignore.case = FALSE, fixed = fixed))
|
||||
res2 <- as.logical(rowSums(res))
|
||||
# get only first item of every hit in pattern
|
||||
res2[duplicated(res)] <- FALSE
|
||||
res2[rowSums(res) == 0] <- NA
|
||||
return(res2)
|
||||
} else {
|
||||
# x and pattern are of same length, so items with each other
|
||||
for (i in seq_len(length(res))) {
|
||||
if (is.factor(x[i])) {
|
||||
res[i] <- as.integer(x[i]) %in% grep(pattern[i], levels(x[i]), ignore.case = FALSE, fixed = fixed)
|
||||
} else {
|
||||
res[i] <- grepl(pattern[i], x[i], ignore.case = FALSE, fixed = fixed)
|
||||
}
|
||||
}
|
||||
return(res)
|
||||
}
|
||||
}
|
||||
|
||||
# the regular way how grepl works; just one pattern against one or more x
|
||||
if (is.factor(x)) {
|
||||
as.integer(x) %in% grep(pattern, levels(x), ignore.case = FALSE, fixed = fixed)
|
||||
} else {
|
||||
tryCatch(grepl(pattern, x, ignore.case = FALSE, fixed = fixed),
|
||||
error = function(e) {
|
||||
if (grepl("invalid reg(ular )?exp", e$message, ignore.case = TRUE)) {
|
||||
# try with perl = TRUE:
|
||||
return(grepl(pattern = pattern,
|
||||
x = x,
|
||||
ignore.case = FALSE,
|
||||
fixed = fixed,
|
||||
perl = TRUE))
|
||||
} else {
|
||||
# stop otherwise
|
||||
stop(e$message)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#' @rdname like
|
||||
#' @export
|
||||
"%like%" <- function(x, pattern) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(pattern, allow_NA = FALSE)
|
||||
like(x, pattern, ignore.case = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname like
|
||||
#' @export
|
||||
"%like_case%" <- function(x, pattern) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(pattern, allow_NA = FALSE)
|
||||
like(x, pattern, ignore.case = FALSE)
|
||||
}
|
||||
|
||||
"%like_perl%" <- function(x, pattern) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(pattern, allow_NA = FALSE)
|
||||
# convenient for e.g. matching all Klebsiella and Raoultella, but not
|
||||
# K. aerogenes: fullname %like_perl% "^(Klebsiella(?! aerogenes)|Raoultella)"
|
||||
grepl(x = tolower(x),
|
||||
pattern = tolower(pattern),
|
||||
perl = TRUE,
|
||||
fixed = FALSE,
|
||||
ignore.case = TRUE)
|
||||
}
|
||||
@@ -1,334 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Transform input to minimum inhibitory concentrations (MIC)
|
||||
#'
|
||||
#' This transforms a vector to a new class [`mic`], which is an ordered [factor] with valid minimum inhibitory concentrations (MIC) as levels. Invalid MIC values will be translated as `NA` with a warning.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @rdname as.mic
|
||||
#' @param x vector
|
||||
#' @param na.rm a logical indicating whether missing values should be removed
|
||||
#' @details To interpret MIC values as RSI values, use [as.rsi()] on MIC values. It supports guidelines from EUCAST and CLSI.
|
||||
#' @return Ordered [factor] with additional class [`mic`]
|
||||
#' @aliases mic
|
||||
#' @export
|
||||
#' @seealso [as.rsi()]
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' mic_data <- as.mic(c(">=32", "1.0", "1", "1.00", 8, "<=0.128", "8", "16", "16"))
|
||||
#' is.mic(mic_data)
|
||||
#'
|
||||
#' # this can also coerce combined MIC/RSI values:
|
||||
#' as.mic("<=0.002; S") # will return <=0.002
|
||||
#'
|
||||
#' # interpret MIC values
|
||||
#' as.rsi(x = as.mic(2),
|
||||
#' mo = as.mo("S. pneumoniae"),
|
||||
#' ab = "AMX",
|
||||
#' guideline = "EUCAST")
|
||||
#' as.rsi(x = as.mic(4),
|
||||
#' mo = as.mo("S. pneumoniae"),
|
||||
#' ab = "AMX",
|
||||
#' guideline = "EUCAST")
|
||||
#'
|
||||
#' plot(mic_data)
|
||||
#' barplot(mic_data)
|
||||
as.mic <- function(x, na.rm = FALSE) {
|
||||
meet_criteria(x, allow_class = c("mic", "character", "numeric", "integer"), allow_NA = TRUE)
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
|
||||
if (is.mic(x)) {
|
||||
x
|
||||
} else {
|
||||
x <- x %pm>% unlist()
|
||||
if (na.rm == TRUE) {
|
||||
x <- x[!is.na(x)]
|
||||
}
|
||||
x.bak <- x
|
||||
|
||||
# comma to period
|
||||
x <- gsub(",", ".", x, fixed = TRUE)
|
||||
# transform Unicode for >= and <=
|
||||
x <- gsub("\u2264", "<=", x, fixed = TRUE)
|
||||
x <- gsub("\u2265", ">=", x, fixed = TRUE)
|
||||
# remove space between operator and number ("<= 0.002" -> "<=0.002")
|
||||
x <- gsub("(<|=|>) +", "\\1", x)
|
||||
# transform => to >= and =< to <=
|
||||
x <- gsub("=<", "<=", x, fixed = TRUE)
|
||||
x <- gsub("=>", ">=", x, fixed = TRUE)
|
||||
# dots without a leading zero must start with 0
|
||||
x <- gsub("([^0-9]|^)[.]", "\\10.", x)
|
||||
# values like "<=0.2560.512" should be 0.512
|
||||
x <- gsub(".*[.].*[.]", "0.", x)
|
||||
# remove ending .0
|
||||
x <- gsub("[.]+0$", "", x)
|
||||
# remove all after last digit
|
||||
x <- gsub("[^0-9]+$", "", x)
|
||||
# keep only one zero before dot
|
||||
x <- gsub("0+[.]", "0.", x)
|
||||
# starting 00 is probably 0.0 if there's no dot yet
|
||||
x[!x %like% "[.]"] <- gsub("^00", "0.0", x[!x %like% "[.]"])
|
||||
# remove last zeroes
|
||||
x <- gsub("([.].?)0+$", "\\1", x)
|
||||
x <- gsub("(.*[.])0+$", "\\10", x)
|
||||
# remove ending .0 again
|
||||
x[x %like% "[.]"] <- gsub("0+$", "", x[x %like% "[.]"])
|
||||
# never end with dot
|
||||
x <- gsub("[.]$", "", x)
|
||||
# force to be character
|
||||
x <- as.character(x)
|
||||
# trim it
|
||||
x <- trimws(x)
|
||||
|
||||
## previously unempty values now empty - should return a warning later on
|
||||
x[x.bak != "" & x == ""] <- "invalid"
|
||||
|
||||
# these are allowed MIC values and will become factor levels
|
||||
ops <- c("<", "<=", "", ">=", ">")
|
||||
lvls <- c(c(t(vapply(FUN.VALUE = character(9), ops, function(x) paste0(x, "0.00", 1:9)))),
|
||||
unique(c(t(vapply(FUN.VALUE = character(104), ops, function(x) paste0(x, sort(as.double(paste0("0.0",
|
||||
sort(c(1:99, 125, 128, 256, 512, 625)))))))))),
|
||||
unique(c(t(vapply(FUN.VALUE = character(103), ops, function(x) paste0(x, sort(as.double(paste0("0.",
|
||||
c(1:99, 125, 128, 256, 512))))))))),
|
||||
c(t(vapply(FUN.VALUE = character(10), ops, function(x) paste0(x, sort(c(1:9, 1.5)))))),
|
||||
c(t(vapply(FUN.VALUE = character(45), ops, function(x) paste0(x, c(10:98)[9:98 %% 2 == TRUE])))),
|
||||
c(t(vapply(FUN.VALUE = character(15), ops, function(x) paste0(x, sort(c(2 ^ c(7:10), 80 * c(2:12))))))))
|
||||
|
||||
na_before <- x[is.na(x) | x == ""] %pm>% length()
|
||||
x[!x %in% lvls] <- NA
|
||||
na_after <- x[is.na(x) | x == ""] %pm>% length()
|
||||
|
||||
if (na_before != na_after) {
|
||||
list_missing <- x.bak[is.na(x) & !is.na(x.bak) & x.bak != ""] %pm>%
|
||||
unique() %pm>%
|
||||
sort()
|
||||
list_missing <- paste0('"', list_missing, '"', collapse = ", ")
|
||||
warning_(na_after - na_before, " results truncated (",
|
||||
round(((na_after - na_before) / length(x)) * 100),
|
||||
"%) that were invalid MICs: ",
|
||||
list_missing, call = FALSE)
|
||||
}
|
||||
|
||||
set_clean_class(factor(x, levels = lvls, ordered = TRUE),
|
||||
new_class = c("mic", "ordered", "factor"))
|
||||
}
|
||||
}
|
||||
|
||||
all_valid_mics <- function(x) {
|
||||
if (!inherits(x, c("mic", "character", "factor", "numeric", "integer"))) {
|
||||
return(FALSE)
|
||||
}
|
||||
x_mic <- tryCatch(suppressWarnings(as.mic(x[!is.na(x)])),
|
||||
error = function(e) NA)
|
||||
!any(is.na(x_mic)) && !all(is.na(x))
|
||||
}
|
||||
|
||||
#' @rdname as.mic
|
||||
#' @export
|
||||
is.mic <- function(x) {
|
||||
inherits(x, "mic")
|
||||
}
|
||||
|
||||
#' @method as.double mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
as.double.mic <- function(x, ...) {
|
||||
as.double(gsub("[<=>]+", "", as.character(x)))
|
||||
}
|
||||
|
||||
#' @method as.integer mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
as.integer.mic <- function(x, ...) {
|
||||
as.integer(gsub("[<=>]+", "", as.character(x)))
|
||||
}
|
||||
|
||||
#' @method as.numeric mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
as.numeric.mic <- function(x, ...) {
|
||||
as.numeric(gsub("[<=>]+", "", as.character(x)))
|
||||
}
|
||||
|
||||
#' @method droplevels mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
droplevels.mic <- function(x, exclude = if (any(is.na(levels(x)))) NULL else NA, ...) {
|
||||
x <- droplevels.factor(x, exclude = exclude, ...)
|
||||
class(x) <- c("mic", "ordered", "factor")
|
||||
x
|
||||
}
|
||||
|
||||
# will be exported using s3_register() in R/zzz.R
|
||||
pillar_shaft.mic <- function(x, ...) {
|
||||
crude_numbers <- as.double(x)
|
||||
operators <- gsub("[^<=>]+", "", as.character(x))
|
||||
pasted <- trimws(paste0(operators, trimws(format(crude_numbers))))
|
||||
out <- pasted
|
||||
out[is.na(x)] <- font_na(NA)
|
||||
out <- gsub("(<|=|>)", font_silver("\\1"), out)
|
||||
create_pillar_column(out, align = "right", width = max(nchar(pasted)))
|
||||
}
|
||||
|
||||
# will be exported using s3_register() in R/zzz.R
|
||||
type_sum.mic <- function(x, ...) {
|
||||
"mic"
|
||||
}
|
||||
|
||||
#' @method print mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.mic <- function(x, ...) {
|
||||
cat("Class <mic>\n")
|
||||
print(as.character(x), quote = FALSE)
|
||||
}
|
||||
|
||||
#' @method summary mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
summary.mic <- function(object, ...) {
|
||||
x <- object
|
||||
n_total <- length(x)
|
||||
x <- x[!is.na(x)]
|
||||
n <- length(x)
|
||||
value <- c("Class" = "mic",
|
||||
"<NA>" = n_total - n,
|
||||
"Min." = as.character(sort(x)[1]),
|
||||
"Max." = as.character(sort(x)[n]))
|
||||
class(value) <- c("summaryDefault", "table")
|
||||
value
|
||||
}
|
||||
|
||||
#' @method plot mic
|
||||
#' @export
|
||||
#' @importFrom graphics barplot axis
|
||||
#' @rdname plot
|
||||
plot.mic <- function(x,
|
||||
main = paste("MIC values of", deparse(substitute(x))),
|
||||
ylab = "Frequency",
|
||||
xlab = "MIC value",
|
||||
axes = FALSE,
|
||||
...) {
|
||||
meet_criteria(main, allow_class = "character", has_length = 1)
|
||||
meet_criteria(ylab, allow_class = "character", has_length = 1)
|
||||
meet_criteria(xlab, allow_class = "character", has_length = 1)
|
||||
meet_criteria(axes, allow_class = "logical", has_length = 1)
|
||||
|
||||
barplot(table(as.double(x)),
|
||||
ylab = ylab,
|
||||
xlab = xlab,
|
||||
axes = axes,
|
||||
main = main,
|
||||
...)
|
||||
axis(2, seq(0, max(table(as.double(x)))))
|
||||
}
|
||||
|
||||
#' @method barplot mic
|
||||
#' @export
|
||||
#' @importFrom graphics barplot axis
|
||||
#' @rdname plot
|
||||
barplot.mic <- function(height,
|
||||
main = paste("MIC values of", deparse(substitute(height))),
|
||||
ylab = "Frequency",
|
||||
xlab = "MIC value",
|
||||
axes = FALSE,
|
||||
...) {
|
||||
meet_criteria(main, allow_class = "character", has_length = 1)
|
||||
meet_criteria(ylab, allow_class = "character", has_length = 1)
|
||||
meet_criteria(xlab, allow_class = "character", has_length = 1)
|
||||
meet_criteria(axes, allow_class = "logical", has_length = 1)
|
||||
|
||||
barplot(table(as.double(height)),
|
||||
ylab = ylab,
|
||||
xlab = xlab,
|
||||
axes = axes,
|
||||
main = main,
|
||||
...)
|
||||
axis(2, seq(0, max(table(as.double(height)))))
|
||||
}
|
||||
|
||||
#' @method [ mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[.mic" <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
#' @method [[ mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[[.mic" <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
#' @method [<- mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[<-.mic" <- function(i, j, ..., value) {
|
||||
value <- as.mic(value)
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(i)
|
||||
y
|
||||
}
|
||||
#' @method [[<- mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[[<-.mic" <- function(i, j, ..., value) {
|
||||
value <- as.mic(value)
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(i)
|
||||
y
|
||||
}
|
||||
#' @method c mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
c.mic <- function(x, ...) {
|
||||
y <- unlist(lapply(list(...), as.character))
|
||||
x <- as.character(x)
|
||||
as.mic(c(x, y))
|
||||
}
|
||||
|
||||
#' @method unique mic
|
||||
#' @export
|
||||
#' @noRd
|
||||
unique.mic <- function(x, incomparables = FALSE, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
|
||||
# will be exported using s3_register() in R/zzz.R
|
||||
get_skimmers.mic <- function(column) {
|
||||
skimr::sfl(
|
||||
skim_type = "mic",
|
||||
min = ~as.character(sort(stats::na.omit(.))[1]),
|
||||
max = ~as.character(sort(stats::na.omit(.))[length(stats::na.omit(.))]),
|
||||
median = ~as.character(stats::na.omit(.)[as.double(stats::na.omit(.)) == median(as.double(stats::na.omit(.)))])[1],
|
||||
n_unique = ~pm_n_distinct(., na.rm = TRUE),
|
||||
hist_log2 = ~skimr::inline_hist(log2(as.double(stats::na.omit(.))))
|
||||
)
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Calculate the matching score for microorganisms
|
||||
#'
|
||||
#' This algorithm is used by [as.mo()] and all the [`mo_*`][mo_property()] functions to determine the most probable match of taxonomic records based on user input.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @author Matthijs S. Berends
|
||||
#' @param x Any user input value(s)
|
||||
#' @param n A full taxonomic name, that exists in [`microorganisms$fullname`][microorganisms]
|
||||
#' @section Matching score for microorganisms:
|
||||
#' With ambiguous user input in [as.mo()] and all the [`mo_*`][mo_property()] functions, the returned results are chosen based on their matching score using [mo_matching_score()]. This matching score \eqn{m}, is calculated as:
|
||||
#'
|
||||
#' \ifelse{latex}{\deqn{m_{(x, n)} = \frac{l_{n} - 0.5 \cdot \min \begin{cases}l_{n} \\ \textrm{lev}(x, n)\end{cases}}{l_{n} \cdot p_{n} \cdot k_{n}}}}{\ifelse{html}{\figure{mo_matching_score.png}{options: width="300px" alt="mo matching score"}}{m(x, n) = ( l_n * min(l_n, lev(x, n) ) ) / ( l_n * p_n * k_n )}}
|
||||
#'
|
||||
#' where:
|
||||
#'
|
||||
#' * \ifelse{html}{\out{<i>x</i> is the user input;}}{\eqn{x} is the user input;}
|
||||
#' * \ifelse{html}{\out{<i>n</i> is a taxonomic name (genus, species, and subspecies);}}{\eqn{n} is a taxonomic name (genus, species, and subspecies);}
|
||||
#' * \ifelse{html}{\out{<i>l<sub>n</sub></i> is the length of <i>n</i>;}}{l_n is the length of \eqn{n};}
|
||||
#' * \ifelse{html}{\out{<i>lev</i> is the <a href="https://en.wikipedia.org/wiki/Levenshtein_distance">Levenshtein distance function</a>, which counts any insertion, deletion and substitution as 1 that is needed to change <i>x</i> into <i>n</i>;}}{lev is the Levenshtein distance function, which counts any insertion, deletion and substitution as 1 that is needed to change \eqn{x} into \eqn{n};}
|
||||
#' * \ifelse{html}{\out{<i>p<sub>n</sub></i> is the human pathogenic prevalence group of <i>n</i>, as described below;}}{p_n is the human pathogenic prevalence group of \eqn{n}, as described below;}
|
||||
#' * \ifelse{html}{\out{<i>k<sub>n</sub></i> is the taxonomic kingdom of <i>n</i>, set as Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5.}}{l_n is the taxonomic kingdom of \eqn{n}, set as Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5.}
|
||||
#'
|
||||
#' The grouping into human pathogenic prevalence (\eqn{p}) is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. **Group 1** (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is *Enterococcus*, *Staphylococcus* or *Streptococcus*. This group consequently contains all common Gram-negative bacteria, such as *Pseudomonas* and *Legionella* and all species within the order Enterobacterales. **Group 2** consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is *Absidia*, *Acremonium*, *Actinotignum*, *Alternaria*, *Anaerosalibacter*, *Apophysomyces*, *Arachnia*, *Aspergillus*, *Aureobacterium*, *Aureobasidium*, *Bacteroides*, *Basidiobolus*, *Beauveria*, *Blastocystis*, *Branhamella*, *Calymmatobacterium*, *Candida*, *Capnocytophaga*, *Catabacter*, *Chaetomium*, *Chryseobacterium*, *Chryseomonas*, *Chrysonilia*, *Cladophialophora*, *Cladosporium*, *Conidiobolus*, *Cryptococcus*, *Curvularia*, *Exophiala*, *Exserohilum*, *Flavobacterium*, *Fonsecaea*, *Fusarium*, *Fusobacterium*, *Hendersonula*, *Hypomyces*, *Koserella*, *Lelliottia*, *Leptosphaeria*, *Leptotrichia*, *Malassezia*, *Malbranchea*, *Mortierella*, *Mucor*, *Mycocentrospora*, *Mycoplasma*, *Nectria*, *Ochroconis*, *Oidiodendron*, *Phoma*, *Piedraia*, *Pithomyces*, *Pityrosporum*, *Prevotella*,\\*Pseudallescheria*, *Rhizomucor*, *Rhizopus*, *Rhodotorula*, *Scolecobasidium*, *Scopulariopsis*, *Scytalidium*,*Sporobolomyces*, *Stachybotrys*, *Stomatococcus*, *Treponema*, *Trichoderma*, *Trichophyton*, *Trichosporon*, *Tritirachium* or *Ureaplasma*. **Group 3** consists of all other microorganisms.
|
||||
#'
|
||||
#' All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., `"E. coli"` will return the microbial ID of *Escherichia coli* (\eqn{m = `r round(mo_matching_score("E. coli", "Escherichia coli"), 3)`}, a highly prevalent microorganism found in humans) and not *Entamoeba coli* (\eqn{m = `r round(mo_matching_score("E. coli", "Entamoeba coli"), 3)`}, a less prevalent microorganism in humans), although the latter would alphabetically come first.
|
||||
#' @export
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' as.mo("E. coli")
|
||||
#' mo_uncertainties()
|
||||
#'
|
||||
#' mo_matching_score(x = "E. coli",
|
||||
#' n = c("Escherichia coli", "Entamoeba coli"))
|
||||
mo_matching_score <- function(x, n) {
|
||||
meet_criteria(x, allow_class = c("character", "data.frame", "list"))
|
||||
meet_criteria(n, allow_class = "character")
|
||||
|
||||
x <- parse_and_convert(x)
|
||||
# no dots and other non-whitespace characters
|
||||
x <- gsub("[^a-zA-Z0-9 \\(\\)]+", "", x)
|
||||
# only keep one space
|
||||
x <- gsub(" +", " ", x)
|
||||
|
||||
# n is always a taxonomically valid full name
|
||||
if (length(n) == 1) {
|
||||
n <- rep(n, length(x))
|
||||
}
|
||||
if (length(x) == 1) {
|
||||
x <- rep(x, length(n))
|
||||
}
|
||||
|
||||
# length of fullname
|
||||
l_n <- nchar(n)
|
||||
lev <- double(length = length(x))
|
||||
l_n.lev <- double(length = length(x))
|
||||
for (i in seq_len(length(x))) {
|
||||
# determine Levenshtein distance, but maximise to nchar of n
|
||||
lev[i] <- utils::adist(x[i], n[i], ignore.case = FALSE, fixed = TRUE)
|
||||
# minimum of (l_n, Levenshtein distance)
|
||||
l_n.lev[i] <- min(l_n[i], as.double(lev[i]))
|
||||
}
|
||||
# human pathogenic prevalence (1 to 3), see ?as.mo
|
||||
p_n <- MO_lookup[match(n, MO_lookup$fullname), "prevalence", drop = TRUE]
|
||||
# kingdom index (Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5)
|
||||
k_n <- MO_lookup[match(n, MO_lookup$fullname), "kingdom_index", drop = TRUE]
|
||||
|
||||
# matching score:
|
||||
(l_n - 0.5 * l_n.lev) / (l_n * p_n * k_n)
|
||||
}
|
||||
-754
@@ -1,754 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Get properties of a microorganism
|
||||
#'
|
||||
#' Use these functions to return a specific property of a microorganism based on the latest accepted taxonomy. All input values will be evaluated internally with [as.mo()], which makes it possible to use microbial abbreviations, codes and names as input. Please see *Examples*.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x any character (vector) that can be coerced to a valid microorganism code with [as.mo()]. Can be left blank for auto-guessing the column containing microorganism codes if used in a data set, please see *Examples*.
|
||||
#' @param property one of the column names of the [microorganisms] data set: `r paste0('"``', colnames(microorganisms), '\``"', collapse = ", ")`, or must be `"shortname"`
|
||||
#' @param language language of the returned text, defaults to system language (see [get_locale()]) and can be overwritten by setting the option `AMR_locale`, e.g. `options(AMR_locale = "de")`, see [translate]. Also used to translate text like "no growth". Use `language = NULL` or `language = ""` to prevent translation.
|
||||
#' @param ... other arguments passed on to [as.mo()], such as 'allow_uncertain' and 'ignore_pattern'
|
||||
#' @param ab any (vector of) text that can be coerced to a valid antibiotic code with [as.ab()]
|
||||
#' @param open browse the URL using [`browseURL()`][utils::browseURL()]
|
||||
#' @details All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for [mo_ref()], [mo_authors()] and [mo_year()]. Please refer to this example, knowing that *Escherichia blattae* was renamed to *Shimwellia blattae* in 2010:
|
||||
#' - `mo_name("Escherichia blattae")` will return `"Shimwellia blattae"` (with a message about the renaming)
|
||||
#' - `mo_ref("Escherichia blattae")` will return `"Burgess et al., 1973"` (with a message about the renaming)
|
||||
#' - `mo_ref("Shimwellia blattae")` will return `"Priest et al., 2010"` (without a message)
|
||||
#'
|
||||
#' The short name - [mo_shortname()] - almost always returns the first character of the genus and the full species, like `"E. coli"`. Exceptions are abbreviations of staphylococci (such as *"CoNS"*, Coagulase-Negative Staphylococci) and beta-haemolytic streptococci (such as *"GBS"*, Group B Streptococci). Please bear in mind that e.g. *E. coli* could mean *Escherichia coli* (kingdom of Bacteria) as well as *Entamoeba coli* (kingdom of Protozoa). Returning to the full name will be done using [as.mo()] internally, giving priority to bacteria and human pathogens, i.e. `"E. coli"` will be considered *Escherichia coli*. In other words, `mo_fullname(mo_shortname("Entamoeba coli"))` returns `"Escherichia coli"`.
|
||||
#'
|
||||
#' Since the top-level of the taxonomy is sometimes referred to as 'kingdom' and sometimes as 'domain', the functions [mo_kingdom()] and [mo_domain()] return the exact same results.
|
||||
#'
|
||||
#' The Gram stain - [mo_gramstain()] - will be determined based on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002, [PMID 11837318](https://pubmed.ncbi.nlm.nih.gov/11837318)), who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram-positive - all other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value `NA`. Functions [mo_is_gram_negative()] and [mo_is_gram_positive()] always return `TRUE` or `FALSE` (except when the input is `NA` or the MO code is `UNKNOWN`), thus always return `FALSE` for species outside the taxonomic kingdom of Bacteria.
|
||||
#'
|
||||
#' Determination of yeasts - [mo_is_yeast()] - will be based on the taxonomic phylum, class and order. Budding yeasts are true fungi of the phylum Ascomycetes, class Saccharomycetes (also called Hemiascomycetes). The true yeasts are separated into one main order Saccharomycetales. For all microorganisms that are in one of those two groups, the function will return `TRUE`. It returns `FALSE` for all other taxonomic entries.
|
||||
#'
|
||||
#' Intrinsic resistance - [mo_is_intrinsic_resistant()] - will be determined based on the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(3.2)`. The [mo_is_intrinsic_resistant()] can be vectorised over arguments `x` (input for microorganisms) and over `ab` (input for antibiotics).
|
||||
#'
|
||||
#' All output will be [translate]d where possible.
|
||||
#'
|
||||
#' The function [mo_url()] will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
|
||||
#' @inheritSection mo_matching_score Matching score for microorganisms
|
||||
#' @inheritSection catalogue_of_life Catalogue of Life
|
||||
#' @inheritSection as.mo Source
|
||||
#' @rdname mo_property
|
||||
#' @name mo_property
|
||||
#' @return
|
||||
#' - An [integer] in case of [mo_year()]
|
||||
#' - A [list] in case of [mo_taxonomy()] and [mo_info()]
|
||||
#' - A named [character] in case of [mo_url()]
|
||||
#' - A [double] in case of [mo_snomed()]
|
||||
#' - A [character] in all other cases
|
||||
#' @export
|
||||
#' @seealso [microorganisms]
|
||||
#' @inheritSection AMR Reference data publicly available
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # taxonomic tree -----------------------------------------------------------
|
||||
#' mo_kingdom("E. coli") # "Bacteria"
|
||||
#' mo_phylum("E. coli") # "Proteobacteria"
|
||||
#' mo_class("E. coli") # "Gammaproteobacteria"
|
||||
#' mo_order("E. coli") # "Enterobacterales"
|
||||
#' mo_family("E. coli") # "Enterobacteriaceae"
|
||||
#' mo_genus("E. coli") # "Escherichia"
|
||||
#' mo_species("E. coli") # "coli"
|
||||
#' mo_subspecies("E. coli") # ""
|
||||
#'
|
||||
#' # colloquial properties ----------------------------------------------------
|
||||
#' mo_name("E. coli") # "Escherichia coli"
|
||||
#' mo_fullname("E. coli") # "Escherichia coli" - same as mo_name()
|
||||
#' mo_shortname("E. coli") # "E. coli"
|
||||
#'
|
||||
#' # other properties ---------------------------------------------------------
|
||||
#' mo_gramstain("E. coli") # "Gram-negative"
|
||||
#' mo_snomed("E. coli") # 112283007, 116395006, ... (SNOMED codes)
|
||||
#' mo_type("E. coli") # "Bacteria" (equal to kingdom, but may be translated)
|
||||
#' mo_rank("E. coli") # "species"
|
||||
#' mo_url("E. coli") # get the direct url to the online database entry
|
||||
#' mo_synonyms("E. coli") # get previously accepted taxonomic names
|
||||
#'
|
||||
#' # scientific reference -----------------------------------------------------
|
||||
#' mo_ref("E. coli") # "Castellani et al., 1919"
|
||||
#' mo_authors("E. coli") # "Castellani et al."
|
||||
#' mo_year("E. coli") # 1919
|
||||
#'
|
||||
#' # abbreviations known in the field -----------------------------------------
|
||||
#' mo_genus("MRSA") # "Staphylococcus"
|
||||
#' mo_species("MRSA") # "aureus"
|
||||
#' mo_shortname("VISA") # "S. aureus"
|
||||
#' mo_gramstain("VISA") # "Gram-positive"
|
||||
#'
|
||||
#' mo_genus("EHEC") # "Escherichia"
|
||||
#' mo_species("EHEC") # "coli"
|
||||
#'
|
||||
#' # known subspecies ---------------------------------------------------------
|
||||
#' mo_name("doylei") # "Campylobacter jejuni doylei"
|
||||
#' mo_genus("doylei") # "Campylobacter"
|
||||
#' mo_species("doylei") # "jejuni"
|
||||
#' mo_subspecies("doylei") # "doylei"
|
||||
#'
|
||||
#' mo_fullname("K. pneu rh") # "Klebsiella pneumoniae rhinoscleromatis"
|
||||
#' mo_shortname("K. pneu rh") # "K. pneumoniae"
|
||||
#'
|
||||
#' \donttest{
|
||||
#' # Becker classification, see ?as.mo ----------------------------------------
|
||||
#' mo_fullname("S. epi") # "Staphylococcus epidermidis"
|
||||
#' mo_fullname("S. epi", Becker = TRUE) # "Coagulase-negative Staphylococcus (CoNS)"
|
||||
#' mo_shortname("S. epi") # "S. epidermidis"
|
||||
#' mo_shortname("S. epi", Becker = TRUE) # "CoNS"
|
||||
#'
|
||||
#' # Lancefield classification, see ?as.mo ------------------------------------
|
||||
#' mo_fullname("S. pyo") # "Streptococcus pyogenes"
|
||||
#' mo_fullname("S. pyo", Lancefield = TRUE) # "Streptococcus group A"
|
||||
#' mo_shortname("S. pyo") # "S. pyogenes"
|
||||
#' mo_shortname("S. pyo", Lancefield = TRUE) # "GAS" (='Group A Streptococci')
|
||||
#'
|
||||
#'
|
||||
#' # language support --------------------------------------------------------
|
||||
#' mo_gramstain("E. coli", language = "de") # "Gramnegativ"
|
||||
#' mo_gramstain("E. coli", language = "nl") # "Gram-negatief"
|
||||
#' mo_gramstain("E. coli", language = "es") # "Gram negativo"
|
||||
#'
|
||||
#' # mo_type is equal to mo_kingdom, but mo_kingdom will remain official
|
||||
#' mo_kingdom("E. coli") # "Bacteria" on a German system
|
||||
#' mo_type("E. coli") # "Bakterien" on a German system
|
||||
#' mo_type("E. coli") # "Bacteria" on an English system
|
||||
#'
|
||||
#' mo_fullname("S. pyogenes",
|
||||
#' Lancefield = TRUE,
|
||||
#' language = "de") # "Streptococcus Gruppe A"
|
||||
#' mo_fullname("S. pyogenes",
|
||||
#' Lancefield = TRUE,
|
||||
#' language = "nl") # "Streptococcus groep A"
|
||||
#'
|
||||
#'
|
||||
#' # other --------------------------------------------------------------------
|
||||
#'
|
||||
#' mo_is_yeast(c("Candida", "E. coli")) # TRUE, FALSE
|
||||
#'
|
||||
#' # gram stains and intrinsic resistance can also be used as a filter in dplyr verbs
|
||||
#' if (require("dplyr")) {
|
||||
#' example_isolates %>%
|
||||
#' filter(mo_is_gram_positive())
|
||||
#'
|
||||
#' example_isolates %>%
|
||||
#' filter(mo_is_intrinsic_resistant(ab = "vanco"))
|
||||
#' }
|
||||
#'
|
||||
#'
|
||||
#' # get a list with the complete taxonomy (from kingdom to subspecies)
|
||||
#' mo_taxonomy("E. coli")
|
||||
#' # get a list with the taxonomy, the authors, Gram-stain and URL to the online database
|
||||
#' mo_info("E. coli")
|
||||
#' }
|
||||
mo_name <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_name")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
translate_AMR(mo_validate(x = x, property = "fullname", language = language, ...), language = language, only_unknown = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_fullname <- mo_name
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_shortname <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_shortname")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x.mo <- as.mo(x, language = language, ...)
|
||||
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
|
||||
replace_empty <- function(x) {
|
||||
x[x == ""] <- "spp."
|
||||
x
|
||||
}
|
||||
|
||||
# get first char of genus and complete species in English
|
||||
genera <- mo_genus(x.mo, language = NULL)
|
||||
shortnames <- paste0(substr(genera, 1, 1), ". ", replace_empty(mo_species(x.mo, language = NULL)))
|
||||
|
||||
# exceptions for where no species is known
|
||||
shortnames[shortnames %like% ".[.] spp[.]"] <- genera[shortnames %like% ".[.] spp[.]"]
|
||||
# exceptions for staphylococci
|
||||
shortnames[shortnames == "S. coagulase-negative"] <- "CoNS"
|
||||
shortnames[shortnames == "S. coagulase-positive"] <- "CoPS"
|
||||
# exceptions for streptococci: Group A Streptococcus -> GAS
|
||||
shortnames[shortnames %like% "S. group [ABCDFGHK]"] <- paste0("G", gsub("S. group ([ABCDFGHK])", "\\1", shortnames[shortnames %like% "S. group [ABCDFGHK]"]), "S")
|
||||
# unknown species etc.
|
||||
shortnames[shortnames %like% "unknown"] <- paste0("(", trimws(gsub("[^a-zA-Z -]", "", shortnames[shortnames %like% "unknown"])), ")")
|
||||
|
||||
shortnames[is.na(x.mo)] <- NA_character_
|
||||
load_mo_failures_uncertainties_renamed(metadata)
|
||||
translate_AMR(shortnames, language = language, only_unknown = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_subspecies <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_subspecies")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
translate_AMR(mo_validate(x = x, property = "subspecies", language = language, ...), language = language, only_unknown = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_species <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_species")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
translate_AMR(mo_validate(x = x, property = "species", language = language, ...), language = language, only_unknown = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_genus <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_genus")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
translate_AMR(mo_validate(x = x, property = "genus", language = language, ...), language = language, only_unknown = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_family <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_family")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
translate_AMR(mo_validate(x = x, property = "family", language = language, ...), language = language, only_unknown = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_order <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_order")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
translate_AMR(mo_validate(x = x, property = "order", language = language, ...), language = language, only_unknown = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_class <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_class")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
translate_AMR(mo_validate(x = x, property = "class", language = language, ...), language = language, only_unknown = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_phylum <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_phylum")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
translate_AMR(mo_validate(x = x, property = "phylum", language = language, ...), language = language, only_unknown = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_kingdom <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_kingdom")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
translate_AMR(mo_validate(x = x, property = "kingdom", language = language, ...), language = language, only_unknown = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_domain <- mo_kingdom
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_type <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_type")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x.mo <- as.mo(x, language = language, ...)
|
||||
out <- mo_kingdom(x.mo, language = NULL)
|
||||
out[which(mo_is_yeast(x.mo))] <- "Yeasts"
|
||||
translate_AMR(out, language = language, only_unknown = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_gramstain <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_gramstain")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x.mo <- as.mo(x, language = language, ...)
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
|
||||
x.phylum <- mo_phylum(x.mo)
|
||||
# DETERMINE GRAM STAIN FOR BACTERIA
|
||||
# Source: https://itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=956097
|
||||
# It says this:
|
||||
# Kingdom Bacteria (Cavalier-Smith, 2002)
|
||||
# Subkingdom Posibacteria (Cavalier-Smith, 2002)
|
||||
# Direct Children:
|
||||
# Phylum Actinobacteria (Cavalier-Smith, 2002)
|
||||
# Phylum Chloroflexi (Garrity and Holt, 2002)
|
||||
# Phylum Firmicutes (corrig. Gibbons and Murray, 1978)
|
||||
# Phylum Tenericutes (Murray, 1984)
|
||||
x <- NA_character_
|
||||
# make all bacteria Gram negative
|
||||
x[mo_kingdom(x.mo) == "Bacteria"] <- "Gram-negative"
|
||||
# overwrite these phyla with Gram positive
|
||||
x[x.phylum %in% c("Actinobacteria",
|
||||
"Chloroflexi",
|
||||
"Firmicutes",
|
||||
"Tenericutes")
|
||||
| x.mo == "B_GRAMP"] <- "Gram-positive"
|
||||
|
||||
load_mo_failures_uncertainties_renamed(metadata)
|
||||
translate_AMR(x, language = language, only_unknown = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_is_gram_negative <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_is_gram_negative")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x.mo <- as.mo(x, language = language, ...)
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
grams <- mo_gramstain(x.mo, language = NULL)
|
||||
load_mo_failures_uncertainties_renamed(metadata)
|
||||
out <- grams == "Gram-negative" & !is.na(grams)
|
||||
out[x.mo %in% c(NA_character_, "UNKNOWN")] <- NA
|
||||
out
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_is_gram_positive <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_is_gram_positive")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x.mo <- as.mo(x, language = language, ...)
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
grams <- mo_gramstain(x.mo, language = NULL)
|
||||
load_mo_failures_uncertainties_renamed(metadata)
|
||||
out <- grams == "Gram-positive" & !is.na(grams)
|
||||
out[x.mo %in% c(NA_character_, "UNKNOWN")] <- NA
|
||||
out
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_is_yeast <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_is_yeast")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x.mo <- as.mo(x, language = language, ...)
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
|
||||
x.kingdom <- mo_kingdom(x.mo, language = NULL)
|
||||
x.phylum <- mo_phylum(x.mo, language = NULL)
|
||||
x.class <- mo_class(x.mo, language = NULL)
|
||||
x.order <- mo_order(x.mo, language = NULL)
|
||||
|
||||
load_mo_failures_uncertainties_renamed(metadata)
|
||||
|
||||
out <- rep(FALSE, length(x))
|
||||
out[x.kingdom == "Fungi" &
|
||||
((x.phylum == "Ascomycetes" & x.class == "Saccharomycetes") | x.order == "Saccharomycetales")] <- TRUE
|
||||
out[x.mo %in% c(NA_character_, "UNKNOWN")] <- NA
|
||||
out
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_is_intrinsic_resistant <- function(x, ab, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_is_intrinsic_resistant")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(ab, allow_NA = FALSE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x <- as.mo(x, language = language, ...)
|
||||
ab <- as.ab(ab, language = NULL, flag_multiple_results = FALSE, info = FALSE)
|
||||
|
||||
if (length(x) == 1 & length(ab) > 1) {
|
||||
x <- rep(x, length(ab))
|
||||
} else if (length(ab) == 1 & length(x) > 1) {
|
||||
ab <- rep(ab, length(x))
|
||||
}
|
||||
if (length(x) != length(ab)) {
|
||||
stop_("length of `x` and `ab` must be equal, or one of them must be of length 1.")
|
||||
}
|
||||
|
||||
# show used version number once per session (pkg_env will reload every session)
|
||||
if (message_not_thrown_before("intrinsic_resistant_version", entire_session = TRUE)) {
|
||||
message_("Determining intrinsic resistance based on ",
|
||||
format_eucast_version_nr(3.2, markdown = FALSE), ". ",
|
||||
font_red("This note will be shown once per session."))
|
||||
remember_thrown_message("intrinsic_resistant_version", entire_session = TRUE)
|
||||
}
|
||||
|
||||
# runs against internal vector: INTRINSIC_R (see zzz.R)
|
||||
paste(x, ab) %in% INTRINSIC_R
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_snomed <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_snomed")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
mo_validate(x = x, property = "snomed", language = language, ...)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_ref <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_ref")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
mo_validate(x = x, property = "ref", language = language, ...)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_authors <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_authors")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x <- mo_validate(x = x, property = "ref", language = language, ...)
|
||||
# remove last 4 digits and presumably the comma and space that preceed them
|
||||
x[!is.na(x)] <- gsub(",? ?[0-9]{4}", "", x[!is.na(x)])
|
||||
suppressWarnings(x)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_year <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_year")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x <- mo_validate(x = x, property = "ref", language = language, ...)
|
||||
# get last 4 digits
|
||||
x[!is.na(x)] <- gsub(".*([0-9]{4})$", "\\1", x[!is.na(x)])
|
||||
suppressWarnings(as.integer(x))
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_rank <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_rank")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
mo_validate(x = x, property = "rank", language = language, ...)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_taxonomy <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_taxonomy")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x <- as.mo(x, language = language, ...)
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
|
||||
result <- list(kingdom = mo_kingdom(x, language = language),
|
||||
phylum = mo_phylum(x, language = language),
|
||||
class = mo_class(x, language = language),
|
||||
order = mo_order(x, language = language),
|
||||
family = mo_family(x, language = language),
|
||||
genus = mo_genus(x, language = language),
|
||||
species = mo_species(x, language = language),
|
||||
subspecies = mo_subspecies(x, language = language))
|
||||
|
||||
load_mo_failures_uncertainties_renamed(metadata)
|
||||
result
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_synonyms <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_synonyms")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x <- as.mo(x, language = language, ...)
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
|
||||
IDs <- mo_name(x = x, language = NULL)
|
||||
syns <- lapply(IDs, function(newname) {
|
||||
res <- sort(microorganisms.old[which(microorganisms.old$fullname_new == newname), "fullname"])
|
||||
if (length(res) == 0) {
|
||||
NULL
|
||||
} else {
|
||||
res
|
||||
}
|
||||
})
|
||||
if (length(syns) > 1) {
|
||||
names(syns) <- mo_name(x)
|
||||
result <- syns
|
||||
} else {
|
||||
result <- unlist(syns)
|
||||
}
|
||||
|
||||
load_mo_failures_uncertainties_renamed(metadata)
|
||||
result
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_info <- function(x, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_info")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
x <- as.mo(x, language = language, ...)
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
|
||||
info <- lapply(x, function(y)
|
||||
c(mo_taxonomy(y, language = language),
|
||||
list(synonyms = mo_synonyms(y),
|
||||
gramstain = mo_gramstain(y, language = language),
|
||||
url = unname(mo_url(y, open = FALSE)),
|
||||
ref = mo_ref(y))))
|
||||
if (length(info) > 1) {
|
||||
names(info) <- mo_name(x)
|
||||
result <- info
|
||||
} else {
|
||||
result <- info[[1L]]
|
||||
}
|
||||
|
||||
load_mo_failures_uncertainties_renamed(metadata)
|
||||
result
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_url <- function(x, open = FALSE, language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_url")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(open, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
mo <- as.mo(x = x, language = language, ... = ...)
|
||||
mo_names <- mo_name(mo)
|
||||
metadata <- get_mo_failures_uncertainties_renamed()
|
||||
|
||||
df <- data.frame(mo, stringsAsFactors = FALSE) %pm>%
|
||||
pm_left_join(pm_select(microorganisms, mo, source, species_id), by = "mo")
|
||||
df$url <- ifelse(df$source == "CoL",
|
||||
paste0(catalogue_of_life$url_CoL, "details/species/id/", df$species_id, "/"),
|
||||
ifelse(df$source == "DSMZ",
|
||||
paste0(catalogue_of_life$url_DSMZ, "/advanced_search?adv[taxon-name]=", gsub(" ", "+", mo_names), "/"),
|
||||
NA_character_))
|
||||
u <- df$url
|
||||
names(u) <- mo_names
|
||||
|
||||
if (open == TRUE) {
|
||||
if (length(u) > 1) {
|
||||
warning_("Only the first URL will be opened, as `browseURL()` only suports one string.")
|
||||
}
|
||||
utils::browseURL(u[1L])
|
||||
}
|
||||
|
||||
load_mo_failures_uncertainties_renamed(metadata)
|
||||
u
|
||||
}
|
||||
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_property <- function(x, property = "fullname", language = get_locale(), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an <mo> column
|
||||
x <- find_mo_col(fn = "mo_property")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(property, allow_class = "character", has_length = 1, is_in = colnames(microorganisms))
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE)
|
||||
|
||||
translate_AMR(mo_validate(x = x, property = property, language = language, ...), language = language, only_unknown = TRUE)
|
||||
}
|
||||
|
||||
mo_validate <- function(x, property, language, ...) {
|
||||
check_dataset_integrity()
|
||||
|
||||
if (tryCatch(all(x[!is.na(x)] %in% MO_lookup$mo) & length(list(...)) == 0, error = function(e) FALSE)) {
|
||||
# special case for mo_* functions where class is already <mo>
|
||||
return(MO_lookup[match(x, MO_lookup$mo), property, drop = TRUE])
|
||||
}
|
||||
|
||||
dots <- list(...)
|
||||
Becker <- dots$Becker
|
||||
if (is.null(Becker)) {
|
||||
Becker <- FALSE
|
||||
}
|
||||
Lancefield <- dots$Lancefield
|
||||
if (is.null(Lancefield)) {
|
||||
Lancefield <- FALSE
|
||||
}
|
||||
|
||||
# try to catch an error when inputting an invalid argument
|
||||
# so the 'call.' can be set to FALSE
|
||||
tryCatch(x[1L] %in% MO_lookup[1, property, drop = TRUE],
|
||||
error = function(e) stop(e$message, call. = FALSE))
|
||||
|
||||
if (is.mo(x)
|
||||
& !Becker %in% c(TRUE, "all")
|
||||
& !Lancefield %in% c(TRUE, "all")) {
|
||||
# this will not reset mo_uncertainties and mo_failures
|
||||
# because it's already a valid MO
|
||||
x <- exec_as.mo(x, property = property, initial_search = FALSE, language = language, ...)
|
||||
} else if (!all(x %in% MO_lookup[, property, drop = TRUE])
|
||||
| Becker %in% c(TRUE, "all")
|
||||
| Lancefield %in% c(TRUE, "all")) {
|
||||
x <- exec_as.mo(x, property = property, language = language, ...)
|
||||
}
|
||||
|
||||
if (property == "mo") {
|
||||
return(set_clean_class(x, new_class = c("mo", "character")))
|
||||
} else if (property == "snomed") {
|
||||
return(as.double(eval(parse(text = x))))
|
||||
} else {
|
||||
return(x)
|
||||
}
|
||||
}
|
||||
|
||||
find_mo_col <- function(fn) {
|
||||
# this function tries to find an mo column in the data the function was called in,
|
||||
# which is useful when functions are used within dplyr verbs
|
||||
df <- get_current_data(arg_name = "x", call = -3) # will return an error if not found
|
||||
mo <- NULL
|
||||
try({
|
||||
mo <- suppressMessages(search_type_in_df(df, "mo"))
|
||||
}, silent = TRUE)
|
||||
if (!is.null(df) && !is.null(mo) && is.data.frame(df)) {
|
||||
if (message_not_thrown_before(fn = fn)) {
|
||||
message_("Using column '", font_bold(mo), "' as input for ", fn, "()")
|
||||
remember_thrown_message(fn = fn)
|
||||
}
|
||||
return(df[, mo, drop = TRUE])
|
||||
} else {
|
||||
stop_("argument `x` is missing and no column with info about microorganisms could be found.", call = -2)
|
||||
}
|
||||
}
|
||||
-309
@@ -1,309 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' User-defined reference data set for microorganisms
|
||||
#'
|
||||
#' @description These functions can be used to predefine your own reference to be used in [as.mo()] and consequently all [`mo_*`][mo_property()] functions (such as [mo_genus()] and [mo_gramstain()]).
|
||||
#'
|
||||
#' This is **the fastest way** to have your organisation (or analysis) specific codes picked up and translated by this package, since you don't have to bother about it again after setting it up once.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param path location of your reference file, see Details. Can be `""`, `NULL` or `FALSE` to delete the reference file.
|
||||
#' @param destination destination of the compressed data file, default to the user's home directory.
|
||||
#' @rdname mo_source
|
||||
#' @name mo_source
|
||||
#' @aliases set_mo_source get_mo_source
|
||||
#' @details The reference file can be a text file separated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an \R object file (extension '.rds'). To use an Excel file, you will need to have the `readxl` package installed.
|
||||
#'
|
||||
#' [set_mo_source()] will check the file for validity: it must be a [data.frame], must have a column named `"mo"` which contains values from [`microorganisms$mo`][microorganisms] and must have a reference column with your own defined values. If all tests pass, [set_mo_source()] will read the file into \R and will ask to export it to `"~/mo_source.rds"`. The CRAN policy disallows packages to write to the file system, although '*exceptions may be allowed in interactive sessions if the package obtains confirmation from the user*'. For this reason, this function only works in interactive sessions so that the user can **specifically confirm and allow** that this file will be created. The destination of this file can be set with the `destination` argument and defaults to the user's home directory. It can also be set as an \R option, using `options(AMR_mo_source = "my/location/file.rds")`.
|
||||
#'
|
||||
#' The created compressed data file `"mo_source.rds"` will be used at default for MO determination (function [as.mo()] and consequently all `mo_*` functions like [mo_genus()] and [mo_gramstain()]). The location and timestamp of the original file will be saved as an attribute to the compressed data file.
|
||||
#'
|
||||
#' The function [get_mo_source()] will return the data set by reading `"mo_source.rds"` with [readRDS()]. If the original file has changed (by checking the location and timestamp of the original file), it will call [set_mo_source()] to update the data file automatically if used in an interactive session.
|
||||
#'
|
||||
#' Reading an Excel file (`.xlsx`) with only one row has a size of 8-9 kB. The compressed file created with [set_mo_source()] will then have a size of 0.1 kB and can be read by [get_mo_source()] in only a couple of microseconds (millionths of a second).
|
||||
#'
|
||||
#' @section How to setup:
|
||||
#'
|
||||
#' Imagine this data on a sheet of an Excel file (mo codes were looked up in the [microorganisms] data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:
|
||||
#'
|
||||
#' ```
|
||||
#' | A | B |
|
||||
#' --|--------------------|--------------|
|
||||
#' 1 | Organisation XYZ | mo |
|
||||
#' 2 | lab_mo_ecoli | B_ESCHR_COLI |
|
||||
#' 3 | lab_mo_kpneumoniae | B_KLBSL_PNMN |
|
||||
#' 4 | | |
|
||||
#' ```
|
||||
#'
|
||||
#' We save it as `"home/me/ourcodes.xlsx"`. Now we have to set it as a source:
|
||||
#'
|
||||
#' ```
|
||||
#' set_mo_source("home/me/ourcodes.xlsx")
|
||||
#' #> NOTE: Created mo_source file '/Users/me/mo_source.rds' (0.3 kB) from
|
||||
#' #> '/Users/me/Documents/ourcodes.xlsx' (9 kB), columns
|
||||
#' #> "Organisation XYZ" and "mo"
|
||||
#' ```
|
||||
#'
|
||||
#' It has now created a file `"~/mo_source.rds"` with the contents of our Excel file. Only the first column with foreign values and the 'mo' column will be kept when creating the RDS file.
|
||||
#'
|
||||
#' And now we can use it in our functions:
|
||||
#'
|
||||
#' ```
|
||||
#' as.mo("lab_mo_ecoli")
|
||||
#' #> Class <mo>
|
||||
#' #> [1] B_ESCHR_COLI
|
||||
#'
|
||||
#' mo_genus("lab_mo_kpneumoniae")
|
||||
#' #> [1] "Klebsiella"
|
||||
#'
|
||||
#' # other input values still work too
|
||||
#' as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli"))
|
||||
#' #> NOTE: Translation to one microorganism was guessed with uncertainty.
|
||||
#' #> Use mo_uncertainties() to review it.
|
||||
#' #> Class <mo>
|
||||
#' #> [1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI
|
||||
#' ```
|
||||
#'
|
||||
#' If we edit the Excel file by, let's say, adding row 4 like this:
|
||||
#'
|
||||
#' ```
|
||||
#' | A | B |
|
||||
#' --|--------------------|--------------|
|
||||
#' 1 | Organisation XYZ | mo |
|
||||
#' 2 | lab_mo_ecoli | B_ESCHR_COLI |
|
||||
#' 3 | lab_mo_kpneumoniae | B_KLBSL_PNMN |
|
||||
#' 4 | lab_Staph_aureus | B_STPHY_AURS |
|
||||
#' 5 | | |
|
||||
#' ```
|
||||
#'
|
||||
#' ...any new usage of an MO function in this package will update your data file:
|
||||
#'
|
||||
#' ```
|
||||
#' as.mo("lab_mo_ecoli")
|
||||
#' #> NOTE: Updated mo_source file '/Users/me/mo_source.rds' (0.3 kB) from
|
||||
#' #> '/Users/me/Documents/ourcodes.xlsx' (9 kB), columns
|
||||
#' #> "Organisation XYZ" and "mo"
|
||||
#' #> Class <mo>
|
||||
#' #> [1] B_ESCHR_COLI
|
||||
#'
|
||||
#' mo_genus("lab_Staph_aureus")
|
||||
#' #> [1] "Staphylococcus"
|
||||
#' ```
|
||||
#'
|
||||
#' To delete the reference data file, just use `""`, `NULL` or `FALSE` as input for [set_mo_source()]:
|
||||
#'
|
||||
#' ```
|
||||
#' set_mo_source(NULL)
|
||||
#' #> Removed mo_source file '/Users/me/mo_source.rds'
|
||||
#' ```
|
||||
#'
|
||||
#' If the original file (in the previous case an Excel file) is moved or deleted, the `mo_source.rds` file will be removed upon the next use of [as.mo()] or any [`mo_*`][mo_property()] function.
|
||||
#' @export
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
set_mo_source <- function(path, destination = getOption("AMR_mo_source", "~/mo_source.rds")) {
|
||||
meet_criteria(path, allow_class = "character", has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(destination, allow_class = "character", has_length = 1)
|
||||
stop_ifnot(destination %like% "[.]rds$", "the `destination` must be a file location with file extension .rds.")
|
||||
|
||||
mo_source_destination <- path.expand(destination)
|
||||
|
||||
stop_ifnot(interactive(), "this function can only be used in interactive mode, since it must ask for the user's permission to write a file to their home folder.")
|
||||
|
||||
if (is.null(path) || path %in% c(FALSE, "")) {
|
||||
pkg_env$mo_source <- NULL
|
||||
if (file.exists(mo_source_destination)) {
|
||||
unlink(mo_source_destination)
|
||||
message_("Removed mo_source file '", font_bold(mo_source_destination), "'",
|
||||
add_fn = font_red,
|
||||
as_note = FALSE)
|
||||
}
|
||||
return(invisible())
|
||||
}
|
||||
|
||||
stop_ifnot(file.exists(path), "file not found: ", path)
|
||||
|
||||
if (path %like% "[.]rds$") {
|
||||
df <- readRDS(path)
|
||||
|
||||
} else if (path %like% "[.]xlsx?$") {
|
||||
# is Excel file (old or new)
|
||||
stop_ifnot_installed("readxl")
|
||||
df <- readxl::read_excel(path)
|
||||
|
||||
} else if (path %like% "[.]tsv$") {
|
||||
df <- utils::read.table(header = TRUE, sep = "\t", stringsAsFactors = FALSE)
|
||||
|
||||
} else {
|
||||
# try comma first
|
||||
try(
|
||||
df <- utils::read.table(header = TRUE, sep = ",", stringsAsFactors = FALSE),
|
||||
silent = TRUE)
|
||||
if (!check_validity_mo_source(df, stop_on_error = FALSE)) {
|
||||
# try tab
|
||||
try(
|
||||
df <- utils::read.table(header = TRUE, sep = "\t", stringsAsFactors = FALSE),
|
||||
silent = TRUE)
|
||||
}
|
||||
if (!check_validity_mo_source(df, stop_on_error = FALSE)) {
|
||||
# try pipe
|
||||
try(
|
||||
df <- utils::read.table(header = TRUE, sep = "|", stringsAsFactors = FALSE),
|
||||
silent = TRUE)
|
||||
}
|
||||
}
|
||||
|
||||
# check integrity
|
||||
check_validity_mo_source(df)
|
||||
|
||||
df <- subset(df, !is.na(mo))
|
||||
|
||||
# keep only first two columns, second must be mo
|
||||
if (colnames(df)[1] == "mo") {
|
||||
df <- df[, c(colnames(df)[2], "mo")]
|
||||
} else {
|
||||
df <- df[, c(colnames(df)[1], "mo")]
|
||||
}
|
||||
|
||||
df <- as.data.frame(df, stringAsFactors = FALSE)
|
||||
df[, "mo"] <- set_clean_class(df[, "mo", drop = TRUE], c("mo", "character"))
|
||||
|
||||
# success
|
||||
if (file.exists(mo_source_destination)) {
|
||||
action <- "Updated"
|
||||
} else {
|
||||
action <- "Created"
|
||||
# only ask when file is created, not when it is updated
|
||||
txt <- paste0(word_wrap(paste0("This will write create the new file '",
|
||||
mo_source_destination,
|
||||
"', for which your permission is needed.")),
|
||||
"\n\n",
|
||||
word_wrap("Do you agree that this file will be created?"))
|
||||
if ("rsasdtudioapi" %in% rownames(utils::installed.packages())) {
|
||||
showQuestion <- import_fn("showQuestion", "rstudioapi")
|
||||
q_continue <- showQuestion("Create new file in home directory", txt)
|
||||
} else {
|
||||
q_continue <- utils::menu(choices = c("OK", "Cancel"), graphics = FALSE, title = txt)
|
||||
}
|
||||
if (q_continue %in% c(FALSE, 2)) {
|
||||
return(invisible())
|
||||
}
|
||||
}
|
||||
attr(df, "mo_source_location") <- path
|
||||
attr(df, "mo_source_destination") <- mo_source_destination
|
||||
attr(df, "mo_source_timestamp") <- file.mtime(path)
|
||||
saveRDS(df, mo_source_destination)
|
||||
pkg_env$mo_source <- df
|
||||
message_(action, " mo_source file '", font_bold(mo_source_destination),
|
||||
"' (", formatted_filesize(mo_source_destination),
|
||||
") from '", font_bold(path),
|
||||
"' (", formatted_filesize(path),
|
||||
'), columns "', colnames(df)[1], '" and "', colnames(df)[2], '"')
|
||||
}
|
||||
|
||||
#' @rdname mo_source
|
||||
#' @export
|
||||
get_mo_source <- function(destination = getOption("AMR_mo_source", "~/mo_source.rds")) {
|
||||
if (!file.exists(path.expand(destination))) {
|
||||
if (interactive()) {
|
||||
# source file might have been deleted, so update reference
|
||||
set_mo_source("")
|
||||
}
|
||||
return(NULL)
|
||||
}
|
||||
if (is.null(pkg_env$mo_source)) {
|
||||
pkg_env$mo_source <- readRDS(path.expand(destination))
|
||||
}
|
||||
|
||||
old_time <- attributes(pkg_env$mo_source)$mo_source_timestamp
|
||||
new_time <- file.mtime(attributes(pkg_env$mo_source)$mo_source_location)
|
||||
if (interactive() && !identical(old_time, new_time)) {
|
||||
# source file was updated, also update reference
|
||||
set_mo_source(attributes(pkg_env$mo_source)$mo_source_location)
|
||||
}
|
||||
pkg_env$mo_source
|
||||
}
|
||||
|
||||
check_validity_mo_source <- function(x, refer_to_name = "`reference_df`", stop_on_error = TRUE) {
|
||||
check_dataset_integrity()
|
||||
|
||||
if (paste(deparse(substitute(x)), collapse = "") == "get_mo_source()") {
|
||||
return(TRUE)
|
||||
}
|
||||
if (is.null(pkg_env$mo_source) && (identical(x, get_mo_source()))) {
|
||||
return(TRUE)
|
||||
}
|
||||
if (is.null(x)) {
|
||||
if (stop_on_error == TRUE) {
|
||||
stop_(refer_to_name, " cannot be NULL", call = FALSE)
|
||||
} else {
|
||||
return(FALSE)
|
||||
}
|
||||
}
|
||||
if (!is.data.frame(x)) {
|
||||
if (stop_on_error == TRUE) {
|
||||
stop_(refer_to_name, " must be a data.frame", call = FALSE)
|
||||
} else {
|
||||
return(FALSE)
|
||||
}
|
||||
}
|
||||
if (!"mo" %in% colnames(x)) {
|
||||
if (stop_on_error == TRUE) {
|
||||
stop_(refer_to_name, " must contain a column 'mo'", call = FALSE)
|
||||
} else {
|
||||
return(FALSE)
|
||||
}
|
||||
}
|
||||
if (!all(x$mo %in% c("", microorganisms$mo, microorganisms.translation$mo_old), na.rm = TRUE)) {
|
||||
if (stop_on_error == TRUE) {
|
||||
invalid <- x[which(!x$mo %in% c("", microorganisms$mo, microorganisms.translation$mo_old)), , drop = FALSE]
|
||||
if (nrow(invalid) > 1) {
|
||||
plural <- "s"
|
||||
} else {
|
||||
plural <- ""
|
||||
}
|
||||
stop_("Value", plural, " ", paste0("'", invalid[, 1, drop = TRUE], "'", collapse = ", "),
|
||||
" found in ", tolower(refer_to_name),
|
||||
", but with invalid microorganism code", plural, " ", paste0("'", invalid$mo, "'", collapse = ", "),
|
||||
call = FALSE)
|
||||
} else {
|
||||
return(FALSE)
|
||||
}
|
||||
}
|
||||
if (colnames(x)[1] != "mo" & nrow(x) > length(unique(x[, 1, drop = TRUE]))) {
|
||||
if (stop_on_error == TRUE) {
|
||||
stop_(refer_to_name, " contains duplicate values in column '", colnames(x)[1], "'", call = FALSE)
|
||||
} else {
|
||||
return(FALSE)
|
||||
}
|
||||
}
|
||||
if (colnames(x)[2] != "mo" & nrow(x) > length(unique(x[, 2, drop = TRUE]))) {
|
||||
if (stop_on_error == TRUE) {
|
||||
stop_(refer_to_name, " contains duplicate values in column '", colnames(x)[2], "'", call = FALSE)
|
||||
} else {
|
||||
return(FALSE)
|
||||
}
|
||||
}
|
||||
return(TRUE)
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Principal Component Analysis (for AMR)
|
||||
#'
|
||||
#' Performs a principal component analysis (PCA) based on a data set with automatic determination for afterwards plotting the groups and labels, and automatic filtering on only suitable (i.e. non-empty and numeric) variables.
|
||||
#' @inheritSection lifecycle Maturing lifecycle
|
||||
#' @param x a [data.frame] containing numeric columns
|
||||
#' @param ... columns of `x` to be selected for PCA, can be unquoted since it supports quasiquotation.
|
||||
#' @inheritParams stats::prcomp
|
||||
#' @details The [pca()] function takes a [data.frame] as input and performs the actual PCA with the \R function [prcomp()].
|
||||
#'
|
||||
#' The result of the [pca()] function is a [prcomp] object, with an additional attribute `non_numeric_cols` which is a vector with the column names of all columns that do not contain numeric values. These are probably the groups and labels, and will be used by [ggplot_pca()].
|
||||
#' @return An object of classes [pca] and [prcomp]
|
||||
#' @importFrom stats prcomp
|
||||
#' @export
|
||||
#' @examples
|
||||
#' # `example_isolates` is a dataset available in the AMR package.
|
||||
#' # See ?example_isolates.
|
||||
#'
|
||||
#' \donttest{
|
||||
#'
|
||||
#' if (require("dplyr")) {
|
||||
#' # calculate the resistance per group first
|
||||
#' resistance_data <- example_isolates %>%
|
||||
#' group_by(order = mo_order(mo), # group on anything, like order
|
||||
#' genus = mo_genus(mo)) %>% # and genus as we do here
|
||||
#' summarise_if(is.rsi, resistance) # then get resistance of all drugs
|
||||
#'
|
||||
#' # now conduct PCA for certain antimicrobial agents
|
||||
#' pca_result <- resistance_data %>%
|
||||
#' pca(AMC, CXM, CTX, CAZ, GEN, TOB, TMP, SXT)
|
||||
#'
|
||||
#' pca_result
|
||||
#' summary(pca_result)
|
||||
#' biplot(pca_result)
|
||||
#' ggplot_pca(pca_result) # a new and convenient plot function
|
||||
#' }
|
||||
#' }
|
||||
pca <- function(x,
|
||||
...,
|
||||
retx = TRUE,
|
||||
center = TRUE,
|
||||
scale. = TRUE,
|
||||
tol = NULL,
|
||||
rank. = NULL) {
|
||||
meet_criteria(x, allow_class = "data.frame")
|
||||
meet_criteria(retx, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(center, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(scale., allow_class = "logical", has_length = 1)
|
||||
meet_criteria(tol, allow_class = "numeric", has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(rank., allow_class = "numeric", has_length = 1, allow_NULL = TRUE)
|
||||
|
||||
# unset data.table, tibble, etc.
|
||||
# also removes groups made by dplyr::group_by
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
x.bak <- x
|
||||
|
||||
# defuse R expressions, this replaces rlang::enquos()
|
||||
dots <- substitute(list(...))
|
||||
if (length(dots) > 1) {
|
||||
new_list <- list(0)
|
||||
for (i in seq_len(length(dots) - 1)) {
|
||||
new_list[[i]] <- tryCatch(eval(dots[[i + 1]], envir = x),
|
||||
error = function(e) stop(e$message, call. = FALSE))
|
||||
if (length(new_list[[i]]) == 1) {
|
||||
if (is.character(new_list[[i]]) & new_list[[i]] %in% colnames(x)) {
|
||||
# this is to support quoted variables: df %pm>% pca("mycol1", "mycol2")
|
||||
new_list[[i]] <- x[, new_list[[i]]]
|
||||
} else {
|
||||
# remove item - it's a argument like `center`
|
||||
new_list[[i]] <- NULL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
x <- as.data.frame(new_list, stringsAsFactors = FALSE)
|
||||
if (any(vapply(FUN.VALUE = logical(1), x, function(y) !is.numeric(y)))) {
|
||||
warning_("Be sure to first calculate the resistance (or susceptibility) of variables with antimicrobial test results, since PCA works with numeric variables only. Please see Examples in ?pca.")
|
||||
}
|
||||
|
||||
# set column names
|
||||
tryCatch(colnames(x) <- as.character(dots)[2:length(dots)],
|
||||
error = function(e) warning("column names could not be set"))
|
||||
|
||||
# keep only numeric columns
|
||||
x <- x[, vapply(FUN.VALUE = logical(1), x, function(y) is.numeric(y))]
|
||||
# bind the data set with the non-numeric columns
|
||||
x <- cbind(x.bak[, vapply(FUN.VALUE = logical(1), x.bak, function(y) !is.numeric(y) & !all(is.na(y))), drop = FALSE], x)
|
||||
}
|
||||
|
||||
x <- pm_ungroup(x) # would otherwise select the grouping vars
|
||||
x <- x[rowSums(is.na(x)) == 0, ] # remove columns containing NAs
|
||||
|
||||
pca_data <- x[, which(vapply(FUN.VALUE = logical(1), x, function(x) is.numeric(x)))]
|
||||
|
||||
message_("Columns selected for PCA: ", paste0(font_bold(colnames(pca_data)), collapse = "/"),
|
||||
". Total observations available: ", nrow(pca_data), ".")
|
||||
|
||||
pca_model <- prcomp(pca_data, retx = retx, center = center, scale. = scale., tol = tol, rank. = rank.)
|
||||
attr(pca_model, "non_numeric_cols") <- x[, vapply(FUN.VALUE = logical(1), x, function(y) !is.numeric(y) & !all(is.na(y))), drop = FALSE]
|
||||
class(pca_model) <- c("pca", class(pca_model))
|
||||
pca_model
|
||||
}
|
||||
-278
@@ -1,278 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Calculate microbial resistance
|
||||
#'
|
||||
#' @description These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in `summarise()` from the `dplyr` package and also support grouped variables, please see *Examples*.
|
||||
#'
|
||||
#' [resistance()] should be used to calculate resistance, [susceptibility()] should be used to calculate susceptibility.\cr
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param ... one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [as.rsi()] if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See Examples.
|
||||
#' @param minimum the minimum allowed number of available (tested) isolates. Any isolate count lower than `minimum` will return `NA` with a warning. The default number of `30` isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.
|
||||
#' @param as_percent a logical to indicate whether the output must be returned as a hundred fold with % sign (a character). A value of `0.123456` will then be returned as `"12.3%"`.
|
||||
#' @param only_all_tested (for combination therapies, i.e. using more than one variable for `...`): a logical to indicate that isolates must be tested for all antibiotics, see section *Combination therapy* below
|
||||
#' @param data a [data.frame] containing columns with class [`rsi`] (see [as.rsi()])
|
||||
#' @param translate_ab a column name of the [antibiotics] data set to translate the antibiotic abbreviations to, using [ab_property()]
|
||||
#' @inheritParams ab_property
|
||||
#' @param combine_SI a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument `combine_IR`, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is `TRUE`.
|
||||
#' @param combine_IR a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see argument `combine_SI`.
|
||||
#' @inheritSection as.rsi Interpretation of R and S/I
|
||||
#' @details
|
||||
#' The function [resistance()] is equal to the function [proportion_R()]. The function [susceptibility()] is equal to the function [proportion_SI()].
|
||||
#'
|
||||
#' **Remember that you should filter your table to let it contain only first isolates!** This is needed to exclude duplicates and to reduce selection bias. Use [first_isolate()] to determine them in your data set.
|
||||
#'
|
||||
#' These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the [`count()`][AMR::count()] functions to count isolates. The function [susceptibility()] is essentially equal to `count_susceptible() / count_all()`. *Low counts can influence the outcome - the `proportion` functions may camouflage this, since they only return the proportion (albeit being dependent on the `minimum` argument).*
|
||||
#'
|
||||
#' The function [proportion_df()] takes any variable from `data` that has an [`rsi`] class (created with [as.rsi()]) and calculates the proportions R, I and S. It also supports grouped variables. The function [rsi_df()] works exactly like [proportion_df()], but adds the number of isolates.
|
||||
#' @section Combination therapy:
|
||||
#' When using more than one variable for `...` (= combination therapy), use `only_all_tested` to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Drug A and Drug B, about how [susceptibility()] works to calculate the %SI:
|
||||
#'
|
||||
#' ```
|
||||
#' --------------------------------------------------------------------
|
||||
#' only_all_tested = FALSE only_all_tested = TRUE
|
||||
#' ----------------------- -----------------------
|
||||
#' Drug A Drug B include as include as include as include as
|
||||
#' numerator denominator numerator denominator
|
||||
#' -------- -------- ---------- ----------- ---------- -----------
|
||||
#' S or I S or I X X X X
|
||||
#' R S or I X X X X
|
||||
#' <NA> S or I X X - -
|
||||
#' S or I R X X X X
|
||||
#' R R - X - X
|
||||
#' <NA> R - - - -
|
||||
#' S or I <NA> X X - -
|
||||
#' R <NA> - - - -
|
||||
#' <NA> <NA> - - - -
|
||||
#' --------------------------------------------------------------------
|
||||
#' ```
|
||||
#'
|
||||
#' Please note that, in combination therapies, for `only_all_tested = TRUE` applies that:
|
||||
#' ```
|
||||
#' count_S() + count_I() + count_R() = count_all()
|
||||
#' proportion_S() + proportion_I() + proportion_R() = 1
|
||||
#' ```
|
||||
#' and that, in combination therapies, for `only_all_tested = FALSE` applies that:
|
||||
#' ```
|
||||
#' count_S() + count_I() + count_R() >= count_all()
|
||||
#' proportion_S() + proportion_I() + proportion_R() >= 1
|
||||
#' ```
|
||||
#'
|
||||
#' Using `only_all_tested` has no impact when only using one antibiotic as input.
|
||||
#' @source **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition**, 2014, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
|
||||
#' @seealso [AMR::count()] to count resistant and susceptible isolates.
|
||||
#' @return A [double] or, when `as_percent = TRUE`, a [character].
|
||||
#' @rdname proportion
|
||||
#' @aliases portion
|
||||
#' @name proportion
|
||||
#' @export
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' # example_isolates is a data set available in the AMR package.
|
||||
#' ?example_isolates
|
||||
#'
|
||||
#' resistance(example_isolates$AMX) # determines %R
|
||||
#' susceptibility(example_isolates$AMX) # determines %S+I
|
||||
#'
|
||||
#' # be more specific
|
||||
#' proportion_S(example_isolates$AMX)
|
||||
#' proportion_SI(example_isolates$AMX)
|
||||
#' proportion_I(example_isolates$AMX)
|
||||
#' proportion_IR(example_isolates$AMX)
|
||||
#' proportion_R(example_isolates$AMX)
|
||||
#'
|
||||
#' if (require("dplyr")) {
|
||||
#' example_isolates %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(r = resistance(CIP),
|
||||
#' n = n_rsi(CIP)) # n_rsi works like n_distinct in dplyr, see ?n_rsi
|
||||
#'
|
||||
#' example_isolates %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(R = resistance(CIP, as_percent = TRUE),
|
||||
#' SI = susceptibility(CIP, as_percent = TRUE),
|
||||
#' n1 = count_all(CIP), # the actual total; sum of all three
|
||||
#' n2 = n_rsi(CIP), # same - analogous to n_distinct
|
||||
#' total = n()) # NOT the number of tested isolates!
|
||||
#'
|
||||
#' # Calculate co-resistance between amoxicillin/clav acid and gentamicin,
|
||||
#' # so we can see that combination therapy does a lot more than mono therapy:
|
||||
#' example_isolates %>% susceptibility(AMC) # %SI = 76.3%
|
||||
#' example_isolates %>% count_all(AMC) # n = 1879
|
||||
#'
|
||||
#' example_isolates %>% susceptibility(GEN) # %SI = 75.4%
|
||||
#' example_isolates %>% count_all(GEN) # n = 1855
|
||||
#'
|
||||
#' example_isolates %>% susceptibility(AMC, GEN) # %SI = 94.1%
|
||||
#' example_isolates %>% count_all(AMC, GEN) # n = 1939
|
||||
#'
|
||||
#'
|
||||
#' # See Details on how `only_all_tested` works. Example:
|
||||
#' example_isolates %>%
|
||||
#' summarise(numerator = count_susceptible(AMC, GEN),
|
||||
#' denominator = count_all(AMC, GEN),
|
||||
#' proportion = susceptibility(AMC, GEN))
|
||||
#'
|
||||
#' example_isolates %>%
|
||||
#' summarise(numerator = count_susceptible(AMC, GEN, only_all_tested = TRUE),
|
||||
#' denominator = count_all(AMC, GEN, only_all_tested = TRUE),
|
||||
#' proportion = susceptibility(AMC, GEN, only_all_tested = TRUE))
|
||||
#'
|
||||
#'
|
||||
#' example_isolates %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(cipro_p = susceptibility(CIP, as_percent = TRUE),
|
||||
#' cipro_n = count_all(CIP),
|
||||
#' genta_p = susceptibility(GEN, as_percent = TRUE),
|
||||
#' genta_n = count_all(GEN),
|
||||
#' combination_p = susceptibility(CIP, GEN, as_percent = TRUE),
|
||||
#' combination_n = count_all(CIP, GEN))
|
||||
#'
|
||||
#' # Get proportions S/I/R immediately of all rsi columns
|
||||
#' example_isolates %>%
|
||||
#' select(AMX, CIP) %>%
|
||||
#' proportion_df(translate = FALSE)
|
||||
#'
|
||||
#' # It also supports grouping variables
|
||||
#' example_isolates %>%
|
||||
#' select(hospital_id, AMX, CIP) %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' proportion_df(translate = FALSE)
|
||||
#' }
|
||||
resistance <- function(...,
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = "R",
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname proportion
|
||||
#' @export
|
||||
susceptibility <- function(...,
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = c("S", "I"),
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname proportion
|
||||
#' @export
|
||||
proportion_R <- function(...,
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = "R",
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname proportion
|
||||
#' @export
|
||||
proportion_IR <- function(...,
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = c("I", "R"),
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname proportion
|
||||
#' @export
|
||||
proportion_I <- function(...,
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = "I",
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname proportion
|
||||
#' @export
|
||||
proportion_SI <- function(...,
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = c("S", "I"),
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname proportion
|
||||
#' @export
|
||||
proportion_S <- function(...,
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE) {
|
||||
rsi_calc(...,
|
||||
ab_result = "S",
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = FALSE)
|
||||
}
|
||||
|
||||
#' @rdname proportion
|
||||
#' @export
|
||||
proportion_df <- function(data,
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE) {
|
||||
rsi_calc_df(type = "proportion",
|
||||
data = data,
|
||||
translate_ab = translate_ab,
|
||||
language = language,
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
combine_SI = combine_SI,
|
||||
combine_IR = combine_IR,
|
||||
combine_SI_missing = missing(combine_SI))
|
||||
}
|
||||
-132
@@ -1,132 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Random MIC values/disk zones/RSI generation
|
||||
#'
|
||||
#' These functions can be used for generating random MIC values and disk diffusion diameters, for AMR analysis practice.
|
||||
#' @inheritSection lifecycle Maturing lifecycle
|
||||
#' @param size desired size of the returned vector
|
||||
#' @param mo any character that can be coerced to a valid microorganism code with [as.mo()]
|
||||
#' @param ab any character that can be coerced to a valid antimicrobial agent code with [as.ab()]
|
||||
#' @param prob_RSI a vector of length 3: the probabilities for R (1st value), S (2nd value) and I (3rd value)
|
||||
#' @param ... extension for future versions, not used at the moment
|
||||
#' @details The base R function [sample()] is used for generating values.
|
||||
#'
|
||||
#' Generated values are based on the latest EUCAST guideline implemented in the [rsi_translation] data set. To create specific generated values per bug or drug, set the `mo` and/or `ab` argument.
|
||||
#' @return class `<mic>` for [random_mic()] (see [as.mic()]) and class `<disk>` for [random_disk()] (see [as.disk()])
|
||||
#' @name random
|
||||
#' @rdname random
|
||||
#' @export
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' random_mic(100)
|
||||
#' random_disk(100)
|
||||
#' random_rsi(100)
|
||||
#'
|
||||
#' \donttest{
|
||||
#' # make the random generation more realistic by setting a bug and/or drug:
|
||||
#' random_mic(100, "Klebsiella pneumoniae") # range 0.0625-64
|
||||
#' random_mic(100, "Klebsiella pneumoniae", "meropenem") # range 0.0625-16
|
||||
#' random_mic(100, "Streptococcus pneumoniae", "meropenem") # range 0.0625-4
|
||||
#'
|
||||
#' random_disk(100, "Klebsiella pneumoniae") # range 11-50
|
||||
#' random_disk(100, "Klebsiella pneumoniae", "ampicillin") # range 6-14
|
||||
#' random_disk(100, "Streptococcus pneumoniae", "ampicillin") # range 16-22
|
||||
#' }
|
||||
random_mic <- function(size, mo = NULL, ab = NULL, ...) {
|
||||
random_exec("MIC", size = size, mo = mo, ab = ab)
|
||||
}
|
||||
|
||||
#' @rdname random
|
||||
#' @export
|
||||
random_disk <- function(size, mo = NULL, ab = NULL, ...) {
|
||||
random_exec("DISK", size = size, mo = mo, ab = ab)
|
||||
}
|
||||
|
||||
#' @rdname random
|
||||
#' @export
|
||||
random_rsi <- function(size, prob_RSI = c(0.33, 0.33, 0.33), ...) {
|
||||
sample(as.rsi(c("R", "S", "I")), size = size, replace = TRUE, prob = prob_RSI)
|
||||
}
|
||||
|
||||
random_exec <- function(type, size, mo = NULL, ab = NULL) {
|
||||
df <- rsi_translation %pm>%
|
||||
pm_filter(guideline %like% "EUCAST") %pm>%
|
||||
pm_arrange(pm_desc(guideline)) %pm>%
|
||||
subset(guideline == max(guideline) &
|
||||
method == type)
|
||||
|
||||
if (!is.null(mo)) {
|
||||
mo_coerced <- as.mo(mo)
|
||||
mo_include <- c(mo_coerced,
|
||||
as.mo(mo_genus(mo_coerced)),
|
||||
as.mo(mo_family(mo_coerced)),
|
||||
as.mo(mo_order(mo_coerced)))
|
||||
df_new <- df %pm>%
|
||||
subset(mo %in% mo_include)
|
||||
if (nrow(df_new) > 0) {
|
||||
df <- df_new
|
||||
} else {
|
||||
warning_("No rows found that match mo '", mo, "', ignoring argument `mo`", call = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
if (!is.null(ab)) {
|
||||
ab_coerced <- as.ab(ab)
|
||||
df_new <- df %pm>%
|
||||
subset(ab %in% ab_coerced)
|
||||
if (nrow(df_new) > 0) {
|
||||
df <- df_new
|
||||
} else {
|
||||
warning_("No rows found that match ab '", ab, "', ignoring argument `ab`", call = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
if (type == "MIC") {
|
||||
# all valid MIC levels
|
||||
valid_range <- as.mic(levels(as.mic(1)))
|
||||
set_range_max <- max(df$breakpoint_R)
|
||||
if (log(set_range_max, 2) %% 1 == 0) {
|
||||
# return powers of 2
|
||||
valid_range <- unique(as.double(valid_range))
|
||||
# add one higher MIC level to set_range_max
|
||||
set_range_max <- 2 ^ (log(set_range_max, 2) + 1)
|
||||
set_range <- as.mic(valid_range[log(valid_range, 2) %% 1 == 0 & valid_range <= set_range_max])
|
||||
} else {
|
||||
# no power of 2, return factors of 2 to left and right side
|
||||
valid_mics <- suppressWarnings(as.mic(set_range_max / (2 ^ c(-3:3))))
|
||||
set_range <- valid_mics[!is.na(valid_mics)]
|
||||
}
|
||||
return(as.mic(sample(set_range, size = size, replace = TRUE)))
|
||||
} else if (type == "DISK") {
|
||||
set_range <- seq(from = as.integer(min(df$breakpoint_R)),
|
||||
to = as.integer(max(df$breakpoint_S)),
|
||||
by = 1)
|
||||
out <- sample(set_range, size = size, replace = TRUE)
|
||||
out[out < 6] <- sample(c(6:10), length(out[out < 6]), replace = TRUE)
|
||||
out[out > 50] <- sample(c(40:50), length(out[out > 50]), replace = TRUE)
|
||||
return(as.disk(out))
|
||||
}
|
||||
}
|
||||
@@ -1,391 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Predict antimicrobial resistance
|
||||
#'
|
||||
#' Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns `se_min` and `se_max`. See *Examples* for a real live example.
|
||||
#' @inheritSection lifecycle Maturing lifecycle
|
||||
#' @param col_ab column name of `x` containing antimicrobial interpretations (`"R"`, `"I"` and `"S"`)
|
||||
#' @param col_date column name of the date, will be used to calculate years if this column doesn't consist of years already, defaults to the first column of with a date class
|
||||
#' @param year_min lowest year to use in the prediction model, dafaults to the lowest year in `col_date`
|
||||
#' @param year_max highest year to use in the prediction model, defaults to 10 years after today
|
||||
#' @param year_every unit of sequence between lowest year found in the data and `year_max`
|
||||
#' @param minimum minimal amount of available isolates per year to include. Years containing less observations will be estimated by the model.
|
||||
#' @param model the statistical model of choice. This could be a generalised linear regression model with binomial distribution (i.e. using `glm(..., family = binomial)``, assuming that a period of zero resistance was followed by a period of increasing resistance leading slowly to more and more resistance. See Details for all valid options.
|
||||
#' @param I_as_S a logical to indicate whether values `"I"` should be treated as `"S"` (will otherwise be treated as `"R"`). The default, `TRUE`, follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section *Interpretation of S, I and R* below.
|
||||
#' @param preserve_measurements a logical to indicate whether predictions of years that are actually available in the data should be overwritten by the original data. The standard errors of those years will be `NA`.
|
||||
#' @param info a logical to indicate whether textual analysis should be printed with the name and [summary()] of the statistical model.
|
||||
#' @param main title of the plot
|
||||
#' @param ribbon a logical to indicate whether a ribbon should be shown (default) or error bars
|
||||
#' @param ... arguments passed on to functions
|
||||
#' @inheritSection as.rsi Interpretation of R and S/I
|
||||
#' @inheritParams first_isolate
|
||||
#' @inheritParams graphics::plot
|
||||
#' @details Valid options for the statistical model (argument `model`) are:
|
||||
#' - `"binomial"` or `"binom"` or `"logit"`: a generalised linear regression model with binomial distribution
|
||||
#' - `"loglin"` or `"poisson"`: a generalised log-linear regression model with poisson distribution
|
||||
#' - `"lin"` or `"linear"`: a linear regression model
|
||||
#' @return A [data.frame] with extra class [`resistance_predict`] with columns:
|
||||
#' - `year`
|
||||
#' - `value`, the same as `estimated` when `preserve_measurements = FALSE`, and a combination of `observed` and `estimated` otherwise
|
||||
#' - `se_min`, the lower bound of the standard error with a minimum of `0` (so the standard error will never go below 0%)
|
||||
#' - `se_max` the upper bound of the standard error with a maximum of `1` (so the standard error will never go above 100%)
|
||||
#' - `observations`, the total number of available observations in that year, i.e. \eqn{S + I + R}
|
||||
#' - `observed`, the original observed resistant percentages
|
||||
#' - `estimated`, the estimated resistant percentages, calculated by the model
|
||||
#'
|
||||
#' Furthermore, the model itself is available as an attribute: `attributes(x)$model`, please see *Examples*.
|
||||
#' @seealso The [proportion()] functions to calculate resistance
|
||||
#'
|
||||
#' Models: [lm()] [glm()]
|
||||
#' @rdname resistance_predict
|
||||
#' @export
|
||||
#' @importFrom stats predict glm lm
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @examples
|
||||
#' x <- resistance_predict(example_isolates,
|
||||
#' col_ab = "AMX",
|
||||
#' year_min = 2010,
|
||||
#' model = "binomial")
|
||||
#' plot(x)
|
||||
#' if (require("ggplot2")) {
|
||||
#' ggplot_rsi_predict(x)
|
||||
#' }
|
||||
#'
|
||||
#' # using dplyr:
|
||||
#' if (require("dplyr")) {
|
||||
#' x <- example_isolates %>%
|
||||
#' filter_first_isolate() %>%
|
||||
#' filter(mo_genus(mo) == "Staphylococcus") %>%
|
||||
#' resistance_predict("PEN", model = "binomial")
|
||||
#' plot(x)
|
||||
#'
|
||||
#' # get the model from the object
|
||||
#' mymodel <- attributes(x)$model
|
||||
#' summary(mymodel)
|
||||
#' }
|
||||
#'
|
||||
#' # create nice plots with ggplot2 yourself
|
||||
#' if (require("dplyr") & require("ggplot2")) {
|
||||
#'
|
||||
#' data <- example_isolates %>%
|
||||
#' filter(mo == as.mo("E. coli")) %>%
|
||||
#' resistance_predict(col_ab = "AMX",
|
||||
#' col_date = "date",
|
||||
#' model = "binomial",
|
||||
#' info = FALSE,
|
||||
#' minimum = 15)
|
||||
#'
|
||||
#' ggplot(data,
|
||||
#' aes(x = year)) +
|
||||
#' geom_col(aes(y = value),
|
||||
#' fill = "grey75") +
|
||||
#' geom_errorbar(aes(ymin = se_min,
|
||||
#' ymax = se_max),
|
||||
#' colour = "grey50") +
|
||||
#' scale_y_continuous(limits = c(0, 1),
|
||||
#' breaks = seq(0, 1, 0.1),
|
||||
#' labels = paste0(seq(0, 100, 10), "%")) +
|
||||
#' labs(title = expression(paste("Forecast of Amoxicillin Resistance in ",
|
||||
#' italic("E. coli"))),
|
||||
#' y = "%R",
|
||||
#' x = "Year") +
|
||||
#' theme_minimal(base_size = 13)
|
||||
#' }
|
||||
resistance_predict <- function(x,
|
||||
col_ab,
|
||||
col_date = NULL,
|
||||
year_min = NULL,
|
||||
year_max = NULL,
|
||||
year_every = 1,
|
||||
minimum = 30,
|
||||
model = NULL,
|
||||
I_as_S = TRUE,
|
||||
preserve_measurements = TRUE,
|
||||
info = interactive(),
|
||||
...) {
|
||||
meet_criteria(x, allow_class = "data.frame")
|
||||
meet_criteria(col_ab, allow_class = "character", has_length = 1, is_in = colnames(x))
|
||||
meet_criteria(col_date, allow_class = "character", has_length = 1, is_in = colnames(x), allow_NULL = TRUE)
|
||||
meet_criteria(year_min, allow_class = c("numeric", "integer"), has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(year_max, allow_class = c("numeric", "integer"), has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(year_every, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(minimum, allow_class = c("numeric", "integer"), has_length = 1)
|
||||
meet_criteria(model, allow_class = c("character", "function"), has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(I_as_S, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(preserve_measurements, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(info, allow_class = "logical", has_length = 1)
|
||||
|
||||
stop_if(is.null(model), 'choose a regression model with the `model` argument, e.g. resistance_predict(..., model = "binomial")')
|
||||
|
||||
dots <- unlist(list(...))
|
||||
if (length(dots) != 0) {
|
||||
# backwards compatibility with old arguments
|
||||
dots.names <- dots %pm>% names()
|
||||
if ("tbl" %in% dots.names) {
|
||||
x <- dots[which(dots.names == "tbl")]
|
||||
}
|
||||
if ("I_as_R" %in% dots.names) {
|
||||
warning_("`I_as_R is deprecated - use I_as_S instead.", call = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
# -- date
|
||||
if (is.null(col_date)) {
|
||||
col_date <- search_type_in_df(x = x, type = "date")
|
||||
stop_if(is.null(col_date), "`col_date` must be set")
|
||||
}
|
||||
stop_ifnot(col_date %in% colnames(x),
|
||||
"column '", col_date, "' not found")
|
||||
|
||||
# no grouped tibbles
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
|
||||
year <- function(x) {
|
||||
# don't depend on lubridate or so, would be overkill for only this function
|
||||
if (all(grepl("^[0-9]{4}$", x))) {
|
||||
as.integer(x)
|
||||
} else {
|
||||
as.integer(format(as.Date(x), "%Y"))
|
||||
}
|
||||
}
|
||||
|
||||
df <- x
|
||||
df[, col_ab] <- droplevels(as.rsi(df[, col_ab, drop = TRUE]))
|
||||
if (I_as_S == TRUE) {
|
||||
# then I as S
|
||||
df[, col_ab] <- gsub("I", "S", df[, col_ab, drop = TRUE])
|
||||
} else {
|
||||
# then I as R
|
||||
df[, col_ab] <- gsub("I", "R", df[, col_ab, drop = TRUE])
|
||||
}
|
||||
df[, col_ab] <- ifelse(is.na(df[, col_ab, drop = TRUE]), 0, df[, col_ab, drop = TRUE])
|
||||
|
||||
# remove rows with NAs
|
||||
df <- subset(df, !is.na(df[, col_ab, drop = TRUE]))
|
||||
df$year <- year(df[, col_date, drop = TRUE])
|
||||
df <- as.data.frame(rbind(table(df[, c("year", col_ab)])),
|
||||
stringsAsFactors = FALSE)
|
||||
df$year <- as.integer(rownames(df))
|
||||
rownames(df) <- NULL
|
||||
|
||||
df <- subset(df, sum(df$R + df$S, na.rm = TRUE) >= minimum)
|
||||
# nolint start
|
||||
df_matrix <- as.matrix(df[, c("R", "S"), drop = FALSE])
|
||||
# nolint end
|
||||
|
||||
stop_if(NROW(df) == 0, "there are no observations")
|
||||
|
||||
year_lowest <- min(df$year)
|
||||
if (is.null(year_min)) {
|
||||
year_min <- year_lowest
|
||||
} else {
|
||||
year_min <- max(year_min, year_lowest, na.rm = TRUE)
|
||||
}
|
||||
if (is.null(year_max)) {
|
||||
year_max <- year(Sys.Date()) + 10
|
||||
}
|
||||
|
||||
years <- list(year = seq(from = year_min, to = year_max, by = year_every))
|
||||
|
||||
if (model %in% c("binomial", "binom", "logit")) {
|
||||
model <- "binomial"
|
||||
model_lm <- with(df, glm(df_matrix ~ year, family = binomial))
|
||||
if (info == TRUE) {
|
||||
cat("\nLogistic regression model (logit) with binomial distribution")
|
||||
cat("\n------------------------------------------------------------\n")
|
||||
print(summary(model_lm))
|
||||
}
|
||||
|
||||
predictmodel <- predict(model_lm, newdata = years, type = "response", se.fit = TRUE)
|
||||
prediction <- predictmodel$fit
|
||||
se <- predictmodel$se.fit
|
||||
|
||||
} else if (model %in% c("loglin", "poisson")) {
|
||||
model <- "poisson"
|
||||
model_lm <- with(df, glm(R ~ year, family = poisson))
|
||||
if (info == TRUE) {
|
||||
cat("\nLog-linear regression model (loglin) with poisson distribution")
|
||||
cat("\n--------------------------------------------------------------\n")
|
||||
print(summary(model_lm))
|
||||
}
|
||||
|
||||
predictmodel <- predict(model_lm, newdata = years, type = "response", se.fit = TRUE)
|
||||
prediction <- predictmodel$fit
|
||||
se <- predictmodel$se.fit
|
||||
|
||||
} else if (model %in% c("lin", "linear")) {
|
||||
model <- "linear"
|
||||
model_lm <- with(df, lm((R / (R + S)) ~ year))
|
||||
if (info == TRUE) {
|
||||
cat("\nLinear regression model")
|
||||
cat("\n-----------------------\n")
|
||||
print(summary(model_lm))
|
||||
}
|
||||
|
||||
predictmodel <- predict(model_lm, newdata = years, se.fit = TRUE)
|
||||
prediction <- predictmodel$fit
|
||||
se <- predictmodel$se.fit
|
||||
|
||||
} else {
|
||||
stop("no valid model selected. See ?resistance_predict.")
|
||||
}
|
||||
|
||||
# prepare the output dataframe
|
||||
df_prediction <- data.frame(year = unlist(years),
|
||||
value = prediction,
|
||||
se_min = prediction - se,
|
||||
se_max = prediction + se,
|
||||
stringsAsFactors = FALSE)
|
||||
|
||||
if (model == "poisson") {
|
||||
df_prediction$value <- as.integer(format(df_prediction$value, scientific = FALSE))
|
||||
df_prediction$se_min <- as.integer(df_prediction$se_min)
|
||||
df_prediction$se_max <- as.integer(df_prediction$se_max)
|
||||
|
||||
} else {
|
||||
# se_max not above 1
|
||||
df_prediction$se_max <- ifelse(df_prediction$se_max > 1, 1, df_prediction$se_max)
|
||||
}
|
||||
# se_min not below 0
|
||||
df_prediction$se_min <- ifelse(df_prediction$se_min < 0, 0, df_prediction$se_min)
|
||||
|
||||
df_observations <- data.frame(year = df$year,
|
||||
observations = df$R + df$S,
|
||||
observed = df$R / (df$R + df$S),
|
||||
stringsAsFactors = FALSE)
|
||||
df_prediction <- df_prediction %pm>%
|
||||
pm_left_join(df_observations, by = "year")
|
||||
df_prediction$estimated <- df_prediction$value
|
||||
|
||||
if (preserve_measurements == TRUE) {
|
||||
# replace estimated data by observed data
|
||||
df_prediction$value <- ifelse(!is.na(df_prediction$observed), df_prediction$observed, df_prediction$value)
|
||||
df_prediction$se_min <- ifelse(!is.na(df_prediction$observed), NA, df_prediction$se_min)
|
||||
df_prediction$se_max <- ifelse(!is.na(df_prediction$observed), NA, df_prediction$se_max)
|
||||
}
|
||||
|
||||
df_prediction$value <- ifelse(df_prediction$value > 1, 1, ifelse(df_prediction$value < 0, 0, df_prediction$value))
|
||||
df_prediction <- df_prediction[order(df_prediction$year), ]
|
||||
|
||||
structure(
|
||||
.Data = df_prediction,
|
||||
class = c("resistance_predict", "data.frame"),
|
||||
I_as_S = I_as_S,
|
||||
model_title = model,
|
||||
model = model_lm,
|
||||
ab = col_ab
|
||||
)
|
||||
}
|
||||
|
||||
#' @rdname resistance_predict
|
||||
#' @export
|
||||
rsi_predict <- resistance_predict
|
||||
|
||||
#' @method plot resistance_predict
|
||||
#' @export
|
||||
#' @importFrom graphics plot axis arrows points
|
||||
#' @rdname resistance_predict
|
||||
plot.resistance_predict <- function(x, main = paste("Resistance Prediction of", x_name), ...) {
|
||||
x_name <- paste0(ab_name(attributes(x)$ab), " (", attributes(x)$ab, ")")
|
||||
meet_criteria(main, allow_class = "character", has_length = 1)
|
||||
|
||||
if (attributes(x)$I_as_S == TRUE) {
|
||||
ylab <- "%R"
|
||||
} else {
|
||||
ylab <- "%IR"
|
||||
}
|
||||
|
||||
plot(x = x$year,
|
||||
y = x$value,
|
||||
ylim = c(0, 1),
|
||||
yaxt = "n", # no y labels
|
||||
pch = 19, # closed dots
|
||||
ylab = paste0("Percentage (", ylab, ")"),
|
||||
xlab = "Year",
|
||||
main = main,
|
||||
sub = paste0("(n = ", sum(x$observations, na.rm = TRUE),
|
||||
", model: ", attributes(x)$model_title, ")"),
|
||||
cex.sub = 0.75)
|
||||
|
||||
|
||||
axis(side = 2, at = seq(0, 1, 0.1), labels = paste0(0:10 * 10, "%"))
|
||||
|
||||
# hack for error bars: https://stackoverflow.com/a/22037078/4575331
|
||||
arrows(x0 = x$year,
|
||||
y0 = x$se_min,
|
||||
x1 = x$year,
|
||||
y1 = x$se_max,
|
||||
length = 0.05, angle = 90, code = 3, lwd = 1.5)
|
||||
|
||||
# overlay grey points for prediction
|
||||
points(x = subset(x, is.na(observations))$year,
|
||||
y = subset(x, is.na(observations))$value,
|
||||
pch = 19,
|
||||
col = "grey40")
|
||||
}
|
||||
|
||||
#' @rdname resistance_predict
|
||||
#' @export
|
||||
ggplot_rsi_predict <- function(x,
|
||||
main = paste("Resistance Prediction of", x_name),
|
||||
ribbon = TRUE,
|
||||
...) {
|
||||
x_name <- paste0(ab_name(attributes(x)$ab), " (", attributes(x)$ab, ")")
|
||||
meet_criteria(main, allow_class = "character", has_length = 1)
|
||||
meet_criteria(ribbon, allow_class = "logical", has_length = 1)
|
||||
|
||||
stop_ifnot_installed("ggplot2")
|
||||
stop_ifnot(inherits(x, "resistance_predict"), "`x` must be a resistance prediction model created with resistance_predict()")
|
||||
|
||||
|
||||
if (attributes(x)$I_as_S == TRUE) {
|
||||
ylab <- "%R"
|
||||
} else {
|
||||
ylab <- "%IR"
|
||||
}
|
||||
|
||||
p <- ggplot2::ggplot(x, ggplot2::aes(x = year, y = value)) +
|
||||
ggplot2::geom_point(data = subset(x, !is.na(observations)),
|
||||
size = 2) +
|
||||
scale_y_percent(limits = c(0, 1)) +
|
||||
ggplot2::labs(title = main,
|
||||
y = paste0("Percentage (", ylab, ")"),
|
||||
x = "Year",
|
||||
caption = paste0("(n = ", sum(x$observations, na.rm = TRUE),
|
||||
", model: ", attributes(x)$model_title, ")"))
|
||||
|
||||
if (ribbon == TRUE) {
|
||||
p <- p + ggplot2::geom_ribbon(ggplot2::aes(ymin = se_min, ymax = se_max), alpha = 0.25)
|
||||
} else {
|
||||
p <- p + ggplot2::geom_errorbar(ggplot2::aes(ymin = se_min, ymax = se_max), na.rm = TRUE, width = 0.5)
|
||||
}
|
||||
p <- p +
|
||||
# overlay grey points for prediction
|
||||
ggplot2::geom_point(data = subset(x, is.na(observations)),
|
||||
size = 2,
|
||||
colour = "grey40")
|
||||
p
|
||||
}
|
||||
-341
@@ -1,341 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
dots2vars <- function(...) {
|
||||
# this function is to give more informative output about
|
||||
# variable names in count_* and proportion_* functions
|
||||
dots <- substitute(list(...))
|
||||
paste(as.character(dots)[2:length(dots)], collapse = ", ")
|
||||
}
|
||||
|
||||
rsi_calc <- function(...,
|
||||
ab_result,
|
||||
minimum = 0,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE,
|
||||
only_count = FALSE) {
|
||||
meet_criteria(ab_result, allow_class = c("character", "numeric", "integer"), has_length = c(1, 2, 3), .call_depth = 1)
|
||||
meet_criteria(minimum, allow_class = c("numeric", "integer"), has_length = 1, .call_depth = 1)
|
||||
meet_criteria(as_percent, allow_class = "logical", has_length = 1, .call_depth = 1)
|
||||
meet_criteria(only_all_tested, allow_class = "logical", has_length = 1, .call_depth = 1)
|
||||
meet_criteria(only_count, allow_class = "logical", has_length = 1, .call_depth = 1)
|
||||
|
||||
data_vars <- dots2vars(...)
|
||||
|
||||
dots_df <- switch(1, ...)
|
||||
if (is.data.frame(dots_df)) {
|
||||
# make sure to remove all other classes like tibbles, data.tables, etc
|
||||
dots_df <- as.data.frame(dots_df, stringsAsFactors = FALSE)
|
||||
}
|
||||
|
||||
dots <- eval(substitute(alist(...)))
|
||||
stop_if(length(dots) == 0, "no variables selected", call = -2)
|
||||
|
||||
stop_if("also_single_tested" %in% names(dots),
|
||||
"`also_single_tested` was replaced by `only_all_tested`.\n",
|
||||
"Please read Details in the help page (`?proportion`) as this may have a considerable impact on your analysis.", call = -2)
|
||||
ndots <- length(dots)
|
||||
|
||||
if (is.data.frame(dots_df)) {
|
||||
# data.frame passed with other columns, like: example_isolates %pm>% proportion_S(AMC, GEN)
|
||||
|
||||
dots <- as.character(dots)
|
||||
# remove first element, it's the data.frame
|
||||
if (length(dots) == 1) {
|
||||
dots <- character(0)
|
||||
} else {
|
||||
dots <- dots[2:length(dots)]
|
||||
}
|
||||
if (length(dots) == 0 | all(dots == "df")) {
|
||||
# for complete data.frames, like example_isolates %pm>% select(AMC, GEN) %pm>% proportion_S()
|
||||
# and the old rsi function, which has "df" as name of the first argument
|
||||
x <- dots_df
|
||||
} else {
|
||||
# get dots that are in column names already, and the ones that will be once evaluated using dots_df or global env
|
||||
# this is to support susceptibility(example_isolates, AMC, any_of(some_vector_with_AB_names))
|
||||
dots <- c(dots[dots %in% colnames(dots_df)],
|
||||
eval(parse(text = dots[!dots %in% colnames(dots_df)]), envir = dots_df, enclos = globalenv()))
|
||||
dots_not_exist <- dots[!dots %in% colnames(dots_df)]
|
||||
stop_if(length(dots_not_exist) > 0, "column(s) not found: ", paste0("'", dots_not_exist, "'", collapse = ", "), call = -2)
|
||||
x <- dots_df[, dots, drop = FALSE]
|
||||
}
|
||||
} else if (ndots == 1) {
|
||||
# only 1 variable passed (can also be data.frame), like: proportion_S(example_isolates$AMC) and example_isolates$AMC %pm>% proportion_S()
|
||||
x <- dots_df
|
||||
} else {
|
||||
# multiple variables passed without pipe, like: proportion_S(example_isolates$AMC, example_isolates$GEN)
|
||||
x <- NULL
|
||||
try(x <- as.data.frame(dots, stringsAsFactors = FALSE), silent = TRUE)
|
||||
if (is.null(x)) {
|
||||
# support for example_isolates %pm>% group_by(hospital_id) %pm>% summarise(amox = susceptibility(GEN, AMX))
|
||||
x <- as.data.frame(list(...), stringsAsFactors = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
if (is.null(x)) {
|
||||
warning_("argument is NULL (check if columns exist): returning NA", call = FALSE)
|
||||
if (as_percent == TRUE) {
|
||||
return(NA_character_)
|
||||
} else {
|
||||
return(NA_real_)
|
||||
}
|
||||
}
|
||||
|
||||
print_warning <- FALSE
|
||||
|
||||
ab_result <- as.rsi(ab_result)
|
||||
|
||||
if (is.data.frame(x)) {
|
||||
rsi_integrity_check <- character(0)
|
||||
for (i in seq_len(ncol(x))) {
|
||||
# check integrity of columns: force <rsi> class
|
||||
if (!is.rsi(x[, i, drop = TRUE])) {
|
||||
rsi_integrity_check <- c(rsi_integrity_check, as.character(x[, i, drop = TRUE]))
|
||||
x[, i] <- suppressWarnings(as.rsi(x[, i, drop = TRUE])) # warning will be given later
|
||||
print_warning <- TRUE
|
||||
}
|
||||
}
|
||||
if (length(rsi_integrity_check) > 0) {
|
||||
# this will give a warning for invalid results, of all input columns (so only 1 warning)
|
||||
rsi_integrity_check <- as.rsi(rsi_integrity_check)
|
||||
}
|
||||
|
||||
x_transposed <- as.list(as.data.frame(t(x), stringsAsFactors = FALSE))
|
||||
if (only_all_tested == TRUE) {
|
||||
# no NAs in any column
|
||||
y <- apply(X = as.data.frame(lapply(x, as.integer), stringsAsFactors = FALSE),
|
||||
MARGIN = 1,
|
||||
FUN = min)
|
||||
numerator <- sum(as.integer(y) %in% as.integer(ab_result), na.rm = TRUE)
|
||||
denominator <- sum(vapply(FUN.VALUE = logical(1), x_transposed, function(y) !(any(is.na(y)))))
|
||||
} else {
|
||||
# may contain NAs in any column
|
||||
other_values <- setdiff(c(NA, levels(ab_result)), ab_result)
|
||||
numerator <- sum(vapply(FUN.VALUE = logical(1), x_transposed, function(y) any(y %in% ab_result, na.rm = TRUE)))
|
||||
denominator <- sum(vapply(FUN.VALUE = logical(1), x_transposed, function(y) !(all(y %in% other_values) & any(is.na(y)))))
|
||||
}
|
||||
} else {
|
||||
# x is not a data.frame
|
||||
if (!is.rsi(x)) {
|
||||
x <- as.rsi(x)
|
||||
print_warning <- TRUE
|
||||
}
|
||||
numerator <- sum(x %in% ab_result, na.rm = TRUE)
|
||||
denominator <- sum(x %in% levels(ab_result), na.rm = TRUE)
|
||||
}
|
||||
|
||||
if (print_warning == TRUE) {
|
||||
if (message_not_thrown_before("rsi_calc")) {
|
||||
warning_("Increase speed by transforming to class <rsi> on beforehand: your_data %>% mutate_if(is.rsi.eligible, as.rsi)",
|
||||
call = FALSE)
|
||||
remember_thrown_message("rsi_calc")
|
||||
}
|
||||
}
|
||||
|
||||
if (only_count == TRUE) {
|
||||
return(numerator)
|
||||
}
|
||||
|
||||
if (denominator < minimum) {
|
||||
if (data_vars != "") {
|
||||
data_vars <- paste(" for", data_vars)
|
||||
}
|
||||
warning_("Introducing NA: only ", denominator, " results available", data_vars, " (`minimum` = ", minimum, ").", call = FALSE)
|
||||
fraction <- NA_real_
|
||||
} else {
|
||||
fraction <- numerator / denominator
|
||||
fraction[is.nan(fraction)] <- NA_real_
|
||||
}
|
||||
|
||||
if (as_percent == TRUE) {
|
||||
percentage(fraction, digits = 1)
|
||||
} else {
|
||||
fraction
|
||||
}
|
||||
}
|
||||
|
||||
rsi_calc_df <- function(type, # "proportion", "count" or "both"
|
||||
data,
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE,
|
||||
combine_SI_missing = FALSE) {
|
||||
meet_criteria(type, is_in = c("proportion", "count", "both"), has_length = 1, .call_depth = 1)
|
||||
meet_criteria(data, allow_class = "data.frame", contains_column_class = "rsi", .call_depth = 1)
|
||||
meet_criteria(translate_ab, allow_class = c("character", "logical"), has_length = 1, allow_NA = TRUE, .call_depth = 1)
|
||||
meet_criteria(language, has_length = 1, is_in = c(LANGUAGES_SUPPORTED, ""), allow_NULL = TRUE, allow_NA = TRUE, .call_depth = 1)
|
||||
meet_criteria(minimum, allow_class = c("numeric", "integer"), has_length = 1, .call_depth = 1)
|
||||
meet_criteria(as_percent, allow_class = "logical", has_length = 1, .call_depth = 1)
|
||||
meet_criteria(combine_SI, allow_class = "logical", has_length = 1, .call_depth = 1)
|
||||
meet_criteria(combine_SI_missing, allow_class = "logical", has_length = 1, .call_depth = 1)
|
||||
|
||||
check_dataset_integrity()
|
||||
|
||||
if (isTRUE(combine_IR) & isTRUE(combine_SI_missing)) {
|
||||
combine_SI <- FALSE
|
||||
}
|
||||
stop_if(isTRUE(combine_SI) & isTRUE(combine_IR), "either `combine_SI` or `combine_IR` can be TRUE, not both", call = -2)
|
||||
|
||||
translate_ab <- get_translate_ab(translate_ab)
|
||||
|
||||
# select only groups and antibiotics
|
||||
if (inherits(data, "grouped_df")) {
|
||||
data_has_groups <- TRUE
|
||||
groups <- setdiff(names(attributes(data)$groups), ".rows")
|
||||
data <- data[, c(groups, colnames(data)[vapply(FUN.VALUE = logical(1), data, is.rsi)]), drop = FALSE]
|
||||
} else {
|
||||
data_has_groups <- FALSE
|
||||
data <- data[, colnames(data)[vapply(FUN.VALUE = logical(1), data, is.rsi)], drop = FALSE]
|
||||
}
|
||||
|
||||
data <- as.data.frame(data, stringsAsFactors = FALSE)
|
||||
if (isTRUE(combine_SI) | isTRUE(combine_IR)) {
|
||||
for (i in seq_len(ncol(data))) {
|
||||
if (is.rsi(data[, i, drop = TRUE])) {
|
||||
data[, i] <- as.character(data[, i, drop = TRUE])
|
||||
if (isTRUE(combine_SI)) {
|
||||
data[, i] <- gsub("(I|S)", "SI", data[, i, drop = TRUE])
|
||||
} else if (isTRUE(combine_IR)) {
|
||||
data[, i] <- gsub("(I|R)", "IR", data[, i, drop = TRUE])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sum_it <- function(.data) {
|
||||
out <- data.frame(antibiotic = character(0),
|
||||
interpretation = character(0),
|
||||
value = double(0),
|
||||
isolates = integer(0),
|
||||
stringsAsFactors = FALSE)
|
||||
if (data_has_groups) {
|
||||
group_values <- unique(.data[, which(colnames(.data) %in% groups), drop = FALSE])
|
||||
rownames(group_values) <- NULL
|
||||
.data <- .data[, which(!colnames(.data) %in% groups), drop = FALSE]
|
||||
}
|
||||
for (i in seq_len(ncol(.data))) {
|
||||
values <- .data[, i, drop = TRUE]
|
||||
if (isTRUE(combine_SI)) {
|
||||
values <- factor(values, levels = c("SI", "R"), ordered = TRUE)
|
||||
} else if (isTRUE(combine_IR)) {
|
||||
values <- factor(values, levels = c("S", "IR"), ordered = TRUE)
|
||||
} else {
|
||||
values <- factor(values, levels = c("S", "I", "R"), ordered = TRUE)
|
||||
}
|
||||
col_results <- as.data.frame(as.matrix(table(values)), stringsAsFactors = FALSE)
|
||||
col_results$interpretation <- rownames(col_results)
|
||||
col_results$isolates <- col_results[, 1, drop = TRUE]
|
||||
if (NROW(col_results) > 0 && sum(col_results$isolates, na.rm = TRUE) > 0) {
|
||||
if (sum(col_results$isolates, na.rm = TRUE) >= minimum) {
|
||||
col_results$value <- col_results$isolates / sum(col_results$isolates, na.rm = TRUE)
|
||||
} else {
|
||||
col_results$value <- rep(NA_real_, NROW(col_results))
|
||||
}
|
||||
out_new <- data.frame(antibiotic = ifelse(isFALSE(translate_ab),
|
||||
colnames(.data)[i],
|
||||
ab_property(colnames(.data)[i], property = translate_ab, language = language)),
|
||||
interpretation = col_results$interpretation,
|
||||
value = col_results$value,
|
||||
isolates = col_results$isolates,
|
||||
stringsAsFactors = FALSE)
|
||||
if (data_has_groups) {
|
||||
if (nrow(group_values) < nrow(out_new)) {
|
||||
# repeat group_values for the number of rows in out_new
|
||||
repeated <- rep(seq_len(nrow(group_values)),
|
||||
each = nrow(out_new) / nrow(group_values))
|
||||
group_values <- group_values[repeated, , drop = FALSE]
|
||||
}
|
||||
out_new <- cbind(group_values, out_new)
|
||||
}
|
||||
out <- rbind(out, out_new, stringsAsFactors = FALSE)
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
# based on pm_apply_grouped_function
|
||||
apply_group <- function(.data, fn, groups, drop = FALSE, ...) {
|
||||
grouped <- pm_split_into_groups(.data, groups, drop)
|
||||
res <- do.call(rbind, unname(lapply(grouped, fn, ...)))
|
||||
if (any(groups %in% colnames(res))) {
|
||||
class(res) <- c("grouped_data", class(res))
|
||||
res <- pm_set_groups(res, groups[groups %in% colnames(res)])
|
||||
}
|
||||
res
|
||||
}
|
||||
|
||||
if (data_has_groups) {
|
||||
out <- apply_group(data, "sum_it", groups)
|
||||
} else {
|
||||
out <- sum_it(data)
|
||||
}
|
||||
|
||||
# apply factors for right sorting in interpretation
|
||||
if (isTRUE(combine_SI)) {
|
||||
out$interpretation <- factor(out$interpretation, levels = c("SI", "R"), ordered = TRUE)
|
||||
} else if (isTRUE(combine_IR)) {
|
||||
out$interpretation <- factor(out$interpretation, levels = c("S", "IR"), ordered = TRUE)
|
||||
} else {
|
||||
# don't use as.rsi() here, as it would add the class <rsi> and we would like
|
||||
# the same data structure as output, regardless of input
|
||||
out$interpretation <- factor(out$interpretation, levels = c("S", "I", "R"), ordered = TRUE)
|
||||
}
|
||||
|
||||
if (data_has_groups) {
|
||||
# ordering by the groups and two more: "antibiotic" and "interpretation"
|
||||
out <- pm_ungroup(out[do.call("order", out[, seq_len(length(groups) + 2)]), ])
|
||||
} else {
|
||||
out <- out[order(out$antibiotic, out$interpretation), ]
|
||||
}
|
||||
|
||||
if (type == "proportion") {
|
||||
out <- subset(out, select = -c(isolates))
|
||||
} else if (type == "count") {
|
||||
out$value <- out$isolates
|
||||
out <- subset(out, select = -c(isolates))
|
||||
}
|
||||
|
||||
rownames(out) <- NULL
|
||||
out
|
||||
}
|
||||
|
||||
get_translate_ab <- function(translate_ab) {
|
||||
translate_ab <- as.character(translate_ab)[1L]
|
||||
if (translate_ab %in% c("TRUE", "official")) {
|
||||
return("name")
|
||||
} else if (translate_ab %in% c(NA_character_, "FALSE")) {
|
||||
return(FALSE)
|
||||
} else {
|
||||
translate_ab <- tolower(translate_ab)
|
||||
stop_ifnot(translate_ab %in% colnames(AMR::antibiotics),
|
||||
"invalid value for 'translate_ab', this must be a column name of the antibiotics data set\n",
|
||||
"or TRUE (equals 'name') or FALSE to not translate at all.",
|
||||
call = FALSE)
|
||||
translate_ab
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' @rdname proportion
|
||||
#' @export
|
||||
rsi_df <- function(data,
|
||||
translate_ab = "name",
|
||||
language = get_locale(),
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
combine_SI = TRUE,
|
||||
combine_IR = FALSE) {
|
||||
rsi_calc_df(type = "both",
|
||||
data = data,
|
||||
translate_ab = translate_ab,
|
||||
language = language,
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
combine_SI = combine_SI,
|
||||
combine_IR = combine_IR,
|
||||
combine_SI_missing = missing(combine_SI))
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Skewness of the sample
|
||||
#'
|
||||
#' @description Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean.
|
||||
#'
|
||||
#' When negative ('left-skewed'): the left tail is longer; the mass of the distribution is concentrated on the right of a histogram. When positive ('right-skewed'): the right tail is longer; the mass of the distribution is concentrated on the left of a histogram. A normal distribution has a skewness of 0.
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @param x a vector of values, a [matrix] or a [data.frame]
|
||||
#' @param na.rm a logical value indicating whether `NA` values should be stripped before the computation proceeds
|
||||
#' @seealso [kurtosis()]
|
||||
#' @rdname skewness
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @export
|
||||
skewness <- function(x, na.rm = FALSE) {
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
UseMethod("skewness")
|
||||
}
|
||||
|
||||
#' @method skewness default
|
||||
#' @rdname skewness
|
||||
#' @export
|
||||
skewness.default <- function(x, na.rm = FALSE) {
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
x <- as.vector(x)
|
||||
if (na.rm == TRUE) {
|
||||
x <- x[!is.na(x)]
|
||||
}
|
||||
n <- length(x)
|
||||
(sum((x - mean(x))^3) / n) / (sum((x - mean(x)) ^ 2) / n) ^ (3 / 2)
|
||||
}
|
||||
|
||||
#' @method skewness matrix
|
||||
#' @rdname skewness
|
||||
#' @export
|
||||
skewness.matrix <- function(x, na.rm = FALSE) {
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
apply(x, 2, skewness.default, na.rm = na.rm)
|
||||
}
|
||||
|
||||
#' @method skewness data.frame
|
||||
#' @rdname skewness
|
||||
#' @export
|
||||
skewness.data.frame <- function(x, na.rm = FALSE) {
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
vapply(FUN.VALUE = double(1), x, skewness.default, na.rm = na.rm)
|
||||
}
|
||||
Binary file not shown.
-177
@@ -1,177 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Translate strings from AMR package
|
||||
#'
|
||||
#' For language-dependent output of AMR functions, like [mo_name()], [mo_gramstain()], [mo_type()] and [ab_name()].
|
||||
#' @inheritSection lifecycle Stable lifecycle
|
||||
#' @details Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: <https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv>. This file will be read by all functions where a translated output can be desired, like all [`mo_*`][mo_property()] functions (such as [mo_name()], [mo_gramstain()], [mo_type()], etc.) and [`ab_*`][ab_property()] functions (such as [ab_name()], [ab_group()], etc.).
|
||||
#'
|
||||
#' Currently supported languages are: `r paste(sort(gsub(";.*", "", ISOcodes::ISO_639_2[which(ISOcodes::ISO_639_2$Alpha_2 %in% LANGUAGES_SUPPORTED), "Name"])), collapse = ", ")`. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names.
|
||||
#'
|
||||
#' Please suggest your own translations [by creating a new issue on our repository](https://github.com/msberends/AMR/issues/new?title=Translations).
|
||||
#'
|
||||
#' ## Changing the default language
|
||||
#' The system language will be used at default (as returned by `Sys.getenv("LANG")` or, if `LANG` is not set, [Sys.getlocale()]), if that language is supported. But the language to be used can be overwritten in two ways and will be checked in this order:
|
||||
#'
|
||||
#' 1. Setting the R option `AMR_locale`, e.g. by running `options(AMR_locale = "de")`
|
||||
#' 2. Setting the system variable `LANGUAGE` or `LANG`, e.g. by adding `LANGUAGE="de_DE.utf8"` to your `.Renviron` file in your home directory
|
||||
#'
|
||||
#' So if the R option `AMR_locale` is set, the system variables `LANGUAGE` and `LANG` will be ignored.
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @rdname translate
|
||||
#' @name translate
|
||||
#' @export
|
||||
#' @examples
|
||||
#' # The 'language' argument of below functions
|
||||
#' # will be set automatically to your system language
|
||||
#' # with get_locale()
|
||||
#'
|
||||
#' # English
|
||||
#' mo_name("CoNS", language = "en")
|
||||
#' #> "Coagulase-negative Staphylococcus (CoNS)"
|
||||
#'
|
||||
#' # German
|
||||
#' mo_name("CoNS", language = "de")
|
||||
#' #> "Koagulase-negative Staphylococcus (KNS)"
|
||||
#'
|
||||
#' # Dutch
|
||||
#' mo_name("CoNS", language = "nl")
|
||||
#' #> "Coagulase-negatieve Staphylococcus (CNS)"
|
||||
#'
|
||||
#' # Spanish
|
||||
#' mo_name("CoNS", language = "es")
|
||||
#' #> "Staphylococcus coagulasa negativo (SCN)"
|
||||
#'
|
||||
#' # Italian
|
||||
#' mo_name("CoNS", language = "it")
|
||||
#' #> "Staphylococcus negativo coagulasi (CoNS)"
|
||||
#'
|
||||
#' # Portuguese
|
||||
#' mo_name("CoNS", language = "pt")
|
||||
#' #> "Staphylococcus coagulase negativo (CoNS)"
|
||||
get_locale <- function() {
|
||||
# AMR versions 1.3.0 and prior used the environmental variable:
|
||||
if (!identical("", Sys.getenv("AMR_locale"))) {
|
||||
options(AMR_locale = Sys.getenv("AMR_locale"))
|
||||
}
|
||||
|
||||
if (!is.null(getOption("AMR_locale", default = NULL))) {
|
||||
lang <- getOption("AMR_locale")
|
||||
if (lang %in% LANGUAGES_SUPPORTED) {
|
||||
return(lang)
|
||||
} else {
|
||||
stop_("unsupported language set as option 'AMR_locale': '", lang, "' - use one of: ",
|
||||
paste0("'", LANGUAGES_SUPPORTED, "'", collapse = ", "))
|
||||
}
|
||||
} else {
|
||||
# we now support the LANGUAGE system variable - return it if set
|
||||
if (!identical("", Sys.getenv("LANGUAGE"))) {
|
||||
return(coerce_language_setting(Sys.getenv("LANGUAGE")))
|
||||
}
|
||||
if (!identical("", Sys.getenv("LANG"))) {
|
||||
return(coerce_language_setting(Sys.getenv("LANG")))
|
||||
}
|
||||
}
|
||||
|
||||
coerce_language_setting(Sys.getlocale("LC_COLLATE"))
|
||||
}
|
||||
|
||||
coerce_language_setting <- function(lang) {
|
||||
# grepl() with ignore.case = FALSE is faster than %like%
|
||||
if (grepl("^(English|en_|EN_)", lang, ignore.case = FALSE, perl = TRUE)) {
|
||||
# as first option to optimise speed
|
||||
"en"
|
||||
} else if (grepl("^(German|Deutsch|de_|DE_)", lang, ignore.case = FALSE, perl = TRUE)) {
|
||||
"de"
|
||||
} else if (grepl("^(Dutch|Nederlands|nl_|NL_)", lang, ignore.case = FALSE, perl = TRUE)) {
|
||||
"nl"
|
||||
} else if (grepl("^(Spanish|Espa.+ol|es_|ES_)", lang, ignore.case = FALSE, perl = TRUE)) {
|
||||
"es"
|
||||
} else if (grepl("^(Italian|Italiano|it_|IT_)", lang, ignore.case = FALSE, perl = TRUE)) {
|
||||
"it"
|
||||
} else if (grepl("^(French|Fran.+ais|fr_|FR_)", lang, ignore.case = FALSE, perl = TRUE)) {
|
||||
"fr"
|
||||
} else if (grepl("^(Portuguese|Portugu.+s|pt_|PT_)", lang, ignore.case = FALSE, perl = TRUE)) {
|
||||
"pt"
|
||||
} else {
|
||||
# other language -> set to English
|
||||
"en"
|
||||
}
|
||||
}
|
||||
|
||||
# translate strings based on inst/translations.tsv
|
||||
translate_AMR <- function(from, language = get_locale(), only_unknown = FALSE) {
|
||||
|
||||
if (is.null(language)) {
|
||||
return(from)
|
||||
}
|
||||
if (language %in% c("en", "", NA)) {
|
||||
return(from)
|
||||
}
|
||||
|
||||
df_trans <- translations_file # internal data file
|
||||
from.bak <- from
|
||||
from_unique <- unique(from)
|
||||
from_unique_translated <- from_unique
|
||||
|
||||
stop_ifnot(language %in% LANGUAGES_SUPPORTED,
|
||||
"unsupported language: '", language, "' - use one of: ",
|
||||
paste0("'", LANGUAGES_SUPPORTED, "'", collapse = ", "),
|
||||
call = FALSE)
|
||||
|
||||
df_trans <- subset(df_trans, lang == language)
|
||||
if (only_unknown == TRUE) {
|
||||
df_trans <- subset(df_trans, pattern %like% "unknown")
|
||||
}
|
||||
|
||||
# default case sensitive if value if 'ignore.case' is missing:
|
||||
df_trans$ignore.case[is.na(df_trans$ignore.case)] <- FALSE
|
||||
# default not using regular expressions (fixed = TRUE) if 'fixed' is missing:
|
||||
df_trans$fixed[is.na(df_trans$fixed)] <- TRUE
|
||||
|
||||
# check if text to look for is in one of the patterns
|
||||
any_form_in_patterns <- tryCatch(any(from_unique %like% paste0("(", paste(df_trans$pattern, collapse = "|"), ")")),
|
||||
error = function(e) {
|
||||
warning_("Translation not possible. Please open an issue on GitHub (https://github.com/msberends/AMR/issues).", call = FALSE)
|
||||
return(FALSE)
|
||||
})
|
||||
if (NROW(df_trans) == 0 | !any_form_in_patterns) {
|
||||
return(from)
|
||||
}
|
||||
|
||||
lapply(seq_len(nrow(df_trans)),
|
||||
function(i) from_unique_translated <<- gsub(pattern = df_trans$pattern[i],
|
||||
replacement = df_trans$replacement[i],
|
||||
x = from_unique_translated,
|
||||
ignore.case = df_trans$ignore.case[i],
|
||||
fixed = df_trans$fixed[i]))
|
||||
|
||||
# force UTF-8 for diacritics
|
||||
from_unique_translated <- enc2utf8(from_unique_translated)
|
||||
|
||||
# a kind of left join to get all results back
|
||||
from_unique_translated[match(from.bak, from_unique)]
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
#' WHOCC: WHO Collaborating Centre for Drug Statistics Methodology
|
||||
#'
|
||||
#' All antimicrobial drugs and their official names, ATC codes, ATC groups and defined daily dose (DDD) are included in this package, using the WHO Collaborating Centre for Drug Statistics Methodology.
|
||||
#' @section WHOCC:
|
||||
#' \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr}
|
||||
#' This package contains **all ~550 antibiotic, antimycotic and antiviral drugs** and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, <https://www.whocc.no>) and the Pharmaceuticals Community Register of the European Commission (<http://ec.europa.eu/health/documents/community-register/html/atc.htm>).
|
||||
#'
|
||||
#' These have become the gold standard for international drug utilisation monitoring and research.
|
||||
#'
|
||||
#' The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
|
||||
#'
|
||||
#' **NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.** See <https://www.whocc.no/copyright_disclaimer/.>
|
||||
#' @inheritSection AMR Read more on our website!
|
||||
#' @name WHOCC
|
||||
#' @rdname WHOCC
|
||||
#' @examples
|
||||
#' as.ab("meropenem")
|
||||
#' ab_name("J01DH02")
|
||||
#'
|
||||
#' ab_tradenames("flucloxacillin")
|
||||
NULL
|
||||
@@ -1,190 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
# set up package environment, used by numerous AMR functions
|
||||
pkg_env <- new.env(hash = FALSE)
|
||||
pkg_env$mo_failed <- character(0)
|
||||
|
||||
.onLoad <- function(libname, pkgname) {
|
||||
|
||||
assign(x = "AB_lookup",
|
||||
value = create_AB_lookup(),
|
||||
envir = asNamespace("AMR"))
|
||||
|
||||
assign(x = "MO_lookup",
|
||||
value = create_MO_lookup(),
|
||||
envir = asNamespace("AMR"))
|
||||
|
||||
assign(x = "MO.old_lookup",
|
||||
value = create_MO.old_lookup(),
|
||||
envir = asNamespace("AMR"))
|
||||
|
||||
assign(x = "INTRINSIC_R",
|
||||
value = create_intr_resistance(),
|
||||
envir = asNamespace("AMR"))
|
||||
|
||||
assign(x = "LANGUAGES_SUPPORTED",
|
||||
value = sort(c("en", unique(translations_file$lang))),
|
||||
envir = asNamespace("AMR"))
|
||||
|
||||
assign(x = "MO_CONS",
|
||||
value = create_species_cons_cops("CoNS"),
|
||||
envir = asNamespace("AMR"))
|
||||
|
||||
assign(x = "MO_COPS",
|
||||
value = create_species_cons_cops("CoPS"),
|
||||
envir = asNamespace("AMR"))
|
||||
|
||||
# Support for tibble headers (type_sum) and tibble columns content (pillar_shaft)
|
||||
# without the need to depend on other packages. This was suggested by the
|
||||
# developers of the vctrs package:
|
||||
# https://github.com/r-lib/vctrs/blob/05968ce8e669f73213e3e894b5f4424af4f46316/R/register-s3.R
|
||||
s3_register("pillar::pillar_shaft", "ab")
|
||||
s3_register("pillar::pillar_shaft", "mo")
|
||||
s3_register("pillar::pillar_shaft", "rsi")
|
||||
s3_register("pillar::pillar_shaft", "mic")
|
||||
s3_register("pillar::pillar_shaft", "disk")
|
||||
s3_register("tibble::type_sum", "ab")
|
||||
s3_register("tibble::type_sum", "mo")
|
||||
s3_register("tibble::type_sum", "rsi")
|
||||
s3_register("tibble::type_sum", "mic")
|
||||
s3_register("tibble::type_sum", "disk")
|
||||
# Support for frequency tables from the cleaner package
|
||||
s3_register("cleaner::freq", "mo")
|
||||
s3_register("cleaner::freq", "rsi")
|
||||
# Support from skim() from the skimr package
|
||||
s3_register("skimr::get_skimmers", "mo")
|
||||
s3_register("skimr::get_skimmers", "rsi")
|
||||
s3_register("skimr::get_skimmers", "mic")
|
||||
s3_register("skimr::get_skimmers", "disk")
|
||||
|
||||
# if mo source exists, fire it up (see mo_source())
|
||||
try({
|
||||
if (file.exists(getOption("AMR_mo_source", "~/mo_source.rds"))) {
|
||||
invisible(get_mo_source())
|
||||
}
|
||||
}, silent = TRUE)
|
||||
}
|
||||
|
||||
.onAttach <- function(...) {
|
||||
# show notice in 10% of cases in interactive session
|
||||
if (!interactive() || stats::runif(1) > 0.1 || isTRUE(as.logical(getOption("AMR_silentstart", FALSE)))) {
|
||||
return()
|
||||
}
|
||||
packageStartupMessage(word_wrap("Thank you for using the AMR package! ",
|
||||
"If you have a minute, please anonymously fill in this short questionnaire to improve the package and its functionalities: ",
|
||||
font_blue("https://msberends.github.io/AMR/survey.html\n"),
|
||||
"[prevent his notice with ",
|
||||
font_bold("suppressPackageStartupMessages(library(AMR))"),
|
||||
" or use ",
|
||||
font_bold("options(AMR_silentstart = TRUE)"), "]"))
|
||||
}
|
||||
|
||||
create_intr_resistance <- function() {
|
||||
# for mo_is_intrinsic_resistant() - saves a lot of time when executed on this vector
|
||||
paste(AMR::microorganisms[match(AMR::intrinsic_resistant$microorganism, AMR::microorganisms$fullname), "mo", drop = TRUE],
|
||||
AMR::antibiotics[match(AMR::intrinsic_resistant$antibiotic, AMR::antibiotics$name), "ab", drop = TRUE])
|
||||
}
|
||||
|
||||
create_species_cons_cops <- function(type = c("CoNS", "CoPS")) {
|
||||
# Determination of which staphylococcal species are CoNS/CoPS according to:
|
||||
# - Becker et al. 2014, PMID 25278577
|
||||
# - Becker et al. 2019, PMID 30872103
|
||||
# - Becker et al. 2020, PMID 32056452
|
||||
# this function returns class <mo>
|
||||
MO_staph <- AMR::microorganisms
|
||||
MO_staph <- MO_staph[which(MO_staph$genus == "Staphylococcus"), , drop = FALSE]
|
||||
if (type == "CoNS") {
|
||||
MO_staph[which(MO_staph$species %in% c("coagulase-negative", "argensis", "arlettae",
|
||||
"auricularis", "caeli", "capitis", "caprae",
|
||||
"carnosus", "chromogenes", "cohnii", "condimenti",
|
||||
"debuckii", "devriesei", "edaphicus", "epidermidis",
|
||||
"equorum", "felis", "fleurettii", "gallinarum",
|
||||
"haemolyticus", "hominis", "jettensis", "kloosii",
|
||||
"lentus", "lugdunensis", "massiliensis", "microti",
|
||||
"muscae", "nepalensis", "pasteuri", "petrasii",
|
||||
"pettenkoferi", "piscifermentans", "pseudoxylosus",
|
||||
"rostri", "saccharolyticus", "saprophyticus",
|
||||
"sciuri", "simulans", "stepanovicii", "succinus",
|
||||
"vitulinus", "warneri", "xylosus")
|
||||
| (MO_staph$species == "schleiferi" & MO_staph$subspecies %in% c("schleiferi", ""))),
|
||||
"mo", drop = TRUE]
|
||||
} else if (type == "CoPS") {
|
||||
MO_staph[which(MO_staph$species %in% c("coagulase-positive",
|
||||
"simiae", "agnetis",
|
||||
"delphini", "lutrae",
|
||||
"hyicus", "intermedius",
|
||||
"pseudintermedius", "pseudointermedius",
|
||||
"schweitzeri", "argenteus")
|
||||
| (MO_staph$species == "schleiferi" & MO_staph$subspecies == "coagulans")),
|
||||
"mo", drop = TRUE]
|
||||
}
|
||||
}
|
||||
|
||||
create_AB_lookup <- function() {
|
||||
AB_lookup <- AMR::antibiotics
|
||||
AB_lookup$generalised_name <- generalise_antibiotic_name(AB_lookup$name)
|
||||
AB_lookup$generalised_synonyms <- lapply(AB_lookup$synonyms, generalise_antibiotic_name)
|
||||
AB_lookup$generalised_abbreviations <- lapply(AB_lookup$abbreviations, generalise_antibiotic_name)
|
||||
AB_lookup$generalised_loinc <- lapply(AB_lookup$loinc, generalise_antibiotic_name)
|
||||
AB_lookup
|
||||
}
|
||||
|
||||
create_MO_lookup <- function() {
|
||||
MO_lookup <- AMR::microorganisms
|
||||
|
||||
MO_lookup$kingdom_index <- NA_real_
|
||||
MO_lookup[which(MO_lookup$kingdom == "Bacteria" | MO_lookup$mo == "UNKNOWN"), "kingdom_index"] <- 1
|
||||
MO_lookup[which(MO_lookup$kingdom == "Fungi"), "kingdom_index"] <- 2
|
||||
MO_lookup[which(MO_lookup$kingdom == "Protozoa"), "kingdom_index"] <- 3
|
||||
MO_lookup[which(MO_lookup$kingdom == "Archaea"), "kingdom_index"] <- 4
|
||||
# all the rest
|
||||
MO_lookup[which(is.na(MO_lookup$kingdom_index)), "kingdom_index"] <- 5
|
||||
|
||||
# use this paste instead of `fullname` to work with Viridans Group Streptococci, etc.
|
||||
MO_lookup$fullname_lower <- tolower(trimws(paste(MO_lookup$genus,
|
||||
MO_lookup$species,
|
||||
MO_lookup$subspecies)))
|
||||
ind <- MO_lookup$genus == "" | grepl("^[(]unknown ", MO_lookup$fullname)
|
||||
MO_lookup[ind, "fullname_lower"] <- tolower(MO_lookup[ind, "fullname"])
|
||||
MO_lookup$fullname_lower <- trimws(gsub("[^.a-z0-9/ \\-]+", "", MO_lookup$fullname_lower, perl = TRUE))
|
||||
|
||||
# add a column with only "e coli" like combinations
|
||||
MO_lookup$g_species <- gsub("^([a-z])[a-z]+ ([a-z]+) ?.*", "\\1 \\2", MO_lookup$fullname_lower, perl = TRUE)
|
||||
|
||||
# so arrange data on prevalence first, then kingdom, then full name
|
||||
MO_lookup[order(MO_lookup$prevalence, MO_lookup$kingdom_index, MO_lookup$fullname_lower), ]
|
||||
}
|
||||
|
||||
create_MO.old_lookup <- function() {
|
||||
MO.old_lookup <- AMR::microorganisms.old
|
||||
MO.old_lookup$fullname_lower <- trimws(gsub("[^.a-z0-9/ \\-]+", "", tolower(trimws(MO.old_lookup$fullname))))
|
||||
|
||||
# add a column with only "e coli"-like combinations
|
||||
MO.old_lookup$g_species <- trimws(gsub("^([a-z])[a-z]+ ([a-z]+) ?.*", "\\1 \\2", MO.old_lookup$fullname_lower))
|
||||
|
||||
# so arrange data on prevalence first, then full name
|
||||
MO.old_lookup[order(MO.old_lookup$prevalence, MO.old_lookup$fullname_lower), ]
|
||||
}
|
||||
@@ -1,52 +1,226 @@
|
||||
% AMR (for R)
|
||||
|
||||
# `AMR` (for R)
|
||||
The `AMR` package for R is a powerful tool for antimicrobial resistance (AMR) analysis. It provides extensive features for handling microbial and antimicrobial data. However, for those who work primarily in Python, we now have a more intuitive option available: the [`AMR` Python package](https://pypi.org/project/AMR/).
|
||||
|
||||
[](https://cran.r-project.org/package=AMR)
|
||||
[](https://cran.r-project.org/package=AMR)
|
||||

|
||||
[](https://www.codefactor.io/repository/github/msberends/amr)
|
||||
[](https://codecov.io/gh/msberends/AMR?branch=master)
|
||||
This Python package is a wrapper around the `AMR` R package. It uses the `rpy2` package internally. Despite the need to have R installed, Python users can now easily work with AMR data directly through Python code.
|
||||
|
||||
<img src="https://msberends.github.io/AMR/works_great_on.png" align="center" height="150px" />
|
||||
# Prerequisites
|
||||
|
||||
The latest built **source package** (`AMR_x.x.x.tar.gz`) can be found in folder [/data-raw/](data-raw).
|
||||
This package was only tested with a [virtual environment (venv)](https://docs.python.org/3/library/venv.html). You can set up such an environment by running:
|
||||
|
||||
`AMR` is a free, open-source and independent R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. Our aim is to provide a standard for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.
|
||||
|
||||
After installing this package, R knows ~70,000 distinct microbial species and all ~550 antibiotic, antimycotic and antiviral drugs by name and code (including ATC, EARS-NET, LOINC and SNOMED CT), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data.
|
||||
```python
|
||||
# linux and macOS:
|
||||
python -m venv /path/to/new/virtual/environment
|
||||
|
||||
This package is fully independent of any other R package and works on Windows, macOS and Linux with all versions of R since R-3.0.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, in collaboration with non-profit organisations Certe Medical Diagnostics and Advice and University Medical Center Groningen. This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation.
|
||||
# Windows:
|
||||
python -m venv C:\path\to\new\virtual\environment
|
||||
```
|
||||
|
||||
This is the development source of the `AMR` package for R. Not a developer? Then please visit our website [https://msberends.github.io/AMR/](https://msberends.github.io/AMR/) to read more about this package.
|
||||
Then you can [activate the environment](https://docs.python.org/3/library/venv.html#how-venvs-work), after which the venv is ready to work with.
|
||||
|
||||
*NOTE: this source code is on GitHub (https://github.com/msberends/AMR), but also automatically mirrored to GitLab (https://gitlab.com/msberends/AMR).*
|
||||
# Install AMR
|
||||
|
||||
### How to get this package
|
||||
Please see [our website](https://msberends.github.io/AMR/#get-this-package).
|
||||
1. Since the Python package is available on the official [Python Package Index](https://pypi.org/project/AMR/), you can just run:
|
||||
|
||||
Bottom line: `install.packages("AMR")`
|
||||
```bash
|
||||
pip install AMR
|
||||
```
|
||||
|
||||
### Copyright
|
||||
2. Make sure you have R installed. There is **no need to install the `AMR` R package**, as it will be installed automatically.
|
||||
|
||||
This R package is licensed under the [GNU General Public License (GPL) v2.0](https://github.com/msberends/AMR/blob/master/LICENSE). In a nutshell, this means that this package:
|
||||
For Linux:
|
||||
|
||||
- May be used for commercial purposes
|
||||
```bash
|
||||
# Ubuntu / Debian
|
||||
sudo apt install r-base
|
||||
# Fedora:
|
||||
sudo dnf install R
|
||||
# CentOS/RHEL
|
||||
sudo yum install R
|
||||
```
|
||||
|
||||
For macOS (using [Homebrew](https://brew.sh)):
|
||||
|
||||
```bash
|
||||
brew install r
|
||||
```
|
||||
|
||||
For Windows, visit the [CRAN download page](https://cran.r-project.org) to download and install R.
|
||||
|
||||
- May be used for private purposes
|
||||
# Examples of Usage
|
||||
|
||||
- May **not** be used for patent purposes
|
||||
## Cleaning Taxonomy
|
||||
|
||||
- May be modified, although:
|
||||
Here’s an example that demonstrates how to clean microorganism and drug names using the `AMR` Python package:
|
||||
|
||||
- Modifications **must** be released under the same license when distributing the package
|
||||
- Changes made to the code **must** be documented
|
||||
```python
|
||||
import pandas as pd
|
||||
import AMR
|
||||
|
||||
- May be distributed, although:
|
||||
# Sample data
|
||||
data = {
|
||||
"MOs": ['E. coli', 'ESCCOL', 'esco', 'Esche coli'],
|
||||
"Drug": ['Cipro', 'CIP', 'J01MA02', 'Ciproxin']
|
||||
}
|
||||
df = pd.DataFrame(data)
|
||||
|
||||
- Source code **must** be made available when the package is distributed
|
||||
- A copy of the license and copyright notice **must** be included with the package.
|
||||
# Use AMR functions to clean microorganism and drug names
|
||||
df['MO_clean'] = AMR.mo_name(df['MOs'])
|
||||
df['Drug_clean'] = AMR.ab_name(df['Drug'])
|
||||
|
||||
- Comes with a LIMITATION of liability
|
||||
# Display the results
|
||||
print(df)
|
||||
```
|
||||
|
||||
- Comes with NO warranty
|
||||
| MOs | Drug | MO_clean | Drug_clean |
|
||||
|-------------|-----------|--------------------|---------------|
|
||||
| E. coli | Cipro | Escherichia coli | Ciprofloxacin |
|
||||
| ESCCOL | CIP | Escherichia coli | Ciprofloxacin |
|
||||
| esco | J01MA02 | Escherichia coli | Ciprofloxacin |
|
||||
| Esche coli | Ciproxin | Escherichia coli | Ciprofloxacin |
|
||||
|
||||
### Explanation
|
||||
|
||||
* **mo_name:** This function standardises microorganism names. Here, different variations of *Escherichia coli* (such as "E. coli", "ESCCOL", "esco", and "Esche coli") are all converted into the correct, standardised form, "Escherichia coli".
|
||||
|
||||
* **ab_name**: Similarly, this function standardises antimicrobial names. The different representations of ciprofloxacin (e.g., "Cipro", "CIP", "J01MA02", and "Ciproxin") are all converted to the standard name, "Ciprofloxacin".
|
||||
|
||||
## Calculating AMR
|
||||
|
||||
```python
|
||||
import AMR
|
||||
import pandas as pd
|
||||
|
||||
df = AMR.example_isolates
|
||||
result = AMR.resistance(df["AMX"])
|
||||
print(result)
|
||||
```
|
||||
|
||||
```
|
||||
[0.59555556]
|
||||
```
|
||||
|
||||
## Generating Antibiograms
|
||||
|
||||
One of the core functions of the `AMR` package is generating an antibiogram, a table that summarises the antimicrobial susceptibility of bacterial isolates. Here’s how you can generate an antibiogram from Python:
|
||||
|
||||
```python
|
||||
result2a = AMR.antibiogram(df[["mo", "AMX", "CIP", "TZP"]])
|
||||
print(result2a)
|
||||
```
|
||||
|
||||
| Pathogen | Amoxicillin | Ciprofloxacin | Piperacillin/tazobactam |
|
||||
|-----------------|-----------------|-----------------|--------------------------|
|
||||
| CoNS | 7% (10/142) | 73% (183/252) | 30% (10/33) |
|
||||
| E. coli | 50% (196/392) | 88% (399/456) | 94% (393/416) |
|
||||
| K. pneumoniae | 0% (0/58) | 96% (53/55) | 89% (47/53) |
|
||||
| P. aeruginosa | 0% (0/30) | 100% (30/30) | None |
|
||||
| P. mirabilis | None | 94% (34/36) | None |
|
||||
| S. aureus | 6% (8/131) | 90% (171/191) | None |
|
||||
| S. epidermidis | 1% (1/91) | 64% (87/136) | None |
|
||||
| S. hominis | None | 80% (56/70) | None |
|
||||
| S. pneumoniae | 100% (112/112) | None | 100% (112/112) |
|
||||
|
||||
|
||||
```python
|
||||
result2b = AMR.antibiogram(df[["mo", "AMX", "CIP", "TZP"]], mo_transform = "gramstain")
|
||||
print(result2b)
|
||||
```
|
||||
|
||||
| Pathogen | Amoxicillin | Ciprofloxacin | Piperacillin/tazobactam |
|
||||
|----------------|-----------------|------------------|--------------------------|
|
||||
| Gram-negative | 36% (226/631) | 91% (621/684) | 88% (565/641) |
|
||||
| Gram-positive | 43% (305/703) | 77% (560/724) | 86% (296/345) |
|
||||
|
||||
|
||||
In this example, we generate an antibiogram by selecting various antibiotics.
|
||||
|
||||
## Taxonomic Data Sets Now in Python!
|
||||
|
||||
As a Python user, you might like that the most important data sets of the `AMR` R package, `microorganisms`, `antimicrobials`, `clinical_breakpoints`, and `example_isolates`, are now available as regular Python data frames:
|
||||
|
||||
```python
|
||||
AMR.microorganisms
|
||||
```
|
||||
|
||||
| mo | fullname | status | kingdom | gbif | gbif_parent | gbif_renamed_to | prevalence |
|
||||
|--------------|------------------------------------|----------|----------|-----------|-------------|-----------------|------------|
|
||||
| B_GRAMN | (unknown Gram-negatives) | unknown | Bacteria | None | None | None | 2.0 |
|
||||
| B_GRAMP | (unknown Gram-positives) | unknown | Bacteria | None | None | None | 2.0 |
|
||||
| B_ANAER-NEG | (unknown anaerobic Gram-negatives) | unknown | Bacteria | None | None | None | 2.0 |
|
||||
| B_ANAER-POS | (unknown anaerobic Gram-positives) | unknown | Bacteria | None | None | None | 2.0 |
|
||||
| B_ANAER | (unknown anaerobic bacteria) | unknown | Bacteria | None | None | None | 2.0 |
|
||||
| ... | ... | ... | ... | ... | ... | ... | ... |
|
||||
| B_ZYMMN_POMC | Zymomonas pomaceae | accepted | Bacteria | 10744418 | 3221412 | None | 2.0 |
|
||||
| B_ZYMPH | Zymophilus | synonym | Bacteria | None | 9475166 | None | 2.0 |
|
||||
| B_ZYMPH_PCVR | Zymophilus paucivorans | synonym | Bacteria | None | None | None | 2.0 |
|
||||
| B_ZYMPH_RFFN | Zymophilus raffinosivorans | synonym | Bacteria | None | None | None | 2.0 |
|
||||
| F_ZYZYG | Zyzygomyces | unknown | Fungi | None | 7581 | None | 2.0 |
|
||||
|
||||
```python
|
||||
AMR.antimicrobials
|
||||
```
|
||||
|
||||
| ab | cid | name | group | oral_ddd | oral_units | iv_ddd | iv_units |
|
||||
|-----|-------------|----------------------|----------------------------|----------|------------|--------|----------|
|
||||
| AMA | 4649.0 | 4-aminosalicylic acid| Antimycobacterials | 12.00 | g | NaN | None |
|
||||
| ACM | 6450012.0 | Acetylmidecamycin | Macrolides/lincosamides | NaN | None | NaN | None |
|
||||
| ASP | 49787020.0 | Acetylspiramycin | Macrolides/lincosamides | NaN | None | NaN | None |
|
||||
| ALS | 8954.0 | Aldesulfone sodium | Other antibacterials | 0.33 | g | NaN | None |
|
||||
| AMK | 37768.0 | Amikacin | Aminoglycosides | NaN | None | 1.0 | g |
|
||||
| ... | ... | ... | ... | ... | ... | ... | ... |
|
||||
| VIR | 11979535.0 | Virginiamycine | Other antibacterials | NaN | None | NaN | None |
|
||||
| VOR | 71616.0 | Voriconazole | Antifungals/antimycotics | 0.40 | g | 0.4 | g |
|
||||
| XBR | 72144.0 | Xibornol | Other antibacterials | NaN | None | NaN | None |
|
||||
| ZID | 77846445.0 | Zidebactam | Other antibacterials | NaN | None | NaN | None |
|
||||
| ZFD | NaN | Zoliflodacin | None | NaN | None | NaN | None |
|
||||
|
||||
|
||||
# Installation Channels
|
||||
|
||||
## Stable Release (CRAN)
|
||||
|
||||
The default `AMR` Python package uses the latest stable version of the `AMR` R package, published on CRAN. After running `pip install AMR`, import it as usual:
|
||||
|
||||
```python
|
||||
import AMR
|
||||
|
||||
AMR.example_isolates
|
||||
```
|
||||
|
||||
## Development Version (GitHub)
|
||||
|
||||
To use the latest development version of the `AMR` R package (sourced directly from GitHub), import the `beta` sub-package and alias it as `AMR`:
|
||||
|
||||
```python
|
||||
import AMR.beta as AMR
|
||||
|
||||
AMR.example_isolates
|
||||
```
|
||||
|
||||
Aliasing with `as AMR` keeps all downstream code identical to the stable import. Switching between the stable release and the development version requires changing only the import line — nothing else in your script needs to change.
|
||||
|
||||
# SIR Classification with `as_sir()`
|
||||
|
||||
## Using `enforce_method`
|
||||
|
||||
The `as_sir()` function in R uses S3 method dispatch to select the correct calculation method based on the input class: `<mic>` for MIC values and `<disk>` for disk diffusion values. Because Python objects do not carry R class attributes through the `rpy2` bridge, this automatic dispatch may not resolve correctly.
|
||||
|
||||
To explicitly specify the input type, use the `enforce_method` argument:
|
||||
|
||||
```python
|
||||
# Treat the column as MIC values — maps to R's as.sir.mic()
|
||||
AMR.as_sir(df["MIC_col"], mo="E. coli", ab="AMX", guideline="EUCAST", enforce_method="mic")
|
||||
|
||||
# Treat the column as disk diffusion values — maps to R's as.sir.disk()
|
||||
AMR.as_sir(df["disk_col"], mo="E. coli", ab="AMX", guideline="EUCAST", enforce_method="disk")
|
||||
```
|
||||
|
||||
Without `enforce_method`, R falls back to class-based dispatch on the raw Python input, which may fail or return unexpected results. Always supply `enforce_method` when calling `as_sir()` from Python.
|
||||
|
||||
# Conclusion
|
||||
|
||||
With the `AMR` Python package, Python users can now effortlessly call R functions from the `AMR` R package. This eliminates the need for complex `rpy2` configurations and provides a clean, easy-to-use interface for antimicrobial resistance analysis. The examples provided above demonstrate how this can be applied to typical workflows, such as standardising microorganism and antimicrobial names or calculating resistance.
|
||||
|
||||
By just running `import AMR`, users can seamlessly integrate the robust features of the R `AMR` package into Python workflows.
|
||||
|
||||
Whether you're cleaning data or analysing resistance patterns, the `AMR` Python package makes it easy to work with AMR data in Python.
|
||||
|
||||
-222
@@ -1,222 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
title: "AMR (for R)"
|
||||
url: "https://msberends.github.io/AMR/"
|
||||
|
||||
development:
|
||||
mode: "release" # improves indexing by search engines
|
||||
version_tooltip: "Latest development version"
|
||||
|
||||
news:
|
||||
one_page: true
|
||||
|
||||
navbar:
|
||||
title: "AMR (for R)"
|
||||
left:
|
||||
- text: "Home"
|
||||
icon: "fa-home"
|
||||
href: "index.html"
|
||||
- text: "How to"
|
||||
icon: "fa-question-circle"
|
||||
menu:
|
||||
- text: "Conduct AMR analysis"
|
||||
icon: "fa-directions"
|
||||
href: "articles/AMR.html"
|
||||
- text: "Predict antimicrobial resistance"
|
||||
icon: "fa-dice"
|
||||
href: "articles/resistance_predict.html"
|
||||
- text: "Data sets for download / own use"
|
||||
icon: "fa-database"
|
||||
href: "articles/datasets.html"
|
||||
- text: "Conduct principal component analysis for AMR"
|
||||
icon: "fa-compress"
|
||||
href: "articles/PCA.html"
|
||||
- text: "Determine multi-drug resistance (MDR)"
|
||||
icon: "fa-skull-crossbones"
|
||||
href: "articles/MDR.html"
|
||||
- text: "Work with WHONET data"
|
||||
icon: "fa-globe-americas"
|
||||
href: "articles/WHONET.html"
|
||||
- text: "Import data from SPSS/SAS/Stata"
|
||||
icon: "fa-file-upload"
|
||||
href: "articles/SPSS.html"
|
||||
- text: "Apply EUCAST rules"
|
||||
icon: "fa-exchange-alt"
|
||||
href: "articles/EUCAST.html"
|
||||
- text: "Get properties of a microorganism"
|
||||
icon: "fa-bug"
|
||||
href: "reference/mo_property.html" # reference instead of an article
|
||||
- text: "Get properties of an antibiotic"
|
||||
icon: "fa-capsules"
|
||||
href: "reference/ab_property.html" # reference instead of an article
|
||||
- text: "Other: benchmarks"
|
||||
icon: "fa-shipping-fast"
|
||||
href: "articles/benchmarks.html"
|
||||
- text: "Manual"
|
||||
icon: "fa-book-open"
|
||||
href: "reference/index.html"
|
||||
- text: "Authors"
|
||||
icon: "fa-users"
|
||||
href: "authors.html"
|
||||
- text: "Changelog"
|
||||
icon: "far fa-newspaper"
|
||||
href: "news/index.html"
|
||||
right:
|
||||
- text: "Source Code"
|
||||
icon: "fab fa-github"
|
||||
href: "https://github.com/msberends/AMR"
|
||||
- text: "Survey"
|
||||
icon: "fa-clipboard-list"
|
||||
href: "survey.html"
|
||||
|
||||
reference:
|
||||
- title: "Background information on included data"
|
||||
desc: >
|
||||
Some pages about our package and its external sources. Be sure to read our [How To's](./../articles/index.html)
|
||||
for more information about how to work with functions in this package.
|
||||
contents:
|
||||
- "`AMR`"
|
||||
- "`example_isolates`"
|
||||
- "`microorganisms`"
|
||||
- "`microorganisms.codes`"
|
||||
- "`microorganisms.old`"
|
||||
- "`antibiotics`"
|
||||
- "`intrinsic_resistant`"
|
||||
- "`dosage`"
|
||||
- "`catalogue_of_life`"
|
||||
- "`catalogue_of_life_version`"
|
||||
- "`WHOCC`"
|
||||
- "`lifecycle`"
|
||||
- "`example_isolates_unclean`"
|
||||
- "`rsi_translation`"
|
||||
- "`WHONET`"
|
||||
|
||||
- title: "Preparing data: microorganisms"
|
||||
desc: >
|
||||
These functions are meant to get taxonomically valid properties of microorganisms from any input.
|
||||
Use `mo_source()` to teach this package how to translate your own codes to valid microorganism codes.
|
||||
contents:
|
||||
- "`as.mo`"
|
||||
- "`mo_property`"
|
||||
- "`mo_source`"
|
||||
|
||||
- title: "Preparing data: antibiotics"
|
||||
desc: >
|
||||
Use these functions to get valid properties of antibiotics from any input or to clean your input.
|
||||
You can even retrieve drug names and doses from clinical text records, using `ab_from_text()`.
|
||||
contents:
|
||||
- "`as.ab`"
|
||||
- "`ab_property`"
|
||||
- "`ab_from_text`"
|
||||
- "`atc_online_property`"
|
||||
|
||||
- title: "Preparing data: antimicrobial resistance"
|
||||
desc: >
|
||||
With `as.mic()` and `as.disk()` you can transform your raw input to valid MIC or disk diffusion values.
|
||||
Use `as.rsi()` for cleaning raw data to let it only contain "R", "I" and "S", or to interpret MIC or disk diffusion values as R/SI based on the lastest EUCAST and CLSI guidelines.
|
||||
Afterwards, you can extend antibiotic interpretations by applying [EUCAST rules](https://www.eucast.org/expert_rules_and_intrinsic_resistance/) with `eucast_rules()`.
|
||||
contents:
|
||||
- "`as.rsi`"
|
||||
- "`as.mic`"
|
||||
- "`as.disk`"
|
||||
- "`eucast_rules`"
|
||||
- "`plot`"
|
||||
- "`isolate_identifier`"
|
||||
|
||||
- title: "Analysing data: antimicrobial resistance"
|
||||
desc: >
|
||||
Use these function for the analysis part. You can use `susceptibility()` or `resistance()` on any antibiotic column.
|
||||
Be sure to first select the isolates that are appropiate for analysis, by using `first_isolate()` or `is_new_episode()`.
|
||||
You can also filter your data on certain resistance in certain antibiotic classes (`filter_ab_class()`), or determine multi-drug resistant microorganisms (MDRO, `mdro()`).
|
||||
contents:
|
||||
- "`proportion`"
|
||||
- "`count`"
|
||||
- "`is_new_episode`"
|
||||
- "`first_isolate`"
|
||||
- "`key_antibiotics`"
|
||||
- "`mdro`"
|
||||
- "`count`"
|
||||
- "`ggplot_rsi`"
|
||||
- "`bug_drug_combinations`"
|
||||
- "`antibiotic_class_selectors`"
|
||||
- "`filter_ab_class`"
|
||||
- "`resistance_predict`"
|
||||
- "`guess_ab_col`"
|
||||
|
||||
- title: "Other: miscellaneous functions"
|
||||
desc: >
|
||||
These functions are mostly for internal use, but some of
|
||||
them may also be suitable for your analysis. Especially the
|
||||
'like' function can be useful: `if (x %like% y) {...}`.
|
||||
contents:
|
||||
- "`age_groups`"
|
||||
- "`age`"
|
||||
- "`availability`"
|
||||
- "`get_locale`"
|
||||
- "`ggplot_pca`"
|
||||
- "`join`"
|
||||
- "`like`"
|
||||
- "`mo_matching_score`"
|
||||
- "`pca`"
|
||||
- "`random`"
|
||||
|
||||
- title: "Other: statistical tests"
|
||||
desc: >
|
||||
Some statistical tests or methods are not part of base R and were added to this package for convenience.
|
||||
contents:
|
||||
- "`g.test`"
|
||||
- "`kurtosis`"
|
||||
- "`skewness`"
|
||||
|
||||
- title: "Other: deprecated functions"
|
||||
desc: >
|
||||
These functions are deprecated, meaning that they will still
|
||||
work but show a warning with every use and will be removed
|
||||
in a future version.
|
||||
contents:
|
||||
- "`AMR-deprecated`"
|
||||
|
||||
authors:
|
||||
Matthijs S. Berends:
|
||||
href: https://www.rug.nl/staff/m.s.berends/
|
||||
Christian F. Luz:
|
||||
href: https://www.rug.nl/staff/c.f.luz/
|
||||
Alexander W. Friedrich:
|
||||
href: https://www.rug.nl/staff/a.w.friedrich/
|
||||
Bhanu N. M. Sinha:
|
||||
href: https://www.rug.nl/staff/b.sinha/
|
||||
Casper J. Albers:
|
||||
href: https://www.rug.nl/staff/c.j.albers/
|
||||
Corinna Glasner:
|
||||
href: https://www.rug.nl/staff/c.glasner/
|
||||
|
||||
template:
|
||||
# this requires the 'preferably' package, https://github.com/amirmasoudabdol/preferably/
|
||||
# package: preferably
|
||||
assets: "pkgdown/logos" # use logos in this folder
|
||||
params:
|
||||
noindex: false
|
||||
bootswatch: "flatly"
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE #
|
||||
# Antimicrobial Resistance (AMR) Analysis for R #
|
||||
# #
|
||||
# SOURCE #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# LICENCE #
|
||||
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
||||
# Developed at the University of Groningen, the Netherlands, in #
|
||||
# collaboration with non-profit organisations Certe Medical #
|
||||
# Diagnostics & Advice, and University Medical Center Groningen. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR analysis: https://msberends.github.io/AMR/ #
|
||||
# ==================================================================== #
|
||||
|
||||
codecov:
|
||||
require_ci_to_pass: no # allow fail
|
||||
branch: master
|
||||
|
||||
comment: no
|
||||
|
||||
coverage:
|
||||
precision: 1
|
||||
round: up
|
||||
range: "0...100"
|
||||
status:
|
||||
project: no
|
||||
patch: no
|
||||
changes: no
|
||||
@@ -1 +0,0 @@
|
||||
* Since version 0.3.0 (2018-08-14), CHECK returns a NOTE for having a data directory over 3 MB. This is needed to offer users reference data for the complete taxonomy of microorganisms - one of the most important features of this package.
|
||||
Binary file not shown.
@@ -1,545 +0,0 @@
|
||||
ID WHON5_CODE WHON4_CODE WHO_CODE DIN_CODE JAC_CODE USER_CODE ANTIBIOTIC GUIDELINES CLSI EUCAST SFM SRGA BSAC DIN NEO AFA ABX_NUMBER POTENCY BETALACTAM CLASS SUBCLASS PROF_CLASS CLSI_ORDER HUMAN VETERINARY ANIMAL_GP WHO_IMPORT LOINCCOMP LOINCGEN LOINCDISK LOINCMIC LOINCETEST LOINCSLOW LOINCAFB LOINCSBT LOINCMLC CLSI19_DR CLSI19_DI CLSI19_DS CLSI19_MS CLSI19_MR CLSI18_DR CLSI18_DI CLSI18_DS CLSI18_MS CLSI18_MR CLSI17_DR CLSI17_DI CLSI17_DS CLSI17_MS CLSI17_MR CLSI16_DR CLSI16_DI CLSI16_DS CLSI16_MS CLSI16_MR CLSI15_DR CLSI15_DI CLSI15_DS CLSI15_MS CLSI15_MR CLSI14_DR CLSI14_DI CLSI14_DS CLSI14_MS CLSI14_MR CLSI13_DR CLSI13_DI CLSI13_DS CLSI13_MS CLSI13_MR CLSI12_DR CLSI12_DI CLSI12_DS CLSI12_MS CLSI12_MR CLSI11_DR CLSI11_DI CLSI11_DS CLSI11_MS CLSI11_MR CLSI10_DR CLSI10_DI CLSI10_DS CLSI10_MS CLSI10_MR EUCST19_DR EUCST19_DI EUCST19_DS EUCST19_MS EUCST19_MR EUCST18_DR EUCST18_DI EUCST18_DS EUCST18_MS EUCST18_MR EUCST17_DR EUCST17_DI EUCST17_DS EUCST17_MS EUCST17_MR EUCST16_DR EUCST16_DI EUCST16_DS EUCST16_MS EUCST16_MR EUCST15_DR EUCST15_DI EUCST15_DS EUCST15_MS EUCST15_MR EUCST14_DR EUCST14_DI EUCST14_DS EUCST14_MS EUCST14_MR EUCST13_DR EUCST13_DI EUCST13_DS EUCST13_MS EUCST13_MR ECV12_DR ECV12_DI ECV12_DS ECV12_MS ECV12_MR EUCST11_DR EUCST11_DI EUCST11_DS EUCST11_MS EUCST11_MR NEODK16_DR NEODK16_DI NEODK16_DS NEODK16_MS NEODK16_MR NEODK13_DR NEODK13_DI NEODK13_DS NEODK13_MS NEODK13_MR NEODK98_DR NEODK98_DI NEODK98_DS NEODK98_MS NEODK98_MR SFM07_DR SFM07_DI SFM07_DS SFM07_MS SFM07_MR DIN04_DR DIN04_DI DIN04_DS DIN04_MS DIN04_MR CRG96_DR CRG96_DI CRG96_DS CRG96_MS CRG96_MR AFA00_DR AFA00_DI AFA00_DS AFA00_MS AFA00_MR MENS00_DR MENS00_DI MENS00_DS MENS00_MS MENS00_MR SRGA98_DR SRGA98_DI SRGA98_DS SRGA98_MS SRGA98_MR BSAC00_DR BSAC00_DI BSAC00_DS BSAC00_MS BSAC00_MR OTHER_DR OTHER_DI OTHER_DS OTHER_MS OTHER_MR
|
||||
5 AMC AUG AMC AMC AMPC-CVA Amoxicillin/Clavulanic acid CLSI,EUCAST X X X X X 2 20/10ug X Beta-lactam+Inhibitors BL+INH 03 X Amoxicilli 18862-3 21-6 20-8 6977-3 25310-4 22-4 19-0 13 14-17 18 8 32 13 14-17 18 8 32 13 14-17 18 8 32 13 14-17 18 8 32 13 14-17 18 8 32 13 14-17 18 8 32 13 14-17 18 8 32 13 14-17 18 8 32 13 14-17 18 8 32 13 14-17 18 8 32 11 12 8 16 13 14-20 21 4 32 20 21-27 28 2 16 2 32 17 - 18 8 16
|
||||
99 APX APX APX ASP ASPC Aspoxicillin 213 X Penicillins Ureidopenicillin PEN 01c
|
||||
6 AMC AU2 AMC AMC AMPC-CVA Amoxicillin/Clavulanic acid BSAC,EUCAST(HAE) X X 306 2/1ug X Beta-lactam+Inhibitors BL+INH 03 X Amoxicilli 18862-3 21-6 20-8 6977-3 25310-4 22-4 19-0 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 4 32 2 16 2 32 8 16
|
||||
7 BDP BDP BDP Brodimoprim 220 Folate pathway inhibitors FOLATE 12a
|
||||
8 BUT BUC BUT Butoconazole 221 Antifungals FUNG 29
|
||||
9 CAP CAP CPR Capreomycin 128 Antimycobacterials MYCO 28 Capreomyci 18872-2 57-0 56-2 23607-5 58-8 55-4
|
||||
11 CRB CAR CB CAR Carbenicillin CLSI,BSAC X X 9 100ug X Penicillins Carboxypenicillin PEN 01d X Carbenicil 18873-0 61-2 60-4 41668-5 62-0 59-6 19 20-22 23 16 64 19 20-22 23 16 64 12 - 13 128 256
|
||||
12 CAR CAM CAR CAM CRMN Carumonam 148 X Monobactams MONO 06
|
||||
13 CAS CAS CAS Caspofungin CLSI,NEO X 441 5ug Antifungals FUNG 29 Caspofungi 32378-2
|
||||
14 CAC FAC CAC CAC Cefacetrile 149 30ug X Cephems Cephalosporin I CEPH1 04a
|
||||
15 CEC CFC CEC CEC CCL Cefaclor CLSI,EUCAST X X X X 10 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefaclor 18874-8 85-1 84-4 6986-4 86-9 83-6 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 2 16 1 8 4 32 13 14-34 35 1 16 34 - 35 1 2
|
||||
17 BEK BEK AKM Bekanamycin 444 Aminoglycosides AG 09
|
||||
91 SAM AS2 SAM AMS ABPC-SBT Ampicillin/Sulbactam DIN X 211 20/10ug X Beta-lactam+Inhibitors BL+INH 03 X Ampicillin 18865-6 33-1 32-3 6980-7 20374-5 23618-2 34-9 31-5 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 4 32 15 16-24 25 2 16
|
||||
92 SAM AS3 SAM AMS ABPC-SBT Ampicillin/Sulbactam NEO X 334 30/30ug X Beta-lactam+Inhibitors BL+INH 03 X Ampicillin 18865-6 33-1 32-3 6980-7 20374-5 23618-2 34-9 31-5 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 4 32 2 16
|
||||
93 AMR AMR Amprolium 405 Coccidiostats COCC 27
|
||||
94 ANI ANI Anidulafungin 477 Antifungals FUNG 29
|
||||
95 APL APA APL APL Apalcillin 144 X Penicillins Ureidopenicillin PEN 01c
|
||||
96 APR AP1 APR Apramycin CLSI X 400 15ug Aminoglycosides AG 09 X Apramycin 23659-6 73653-8 73652-0
|
||||
2 BAC BAC B BTC BC Bacitracin zinc CLSI,SFM X X 8 10units Polypeptides POLYPEP 26 X Bacitracin 18870-6 10868-8 6827-0 6983-1 14 - 15 2 4
|
||||
3 AMX AX3 AMX AMX AMPC Amoxicillin NEO X 330 30ug X Penicillins Aminopenicillin PEN 01b X Amoxicilli 18861-5 17-4 16-6 6976-5 18-2 15-8 14 15-27 28 4 32 2 16 2 32 2 32
|
||||
4 AMX AMX AMX AMX AMPC Amoxicillin 485 2ug X Penicillins Aminopenicillin PEN 01b X Amoxicilli 18861-5 17-4 16-6 6976-5 18-2 15-8 4 32 2 16 2 32 2 32
|
||||
123 CPC CPC CEPM-CVA Cefepime/Clavulanic acid 432 X Beta-lactam+Inhibitors BL+INH 03 Cefepime+C 42353-3 42350-9 42351-7 35763-2
|
||||
34 CCP CEP CFPN Cefcapene 152 5ug X Cephems Cephalosporin III CEPH3 04c
|
||||
36 AMC AU5 AMC AMC AMPC-CVA Amoxicillin/Clavulanic acid 307 25/2ug X Beta-lactam+Inhibitors BL+INH 03 X Amoxicilli 18862-3 21-6 20-8 6977-3 25310-4 22-4 19-0 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 4 32 2 16 2 32 8 16
|
||||
18 BES BES Besifloxacin CLSI X 486 Quinolones Fluoroquinolone FQ 11b X 73606-6 73651-2 73628-0
|
||||
19 BIA BIA BIPM Biapenem CLSI X 218 X Penems Carbapenems CARB 07a Biapenem 41728-7 41666-9 41665-1 41667-7
|
||||
20 BCZ BCZ BCZ Bicyclomycin (Bicozamycin) 219 Rho factor inhibitors RHO 27
|
||||
21 AMX AMX AMX AMX AMPC Amoxicillin CLSI X X 82 30ug X Penicillins Aminopenicillin PEN 01b X Amoxicilli 18861-5 17-4 16-6 6976-5 18-2 15-8 13 14-20 21 4 32 2 16 2 32 2 32
|
||||
150 CTL CTL CTZ Ceftezole 450 X Cephems Cephalosporin I CEPH1 04a
|
||||
22 AMX AX1 AMX AMX AMPC Amoxicillin EUCAST X X 210 10ug X Penicillins Aminopenicillin PEN 01b X Amoxicilli 18861-5 17-4 16-6 6976-5 18-2 15-8 8 16 4 32 15 16-22 23 2 16 2 32 2 32
|
||||
24 CFR DRX CFR CFR CDX Cefadroxil EUCAST X X X X 70 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefadroxil 18875-5 65-3 64-6 66-1 63-8 11 - 12 16 32 11 12-17 18 8 64 13 14-29 30 1 16 24 - 25 1 2
|
||||
25 RID RID CD CLO Cefaloridine 71 30ug X Cephems Cephalosporin I CEPH1 04a Cephalorid 18899-5 158-6 157-8 41684-2 156-0 1 2
|
||||
26 MAN MAN MA CMD CMD Cefamandole CLSI,SFM,DIN,BSAC X X X X 11 30ug X Cephems Cephalosporin II CEPH2 04b X Cefamandol 18876-3 69-5 68-7 41669-3 70-3 67-9 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-21 22 8 64 4 16 4 32 19 - 20 8 16
|
||||
27 MAN MA6 MA CMD CMD Cefamandole NEO X 338 60ug X Cephems Cephalosporin II CEPH2 04b X Cefamandol 18876-3 69-5 68-7 41669-3 70-3 67-9 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 64 4 16 4 32 8 16
|
||||
97 APR APR APR Apramycin NEO X 145 40ug Aminoglycosides AG 09 Apramycin 23659-6
|
||||
30 CNX CNX CNX CFX CMNX Cefminox 229 X Cephems Cephamycin CEPHAM 04e
|
||||
31 CZO CFZ CZ CEZ CEZ Cefazolin CLSI,DIN X X 12 30ug X Cephems Cephalosporin I CEPH1 04a X Cefazolin 18878-9 77-8 76-0 41670-1 78-6 75-2 19 20-22 23 2 8 19 20-22 23 2 8 19 20-22 23 2 8 19 20-22 23 2 8 19 20-22 23 2 8 19 20-22 23 2 8 19 20-22 23 2 8 19 20-22 23 2 8 19 20-22 23 2 8 14 15-17 18 1 4 19 20-21 22 4 16
|
||||
32 CZO CZ6 CZ CEZ Cefazolin NEO X 339 60ug X Cephems Cephalosporin I CEPH1 04a X Cefazolin 18878-9 77-8 76-0 41670-1 78-6 75-2 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 4 16
|
||||
33 CFB CFB CFB CBZ CBPZ Cefbuperazone 223 X Cephems Cephamycin CEPHAM 04e
|
||||
58 CMZ CMZ CMZ CMT CMZ Cefmetazole CLSI X 99 30ug X Cephems Cephamycin CEPHAM 04e X Cefmetazol 18881-3 89-3 88-5 11575-8 90-1 87-7 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64
|
||||
35 CCX CCX CCP Cefcapene pivoxil 445 X Cephems-Oral Cephalosporin CEPH-ORAL 05a
|
||||
1 BAM BAM BAC BAPC Bacampicillin 147 X Penicillins Aminopenicillin PEN 01b Bacampicil 18869-8 49-7 48-9 50-5 47-1
|
||||
37 AMC AU3 AMC AMC AMPC-CVA Amoxicillin/Clavulanic acid NEO X 331 30/15ug X Beta-lactam+Inhibitors BL+INH 03 X Amoxicilli 18862-3 21-6 20-8 6977-3 25310-4 22-4 19-0 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 14 15-27 28 4 32 2 16 2 32 8 16
|
||||
38 AXS AXS AMC AMPC-SBT Amoxicillin/Sulbactam 3 X Beta-lactam+Inhibitors BL+INH 03
|
||||
39 AMB AMB AB APH AMPH-B Amphotericin B CLSI,NEO X X 127 10ug Antifungals FUNG 29 Amphoteric 18863-1 25-7 24-0 6978-1 26-5 23-2 1 2
|
||||
40 AMP AM2 AM AMP ABPC Ampicillin EUCAST X X 309 2ug X Penicillins Aminopenicillin PEN 01b X Ampicillin 18864-9 29-9 28-1 6979-9 30-7 27-3 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 16 4 32 2 16 2 32 2 32 1 16 8 16
|
||||
153 CRO CRO CRO CRO CTRX Ceftriaxone CLSI,EUCAST X X X X X X X 20 30ug X Cephems Cephalosporin III CEPH3 04c X Ceftriaxon 18895-3 142-0 141-2 6998-9 25367-4 143-8 140-4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 12 13-25 26 14 15-20 21 4 64 16 17-20 21 4 32 20 21-27 28 2 16 26 27-29 30 .5 2 27 - 28 1 2
|
||||
41 AMP AM5 AM AMP ABPC Ampicillin BSAC X 308 25ug X Penicillins Aminopenicillin PEN 01b X Ampicillin 18864-9 29-9 28-1 6979-9 30-7 27-3 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 4 32 2 16 2 32 2 32 1 16 8 16
|
||||
42 AMP AM1 AM AMP ABPC Ampicillin NEO X 332 2.5ug X Penicillins Aminopenicillin PEN 01b X Ampicillin 18864-9 29-9 28-1 6979-9 30-7 27-3 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 4 32 2 16 2 32 2 32 1 16 8 16
|
||||
43 AMP AM3 AM AMP ABPC Ampicillin NEO X 333 33ug X Penicillins Aminopenicillin PEN 01b X Ampicillin 18864-9 29-9 28-1 6979-9 30-7 27-3 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 14 15-27 28 4 32 2 16 2 32 2 32 1 16 8 16
|
||||
10 CRB CA5 CB CAR Carbenicillin NEO X 337 115ug X Penicillins Carboxypenicillin PEN 01d X Carbenicil 18873-0 61-2 60-4 41668-5 62-0 59-6 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 9 10-27 28 128 256
|
||||
152 CTB BUT CTB CIB CETB Ceftibuten CLSI,EUCAST X X X 140 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Ceftibuten 35779-8 35777-2 35778-0 6996-3 17 18-20 21 8 32 17 18-20 21 8 32 17 18-20 21 8 32 17 18-20 21 8 32 17 18-20 21 8 32 17 18-20 21 8 32 17 18-20 21 8 32 17 18-20 21 8 32 17 18-20 21 8 32 17 18-20 21 8 32 20 - 21 1 2 2 16 1 8 23 24-26 27 1 8 1 2
|
||||
44 CFM FIX CFM CFI CFIX Cefixime CLSI,EUCAST X X X X 69 5ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefixime 18880-5 81-0 80-2 35766-5 82-8 79-4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 16 - 17 1 2 1 4 1 4 19 - 20 1 2
|
||||
45 CFM FI1 CFM CFI CFIX Cefixime SFM,DIN X X 186 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefixime 18880-5 81-0 80-2 35766-5 82-8 79-4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 21 22-24 25 1 4 21 22-25 26 1 4 1 2
|
||||
46 CFM FI3 CFM CFI CFIX Cefixime NEO X 340 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefixime 18880-5 81-0 80-2 35766-5 82-8 79-4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 2
|
||||
47 CZP CZP CZX-AP Ceftizoxime alapivoxil 447 X Cephems Cephalosporin III CEPH3 04c
|
||||
48 CMX ME0 CMX CMX CMX Cefmenoxime DIN X 228 10ug X Cephems Cephalosporin III CEPH3 04c Cefmenoxim 32375-8 2 16 1 4
|
||||
49 CTE CTE CH CTE Chlortetracycline 91 Tetracyclines TETRA 24 Chlortetra 18904-3 178-4 177-6 179-2 176-8
|
||||
50 CIC CCL CI ACPC Ciclacillin 159 X Penicillins Aminopenicillin PEN 01b Cyclacilli 18913-4 210-5 209-7 211-3 208-9
|
||||
51 CIN CI3 CIN CIN CINX Cinoxacin SRGA,NEO X X 191 30ug Quinolones Quinolone QUIN 11a X Cinoxacin 18905-0 182-6 181-8 183-4 180-0 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 15 16-19 20 8 32
|
||||
52 CIN CIN CIN CIN CINX Cinoxacin CLSI X 25 100ug Quinolones Quinolone QUIN 11a X Cinoxacin 18905-0 182-6 181-8 183-4 180-0 14 15-18 19 16 64 14 15-18 19 16 64 14 15-18 19 16 64 14 15-18 19 16 64 14 15-18 19 16 64 14 15-18 19 16 64 14 15-18 19 16 64 14 15-18 19 16 64 14 15-18 19 16 64 14 15-18 19 16 64 8 32
|
||||
53 CIP CI0 CIP CPFX Ciprofloxacin AFA,SRGA,NEO X X X 192 10ug Quinolones Fluoroquinolone FQ 11b X Ciprofloxa 18906-8 186-7 185-9 7002-9 20377-8 23621-6 187-5 184-2 0.25 1 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 12 13-23 24 1 4 1 4 1 4 18 19-26 27 .25 4 17 18-23 24 .125 2 1 2
|
||||
98 ARB ARB ARB ABK Arbekacin 212 Aminoglycosides AG 09 Arbekacin 32373-3
|
||||
29 CZD CZD CZD CZD Cefazedone 222 X Cephems Cephalosporin I CEPH1 04a
|
||||
54 CIP CI5 CIP CPFX Ciprofloxacin NEO X 346 .5ug Quinolones Fluoroquinolone FQ 11b X Ciprofloxa 18906-8 186-7 185-9 7002-9 20377-8 23621-6 187-5 184-2 0.25 1 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 .25 4 .125 2 1 2
|
||||
55 CIP CI1 CIP CPFX Ciprofloxacin BSAC X 314 1ug Quinolones Fluoroquinolone FQ 11b X Ciprofloxa 18906-8 186-7 185-9 7002-9 20377-8 23621-6 187-5 184-2 0.25 1 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 .25 4 .125 2 17 - 18 1 2
|
||||
56 CIP CIP CIP CPFX Ciprofloxacin CLSI,EUCAST X X X X X 26 5ug Quinolones Fluoroquinolone FQ 11b X Ciprofloxa 18906-8 186-7 185-9 7002-9 20377-8 23621-6 187-5 184-2 21 22-25 26 0.25 1 15 16-20 21 1 4 15 16-20 21 1 4 15 16-20 21 1 4 15 16-20 21 1 4 15 16-20 21 1 4 15 16-20 21 1 4 15 16-20 21 1 4 15 16-20 21 1 4 15 16-20 21 1 4 18 19-21 22 0.5 2 21 22-24 25 .5 2 18 19-22 23 1 4 1 4 .25 4 .125 2 1 2
|
||||
57 CLR CL3 CLR CLR CAM Clarithromycin NEO X 347 30ug Macrolides 14-Membered ring MACRO 17 X Clarithrom 18907-6 190-9 189-1 7003-7 20375-2 23619-0 191-7 188-3 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 12 13-21 22 2 8 .5 4 1 4 .5 1 .5 1
|
||||
28 CTZ FAT CTZ CRI CFT Cefatrizine SFM X 151 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a Cefatrizin 18877-1 73-7 72-9 74-5 71-1 14 15-21 22 2 16
|
||||
59 CLR CLA CLR CLR CAM Clarithromycin CLSI,EUCAST X X X X X 103 15ug Macrolides 14-Membered ring MACRO 17a X Clarithrom 18907-6 190-9 189-1 7003-7 20375-2 23619-0 191-7 188-3 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 16 17-20 21 2 8 .5 4 16 17-20 21 1 4 19 20-24 25 .5 1 .5 1
|
||||
60 CLR CR2 CLR CLR CAM Clarithromycin X 410 2ug Macrolides 14-Membered ring MACRO 17 X Clarithrom 18907-6 190-9 189-1 7003-7 20375-2 23619-0 191-7 188-3 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 .5 4 1 4 .5 1 19 - 20 .5 1
|
||||
61 CED RAD CED CED CED Cephradine NEO X 74 60ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a Cephradine 18902-7 170-1 169-3 171-9 168-5 8 64 4 32 2 4
|
||||
62 CED RA3 CED CED CED Cephradine SFM,BSAC X X 408 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a Cephradine 18902-7 170-1 169-3 171-9 168-5 11 12-17 18 8 64 4 32 11 - 12 2 4
|
||||
151 CTB BU1 CTB CIB CETB Ceftibuten SFM,DIN,BSAC X X X 189 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Ceftibuten 35779-8 35777-2 35778-0 6996-3 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 15 16-19 20 2 16 1 8 1 8 27 - 28 1 2
|
||||
64 DIZ DIZ CDZ CFO CDZM Cefodizime DIN X 100 10ug X Cephems Cephalosporin III CEPH3 04c Cefodizime 18882-1 93-5 92-7 6988-0 94-3 91-9 15 16-17 18 4 16
|
||||
65 CHL CH6 C CMP CP Chloramphenicol NEO X 345 60ug Phenicols PHEN 22 X Chloramphe 18903-5 174-3 173-5 7001-1 175-0 172-7 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 14 15-27 28 8 32 8 16 4 16 2 8 8 16 8 16
|
||||
66 CMX MEN CMX CMX CMX Cefmenoxime SFM 85 30ug X Cephems Cephalosporin III CEPH3 04c Cefmenoxim 32375-8 2 16 1 4
|
||||
67 CHL CHL C CMP CP Chloramphenicol CLSI,EUCAST X X X X X X X 24 30ug Phenicols PHEN 22 X Chloramphe 18903-5 174-3 173-5 7001-1 175-0 172-7 12 13-17 18 8 32 12 13-17 18 8 32 12 13-17 18 8 32 12 13-17 18 8 32 12 13-17 18 8 32 12 13-17 18 8 32 12 13-17 18 8 32 12 13-17 18 8 32 12 13-17 18 8 32 12 13-17 18 8 32 16 - 17 8 16 18 19-22 23 8 32 20 - 21 8 16 4 16 24 25-31 32 2 8 17 18-20 21 8 16 20 - 21 8 16
|
||||
103 AVO AVO AVO Avoparcin 215 Glycopeptides Glycopeptide GLYCO 21a
|
||||
73 FOX FOX FOX COX CFX Cefoxitin CLSI,EUCAST X X X X X X 17 30ug X Cephems Cephamycin CEPHAM 04e X Cefoxitin 18888-8 117-2 116-4 6991-4 25366-6 118-0 115-6 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-21 22 8 64 20 21-25 26 4 16 4 32 17 18-27 28 2 16 15 16-19 20 4 16 19 - 20 4 8
|
||||
74 CPD PO1 CPD CPO CPDX Cefpodoxime 407 1ug X Cephems Cephalosporin III CEPH3 04c X Cefpodoxim 18890-4 121-4 120-6 6993-0 122-2 119-8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 1 4 1 4 1 2
|
||||
100 AST AST AST AST ASTM Astromicin 146 Aminoglycosides AG 09
|
||||
75 CPD PO5 CPD CPO CPDX Cefpodoxime BSAC X 311 5ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefpodoxim 18890-4 121-4 120-6 6993-0 122-2 119-8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 1 4 1 4 33 - 34 1 2
|
||||
76 CLI CL1 CM CLI CLDM Clindamycin AFA,SRGA X X 193 15ug Lincosamides LINCO 15 X Clindamyci 18908-4 194-1 193-3 7005-2 195-8 192-5 .5 4 .5 4 .5 4 .5 4 .5 4 .5 4 .5 4 .5 4 .5 4 .5 4 2 4 1 8 1 8 17 18-23 24 1 4 19 20-27 28 .5 4 .5 1
|
||||
77 CLI CL2 CM CLI CLDM Clindamycin NEO X 348 25ug Lincosamides LINCO 15 X Clindamyci 18908-4 194-1 193-3 7005-2 195-8 192-5 .5 4 .5 4 .5 4 .5 4 .5 4 .5 4 .5 4 .5 4 .5 4 .5 4 14 15-27 28 2 4 1 8 1 8 1 4 .5 4 .5 1
|
||||
78 CLF CLF Clofazimine 482 Antimycobacterials MYCO 28
|
||||
79 CTR CLO CTR CTR Clotrimazole NEO X 158 10ug Antifungals FUNG 29 Clotrimazo 18909-2 10653-4 10654-2
|
||||
80 CLR CL5 CLR CLR CAM Clarithromycin X 409 5ug Macrolides 14-Membered ring MACRO 17 X Clarithrom 18907-6 190-9 189-1 7003-7 20375-2 23619-0 191-7 188-3 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 .5 4 1 4 .5 1 .5 1
|
||||
81 CLA CLV CLA CLA CVA Clavulanic acid CLSI X 246 X Beta-lactamase inhibitors BL-INH 02 Clavulanat 41733-7 41686-7 41687-5 41685-9
|
||||
82 CLX CLN CLN Clinafloxacin CLSI X 157 5ug Quinolones Fluoroquinolone FQ 11b X Clinafloxa 32376-6 35785-5 35786-3 7004-5
|
||||
68 CHL CH1 C CMP CP Chloramphenicol BSAC,NEO X X 313 10ug Phenicols PHEN 22 X Chloramphe 18903-5 174-3 173-5 7001-1 175-0 172-7 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 16 4 16 2 8 8 16 8 16
|
||||
69 CTT CTN CTT CTT CTT Cefotetan CLSI,SFM,BSAC X X X 16 30ug X Cephems Cephamycin CEPHAM 04e X Cefotetan 18887-0 113-1 112-3 6990-6 114-9 111-5 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-15 16 16 64 12 13-23 24 16 17-22 23 4 64 4 32 4 32 23 - 24 4 8
|
||||
70 CTF FOT CTF CTM CTM Cefotiam SFM,DIN X X 86 30ug X Cephems Cephamycin CEPHAM 04e Cefotiam 32374-1 35772-3 35773-1 14 15-21 22 4 64 16 17-19 20 4 16
|
||||
71 CHE CHE CTH CTM-HE Cefotiam hexetil SFM X 235 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a 18 19-21 22 1 4
|
||||
72 CHE CHE CTH CTM-HE Cefotiam hexetil DIN X 435 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a 20 21-25 26 1 8
|
||||
83 CLI CLI CM CLI CLDM Clindamycin CLSI,EUCAST X X X X 27 2ug Lincosamides LINCO 15 X Clindamyci 18908-4 194-1 193-3 7005-2 195-8 192-5 14 15-20 21 .5 4 14 15-20 21 .5 4 14 15-20 21 .5 4 14 15-20 21 .5 4 14 15-20 21 .5 4 14 15-20 21 .5 4 14 15-20 21 .5 4 14 15-20 21 .5 4 14 15-20 21 .5 4 14 15-20 21 .5 4 14 - 15 2 4 1 8 1 8 1 4 .5 4 25 - 26 .5 1
|
||||
84 FCT 5C1 FCT 5FC 5-FC 5-Fluorocytosine CLSI,NEO X X 328 10ug Antifungals FUNG 29 X 5-Fluorocy 18855-7 254-3 253-5 7014-4 255-0 252-7 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 8 16
|
||||
85 FCT 5FC FCT 5-FC 5-Fluorocytosine CLSI,NEO X X 126 1ug Antifungals FUNG 29 X 5-Fluorocy 18855-7 254-3 253-5 7014-4 255-0 252-7 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 8 16
|
||||
86 ACM ACM Acetylmidecamycin 114 Macrolides MACRO 17
|
||||
87 ASP ASP Acetylspiramycin 113 Macrolides MACRO 17
|
||||
63 CTO CTO CTO Cetocycline 245 Tetracyclines TETRA 24
|
||||
108 ATM ATM ATM AZT AZT Aztreonam CLSI,EUCAST X X X X X X 7 30ug X Monobactams MONO 06 X Aztreonam 18868-0 45-5 44-8 6982-3 46-3 43-0 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 20 - 25 1 16 16 17-22 23 4 64 2 32 4 16 14 15-25 26 2 32 24 25-27 28 0.5 2 23 - 24 8 16
|
||||
109 ATM AT1 ATM AZT AZT Aztreonam DIN X 217 10ug X Monobactams MONO 06 X Aztreonam 18868-0 45-5 44-8 6982-3 46-3 43-0 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 64 2 32 4 16 2 32 0.5 2 8 16
|
||||
110 CID CID CID CNI Cefonicid CLSI X 13 30ug X Cephems Cephalosporin II CEPH2 04b X Cefonicid 18883-9 97-6 96-8 98-4 95-0 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32
|
||||
111 CFP CFP CFP CPZ CPZ Cefoperazone CLSI X 14 75ug X Cephems Cephalosporin II CEPH2 04b X Cefoperazo 18884-7 101-6 100-8 35767-3 102-4 99-2 15 16-20 21 16 64 15 16-20 21 16 64 15 16-20 21 16 64 15 16-20 21 16 64 15 16-20 21 16 64 15 16-20 21 16 64 15 16-20 21 16 64 15 16-20 21 16 64 15 16-20 21 16 64 15 16-20 21 16 64 4 64 4 32 4 8
|
||||
112 CFP CP1 CFP CPZ CPZ Cefoperazone DIN X 230 10ug X Cephems Cephalosporin II CEPH2 04b X Cefoperazo 18884-7 101-6 100-8 35767-3 102-4 99-2 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 4 64 14 15-20 21 4 32 4 8
|
||||
113 CFP CF3 CFP CPZ CPZ Cefoperazone SFM,BSAC X X 187 30ug X Cephems Cephalosporin II CEPH2 04b X Cefoperazo 18884-7 101-6 100-8 35767-3 102-4 99-2 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 13 14-20 21 4 64 4 32 24 - 25 4 8
|
||||
114 CFP CF6 CFP CPZ CPZ Cefoperazone NEO X 341 60ug X Cephems Cephalosporin II CEPH2 04b X Cefoperazo 18884-7 101-6 100-8 35767-3 102-4 99-2 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 4 64 4 32 4 8
|
||||
115 CSL CFS CPS CPZ-SBT Cefoperazone/Sulbactam DIN X 101 30/15ug X Beta-lactam+Inhibitors BL+INH 03 35768-1 15 16-21 22
|
||||
116 CND CND CND Ceforanide NEO X 231 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a Ceforanide 18885-4 105-7 104-0 106-5 103-2
|
||||
117 CSE CSE Cefoselis 448 X Cephems Cephalosporin IV CEPH4 04d
|
||||
88 AMK AMK AN AMK AMK Amikacin CLSI,EUCAST X X X X X X 1 30ug Aminoglycosides AG 09 X Amikacin 18860-7 13-3 12-5 6975-7 20373-7 23624-0 14-1 11-7 14 15-16 17 16 64 14 15-16 17 16 64 14 15-16 17 16 64 14 15-16 17 16 64 14 15-16 17 16 64 14 15-16 17 16 64 14 15-16 17 16 64 14 15-16 17 16 64 14 15-16 17 16 64 14 15-16 17 16 64 12 13-15 16 8 32 14 15-16 17 8 32 13 14-19 20 4 32 4 32 15 16-18 19 4 8 19 - 20 4 8
|
||||
89 AMP AMP AM AMP ABPC Ampicillin CLSI,EUCAST(EBC) X X X X X X X 4 10ug X Penicillins Aminopenicillin PEN 01b X Ampicillin 18864-9 29-9 28-1 6979-9 30-7 27-3 13 14-16 17 8 32 13 14-16 17 8 32 13 14-16 17 8 32 13 14-16 17 8 32 13 14-16 17 8 32 13 14-16 17 8 32 13 14-16 17 8 32 13 14-16 17 8 32 13 14-16 17 8 32 13 14-16 17 8 32 11 12 8 16 13 14-18 19 4 32 14 15-21 22 2 16 2 32 8 9-21 22 2 32 11 12-29 30 1 16 17 - 18 8 16
|
||||
90 SAM AMS SAM AMS ABPC-SBT Ampicillin/Sulbactam CLSI,EUCAST X X X 5 10/10ug X Beta-lactam+Inhibitors BL+INH 03 X Ampicillin 18865-6 33-1 32-3 6980-7 20374-5 23618-2 34-9 31-5 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 8 16 13 14-18 19 4 32 2 16
|
||||
101 AVB AVB Avibactam CLSI X 496 X Beta-lactamase inhibitors BL-INH
|
||||
102 AVI AVI AVI AVM Avilamycin 214 Everninomycins EVER 27 Avilamycin 35756-6 35754-1 35755-8
|
||||
104 AZM AZI AZM AZM Azithromycin CLSI,EUCAST X X X X X X X 83 15ug Macrolides 15-Membered ring MACRO 17a X Azithromyc 18866-4 37-2 36-4 6981-5 23612-5 38-0 35-6 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 13 14-17 18 2 8 16 17-21 22 .5 8 17 18-20 21 2 8 19 20-23 24 1 4 19 20-22 23 .5 1 19 - 20 1 2
|
||||
105 AZM AI3 AZM AZM Azithromycin NEO X 335 30ug Macrolides 15-Membered ring MACRO 17 X Azithromyc 18866-4 37-2 36-4 6981-5 23612-5 38-0 35-6 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 12 13-21 22 .5 8 2 8 1 4 .5 1 1 2
|
||||
106 AZL AZL AZL AZL Azlocillin CLSI,SFM X X 6 75ug X Penicillins Ureidopenicillin PEN 01c X Azlocillin 18867-2 41-4 40-6 41661-0 42-2 39-8 17 - 18 64 128 17 - 18 64 128 17 - 18 64 128 17 - 18 64 128 17 - 18 64 128 17 - 18 64 128 17 - 18 64 128 17 - 18 64 128 17 - 18 64 128 17 - 18 64 128 12 13-18 19 16 128 2 32
|
||||
107 AZL AZ3 AZL AZL Azlocillin AFA,DIN,NEO X X X 216 30ug X Penicillins Ureidopenicillin PEN 01c X Azlocillin 18867-2 41-4 40-6 41661-0 42-2 39-8 64 128 64 128 64 128 64 128 64 128 64 128 64 128 64 128 64 128 64 128 14 15-27 28 16 128 12 13-21 22 15 16-27 28 2 32
|
||||
118 CDR DIN CDR CFD CFDN Cefdinir CLSI X 96 5ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefdinir 23636-4 35758-2 23637-2 35757-4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4
|
||||
119 DIT DIT CDT CDTR Cefditoren CLSI X 153 5ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefditoren 35762-4 35759-0 35761-6 35760-8
|
||||
120 DIX DIX CDTR-PI Cefditoren pivoxil 446 X Cephems-Oral Cephalosporin CEPH-ORAL 05a
|
||||
121 FEP FEP FEP CEP CEPM Cefepime CLSI,EUCAST X X X X X 97 30ug X Cephems Cephalosporin IV CEPH4 04d X Cefepime 18879-7 8272-7 6644-9 6987-2 8273-5 6643-1 18 19-24 25 2 16 18 19-24 25 2 16 18 19-24 25 2 16 18 19-24 25 2 16 18 19-24 25 2 16 18 19-24 25 2 16 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 17 18-23 24 1 16 14 15-27 28 14 15-20 21 4 64 4 32 23 24-26 27 .5 2 31 - 32 2 4
|
||||
122 FEP FE1 FEP CEP CEPM Cefepime DIN X 224 10ug X Cephems Cephalosporin IV CEPH4 04d X Cefepime 18879-7 8272-7 6644-9 6987-2 8273-5 6643-1 2 16 2 16 2 16 2 16 2 16 2 16 8 32 8 32 8 32 8 32 4 64 12 13-18 19 4 32 .5 2 2 4
|
||||
124 CTX FTX CTX CTX CTX Cefotaxime CLSI,SFM,SRGA,BSAC X X X X X 15 30ug X Cephems Cephalosporin III CEPH3 04c X Cefotaxime 18886-2 109-9 108-1 6989-8 110-7 107-3 22 23-25 26 1 4 22 23-25 26 1 4 22 23-25 26 1 4 22 23-25 26 1 4 22 23-25 26 1 4 22 23-25 26 1 4 22 23-25 26 1 4 22 23-25 26 1 4 22 23-25 26 1 4 22 23-25 26 1 4 14 15-27 28 14 15-20 21 4 64 2 16 4 32 20 21-26 27 2 16 23 24-26 27 .5 2 29 - 30 1 2
|
||||
125 CTX FT5 CTX CTX CTX Cefotaxime EUCAST X X 406 5ug X Cephems Cephalosporin III CEPH3 04c X Cefotaxime 18886-2 109-9 108-1 6989-8 110-7 107-3 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 17 18-20 21 1 4 4 64 2 16 4 32 2 16 .5 2 1 2
|
||||
126 CTX FT1 CTX CTX CTX Cefotaxime DIN X 232 10ug X Cephems Cephalosporin III CEPH3 04c X Cefotaxime 18886-2 109-9 108-1 6989-8 110-7 107-3 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 4 64 13 14-20 21 2 16 4 32 2 16 .5 2 1 2
|
||||
127 CTC CTC CTX-CVA Cefotaxime/Clavulanic acid CLSI X 394 30/10ug X Beta-lactam+Inhibitors BL+INH 03 X Cefotaxime 35771-5 35769-9 35770-7 41671-9
|
||||
128 CTS CTS CTS CTX-SBT Cefotaxime/Sulbactam DIN X 233 10/15ug X Beta-lactam+Inhibitors BL+INH 03 2 16
|
||||
129 CTT CT1 CTT CTT CTT Cefotetan DIN X 234 10ug X Cephems Cephamycin CEPHAM 04e X Cefotetan 18887-0 113-1 112-3 6990-6 114-9 111-5 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 4 64 4 32 4 32 4 8
|
||||
130 CAT FET CAT CFT CEMT Cefetamet CLSI X 98 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefetamet 32377-4 35764-0 35765-7 14 15-17 18 4 16 14 15-17 18 4 16 14 15-17 18 4 16 14 15-17 18 4 16 14 15-17 18 4 16 14 15-17 18 4 16 14 15-17 18 4 16 14 15-17 18 4 16 14 15-17 18 4 16 14 15-17 18 4 16
|
||||
131 CPI CPI CFP CEMT-PI Cefetamet pivoxil DIN X 225 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a 19 20-25 26 1 8
|
||||
132 CCL CET CCL Cefetecol (Cefcatacol) 226 X Cephems Cephalosporin IV CEPH4 04d
|
||||
133 CZL CZL CZL Cefetrizole 227 X Cephems Cephalosporin-new CEPH? 04e
|
||||
134 CFS SLD CFS CFS CFS Cefsulodin SFM,DIN X X 73 30ug X Cephems Cephalosporin III CEPH3 04c Cefsulodin 18892-0 129-7 128-9 130-5 127-1 14 15-27 28 13 14-21 22 8 64 18 19-28 29 4 32
|
||||
135 CSU CSU CSU CSM Cefsumide 240 X Cephems Cephalosporin-new CEPH? 04e
|
||||
136 CPT CPT Ceftaroline CLSI X 475 30ug X Cephems Cephalosporin CEPH 04b X 73605-8 73650-4 73627-2 19 20-22 23 .5 2 19 20-22 23 .5 2 19 20-22 23 .5 2 19 20-22 23 .5 2 19 20-22 23 .5 2 19 20-22 23 .5 2 19 20-22 23 .5 2
|
||||
137 CPT CPT Ceftaroline EUCAST X 507 5ug Cephems Cephalosporin CEPH 04b 73605-8 73650-4 73627-2
|
||||
138 CPA CPA Ceftaroline/Avibactam CLSI X 497 30/15ug X Beta-lactam+Inhibitors BL+INH 03 X 73604-1 73649-6 73626-4
|
||||
16 BAC BA4 B BTC BC Bacitracin zinc NEO X 336 40units Polypeptides POLYPEP 26 X Bacitracin 18870-6 10868-8 6827-0 6983-1 12 13-21 22 2 4
|
||||
144 CZX ZOX CZX CZX CZX Ceftizoxime CLSI,SFM,BSAC X X X 19 30ug X Cephems Cephalosporin III CEPH3 04c X Ceftizoxim 18894-6 138-8 137-0 6997-1 20378-6 23622-4 139-6 136-2 21 22-24 25 1 4 21 22-24 25 1 4 21 22-24 25 1 4 21 22-24 25 1 4 21 22-24 25 1 4 21 22-24 25 1 4 21 22-24 25 1 4 21 22-24 25 1 4 21 22-24 25 1 4 21 22-24 25 1 4 14 15-20 21 4 64 2 16 29 - 30 1 2
|
||||
139 CAZ CAZ CAZ CAZ CAZ Ceftazidime CLSI,SFM,SRGA,BSAC X X X X X 18 30ug X Cephems Cephalosporin III CEPH3 04c X Ceftazidim 18893-8 134-7 133-9 6995-5 135-4 132-1 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 17 18-20 21 4 16 14 15-27 28 14 15-20 21 4 64 4 32 4 32 19 20-25 26 2 16 23 24-26 27 2 8 27 - 28 2 4
|
||||
140 CAZ CA1 CAZ CAZ CAZ Ceftazidime EUCAST X X 241 10ug X Cephems Cephalosporin III CEPH3 04c X Ceftazidim 18893-8 134-7 133-9 6995-5 135-4 132-1 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 14 15-29 20 1 16 4 64 10 11-15 16 4 32 4 32 2 16 2 8 2 4
|
||||
141 CZA CZA Ceftazidime/Avibactam CLSI X 498 30/20ug X Beta-lactam+Inhibitors BL+INH 03 X 73603-3 73648-8 73625-6 20 21 8 16 20 21 8 16
|
||||
142 TIO TIO CFL Ceftiofur CLSI X 154 30ug X Cephems Cephalosporin III CEPH3 04c X Ceftiofur 23709-9 35780-6 35781-4 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8
|
||||
143 CZX ZO5 CZX CZX CZX Ceftizoxime DIN X 244 5ug X Cephems Cephalosporin III CEPH3 04c X Ceftizoxim 18894-6 138-8 137-0 6997-1 20378-6 23622-4 139-6 136-2 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 4 64 11 12-16 17 2 16 1 2
|
||||
145 BPR BPR Ceftobiprole CLSI X 474 30ug X Cephems Cephalosporin CEPH 04e X Ceftobipro 43272-4 43269-0 43271-6 43270-8
|
||||
146 CZT CZT Ceftolozane/Tazobactam CLSI,EUCAST X X 506 30/10ug X Beta-lactam+Inhibitors BL+INH X 73602-5 73647-0 73624-9 17 18-20 21 2 8 17 18-20 21 2 8 2 8 2 8
|
||||
147 CCV CCV CAZ-CVA Ceftazidime/Clavulanic acid CLSI X 242 30/4ug X Beta-lactam+Inhibitors BL+INH 03 X Ceftazidim 35776-4 35774-9 35775-6 42352-5
|
||||
148 CEM CEM CEM CFM Cefteram 243 X Cephems Cephalosporin II CEPH2 04b
|
||||
149 CPL CPL CFTM-PI Cefteram pivoxil 449 X Cephems-Oral Cephalosporin CEPH-ORAL 05a
|
||||
23 CEC CF1 CEC CEC CCL Cefaclor SFM X 185 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefaclor 18874-8 85-1 84-4 6986-4 86-9 83-6 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 15 16-21 22 2 16 1 8 4 32 1 16 1 2
|
||||
154 CXM FR5 CXM CXM CXM Cefuroxime BSAC X 312 5ug X Cephems Cephalosporin II CEPH2 04b X Cefuroxime 18896-1 146-1 145-3 6999-7 147-9 144-6 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 64 4 16 4 32 2 16 8 16 1 32
|
||||
155 AMK AK4 AN AMK AMK Amikacin NEO X 329 40ug Aminoglycosides AG 09 X Amikacin 18860-7 13-3 12-5 6975-7 20373-7 23624-0 14-1 11-7 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 14 15-25 26 8 32 4 32 4 32 4 8 4 8
|
||||
156 CXM FRX CXM CXM CXM Cefuroxime CLSI,EUCAST X X X X X X X 21 30ug X Cephems Cephalosporin II CEPH2 04b X Cefuroxime 18896-1 146-1 145-3 6999-7 147-9 144-6 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 17 - 18 8 16 14 15-21 22 8 64 4 16 4 32 19 20-28 29 2 16 15 16-18 19 8 16 17 18-24 25 1 32
|
||||
157 CXM FR6 CXM CXM CXM Cefuroxime NEO X 343 60ug X Cephems Cephalosporin II CEPH2 04b X Cefuroxime 18896-1 146-1 145-3 6999-7 147-9 144-6 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 14 15-27 28 8 64 4 16 4 32 2 16 8 16 1 32
|
||||
158 CXA FRA CFA CXM-AX Cefuroxime axetil CLSI,EUCAST X X X X 22 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefuroxime 35783-0 35782-2 20460-2 14 15-22 23 4 32 14 15-22 23 4 32 14 15-22 23 4 32 14 15-22 23 4 32 14 15-22 23 4 32 14 15-22 23 4 32 14 15-22 23 4 32 14 15-22 23 4 32 14 15-22 23 4 32 14 15-22 23 4 32 17 - 18 8 16 1 8 1 8 1 32 24 25-28 29 1 4 24 - 25 1 2
|
||||
159 CXA FR1 CFA CXM-AX Cefuroxime axetil SFM X 190 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefuroxime 35783-0 35782-2 20460-2 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 19 20-25 26 1 8 1 8 1 32 1 4 1 2
|
||||
160 ZON ZON CFZ Cefuzonam 155 X Cephems Cephamycin CEPHAM 04e
|
||||
161 LEX LEX CN CEX CEX Cephalexin EUCAST X X X X 121 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cephalexin 18897-9 150-3 149-5 35784-8 151-1 148-7 16 32 11 12-17 18 8 64 20 21-31 32 13 14-26 27 1 16 24 - 25 2 4
|
||||
162 CEP KE6 CF CTN CET Cephalothin NEO X 344 66ug X Cephems Cephalosporin I CEPH1 04a X Cephalothi 18900-1 162-8 161-0 7000-3 163-6 160-2 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 14 15-27 28 8 64 4 32 2 16 1 16 1 2
|
||||
163 CEP KEF CF CTN CET Cephalothin CLSI,EUCAST X X X X X 23 30ug X Cephems Cephalosporin I CEPH1 04a X Cephalothi 18900-1 162-8 161-0 7000-3 163-6 160-2 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 11 12-17 18 8 64 4 32 17 18-26 27 2 16 13 14-26 27 1 16 26 - 27 1 2
|
||||
164 HAP FAP CP CAP Cephapirin SFM 150 30ug X Cephems Cephalosporin I CEPH1 04a Cephapirin 18901-9 166-9 165-1 167-7 164-4
|
||||
165 GEH GE2 Gentamicin-High BSAC X 318 200ug Aminoglycosides AG 09 X Gentamicin 18929-0 7017-7 7018-5 35817-6 500 501 500 501 500 501 500 501 500 501 500 501 500 501 500 501 500 501 500 501 250 501 500 1000
|
||||
166 GEH GEH Gentamicin-High CLSI X 137 120ug Aminoglycosides AG 09 X Gentamicin 18929-0 7017-7 7018-5 35817-6 6 7-9 10 512 513 6 7-9 10 512 513 6 7-9 10 512 513 6 7-9 10 512 513 6 7-9 10 512 513 6 7-9 10 512 513 6 7-9 10 512 513 6 7-9 10 512 513 6 7-9 10 512 513 6 7-9 10 512 513 250 501 500 1000
|
||||
167 GEH G30 Gentamicin-High EUCAST X 488 30ug Aminoglycosides AG 09 X Gentamicin 18929-0 7017-7 7018-5 35817-6 512 513 512 513 512 513 512 513 512 513 512 513 512 513 512 513 512 513 512 513 250 501 500 1000
|
||||
168 GRX GRE GRE GPFX Grepafloxacin CLSI X 141 5ug Quinolones Fluoroquinolone FQ 11b X Grepafloxa 23638-0 35818-4 23639-8 21316-5 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4
|
||||
169 GRI GRI GRI GRF Griseofulvin NEO X 257 25ug Antifungals FUNG 29
|
||||
170 HAB HAB HAB Habekacin 258 Aminoglycosides AG 09
|
||||
171 CLO CLX CX MCIPC Cloxacillin 122 5ug X Penicillins Penicillin (Stable) PEN-S 01e Cloxacilli 18910-0 198-2 197-4 199-0 196-6 4 8
|
||||
172 FOX FO6 FOX COX CFX Cefoxitin NEO X 342 60ug X Cephems Cephamycin CEPHAM 04e X Cefoxitin 18888-8 117-2 116-4 6991-4 25366-6 118-0 115-6 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 14 15-27 28 8 64 4 16 4 32 2 16 4 16 4 8
|
||||
173 FOX FOX FOX COX CFX Cefoxitin 439 10ug X Cephems Cephamycin CEPHAM 04e X Cefoxitin 18888-8 117-2 116-4 6991-4 25366-6 118-0 115-6 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32
|
||||
174 ZOP ZOP COP CZOP Cefozopran 156 X Cephems-Oral Cephalosporin CEPH-ORAL 05a
|
||||
175 CFZ MIZ CFZ CMZ Cefpimizole 236 X Cephems Cephalosporin III CEPH3 04c
|
||||
176 CPM CPM CPM CPM Cefpiramide 237 X Cephems Cephalosporin III CEPH3 04c
|
||||
177 CPO PIR CPO CPI CPR Cefpirome SFM,SRGA,NEO,SFM X X X 72 30ug X Cephems Cephalosporin III CEPH3 04c Cefpirome 18889-6 8276-8 8275-0 6992-2 6650-6 8274-3 14 15-27 28 14 15-20 21 4 64 2 16 23 24-26 27 .5 2 1 2
|
||||
178 CPO PI2 CPO CPI CPR Cefpirome BSAC X 310 20ug X Cephems Cephalosporin III CEPH3 04c Cefpirome 18889-6 8276-8 8275-0 6992-2 6650-6 8274-3 4 64 2 16 .5 2 24 - 25 1 2
|
||||
179 COL CO1 CS COL CL Colistin NEO X 349 150ug Lipopeptides LIPOPEP 16 X Colistin 18912-6 206-3 205-5 33333-6 207-1 204-8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 12 13-21 22 2 4 0.5 4 4 8
|
||||
180 COL COL CS COL CL Colistin CLSI,EUCAST X X 28 10ug Lipopeptides LIPOPEP 16 X Colistin 18912-6 206-3 205-5 33333-6 207-1 204-8 10 - 11 2 8 10 - 11 2 8 10 - 11 2 8 10 - 11 2 8 10 - 11 2 8 10 - 11 2 8 10 - 11 2 8 10 - 11 2 8 10 - 11 2 8 10 - 11 2 8 2 4 2 4 0.5 4 4 8
|
||||
181 COL CO5 CS COL CL Colistin SFM X 194 50ug Lipopeptides LIPOPEP 16 X Colistin 18912-6 206-3 205-5 33333-6 207-1 204-8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 14 - 15 2 4 0.5 4 4 8
|
||||
182 COL CO2 CS COL CL Colistin BSAC X 315 25ug Lipopeptides LIPOPEP 16 X Colistin 18912-6 206-3 205-5 33333-6 207-1 204-8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 4 0.5 4 14 - 15 4 8
|
||||
183 CYC CYC CSE CS Cycloserine 129 Antimycobacterials MYCO 28 Cycloserin 18914-2 214-7 213-9 23608-3 215-4 212-1
|
||||
184 DAL DAL Dalbavancin CLSI,EUCAST X X 467 Glycopeptides Lipoglycopeptide GLYCO 21b X Dalbavanci 41734-5 41688-3 41689-1 41690-9
|
||||
185 DAN DFX DFX DAN Danofloxacin CLSI X 247 5ug Quinolones Fluoroquinolone FQ 11b X 73601-7 73646-2 73623-1
|
||||
186 DAP DAP DPT Daptomycin CLSI X 395 30ug Lipopeptides LIPOPEP 16 X Daptomycin 35789-7 35787-1 35788-9 41691-7 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 -
|
||||
187 DEM DEM DM DMCTC Demeclocycline 160 Tetracyclines TETRA 24 Demeclocyc 18915-9 218-8 217-0 7006-0 219-6 216-2
|
||||
188 DKB DIB DKB DIB DKB Dibekacin SFM X 29 10ug Aminoglycosides AG 09 13 14-15 16 4 16
|
||||
189 DIC DIC DX DIC MDIPC Dicloxacillin DIN X 123 5ug X Penicillins Penicillin (Stable) PEN-S 01e Dicloxacil 18916-7 222-0 221-2 223-8 220-4 1 2
|
||||
190 DIF DIF DIF Difloxacin CLSI X 248 10ug Quinolones Fluoroquinolone FQ 11b X Difloxacin 35792-1 35790-5 35791-3 17 18-20 21 .5 4 17 18-20 21 .5 4 17 18-20 21 .5 4 17 18-20 21 .5 4 17 18-20 21 .5 4 17 18-20 21 .5 4 17 18-20 21 .5 4 17 18-20 21 .5 4 17 18-20 21 .5 4 17 18-20 21 .5 4
|
||||
191 DIR DIR DIR Dirithromycin CLSI,SFM X X 104 15ug Macrolides MACRO 17a X Dirithromy 35795-4 35793-9 35794-7 7007-8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-27 28 .125 8
|
||||
192 CPD PO3 CPD CPO CPDX Cefpodoxime SRGA,NEO X X 188 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefpodoxim 18890-4 121-4 120-6 6993-0 122-2 119-8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 1 4 23 24-26 27 1 4 1 2
|
||||
193 CPD POD CPD CPO CPDX Cefpodoxime CLSI,EUCAST X X X 87 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefpodoxim 18890-4 121-4 120-6 6993-0 122-2 119-8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 17 18-20 21 2 8 20 - 21 1 2 20 21-23 24 1 4 1 4 1 2
|
||||
194 CPX CPX CPP CPDX-PR Cefpodoxime proxetil SFM,DIN X X 238 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a 20 21-23 24 1 4 18 19-24 25 1 8
|
||||
195 CDC CDC CPDX-CVA Cefpodoxime/Clavulanic acid 429 X Beta-lactam+Inhibitors BL+INH 03 Cefpodoxim 41731-1 41680-0 41679-2 41678-4
|
||||
196 CPR PRO CPR CPY Cefprozil CLSI X 102 30ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a X Cefprozil 18891-2 125-5 124-8 6994-8 126-3 123-0 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32
|
||||
197 CEQ CEQ Cefquinome 481 X Cephems Cephalosporin ? CEPH? 04d
|
||||
198 CRD CRD CRD CXD Cefroxadine 239 X Cephems Cephalosporin I CEPH1 04a
|
||||
199 DOR DOR DRPM Doripenem CLSI,EUCAST X X 451 10ug X Penems Carbapenems CARB 07a X Doripenem 60535-2 72893-1 56031-8 58711-3 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 17 18-23 24 1 8
|
||||
200 DOX DOX DO DOX DOXY Doxycycline CLSI,SFM,SRGA,BSAC X X X X X 30 30ug Tetracyclines TETRA 24a X Doxycyclin 18917-5 226-1 225-3 7008-6 20379-4 23623-2 227-9 224-6 10 11-13 14 4 16 10 11-13 14 4 16 10 11-13 14 4 16 10 11-13 14 4 16 10 11-13 14 4 16 10 11-13 14 4 16 10 11-13 14 4 16 10 11-13 14 4 16 10 11-13 14 4 16 10 11-13 14 4 16 16 17-18 19 4 16 1 8 19 20-24 25 1 4 19 20-22 23 1 2 28 - 29 1 2
|
||||
201 DOX DO8 DO DOX DOXY Doxycycline NEO X 350 80ug Tetracyclines TETRA 24 X Doxycyclin 18917-5 226-1 225-3 7008-6 20379-4 23623-2 227-9 224-6 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 1 8 1 4 1 2 1 2
|
||||
202 ECO ECO ECO Econazole NEO X 351 10ug Antifungals FUNG 29 Econazole 25595-0 25637-0
|
||||
203 ENX EN5 ENX ENO ENX Enoxacin SFM,DIN X X 249 5ug Quinolones Fluoroquinolone FQ 11b X Enoxacin 18918-3 230-3 229-5 41692-5 231-1 228-7 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 18 19-21 22 1 4 16 17-20 21 1 4
|
||||
204 ENX ENX ENX ENO ENX Enoxacin CLSI X 31 10ug Quinolones Fluoroquinolone FQ 11b X Enoxacin 18918-3 230-3 229-5 41692-5 231-1 228-7 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 1 4 1 4
|
||||
205 GRN GRN Garenoxacin CLSI X 491 5ug Quinolones Quinolone QUIN 11a X Garenoxaci 35813-5 35811-9 35812-7
|
||||
206 GAT GA2 GAT GFLX Gatifloxacin 412 2ug Quinolones Fluoroquinolone FQ 11b X Gatifloxac 31038-3 31040-9 31036-7 31042-5 41494-6 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 1 4 1 4 1 2
|
||||
207 GAT GAT GAT GFLX Gatifloxacin CLSI,SFM,DIN X X X 256 5ug Quinolones Fluoroquinolone FQ 11b X Gatifloxac 31038-3 31040-9 31036-7 31042-5 41494-6 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 14 15-17 18 2 8 17 18-20 21 1 4 17 18-22 23 1 4 1 2
|
||||
208 GEM GEM GEM Gemifloxacin CLSI X 393 5ug Quinolones Fluoroquinolone FQ 11b X Gemifloxac 35816-8 35814-3 35815-0 41697-4 15 16-19 20 .25 1 15 16-19 20 .25 1 15 16-19 20 .25 1 15 16-19 20 .25 1 15 16-19 20 .25 1 15 16-19 20 .25 1 15 16-19 20 .25 1 15 16-19 20 .25 1 15 16-19 20 .25 1 15 16-19 20 .25 1 1 2
|
||||
209 GEM GX1 GEM Gemifloxacin X 413 1ug Quinolones Fluoroquinolone FQ 11b X Gemifloxac 35816-8 35814-3 35815-0 41697-4 .25 1 .25 1 .25 1 .25 1 .25 1 .25 1 .25 1 .25 1 .25 1 .25 1 19 - 20 1 2
|
||||
210 GEN GE1 GM GEN GM Gentamicin SFM X 196 15ug Aminoglycosides AG 09 X Gentamicin 18928-2 268-3 267-5 7016-9 269-1 266-7 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 15 16-17 18 2 8 1 8 1 8 2 8 2 4 1 2
|
||||
211 JOS JOS JM JOS JM Josamycin 115 100ug Macrolides MACRO 17 Josamycine 25597-6 41698-2 25702-2 41699-0
|
||||
212 GEN GEN GM GEN GM Gentamicin CLSI,EUCAST X X X X 35 10ug Aminoglycosides AG 09 X Gentamicin 18928-2 268-3 267-5 7016-9 269-1 266-7 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 13 14-16 17 2 8 4 16 14 15-20 21 1 8 1 8 2 8 2 4 19 - 20 1 2
|
||||
213 GEN GE4 GM GEN GM Gentamicin NEO X 358 40ug Aminoglycosides AG 09 X Gentamicin 18928-2 268-3 267-5 7016-9 269-1 266-7 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 14 15-25 26 4 16 1 8 1 8 2 8 2 4 1 2
|
||||
214 GEN GE3 GM GEN GM Gentamicin AFA,SRGA X X 197 30ug Aminoglycosides AG 09 X Gentamicin 18928-2 268-3 267-5 7016-9 269-1 266-7 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 1 8 1 8 18 19-21 22 2 8 17 18-20 21 2 4 1 2
|
||||
215 GEH GH2 Gentamicin-High NEO X 359 250ug Aminoglycosides AG 09 X Gentamicin 18929-0 7017-7 7018-5 35817-6 500 501 500 501 500 501 500 501 500 501 500 501 500 501 500 501 500 501 500 501 250 501 500 1000
|
||||
216 GEH GE5 Gentamicin-High SFM X 198 500ug Aminoglycosides AG 09 X Gentamicin 18929-0 7017-7 7018-5 35817-6 500 501 500 501 500 501 500 501 500 501 500 501 500 501 500 501 500 501 500 501 10 11-16 17 250 501 500 1000
|
||||
217 HET HET H Hetacillin 259 X Penicillins Aminopenicillin PEN 01b Hetacillin 18931-6 276-6 275-8 277-4 274-1
|
||||
218 HYG HYG Hygromycin 414 Aminoglycosides AG 09
|
||||
219 ICL ICL Iclaprim CLSI X 476 5ug Folate pathway inhibitors FOLATE 12a X 73597-7 73642-1 73619-9
|
||||
220 IPM IMP IPM IMP Imipenem CLSI,EUCAST X X X X X X X 36 10ug X Penems Carbapenems CARB 07a X Imipenem 18932-4 280-8 279-0 7019-3 23613-3 281-6 278-2 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 13 14-15 16 4 16 14 15-20 21 2 16 16 17-21 22 4 16 19 20-22 23 2 8 2 16 22 23-25 26 4 16 16 17-22 23 1 16 22 - 23 4 8
|
||||
221 IPM IM1 IPM IMP IPM/CS Imipenem NEO X 360 15ug X Penems Carbapenems CARB 07a X Imipenem 18932-4 280-8 279-0 7019-3 23613-3 281-6 278-2 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 12 13-25 26 4 16 4 16 4 8
|
||||
222 IPE IPE Imipenem/EDTA 433 X Penems Carbapenems CARB 07a 35819-2
|
||||
223 ISE ISE ISP ISE ISP Isepamicin SFM X 75 30ug Aminoglycosides AG 09 Isepamicin 32381-6 35820-0 35821-8 14 15-16 17 8 32
|
||||
224 ISO ISO ISL Isoconazole NEO X 165 10ug Antifungals FUNG 29
|
||||
225 INH INH INH INH Isoniazid 132 Antimycobacterials MYCO 28 Isoniazid 18934-0 288-1 287-3 7020-1 20383-6 23947-5 289-9 286-5
|
||||
227 ENR EN1 ENR Enrofloxacin NEO X 352 10ug Quinolones Fluoroquinolone FQ 11b Enrofloxac 23712-3 35797-0 35798-8 35796-2 .25 2 .25 2 .25 2 .25 2 .25 2 .25 2 .25 2 .25 2 .25 2 .25 2
|
||||
228 ENR ENR ENR Enrofloxacin CLSI X 161 5ug Quinolones Fluoroquinolone FQ 11b X Enrofloxac 23712-3 35797-0 35798-8 35796-2 16 17-22 23 .25 2 16 17-22 23 .25 2 16 17-22 23 .25 2 16 17-22 23 .25 2 16 17-22 23 .25 2 16 17-22 23 .25 2 16 17-22 23 .25 2 16 17-22 23 .25 2 16 17-22 23 .25 2 16 17-22 23 .25 2
|
||||
229 ENV ENV EVM Enviomycin (Tuberactinomycin) 452 Antimycobacterials MYCO 28
|
||||
230 EPE EPE Eperozolid 250 Oxazolidinones OXAZOLID 20
|
||||
231 EPP EPP EPP Epiroprim 251 Folate pathway inhibitors FOLATE 12a
|
||||
232 ETP ETP ERT Ertapenem CLSI,EUCAST X X X 401 10ug X Penems Carbapenems CARB 07a X Ertapenem 35802-8 35799-6 35801-0 35800-2 18 19-21 22 .5 2 18 19-21 22 .5 2 18 19-21 22 .5 2 18 19-21 22 .5 2 18 19-21 22 .5 2 18 19-21 22 .5 2 18 19-21 22 .5 2 18 19-21 22 .5 2 19 20-22 23 .25 1 15 16-18 19 2 8 21 22-24 25 0.5 2 19 20-22 23 2 8
|
||||
233 ERY ER5 E ERY EM Erythromycin BSAC X 316 5ug Macrolides MACRO 17 X Erythromyc 18919-1 234-5 233-7 7009-4 20380-2 23633-1 235-2 232-9 .5 8 .5 8 .5 8 .5 8 .5 8 .5 8 .5 8 .5 8 .5 8 .5 8 1 8 1 8 1 4 1 4 .5 1 19 - 20 .5 1
|
||||
234 ERY ERY E ERY EM Erythromycin CLSI,EUCAST X X X X X X 32 15ug Macrolides 14-Membered ring MACRO 17a X Erythromyc 18919-1 234-5 233-7 7009-4 20380-2 23633-1 235-2 232-9 13 14-22 23 .5 8 13 14-22 23 .5 8 13 14-22 23 .5 8 13 14-22 23 .5 8 13 14-22 23 .5 8 13 14-22 23 .5 8 13 14-22 23 .5 8 13 14-22 23 .5 8 13 14-22 23 .5 8 13 14-22 23 .5 8 16 17-21 22 1 8 16 17-20 21 1 8 1 4 19 20-23 24 1 4 19 20-24 25 .5 1 .5 1
|
||||
235 ERY ER7 E ERY EM Erythromycin NEO X 353 78ug Macrolides 14-Membered ring MACRO 17 X Erythromyc 18919-1 234-5 233-7 7009-4 20380-2 23633-1 235-2 232-9 .5 8 .5 8 .5 8 .5 8 .5 8 .5 8 .5 8 .5 8 .5 8 .5 8 14 15-27 28 1 8 1 8 1 4 1 4 .5 1 .5 1
|
||||
236 ETH ETH EB EMB EB Ethambutol 130 Antimycobacterials MYCO 28 Ethambutol 18921-7 242-8 241-0 7010-2 20381-0 23625-7 243-6 240-2
|
||||
237 ETI ETI EA ETH ETH Ethionamide 131 Antimycobacterials MYCO 28 Ethionamid 18922-5 41693-3 16099-4 7011-0 20382-8 23617-4
|
||||
238 ETO ETO Ethopabate 411 Coccidiostats COCC 27
|
||||
239 FAR FAR FAR FRPM Faropenem CLSI X 428 5ug X Penems Penem PENEM 07b X 73600-9 73645-4 73622-3
|
||||
240 FDX FDX Fidaxomicin CLSI X 487 17 X 73599-3 73644-7 73621-5
|
||||
241 FIN FIN Finafloxacin CLSI X 500 Quinolones Fluoroquinolone FQ 11b X 73598-5 73643-9 73620-7
|
||||
242 FLA FLA Flavomycin 252 Flavophospholipols FLAVO 27
|
||||
243 FLE FL1 FLE FLO FLRX Fleroxacin NEO X 354 10ug Quinolones Fluoroquinolone FQ 11b X Fleroxacin 32372-5 35806-9 25411-0 7012-8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 1 8
|
||||
244 FLE FLE FLE FLO FLRX Fleroxacin CLSI,DIN X X 105 5ug Quinolones Fluoroquinolone FQ 11b X Fleroxacin 32372-5 35806-9 25411-0 7012-8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 15 16-18 19 2 8 12 13-23 24 14 15-21 22 1 8
|
||||
245 FLO FLO FLO FLX FMOX Flomoxef 162 X Cephems Oxacephem OXACEPH 04f
|
||||
246 FLR FLR FLF Florfenicol CLSI X 253 30ug Phenicols PHEN 22 X Florfenico 23740-4 35807-7 35808-5 14 15-18 19 2 8 14 15-18 19 2 8 14 15-18 19 2 8 14 15-18 19 2 8 14 15-18 19 2 8 14 15-18 19 2 8 14 15-18 19 2 8 14 15-18 19 2 8 14 15-18 19 2 8 14 15-18 19 2 8
|
||||
247 FLC FLC FU FLU Flucloxacillin DIN X 163 X Penicillins Penicillin (Stable) PEN-S 01e 1 2 4 8
|
||||
248 FLU FL2 FCA FLCZ Fluconazole CLSI,NEO X 443 25ug Antifungals FUNG 29 X Fluconazol 18924-1 250-1 249-3 7013-6 251-9 248-5 14 15-18 19 8 64 14 15-18 19 8 64 14 15-18 19 8 64 14 15-18 19 8 64 14 15-18 19 8 64 14 15-18 19 8 64 14 15-18 19 8 64 14 15-18 19 8 64 14 15-18 19 8 64
|
||||
250 FLM FLM UB FLM Flumequine SFM X 88 30ug Quinolones Quinolone QUIN 11a 20 21-24 25 4 16
|
||||
251 FFL FFL F-FLCZ Fosfluconazole 453 Antifungals FUNG 29
|
||||
252 FOS FO7 FOS FOS FOM Fosfomycin NEO X 355 70ug Fosfomycins Fosfomycin FOSFO 13 X Fosfomycin 25596-8 35810-1 25653-7 35809-3 64 256 64 256 64 256 64 256 64 256 64 256 64 256 64 256 64 256 12 13-17 18 32 64 128 256
|
||||
253 FOS FO2 FOS FOS FOM Fosfomycin BSAC 317 20ug Fosfomycins Fosfomycin FOSFO 13 X Fosfomycin 25596-8 35810-1 25653-7 35809-3 64 256 64 256 64 256 64 256 64 256 64 256 64 256 64 256 64 256 32 64 128 256
|
||||
254 FOS FOS FOS FOS FOM Fosfomycin CLSI,EUCAST X X X 254 200ug Fosfomycins Fosfomycin FOSFO 13 X Fosfomycin 25596-8 35810-1 25653-7 35809-3 12 13-15 16 64 256 12 13-15 16 64 256 12 13-15 16 64 256 12 13-15 16 64 256 12 13-15 16 64 256 12 13-15 16 64 256 12 13-15 16 64 256 12 13-15 16 64 256 12 13-15 16 64 256 32 64 32 64 19 - 20 128 256
|
||||
255 FOS FO5 FOS FOS FOM Fosfomycin SFM X 33 50ug Fosfomycins Fosfomycin FOSFO 13 X Fosfomycin 25596-8 35810-1 25653-7 35809-3 64 256 64 256 64 256 64 256 64 256 64 256 64 256 64 256 64 256 13 - 14 32 64 128 256
|
||||
256 FMD FMD FMD Fosmidomycin 255 Fosfomycins Fosfomycin FOSFO 13
|
||||
257 FRM FRM FY FRA Framycetin 164 30ug Aminoglycosides AG 09 Framycetin 18926-6 259-2 258-4 260-0 257-6
|
||||
258 FRZ FRZ FUR Furazolidone 434 100ug Nitrofurans FURAN 18
|
||||
259 FRZ FRZ FUR Furazolidone NEO X 356 50ug Nitrofurans FURAN 18
|
||||
260 FUS FU5 FA FUS FA Fusidic acid AFA,SRGA X X 195 50ug Steroidals Fusidane FUSID 26 X Fusidate 18927-4 263-4 262-6 7015-1 264-2 261-8 2 32 1 2 32 - 33 .5 1 26 27-29 30 .5 1 1 2
|
||||
261 FUS FUS FA FUS FA Fusidic acid EUCAST X X X X 34 10ug Steroidals Fusidane FUSID 26 X Fusidate 18927-4 263-4 262-6 7015-1 264-2 261-8 14 15-21 22 2 32 1 2 .5 1 .5 1 29 - 30 1 2
|
||||
262 FUS F00 FA FUS FA Fusidic acid NEO X 357 100ug Steroidals Fusidane FUSID 26 X Fusidate 18927-4 263-4 262-6 7015-1 264-2 261-8 14 15-27 28 2 32 1 2 .5 1 .5 1 1 2
|
||||
263 KAN KAN K KAN KM Kanamycin CLSI,SFM X X 37 30ug Aminoglycosides AG 09 X Kanamycin 18935-7 292-3 291-5 7022-7 23609-1 293-1 290-7 13 14-17 18 16 64 13 14-17 18 16 64 13 14-17 18 16 64 13 14-17 18 16 64 13 14-17 18 16 64 13 14-17 18 16 64 13 14-17 18 16 64 13 14-17 18 16 64 13 14-17 18 16 64 13 14-17 18 16 64 14 15-16 17 8 32 4 32
|
||||
264 KAN KA1 K KM Kanamycin NEO X 361 100ug Aminoglycosides AG 09 X Kanamycin 18935-7 292-3 291-5 7022-7 23609-1 293-1 290-7 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 16 64 14 15-27 28 8 32 4 32
|
||||
265 KAH KAH Kanamycin-High CLSI,SFM X X 138 1000ug Aminoglycosides AG 09 X Kanamycin. 18936-5 7023-5 7024-3 9 10-13 14 250 501
|
||||
266 KAH KH5 Kanamycin-High NEO X 362 500ug Aminoglycosides AG 09 X Kanamycin. 18936-5 7023-5 7024-3 250 501
|
||||
267 KET KET KET KCZ Ketoconazole NEO X 134 15ug Antifungals FUNG 29 Ketoconazo 18937-3 296-4 295-6 7025-0 297-2 294-9
|
||||
268 KIT KIT LU LM Kitasamycin (Leucomycin) 116 Macrolides MACRO 17
|
||||
269 LAS LAS Lasalocid 415 Combinations Coccidiostat/Ionophore OTHER 28
|
||||
270 LEN LEN LEN LAPC Lenampicillin 454 X Penicillins Aminopenicillin PEN 01b
|
||||
271 LVX LEV LEV LVFX Levofloxacin CLSI,EUCAST X X X X X 142 5ug Quinolones Fluoroquinolone FQ 11b X Levofloxac 20629-2 21367-8 20396-8 7026-8 16 17-20 21 0.5 2 13 14-16 17 2 8 13 14-16 17 2 8 13 14-16 17 2 8 13 14-16 17 2 8 13 14-16 17 2 8 13 14-16 17 2 8 13 14-16 17 2 8 13 14-16 17 2 8 13 14-16 17 2 8 18 19-21 22 1 4 16 17-19 20 1 4 2 4 2 4
|
||||
272 LVX LE1 LEV LVFX Levofloxacin BSAC X 319 1ug Quinolones Fluoroquinolone FQ 11b X Levofloxac 20629-2 21367-8 20396-8 7026-8 0.5 2 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 1 8 2 4 19 - 20 2 4
|
||||
273 LIN LIN L LIN LCM Lincomycin AFA,SFM X X 38 15ug Lincosamides LINCO 15 Lincomycin 18938-1 300-4 299-8 41700-6 301-2 298-0 16 17-20 21 2 16 17 18-23 24 1 4
|
||||
274 LIN LI1 L LIN LCM Lincomycin NEO X 363 19ug Lincosamides LINCO 15 Lincomycin 18938-1 300-4 299-8 41700-6 301-2 298-0 14 15-27 28 2 16 1 4
|
||||
275 LSP LSP Linco-spectin (lincomycin/spectinomycin) NEO X 364 15/200ug Combinations Lincosamide/Aminocyclitol OTHER 28
|
||||
276 LNZ LNZ LIZ LZD Linezolid CLSI,SFM X X 260 30ug Oxazolidinones OXAZOLID 20 X Linezolid 29258-1 29255-7 29254-0 33332-8 41500-0 20 - 21 4 8 20 - 21 4 8 20 - 21 4 8 20 - 21 4 8 20 - 21 4 8 20 - 21 4 8 20 - 21 4 8 20 - 21 4 8 20 - 21 4 8 20 - 21 4 8 23 24-27 28 2 8 2 4
|
||||
277 LNZ LN1 LIZ LZD Linezolid EUCAST X X 416 10ug Oxazolidinones OXAZOLID 20 X Linezolid 29258-1 29255-7 29254-0 33332-8 41500-0 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 2 8 22 - 23 2 4
|
||||
278 LFE LFE Linoprist-flopristin CLSI X 483 10ug Streptogramins STREPTOG 23 X 55292-7 55294-3 55293-5
|
||||
279 LOM LOM LOM LOM LFLX Lomefloxacin CLSI X 107 10ug Quinolones Fluoroquinolone FQ 11b X Lomefloxac 18939-9 304-6 303-8 41701-4 305-3 302-0 18 19-21 22 2 8 18 19-21 22 2 8 18 19-21 22 2 8 18 19-21 22 2 8 18 19-21 22 2 8 18 19-21 22 2 8 18 19-21 22 2 8 18 19-21 22 2 8 18 19-21 22 2 8 18 19-21 22 2 8 1 4
|
||||
280 LOM LO5 LOM LOM LFLX Lomefloxacin SFM X 261 5ug Quinolones Fluoroquinolone FQ 11b X Lomefloxac 18939-9 304-6 303-8 41701-4 305-3 302-0 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 18 19-21 22 1 4
|
||||
281 LOR LOR LOR LCBF Loracarbef CLSI,DIN X X 108 30ug X Cephems-Oral Carbacephem CEPH-ORAL 05b X Loracarbef 18940-7 308-7 307-9 7027-6 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 14 15-17 18 8 32 2 16 20 21-25 26 2 16 19 20-22 23 2 8
|
||||
282 LOR LO1 LOR LCBF Loracarbef SFM X 262 10ug X Cephems-Oral Cephalosporin CEPH-ORAL 05a Loracarbef 18940-7 308-7 307-9 7027-6 309-5 306-1 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 14 15-22 23 2 16 2 16 2 8
|
||||
283 MAR MAR MAR Marbofloxacin CLSI X 468 5ug Quinolones Fluoroquinolone FQ 11b X 73596-9 73641-3 73618-1 14 15-19 20 1 4 14 15-19 20 1 4 14 15-19 20 1 4 14 15-19 20 1 4 14 15-19 20 1 4
|
||||
284 MEC ME4 MEC MCL Mecillinam (Amdinocillin) NEO X 365 33ug X Penicillins Amidinopenicillin PEN 01f X Amdinocill 18859-9 9-1 8-3 7028-4 10-9 7-5 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 14 15-27 28 2 16 1 16 1 16 1 16
|
||||
285 MEC MEC MEC MCL Mecillinam (Amdinocillin) CLSI,EUCAST X X X X X X 80 10ug X Penicillins Amidinopenicillin PEN 01f X Amdinocill 18859-9 9-1 8-3 7028-4 10-9 7-5 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 11 12-14 15 8 32 14 - 15 8 16 17 18-21 22 2 16 14 15-23 24 1 16 13 14-23 24 1 16 13 14-23 24 1 16
|
||||
286 MEL MEL Meleumycin 117 Macrolides MACRO 17
|
||||
287 MEM MER MEM MER MEPM Meropenem CLSI,EUCAST X X X X X X X 109 10ug X Penems Carbapenems CARB 07a X Meropenem 18943-1 6653-0 6652-2 7029-2 6654-8 6651-4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 19 20-22 23 1 4 13 14-15 16 4 16 15 16-21 22 2 16 16 17-19 20 14 15-19 20 4 16 13 14-21 22 2 16 16 17-22 23 4 16 19 20-28 29 .125 16 22 - 23 4 8
|
||||
288 MES MES MES Mesulfamide 263 Folate pathway inhibitors FOLATE 12a 4 8
|
||||
289 MET MET ME MET Methicillin CLSI,BSAC X X 39 5ug X Penicillins Penicillin (Stable) PEN-S 01e X Methicilli 18945-6 324-4 323-6 7030-0 325-1 322-8 9 10-13 14 8 16 9 10-13 14 8 16 9 10-13 14 8 16 9 10-13 14 8 16 9 10-13 14 8 16 9 10-13 14 8 16 9 10-13 14 8 16 9 10-13 14 8 16 9 10-13 14 8 16 9 10-13 14 8 16 13 - 14 4 8
|
||||
290 MET ME2 ME MET Methicillin NEO X 366 29ug X Penicillins Penicillin (Stable) PEN-S 01e X Methicilli 18945-6 324-4 323-6 7030-0 325-1 322-8 8 16 8 16 8 16 8 16 8 16 8 16 8 16 8 16 8 16 8 16 14 15-27 28 4 8
|
||||
291 MTP MTP MTP Metioprim 264 Folate pathway inhibitors FOLATE 12a
|
||||
292 MXT MXT MXT Metioxate 265 Quinolones Quinolone QUIN 11a
|
||||
293 MTR MTR MTR MTR Metronidazole SRGA X 76 4ug Nitroimidazoles IMIDAZ 19 Metronidaz 18946-4 328-5 327-7 7031-8 329-3 326-9 4 32 4 8 4 16
|
||||
294 MTR MT1 MTR MTR Metronidazole SFM,NEO X X 367 16ug Nitroimidazoles IMIDAZ 19 X Metronidaz 18946-4 328-5 327-7 7031-8 329-3 326-9 20 - 21 4 32 4 8 4 16
|
||||
295 MTR MTR MTR MTR Metronidazole 430 5ug Nitroimidazoles IMIDAZ 19 X Metronidaz 18946-4 328-5 327-7 7031-8 329-3 326-9 4 32 4 8 4 16
|
||||
296 MTR ME1 MTR MTR Metronidazole EUCAST X 199 10ug Nitroimidazoles IMIDAZ 19 X Metronidaz 18946-4 328-5 327-7 7031-8 329-3 326-9 4 32 4 8 4 16
|
||||
297 MEZ MEZ MZ MZL Mezlocillin CLSI,SFM,BSAC X X X 40 75ug X Penicillins Ureidopenicillin PEN 01c X Mezlocilli 18947-2 332-7 331-9 41702-2 333-5 330-1 17 18-20 21 16 128 17 18-20 21 16 128 15 16-20 21 8 64 4 32 4 8 21 - 22 16 32
|
||||
298 MEZ ME3 MZ MZL Mezlocillin DIN X 266 30ug X Penicillins Ureidopenicillin PEN 01c X Mezlocilli 18947-2 332-7 331-9 41702-2 333-5 330-1 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 8 64 16 17-22 23 4 32 4 8 16 32
|
||||
299 MSU MSU MZS Mezlocillin/Sulbactam DIN X 267 30/15ug X Beta-lactam+Inhibitors BL+INH 03 16 17-21 22 4 32
|
||||
300 MIF MIF Micafungin CLSI X 455 10ug Antifungals FUNG 29
|
||||
301 MCZ MCZ MCZ MCZ MCZ Miconazole NEO X 268 10ug Antifungals FUNG 29 Miconazole 25607-3 25722-0
|
||||
302 MCR MCR MCR MCR MCR Micronomicin 269 Aminoglycosides AG 09
|
||||
303 MID MID MID MDM Midecamycin 118 100ug Macrolides MACRO 17
|
||||
304 MIL MIL MIL Miloxacin 270 Quinolones Quinolone QUIN 11a
|
||||
305 MNO MIN MNO MNO MINO Minocycline CLSI,EUCAST X X X 41 30ug Tetracyclines TETRA 24a X Minocyclin 18948-0 336-8 335-0 7032-6 337-6 334-3 12 13-15 16 4 16 12 13-15 16 4 16 12 13-15 16 4 16 12 13-15 16 4 16 12 13-15 16 4 16 12 13-15 16 4 16 12 13-15 16 4 16 12 13-15 16 4 16 12 13-15 16 4 16 12 13-15 16 4 16 16 17-18 19 4 16 1 8
|
||||
306 MNO MI8 MNO MNO MINO Minocycline NEO X 368 80ug Tetracyclines TETRA 24 X Minocyclin 18948-0 336-8 335-0 7032-6 337-6 334-3 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 1 8
|
||||
307 MON MON Monensin sodium 417 Combinations Coccidiostat/Ionophore OTHER 28
|
||||
308 MOX MOX MOX LMO LMOX Moxalactam (Latamoxef) CLSI,SFM X X 42 30ug X Cephems Oxacephem OXACEPH 04f X Moxalactam 18950-6 344-2 343-4 41703-0 345-9 342-6 14 15-22 23 8 64 14 15-22 23 8 64 14 15-22 23 8 64 14 15-22 23 8 64 14 15-22 23 8 64 14 15-22 23 8 64 14 15-22 23 8 64 14 15-22 23 8 64 14 15-22 23 8 64 14 15-22 23 8 64 16 17-22 23 4 64
|
||||
309 MFX MF1 MOX MFLX Moxifloxacin X 418 1ug Quinolones Fluoroquinolone FQ 11b X Moxifloxac 31039-1 31041-7 31037-5 31043-3 41502-6 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 1 4 1 4 19 - 20 1 2
|
||||
310 MFX MFX MOX MFLX Moxifloxacin CLSI,EUCAST X X X X X 392 5ug Quinolones Fluoroquinolone FQ 11b X Moxifloxac 31039-1 31041-7 31037-5 31043-3 41502-6 20 21-23 24 .5 2 20 21-23 24 .5 2 20 21-23 24 .5 2 20 21-23 24 .5 2 20 21-23 24 .5 2 20 21-23 24 .5 2 20 21-23 24 .5 2 20 21-23 24 .5 2 20 21-23 24 .5 2 20 21-23 24 .5 2 16 17-19 20 0.5 2 20 21-23 24 .5 2 18 19-21 22 1 4 1 2
|
||||
311 MUP MUP MUP MUP Mupirocin CLSI,NEO X X 124 10ug Pseudomonic acids PSEUDOM 27 X Mupirocin 20389-3 35822-6 35823-4 7033-4 19 - 20 2 - 4 8
|
||||
312 MUP MU5 MUP MUP Mupirocin SFM,BSAC X X 419 5ug Pseudomonic acids PSEUDOM 27 X Mupirocin 20389-3 35822-6 35823-4 7033-4 - - 19 2 - 21 - 22 4 8
|
||||
313 NAD NAD NDFX Nadifloxacin 456 Quinolones Fluoroquinolone FQ 11b
|
||||
314 NAF NAF NF NCL Nafcillin CLSI X 43 1ug X Penicillins Penicillin (Stable) PEN-S 01e X Nafcillin 18951-4 348-3 347-5 41704-8 349-1 346-7 10 11-12 13 2 4 10 11-12 13 2 4 10 11-12 13 2 4 10 11-12 13 2 4 10 11-12 13 2 4 10 11-12 13 2 4 10 11-12 13 2 4 10 11-12 13 2 4 10 11-12 13 2 4 10 11-12 13 2 4
|
||||
315 NAL NAL NA NAL NA Nalidixic acid CLSI,EUCAST X X X X 44 30ug Quinolones Quinolone QUIN 11a X Nalidixate 18952-2 352-5 351-7 7034-2 353-3 350-9 13 14-18 19 16 32 13 14-18 19 16 32 13 14-18 19 16 32 13 14-18 19 16 32 13 14-18 19 16 32 13 14-18 19 16 32 13 14-18 19 16 32 13 14-18 19 16 32 13 14-18 19 16 32 13 14-18 19 16 32 15 - 16 16 32 14 15-19 20 8 32 14 - 15 16 32 15 16-19 20 8 32
|
||||
316 NAL NA1 NA NAL NA Nalidixic acid NEO X 369 130ug Quinolones Quinolone QUIN 11a X Nalidixate 18952-2 352-5 351-7 7034-2 353-3 350-9 16 32 16 32 16 32 16 32 16 32 16 32 16 32 16 32 16 32 16 32 14 15-27 28 8 32 16 32
|
||||
317 NAR NAR Narasin 402 Combinations Coccidiostat/Ionophore OTHER 28
|
||||
318 NEO NEO N NEO FRM Neomycin CLSI X 45 30ug Aminoglycosides AG 09 X Neomycin 18953-0 356-6 355-8 41705-5 357-4 354-1
|
||||
319 NEO NE0 NEO FRM Neomycin X 420 10ug Aminoglycosides AG 09 X Neomycin 18953-0 356-6 355-8 41705-5 357-4 354-1 16 - 17
|
||||
320 NEO NE2 N NEO FRM Neomycin NEO X 370 120ug Aminoglycosides AG 09 X Neomycin 18953-0 356-6 355-8 41705-5 357-4 354-1 14 15-27 28
|
||||
321 NET NET NET NET NTL Netilmicin CLSI,SFM,SRGA X X X X 46 30ug Aminoglycosides AG 09 X Netilmicin 18954-8 360-8 359-0 7035-9 361-6 358-2 12 13-14 15 8 32 12 13-14 15 8 32 12 13-14 15 8 32 12 13-14 15 8 32 12 13-14 15 8 32 12 13-14 15 8 32 12 13-14 15 8 32 12 13-14 15 8 32 12 13-14 15 8 32 12 13-14 15 8 32 18 19-20 21 2 8 1 8 2 16 18 19-21 22 2 8 17 18-20 21 2 4 1 2
|
||||
322 NET NE1 NET NET NTL Netilmicin EUCAST X X X 271 10ug Aminoglycosides AG 09 X Netilmicin 18954-8 360-8 359-0 7035-9 361-6 358-2 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 11 12-14 15 2 8 4 16 16 17-21 22 1 8 2 16 2 8 2 4 24 - 25 1 2
|
||||
323 NET NE4 NET NET NTL Netilmicin NEO X 371 40ug Aminoglycosides AG 09 X Netilmicin 18954-8 360-8 359-0 7035-9 361-6 358-2 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 14 15-25 26 4 16 1 8 2 16 2 8 17 18-20 21 2 4 1 2
|
||||
324 NIC NIC Nicarbazin 421 Coccidiostats COCC 27
|
||||
325 NIF NIF NIF Nifuroquine 272 Quinolones Quinolone QUIN 11a
|
||||
326 NTZ NTZ Nitazoxanide CLSI X 492 Thiazolides THIAZ 30 73595-1 73640-5 73617-3
|
||||
327 NIT FU0 FT NFT Nitrofurantoin BSAC 327 50ug Nitrofurans FURAN 18 X Nitrofuran 18955-5 364-0 363-2 7036-7 365-7 362-4 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 256 64 512 32 64 16 32 32 64 32 64
|
||||
328 NIT FU6 FT NFT Nitrofurantoin NEO X 372 260ug Nitrofurans FURAN 18 X Nitrofuran 18955-5 364-0 363-2 7036-7 365-7 362-4 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 14 15-27 28 32 256 64 512 32 64 16 32 32 64 32 64
|
||||
329 NIT FU1 FT NFT Nitrofurantoin EUCAST X X X X 200 100ug Nitrofurans FURAN 18 X Nitrofuran 18955-5 364-0 363-2 7036-7 365-7 362-4 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 10 - 11 64 128 32 256 10 11-15 16 64 512 32 64 18 - 19 16 32 13 14-16 17 32 64 32 64
|
||||
330 NIT FUR FT NFT Nitrofurantoin CLSI,SFM X X 47 300ug Nitrofurans FURAN 18 X Nitrofuran 18955-5 364-0 363-2 7036-7 365-7 362-4 14 15-16 17 32 128 14 15-16 17 32 128 14 15-16 17 32 128 14 15-16 17 32 128 14 15-16 17 32 128 14 15-16 17 32 128 14 15-16 17 32 128 14 15-16 17 32 128 14 15-16 17 32 128 14 15-16 17 32 128 13 14-16 17 32 256 64 512 32 64 16 32 32 64 32 64
|
||||
331 NIT FU2 FT NFT Nitrofurantoin BSAC X 320 200ug Nitrofurans FURAN 18 X Nitrofuran 18955-5 364-0 363-2 7036-7 365-7 362-4 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 256 64 512 32 64 16 32 32 64 19 - 20 32 64
|
||||
332 NIZ NIZ FC Nitrofurazone 166 Nitrofurans FURAN 18
|
||||
333 NTR NIT NI NIT Nitroxoline SFM X 89 20ug Quinolones Quinolone QUIN 11a Nitroxolin 25608-1 25723-8 11 12-29 30 1 64
|
||||
334 NOR NOR NOR NOR NFLX Norfloxacin CLSI,EUCAST X X X X 48 10ug Quinolones Fluoroquinolone FQ 11b X Norfloxaci 18956-3 368-1 367-3 7037-5 41504-2 369-9 366-5 12 13-16 17 4 16 12 13-16 17 4 16 12 13-16 17 4 16 12 13-16 17 4 16 12 13-16 17 4 16 12 13-16 17 4 16 12 13-16 17 4 16 12 13-16 17 4 16 12 13-16 17 4 16 18 19-21 22 0.5 2 12 13-25 26 1 4 23 24-26 27 1 4 1 4 17 18-23 24 .5 2 4 8
|
||||
335 NOR NO5 NOR NOR NFLX Norfloxacin SFM X 201 5ug Quinolones Fluoroquinolone FQ 11b X Norfloxaci 18956-3 368-1 367-3 7037-5 41504-2 369-9 366-5 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 21 22-24 25 .5 2 1 4 1 4 .5 2 4 8
|
||||
336 NOR NO2 NOR NOR NFLX Norfloxacin BSAC X 321 2ug Quinolones Fluoroquinolone FQ 11b X Norfloxaci 18956-3 368-1 367-3 7037-5 41504-2 369-9 366-5 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 1 4 1 4 1 4 .5 2 16 - 17 4 8
|
||||
337 NVA NVA Norvancomycin 119 Glycopeptides Glycopeptide GLYCO 21a
|
||||
338 NOV NOV NB Novobiocin CLSI,NEO X X 49 5ug Polypeptides Coumarin POLYPEP 26 X Novobiocin 18957-1 372-3 371-5 41706-3 373-1 370-7 15 - 16
|
||||
339 NOV NO1 NB Novobiocin NEO X 373 100ug Polypeptides Coumarin POLYPEP 26 X Novobiocin 18957-1 372-3 371-5 41706-3 373-1 370-7 12 13-21 22
|
||||
340 NYS NYS NY NYS NYS Nystatin NEO X 273 50ug Antifungals FUNG 29 Nystatin 18958-9 35824-2 10697-1 10698-9
|
||||
341 OFX OFL OFX OFLX Ofloxacin CLSI,EUCAST X X X X 50 5ug Quinolones Fluoroquinolone FQ 11b X Ofloxacin 18959-7 376-4 375-6 7038-3 20384-4 23948-3 377-2 374-9 12 13-15 16 2 8 12 13-15 16 2 8 12 13-15 16 2 8 12 13-15 16 2 8 12 13-15 16 2 8 12 13-15 16 2 8 12 13-15 16 2 8 12 13-15 16 2 8 12 13-15 16 2 8 12 13-15 16 2 8 18 19-21 22 0.5 2 21 22-24 25 .5 1 17 18-21 22 1 4 1 8 .5 8 .5 2 2 4
|
||||
342 OFX OF1 OFX OFLX Ofloxacin BSAC X 322 1ug Quinolones Fluoroquinolone FQ 11b X Ofloxacin 18959-7 376-4 375-6 7038-3 20384-4 23948-3 377-2 374-9 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 1 8 1 4 1 8 .5 8 .5 2 23 - 24 2 4
|
||||
343 OFX OF0 OFX OFLX Ofloxacin AFA,SRGA,NEO X X X 202 10ug Quinolones Fluoroquinolone FQ 11b X Ofloxacin 18959-7 376-4 375-6 7038-3 20384-4 23948-3 377-2 374-9 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 12 13-23 24 1 8 1 4 1 8 17 18-27 28 .5 8 17 18-23 24 .5 2 2 4
|
||||
344 OLE OLE OL OLE Oleandomycin 167 15ug Macrolides MACRO 17 Oleandomyc 18960-5 380-6 379-8 381-4 378-0
|
||||
345 OMC OMC Omadacycline CLSI X 502 Tetracyclines Aminomethylcycline TETRA 24c X 73594-4 73639-7 73616-5
|
||||
346 OPT OPT Optochin 168 5ug Optochins OPT 27
|
||||
347 ORB ORB ORB Orbifloxacin CLSI X 469 10ug Quinolones Fluoroquinolone FQ 11b X Orbifloxac 35827-5 35825-9 35826-7 17 18-22 23 1 8 17 18-22 23 1 8 17 18-22 23 1 8 17 18-22 23 1 8 17 18-22 23 1 8 17 18-22 23 1 8 17 18-22 23 1 8 17 18-22 23 1 8 17 18-22 23 1 8 17 18-22 23 1 8
|
||||
348 ORI ORI Oritavancin CLSI,EUCAST X X 442 Glycopeptides Glycopeptide LIPOGLYC 21a X Oritavanci 41736-0 41707-1 41708-9 41709-7
|
||||
349 ORS ORS Ormetroprim/Sulfamethoxazole CLSI X 274 1.25/23.75ug Folate pathway inhibitors FOLATE 12a X 73593-6 73638-9 73615-7
|
||||
350 ORN ORN ORN ORN Ornidazole 169 4ug Nitroimidazoles IMIDAZ 19
|
||||
351 OXA OXA OX OXA Oxacillin CLSI,EUCAST X X X X X 51 1ug X Penicillins Penicillin (Stable) PEN-S 01e X Oxacillin 18961-3 384-8 383-0 7039-1 385-5 382-2 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 2 4 1 2 1 4 9 10-11 12 14 - 15 2 4
|
||||
352 OXA OX5 OX OXA Oxacillin SFM,DIN,NEO X X X 203 5ug X Penicillins Penicillin (Stable) PEN-S 01e X Oxacillin 18961-3 384-8 383-0 7039-1 385-5 382-2 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 15 - 16 19 - 20 2 4 15 - 16 1 2 1 4 2 4
|
||||
353 OXA OX1 OX OXA Oxacillin AFA X 398 10ug X Penicillins Penicillin (Stable) PEN-S 01e X Oxacillin 18961-3 384-8 383-0 7039-1 385-5 382-2 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 .25 .5 2 4 1 2 19 - 20 1 4 2 4
|
||||
354 OXO OXO OA OXL Oxolinic acid CLSI X 470 2ug Quinolones Quinolone QUIN 11a X Oxolinate 55696-9 55697-7 55695-1 55698-5
|
||||
355 OXO OXO OA OXL Oxolinic acid SFM X 90 10ug Quinolones Quinolone QUIN 11a Oxolinate 55696-9 55697-7 55695-1 55698-5 16 17-19 20 2 8
|
||||
356 OXY OXY OT OTE OTC Oxytetracycline SFM X 170 30ug Tetracyclines TETRA 24 Oxytetracy 18962-1 388-9 387-1 389-7 386-3 16 17-18 19 4 16
|
||||
357 OXY OX8 OT OTE OTC Oxytetracycline NEO X 374 80ug Tetracyclines TETRA 24 Oxytetracy 18962-1 388-9 387-1 389-7 386-3 14 15-27 28 4 16
|
||||
358 PAS PAS PAS P-Aminosalicylic acid 171 Antimycobacterials MYCO 28 Para amino 23629-9 14332-1 23611-7
|
||||
359 PAN PAN PAN PAPM-BP Panipenem 172 X Penems Carbapenems CARB 07a
|
||||
360 PAR PAR PM PAR Paromomycin 275 Oligosaccharides OLIGO 27
|
||||
361 PAZ PAZ PZF PZFX Pazufloxacin 457 Quinolones Fluoroquinolone FQ 11b
|
||||
362 PEF PEF PEF Pefloxacin SFM X 52 5ug Quinolones Fluoroquinolone FQ 11b Pefloxacin 18963-9 35828-3 390-5 7040-9 15 16-21 22 1 8 1 8
|
||||
363 PEF PE0 PEF Pefloxacin NEO X 375 10ug Quinolones Fluoroquinolone FQ 11b Pefloxacin 18963-9 35828-3 390-5 7040-9 1 8 1 8
|
||||
364 PEN PEN P PEN PCG Penicillin G CLSI,SFM,DIN,SRGA X X X X X 53 10units X Penicillins Penicillin PEN 01a X Penicillin 18965-4 393-9 392-1 7041-7 394-7 391-3 28 - 29 .125 .25 28 - 29 .125 .25 28 - 29 .125 .25 28 - 29 .125 .25 28 - 29 .125 .25 28 - 29 .125 .25 28 - 29 .125 .25 28 - 29 .125 .25 28 - 29 .125 .25 28 - 29 .125 .25 7 8-28 29 .25 32 12 13-23 24 0.125 2 .25 8 10 11-22 23 1 32 30 31-33 34 .125 .25
|
||||
365 PEN PE1 P PEN PCG Penicillin G EUCAST X X 323 1unit X Penicillins Penicillin PEN 01a X Penicillin 18965-4 393-9 392-1 7041-7 394-7 391-3 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .25 32 0.125 2 .25 8 1 32 24 - 25 .125 .25
|
||||
366 PEN PE5 P PEN PCG Penicillin G NEO X 376 5ug X Penicillins Penicillin PEN 01a X Penicillin 18965-4 393-9 392-1 7041-7 394-7 391-3 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 .125 .25 14 15-27 28 .25 32 0.125 2 .25 8 1 32 .125 .25
|
||||
367 PNV PNV PV PEN Penicillin V CLSI,EUCAST X X X X 81 10ug X Penicillins Penicillin PEN 01a X Penicillin 18966-2 397-0 396-2 7042-5 398-8 395-4 0.125 2 20 21-25 26 1 4 30 31-33 34
|
||||
368 PNO PNO Penicillin/Novobiocin CLSI X 84 10units/30ug Combinations Penicillin/Polypeptide OTHER 28 X Penicillin 35874-7 35872-1 35873-9 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4 14 15-17 18 1 4
|
||||
369 PSU PSU PCG-SBT Penicillin/Sulbactam DIN X 437 10/10 X Beta-lactam+Inhibitors BL+INH 03 20 21-25 26 0.125 2
|
||||
370 PIM PIM PIM Pentisomicin 276 Aminoglycosides AG 09
|
||||
371 PTZ PTZ PTZ Pentizidone 277 Oxazolidinones OXAZOLID 20
|
||||
372 PHE PHE PEPC Phenethicillin 458 X Penicillins Penicillin PEN 01a Phenethici 18967-0 401-0 400-2 402-8 399-6
|
||||
373 PMR PMR PMR Pimaricin (Natamycin) 459 Antifungals FUNG 29
|
||||
374 PPA PPA PI PIM PPA Pipemidic acid DIN,SFM X X 54 20ug Quinolones Quinolone QUIN 11a Pipemidate 18968-8 405-1 404-4 406-9 403-6 13 14-18 19 8 32 16 - 17 4 8 8 16
|
||||
375 PPA PP3 PI PIM PPA Pipemidic acid NEO X 377 30ug Quinolones Quinolone QUIN 11a Pipemidate 18968-8 405-1 404-4 406-9 403-6 8 32 4 8 8 16
|
||||
376 PIP PI7 PIP PIP PIPC Piperacillin SFM,BSAC X X 207 75ug X Penicillins Ureidopenicillin PEN 01c X Piperacill 18969-6 409-3 408-5 7043-3 410-1 407-7 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 11 12-19 20 8 128 4 64 16 128 16 32 23 - 24 16 32
|
||||
377 PIP PIP PIP PIP PIPC Piperacillin CLSI X 55 100ug X Penicillins Ureidopenicillin PEN 01c X Piperacill 18969-6 409-3 408-5 7043-3 410-1 407-7 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 9 10-27 28 8 128 4 64 16 128 16 32 16 32
|
||||
378 PIP PI3 PIP PIP PIPC Piperacillin EUCAST X X X 206 30ug X Penicillins Ureidopenicillin PEN 01c X Piperacill 18969-6 409-3 408-5 7043-3 410-1 407-7 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 14 15-17 18 8 32 8 128 12 13-21 22 4 64 16 128 17 18-20 21 16 32 16 32
|
||||
379 PIS PIS PIS PIPC-SBT Piperacillin/Sulbactam DIN X 278 30/15ug X Beta-lactam+Inhibitors BL+INH 03 13 14-21 22 4 64
|
||||
380 TZP PTA PIT PIPC-TAZ Piperacillin/Tazobactam CLSI X 92 100/10ug X Beta-lactam+Inhibitors BL+INH 03 X Piperacill 18970-4 413-5 412-7 7044-1 414-3 411-9 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 17 18-20 21 16 128 16 128 17 18-20 21 16 128 17 18-20 21 16 128 9 10-27 28 8 128 4 64 16 64 8 32 16 32 16 32
|
||||
381 TZP PT3 PIT PIPC-TAZ Piperacillin/Tazobactam EUCAST X X 204 30/6ug X Beta-lactam+Inhibitors BL+INH 03 X Piperacill 18970-4 413-5 412-7 7044-1 414-3 411-9 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 14 15-17 18 8 32 8 128 4 64 16 64 8 32 17 18-20 21 16 32 16 32
|
||||
382 TZP PT7 PIT PIPC-TAZ Piperacillin/Tazobactam SFM,BSAC X X 205 75/10ug X Beta-lactam+Inhibitors BL+INH 03 X Piperacill 18970-4 413-5 412-7 7044-1 414-3 411-9 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 13 14-20 21 8 128 4 64 16 64 8 32 16 32 23 - 24 16 32
|
||||
383 TZP PT1 PIT PIPC-TAZ Piperacillin/Tazobactam DIN X 279 30/10ug X Beta-lactam+Inhibitors BL+INH 03 X Piperacill 18970-4 413-5 412-7 7044-1 414-3 411-9 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 16 128 8 128 14 15-21 22 4 64 16 64 8 32 16 32 16 32
|
||||
384 PRC PRC PRC Piridicillin 280 X Penicillins ? PEN 01h
|
||||
385 PRL PIL Pirlimycin CLSI X 173 2ug Lincosamides LINCO 15 X Pirlimycin 35831-7 35829-1 35830-9 12 - 13 2 4 12 - 13 2 4 12 - 13 2 4 12 - 13 2 4 12 - 13 2 4 12 - 13 2 4 12 - 13 2 4 12 - 13 2 4 12 - 13 2 4 12 - 13 2 4
|
||||
386 PIR PIA PIR PA Piromidic acid SFM X 281 25ug Quinolones Quinolone QUIN 11a 15 16-19 20 16 64
|
||||
387 PME PME PMPC Pivmecillinam (Amdinocillin pivoxil) 460 X Penicillins Amidinopenicillin PEN 01f
|
||||
388 PLZ PLZ Plazomicin CLSI X 503 Aminoglycosides AG 09 X 73592-8 73637-1 73614-0
|
||||
389 POL POL PB POL PL-B Polymixin B CLSI X 471 300units Lipopeptides Polymyxin LIPOPEP 16 X Polymyxin 18972-0 421-8 420-0 35832-5 422-6 419-2 11 - 12 2 8 11 - 12 2 8 11 - 12 2 8 11 - 12 2 8 11 - 12 2 8 11 - 12 2 8 11 - 12 2 8 11 - 12 2 8 11 - 12 2 8 11 - 12 2 8
|
||||
390 POL POL PB POL PL-B Polymixin B 56 50ug Lipopeptides Polymyxin LIPOPEP 16 X Polymyxin 18972-0 421-8 420-0 35832-5 422-6 419-2 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8
|
||||
391 POS POS Posaconazole CLSI,NEO X 478 5ug Antifungals FUNG 29
|
||||
392 PRX PRX PRE Premafloxacin CLSI X 403 1ug Quinolones Fluoroquinolone FQ 11b X 73591-0 73636-3 73613-2
|
||||
393 PRM PRM PRM Primycin 282 Macrolides MACRO 17
|
||||
394 PRI PR3 PT PRI Pristinamycin NEO X 378 30ug Streptogramins STREPTOG 23 Pristinamy 32383-2 35833-3 35834-1 1 4
|
||||
395 PRI PRI PT Pristinamycin SFM X 93 15ug Streptogramins STREPTOG 23 Pristinamy 32383-2 35833-3 35834-1 18 19-21 22 1 4
|
||||
396 PRP PRP PR PRO Propicillin DIN X 174 X Penicillins Aminopenicillin PEN 01b 0.125 0.25
|
||||
397 PKA PKA PKA Propikacin 283 Aminoglycosides AG 09
|
||||
398 PTH PRT PTH PTH Prothionamide 175 Antimycobacterials MYCO 28
|
||||
399 PRU PRU PUFX Prulifloxacin 461 Quinolones Fluoroquinolone FQ 11b
|
||||
400 PZA PZA PZA PZA Pyrazinamide 135 Antimycobacterials MYCO 28 Pyrazinami 18973-8 425-9 424-2 20461-0 23632-3 426-7 423-4
|
||||
401 QDA QUI QPD QPR/DPR Quinupristin/Dalfopristin CLSI,EUCAST X X X X 176 15ug Streptogramins STREPTOG 23 X Quinuprist 23640-6 35835-8 23641-4 33334-4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 15 16-18 19 1 4 18 19-24 25 .5 4 19 - 20 2 4
|
||||
402 RAC RAC Ractopamine 422 Phenethylamines PHEN 27 X
|
||||
403 RAM RAM Ramoplanin CLSI X 493 Glycopeptides Lipoglycopeptide LIPOGLYC 21a X Ramoplanin 41737-8 41712-1 41710-5 41711-3
|
||||
404 RZM RZM Razupenem CLSI X 489 10ug X Penems Carbapenems CARB 07a X 73590-2 73635-5 73612-4
|
||||
405 RST RST RSM Ribostamycin 462 Aminoglycosides AG 09
|
||||
406 RIB RIB RIB Rifabutin 136 Ansamycins RIF 10 Rifabutin 19149-4 16100-0 20386-9 23630-7
|
||||
407 RIF RI3 RA RAM RFP Rifampin SFM,NEO X X 58 30ug Ansamycins RIF 10 X Rifampin 18974-6 429-1 428-3 7045-8 20385-1 23949-1 430-9 427-5 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 14 15-27 28 13 14-18 19 4 32 1 2 1 2 1 2 .125 .06
|
||||
408 RIF RIF RA RAM RFP Rifampin CLSI,EUCAST X X X X 57 5ug Ansamycins RIF 10 X Rifampin 18974-6 429-1 428-3 7045-8 20385-1 23949-1 430-9 427-5 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 16 17-19 20 1 4 4 32 1 2 25 26 27 1 2 21 22-24 25 1 2 .125 .06
|
||||
409 RIF RI2 RA RAM RFP Rifampin BSAC X 324 2ug Ansamycins RIF 10 X Rifampin 18974-6 429-1 428-3 7045-8 20385-1 23949-1 430-9 427-5 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 4 4 32 1 2 1 2 1 2 29 - 30 .125 .06
|
||||
410 Rifaximin CLSI X 494 Ansamycins RIF 73589-4 73634-8 73611-6
|
||||
411 RIT RIT RIPM Ritipenem 463 X Penems Carbapenems CARB 07a
|
||||
412 RIA RIA RIPM-AC Ritipenem acoxil 464 X Penems Carbapenems CARB 07a
|
||||
413 ROK ROK ROK ROK RKM Rokitamycin 284 Macrolides MACRO 17
|
||||
414 ROS ROS ROS ROS Rosoxacin SFM X 94 5ug Quinolones Quinolone QUIN 11a Rosoxacin 18977-9 441-6 440-8 442-4 439-0 1 2
|
||||
415 RXT RO3 RXT ROX RXM Roxithromicin NEO X 379 30ug Macrolides MACRO 17 Roxithromy 18978-7 445-7 444-0 7046-6 446-5 443-2 12 13-17 18 1 2 1 2
|
||||
416 RXT ROX RXT ROX RXM Roxithromicin SRGA X 77 15ug Macrolides MACRO 17 Roxithromy 18978-7 445-7 444-0 7046-6 446-5 443-2 1 2 19 20-24 25 1 2
|
||||
417 SAL SAL Salinomycin 423 Combinations Coccidiostat/Ionophore OTHER 28 Salinomyci 35838-2 35836-6 35837-4
|
||||
418 SAR SAR SAR Sarafloxacin CLSI X 285 5ug Quinolones Fluoroquinolone FQ 11b X 73588-6 73633-0 73610-8
|
||||
419 SRX SRX SRX Sarmoxicillin 286 X Penicillins Aminopenicillin PEN 01b
|
||||
420 SIS SIS SIS SIS SISO Sisomicin SFM X 78 10ug Aminoglycosides AG 09 Sisomicin 18979-5 449-9 448-1 450-7 447-3 13 14-15 16 4 16
|
||||
421 SIT SIT SIT STFX Sitafloxacin 465 Quinolones Fluoroquinolone FQ 11b
|
||||
422 SOL SOL Solithromycin CLSI X 504 Macrolides Fluoroketolide MACRO 17c X 73587-8 73632-2 73609-0
|
||||
423 SPX SP2 SPF SPFX Sparfloxacin BSAC 325 2ug Quinolones Fluoroquinolone FQ 11b X Sparfloxac 23628-1 35839-0 20397-6 7047-4 23610-9 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 1 4 1 4
|
||||
424 SPX SPA SPF SPFX Sparfloxacin CLSI,SFM,DIN X X X 110 5ug Quinolones Fluoroquinolone FQ 11b X Sparfloxac 23628-1 35839-0 20397-6 7047-4 23610-9 15 16-18 19 .5 2 15 16-18 19 .5 2 15 16-18 19 .5 2 15 16-18 19 .5 2 15 16-18 19 .5 2 15 16-18 19 .5 2 15 16-18 19 .5 2 15 16-18 19 .5 2 15 16-18 19 .5 2 15 16-18 19 .5 2 15 16-19 20 1 4 18 19-22 23 1 4
|
||||
425 SPX SP1 SPF SPFX Sparfloxacin NEO X 380 10ug Quinolones Fluoroquinolone FQ 11b Sparfloxac 23628-1 35839-0 20397-6 7047-4 23610-9 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 .5 2 1 4 1 4
|
||||
426 SPT SP0 SPT SPT SPCM Spectinomycin NEO X 381 200ug Aminocyclitols AMINOC 08 X Spectinomy 18980-3 453-1 452-3 35840-8 454-9 451-5 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 64 128 8 16 64 128
|
||||
427 SPT SPE SPT SPT SPCM Spectinomycin CLSI,EUCAST X X X 59 100ug Aminocyclitols AMINOC 08 X Spectinomy 18980-3 453-1 452-3 35840-8 454-9 451-5 14 15-17 18 32 128 14 15-17 18 32 128 19 - 20 64 128 8 16 64 128
|
||||
428 SPT SP5 SPT SPCM Spectinomycin X 424 25ug Aminocyclitols AMINOC 08 X Spectinomy 18980-3 453-1 452-3 35840-8 454-9 451-5 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 32 128 64 128 8 16 13 - 14 64 128
|
||||
429 SPI SPI SP SPM SPM Spiramycin SFM X 95 100ug Macrolides MACRO 17 Spiramycin 18981-1 457-2 456-4 458-0 455-6 18 19-23 24 1 8
|
||||
430 SPI SM2 SP SPM SPM Spiramycin NEO X 382 200ug Macrolides 16-Membered ring MACRO 17 Spiramycin 18981-1 457-2 456-4 458-0 455-6 1 8
|
||||
431 STR STR S STR SM Streptomycin CLSI,SFM,BSAC X X X 60 10ug Aminoglycosides AG 09 X Streptomyc 18982-9 461-4 460-6 7048-2 20462-8 23626-5 462-2 459-8 11 12-14 15 11 12-14 15 11 12-14 15 11 12-14 15 11 12-14 15 11 12-14 15 11 12-14 15 11 12-14 15 11 12-14 15 11 12-14 15 12 13-14 15 8 32 4 32 12 - 13 8 16
|
||||
432 STR ST1 S STR SM Streptomycin NEO X 383 100ug Aminoglycosides AG 09 X Streptomyc 18982-9 461-4 460-6 7048-2 20462-8 23626-5 462-2 459-8 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 14 15-27 28 8 32 4 32 8 16
|
||||
433 STH STH Streptomycin-High CLSI X 139 300ug Aminoglycosides AG 09 X Streptomyc 18983-7 7049-0 6933-6 35841-6 6 7-9 10 1024 1025 6 7-9 10 1024 1025 6 7-9 10 1024 1025 6 7-9 10 1024 1025 6 7-9 10 1024 1025 6 7-9 10 1024 1025 6 7-9 10 1024 1025 6 7-9 10 1024 1025 6 7-9 10 1024 1025 6 7-9 10 1024 1025 250 501 500 1000
|
||||
434 STH ST5 Streptomycin-High SFM,NEO X X 208 500ug Aminoglycosides AG 09 X Streptomyc 18983-7 7049-0 6933-6 35841-6 1000 1001 1000 1001 1000 1001 1000 1001 1000 1001 1000 1001 1000 1001 1000 1001 1000 1001 1000 1001 11 12-13 14 250 501 500 1000
|
||||
435 SUL SBM SUL SBT Sulbactam CLSI,SFM X X 397 X Beta-lactamase inhibitors BL-INH 02 Sulbactam 41739-4 41716-2 41718-8 41717-0 8 -
|
||||
436 SBC SLB SBC SBPC Sulbenicillin 125 X Penicillins Sulfonopenicillin PEN 01g
|
||||
437 SUC SUC SUC Sulconazole 287 Antifungals FUNG 29
|
||||
438 SUP SUP Sulfachlorpyridazine 288 Folate pathway inhibitors FOLATE 12a
|
||||
439 SDI SDI SLD Sulfadiazine 425 Folate pathway inhibitors FOLATE 12a Sulfadiazi 18984-5 465-5 464-8 7050-8 466-3 463-0
|
||||
440 SUD SUD X Sulfadimethoxine 289 Folate pathway inhibitors FOLATE 12a
|
||||
441 SDM SDM SDM Sulfadimidine AFA X 290 250ug Folate pathway inhibitors FOLATE 12a 12 13-25 26 16 256
|
||||
442 SZO SZO SZO Sulfamazone 291 Folate pathway inhibitors FOLATE 12a
|
||||
443 SUM SUM Sulfamethazine 292 Folate pathway inhibitors FOLATE 12a
|
||||
444 SMX SMX SMX SOZ Sulfamethoxazole CLSI,SFM X X 427 200-300ug Folate pathway inhibitors FOLATE 12a X Sulfametho 18985-2 469-7 468-9 11577-4 470-5 467-1 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 14 15-27 28 11 12-16 17 64 512 32 128 32 64
|
||||
445 SMX SMX SMX SOZ Sulfamethoxazole X 293 100ug Folate pathway inhibitors FOLATE 12a X Sulfametho 18985-2 469-7 468-9 11577-4 470-5 467-1 256 512 256 512 256 512 256 512 256 512 256 512 256 512 256 512 256 512 256 512 64 512 32 128 13 - 14 32 64
|
||||
446 SNA SNA SNA Sulfasuccinamide 294 Folate pathway inhibitors FOLATE 12a
|
||||
447 SUT SUT ST Sulfathiazole 295 Folate pathway inhibitors FOLATE 12a
|
||||
448 SOX SOX Sulfisoxazole CLSI X 404 200-300ug Folate pathway inhibitors FOLATE 12a X Sulfisoxaz 18986-0 473-9 472-1 11578-2 474-7 471-3 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 64 512
|
||||
449 SSS SUL SSS SSS Sulfonamides CLSI,SFM X X 61 200-300ug Folate pathway inhibitors FOLATE 12a X Sulfonamid 18987-8 477-0 476-2 35842-4 478-8 475-4 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 12 13-16 17 256 512 14 15-27 28 11 12-16 17 64 512 32 128 32 64
|
||||
450 SLP SLP Sulopenem CLSI X 484 X Penems Penem PENEM 07b X Sulopenem 55289-3 55291-9 55290-1
|
||||
451 TAL TAL TAPC Talampicillin 466 X Penicillins Aminopenicillin PEN 01b Talampicil 18988-6 481-2 480-4 482-0 479-6
|
||||
452 TLP TLP TLP Talmetoprim 296 Folate pathway inhibitors FOLATE 12a
|
||||
453 TAZ TAZ TAB TAZ Tazobactam CLSI X 297 X Beta-lactamase inhibitors BL-INH 02 Tazobactam 41740-2 41719-6 41721-2 41720-4
|
||||
454 TZD TED Tedizolid CLSI,EUCAST X X 505 Oxazolidinones OXAZOLID 20 73586-0 73631-4 73608-2
|
||||
455 TEC TE6 TEC TPL TEIC Teicoplanin NEO X 384 60ug Glycopeptides Lipoglycopeptide GLYCO 21b X Teicoplani 18989-4 485-3 484-6 7051-6 486-1 483-8 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 8 32 12 13-21 22 4 32 2 8 4 16 4 8 4 8
|
||||
456 TEC TEI TEC TPL TEIC Teicoplanin CLSI,EUCAST X X X X X 79 30ug Glycopeptides Lipoglycopeptide GLYCO 21b X Teicoplani 18989-4 485-3 484-6 7051-6 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 - - 17 4 16 2 8 14 15 16 4 16 11 12-15 16 4 8 14 - 15 4 8
|
||||
457 TCM TCM TEIC Teicoplanin-Macromethod 440 Glycopeptides Lipoglycopeptide GLYCO 21b
|
||||
458 TLV TLV Telavancin CLSI X 472 30ug Glycopeptides Lipoglycopeptide GLYCO 21b X 72894-9 73630-6 72894-9
|
||||
459 TLT TLT TEL TEL Telithromycin CLSI,EUCAST X X X 396 15ug Macrolides Ketolide MACRO 17b X Telithromy 35845-7 35843-2 35844-0 41722-0 18 19-21 22 1 4 18 19-21 22 1 4 18 19-21 22 1 4 18 19-21 22 1 4 18 19-21 22 1 4 18 19-21 22 1 4 18 19-21 22 1 4 18 19-21 22 1 4 18 19-21 22 1 4 18 19-21 22 1 4 16 17-20 21 .5 4
|
||||
460 TMX TEM TMX TEM Temafloxacin CLSI X 111 5ug Quinolones Fluoroquinolone FQ 11b X Temafloxac 18990-2 489-5 488-7 490-3 487-9
|
||||
461 TEM TEL TEM TMO Temocillin NEO X 298 30ug X Penicillins Penicillin (Stable) PEN-S 01e Temocillin 18991-0 493-7 492-9 494-5 491-1
|
||||
462 TRB TRB Terbinafine 479 Antifungals FUNG 29
|
||||
463 TRC TRC Terconazole 480 Antifungals FUNG 29
|
||||
464 TCY TET TE TET TC Tetracycline CLSI,EUCAST X X X X X X X 62 30ug Tetracyclines TETRA 24a X Tetracycli 18993-6 497-8 496-0 7052-4 498-6 495-2 11 12-14 15 4 16 11 12-14 15 4 16 11 12-14 15 4 16 11 12-14 15 4 16 11 12-14 15 4 16 11 12-14 15 4 16 11 12-14 15 4 16 11 12-14 15 4 16 11 12-14 15 4 16 11 12-14 15 4 16 16 17-18 19 4 16 16 17-21 22 1 8 1 8 19 20-24 25 1 4 21 22-24 25 2 4 33 - 34 1 2
|
||||
465 TCY TE8 TE TET TC Tetracycline NEO X 399 80ug Tetracyclines TETRA 24 X Tetracycli 18993-6 497-8 496-0 7052-4 498-6 495-2 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 14 15-27 28 4 16 1 8 1 8 1 4 2 4 1 2
|
||||
466 TCY TE1 TE TET TC Tetracycline BSAC,NEO X X 326 10ug Tetracyclines TETRA 24 X Tetracycli 18993-6 497-8 496-0 7052-4 498-6 495-2 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 1 8 1 8 1 4 2 4 1 2
|
||||
467 TET TEP TET TTP Tetroxoprim 299 Folate pathway inhibitors FOLATE 12a
|
||||
468 THA THA Thiacetazone 177 Antimycobacterials MYCO 28 Thiacetazo 32384-0
|
||||
469 THI THI TP TPH TP Thiamphenicol 120 30ug Phenicols PHEN 22 Thiampheni 41723-8 41725-3 41724-6
|
||||
470 THI TH6 TP TPH TP Thiamphenicol NEO X 385 60ug Phenicols PHEN 22 Thiampheni 41723-8 41725-3 41724-6
|
||||
471 TIA TIA TIA Tiamulin CLSI,NEO X X 178 30ug Pleuromutilins OTHER 28 X Tiamulin 35848-1 35846-5 35847-3 8 - 9 16 32 8 - 9 16 32 8 - 9 16 32 8 - 9 16 32 8 - 9 16 32 8 - 9 16 32 8 - 9 16 32 8 - 9 16 32 8 - 9 16 32 8 - 9 16 32
|
||||
472 TIC TIC TIC TIC Ticarcillin CLSI,EUCAST X X X 63 75ug X Penicillins Carboxypenicillin PEN 01d X Ticarcilli 18994-4 501-7 500-9 7053-2 502-5 499-4 14 15-19 20 16 128 14 15-19 20 16 128 21 22 23 8 32 9 10-27 28 17 18-21 22 16 128 16 128
|
||||
473 TCC TIM TCC TCC Ticarcillin/Clavulanic acid CLSI,EUCAST X X X X X 64 75/10-15ug X Beta-lactam+Inhibitors BL+INH 03 X Ticarcilli 18995-1 505-8 504-1 7054-0 506-6 503-3 14 15-19 20 16 128 14 15-19 20 16 128 14 15-19 20 16 128 14 15-19 20 16 128 14 15-19 20 16 128 14 15-19 20 16 128 14 15-19 20 16 128 14 15-19 20 16 128 14 15-19 20 16 128 14 15-19 20 16 128 8 32 9 10-27 28 17 18-21 22 16 128 15 16-19 20 16 128 20 - 21 16 32
|
||||
474 TGC TGC TGC Tigecycline CLSI,EUCAST X X 473 15ug Tetracyclines Glycylglycine TETRA 24b X Tigecyclin 42357-4 42356-6 42355-8 42354-1 14 15-17 18 1 4 21 - 22 .25 1
|
||||
475 TBQ TBQ TBQ Tilbroquinol 300 Quinolones Quinolone QUIN 11a
|
||||
476 TIL TIL Tilmicosin CLSI X 179 15ug Macrolides 16-Membered ring MACRO 17a X Tilmicosin 35851-5 35849-9 35850-7 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32 10 11-13 14 8 32
|
||||
477 TIN TIN TNZ Tinidazole CLSI X 180 4ug Nitroimidazoles IMIDAZ 29 Tinidazole 54928-7 55721-5 55720-7 55722-3
|
||||
478 TIN TI1 TNZ Tinidazole CLSI,NEO X 386 16ug Nitroimidazoles IMIDAZ 29 Tinidazole 54928-7 55721-5 55720-7 55722-3
|
||||
479 TDC TDC TDC Tiodonium chloride 301 Thiophenes THIO 27
|
||||
480 TXC TXC TXC Tioxacin 302 Quinolones Quinolone QUIN 11a
|
||||
481 TIZ TIZ Tizoxanide CLSI X 495 Thiazolides THIAZ 30 73585-2 73629-8 73607-4
|
||||
482 TOB TO3 TM TOB TOB Tobramycin AFA,SRGA X X 209 30ug Aminoglycosides AG 09 X Tobramycin 18996-9 509-0 508-2 7055-7 25800-4 510-8 507-4 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 1 8 1 8 18 19-22 23 2 8 17 18-20 21 2 4 1 2
|
||||
483 TOB TO4 TM TOB TOB Tobramycin NEO X 387 40ug Aminoglycosides AG 09 X Tobramycin 18996-9 509-0 508-2 7055-7 25800-4 510-8 507-4 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 4 16 14 15-25 26 4 16 1 8 1 8 2 8 2 4 1 2
|
||||
484 TOB TOB TM TOB TOB Tobramycin CLSI,EUCAST X X X X X 65 10ug Aminoglycosides AG 09 X Tobramycin 18996-9 509-0 508-2 7055-7 25800-4 510-8 507-4 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 12 13-14 15 4 16 11 12-14 15 2 8 14 15-16 17 8 32 15 16-18 19 1 8 1 8 2 8 2 4 17 - 18 1 2
|
||||
485 TFX TFX TFX TOS TFLX Tosufloxacin 303 Quinolones Fluoroquinolone FQ 11b
|
||||
486 TMP TM2 TRP Trimethoprim X 426 2.5ug Folate pathway inhibitors FOLATE 12a X Trimethopr 18997-7 513-2 512-4 7056-5 23614-1 514-0 511-6 8 16 8 16 8 16 8 16 8 16 8 16 8 16 8 16 8 16 8 16 4 16 1 4 2 8 2 8 14 15-19 20 .5 4
|
||||
487 TMP TMP TMP TRP Trimethoprim CLSI,EUCAST X X X X X X 66 5ug Folate pathway inhibitors FOLATE 12a X Trimethopr 18997-7 513-2 512-4 7056-5 23614-1 514-0 511-6 10 11-15 16 8 16 10 11-15 16 8 16 10 11-15 16 8 16 10 11-15 16 8 16 10 11-15 16 8 16 10 11-15 16 8 16 10 11-15 16 8 16 10 11-15 16 8 16 10 11-15 16 8 16 10 11-15 16 8 16 14 15-17 18 2 8 11 12-15 16 4 16 1 4 16 17-20 21 2 8 13 14-16 17 2 8 .5 4
|
||||
488 TMP TM5 TMP TRP Trimethoprim NEO X 388 5.2ug Folate pathway inhibitors FOLATE 12a X Trimethopr 18997-7 513-2 512-4 7056-5 23614-1 514-0 511-6 8 16 8 16 8 16 8 16 8 16 8 16 8 16 8 16 8 16 8 16 12 13-21 22 4 16 1 4 2 8 2 8 .5 4
|
||||
489 SXT SXT SXT SXT ST Trimethoprim/Sulfamethoxazole CLSI,EUCAST X X X X X X X 67 1.25/23.75ug Folate pathway inhibitors FOLATE 12a X Trimethopr 18998-5 517-3 516-5 7057-3 20387-7 23631-5 518-1 515-7 10 11-15 16 2 4 10 11-15 16 2 4 10 11-15 16 2 4 10 11-15 16 2 4 10 11-15 16 2 4 10 11-15 16 2 4 10 11-15 16 2 4 10 11-15 16 2 4 10 11-15 16 2 4 10 11-15 16 2 4 12 13-15 16 2 8 9 10-15 16 2 16 10 11-15 16 16 128 1 4 13 14-25 26 2 8 13 14-16 17 16 64 15 - 16 32 64
|
||||
490 SXT SX5 SXT SXT ST Trimethoprim/Sulfamethoxazole NEO X 389 5.2/240ug Folate pathway inhibitors FOLATE 12a X Trimethopr 18998-5 517-3 516-5 7057-3 20387-7 23631-5 518-1 515-7 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 14 15-27 28 2 16 16 128 1 4 2 8 16 64 32 64
|
||||
491 TRL TRL Troleandomycin 181 Macrolides MACRO 17 Troleandom 18999-3 521-5 520-7 522-3 519-9
|
||||
492 TRO TRO TRS Trospectomycin CLSI X 112 30ug Aminocyclitols AMINOC 08 X Trospectin 35854-9 35852-3 35853-1
|
||||
493 TVA TRV TRO Trovafloxacin CLSI,SFM X X 182 10ug Quinolones Fluoroquinolone FQ 11b X Trovafloxa 23642-2 35855-6 23643-0 7058-1 16 17-19 20 1 4 1 4 .25 2
|
||||
494 TVA TRV TRO Trovafloxacin DIN X 438 5ug Quinolones Fluoroquinolone FQ 11b X Trovafloxa 23642-2 35855-6 23643-0 7058-1 16 17-19 20 1 4
|
||||
495 TYL TYL TI TLS Tylosin NEO X 304 150ug Macrolides 16-Membered ring MACRO 17 X Tylosin 35858-0 35856-4 35857-2
|
||||
496 PRU PRU Ulifloxacin (Prulifloxacin) 490 5ug Quinolones Fluoroquinolone FQ 11b
|
||||
497 VAN VA7 VA VAN VCM Vancomycin NEO X 390 70ug Glycopeptides Glycopeptide GLYCO 21a X Vancomycin 19000-9 525-6 524-9 7059-9 23615-8 526-4 523-1 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 12 13-21 22 4 32 4 16 4 16 4 16 4 8 4 8
|
||||
498 VAN VAN VA VAN VCM Vancomycin CLSI,AFA,SFM X X X 68 30ug Glycopeptides Glycopeptide GLYCO 21a X Vancomycin 19000-9 525-6 524-9 7059-9 23615-8 526-4 523-1 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 - - 17 4 16 4 16 4 16 16 17-19 20 4 16 4 8 4 8
|
||||
499 VAN VA5 VA VAN VCM Vancomycin EUCAST,NEO X X X X 305 5ug Glycopeptides Glycopeptide GLYCO 21a X Vancomycin 19000-9 525-6 524-9 7059-9 23615-8 526-4 523-1 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 4 32 15 - 16 4 32 4 16 4 16 4 16 9 10-10 11 4 8 11 - 12 4 8
|
||||
500 VAM VAM VCM Vancomycin-Macromethod 436 Glycopeptides Glycopeptide GLYCO 21a
|
||||
501 VIO VIO VIO Viomycin 183 Antimycobacterials MYCO 28 Viomycin 19001-7 529-8 528-0 23616-6 530-6 527-2
|
||||
502 VIR VI3 VG VIR Virginiamycine NEO X 391 30ug Streptogramins STREPTOG 23 Virginiamy 35861-4 35859-8 35860-6
|
||||
503 VIR VIR VG VIR Virginiamycine SFM X 184 15ug Streptogramins STREPTOG 23 Virginiamy 35861-4 35859-8 35860-6
|
||||
504 VOR VOR VRCZ Voriconazole CLSI,NEO X 431 1ug Antifungals FUNG 29 X Voriconazo 32379-0 41200-7 35863-0 35862-2 41199-1
|
||||
505 AZA AZA Aztreonam/Avibactam CLSI X 510 30/20ug Beta-lactam+inhibitors BL+INH
|
||||
506 POP POP Polymyxin B/Polysorbate 80 CLSI X 509 300units Lipopeptides Polymyxin LIPOPEP 16 X
|
||||
507 SUR SUR Surotomycin CLSI X 514 Lipopeptides LIPOPEP
|
||||
508 COP COP Colistin/Polysorbate CLSI X 508 10ug Lipopeptides LIPOPEP 16 X
|
||||
509 ERV ERV Eravacycline CLSI X 513 20ug Fluorocyclines OTHER 28
|
||||
510 DLM DLM Delamanid X 512
|
||||
511 BDQ BDQ Bedaquiline X 511
|
||||
512 FOV FOV Cefovecin CLSI X 515 Cephems Cephalosporin III CEPH3 04c X
|
||||
513 GAM GAM Gamithromycin CLSI X 516 Macrolides 15-Membered ring MACRO X
|
||||
514 KAC KAC Kanamycin/Cephalexin CLSI X 517 Combinations Aminoglycoside/Cephem OTHER 28 X
|
||||
515 TIP TIP Tildipirosin CLSI X 519 Macrolides 16-Membered ring MACRO X
|
||||
516 PRA PRA Pradofloxacin CLSI X 518 Quinolones Fluoroquinolone FQ 11b X
|
||||
517 TUL TUL Tulathromycin CLSI X 520 Macrolides 15-Membered ring MACRO X 14 15-17 18 16 64 14 15-17 18 16 64 14 15-17 18 16 64 14 15-17 18 16 64 14 15-17 18 16 64
|
||||
518 Tylvalosin CLSI X 521 Macrolides 16-Membered ring MACRO X
|
||||
519 AKF AKF Amikacin/Fosfomycin CLSI X 522 Combinations Aminoglycoside/Fosfomycin OTHER 28
|
||||
520 CDZ CDZ Cadazolid CLSI X 523 Quinolonyl oxazolidinones OTHER 28
|
||||
521 FPT FPT Cefepime/Tazobactam CLSI X 524 Beta-lactam+Inhibitors BL+INH 03c
|
||||
522 DFX DFX Delafloxacin CLSI X 525 5ug Quinolones Quinolone QUIN 11a
|
||||
523 GEP GEP Gepotidacin CLSI X 526 10ug Triazaacenaphylenes OTHER 28
|
||||
524 IMR IMR Imipenem/relebactam CLSI X 527 Beta-lactam+Inhibitors BL+INH 03c
|
||||
525 LMU LMU Lefamulin CLSI X 528 20ug Pleuromutilins OTHER 28
|
||||
526 LND LND Levonadifloxacin CLSI X 529 10ug Quinolones Benzoquinolizine BQ 11c
|
||||
527 SEC SEC Secnidazole CLSI X 530 Nitroimidazoles IMIDAZ
|
||||
528 ISV ISV Isavuconazole EUCAST X 531 Antifungals FUNG
|
||||
529 MUP MU2 MUP MUP Mupirocin EUCAST X 532 200ug Pseudomonic acids PSEUDOM 27 X Mupirocin 20389-3 35822-6 35823-4 7033-4
|
||||
530 MEV MEV Meropenem/Vaborbactam CLSI X 533 20/10ug Beta-lactam+Inhibitors 03c X 14 15-17 18 4 16
|
||||
531 ZWK ZWK Nafithromycin CLSI X 534 15ug Macrolides Ketolide MACRO 17 X
|
||||
532 PEX PEX Pexiganan CLSI X 535 Peptsides Magainin PEPTIDE X
|
||||
533 Retapamulin CLSI X 538 Pleuromutilins
|
||||
534 Rifapentine CLSI X 539 Ansamycins
|
||||
535 FDC FDC Cefiderocol CLSI X 537 Cephems Siderophore 4 16
|
||||
536 FPZ FPZ Cefepime/Zidebactam CLSI X 536
|
||||
537 ZID ZID Zidebactam CLSI 540 X
|
||||
538 RID RID Ridinilazole CLSI 541 X
|
||||
539 TBP TBP Tebipenem CLSI X 10ug Penems Carbapenems X
|
||||
540 MNC MNC Meropenem/Nacubactam CLSI X Beta-lactam+Inhibitors
|
||||
541 NAC NAC Nacubactam CLSI X Beta-lactamase inhibitors
|
||||
542 TYL TYL Tylosin EUCAST 304 30ug Macrolides 16-Membered ring 17
|
||||
543 ITR ITR Itraconazole NEO X 133 10ug Antifungals FUNG 29 X
|
||||
544 CZA CZA Ceftazidime/Avibactam EUCAST 498 10/4ug Beta-lactam+Inhibitors 03 X 20 21 8 16
|
||||
545 BPR BPR Ceftobiprole EUCAST 474 5ug Cephems Cephalosporin 04e X
|
||||
546 AMX AMX Amoxicillin SFM 82 20ug Penicillins Aminopenicillin 01b X
|
||||
Binary file not shown.
Binary file not shown.
-92370
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
fa68ab044001078f290218a7de6cc5c4
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,511 +0,0 @@
|
||||
"ab" "atc" "cid" "name" "group" "atc_group1" "atc_group2" "abbreviations" "synonyms" "oral_ddd" "oral_units" "iv_ddd" "iv_units" "loinc"
|
||||
"AMA" "J04AA01" 4649 "4-aminosalicylic acid" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Aminosalicylic acid and derivatives" "" "c(\"aminopar\", \"aminosalicylic\", \"aminosalicylic acid\", \"aminosalyl\", \"aminox\", \"apacil\", \"deapasil\", \"entepas\", \"ferrosan\", \"gabbropas\", \"helipidyl\", \"hellipidyl\", \"neopasalate\", \"osacyl\", \"pamacyl\", \"pamisyl\", \"paramycin\", \"parasal\", \"parasalicil\", \"parasalindon\", \"pasalon\", \"pasara\", \"pascorbic\", \"pasdium\", \"paser granules\", \"paskalium\", \"pasmed\", \"pasnodia\", \"pasolac\", \"propasa\", \"rezipas\", \"teebacin\", \"wln: zr cq dvq\")" 12 "g" "character(0)"
|
||||
"FCT" "D01AE21" 3366 "5-fluorocytosine" "Antifungals/antimycotics" "Antifungals for topical use" "Other antifungals for topical use" "c(\"5flc\", \"fluo\")" "c(\"alcobon\", \"ancobon\", \"ancotil\", \"ancotyl\", \"flucitosina\", \"flucystine\", \"flucytosin\", \"flucytosine\", \"flucytosinum\", \"flucytosone\", \"fluocytosine\", \"fluorcytosine\")" "c(\"10974-4\", \"23805-5\", \"25142-1\", \"25143-9\", \"3639-2\", \"46218-4\")"
|
||||
"ACM" 6450012 "Acetylmidecamycin" "Macrolides/lincosamides" "" "" ""
|
||||
"ASP" 49787020 "Acetylspiramycin" "Macrolides/lincosamides" "" "c(\"acetylspiramycin\", \"foromacidin b\", \"spiramycin ii\")" "character(0)"
|
||||
"ALS" "J04BA03" 8954 "Aldesulfone sodium" "Other antibacterials" "Drugs for treatment of lepra" "Drugs for treatment of lepra" "" "c(\"adesulfone sodium\", \"aldapsone\", \"aldesulfona sodica\", \"aldesulfone\", \"aldesulfone sodique\", \"aldesulfone sodium\", \"diamidin\", \"diasone\", \"diasone sodium\", \"diazon\", \"novotrone\", \"sodium aldesulphone\", \"sodium sulfoxone\", \"sulfoxone sodium\")" 0.33 "g" "character(0)"
|
||||
"AMK" "J01GB06" 37768 "Amikacin" "Aminoglycosides" "Aminoglycoside antibacterials" "Other aminoglycosides" "c(\"ak\", \"ami\", \"amik\", \"amk\", \"an\")" "c(\"amicacin\", \"amikacillin\", \"amikacin\", \"amikacin base\", \"amikacin dihydrate\", \"amikacin sulfate\", \"amikacina\", \"amikacine\", \"amikacinum\", \"amikavet\", \"amikin\", \"amiklin\", \"amikozit\", \"amukin\", \"arikace\", \"briclin\", \"lukadin\", \"mikavir\", \"pierami\", \"potentox\")" 1 "g" "c(\"13546-7\", \"15098-7\", \"17798-0\", \"31097-9\", \"31098-7\", \"31099-5\", \"3319-1\", \"3320-9\", \"3321-7\", \"35669-1\", \"50802-8\", \"50803-6\", \"56628-1\", \"59378-0\", \"80972-3\")"
|
||||
"AKF" "Amikacin/fosfomycin" "Aminoglycosides" "" "" ""
|
||||
"AMX" "J01CA04" 33613 "Amoxicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "c(\"ac\", \"amox\", \"amx\")" "c(\"actimoxi\", \"amoclen\", \"amolin\", \"amopen\", \"amopenixin\", \"amoxibiotic\", \"amoxicaps\", \"amoxicilina\", \"amoxicillin\", \"amoxicilline\", \"amoxicillinum\", \"amoxiden\", \"amoxil\", \"amoxivet\", \"amoxy\", \"amoxycillin\", \"anemolin\", \"aspenil\", \"biomox\", \"bristamox\", \"cemoxin\", \"clamoxyl\", \"delacillin\", \"dispermox\", \"efpenix\", \"flemoxin\", \"hiconcil\", \"histocillin\", \"hydroxyampicillin\", \"ibiamox\", \"imacillin\", \"lamoxy\", \"metafarma capsules\", \"metifarma capsules\", \"moxacin\", \"moxatag\", \"ospamox\", \"pamoxicillin\",
|
||||
\"piramox\", \"robamox\", \"sawamox pm\", \"tolodina\", \"unicillin\", \"utimox\", \"vetramox\")" 1.5 "g" 3 "g" "c(\"16365-9\", \"25274-2\", \"3344-9\", \"80133-2\")"
|
||||
"AMC" "J01CR02" 23665637 "Amoxicillin/clavulanic acid" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "c(\"a/c\", \"amcl\", \"aml\", \"aug\", \"xl\")" "c(\"amocla\", \"amoclan\", \"amoclav\", \"amoxsiklav\", \"augmentan\", \"augmentin\", \"augmentin xr\", \"augmentine\", \"auspilic\", \"clamentin\", \"clamobit\", \"clavamox\", \"clavinex\", \"clavoxilin plus\", \"clavulin\", \"clavumox\", \"coamoxiclav\", \"eumetinex\", \"kmoxilin\", \"spectramox\", \"spektramox\", \"viaclav\", \"xiclav\")" 1.5 "g" 3 "g" "character(0)"
|
||||
"AXS" 465441 "Amoxicillin/sulbactam" "Beta-lactams/penicillins" "" "" ""
|
||||
"AMB" "J02AA01" 5280965 "Amphotericin B" "Antifungals/antimycotics" "Antimycotics for systemic use" "Antibiotics" "c(\"amfb\", \"amph\")" "c(\"abelcet\", \"abelecet\", \"ambisome\", \"amfotericina b\", \"amphocin\", \"amphomoronal\", \"amphortericin b\", \"amphotec\", \"amphotericin\", \"amphotericin b\", \"amphotericine b\", \"amphotericinum b\", \"amphozone\", \"anfotericine b\", \"fungilin\", \"fungisome\", \"fungisone\", \"fungizone\", \"halizon\")" 35 "mg" "c(\"16370-9\", \"3353-0\", \"3354-8\", \"40707-2\", \"40757-7\", \"49859-2\")"
|
||||
"AMH" "Amphotericin B-high" "Aminoglycosides" "c(\"amfo b high\", \"amhl\", \"ampho b high\", \"amphotericin high\")" "" ""
|
||||
"AMP" "J01CA01" 6249 "Ampicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "c(\"am\", \"amp\", \"ampi\")" "c(\"acillin\", \"adobacillin\", \"amblosin\", \"amcill\", \"amfipen\", \"amfipen v\", \"amipenix s\", \"ampichel\", \"ampicil\", \"ampicilina\", \"ampicillin\", \"ampicillin a\", \"ampicillin acid\", \"ampicillin anhydrate\", \"ampicillin anhydrous\", \"ampicillin base\", \"ampicillin sodium\", \"ampicillina\", \"ampicilline\", \"ampicillinum\", \"ampicin\", \"ampifarm\", \"ampikel\", \"ampimed\", \"ampipenin\", \"ampiscel\", \"ampisyn\", \"ampivax\", \"ampivet\", \"amplacilina\", \"amplin\", \"amplipenyl\", \"amplisom\", \"amplital\", \"anhydrous ampicillin\", \"austrapen\",
|
||||
\"binotal\", \"bonapicillin\", \"britacil\", \"campicillin\", \"copharcilin\", \"delcillin\", \"deripen\", \"divercillin\", \"doktacillin\", \"duphacillin\", \"grampenil\", \"guicitrina\", \"guicitrine\", \"lifeampil\", \"marcillin\", \"morepen\", \"norobrittin\", \"nuvapen\", \"olin kid\", \"omnipen\", \"orbicilina\", \"pen a oral\", \"pen ampil\", \"penbristol\", \"penbritin\", \"penbritin paediatric\", \"penbritin syrup\", \"penbrock\", \"penicline\", \"penimic\", \"pensyn\", \"pentrex\", \"pentrexl\", \"pentrexyl\", \"pentritin\", \"pfizerpen a\", \"polycillin\", \"polyflex\",
|
||||
\"ponecil\", \"princillin\", \"principen\", \"qidamp\", \"racenacillin\", \"rosampline\", \"roscillin\", \"semicillin\", \"semicillin r\", \"servicillin\", \"sumipanto\", \"synpenin\", \"texcillin\", \"tokiocillin\", \"tolomol\", \"totacillin\", \"totalciclina\", \"totapen\", \"trifacilina\", \"ukapen\", \"ultrabion\", \"ultrabron\", \"vampen\", \"viccillin\", \"viccillin s\", \"vidocillin\", \"wypicil\")" 2 "g" 6 "g" "c(\"21066-6\", \"3355-5\", \"33562-0\", \"33919-2\", \"43883-8\", \"43884-6\", \"87604-5\")"
|
||||
"SAM" "J01CR01" 119561 "Ampicillin/sulbactam" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "c(\"a/s\", \"ab\", \"ams\", \"amsu\", \"apsu\", \"sam\")" "" 6 "g" ""
|
||||
"AMR" 73341 "Amprolium" "Other antibacterials" "" "c(\"amprocidum\", \"amprolio\", \"amprolium\", \"amprovine\")" "character(0)"
|
||||
"ANI" "J02AX06" 166548 "Anidulafungin" "Antifungals/antimycotics" "Antimycotics for systemic use" "Other antimycotics for systemic use" "anid" "c(\"anidulafungin\", \"anidulafungina\", \"anidulafungine\", \"anidulafunginum\", \"ecalta\", \"eraxis\")" 0.1 "g" "58420-1"
|
||||
"APL" 6602341 "Apalcillin" "Beta-lactams/penicillins" "" "c(\"apalcilina\", \"apalcillin\", \"apalcilline\", \"apalcillinum\")" "character(0)"
|
||||
"APR" 3081545 "Apramycin" "Aminoglycosides" "" "c(\"ambylan\", \"apralan\", \"apramicina\", \"apramycin\", \"apramycine\", \"apramycinum\", \"nebramycin ii\")" "character(0)"
|
||||
"ARB" 68682 "Arbekacin" "Aminoglycosides" "" "c(\"arbekacin\", \"arbekacina\", \"arbekacine\", \"arbekacini sulfas\", \"arbekacinum\", \"habekacin\", \"haberacin\")" "character(0)"
|
||||
"APX" 71961 "Aspoxicillin" "Beta-lactams/penicillins" "" "c(\"aspoxicilina\", \"aspoxicillan\", \"aspoxicillin\", \"aspoxicilline\", \"aspoxicillinum\")" "character(0)"
|
||||
"AST" 5284517 "Astromicin" "Aminoglycosides" "" "c(\"astromicin\", \"astromicin a\", \"astromicina\", \"astromicine\", \"astromicinum\", \"fortimicin a\")" "character(0)"
|
||||
"AVB" 9835049 "Avibactam" "Beta-lactams/penicillins" "" "c(\"avibactam\", \"avibactam free acid\")" "character(0)"
|
||||
"AVI" 71674 "Avilamycin" "Other antibacterials" "" "c(\"avilamycin\", \"avilamycina\", \"avilamycine\", \"avilamycinum\", \"surmax\")" "character(0)"
|
||||
"AVO" 16131159 "Avoparcin" "Glycopeptides" "" "" ""
|
||||
"AZD" "J01CE04" 15574941 "Azidocillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "" "c(\"azidocilina\", \"azidocillin\", \"azidocillina\", \"azidocilline\", \"azidocillinum\")" 1.5 "g" "character(0)"
|
||||
"AZM" "J01FA10" 447043 "Azithromycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "c(\"az\", \"azi\", \"azit\", \"azm\")" "c(\"aritromicina\", \"azasite\", \"azenil\", \"azifast\", \"azigram\", \"azimakrol\", \"azithramycine\", \"azithromycin\", \"azithromycine\", \"azithromycinum\", \"azitrocin\", \"azitromax\", \"azitromicina\", \"azitromicine\", \"azitromin\", \"aziwok\", \"aztrin\", \"azyter\", \"azythromycin\", \"hemomycin\", \"misultina\", \"mixoterin\", \"setron\", \"sumamed\", \"tromix\", \"trulimax\", \"zentavion\", \"zithrax\", \"zithromac\", \"zithromax\", \"zithromax iv\", \"zithromycin\", \"zitrim\", \"zitromax\", \"zitrotek\", \"zmax sr\")" 0.3 "g" 0.5 "g" "c(\"16420-2\", \"25233-8\")"
|
||||
"AZL" "J01CA09" 6479523 "Azlocillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "c(\"az\", \"azl\", \"azlo\")" "" 12 "g" ""
|
||||
"ATM" "J01DF01" 5742832 "Aztreonam" "Beta-lactams/penicillins" "Other beta-lactam antibacterials" "Monobactams" "c(\"at\", \"atm\", \"azm\", \"azt\", \"aztr\")" "c(\"azactam\", \"azetreonam\", \"azthreonam\", \"aztreonam\", \"primbactam\")" 4 "g" "c(\"16423-6\", \"25234-6\", \"3369-6\")"
|
||||
"AZA" "Aztreonam/avibactam" "Beta-lactams/penicillins" "" "" ""
|
||||
"BAM" "J01CA06" 441397 "Bacampicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "" "c(\"bacampicilina\", \"bacampicillin\", \"bacampicilline\", \"bacampicillinum\", \"penglobe\")" 1.2 "g" "character(0)"
|
||||
"BAC" "R02AB04" 78358334 "Bacitracin zinc" "Other antibacterials" "baci" "" ""
|
||||
"BDQ" 5388906 "Bedaquiline" "Other antibacterials" "" "c(\"bedaquiline\", \"sirturo\")" "80637-2"
|
||||
"BEK" 439318 "Bekanamycin" "Aminoglycosides" "" "c(\"aminodeoxykanamycin\", \"becanamicina\", \"bekanamycin\", \"bekanamycine\", \"bekanamycinum\", \"nebramycin v\")" "character(0)"
|
||||
"BNB" "J01CE08" "Benzathine benzylpenicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "" "" 3.6 "g" ""
|
||||
"BNP" "J01CE10" 64725 "Benzathine phenoxymethylpenicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "" "c(\"bicillin v\", \"biphecillin\")" 2 "g" "character(0)"
|
||||
"PEN" "J01CE01" 5904 "Benzylpenicillin" "Beta-lactams/penicillins" "Combinations of antibacterials" "Combinations of antibacterials" "c(\"bepe\", \"pen\", \"peni\", \"peni g\", \"penicillin\", \"penicillin g\", \"pg\")" "c(\"abbocillin\", \"ayercillin\", \"bencilpenicilina\", \"benzopenicillin\", \"benzyl penicillin\", \"benzylpenicillin\", \"benzylpenicillin g\", \"benzylpenicilline\", \"benzylpenicillinum\", \"bicillin\", \"cillora\", \"cilloral\", \"cilopen\", \"compocillin g\", \"cosmopen\", \"dropcillin\", \"free penicillin g\", \"free penicillin ii\", \"galofak\", \"gelacillin\", \"liquacillin\", \"megacillin\", \"pencillin g\", \"penicillin\", \"penicilling\", \"pentids\", \"permapen\", \"pfizerpen\", \"pfizerpen g\", \"pharmacillin\", \"pradupen\", \"specilline g\", \"ursopen\"
|
||||
)" 3.6 "g" "3913-1"
|
||||
"BES" 10178705 "Besifloxacin" "Quinolones" "" "besifloxacin" "character(0)"
|
||||
"BIA" 71339 "Biapenem" "Carbapenems" "" "c(\"biapenem\", \"biapenern\", \"bipenem\", \"omegacin\")" "character(0)"
|
||||
"BCZ" 65807 "Bicyclomycin (Bicozamycin)" "Other antibacterials" "" "c(\"aizumycin\", \"bacfeed\", \"bacteron\", \"bicozamicina\", \"bicozamycin\", \"bicozamycine\", \"bicozamycinum\")" "character(0)"
|
||||
"BDP" "J01EA02" 68760 "Brodimoprim" "Trimethoprims" "Sulfonamides and trimethoprim" "Trimethoprim and derivatives" "" "c(\"brodimoprim\", \"brodimoprima\", \"brodimoprime\", \"brodimoprimum\", \"bromdimoprim\", \"hyprim\", \"unitrim\")" 0.2 "g" "character(0)"
|
||||
"BUT" 47472 "Butoconazole" "Antifungals/antimycotics" "" "c(\"butaconazole\", \"butoconazol\", \"butoconazole\", \"butoconazolum\", \"compositenstarke\", \"dahlin\", \"femstat\", \"gynofort\", \"polyfructosanum\")" "character(0)"
|
||||
"CDZ" "J01DD09" 44242317 "Cadazolid" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "" "cadazolid" 2 "g" "character(0)"
|
||||
"CLA" "J04AA03" "Calcium aminosalicylate" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Aminosalicylic acid and derivatives" "" "" 15 ""
|
||||
"CAP" "J04AB30" 135565060 "Capreomycin" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Antibiotics" "c(\"\", \"capr\")" "" 1 "g" ""
|
||||
"CRB" "J01CA03" 20824 "Carbenicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "c(\"bar\", \"carb\", \"cb\")" "c(\"anabactyl\", \"carbenicilina\", \"carbenicillin\", \"carbenicillina\", \"carbenicilline\", \"carbenicillinum\", \"geopen\", \"pyopen\")" 12 "g" "3434-8"
|
||||
"CRN" "J01CA05" 93184 "Carindacillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "" "c(\"carindacilina\", \"carindacillin\", \"carindacilline\", \"carindacillinum\")" 4 "g" "character(0)"
|
||||
"CAR" 6540466 "Carumonam" "Other antibacterials" "" "c(\"carumonam\", \"carumonamum\")" "character(0)"
|
||||
"CAS" "J02AX04" 2826718 "Caspofungin" "Antifungals/antimycotics" "Antimycotics for systemic use" "Other antimycotics for systemic use" "casp" "c(\"cancidas\", \"capsofungin\", \"caspofungin\")" 50 "mg" "58419-3"
|
||||
"CAC" "J01DB10" 91562 "Cefacetrile" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "" "c(\"cefacetril\", \"cefacetrile\", \"cefacetrilo\", \"cefacetrilum\", \"celospor\", \"celtol\", \"cephacetrile\", \"cristacef\", \"vetrimast\")" "character(0)"
|
||||
"CEC" "J01DC04" 51039 "Cefaclor" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "c(\"ccl\", \"cec\", \"cf\", \"cfac\", \"cfc\", \"cfcl\", \"cfr\", \"fac\")" "c(\"alenfral\", \"alfacet\", \"ceclor\", \"ceclor cd\", \"cefaclor\", \"cefaclor anhydrous\", \"cefaclor monohydrate\", \"cefacloro\", \"cefaclorum\", \"cefeaclor\", \"cephaclor\", \"dystaclor mr\", \"keflor\", \"kefral\", \"raniclor\")" 1 "g" "c(\"16564-7\", \"21149-0\")"
|
||||
"CFR" "J01DB05" 47965 "Cefadroxil" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "c(\"cfdx\", \"cfr\", \"fad\")" "c(\"cefadrops\", \"cefadroxil\", \"cefadroxil anhydrous\", \"cefadroxilo\", \"cefadroxilum\", \"cefradroxil\", \"cephadroxil\", \"duricef\", \"sumacef\", \"ultracef\")" 2 "g" "16565-4"
|
||||
"RID" "J01DB02" 5773 "Cefaloridine" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefa" "c(\"aliporina\", \"ampligram\", \"cefaloridin\", \"cefaloridina\", \"cefaloridine\", \"cefaloridinum\", \"cefalorizin\", \"ceflorin\", \"cepaloridin\", \"cepalorin\", \"cephalomycine\", \"cephaloridin\", \"cephaloridine\", \"cephaloridinum\", \"ceporan\", \"ceporin\", \"ceporine\", \"cilifor\", \"deflorin\", \"faredina\", \"floridin\", \"glaxoridin\", \"intrasporin\", \"keflodin\", \"keflordin\", \"kefloridin\", \"kefspor\", \"lloncefal\", \"loridine\", \"sasperin\", \"sefacin\", \"verolgin\", \"vioviantine\")" 3 "g" "character(0)"
|
||||
"MAN" "J01DC03" 456255 "Cefamandole" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "c(\"cfam\", \"cfmn\")" "c(\"cefadole\", \"cefamandol\", \"cefamandole\", \"cefamandolum\", \"cephadole\", \"cephamandole\", \"kefamandol\", \"kefdole\", \"mancef\")" 6 "g" "3441-3"
|
||||
"CTZ" "J01DB07" 6410758 "Cefatrizine" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "" "c(\"bricef\", \"cefatrix\", \"cefatrizine\", \"cefatrizino\", \"cefatrizinum\", \"cepticol\", \"cetrazil\", \"latocef\", \"orosporina\", \"trizina\")" 1 "g" "character(0)"
|
||||
"CZD" "J01DB06" 71736 "Cefazedone" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "" "c(\"cefazedon\", \"cefazedona\", \"cefazedone\", \"cefazedone acid\", \"cefazedonum\", \"refosporen\", \"refosporene\", \"refosporin\")" 3 "g" "character(0)"
|
||||
"CZO" "J01DB04" 33255 "Cefazolin" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "c(\"cfz\", \"cfzl\", \"cz\", \"czol\", \"faz\", \"kz\")" "c(\"atirin\", \"cefamezin\", \"cefamezine\", \"cefazina\", \"cefazolin\", \"cefazolin acid\", \"cefazolina\", \"cefazoline\", \"cefazolinum\", \"cephamezine\", \"cephazolidin\", \"cephazolin\", \"cephazoline\", \"elzogram\", \"firmacef\", \"kefzol\", \"liviclina\", \"totacef\")" 3 "g" "c(\"16566-2\", \"25235-3\", \"3442-1\", \"3443-9\", \"80962-4\")"
|
||||
"CFB" 127527 "Cefbuperazone" "Other antibacterials" "" "c(\"cefbuperazona\", \"cefbuperazone\", \"cefbuperazonum\", \"cefbuperzaone\", \"cerbuperazone\", \"tomiporan\")" "character(0)"
|
||||
"CCP" 6436055 "Cefcapene" "Cephalosporins (3rd gen.)" "" "c(\"cefcamate\", \"cefcapene\")" "character(0)"
|
||||
"CCX" 5282438 "Cefcapene pivoxil" "Cephalosporins (3rd gen.)" "" "c(\"cefcamate pivoxil\", \"cefcapene piroxil\")" "character(0)"
|
||||
"CDR" "J01DD15" 6915944 "Cefdinir" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"cd\", \"cdn\", \"cdr\", \"cfd\", \"din\")" "c(\"cefdinir\", \"cefdinirum\", \"cefdinyl\", \"cefdirnir\", \"ceftinex\", \"cefzon\", \"omnicef\")" 0.6 "g" "character(0)"
|
||||
"DIT" "J01DD16" 9870843 "Cefditoren" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cdn" "cefditoren" 0.4 "g" "character(0)"
|
||||
"DIX" 6437877 "Cefditoren pivoxil" "Cephalosporins (3rd gen.)" "" "c(\"cefditoren\", \"cefditoren pi voxil\", \"cefditoren pivoxil\", \"cefditorin\", \"cefditorin pivoxil\", \"meiact\", \"spectracef\")" "character(0)"
|
||||
"FEP" "J01DE01" 5479537 "Cefepime" "Cephalosporins (4th gen.)" "Other beta-lactam antibacterials" "Fourth-generation cephalosporins" "c(\"cfep\", \"cfpi\", \"cpe\", \"cpm\", \"fep\", \"pm\", \"xpm\")" "c(\"axepim\", \"cefepima\", \"cefepime\", \"cefepimum\", \"cepimax\", \"cepimex\", \"maxcef\", \"maxipime\")" 4 "g" "38363-8"
|
||||
"CPC" 9567559 "Cefepime/clavulanic acid" "Cephalosporins (4th gen.)" "c(\"cicl\", \"xpml\")" "" ""
|
||||
"FPT" 9567558 "Cefepime/tazobactam" "Cephalosporins (4th gen.)" "" "" ""
|
||||
"FPZ" "Cefepime/zidebactam" "Other antibacterials" "" "" ""
|
||||
"CAT" "J01DD10" 5487888 "Cefetamet" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "" "c(\"cefetamet\", \"cefetametum\", \"cepime o\", \"deacetoxycefotaxime\")" 1 "g" "character(0)"
|
||||
"CPI" 5486182 "Cefetamet pivoxil" "Cephalosporins (3rd gen.)" "" "c(\"cefetamet pivoxyl\", \"globocef\")" "character(0)"
|
||||
"CCL" 71719688 "Cefetecol (Cefcatacol)" "Cephalosporins (4th gen.)" "" "" ""
|
||||
"CZL" 193956 "Cefetrizole" "Cephalosporins (unclassified gen.)" "" "c(\"cefetrizole\", \"cefetrizolum\")" "character(0)"
|
||||
"FDC" 77843966 "Cefiderocol" "Other antibacterials" "" "cefiderocol" "character(0)"
|
||||
"CFM" "J01DD08" 5362065 "Cefixime" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"cfe\", \"cfix\", \"cfxm\", \"dcfm\", \"fix\", \"ix\")" "c(\"cefixim\", \"cefixima\", \"cefixime\", \"cefixime anhydrous\", \"cefiximum\", \"cefixoral\", \"cefspan\", \"cephoral\", \"denvar\", \"necopen\", \"suprax\", \"tricef\", \"unixime\")" 0.4 "g" "c(\"16567-0\", \"25236-1\")"
|
||||
"CMX" "J01DD05" 9570757 "Cefmenoxime" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "" "c(\"bestron\", \"cefmax\", \"cefmenoxima\", \"cefmenoxime\", \"cefmenoximum\")" 2 "g" "character(0)"
|
||||
"CMZ" "J01DC09" 42008 "Cefmetazole" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "" "c(\"cefmetazole\", \"cefmetazolo\", \"cefmetazolum\")" 4 "g" "character(0)"
|
||||
"CNX" 71141 "Cefminox" "Other antibacterials" "" "c(\"cefminox\", \"cefminoxum\")" "character(0)"
|
||||
"DIZ" "J01DD09" 5361871 "Cefodizime" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "" "c(\"cefodizima\", \"cefodizime\", \"cefodizime acid\", \"cefodizimum\", \"cefodizme\", \"diezime\", \"modivid\", \"neucef\", \"timecef\")" 2 "g" "character(0)"
|
||||
"CID" "J01DC06" 43594 "Cefonicid" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "" "c(\"cefonicid\", \"cefonicido\", \"cefonicidum\", \"monocef\")" 1 "g" "c(\"25237-9\", \"3444-7\")"
|
||||
"CFP" "J01DD12" 44187 "Cefoperazone" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"cfp\", \"cfpz\", \"cp\", \"cpz\", \"fop\", \"per\")" "c(\"bioperazone\", \"cefobid\", \"cefoperazine\", \"cefoperazon\", \"cefoperazone\", \"cefoperazone acid\", \"cefoperazono\", \"cefoperazonum\", \"cefozon\", \"medocef\", \"myticef\", \"pathozone\", \"peracef\")" 4 "g" "3445-4"
|
||||
"CSL" "J01DD62" "Cefoperazone/sulbactam" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "" "" 4 "g" ""
|
||||
"CND" "J01DC11" 43507 "Ceforanide" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "" "c(\"ceforanide\", \"ceforanido\", \"ceforanidum\", \"precef\", \"radacef\")" 4 "g" "character(0)"
|
||||
"CSE" 9830519 "Cefoselis" "Cephalosporins (4th gen.)" "" "c(\"cefoselis\", \"cefoselis sulfate\", \"winsef\")" "character(0)"
|
||||
"CTX" "J01DD01" 5742673 "Cefotaxime" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"cfot\", \"cft\", \"cftx\", \"ct\", \"ctx\", \"fot\", \"tax\", \"xct\")" "c(\"cefotaxim\", \"cefotaxim hikma\", \"cefotaxima\", \"cefotaxime\", \"cefotaxime acid\", \"cefotaximum\", \"cephotaxime\", \"claforan\", \"omnatax\")" 4 "g" "c(\"25238-7\", \"3446-2\", \"80961-6\")"
|
||||
"CTC" 9575353 "Cefotaxime/clavulanic acid" "Cephalosporins (3rd gen.)" "c(\"cxcl\", \"xctl\")" "" ""
|
||||
"CTS" 9574753 "Cefotaxime/sulbactam" "Cephalosporins (3rd gen.)" "" "" ""
|
||||
"CTT" "J01DC05" 53025 "Cefotetan" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "c(\"cftt\", \"cn\", \"cte\", \"ctn\", \"ctt\", \"tans\")" "c(\"apacef\", \"cefotetan\", \"cefotetan free acid\", \"cefotetanum\")" 4 "g" "c(\"25239-5\", \"3447-0\")"
|
||||
"CTF" "J01DC07" 43708 "Cefotiam" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "" "c(\"cefotiam\", \"cefotiam?\", \"cefotiamum\", \"ceradolan\", \"ceradon\", \"haloapor\")" 1.2 "g" 4 "g" "character(0)"
|
||||
"CHE" 125846 "Cefotiam hexetil" "Cephalosporins (3rd gen.)" "" "c(\"cefotiam cilexetil\", \"pansporin t\")" "character(0)"
|
||||
"FOV" 9578573 "Cefovecin" "Cephalosporins (3rd gen.)" "" "" ""
|
||||
"FOX" "J01DC01" 441199 "Cefoxitin" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "c(\"cfox\", \"cfx\", \"cfxt\", \"cx\", \"fox\", \"fx\")" "c(\"cefoxitin\", \"cefoxitina\", \"cefoxitine\", \"cefoxitinum\", \"cefoxotin\", \"cephoxitin\", \"mefoxin\", \"mefoxitin\", \"rephoxitin\")" 6 "g" "c(\"25240-3\", \"3448-8\")"
|
||||
"FOX1" "Cefoxitin screening" "Cephalosporins (2nd gen.)" "cfsc" "" ""
|
||||
"ZOP" 9571080 "Cefozopran" "Cephalosporins (4th gen.)" "" "cefozopran" "character(0)"
|
||||
"CFZ" 68597 "Cefpimizole" "Cephalosporins (3rd gen.)" "" "c(\"cefpimizol\", \"cefpimizole\", \"cefpimizole sodium\", \"cefpimizolum\")" "character(0)"
|
||||
"CPM" "J01DD11" 636405 "Cefpiramide" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "" "c(\"cefpiramide\", \"cefpiramide acid\", \"cefpiramido\", \"cefpiramidum\")" 2 "g" "character(0)"
|
||||
"CPO" "J01DE02" 5479539 "Cefpirome" "Cephalosporins (4th gen.)" "Other beta-lactam antibacterials" "Fourth-generation cephalosporins" "c(\"\", \"cfpr\")" "c(\"broact\", \"cefpiroma\", \"cefpirome\", \"cefpiromum\", \"cefrom\", \"cerfpirome\", \"keiten\")" 4 "g" "character(0)"
|
||||
"CPD" "J01DD13" 6335986 "Cefpodoxime" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"cfpd\", \"cfpo\", \"cpd\", \"pod\", \"px\")" "c(\"cefpodoxim acid\", \"cefpodoxima\", \"cefpodoxime\", \"cefpodoxime acid\", \"cefpodoximum\", \"epoxim\")" 0.4 "g" "25241-1"
|
||||
"CPX" 6526396 "Cefpodoxime proxetil" "Cephalosporins (3rd gen.)" "" "c(\"cefodox\", \"cefoprox\", \"cefpodoxime proxetil\", \"cepodem\", \"orelox\", \"otreon\", \"podomexef\", \"simplicef\", \"vantin\")" "character(0)"
|
||||
"CDC" "Cefpodoxime/clavulanic acid" "Cephalosporins (3rd gen.)" "c(\"\", \"cecl\")" "" ""
|
||||
"CPR" "J01DC10" 5281006 "Cefprozil" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "c(\"cpr\", \"cpz\", \"fp\")" "c(\"arzimol\", \"brisoral\", \"cefprozil\", \"cefprozil anhydrous\", \"cefprozil hydrate\", \"cefprozilo\", \"cefprozilum\", \"cefzil\", \"cronocef\", \"procef\", \"serozil\")" 1 "g" "character(0)"
|
||||
"CEQ" 5464355 "Cefquinome" "Cephalosporins (4th gen.)" "" "c(\"cefquinoma\", \"cefquinome\", \"cefquinomum\", \"cobactan\")" "character(0)"
|
||||
"CRD" "J01DB11" 5284529 "Cefroxadine" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "" "c(\"cefroxadine\", \"cefroxadino\", \"cefroxadinum\")" 2.1 "character(0)"
|
||||
"CFS" "J01DD03" 656575 "Cefsulodin" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"cfsl\", \"cfsu\")" "c(\"cefsulodin\", \"cefsulodine\", \"cefsulodino\", \"cefsulodinum\")" 4 "g" "c(\"131-3\", \"25242-9\")"
|
||||
"CSU" 68718 "Cefsumide" "Cephalosporins (unclassified gen.)" "" "c(\"cefsumide\", \"cefsumido\", \"cefsumidum\")" "character(0)"
|
||||
"CPT" "J01DI02" 56841980 "Ceftaroline" "Cephalosporins (5th gen.)" "c(\"\", \"cfro\")" "c(\"teflaro\", \"zinforo\")" 1.2 "character(0)"
|
||||
"CPA" "Ceftaroline/avibactam" "Cephalosporins (5th gen.)" "" "" ""
|
||||
"CAZ" "J01DD02" 5481173 "Ceftazidime" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"caz\", \"cefta\", \"cfta\", \"cftz\", \"taz\", \"tz\", \"xtz\")" "c(\"ceftazidim\", \"ceftazidima\", \"ceftazidime\", \"ceftazidimum\", \"ceptaz\", \"fortaz\", \"fortum\", \"pentacef\", \"tazicef\", \"tazidime\")" 4 "g" "c(\"21151-6\", \"3449-6\", \"80960-8\")"
|
||||
"CZA" "Ceftazidime/avibactam" "Cephalosporins (3rd gen.)" "c(\"\", \"cfav\")" "" ""
|
||||
"CCV" "J01DD52" 9575352 "Ceftazidime/clavulanic acid" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"czcl\", \"xtzl\")" "" 6 ""
|
||||
"CEM" 6537431 "Cefteram" "Cephalosporins (3rd gen.)" "" "c(\"cefteram\", \"cefterame\", \"cefteramum\", \"ceftetrame\")" "character(0)"
|
||||
"CPL" 5362114 "Cefteram pivoxil" "Cephalosporins (3rd gen.)" "" "c(\"cefteram pivoxil\", \"tomiron\")" "character(0)"
|
||||
"CTL" "J01DB12" 65755 "Ceftezole" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "" "c(\"ceftezol\", \"ceftezole\", \"ceftezolo\", \"ceftezolum\", \"demethylcefazolin\")" 3 "g" "character(0)"
|
||||
"CTB" "J01DD14" 5282242 "Ceftibuten" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"cb\", \"cfbu\", \"ctb\", \"tib\")" "c(\"ceftem\", \"ceftibuten\", \"ceftibuten hydrate\", \"ceftibutene\", \"ceftibuteno\", \"ceftibutenum\", \"cephem\", \"ceprifran\", \"isocef\", \"keimax\")" 0.4 "g" "character(0)"
|
||||
"TIO" 6328657 "Ceftiofur" "Cephalosporins (3rd gen.)" "" "c(\"ceftiofur\", \"ceftiofurum\", \"excede\", \"excenel\", \"naxcel\")" "character(0)"
|
||||
"CZX" "J01DD07" 6533629 "Ceftizoxime" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"cfzx\", \"ctz\", \"cz\", \"czx\", \"tiz\", \"zox\")" "c(\"cefizox\", \"ceftisomin\", \"ceftix\", \"ceftizoxima\", \"ceftizoxime\", \"ceftizoximum\", \"epocelin\", \"eposerin\")" 4 "g" "c(\"25243-7\", \"3450-4\")"
|
||||
"CZP" 9578661 "Ceftizoxime alapivoxil" "Cephalosporins (3rd gen.)" "" "" ""
|
||||
"BPR" "J01DI01" 135413542 "Ceftobiprole" "Cephalosporins (5th gen.)" "" "ceftobiprole" 1.5 "character(0)"
|
||||
"CFM1" "J01DI01" 135413544 "Ceftobiprole medocaril" "Cephalosporins (5th gen.)" "Other beta-lactam antibacterials" "Other cephalosporins" "" "" 1.5 ""
|
||||
"CEI" "J01DI54" "Ceftolozane/enzyme inhibitor" "Cephalosporins (5th gen.)" "Other beta-lactam antibacterials" "Other cephalosporins" "" "" 3 ""
|
||||
"CZT" "Ceftolozane/tazobactam" "Cephalosporins (5th gen.)" "" "" ""
|
||||
"CRO" "J01DD04" 5479530 "Ceftriaxone" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"axo\", \"cax\", \"cftr\", \"cro\", \"ctr\", \"frx\", \"tx\")" "c(\"biotrakson\", \"cefatriaxone\", \"cefatriaxone hydrate\", \"ceftriaxon\", \"ceftriaxona\", \"ceftriaxone\", \"ceftriaxone sodium\", \"ceftriaxonum\", \"ceftriazone\", \"cephtriaxone\", \"longacef\", \"rocefin\", \"rocephalin\", \"rocephin\", \"rocephine\", \"rophex\")" 2 "g" "c(\"25244-5\", \"3451-2\", \"80957-4\")"
|
||||
"CXM" "J01DC02" 5479529 "Cefuroxime" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "c(\"cfrx\", \"cfur\", \"cfx\", \"crm\", \"cxm\", \"fur\", \"rox\", \"xm\")" "c(\"biofuroksym\", \"cefuril\", \"cefuroxim\", \"cefuroxime\", \"cefuroximine\", \"cefuroximo\", \"cefuroximum\", \"cephuroxime\", \"kefurox\", \"sharox\", \"zinacef\", \"zinacef danmark\")" 0.5 "g" 3 "g" "c(\"25245-2\", \"3452-0\", \"80608-3\", \"80617-4\")"
|
||||
"CXA" 6321416 "Cefuroxime axetil" "Cephalosporins (2nd gen.)" "c(\"\", \"cfax\")" "c(\"altacef\", \"bioracef\", \"cefaks\", \"cefazine\", \"ceftin\", \"cefuroximaxetil\", \"cefuroxime axetil\", \"celocid\", \"cepazine\", \"cethixim\", \"cetoxil\", \"coliofossim\", \"elobact\", \"forcef\", \"furoxime\", \"kalcef\", \"maxitil\", \"medoxm\", \"nivador\", \"zinnat\")" "character(0)"
|
||||
"CFM2" "J01RA03" "Cefuroxime/metronidazole" "Other antibacterials" "Combinations of antibacterials" "Combinations of antibacterials" "" "" ""
|
||||
"ZON" 6336505 "Cefuzonam" "Other antibacterials" "" "c(\"cefuzonam\", \"cefuzonam sodium\", \"cefuzoname\", \"cefuzonamum\")" "character(0)"
|
||||
"LEX" "J01DB01" 27447 "Cephalexin" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "c(\"\", \"cflx\")" "c(\"alcephin\", \"alexin\", \"alsporin\", \"anhydrous cefalexin\", \"anhydrous cephalexin\", \"biocef\", \"carnosporin\", \"cefablan\", \"cefadal\", \"cefadin\", \"cefadina\", \"cefaleksin\", \"cefalessina\", \"cefalexin\", \"cefalexin anhydrous\", \"cefalexina\", \"cefalexine\", \"cefalexinum\", \"cefalin\", \"cefaloto\", \"cefaseptin\", \"ceflax\", \"ceforal\", \"cefovit\", \"celexin\", \"cepastar\", \"cepexin\", \"cephacillin\", \"cephalexin\", \"cephalexin anhydrous\", \"cephalexine\", \"cephalexinum\", \"cephanasten\", \"cephaxin\", \"cephin\", \"ceporex\", \"ceporex forte\",
|
||||
\"ceporexin\", \"ceporexine\", \"cerexin\", \"cerexins\", \"cophalexin\", \"durantel\", \"durantel ds\", \"erocetin\", \"factagard\", \"felexin\", \"ibilex\", \"ibrexin\", \"inphalex\", \"kefalospes\", \"keflet\", \"keflex\", \"kefolan\", \"keforal\", \"keftab\", \"kekrinal\", \"kidolex\", \"lafarine\", \"larixin\", \"lenocef\", \"lexibiotico\", \"lonflex\", \"lopilexin\", \"madlexin\", \"mamalexin\", \"mamlexin\", \"medoxine\", \"neokef\", \"neolexina\", \"novolexin\", \"optocef\", \"oracef\", \"oriphex\", \"oroxin\", \"ortisporina\", \"ospexin\", \"palitrex\", \"panixine disperdose\",
|
||||
\"pectril\", \"pyassan\", \"roceph\", \"roceph distab\", \"sanaxin\", \"sartosona\", \"sencephalin\", \"sepexin\", \"servispor\", \"sialexin\", \"sinthecillin\", \"sporicef\", \"sporidex\", \"syncle\", \"synecl\", \"tepaxin\", \"tokiolexin\", \"uphalexin\", \"voxxim\", \"winlex\", \"zozarine\")" 2 "g" "c(\"21175-5\", \"3453-8\")"
|
||||
"CEP" "J01DB03" 6024 "Cephalothin" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "c(\"cfal\", \"cflt\")" "c(\"cefalothin\", \"cefalotin\", \"cefalotina\", \"cefalotina fabra\", \"cefalotine\", \"cefalotinum\", \"cemastin\", \"cephalothinum\", \"cephalotin\", \"coaxin\", \"keflin\", \"seffin\")" 4 "g" "c(\"25246-0\", \"3454-6\")"
|
||||
"HAP" "J01DB08" 30699 "Cephapirin" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "" "c(\"ambrocef\", \"cefadyl\", \"cefapilin\", \"cefapirin\", \"cefapirina\", \"cefapirine\", \"cefapirinum\", \"cefaprin\", \"cefaprin sodium\", \"cefatrex\", \"cefatrexyl\", \"cephapirine\", \"metricure\")" 4 "g" "10980-1"
|
||||
"CED" "J01DB09" 38103 "Cephradine" "Cephalosporins (1st gen.)" "Other beta-lactam antibacterials" "First-generation cephalosporins" "c(\"cfra\", \"cfrd\")" "c(\"anspor\", \"cefradin\", \"cefradina\", \"cefradine\", \"cefradinum\", \"cekodin\", \"cephradin\", \"cephradine\", \"eskacef\", \"infexin\", \"megace f\", \"megacef\", \"sefril\", \"velocef\", \"velosef\")" 2 "g" 2 "g" "character(0)"
|
||||
"CTO" 71402 "Cetocycline" "Tetracyclines" "" "c(\"cetocycline\", \"cetocyline\", \"cetotetrine\")" "character(0)"
|
||||
"CHL" "J01BA01" 5959 "Chloramphenicol" "Amphenicols" "Amphenicols" "Amphenicols" "c(\"c\", \"chl\", \"chlo\", \"cl\")" "c(\"alficetyn\", \"ambofen\", \"amphenicol\", \"amphicol\", \"amseclor\", \"anacetin\", \"aquamycetin\", \"austracil\", \"austracol\", \"biocetin\", \"biophenicol\", \"catilan\", \"ch loramex\", \"chemiceticol\", \"chemicetin\", \"chemicetina\", \"chlomin\", \"chlomycol\", \"chloramex\", \"chloramfenikol\", \"chloramficin\", \"chloramfilin\", \"chloramphenicol\", \"chloramphenicole\", \"chloramphenicolum\", \"chloramsaar\", \"chlorasol\", \"chlorbiotic\", \"chloricol\", \"chlormycetin r\", \"chlornitromycin\", \"chloroamphenicol\", \"chlorocaps\", \"chlorocid\",
|
||||
\"chlorocid s\", \"chlorocide\", \"chlorocidin c\", \"chlorocidin c tetran\", \"chlorocin\", \"chlorocol\", \"chlorofair\", \"chloroject l\", \"chloromax\", \"chloromycetin\", \"chloromycetny\", \"chloromyxin\", \"chloronitrin\", \"chloroptic\", \"chloroptic s.o.p\", \"chloroptic s.o.p.\", \"chlorovules\", \"chlorsig\", \"cidocetine\", \"ciplamycetin\", \"cloramfen\", \"cloramfenicol\", \"cloramfenicolo\", \"cloramficin\", \"cloramical\", \"cloramicol\", \"cloramidina\", \"cloranfenicol\", \"cloroamfenicolo\", \"clorocyn\", \"cloromisan\", \"cloromissan\", \"clorosintex\",
|
||||
\"comycetin\", \"cylphenicol\", \"desphen\", \"detreomycin\", \"detreomycine\", \"dextromycetin\", \"doctamicina\", \"duphenicol\", \"econochlor\", \"embacetin\", \"emetren\", \"enicol\", \"enteromycetin\", \"erbaplast\", \"ertilen\", \"f armicetina\", \"farmicetina\", \"fenicol\", \"globenicol\", \"glorous\", \"halomycetin\", \"hortfenicol\", \"interomycetine\", \"intramycetin\", \"intramyctin\", \"isicetin\", \"ismicetina\", \"isophenicol\", \"isopto fenicol\", \"juvamycetin\", \"kamaver\", \"kemicetina\", \"kemicetine\", \"kloramfenikol\", \"klorita\", \"klorocid s\",
|
||||
\"laevomycetinum\", \"leukamycin\", \"leukomyan\", \"leukomycin\", \"levocin\", \"levomicetina\", \"levomitsetin\", \"levomycetin\", \"levoplast\", \"levosin\", \"levovetin\", \"loromicetina\", \"loromisan\", \"loromisin\", \"mastiphen\", \"mediamycetine\", \"medichol\", \"micloretin\", \"micochlorine\", \"micoclorina\", \"microcetina\", \"mychel\", \"mycinol\", \"myclocin\", \"mycochlorin\", \"myscel\", \"normimycin v\", \"novochlorocap\", \"novomycetin\", \"novophenicol\", \"ocuphenicol\", \"oftalent\", \"oleomycetin\", \"opclor\", \"opelor\", \"ophthochlor\", \"ophthocort\",
|
||||
\"ophtochlor\", \"optomycin\", \"otachron\", \"otophen\", \"pantovernil\", \"paraxin\", \"pentamycetin\", \"quemicetina\", \"rivomycin\", \"romphenil\", \"ronfenil\", \"ronphenil\", \"septicol\", \"sificetina\", \"sintomicetina\", \"sintomicetine r\", \"sno phenicol\", \"soluthor\", \"stanomycetin\", \"synthomycetin\", \"synthomycetine\", \"synthomycine\", \"syntomycin\", \"tevcocin\", \"tevcosin\", \"tifomycin\", \"tifomycine\", \"tiromycetin\", \"treomicetina\", \"unimycetin\", \"veticol\", \"vice ton\", \"viceton\")" 3 "g" 3 "g" "c(\"15101-9\", \"16603-3\", \"16604-1\", \"25247-8\", \"29214-4\", \"29346-4\", \"29347-2\", \"3455-3\")"
|
||||
"CTE" "J01AA03" 54675777 "Chlortetracycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "" "c(\"acronize\", \"aueromycin\", \"aureocina\", \"aureomycin\", \"aureomykoin\", \"biomitsin\", \"biomycin\", \"biomycin a\", \"chlormax\", \"chlorotetracycline\", \"chlortetracycline\", \"chlortetracyclinum\", \"chrysomykine\", \"clortetraciclina\", \"duomycin\", \"flamycin\", \"uromycin\")" 1 "g" "87600-3"
|
||||
"CIC" 19003 "Ciclacillin" "Beta-lactams/penicillins" "" "c(\"bastcillin\", \"calthor\", \"ciclacilina\", \"ciclacillin\", \"ciclacilline\", \"ciclacillinum\", \"ciclacillum\", \"citosarin\", \"cyclacillin\", \"cyclapen\", \"noblicil\", \"orfilina\", \"peamezin\", \"syngacillin\", \"ultracillin\", \"vastcillin\", \"vipicil\", \"wyvital\")" "character(0)"
|
||||
"CIX" "D01AE14" 47472 "Ciclopirox" "Antifungals/antimycotics" "Antifungals for topical use" "Other antifungals for topical use" "cipx" "c(\"butaconazole\", \"butoconazol\", \"butoconazole\", \"butoconazolum\", \"compositenstarke\", \"dahlin\", \"femstat\", \"gynofort\", \"polyfructosanum\")" "character(0)"
|
||||
"CIN" "J01MB06" 2762 "Cinoxacin" "Quinolones" "Quinolone antibacterials" "Other quinolones" "c(\"cino\", \"cnox\")" "c(\"azolinic acid\", \"cinobac\", \"cinobactin\", \"cinoxacin\", \"cinoxacine\", \"cinoxacino\", \"cinoxacinum\", \"clinoxacin\", \"noxigram\", \"uronorm\")" 1 "g" "character(0)"
|
||||
"CIP" "J01MA02" 2764 "Ciprofloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"ci\", \"cip\", \"cipr\", \"cp\")" "c(\"alcon cilox\", \"auripro\", \"bacquinor\", \"baflox\", \"baycip\", \"bernoflox\", \"cetraxal\", \"ciflox\", \"cifloxin\", \"ciloxan\", \"ciplus\", \"ciprecu\", \"ciprine\", \"ciprinol\", \"cipro i.v.\", \"cipro iv\", \"cipro xl\", \"cipro xr\", \"ciprobay\", \"ciprobay uro\", \"ciprocinol\", \"ciprodar\", \"ciproflox\", \"ciprofloxacin\", \"ciprofloxacina\", \"ciprofloxacine\", \"ciprofloxacino\", \"ciprofloxacinum\", \"ciprogis\", \"ciprolin\", \"ciprolon\", \"cipromycin\", \"ciproquinol\", \"ciprowin\", \"ciproxan\", \"ciproxin\", \"ciproxina\", \"ciproxine\", \"ciriax\",
|
||||
\"citopcin\", \"corsacin\", \"cyprobay\", \"fimoflox\", \"flociprin\", \"ipiflox\", \"italnik\", \"linhaliq\", \"otiprio\", \"probiox\", \"proflaxin\", \"quinolid\", \"quintor\", \"rancif\", \"roxytal\", \"septicide\", \"sophixin ofteno\", \"spitacin\", \"superocin\", \"velmonit\", \"velomonit\", \"zumaflox\")" 1 "g" 0.8 "g" "c(\"14031-9\", \"14032-7\", \"14058-2\", \"14059-0\", \"25248-6\", \"34636-1\", \"3484-3\")"
|
||||
"CLR" "J01FA09" 84029 "Clarithromycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "c(\"ch\", \"cla\", \"clar\", \"clm\", \"clr\")" "c(\"abbotic\", \"astromen\", \"biaxin\", \"biaxin filmtab\", \"biaxin hp\", \"biaxin xl\", \"biaxin xl filmtab\", \"bicrolid\", \"clacee\", \"clacid\", \"clacine\", \"clambiotic\", \"clarem\", \"claribid\", \"claricide\", \"claridar\", \"claripen\", \"clarith\", \"clarithromycin\", \"clarithromycine\", \"clarithromycinum\", \"claritromicina\", \"clathromycin\", \"crixan\", \"cyllid\", \"cyllind\", \"fromilid\", \"heliclar\", \"klabax\", \"klacid\", \"klaciped\", \"klaricid\", \"klaricid h.p\", \"klaricid h.p.\", \"klaricid pediatric\", \"klaricid xl\", \"klarid\", \"klarin\",
|
||||
\"kofron\", \"mabicrol\", \"macladin\", \"maclar\", \"veclam\", \"vikrol\", \"zeclar\")" 0.5 "g" 1 "g" "c(\"16619-9\", \"25253-6\", \"34638-7\", \"80559-8\")"
|
||||
"CLA1" 5280980 "Clavulanic acid" "Other antibacterials" "" "c(\"acide clavulanique\", \"acido clavulanico\", \"acidum clavulanicum\", \"clavulanate\", \"clavulanate acid\", \"clavulanate lithium\", \"clavulanic acid\", \"clavulansaeure\", \"clavulansaure\", \"clavulinic acid\", \"clavulox\", \"sodium clavulanate\")" "character(0)"
|
||||
"CLX" 60063 "Clinafloxacin" "Quinolones" "" "clinafloxacin" "character(0)"
|
||||
"CLI" "J01FF01" 446598 "Clindamycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Lincosamides" "c(\"cc\", \"cd\", \"cli\", \"clin\", \"cm\", \"da\")" "c(\"antirobe\", \"chlolincocin\", \"clindaderm\", \"clindamicina\", \"clindamycin\", \"clindamycine\", \"clindamycinum\", \"clinimycin\", \"dalacin c\", \"dalacine\", \"klimicin\", \"sobelin\")" 1.2 "g" 1.8 "g" "c(\"16621-5\", \"16622-3\", \"25249-4\", \"3486-8\")"
|
||||
"CLF" "J04BA01" 2794 "Clofazimine" "Antimycobacterials" "Drugs for treatment of lepra" "Drugs for treatment of lepra" "clof" "c(\"chlofazimine\", \"clofazimin\", \"clofazimina\", \"clofazimine\", \"clofaziminum\", \"lampren\", \"lamprene\", \"riminophenazine\")" 0.1 "g" "character(0)"
|
||||
"CLF1" "J01XX03" 2799 "Clofoctol" "Other antibacterials" "Other antibacterials" "Other antibacterials" "" "c(\"clofoctol\", \"clofoctolo\", \"clofoctolum\", \"gramplus\", \"octofene\")" "character(0)"
|
||||
"CLM" "J01CE07" 71807 "Clometocillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "" "c(\"chlomethocillin\", \"clometacillin\", \"clometocilina\", \"clometocillin\", \"clometocilline\", \"clometocillinum\", \"rixapen\")" 1 "g" "character(0)"
|
||||
"CLM1" "J01AA11" 54680675 "Clomocycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "" "c(\"chlormethylencycline\", \"clomociclina\", \"clomocyclin\", \"clomocycline\", \"clomocyclinum\", \"megaclor\")" 1 "g" "character(0)"
|
||||
"CTR" "G01AF02" 2812 "Clotrimazole" "Antifungals/antimycotics" "clot" "c(\"canesten\", \"canesten cream\", \"canesten solution\", \"canestene\", \"canestine\", \"canifug\", \"chlotrimazole\", \"cimitidine\", \"clomatin\", \"clotrimaderm\", \"clotrimaderm cream\", \"clotrimazol\", \"clotrimazole\", \"clotrimazolum\", \"cutistad\", \"desamix f\", \"diphenylmethane\", \"empecid\", \"esparol\", \"fem care\", \"femcare\", \"gyne lotrimin\", \"jidesheng\", \"kanesten\", \"klotrimazole\", \"lotrimax\", \"lotrimin\", \"lotrimin af\", \"lotrimin af cream\", \"lotrimin af lotion\", \"lotrimin af solution\", \"lotrimin cream\", \"lotrimin lotion\",
|
||||
\"lotrimin solution\", \"monobaycuten\", \"mycelax\", \"mycelex\", \"mycelex cream\", \"mycelex g\", \"mycelex otc\", \"mycelex solution\", \"mycelex troches\", \"mycelex twin pack\", \"myclo cream\", \"myclo solution\", \"myclo spray solution\", \"mycofug\", \"mycosporin\", \"mykosporin\", \"nalbix\", \"otomax\", \"pedisafe\", \"rimazole\", \"stiemazol\", \"tibatin\", \"trimysten\", \"veltrim\")" "character(0)"
|
||||
"CLO" "J01CF02" 6098 "Cloxacillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "c(\"\", \"clox\")" "c(\"chloroxacillin\", \"clossacillina\", \"cloxacilina\", \"cloxacillin\", \"cloxacillin sodium\", \"cloxacilline\", \"cloxacillinna\", \"cloxacillinum\", \"cloxapen\", \"methocillin s\", \"orbenin\", \"syntarpen\", \"tegopen\")" 2 "g" 2 "g" "c(\"16628-0\", \"25250-2\")"
|
||||
"COL" "J01XB01" 5311054 "Colistin" "Polymyxins" "Other antibacterials" "Polymyxins" "c(\"cl\", \"coli\", \"cs\", \"ct\")" "c(\"belcomycine\", \"colimycin\", \"colimycin sulphate\", \"colisticin\", \"colistimethate\", \"colistimethate sodium\", \"colistin sulfate\", \"colistin sulphate\", \"colomycin\", \"coly-mycin\", \"polymyxin e\", \"polymyxin e. sulfate\", \"promixin\", \"totazina\")" 9 "MU" "c(\"16645-4\", \"29493-4\")"
|
||||
"COP" "Colistin/polysorbate" "Other antibacterials" "" "" ""
|
||||
"CYC" "J04AB01" 6234 "Cycloserine" "Oxazolidinones" "Drugs for treatment of tuberculosis" "Antibiotics" "cycl" "c(\"cicloserina\", \"closerin\", \"closina\", \"cyclorin\", \"cycloserin\", \"cycloserine\", \"cycloserinum\", \"farmiserina\", \"micoserina\", \"miroserina\", \"miroseryn\", \"novoserin\", \"oxamicina\", \"oxamycin\", \"seromycin\", \"tebemicina\", \"tisomycin\", \"wasserina\")" 0.75 "g" "c(\"16702-3\", \"25251-0\", \"3519-6\")"
|
||||
"DAL" "J01XA04" 23724878 "Dalbavancin" "Glycopeptides" "Other antibacterials" "Glycopeptide antibacterials" "dalb" "c(\"dalbavancin\", \"dalvance\")" 1.5 "character(0)"
|
||||
"DAN" 71335 "Danofloxacin" "Quinolones" "" "c(\"advocin\", \"danofloxacin\", \"danofloxacine\", \"danofloxacino\", \"danofloxacinum\")" "character(0)"
|
||||
"DPS" "J04BA02" 2955 "Dapsone" "Other antibacterials" "Drugs for treatment of lepra" "Drugs for treatment of lepra" "" "c(\"aczone\", \"araldite ht\", \"atrisone\", \"avlosulfon\", \"avlosulfone\", \"avlosulphone\", \"avsulfor\", \"bis sulfone\", \"bissulfone\", \"bissulphone\", \"croysulfone\", \"croysulphone\", \"dapson\", \"dapsona\", \"dapsone\", \"dapsonum\", \"di sulfone\", \"diaphenyl sulfone\", \"diaphenylsulfon\", \"diaphenylsulfone\", \"diaphenylsulphon\", \"diaphenylsulphone\", \"dimitone\", \"diphenasone\", \"diphone\", \"disulfone\", \"disulone\", \"disulphone\", \"dubronax\", \"dubronaz\", \"dumitone\", \"eporal\", \"metabolite c\", \"novophone\", \"protogen\", \"servidapson\",
|
||||
\"slphadione\", \"sulfadione\", \"sulfona\", \"sulfone ucb\", \"sulfonyldianiline\", \"sulphadione\", \"sulphonyldianiline\", \"sumicure s\", \"tarimyl\", \"udolac\", \"wln: zr dswr dz\")" 50 "mg" "9747-7"
|
||||
"DAP" "J01XX09" 16134395 "Daptomycin" "Other antibacterials" "Other antibacterials" "Other antibacterials" "c(\"dap\", \"dapt\")" "c(\"cidecin\", \"cubicin\", \"dapcin\", \"daptomicina\", \"daptomycine\", \"daptomycinum\")" 0.28 "g" "character(0)"
|
||||
"DFX" 487101 "Delafloxacin" "Quinolones" "" "c(\"baxdela\", \"delafloxacin\", \"delafloxacinum\")" "character(0)"
|
||||
"DLM" "J04AK06" 6480466 "Delamanid" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "dela" "c(\"delamanid\", \"deltyba\")" 0.2 "character(0)"
|
||||
"DEM" "J01AA01" 54680690 "Demeclocycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "" "c(\"bioterciclin\", \"clortetrin\", \"deganol\", \"demeclociclina\", \"demeclocycline\", \"demeclocyclinum\", \"demeclor\", \"demetraclin\", \"diuciclin\", \"elkamicina\", \"ledermycin\", \"mexocine\", \"novotriclina\", \"perciclina\", \"sumaclina\")" 0.6 "g" "c(\"10982-7\", \"29494-2\")"
|
||||
"DKB" "J01GB09" 470999 "Dibekacin" "Aminoglycosides" "Aminoglycoside antibacterials" "Other aminoglycosides" "" "c(\"debecacin\", \"dibekacin\", \"dibekacin sulfate\", \"dibekacina\", \"dibekacine\", \"dibekacinum\", \"dideoxykanamycin b\", \"kappati\", \"orbicin\", \"panamicin\")" 0.14 "g" "character(0)"
|
||||
"DIC" "J01CF01" 18381 "Dicloxacillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "c(\"\", \"dicl\")" "c(\"dichloroxacillin\", \"diclossacillina\", \"dicloxaciclin\", \"dicloxacilin\", \"dicloxacilina\", \"dicloxacillin\", \"dicloxacillin sodium\", \"dicloxacillina\", \"dicloxacilline\", \"dicloxacillinum\", \"dicloxacycline\", \"dycill\", \"dynapen\", \"maclicine\", \"nm|| dicloxacillin\", \"pathocil\")" 2 "g" 2 "g" "c(\"10984-3\", \"16769-2\", \"25252-8\")"
|
||||
"DIF" 56206 "Difloxacin" "Quinolones" "" "difloxacin" "character(0)"
|
||||
"DIR" "J01FA13" 6473883 "Dirithromycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "" "c(\"dirithromycin\", \"dirithromycine\", \"dirithromycinum\", \"diritromicina\", \"divitross\", \"dynabac\", \"noriclan\", \"valodin\")" 0.5 "g" "character(0)"
|
||||
"DOR" "J01DH04" 73303 "Doripenem" "Carbapenems" "Other beta-lactam antibacterials" "Carbapenems" "dori" "c(\"doribax\", \"doripenem\", \"doripenem hydrate\", \"finibax\")" 1.5 "character(0)"
|
||||
"DOX" "J01AA02" 54671203 "Doxycycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "c(\"dox\", \"doxy\")" "c(\"atridox\", \"azudoxat\", \"deoxymykoin\", \"dossiciclina\", \"doxcycline anhydrous\", \"doxiciclina\", \"doxitard\", \"doxivetin\", \"doxycen\", \"doxychel\", \"doxycin\", \"doxycyclin\", \"doxycycline\", \"doxycycline calcium\", \"doxycycline hyclate\", \"doxycyclinum\", \"doxylin\", \"doxysol\", \"doxytec\", \"doxytetracycline\", \"hydramycin\", \"investin\", \"jenacyclin\", \"liviatin\", \"monodox\", \"oracea\", \"periostat\", \"ronaxan\", \"spanor\", \"supracyclin\", \"vibramycin\", \"vibramycin novum\", \"vibramycine\", \"vibravenos\", \"zenavod\")" 0.1 "g" 0.1 "g" "c(\"10986-8\", \"21250-6\", \"26902-7\")"
|
||||
"ECO" "J01XDXX" 3198 "Econazole" "Antifungals/antimycotics" "econ" "c(\"econazol\", \"econazole\", \"econazolum\", \"ecostatin\", \"ecostatin cream\", \"palavale\", \"pevaryl\", \"spectazole\", \"spectazole cream\")" "character(0)"
|
||||
"ENX" "J01MA04" 3229 "Enoxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"\", \"enox\")" "c(\"almitil\", \"bactidan\", \"bactidron\", \"comprecin\", \"enofloxacine\", \"enoksetin\", \"enoram\", \"enoxacin\", \"enoxacina\", \"enoxacine\", \"enoxacino\", \"enoxacinum\", \"enoxen\", \"enoxin\", \"enoxor\", \"flumark\", \"penetrex\")" 0.8 "g" "c(\"16816-1\", \"3590-7\")"
|
||||
"ENR" 71188 "Enrofloxacin" "Quinolones" "" "c(\"baytril\", \"enrofloxacin\", \"enrofloxacine\", \"enrofloxacino\", \"enrofloxacinum\")" "character(0)"
|
||||
"ENV" 135565326 "Enviomycin (Tuberactinomycin)" "Antimycobacterials" "" "c(\"enviomicina\", \"enviomycin\", \"enviomycina\", \"enviomycinum\")" "character(0)"
|
||||
"EPE" "Eperozolid" "Other antibacterials" "" "" ""
|
||||
"EPC" "J01CA07" 71392 "Epicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "" "c(\"dexacillin\", \"dihydroampicillin\", \"epicilina\", \"epicillin\", \"epicilline\", \"epicillinum\")" 2 "g" 2 "g" "character(0)"
|
||||
"EPP" 68916 "Epiroprim" "Other antibacterials" "" "c(\"epiroprim\", \"epiroprima\", \"epiroprime\", \"epiroprimum\")" "character(0)"
|
||||
"ERV" "J01AA13" 54726192 "Eravacycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "erav" "eravacycline" "character(0)"
|
||||
"ETP" "J01DH03" 150610 "Ertapenem" "Carbapenems" "Other beta-lactam antibacterials" "Carbapenems" "c(\"erta\", \"etp\")" "c(\"ertapenem\", \"invanz\")" 1 "g" "character(0)"
|
||||
"ERY" "J01FA01" 12560 "Erythromycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "c(\"e\", \"em\", \"ery\", \"eryt\")" "c(\"abboticin\", \"abomacetin\", \"acneryne\", \"acnesol\", \"akne cordes losung\", \"aknederm ery gel\", \"aknemycin\", \"austrias\", \"benzamycin\", \"derimer\", \"deripil\", \"dotycin\", \"dumotrycin\", \"emuvin\", \"emycin\", \"endoeritrin\", \"erecin\", \"erisone\", \"eritomicina\", \"eritrocina\", \"eritromicina\", \"ermycin\", \"eryacne\", \"eryacnen\", \"eryc sprinkles\", \"erycen\", \"erycette\", \"erycin\", \"erycinum\", \"eryderm\", \"erydermer\", \"erygel\", \"eryhexal\", \"erymax\", \"erymed\", \"erysafe\", \"erytab\", \"erythrocin\", \"erythrocin stearate\",
|
||||
\"erythroderm\", \"erythrogran\", \"erythroguent\", \"erythromid\", \"erythromycin\", \"erythromycin a\", \"erythromycin base\", \"erythromycin lactate\", \"erythromycine\", \"erythromycines\", \"erythromycinum\", \"erytop\", \"erytrociclin\", \"ilocaps\", \"ilosone\", \"iloticina\", \"ilotycin\", \"ilotycin gluceptate\", \"ilotycin t.s.\", \"inderm\", \"inderm gel\", \"indermretcin\", \"latotryd\", \"lederpax\", \"mephamycin\", \"mercina\", \"oftamolets\", \"paediathrocin\", \"pantoderm\", \"pantodrin\", \"pantomicina\", \"pce dispertab\", \"pharyngocin\", \"primacine\",
|
||||
\"propiocine\", \"proterytrin\", \"retcin\", \"robimycin\", \"romycin\", \"sansac\", \"skid gel e\", \"staticin\", \"stiemicyn\", \"stiemycin\", \"theramycin z\", \"tiloryth\", \"tiprocin\", \"torlamicina\", \"udima ery gel\", \"wyamycin s\")" 2 "g" 1 "g" "c(\"12298-6\", \"16829-4\", \"25275-9\", \"3597-2\")"
|
||||
"ETH" "J04AK02" 14052 "Ethambutol" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "etha" "c(\"aethambutolum\", \"ebutol\", \"etambutol\", \"etambutolo\", \"etapiam\", \"ethambutol\", \"ethambutolum\", \"myambutol\", \"mycobutol\", \"purderal\", \"servambutol\")" 1.2 "g" 1.2 "g" "c(\"25404-5\", \"3607-9\")"
|
||||
"ETI" "J04AM03" 456476 "Ethambutol/isoniazid" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "" "" ""
|
||||
"ETI1" "J04AD03" 2761171 "Ethionamide" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Thiocarbamide derivatives" "ethi" "c(\"aethionamidum\", \"aetina\", \"aetiva\", \"amidazin\", \"amidazine\", \"ethatyl\", \"ethimide\", \"ethina\", \"ethinamide\", \"ethionamide\", \"ethionamidum\", \"ethioniamide\", \"ethylisothiamide\", \"ethyonomide\", \"etimid\", \"etiocidan\", \"etionamid\", \"etionamida\", \"etionamide\", \"etioniamid\", \"etionid\", \"etionizin\", \"etionizina\", \"etionizine\", \"fatoliamid\", \"iridocin\", \"iridocin bayer\", \"iridozin\", \"isothin\", \"isotiamida\", \"itiocide\", \"nicotion\", \"nisotin\", \"nizotin\", \"rigenicid\", \"sertinon\", \"teberus\", \"thianid\", \"thianide\",
|
||||
\"thioamide\", \"thiodine\", \"thiomid\", \"thioniden\", \"tianid\", \"tiomid\", \"trecator\", \"trecator sc\", \"trekator\", \"trescatyl\", \"trescazide\", \"tubenamide\", \"tubermin\", \"tuberoid\", \"tuberoson\")" 0.75 "g" "16845-0"
|
||||
"ETO" 6034 "Ethopabate" "Other antibacterials" "" "c(\"amprol plus\", \"ethopabat\", \"ethopabate\", \"ethyl pabate\")" "character(0)"
|
||||
"FAR" "J01DI03" 65894 "Faropenem" "Other antibacterials" "" "c(\"faropenem\", \"faropenem sodium\", \"fropenem\", \"fropenum sodium\")" 0.75 "character(0)"
|
||||
"FDX" 10034073 "Fidaxomicin" "Other antibacterials" "" "c(\"dificid\", \"dificlir\", \"difimicin\", \"fidaxomicin\", \"lipiarmycin\", \"tiacumicin b\")" "character(0)"
|
||||
"FIN" 11567473 "Finafloxacin" "Quinolones" "" "finafloxacin" "character(0)"
|
||||
"FLA" 46783781 "Flavomycin" "Other antibacterials" "" "moenomycin complex" "character(0)"
|
||||
"FLE" "J01MA08" 3357 "Fleroxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"\", \"fler\")" "c(\"fleroxacin\", \"fleroxacine\", \"fleroxacino\", \"fleroxacinum\", \"fleroxicin\", \"megalocin\", \"megalone\", \"megalosin\", \"quinodis\")" 0.4 "g" 0.4 "g" "character(0)"
|
||||
"FLO" 65864 "Flomoxef" "Other antibacterials" "" "c(\"flomoxef\", \"flomoxefo\", \"flomoxefum\")" "character(0)"
|
||||
"FLR" 114811 "Florfenicol" "Other antibacterials" "" "c(\"aquafen\", \"florfenicol\", \"nuflor\", \"nuflor gold\")" "87599-7"
|
||||
"FLC" "J01CF05" 21319 "Flucloxacillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "c(\"clox\", \"flux\")" "c(\"floxacillin\", \"floxapen\", \"floxapen sodium salt\", \"fluclox\", \"flucloxacilina\", \"flucloxacillin\", \"flucloxacilline\", \"flucloxacillinum\", \"fluorochloroxacillin\")" 2 "g" 2 "g" "character(0)"
|
||||
"FLU" "J02AC01" 3365 "Fluconazole" "Antifungals/antimycotics" "Antimycotics for systemic use" "Triazole derivatives" "c(\"fluc\", \"fluz\")" "c(\"alflucoz\", \"alfumet\", \"biocanol\", \"biozole\", \"biozolene\", \"canzol\", \"cryptal\", \"diflazon\", \"diflucan\", \"dimycon\", \"elazor\", \"flucazol\", \"fluconazol\", \"fluconazole\", \"fluconazole capsules\", \"fluconazolum\", \"flucostat\", \"flukezol\", \"flunazol\", \"flunizol\", \"flusol\", \"fluzon\", \"fluzone\", \"forcan\", \"fuconal\", \"fungata\", \"loitin\", \"oxifugol\", \"pritenzol\", \"syscan\", \"trican\", \"triconal\", \"triflucan\", \"zoltec\")" 0.2 "g" 0.2 "g" "c(\"10987-6\", \"16870-8\", \"25255-1\", \"80530-9\")"
|
||||
"FLM" "J01MB07" 3374 "Flumequine" "Quinolones" "Quinolone antibacterials" "Other quinolones" "" "c(\"apurone\", \"fantacin\", \"flumequine\", \"flumequino\", \"flumequinum\", \"flumigal\", \"flumiquil\", \"flumisol\", \"flumix\", \"imequyl\")" 1.2 "g" "character(0)"
|
||||
"FLR1" "J01FA14" 71260 "Flurithromycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "" "c(\"flurithromicina\", \"flurithromycime\", \"flurithromycin\", \"flurithromycine\", \"flurithromycinum\", \"fluritromicina\", \"fluritromycinum\", \"flurizic\")" 0.75 "g" "character(0)"
|
||||
"FFL" 214356 "Fosfluconazole" "Antifungals/antimycotics" "" "c(\"fosfluconazole\", \"phosfluconazole\", \"procif\", \"prodif\")" "character(0)"
|
||||
"FOS" "J01XX01" 446987 "Fosfomycin" "Other antibacterials" "Other antibacterials" "Other antibacterials" "c(\"ff\", \"fm\", \"fo\", \"fos\", \"fosf\")" "c(\"fosfocina\", \"fosfomicina\", \"fosfomycin\", \"fosfomycin sodium\", \"fosfomycine\", \"fosfomycinum\", \"fosfonomycin\", \"monuril\", \"monurol\", \"phosphonemycin\", \"phosphonomycin\", \"veramina\")" 3 "g" 8 "g" "character(0)"
|
||||
"FMD" 572 "Fosmidomycin" "Other antibacterials" "" "c(\"fosmidomycin\", \"fosmidomycina\", \"fosmidomycine\", \"fosmidomycinum\")" "character(0)"
|
||||
"FRM" 8378 "Framycetin" "Aminoglycosides" "c(\"\", \"fram\")" "c(\"actilin\", \"actiline\", \"antibiotique\", \"bycomycin\", \"endomixin\", \"enterfram\", \"fradiomycin\", \"fradiomycin b\", \"fradiomycinum\", \"framicetina\", \"framycetin\", \"framycetin sulfate\", \"framycetine\", \"framycetinum\", \"framygen\", \"fraquinol\", \"jernadex\", \"myacine\", \"myacyne\", \"mycerin\", \"mycifradin\", \"neobrettin\", \"neolate\", \"neomas\", \"neomcin\", \"neomicina\", \"neomin\", \"neomycin\", \"neomycin b\", \"neomycin b sulfate\", \"neomycin solution\", \"neomycin sulfate\", \"neomycin sulphate\", \"neomycinb\", \"neomycine\", \"neomycinum\",
|
||||
\"nivemycin\", \"pimavecort\", \"soframycin\", \"soframycine\", \"tuttomycin\", \"vonamycin\", \"vonamycin powder v\")" "character(0)"
|
||||
"FRZ" 5323714 "Furazolidone" "Other antibacterials" "" "c(\"bifuron\", \"corizium\", \"coryzium\", \"diafuron\", \"enterotoxon\", \"furall\", \"furaxon\", \"furaxone\", \"furazol\", \"furazolidine\", \"furazolidon\", \"furazolidona\", \"furazolidone\", \"furazolidonum\", \"furazolum\", \"furazon\", \"furidon\", \"furovag\", \"furox aerosol powder\", \"furoxal\", \"furoxane\", \"furoxon\", \"furoxone\", \"furoxone liquid\", \"furoxone swine mix\", \"furozolidine\", \"giardil\", \"giarlam\", \"medaron\", \"neftin\", \"nicolen\", \"nifulidone\", \"nifuran\", \"nifurazolidone\", \"nifurazolidonum\", \"nitrofurazolidone\", \"nitrofurazolidonum\",
|
||||
\"nitrofuroxon\", \"optazol\", \"ortazol\", \"puradin\", \"roptazol\", \"sclaventerol\", \"tikofuran\", \"topazone\", \"trichofuron\", \"tricofuron\", \"tricoron\", \"trifurox\", \"viofuragyn\")" "character(0)"
|
||||
"FUS" "J01XC01" 3000226 "Fusidic acid" "Other antibacterials" "Other antibacterials" "Steroid antibacterials" "fusi" "c(\"acide fusidique\", \"acido fusidico\", \"acidum fusidicum\", \"flucidin\", \"fucidate\", \"fucidate sodium\", \"fucidic acid\", \"fucidin\", \"fucidin acid\", \"fucithalmic\", \"fusidate\", \"fusidate acid\", \"fusidic acid\", \"fusidine\", \"fusidinic acid\", \"ramycin\")" 1.5 "g" 1.5 "g" "character(0)"
|
||||
"GAM" 59364992 "Gamithromycin" "Macrolides/lincosamides" "" "gamithromycin" "character(0)"
|
||||
"GRN" 124093 "Garenoxacin" "Quinolones" "" "c(\"ganefloxacin\", \"garenfloxacin\", \"garenoxacin\")" "character(0)"
|
||||
"GAT" "J01MA16" 5379 "Gatifloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"\", \"gati\")" "c(\"gatiflo\", \"gatifloxacin\", \"gatifloxacine\", \"gatifloxcin\", \"gatilox\", \"gatiquin\", \"gatispan\", \"tequin\", \"tequin and zymar\", \"zymaxid\")" 0.4 "g" 0.4 "g" "character(0)"
|
||||
"GEM" "J01MA15" 9571107 "Gemifloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "" "c(\"factiv\", \"factive\", \"gemifioxacin\", \"gemifloxacin\", \"gemifloxacine\", \"gemifloxacino\", \"gemifloxacinum\")" 0.32 "character(0)"
|
||||
"GEN" "J01GB03" 3467 "Gentamicin" "Aminoglycosides" "Aminoglycoside antibacterials" "Other aminoglycosides" "c(\"cn\", \"gen\", \"gent\", \"gm\")" "c(\"apogen\", \"centicin\", \"cidomycin\", \"garasol\", \"genoptic liquifilm\", \"genoptic s.o.p.\", \"gentacycol\", \"gentafair\", \"gentak\", \"gentamar\", \"gentamcin sulfate\", \"gentamicin\", \"gentamicina\", \"gentamicine\", \"gentamicins\", \"gentamicinum\", \"gentamycin\", \"gentamycins\", \"gentamycinum\", \"gentavet\", \"gentocin\", \"jenamicin\", \"lyramycin\", \"oksitselanim\", \"refobacin\", \"refobacin tm\", \"septigen\", \"uromycine\")" 0.24 "g" "c(\"13561-6\", \"13562-4\", \"15106-8\", \"22746-2\", \"22747-0\", \"31091-2\", \"31092-0\", \"31093-8\", \"35668-3\", \"3663-2\", \"3664-0\", \"3665-7\", \"39082-3\", \"47109-4\", \"59379-8\", \"80971-5\", \"88111-0\")"
|
||||
"GEH" "Gentamicin-high" "Aminoglycosides" "c(\"gehl\", \"genta high\", \"gentamicin high\")" "" ""
|
||||
"GEP" 25101874 "Gepotidacin" "Other antibacterials" "" "gepotidacin" "character(0)"
|
||||
"GRX" "J01MA11" 72474 "Grepafloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"\", \"grep\")" "grepafloxacin" 0.4 "g" "character(0)"
|
||||
"GRI" 441140 "Griseofulvin" "Antifungals/antimycotics" "" "c(\"amudane\", \"curling factor\", \"delmofulvina\", \"fulcin\", \"fulcine\", \"fulvican grisactin\", \"fulvicin\", \"fulvicin bolus\", \"fulvidex\", \"fulvina\", \"fulvinil\", \"fulvistatin\", \"fungivin\", \"greosin\", \"gresfeed\", \"gricin\", \"grifulin\", \"grifulvin\", \"grifulvin v\", \"grisactin\", \"grisactin ultra\", \"grisactin v\", \"griscofulvin\", \"grise ostatin\", \"grisefuline\", \"griseo\", \"griseofulvin\", \"griseofulvin forte\", \"griseofulvina\", \"griseofulvine\", \"griseofulvinum\", \"griseomix\", \"griseostatin\", \"grisetin\", \"grisofulvin\",
|
||||
\"grisovin\", \"grisovin fp\", \"grizeofulvin\", \"grysio\", \"guservin\", \"lamoryl\", \"likuden\", \"likunden\", \"murfulvin\", \"poncyl\", \"spirofulvin\", \"sporostatin xan\", \"xuanjing\")" "12402-4"
|
||||
"HAB" 175989 "Habekacin" "Aminoglycosides" "" "c(\"arbekacin sulfate\", \"habekacin\", \"habekacin sulfate\", \"habekacin xsulfate\")" "character(0)"
|
||||
"HCH" "J02AA02" 11979956 "Hachimycin" "Antifungals/antimycotics" "Antimycotics for systemic use" "Antibiotics" "" "c(\"cabimicina\", \"hachimicina\", \"hachimycin\", \"hachimycine\", \"hachimycinum\", \"trichomycinum\", \"trichonat\")" "character(0)"
|
||||
"HET" "J01CA18" 443387 "Hetacillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "" "c(\"etacillina\", \"hetacilina\", \"hetacillin\", \"hetacilline\", \"hetacillinum\", \"phenazacillin\", \"versapen\")" 2 "g" "character(0)"
|
||||
"HYG" 56928061 "Hygromycin" "Aminoglycosides" "" "c(\"antihelmycin\", \"hydromycin b\", \"hygrovetine\")" "character(0)"
|
||||
"ICL" 213043 "Iclaprim" "Other antibacterials" "" "c(\"iclaprim\", \"mersarex\")" "character(0)"
|
||||
"IPM" "J01DH51" 104838 "Imipenem" "Carbapenems" "Other beta-lactam antibacterials" "Carbapenems" "c(\"imci\", \"imi\", \"imip\", \"imp\")" "c(\"imipemide\", \"imipenem\", \"imipenem anhydrous\", \"imipenem/cilastatin\", \"imipenemum\", \"imipenen\", \"primaxin\", \"tienamycin\")" 2 "g" "c(\"17010-0\", \"25257-7\", \"27331-8\", \"3688-9\")"
|
||||
"IPE" "Imipenem/EDTA" "Carbapenems" "" "" ""
|
||||
"IMR" "Imipenem/relebactam" "Carbapenems" "" "" ""
|
||||
"ISV" 6918485 "Isavuconazole" "Antifungals/antimycotics" "c(\"\", \"isav\")" "isavuconazole" "character(0)"
|
||||
"ISE" "J01GB11" 3037209 "Isepamicin" "Aminoglycosides" "Aminoglycoside antibacterials" "Other aminoglycosides" "" "c(\"isepacin\", \"isepalline\", \"isepamicin\", \"isepamicina\", \"isepamicine\", \"isepamicinum\")" 0.4 "g" "character(0)"
|
||||
"ISO" "D01AC05" 3760 "Isoconazole" "Antifungals/antimycotics" "Antimycotics for topic use" "Triazole derivatives" "" "c(\"isoconazol\", \"isoconazole\", \"isoconazolum\", \"travogen\")" "character(0)"
|
||||
"INH" "J04AC01" 3767 "Isoniazid" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Hydrazides" "inh" "c(\"abdizide\", \"andrazide\", \"anidrasona\", \"antimicina\", \"antituberkulosum\", \"armacide\", \"armazid\", \"armazide\", \"atcotibine\", \"azt + isoniazid\", \"azuren\", \"bacillin\", \"cemidon\", \"chemiazid\", \"chemidon\", \"continazine\", \"cortinazine\", \"cotinazin\", \"cotinizin\", \"defonin\", \"dibutin\", \"diforin\", \"dinacrin\", \"ditubin\", \"ebidene\", \"eralon\", \"ertuban\", \"eutizon\", \"evalon\", \"fetefu\", \"fimalene\", \"hid rasonil\", \"hidranizil\", \"hidrasonil\", \"hidrulta\", \"hidrun\", \"hycozid\", \"hydrazid\", \"hydrazide\", \"hyozid\", \"i.a.i.\",
|
||||
\"idrazil\", \"inizid\", \"iscotin\", \"isidrina\", \"ismazide\", \"isobicina\", \"isocid\", \"isocidene\", \"isocotin\", \"isohydrazide\", \"isokin\", \"isolyn\", \"isonerit\", \"isonex\", \"isoniacid\", \"isoniazid\", \"isoniazid sa\", \"isoniazida\", \"isoniazide\", \"isoniazidum\", \"isonicazide\", \"isonicid\", \"isonico\", \"isonicotan\", \"isonicotil\", \"isonicotinhydrazid\", \"isonicotinohydrazide\", \"isonide\", \"isonidrin\", \"isonikazid\", \"isonilex\", \"isonin\", \"isonindon\", \"isonirit\", \"isoniton\", \"isonizida\", \"isonizide\", \"isotamine\", \"isotebe\",
|
||||
\"isotebezid\", \"isotinyl\", \"isozid\", \"isozide\", \"isozyd\", \"laniazid\", \"laniozid\", \"lanizid\", \"mayambutol\", \"mybasan\", \"neoteben\", \"neoxin\", \"neumandin\", \"niadrin\", \"nicazide\", \"nicetal\", \"nicizina\", \"niconyl\", \"nicotibina\", \"nicotibine\", \"nicotisan\", \"nicozide\", \"nidaton\", \"nidrazid\", \"nikozid\", \"niplen\", \"nitadon\", \"niteban\", \"nydrazid\", \"nyscozid\", \"pelazid\", \"percin\", \"phthisen\", \"pycazide\", \"pyreazid\", \"pyricidin\", \"pyridicin\", \"pyrizidin\", \"raumanon\", \"razide\", \"retozide\", \"rifater\", \"rimicid\",
|
||||
\"rimifon\", \"rimiphone\", \"rimitsid\", \"robiselin\", \"robisellin\", \"roxifen\", \"sanohidrazina\", \"sauterazid\", \"sauterzid\", \"stanozide\", \"tebecid\", \"tebenic\", \"tebexin\", \"tebilon\", \"teebaconin\", \"tekazin\", \"tibazide\", \"tibemid\", \"tibiazide\", \"tibinide\", \"tibison\", \"tibivis\", \"tibizide\", \"tibusan\", \"tisiodrazida\", \"tizide\", \"tubazid\", \"tubazide\", \"tubeco\", \"tubecotubercid\", \"tuberian\", \"tubicon\", \"tubilysin\", \"tubizid\", \"tubomel\", \"unicocyde\", \"unicozyde\", \"vazadrine\", \"vederon\", \"zidafimia\", \"zinadon\",
|
||||
\"zonazide\")" 0.3 "g" 0.3 "g" "c(\"25451-6\", \"26756-7\", \"3697-0\", \"40371-7\")"
|
||||
"ITR" "J02AC02" 3793 "Itraconazole" "Antifungals/antimycotics" "Antimycotics for systemic use" "Triazole derivatives" "itra" "c(\"itraconazol\", \"itraconazole\", \"itraconazolum\", \"itraconzaole\", \"itrazole\", \"oriconazole\", \"sporanox\")" 0.2 "g" 0.2 "g" "c(\"10989-2\", \"12392-7\", \"25258-5\", \"27081-9\", \"32184-4\", \"32185-1\", \"80531-7\")"
|
||||
"JOS" "J01FA07" 5282165 "Josamycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "" "c(\"josacine\", \"josamicina\", \"josamycin\", \"josamycine\", \"josamycinum\")" 2 "g" "character(0)"
|
||||
"KAN" "J01GB04" 6032 "Kanamycin" "Aminoglycosides" "Aminoglycoside antibacterials" "Other aminoglycosides" "c(\"hlk\", \"k\", \"kan\", \"kana\", \"km\")" "c(\"kanamicina\", \"kanamycin\", \"kanamycin a\", \"kanamycin base\", \"kanamycine\", \"kanamycinum\", \"kantrex\", \"kenamycin a\", \"klebcil\", \"liposomal kanamycin\")" 1 "g" "c(\"23889-9\", \"3698-8\", \"3699-6\", \"3700-2\", \"47395-9\")"
|
||||
"KAH" "Kanamycin-high" "Aminoglycosides" "c(\"\", \"kahl\")" "" ""
|
||||
"KAC" "Kanamycin/cephalexin" "Aminoglycosides" "" "" ""
|
||||
"KET" "J02AB02" 456201 "Ketoconazole" "Antifungals/antimycotics" "Antimycotics for systemic use" "Imidazole derivatives" "keto" "c(\"extina\", \"fungarest\", \"fungoral\", \"ketocanazole\", \"ketoconazol\", \"ketoconazole\", \"ketoconazolum\", \"ketoderm\", \"nizoral\", \"xolegel\")" 0.2 "g" "c(\"10990-0\", \"12393-5\", \"25259-3\", \"60091-6\", \"60092-4\")"
|
||||
"KIT" "Kitasamycin (Leucomycin)" "Macrolides/lincosamides" "" "" ""
|
||||
"LAS" 5360807 "Lasalocid" "Other antibacterials" "" "c(\"avatec\", \"lasalocid\", \"lasalocid a\", \"lasalocide\", \"lasalocide a\", \"lasalocido\", \"lasalocidum\")" "87598-9"
|
||||
"LTM" "J01DD06" 47499 "Latamoxef" "Cephalosporins (3rd gen.)" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "c(\"mox\", \"moxa\")" "c(\"disodium moxalactam\", \"festamoxin\", \"lamoxactam\", \"latamoxef\", \"latamoxefum\", \"shiomarin\")" 4 "g" "character(0)"
|
||||
"LMU" 25185057 "Lefamulin" "Other antibacterials" "" "lefamulin" "character(0)"
|
||||
"LEN" 65646 "Lenampicillin" "Beta-lactams/penicillins" "" "c(\"lenampicilina\", \"lenampicillin\", \"lenampicillin hcl\", \"lenampicilline\", \"lenampicillinum\")" "character(0)"
|
||||
"LVX" "J01MA12" 149096 "Levofloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"le\", \"lev\", \"levo\", \"lvx\")" "c(\"aeroquin\", \"cravit\", \"cravit hydrate\", \"cravit iv\", \"cravit ophthalmic\", \"elequine\", \"floxacin\", \"floxel\", \"iquix hydrate\", \"leroxacin\", \"lesacin\", \"levaquin\", \"levaquin hydrate\", \"levo floxacin\", \"levofiexacin\", \"levofloxacin\", \"levofloxacin hydrate\", \"levofloxacine\", \"levofloxacino\", \"levofloxacinum\", \"levokacin\", \"levoxacin\", \"mosardal\", \"nofaxin\", \"oftaquix\", \"quixin\", \"reskuin\", \"tavanic\", \"unibiotic\", \"venaxan\", \"volequin\")" 0.5 "g" 0.5 "g" "c(\"21368-6\", \"30532-6\", \"30533-4\")"
|
||||
"LND" 9850038 "Levonadifloxacin" "Quinolones" "" "levonadifloxacin" "character(0)"
|
||||
"LSP" "Linco-spectin (lincomycin/spectinomycin)" "Other antibacterials" "" "" ""
|
||||
"LIN" "J01FF02" 3000540 "Lincomycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Lincosamides" "linc" "c(\"cillimycin\", \"jiemycin\", \"lincolcina\", \"lincolnensin\", \"lincomicina\", \"lincomycin\", \"lincomycin a\", \"lincomycine\", \"lincomycinum\")" 1.8 "g" 1.8 "g" "87597-1"
|
||||
"LNZ" "J01XX08" 441401 "Linezolid" "Oxazolidinones" "Other antibacterials" "Other antibacterials" "c(\"line\", \"lnz\", \"lz\", \"lzd\")" "c(\"linezlid\", \"linezoid\", \"linezolid\", \"linezolide\", \"linezolidum\", \"zivoxid\", \"zyvoxa\", \"zyvoxam\", \"zyvoxid\")" 1.2 "g" 1.2 "g" "c(\"34202-2\", \"80609-1\")"
|
||||
"LFE" "Linoprist-flopristin" "Other antibacterials" "" "" ""
|
||||
"LOM" "J01MA07" 3948 "Lomefloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"lmf\", \"lom\", \"lome\")" "c(\"lomefloxacin\", \"lomefloxacine\", \"lomefloxacino\", \"lomefloxacinum\", \"maxaquin\")" 0.4 "character(0)"
|
||||
"LOR" "J01DC08" 5284585 "Loracarbef" "Cephalosporins (2nd gen.)" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "c(\"\", \"lora\")" "c(\"anhydrous loracarbef\", \"lorabid\", \"loracarbef\", \"loracarbefum\", \"lorbef\", \"loribid\")" 0.6 "g" "character(0)"
|
||||
"LYM" "J01AA04" 54707177 "Lymecycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "" "c(\"biovetin\", \"chlortetracyclin\", \"ciclisin\", \"ciclolysal\", \"infaciclina\", \"limeciclina\", \"lisinbiotic\", \"lymecyclin\", \"lymecycline\", \"lymecyclinum\", \"mucomycin\", \"ntetracycline\", \"tetralisal\", \"tetralysal\", \"vebicyclysal\")" 0.6 "g" 0.6 "g" "character(0)"
|
||||
"MNA" "J01XX06" 1292 "Mandelic acid" "Other antibacterials" "Other antibacterials" "Other antibacterials" "" "c(\"acido mandelico\", \"almond acid\", \"amygdalic acid\", \"benzoglycolic acid\", \"hydroxyacetic acid\", \"kyselina mandlova\", \"mandelic acid\", \"paramandelic acid\", \"phenylglycolic acid\", \"uromaline\")" 12 "g" "character(0)"
|
||||
"MAR" 60651 "Marbofloxacin" "Quinolones" "" "c(\"marbocyl\", \"marbofloxacin\", \"marbofloxacine\", \"marbofloxacino\", \"marbofloxacinum\", \"zeniquin\")" "character(0)"
|
||||
"MEC" "J01CA11" 36273 "Mecillinam (Amdinocillin)" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "" "c(\"amdinocillin\", \"coactin\", \"hexacillin\", \"mecilinamo\", \"mecillinam\", \"mecillinamum\", \"micillinam\", \"penicillin hx\", \"selexidin\")" 1.2 "g" "character(0)"
|
||||
"MEL" 71306732 "Meleumycin" "Macrolides/lincosamides" "" "" ""
|
||||
"MEM" "J01DH02" 441130 "Meropenem" "Carbapenems" "Other beta-lactam antibacterials" "Carbapenems" "c(\"mem\", \"mer\", \"mero\", \"mp\", \"mrp\")" "c(\"meronem\", \"meropen\", \"meropenem\", \"meropenem anhydrous\", \"meropenem hydrate\", \"meropenem trihydrate\", \"meropenemum\", \"merrem\", \"merrem i.v.\", \"merrem iv\")" 3 "g" "41406-0"
|
||||
"MNC" "Meropenem/nacubactam" "Carbapenems" "" "" ""
|
||||
"MEV" "J01DH52" "Meropenem/vaborbactam" "Carbapenems" "Other beta-lactam antibacterials" "Carbapenems" "" "" ""
|
||||
"MES" 176886 "Mesulfamide" "Other antibacterials" "" "c(\"mesulfamide\", \"mesulfamido\", \"mesulfamidum\")" "character(0)"
|
||||
"MTC" "J01AA05" 54675785 "Metacycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "" "c(\"bialatan\", \"metaciclina\", \"metacycline\", \"metacyclinum\", \"methacycline\", \"methacycline base\", \"methacyclinum\", \"methylenecycline\", \"physiomycine\", \"rondomycin\")" 0.6 "g" "character(0)"
|
||||
"MTM" "J01CA14" 6713928 "Metampicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "" "c(\"blomopen\", \"bonopen\", \"celinmicina\", \"elatocilline\", \"fedacilina kapseln\", \"filorex\", \"italcina kapseln\", \"magnipen\", \"metabacter ampullen\", \"metambac\", \"metampicilina\", \"metampicillin\", \"metampicillin sodium\", \"metampicillina\", \"metampicilline\", \"metampicillinum\", \"methampicillin\", \"metiskia ampullen\", \"micinovo\", \"micinovo ampullen\", \"pangocilin\", \"probiotic\", \"rastomycin k\", \"relyothenate\", \"ruticina\", \"rutizina\", \"rutizina ampullen\", \"sedomycin\", \"suvipen\", \"suvipen ampullen\", \"tampilen ampullen\",
|
||||
\"teonicon trofen\", \"viderpen\", \"viderpin\", \"vioplex\")" 1.5 "g" 1.5 "g" "character(0)"
|
||||
"MTH" "J01XX05" 4101 "Methenamine" "Other antibacterials" "Other antibacterials" "Other antibacterials" "" "c(\"aceto hmt\", \"aminoform\", \"aminoformaldehyde\", \"ammoform\", \"ammonioformaldehyde\", \"antihydral\", \"cystamin\", \"cystex\", \"cystogen\", \"duirexol\", \"ekagom h\", \"esametilentetramina\", \"formamine\", \"formin\", \"h.m.t.\", \"heksa k\", \"herax uts\", \"heterin\", \"hexa b\", \"hexaform\", \"hexaloids\", \"hexamethylamine\", \"hexamethylenamine\", \"hexamethyleneamine\", \"hexamethylentetramin\", \"hexamine\", \"hexamine silver\", \"hexamine superfine\", \"hexaminum\", \"hexasan\", \"hexilmethylenamine\", \"metenamina\", \"metenamine\", \"methamin\",
|
||||
\"methenamin\", \"methenamine\", \"methenamine silver\", \"methenaminum\", \"metramine\", \"naphthamine\", \"nocceler h\", \"preparation af\", \"resotropin\", \"sanceler h\", \"sanceler ht\", \"silver methenamine\", \"uramin\", \"uratrine\", \"urisol\", \"uritone\", \"urodeine\", \"urotropin\", \"urotropine\", \"vesaloin\", \"vesalvine\", \"xametrin\")" 3 "g" "character(0)"
|
||||
"MET" "J01CF03" 6087 "Methicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "meti" "c(\"dimocillin\", \"metacillin\", \"methcilline\", \"methicillin\", \"methicillinum\", \"methycillin\", \"meticilina\", \"meticillin\", \"meticillina\", \"meticilline\", \"meticillinum\", \"staphcillin\")" 4 "g" "c(\"29492-6\", \"3788-7\")"
|
||||
"MTP" 68590 "Metioprim" "Other antibacterials" "" "c(\"methioprim\", \"metioprim\", \"metioprima\", \"metioprime\", \"metioprimum\")" "character(0)"
|
||||
"MXT" 3047729 "Metioxate" "Quinolones" "" "c(\"metioxate\", \"metioxato\", \"metioxatum\")" "character(0)"
|
||||
"MTR" "J01XD01" 4173 "Metronidazole" "Other antibacterials" "Other antibacterials" "Imidazole derivatives" "c(\"metr\", \"mnz\")" "c(\"acromona\", \"anagiardil\", \"arilin\", \"atrivyl\", \"danizol\", \"deflamon\", \"efloran\", \"elyzol\", \"entizol\", \"flagemona\", \"flagesol\", \"flagil\", \"flagyl\", \"flagyl er\", \"flagyl i.v.\", \"flagyl i.v. rtu\", \"flazol\", \"flegyl\", \"florazole\", \"fossyol\", \"giatricol\", \"ginefla vir\", \"gineflavir\", \"helidac\", \"mepagyl\", \"meronidal\", \"methronidazole\", \"metric\", \"metro cream\", \"metro gel\", \"metro i.v\", \"metro i.v.\", \"metro iv\", \"metrocream\", \"metrodzhil\", \"metrogel\", \"metrogyl\", \"metrolag\", \"metrolotion\", \"metrolyl\",
|
||||
\"metromidol\", \"metronidaz\", \"metronidazol\", \"metronidazole\", \"metronidazole usp\", \"metronidazolo\", \"metronidazolum\", \"metrotop\", \"metrozine\", \"metryl\", \"mexibol\", \"mexibol 'silanes'\", \"monagyl\", \"monasin\", \"nidagel\", \"nidagyl\", \"noritate\", \"novonidazol\", \"orvagil\", \"polibiotic\", \"protostat\", \"rathimed\", \"rosased\", \"sanatrichom\", \"satric\", \"takimetol\", \"trichazol\", \"trichex\", \"tricho cordes\", \"trichobrol\", \"trichocide\", \"trichomol\", \"trichopal\", \"trichopol\", \"tricocet\", \"tricom\", \"tricowas b\", \"trikacide\",
|
||||
\"trikamon\", \"trikhopol\", \"trikojol\", \"trikozol\", \"trimeks\", \"trivazol\", \"vagilen\", \"vagimid\", \"vandazole\", \"vertisal\", \"wagitran\", \"zadstat\", \"zidoval\")" 1.5 "g" "10991-8"
|
||||
"MEZ" "J01CA10" 656511 "Mezlocillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "c(\"mez\", \"mezl\", \"mz\")" "c(\"mezlin\", \"mezlocilina\", \"mezlocillin\", \"mezlocillin acid\", \"mezlocillin sodium\", \"mezlocilline\", \"mezlocillinum\", \"multocillin\")" 6 "g" "3820-8"
|
||||
"MSU" "Mezlocillin/sulbactam" "Beta-lactams/penicillins" "" "" ""
|
||||
"MIF" "J02AX05" 477468 "Micafungin" "Antifungals/antimycotics" "Antimycotics for systemic use" "Other antimycotics for systemic use" "c(\"\", \"mica\")" "c(\"micafungin\", \"mycamine\")" 0.1 "g" "58418-5"
|
||||
"MCZ" "J02AB01" 4189 "Miconazole" "Antifungals/antimycotics" "Antimycotics for systemic use" "Imidazole derivatives" "mico" "c(\"aflorix\", \"albistat\", \"andergin\", \"brentan\", \"conofite\", \"dactarin\", \"daktarin\", \"daktarin iv\", \"florid\", \"lotrimin af\", \"micantin\", \"miconasil nitrate\", \"miconazol\", \"miconazole\", \"miconazole base\", \"miconazolo\", \"miconazolum\", \"micozole\", \"minostate\", \"monista\", \"monistat\", \"monistat iv\", \"oravig\", \"vusion\", \"zimybase\", \"zimycan\")" 1 "g" "17278-3"
|
||||
"MCR" 3037206 "Micronomicin" "Aminoglycosides" "" "c(\"gentamicin c\", \"micromycin\", \"micronomicin\", \"micronomicina\", \"micronomicine\", \"micronomicinum\", \"sagamicin\", \"santemycin\")" "character(0)"
|
||||
"MID" "J01FA03" 5282169 "Midecamycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "" "c(\"aboren\", \"espinomycin a\", \"macropen\", \"madecacine\", \"medemycin\", \"midecamicina\", \"midecamycin\", \"midecamycin a\", \"midecamycine\", \"midecamycinum\", \"midecin\", \"momicine\", \"mydecamycin\", \"myoxam\", \"normicina\", \"rubimycin\", \"turimycin p\")" 1.2 1 "g" "character(0)"
|
||||
"MIL" 37614 "Miloxacin" "Quinolones" "" "c(\"miloxacin\", \"miloxacine\", \"miloxacino\", \"miloxacinum\")" "character(0)"
|
||||
"MNO" "J01AA08" 54675783 "Minocycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "c(\"mc\", \"mh\", \"mi\", \"min\", \"mino\", \"mn\", \"mno\")" "c(\"akamin\", \"aknemin\", \"borymycin\", \"dynacin\", \"klinomycin\", \"minociclina\", \"minocin\", \"minocline\", \"minocyclin\", \"minocycline\", \"minocyclinum\", \"minocyn\", \"minoderm\", \"minomycin\", \"sebomin\", \"solodyn\", \"vectrin\")" 0.2 "g" 0.2 "g" "c(\"34606-4\", \"3822-4\", \"49757-8\")"
|
||||
"MCM" "J01FA11" 5282188 "Miocamycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "" "c(\"acecamycin\", \"macroral\", \"midecamycin acetate\", \"miocamen\", \"miocamycine\", \"miokamycin\", \"myocamicin\", \"ponsinomycin\")" 1.2 "g" "character(0)"
|
||||
"MON" 23667299 "Monensin sodium" "Other antibacterials" "" "c(\"monensin sodium\", \"sodium monensin\")" "character(0)"
|
||||
"MRN" "J04AK04" 70374 "Morinamide" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "" "c(\"morfazinamide\", \"morfazinammide\", \"morfgazinamide\", \"morinamida\", \"morinamide\", \"morinamidum\", \"morphazinamid\", \"morphazinamide\", \"piazofolina\", \"piazolin\", \"piazolina\")" "character(0)"
|
||||
"MFX" "J01MA14" 152946 "Moxifloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"mox\", \"moxi\", \"mxf\")" "c(\"actira\", \"avelox\", \"avelox i.v.\", \"avelox iv\", \"avolex\", \"izilox\", \"moxeza\", \"moxifloxacin\", \"moxifloxacine\", \"vigamox\")" 0.4 "g" 0.4 "g" "c(\"43751-7\", \"45223-5\", \"80540-8\")"
|
||||
"MUP" "R01AX06" 446596 "Mupirocin" "Other antibacterials" "c(\"mup\", \"mupi\")" "c(\"bactoderm\", \"bactroban\", \"bactroban nasal\", \"bactroban ointment\", \"centany\", \"mupirocin\", \"mupirocina\", \"mupirocine\", \"mupirocinum\", \"plasimine\", \"pseudomonic acid\", \"pseudomonic acid a\", \"turixin\")" "character(0)"
|
||||
"NAC" 73386748 "Nacubactam" "Beta-lactams/penicillins" "" "nacubactam" "character(0)"
|
||||
"NAD" 4410 "Nadifloxacin" "Quinolones" "" "c(\"acuatim\", \"nadifloxacin\", \"nadifloxacine\", \"nadifloxacino\", \"nadifloxacinum\", \"nadixa\", \"nadoxin\")" "character(0)"
|
||||
"NAF" 8982 "Nafcillin" "Beta-lactams/penicillins" "" "c(\"nafcilina\", \"nafcillin\", \"nafcillin sodium\", \"nafcilline\", \"nafcillinum\", \"nallpen\", \"naphcillin\", \"unipen\")" "c(\"10993-4\", \"25232-0\")"
|
||||
"ZWK" 117587595 "Nafithromycin" "Macrolides/lincosamides" "" "nafithromycin" "character(0)"
|
||||
"NAL" "J01MB02" 4421 "Nalidixic acid" "Quinolones" "Quinolone antibacterials" "Other quinolones" "c(\"na\", \"nal\", \"nali\")" "c(\"acide nalidixico\", \"acide nalidixique\", \"acido nalidissico\", \"acido nalidixico\", \"acidum nalidixicum\", \"betaxina\", \"dixiben\", \"dixinal\", \"eucisten\", \"eucistin\", \"innoxalomn\", \"innoxalon\", \"jicsron\", \"kusnarin\", \"naldixic acid\", \"nalidic acid\", \"nalidicron\", \"nalidixan\", \"nalidixane\", \"nalidixate\", \"nalidixate sodium\", \"nalidixic\", \"nalidixic acid\", \"nalidixin\", \"nalidixinic acid\", \"nalidixinsaure\", \"nalitucsan\", \"nalurin\", \"narigix\", \"naxuril\", \"neggram\", \"negram\", \"nevigramon\", \"nicelate\", \"nogram\",
|
||||
\"poleon\", \"sicmylon\", \"specifen\", \"specifin\", \"unaserus\", \"uralgin\", \"uriben\", \"uriclar\", \"urisal\", \"urodixin\", \"uroman\", \"uroneg\", \"uronidix\", \"uropan\", \"wintomylon\", \"wintron\")" 4 "g" "character(0)"
|
||||
"NAR" 65452 "Narasin" "Other antibacterials" "" "c(\"monteban\", \"narasin\", \"narasin a\", \"narasine\", \"narasino\", \"narasinum\", \"narasul\")" "87570-8"
|
||||
"NEO" "J01GB05" 8378 "Neomycin" "Aminoglycosides" "Aminoglycoside antibacterials" "Other aminoglycosides" "neom" "c(\"actilin\", \"actiline\", \"antibiotique\", \"bycomycin\", \"endomixin\", \"enterfram\", \"fradiomycin\", \"fradiomycin b\", \"fradiomycinum\", \"framicetina\", \"framycetin\", \"framycetin sulfate\", \"framycetine\", \"framycetinum\", \"framygen\", \"fraquinol\", \"jernadex\", \"myacine\", \"myacyne\", \"mycerin\", \"mycifradin\", \"neobrettin\", \"neolate\", \"neomas\", \"neomcin\", \"neomicina\", \"neomin\", \"neomycin\", \"neomycin b\", \"neomycin b sulfate\", \"neomycin solution\", \"neomycin sulfate\", \"neomycin sulphate\", \"neomycinb\", \"neomycine\", \"neomycinum\",
|
||||
\"nivemycin\", \"pimavecort\", \"soframycin\", \"soframycine\", \"tuttomycin\", \"vonamycin\", \"vonamycin powder v\")" 1 "g" "c(\"10995-9\", \"25262-7\")"
|
||||
"NET" "J01GB07" 441306 "Netilmicin" "Aminoglycosides" "Aminoglycoside antibacterials" "Other aminoglycosides" "neti" "c(\"netillin\", \"netilmicin\", \"netilmicin sulfate\", \"netilmicina\", \"netilmicine\", \"netilmicinum\", \"netilyn\", \"netira\", \"vectacin\")" 0.35 "g" 0.35 "g" "c(\"25263-5\", \"3848-9\", \"3849-7\", \"3850-5\", \"47385-0\", \"59565-2\", \"59566-0\", \"59567-8\")"
|
||||
"NIC" 9507 "Nicarbazin" "Other antibacterials" "" "c(\"nicarb\", \"nicarbasin\", \"nicarbazin\", \"nicarbazine\", \"nicoxin\", \"nicrazin\", \"nicrazine\", \"nirazin\")" "character(0)"
|
||||
"NIF" 71946 "Nifuroquine" "Quinolones" "" "c(\"nifuroquina\", \"nifuroquine\", \"nifuroquinum\", \"quinaldofur\")" "character(0)"
|
||||
"NFR" "J01XE02" 9571062 "Nifurtoinol" "Other antibacterials" "Other antibacterials" "Nitrofuran derivatives" "" "c(\"levantin\", \"nifurtoinol\", \"nifurtoinolo\", \"nifurtoinolum\", \"urfadin\", \"urfadine\", \"urfadyn\")" 0.16 "g" "character(0)"
|
||||
"NTZ" 41684 "Nitazoxanide" "Other antibacterials" "" "c(\"adrovet\", \"alinia\", \"azt + nitazoxanide\", \"colufase\", \"cryptaz\", \"dexidex\", \"heliton\", \"kidonax\", \"nitaxozanid\", \"nitaxozanide\", \"nitazox\", \"nitazoxamide\", \"nitazoxanid\", \"nitazoxanida\", \"nitazoxanide\", \"nitazoxanidum\", \"omniparax\", \"pacovanton\", \"paramix\", \"taenitaz\")" "character(0)"
|
||||
"NIT" "J01XE01" 6604200 "Nitrofurantoin" "Other antibacterials" "Other antibacterials" "Nitrofuran derivatives" "c(\"f\", \"f/m\", \"fd\", \"ft\", \"ni\", \"nit\", \"nitr\")" "c(\"alfuran\", \"benkfuran\", \"berkfuran\", \"berkfurin\", \"ceduran\", \"chemiofuran\", \"cistofuran\", \"cyantin\", \"cystit\", \"dantafur\", \"fua med\", \"fuamed\", \"furabid\", \"furachel\", \"furadantin\", \"furadantin retard\", \"furadantina mc\", \"furadantine\", \"furadantine mc\", \"furadantoin\", \"furadoin\", \"furadoine\", \"furadonin\", \"furadonine\", \"furadoninum\", \"furadontin\", \"furadoxyl\", \"furalan\", \"furaloid\", \"furantoin\", \"furantoina\", \"furatoin\", \"furedan\", \"furina\", \"furobactina\", \"furodantin\", \"furophen t\", \"gerofuran\",
|
||||
\"io>>uss>>a<<ixoo\", \"ituran\", \"ivadantin\", \"macpac\", \"macrobid\", \"macrodantin\", \"macrodantina\", \"macrofuran\", \"macrofurin\", \"nierofu\", \"nifurantin\", \"nifuretten\", \"nitoin\", \"nitrex\", \"nitrofuradantin\", \"nitrofurantion\", \"nitrofurantoin\", \"nitrofurantoin macro\", \"nitrofurantoina\", \"nitrofurantoine\", \"nitrofurantoinum\", \"novofuran\", \"orafuran\", \"parfuran\", \"phenurin\", \"piyeloseptyl\", \"siraliden\", \"trantoin\", \"uerineks\", \"urantoin\", \"urizept\", \"urodin\", \"urofuran\", \"urofurin\", \"urolisa\", \"urolong\",
|
||||
\"uvamin\", \"welfurin\", \"zoofurin\")" 0.2 "g" "3860-4"
|
||||
"NIZ" 5447130 "Nitrofurazone" "Other antibacterials" "" "c(\"acutol\", \"aldomycin\", \"alfucin\", \"amifur\", \"babrocid\", \"becafurazone\", \"biofuracina\", \"biofurea\", \"chemofuran\", \"chixin\", \"cocafurin\", \"coxistat\", \"dermofural\", \"dymazone\", \"dynazone\", \"eldezol\", \"fedacin\", \"flavazone\", \"fracine\", \"furacilin\", \"furacilinum\", \"furacillin\", \"furacin\", \"furacine\", \"furacinetten\", \"furacoccid\", \"furacort\", \"furacycline\", \"furaderm\", \"furagent\", \"furalcyn\", \"furaldon\", \"furalone\", \"furametral\", \"furaplast\", \"furaseptyl\", \"furaskin\", \"furatsilin\", \"furaziline\", \"furazin\",
|
||||
\"furazina\", \"furazol w\", \"furazone\", \"furazyme\", \"furesol\", \"furfurin\", \"furosem\", \"fuvacillin\", \"hemofuran\", \"ibiofural\", \"mammex\", \"mastofuran\", \"monafuracin\", \"monafuracis\", \"monofuracin\", \"nfz mix\", \"nifucin\", \"nifurid\", \"nifuzon\", \"nitrofural\", \"nitrofuralum\", \"nitrofuran\", \"nitrofurane\", \"nitrofurazan\", \"nitrofurazone\", \"nitrofurazonum\", \"nitrofurol\", \"nitrozone\", \"otofural\", \"otofuran\", \"rivafurazon\", \"sanfuran\", \"vabrocid\", \"vadrocid\", \"yatrocin\")" "character(0)"
|
||||
"NTR" "J01XX07" 19910 "Nitroxoline" "Quinolones" "Other antibacterials" "Other antibacterials" "" "c(\"galinok\", \"isinok\", \"nibiol\", \"nicene forte\", \"nitroxolin\", \"nitroxolina\", \"nitroxoline\", \"nitroxolinum\", \"notroxoline\", \"noxibiol\")" 1 "g" "character(0)"
|
||||
"NOR" "J01MA06" 4539 "Norfloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"nor\", \"norf\", \"nx\", \"nxn\")" "c(\"baccidal\", \"barazan\", \"chibroxin\", \"chibroxine\", \"chibroxol\", \"fulgram\", \"gonorcin\", \"lexinor\", \"nolicin\", \"noracin\", \"noraxin\", \"norflo\", \"norfloxacin\", \"norfloxacine\", \"norfloxacino\", \"norfloxacinum\", \"norocin\", \"noroxin\", \"noroxine\", \"norxacin\", \"sebercim\", \"uroxacin\", \"utinor\", \"zoroxin\")" 0.8 "g" "3867-9"
|
||||
"NVA" 10419027 "Norvancomycin" "Glycopeptides" "" "norvancomycin" "character(0)"
|
||||
"NOV" "QJ01XX95" 54675769 "Novobiocin" "Other antibacterials" "novo" "c(\"albamix\", \"albamycin\", \"cardelmycin\", \"cathocin\", \"cathomycin\", \"crystallinic acid\", \"inamycin\", \"novobiocin\", \"novobiocina\", \"novobiocine\", \"novobiocinum\", \"robiocina\", \"sirbiocina\", \"spheromycin\", \"stilbiocina\", \"streptonivicin\")" "17378-1"
|
||||
"NYS" "G01AA01" 6433272 "Nystatin" "Antifungals/antimycotics" "nyst" "c(\"biofanal\", \"candex lotion\", \"comycin\", \"diastatin\", \"herniocid\", \"moronal\", \"myconystatin\", \"mycostatin\", \"mycostatin pastilles\", \"mykinac\", \"mykostatyna\", \"nilstat\", \"nistatin\", \"nistatina\", \"nyamyc\", \"nyotran\", \"nyotrantrade mark\", \"nystaform\", \"nystan\", \"nystatin\", \"nystatin a\", \"nystatin g\", \"nystatin lf\", \"nystatine\", \"nystatinum\", \"nystatyna\", \"nystavescent\", \"nystex\", \"nystop\", \"stamycin\", \"terrastatin\", \"zydin e\")" "character(0)"
|
||||
"OFX" "J01MA01" 4583 "Ofloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"of\", \"ofl\", \"oflo\", \"ofx\")" "c(\"bactocin\", \"danoflox\", \"effexin\", \"exocin\", \"exocine\", \"flobacin\", \"flodemex\", \"flotavid\", \"flovid\", \"floxal\", \"floxil\", \"floxin\", \"floxin otic\", \"floxstat\", \"fugacin\", \"inoflox\", \"kinflocin\", \"kinoxacin\", \"levofloxacin hcl\", \"liflox\", \"loxinter\", \"marfloxacin\", \"medofloxine\", \"mergexin\", \"monoflocet\", \"novecin\", \"nufafloqo\", \"occidal\", \"ocuflox\", \"oflocee\", \"oflocet\", \"oflocin\", \"oflodal\", \"oflodex\", \"oflodura\", \"ofloxacin\", \"ofloxacin otic\", \"ofloxacina\", \"ofloxacine\", \"ofloxacino\", \"ofloxacinum\",
|
||||
\"ofloxin\", \"onexacin\", \"operan\", \"orocin\", \"otonil\", \"oxaldin\", \"pharflox\", \"praxin\", \"puiritol\", \"qinolon\", \"quinolon\", \"quotavil\", \"sinflo\", \"tabrin\", \"taravid\", \"tariflox\", \"tarivid\", \"telbit\", \"tructum\", \"uro tarivid\", \"viotisone\", \"visiren\", \"zanocin\")" 0.4 "g" 0.4 "g" "c(\"25264-3\", \"3877-8\")"
|
||||
"OLE" "J01FA05" 72493 "Oleandomycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "" "c(\"amimycin\", \"landomycin\", \"matromycin\", \"oleandomycin a\", \"romicil\")" 1 "g" "character(0)"
|
||||
"OMC" 54697325 "Omadacycline" "Tetracyclines" "" "c(\"amadacycline\", \"omadacycline\")" "character(0)"
|
||||
"OPT" 87880 "Optochin" "Other antibacterials" "" "c(\"numoquin\", \"optochin\", \"optoquine\")" "character(0)"
|
||||
"ORB" 60605 "Orbifloxacin" "Quinolones" "" "orbifloxacin" "character(0)"
|
||||
"ORI" "J01XA05" 16136912 "Oritavancin" "Glycopeptides" "Other antibacterials" "Glycopeptide antibacterials" "orit" "oritavancin" "character(0)"
|
||||
"ORS" "Ormetroprim/sulfamethoxazole" "Other antibacterials" "" "" ""
|
||||
"ORN" "J01XD03" 28061 "Ornidazole" "Other antibacterials" "Other antibacterials" "Imidazole derivatives" "" "c(\"madelen\", \"ornidal\", \"ornidazol\", \"ornidazole\", \"ornidazolum\", \"tiberal\")" 1 "g" "character(0)"
|
||||
"OXA" "J01CF04" 6196 "Oxacillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "c(\"ox\", \"oxa\", \"oxac\", \"oxal\", \"oxs\")" "c(\"bactocill\", \"ossacillina\", \"oxacilina\", \"oxacillin\", \"oxacillin sodium\", \"oxacilline\", \"oxacillinum\", \"oxazocillin\", \"oxazocilline\", \"prostaphlin\", \"prostaphlyn\", \"sodium oxacillin\")" 2 "g" 2 "g" "c(\"25265-0\", \"3882-8\")"
|
||||
"OXO" "J01MB05" 4628 "Oxolinic acid" "Quinolones" "Quinolone antibacterials" "Other quinolones" "" "c(\"acide oxolinique\", \"acido ossolico\", \"acido oxolinico\", \"acidum oxolinicum\", \"aqualinic\", \"cistopax\", \"dioxacin\", \"emyrenil\", \"gramurin\", \"inoxyl\", \"nidantin\", \"oksaren\", \"orthurine\", \"ossian\", \"oxoboi\", \"oxolinic\", \"oxolinic acid\", \"pietil\", \"prodoxal\", \"prodoxol\", \"starner\", \"tiurasin\", \"ultibid\", \"urinox\", \"uritrate\", \"urotrate\", \"uroxol\", \"utibid\")" 1 "g" "character(0)"
|
||||
"OXY" "J01AA06" 54675779 "Oxytetracycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "" "c(\"adamycin\", \"berkmycen\", \"biostat\", \"biostat pa\", \"dabicycline\", \"dalimycin\", \"embryostat\", \"fanterrin\", \"galsenomycin\", \"geomycin\", \"geotilin\", \"hydroxytetracyclinum\", \"imperacin\", \"lenocycline\", \"macocyn\", \"medamycin\", \"mepatar\", \"oksisyklin\", \"ossitetraciclina\", \"oxacycline\", \"oxitetraciclina\", \"oxitetracyclin\", \"oxitetracycline\", \"oxitetracyclinum\", \"oxydon\", \"oxymycin\", \"oxymykoin\", \"oxypam\", \"oxysteclin\", \"oxyterracin\", \"oxyterracine\", \"oxyterracyne\", \"oxytetracid\", \"oxytetracyclin\", \"oxytetracycline\",
|
||||
\"oxytetracycline base\", \"oxytetracyclinum\", \"proteroxyna\", \"riomitsin\", \"ryomycin\", \"solkaciclina\", \"stecsolin\", \"stevacin\", \"tarocyn\", \"tarosin\", \"teravit\", \"terrafungine\", \"terramitsin\", \"terramycin\", \"terramycin im\", \"tetran\", \"unimycin\", \"ursocyclin\", \"ursocycline\", \"vendarcin\")" 1 "g" 1 "g" "c(\"17396-3\", \"25266-8\", \"87595-5\")"
|
||||
"PAS" 4649 "P-aminosalicylic acid" "Antimycobacterials" "" "c(\"aminopar\", \"aminosalicylic\", \"aminosalicylic acid\", \"aminosalyl\", \"aminox\", \"apacil\", \"deapasil\", \"entepas\", \"ferrosan\", \"gabbropas\", \"helipidyl\", \"hellipidyl\", \"neopasalate\", \"osacyl\", \"pamacyl\", \"pamisyl\", \"paramycin\", \"parasal\", \"parasalicil\", \"parasalindon\", \"pasalon\", \"pasara\", \"pascorbic\", \"pasdium\", \"paser granules\", \"paskalium\", \"pasmed\", \"pasnodia\", \"pasolac\", \"propasa\", \"rezipas\", \"teebacin\", \"wln: zr cq dvq\")" "character(0)"
|
||||
"PAN" 72015 "Panipenem" "Carbapenems" "" "c(\"panipenem\", \"panipenemum\", \"penipanem\")" "character(0)"
|
||||
"PAR" 165580 "Paromomycin" "Other antibacterials" "" "c(\"aminosidin\", \"aminosidine\", \"aminosidine i\", \"aminosidine sulfate\", \"amminosidin\", \"crestomycin\", \"estomycin\", \"gabbromicina\", \"gabbromycin\", \"gabromycin\", \"humatin\", \"humycin\", \"hydroxymycin\", \"hydroxymycin sulfate\", \"monomycin\", \"monomycin a\", \"neomycin e\", \"paramomycin\", \"paramomycin sulfate\", \"paromomicina\", \"paromomycin\", \"paromomycin i\", \"paromomycine\", \"paromomycinum\", \"paucimycin\", \"paucimycinum\", \"quintomycin c\")" "character(0)"
|
||||
"PAZ" "J01MA18" 65957 "Pazufloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "" "c(\"pazufloxacin\", \"pazufloxacine\", \"pazufloxacino\", \"pazufloxacinum\")" 1 "g" "character(0)"
|
||||
"PEF" "J01MA03" 51081 "Pefloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"\", \"pefl\")" "c(\"abactal\", \"labocton\", \"pefloxacin\", \"pefloxacine\", \"pefloxacino\", \"pefloxacinum\", \"perfloxacin\", \"silver pefloxacin\")" 0.8 "g" 0.8 "g" "3906-5"
|
||||
"PNM" "J01CE06" 10250769 "Penamecillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "" "c(\"hydroxymethyl\", \"penamecilina\", \"penamecillin\", \"penamecillina\", \"penamecilline\", \"penamecillinum\")" 1.05 "g" "character(0)"
|
||||
"PNO" "Penicillin/novobiocin" "Beta-lactams/penicillins" "" "" ""
|
||||
"PSU" "Penicillin/sulbactam" "Beta-lactams/penicillins" "" "" ""
|
||||
"PNM1" "J01AA10" 54686187 "Penimepicycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "" "c(\"duamine\", \"hydrocycline\", \"penetracyne\", \"penimepiciclina\", \"penimepicycline\", \"penimepicyclinum\")" "character(0)"
|
||||
"PIM" 65453 "Pentisomicin" "Aminoglycosides" "" "c(\"pentisomicin\", \"pentisomicina\", \"pentisomicine\", \"pentisomicinum\")" "character(0)"
|
||||
"PTZ" 55250256 "Pentizidone" "Other antibacterials" "" "" ""
|
||||
"PEX" 16132253 "Pexiganan" "Other antibacterials" "" "pexiganan" "character(0)"
|
||||
"PHE" "J01CE05" 272833 "Phenethicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "c(\"\", \"fene\")" "c(\"feneticilina\", \"feneticillina\", \"feneticilline\", \"k phenethicillin\", \"phenethicilin\", \"phenethicillinum\", \"pheneticillin\", \"pheneticilline\", \"pheneticillinum\", \"phenoxy pc\", \"potassium penicillin\")" 1 "g" "41471-4"
|
||||
"PHN" "J01CE02" 6869 "Phenoxymethylpenicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "c(\"fepe\", \"peni v\", \"penicillin v\", \"pnv\", \"pv\")" "c(\"acipen v\", \"apocillin\", \"apopen\", \"beromycin\", \"calcipen\", \"compocillin v\", \"crystapen v\", \"distaquaine v\", \"eskacillian v\", \"eskacillin v\", \"fenacilin\", \"fenospen\", \"meropenin\", \"oracillin\", \"oratren\", \"penicillin v\", \"phenocillin\", \"phenomycilline\", \"phenopenicillin\", \"robicillin\", \"rocilin\", \"stabicillin\", \"vebecillin\", \"veetids\", \"vegacillin\")" 2 "g" "character(0)"
|
||||
"PMR" 5284447 "Pimaricin (Natamycin)" "Antifungals/antimycotics" "" "c(\"delvocid\", \"mycophyt\", \"myprozine\", \"natacyn\", \"natamicina\", \"natamycin\", \"natamycine\", \"natamycinum\", \"pimafucin\", \"pimaracin\", \"pimarizin\", \"synogil\", \"tennecetin\")" "character(0)"
|
||||
"PPA" "J01MB04" 4831 "Pipemidic acid" "Quinolones" "Quinolone antibacterials" "Other quinolones" "c(\"pipz\", \"pizu\")" "c(\"acide pipemidique\", \"acido pipemidico\", \"acidum pipemidicum\", \"deblaston\", \"dolcol\", \"pipedac\", \"pipemid\", \"pipemidic\", \"pipemidic acid\", \"pipemidicacid\", \"pipram\", \"uromidin\")" 0.8 "g" "character(0)"
|
||||
"PIP" "J01CA12" 43672 "Piperacillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "c(\"pi\", \"pip\", \"pipc\", \"pipe\", \"pp\")" "c(\"isipen\", \"pentcillin\", \"peperacillin\", \"peracin\", \"piperacilina\", \"piperacillin\", \"piperacillin na\", \"piperacillin sodium\", \"piperacilline\", \"piperacillinum\", \"pipercillin\", \"pipracil\", \"pipril\")" 14 "g" "c(\"25268-4\", \"3972-7\")"
|
||||
"PIS" "Piperacillin/sulbactam" "Beta-lactams/penicillins" "" "" ""
|
||||
"TZP" "J01CR05" 461573 "Piperacillin/tazobactam" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "c(\"p/t\", \"piptaz\", \"piptazo\", \"pita\", \"pt\", \"ptc\", \"ptz\", \"tzp\")" "c(\"\", \"tazocel\", \"tazocillin\", \"tazocin\", \"zosyn\")" 14 "g" "character(0)"
|
||||
"PRC" 71978 "Piridicillin" "Beta-lactams/penicillins" "" "piridicillin" "character(0)"
|
||||
"PRL" 157385 "Pirlimycin" "Other antibacterials" "" "c(\"pirlimycin\", \"pirlimycina\", \"pirlimycine\", \"pirlimycinum\", \"pirsue\")" "character(0)"
|
||||
"PIR" "J01MB03" 4855 "Piromidic acid" "Quinolones" "Quinolone antibacterials" "Other quinolones" "" "c(\"acide piromidique\", \"acido piromidico\", \"acidum piromidicum\", \"actrun c\", \"bactramyl\", \"enterol\", \"gastrurol\", \"panacid\", \"pirodal\", \"piromidic acid\", \"pyrido\", \"reelon\", \"septural\", \"urisept\", \"uropir\", \"zaomeal\")" 2 "g" "character(0)"
|
||||
"PVM" "J01CA02" 33478 "Pivampicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "" "c(\"berocillin\", \"pivaloylampicillin\", \"pivampicilina\", \"pivampicillin\", \"pivampicilline\", \"pivampicillinum\", \"pondocillin\")" 1.05 "g" "character(0)"
|
||||
"PME" "J01CA08" 115163 "Pivmecillinam" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "" "c(\"amdinocillin pivoxil\", \"coactabs\", \"hydroxymethyl\", \"pivmecilinamo\", \"pivmecillinam\", \"pivmecillinam hcl\", \"pivmecillinamum\")" 0.6 "g" "character(0)"
|
||||
"PLZ" 42613186 "Plazomicin" "Aminoglycosides" "" "plazomicin" "92024-9"
|
||||
"PLB" "J01XB02" 49800004 "Polymyxin B" "Polymyxins" "Other antibacterials" "Polymyxins" "c(\"pb\", \"pol\", \"polb\", \"poly\", \"poly b\", \"polymixin\", \"polymixin b\")" "c(\"polimixina b\", \"polumyxin b\", \"polymixin b\", \"polymyxine b\")" 0.15 "g" "c(\"17473-0\", \"25269-2\")"
|
||||
"POP" "Polymyxin B/polysorbate 80" "Polymyxins" "" "" ""
|
||||
"POS" "J02AC04" 468595 "Posaconazole" "Antifungals/antimycotics" "Antimycotics for systemic use" "Triazole derivatives" "posa" "c(\"noxafil\", \"posaconazole\", \"posaconazole sp\", \"posconazole\")" 0.3 "g" 0.3 "g" "c(\"53731-6\", \"80545-7\")"
|
||||
"PRA" 9802884 "Pradofloxacin" "Quinolones" "" "pradofloxacin" "character(0)"
|
||||
"PRX" 71455 "Premafloxacin" "Quinolones" "" "premafloxacin" "character(0)"
|
||||
"PMD" "J04AK08" 456199 "Pretomanid" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "" "" ""
|
||||
"PRM" 6446787 "Primycin" "Macrolides/lincosamides" "" "" ""
|
||||
"PRI" "J01FG01" 11979535 "Pristinamycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Streptogramins" "c(\"\", \"pris\")" "c(\"eskalin v\", \"mikamycin\", \"mikamycine\", \"mikamycinum\", \"ostreogrycinum\", \"pristinamycine\", \"pristinamycinum\", \"stafac\", \"stafytracine\", \"staphylomycin\", \"starfac\", \"streptogramin\", \"vernamycin\", \"virgimycin\", \"virgimycine\", \"virginiamycina\", \"virginiamycine\", \"virginiamycinum\")" 2 "g" "character(0)"
|
||||
"PRB" "J01CE09" 5903 "Procaine benzylpenicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "" "c(\"depocillin\", \"duphapen\", \"hostacillin\", \"hydracillin\", \"jenacillin o\", \"nopcaine\", \"penicillin procaine\", \"retardillin\", \"vetspen\", \"vitablend\")" 0.6 "g" "character(0)"
|
||||
"PRP" "J01CE03" 92879 "Propicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "" "c(\"propicilina\", \"propicillin\", \"propicilline\", \"propicillinum\")" 0.9 "g" "character(0)"
|
||||
"PKA" 9872451 "Propikacin" "Aminoglycosides" "" "c(\"propikacin\", \"propikacina\", \"propikacine\", \"propikacinum\")" "character(0)"
|
||||
"PTH" "J04AD01" 666418 "Prothionamide" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Thiocarbamide derivatives" "prot" "c(\"ektebin\", \"peteha\", \"prothionamide\", \"prothionamidum\", \"protion\", \"protionamid\", \"protionamida\", \"protionamide\", \"protionamidum\", \"protionizina\", \"tebeform\", \"trevintix\", \"tuberex\")" 0.75 "g" "character(0)"
|
||||
"PRU" "J01MA17" 65947 "Prulifloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "" "c(\"prulifloxacin\", \"pruvel\", \"pufloxacin dioxolil\", \"quisnon\")" 0.6 "g" "character(0)"
|
||||
"PZA" "J04AK01" 1046 "Pyrazinamide" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "pyra" "c(\"aldinamid\", \"aldinamide\", \"braccopiral\", \"corsazinmid\", \"dipimide\", \"eprazin\", \"farmizina\", \"isopas\", \"lynamide\", \"novamid\", \"p ezetamid\", \"pezetamid\", \"pharozinamide\", \"piraldina\", \"pirazimida\", \"pirazinamid\", \"pirazinamida\", \"pirazinamide\", \"prazina\", \"pyrafat\", \"pyramide\", \"pyrazide\", \"pyrazinamdie\", \"pyrazinamid\", \"pyrazinamide\", \"pyrazinamidum\", \"pyrazine carboxamide\", \"pyrazineamide\", \"pyrizinamide\", \"rifafour\", \"rozide\", \"tebrazid\", \"tebrazio\", \"tisamid\", \"unipyranamide\", \"zinamide\", \"zinastat\"
|
||||
)" 1.5 "g" "c(\"11001-5\", \"25270-0\")"
|
||||
"QDA" "J01FG02" 11979418 "Quinupristin/dalfopristin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Streptogramins" "c(\"q/d\", \"qda\", \"qida\", \"quda\", \"rp\", \"syn\")" "" 1.5 "g" ""
|
||||
"RAC" 56052 "Ractopamine" "Other antibacterials" "" "c(\"ractopamina\", \"ractopamine\", \"ractopaminum\")" "character(0)"
|
||||
"RAM" 16132338 "Ramoplanin" "Glycopeptides" "" "ramoplanin" "character(0)"
|
||||
"RZM" 10993211 "Razupenem" "Carbapenems" "" "razupenem" "character(0)"
|
||||
"RTP" "A07AA11" 6918462 "Retapamulin" "Other antibacterials" "Intestinal antiinfectives" "Antibiotics" "" "c(\"altabax\", \"altargo\", \"retapamulin\")" 0.6 "g" "character(0)"
|
||||
"RBC" "J02AC05" 44631912 "Ribociclib" "Antifungals/antimycotics" "Antimycotics for systemic use" "Triazole derivatives" "ribo" "c(\"kisqali\", \"ribociclib\")" 0.2 0.2 "character(0)"
|
||||
"RST" "J01GB10" 33042 "Ribostamycin" "Aminoglycosides" "Aminoglycoside antibacterials" "Other aminoglycosides" "" "c(\"dekamycin iv\", \"hetangmycin\", \"ribastamin\", \"ribostamicina\", \"ribostamycin\", \"ribostamycine\", \"ribostamycinum\", \"vistamycin\", \"xylostatin\")" 1 "g" "character(0)"
|
||||
"RID1" 16659285 "Ridinilazole" "Other antibacterials" "" "ridinilazole" "character(0)"
|
||||
"RIB" "J04AB04" 135398743 "Rifabutin" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Antibiotics" "rifb" "c(\"alfacid\", \"ansamicin\", \"ansamycin\", \"ansatipin\", \"ansatipine\", \"mycobutin\", \"rifabutin\", \"rifabutina\", \"rifabutine\", \"rifabutinum\")" 0.15 "g" "24032-5"
|
||||
"RIF" "J04AB02" 135398735 "Rifampicin" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Antibiotics" "rifa" "c(\"abrifam\", \"archidyn\", \"arficin\", \"arzide\", \"azt + rifampin\", \"benemicin\", \"benemycin\", \"dipicin\", \"doloresum\", \"eremfat\", \"famcin\", \"fenampicin\", \"rifadin\", \"rifadin i.v\", \"rifadin i.v.\", \"rifadine\", \"rifagen\", \"rifaldazin\", \"rifaldazine\", \"rifaldin\", \"rifamate\", \"rifamicin amp\", \"rifamor\", \"rifampicin\", \"rifampicin sv\", \"rifampicina\", \"rifampicine\", \"rifampicinum\", \"rifampin\", \"rifamsolin\", \"rifamycin amp\", \"rifaprodin\", \"rifcin\", \"rifobac\", \"rifoldin\", \"rifoldine\", \"riforal\", \"rimactan\", \"rimactane\",
|
||||
\"rimactizid\", \"rimazid\", \"rimycin\", \"sinerdol\", \"tubocin\")" 0.6 "g" 0.6 "g" "character(0)"
|
||||
"RFI" "J04AM02" "Rifampicin/isoniazid" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "" "c(\"rifinah\", \"rimactazid\")" "character(0)"
|
||||
"RPEI" "J04AM06" "Rifampicin/pyrazinamide/ethambutol/isoniazid" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "" "" ""
|
||||
"RPI" "J04AM05" "Rifampicin/pyrazinamide/isoniazid" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "" "" ""
|
||||
"RFM" "J04AB03" 6324616 "Rifamycin" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Antibiotics" "" "c(\"aemcolo\", \"rifacin\", \"rifamicina\", \"rifamicine sv\", \"rifamycin\", \"rifamycine\", \"rifamycinum\", \"rifocin\", \"rifocyn\", \"rifomycin\", \"rifomycin sv\", \"tuborin\")" 0.6 "g" "character(0)"
|
||||
"RFP" "J04AB05" 135403821 "Rifapentine" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Antibiotics" "rifp" "c(\"cyclopentyl rifampin\", \"priftin\", \"rifapentin\", \"rifapentina\", \"rifapentine\", \"rifapentinum\")" 0.11 "g" "character(0)"
|
||||
"RFX" "A07AA11" 6436173 "Rifaximin" "Other antibacterials" "Intestinal antiinfectives" "Antibiotics" "" "c(\"fatroximin\", \"flonorm\", \"lormyx\", \"lumenax\", \"normix\", \"redactiv\", \"rifacol\", \"rifamixin\", \"rifaxidin\", \"rifaximin\", \"rifaximina\", \"rifaximine\", \"rifaximinum\", \"rifaxin\", \"ritacol\", \"spiraxin\", \"xifaxan\", \"xifaxsan\")" 0.6 "g" "character(0)"
|
||||
"RIT" 65633 "Ritipenem" "Carbapenems" "" "ritipenem" "character(0)"
|
||||
"RIA" 163692 "Ritipenem acoxil" "Carbapenems" "" "ritipenem acoxil" "character(0)"
|
||||
"ROK" "J01FA12" 5282211 "Rokitamycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "" "c(\"propionylleucomycin\", \"ricamycin\", \"rokicid\", \"rokital\", \"rokitamicina\", \"rokitamycin\", \"rokitamycine\", \"rokitamycinum\")" 0.8 "g" "character(0)"
|
||||
"RLT" "J01AA09" 54682938 "Rolitetracycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "" "c(\"bristacin\", \"kinteto\", \"reverin\", \"rolitetraciclina\", \"rolitetracycline\", \"rolitetracyclinum\", \"solvocillin\", \"superciclin\", \"synotodecin\", \"synterin\", \"syntetrex\", \"syntetrin\", \"velacicline\", \"velacycline\")" 0.35 "g" "character(0)"
|
||||
"ROS" "J01MB01" 287180 "Rosoxacin" "Quinolones" "Quinolone antibacterials" "Other quinolones" "" "c(\"acrosoxacin\", \"eracine\", \"eradacil\", \"eradacin\", \"rosoxacin\", \"rosoxacine\", \"rosoxacino\", \"rosoxacinum\", \"roxadyl\", \"winuron\")" 0.3 "g" "character(0)"
|
||||
"RXT" "J01FA06" "Roxithromycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "roxi" "" 0.3 "g" ""
|
||||
"RFL" "J01MA10" 58258 "Rufloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "" "c(\"rufloxacin\", \"rufloxacin hcl\", \"rufloxacine\", \"rufloxacino\", \"rufloxacinum\")" 0.2 "g" "character(0)"
|
||||
"SAL" 3085092 "Salinomycin" "Other antibacterials" "" "c(\"coxistac\", \"procoxacin\", \"salinomicina\", \"salinomycin\", \"salinomycine\", \"salinomycinum\")" "87593-0"
|
||||
"SAR" 56208 "Sarafloxacin" "Quinolones" "" "c(\"difloxacine\", \"difloxacino\", \"difloxacinum\", \"saraflox\", \"sarafloxacin\", \"sarafloxacine\", \"sarafloxacino\", \"sarafloxacinum\")" "character(0)"
|
||||
"SRX" 9933415 "Sarmoxicillin" "Beta-lactams/penicillins" "" "sarmoxicillin" "character(0)"
|
||||
"SEC" 71815 "Secnidazole" "Other antibacterials" "" "c(\"flagentyl\", \"secnidal\", \"secnidazol\", \"secnidazole\", \"secnidazolum\", \"secnil\", \"sindose\", \"solosec\")" "character(0)"
|
||||
"SMF" "J04AK05" "Simvastatin/fenofibrate" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "simv" "" 86 ""
|
||||
"SIS" "J01GB08" 36119 "Sisomicin" "Aminoglycosides" "Aminoglycoside antibacterials" "Other aminoglycosides" "siso" "c(\"rickamicin\", \"salvamina\", \"siseptin sulfate\", \"sisomicin\", \"sisomicin sulfate\", \"sisomicina\", \"sisomicine\", \"sisomicinum\", \"sisomin\", \"sisomycin\", \"sissomicin\", \"sizomycin\")" 0.24 "g" "character(0)"
|
||||
"SIT" 461399 "Sitafloxacin" "Quinolones" "" "c(\"gracevit\", \"sitafloxacinisomer\")" "character(0)"
|
||||
"SDA" "J04AA02" 2724368 "Sodium aminosalicylate" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Aminosalicylic acid and derivatives" "" "c(\"bactylan\", \"decapasil\", \"lepasen\", \"monopas\", \"nippas\", \"p.a.s. sodium\", \"pamisyl sodium\", \"parasal sodium\", \"pas sodium\", \"pasade\", \"pasnal\", \"passodico\", \"salvis\", \"sanipirol\", \"sodiopas\", \"sodium p.a.s\", \"sodium pas\", \"teebacin\", \"tubersan\")" 14 "g" 14 "g" "character(0)"
|
||||
"SOL" 25242512 "Solithromycin" "Macrolides/lincosamides" "" "" ""
|
||||
"SPX" "J01MA09" 60464 "Sparfloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"\", \"spar\")" "c(\"esparfloxacino\", \"sparfloxacin\", \"sparfloxacine\", \"sparfloxacinum\")" 0.2 "g" "character(0)"
|
||||
"SPT" "J01XX04" 15541 "Spectinomycin" "Other antibacterials" "Other antibacterials" "Other antibacterials" "c(\"sc\", \"spe\", \"spec\", \"spt\")" "c(\"actinospectacina\", \"adspec\", \"espectinomicina\", \"prospec\", \"specitinomycin\", \"spectam\", \"spectinomicina\", \"spectinomycin\", \"spectinomycin di hcl\", \"spectinomycine\", \"spectinomycinum\", \"stanilo\", \"togamycin\", \"trobicin\")" 3 "g" "character(0)"
|
||||
"SPI" "J01FA02" 6419898 "Spiramycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "c(\"\", \"spir\")" "c(\"espiramicin\", \"provamycin\", \"rovamycin\", \"rovamycine\", \"sequamycin\", \"spiramycine\", \"spiramycinum\")" 3 "g" "character(0)"
|
||||
"SPM" "J01RA04" "Spiramycin/metronidazole" "Other antibacterials" "Combinations of antibacterials" "Combinations of antibacterials" "" "" ""
|
||||
"STR" "J01GA02" "Streptoduocin" "Aminoglycosides" "Aminoglycoside antibacterials" "Streptomycins" "" "" 1 "g" ""
|
||||
"STR1" "J01GA01" 19649 "Streptomycin" "Aminoglycosides" "Aminoglycoside antibacterials" "Streptomycins" "c(\"s\", \"str\", \"stre\")" "c(\"agrept\", \"agrimycin\", \"chemform\", \"estreptomicina\", \"neodiestreptopab\", \"strepcen\", \"streptomicina\", \"streptomycin\", \"streptomycin a\", \"streptomycin spx\", \"streptomycin sulfate\", \"streptomycine\", \"streptomyzin\", \"vetstrep\")" 1 "g" "4039-4"
|
||||
"STH" "Streptomycin-high" "Aminoglycosides" "c(\"sthl\", \"strepto high\", \"streptomycin high\")" "" ""
|
||||
"STI" "J04AM01" "Streptomycin/isoniazid" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "" "" ""
|
||||
"SUL" "J01CG01" 130313 "Sulbactam" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase inhibitors" "" "c(\"betamaze\", \"sulbactam\", \"sulbactam acid\", \"sulbactam free acid\", \"sulbactamum\")" 1 "g" "character(0)"
|
||||
"SBC" "J01CA16" 20055036 "Sulbenicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "" "c(\"kedacillina\", \"sulbenicilina\", \"sulbenicilline\", \"sulbenicillinum\")" 15 "g" "character(0)"
|
||||
"SUC" 5318 "Sulconazole" "Antifungals/antimycotics" "" "c(\"sulconazol\", \"sulconazole\", \"sulconazolum\")" "character(0)"
|
||||
"SUP" 6634 "Sulfachlorpyridazine" "Other antibacterials" "" "c(\"cluricol\", \"cosulid\", \"cosumix\", \"durasulf\", \"nefrosul\", \"nsulfanilamide\", \"prinzone vet\", \"prinzone vet.\", \"solfaclorpiridazina\", \"sonilyn\", \"sulfachlorpyridazine\", \"sulfacloropiridazina\", \"vetisulid\")" "character(0)"
|
||||
"SDI" "J01EC02" 5215 "Sulfadiazine" "Trimethoprims" "Sulfonamides and trimethoprim" "Intermediate-acting sulfonamides" "" "c(\"adiazin\", \"adiazine\", \"cocodiazine\", \"codiazine\", \"cremodiazine\", \"cremotres\", \"debenal\", \"deltazina\", \"diazin\", \"diazolone\", \"diazovit\", \"diazyl\", \"eskadiazine\", \"honey diazine\", \"liquadiazine\", \"microsulfon\", \"neazine\", \"neotrizine\", \"nsulfanilamide\", \"palatrize\", \"piridisir\", \"pirimal\", \"pyrimal\", \"quadetts\", \"quadramoid\", \"sanodiazine\", \"sildaflo\", \"silvadene\", \"solfadiazina\", \"spofadrizine\", \"sterazine\", \"sulfacombin\", \"sulfadiazene\", \"sulfadiazin\", \"sulfadiazina\", \"sulfadiazine\", \"sulfadiazinum\",
|
||||
\"sulfapirimidin\", \"sulfapyrimidin\", \"sulfapyrimidine\", \"sulfatryl\", \"sulfazine\", \"sulfolex\", \"sulfonamides duplex\", \"sulfonsol\", \"sulfose\", \"sulphadiazine\", \"sulphadiazine e\", \"terfonyl\", \"theradiazine\", \"thermazene\", \"trifonamide\", \"triple sulfa\", \"triple sulfas\", \"trisem\", \"truozine\", \"zinc sulfadiazine\")" 0.6 "g" "c(\"27216-1\", \"59742-7\", \"6907-0\")"
|
||||
"SLT" "J01EE06" 122284 "Sulfadiazine/tetroxoprim" "Trimethoprims" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "" "" ""
|
||||
"SLT1" "J01EE02" 64932 "Sulfadiazine/trimethoprim" "Trimethoprims" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "" "c(\"antastmon\", \"cotrimazine\", \"diaziprim forte\", \"ditrim\", \"ditrivet\", \"sultrisan\", \"triglobe\", \"trimin\", \"tucoprim\", \"uniprim\")" "character(0)"
|
||||
"SUD" "J01ED01" 5323 "Sulfadimethoxine" "Trimethoprims" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "" "c(\"agribon\", \"arnosulfan\", \"bactrovet\", \"deposul\", \"diasulfa\", \"diasulfyl\", \"dimetazina\", \"dinosol\", \"dorisul\", \"lasibon\", \"madribon\", \"madrigid\", \"madriqid\", \"madroxin\", \"madroxine\", \"maxulvet\", \"mecozine\", \"memcozine\", \"metoxidon\", \"neostrepal\", \"neostreptal\", \"nsulfanilamide\", \"omnibon\", \"persulfen\", \"primor\", \"radonin\", \"redifal\", \"rofenaid\", \"roscosulf\", \"scandisil\", \"solfadimetossina\", \"sudine\", \"suldixine\", \"sulfabon\", \"sulfadimethoxin\", \"sulfadimethoxine\", \"sulfadimethoxinum\", \"sulfadimetossina\",
|
||||
\"sulfadimetoxin\", \"sulfadimetoxina\", \"sulfadimetoxine\", \"sulfastop\", \"sulfdimethoxine\", \"sulfoplan\", \"sulphadimethoxine\", \"sulxin\", \"sumbio\", \"symbio\", \"theracanzan\", \"ultrasulfon\")" 0.5 "g" "character(0)"
|
||||
"SDM" "J01EB03" 5327 "Sulfadimidine" "Trimethoprims" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "" "c(\"azolmetazin\", \"benzene sulfonamide\", \"calfspan\", \"calfspan tablets\", \"cremomethazine\", \"diazil\", \"diazilsulfadine\", \"dimezathine\", \"intradine\", \"kelametazine\", \"mermeth\", \"metazin\", \"neasina\", \"neazina\", \"nsulfanilamide\", \"panazin\", \"pirmazin\", \"primazin\", \"sa iii\", \"solfadimidina\", \"spanbolet\", \"sulfadimerazine\", \"sulfadimesin\", \"sulfadimesine\", \"sulfadimethyldiazine\", \"sulfadimezin\", \"sulfadimezine\", \"sulfadimezinum\", \"sulfadimidin\", \"sulfadimidina\", \"sulfadimidine\", \"sulfadimidinum\", \"sulfadine\",
|
||||
\"sulfametazina\", \"sulfametazyny\", \"sulfamethazine\", \"sulfamethiazine\", \"sulfamezathine\", \"sulfamidine\", \"sulfasure sr bolus\", \"sulfodimesin\", \"sulfodimezine\", \"sulka k boluses\", \"sulka s boluses\", \"sulmet\", \"sulphadimidine\", \"sulphamethasine\", \"sulphamethazine\", \"sulphamezathine\", \"sulphamidine\", \"sulphodimezine\", \"superseptil\", \"superseptyl\", \"vertolan\")" 4 "g" "character(0)"
|
||||
"SLT2" "J01EE05" "Sulfadimidine/trimethoprim" "Trimethoprims" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "" "" ""
|
||||
"SLF" "J01EB05" 5344 "Sulfafurazole" "Trimethoprims" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "c(\"\", \"sfsz\")" "c(\"accuzole\", \"alphazole\", \"amidoxal\", \"astrazolo\", \"azo gantrisin\", \"azosulfizin\", \"bactesulf\", \"barazae\", \"chemouag\", \"cosoxazole\", \"dorsulfan\", \"dorsulfan warthausen\", \"entusil\", \"entusul\", \"eryzole\", \"gantrisin\", \"gantrisine\", \"gantrisona\", \"gantrizin\", \"gantrosan\", \"isoxamin\", \"neazolin\", \"neoxazoi\", \"neoxazol\", \"novazolo\", \"novosaxazole\", \"nsulfanilamide\", \"nsulphanilamide\", \"pancid\", \"pediazole\", \"renosulfan\", \"resoxol\", \"roxosul\", \"roxosul tablets\", \"roxoxol\", \"saxosozine\", \"sodizole\", \"solfafurazolo\",
|
||||
\"soxamide\", \"soxazole\", \"soxisol\", \"soxitabs\", \"soxomide\", \"stansin\", \"sulbio\", \"sulfafuraz ole\", \"sulfafurazol\", \"sulfafurazole\", \"sulfafurazolum\", \"sulfagan\", \"sulfagen\", \"sulfaisoxazole\", \"sulfalar\", \"sulfapolar\", \"sulfasol\", \"sulfasoxazole\", \"sulfasoxizole\", \"sulfazin\", \"sulfisin\", \"sulfisonazole\", \"sulfisoxasole\", \"sulfisoxazol\", \"sulfisoxazole\", \"sulfisoxazolum\", \"sulfizin\", \"sulfizol\", \"sulfizole\", \"sulfofurazole\", \"sulfoxol\", \"suloxsol\", \"sulphafuraz\", \"sulphafurazol\", \"sulphafurazole\", \"sulphafurazolum\",
|
||||
\"sulphaisoxazole\", \"sulphisoxazol\", \"sulphisoxazole\", \"sulphofurazole\", \"sulsoxin\", \"thiasin\", \"unisulf\", \"urisoxin\", \"uritrisin\", \"urogan\", \"vagilia\")" 4 "g" 4 "g" "character(0)"
|
||||
"SLF1" "J01EB01" 5343 "Sulfaisodimidine" "Trimethoprims" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "" "c(\"aristamid\", \"aristamide\", \"aristogyn\", \"domain\", \"domian\", \"elcosin\", \"elcosine\", \"elkosil\", \"elkosin\", \"elkosine\", \"erycon\", \"isosulf\", \"mefenal\", \"nsulfanilamide\", \"solfisomidina\", \"sulfadimetine\", \"sulfaisodimerazine\", \"sulfaisodimidine\", \"sulfaisodimidinum\", \"sulfaisomidine\", \"sulfamethin\", \"sulfasomidine\", \"sulfisomidina\", \"sulfisomidine\", \"sulfisomidine sodium\", \"sulfisomidinum\", \"sulphasomidine\")" 4 "g" 4 "g" "character(0)"
|
||||
"SLF2" "J01ED02" 9047 "Sulfalene" "Trimethoprims" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "" "c(\"dalysep\", \"kelfizin\", \"kelfizina\", \"kelfizine\", \"kelfizine w\", \"longum\", \"nsulfanilamide\", \"policydal\", \"polycidal\", \"solfametopirazina\", \"sulfalen\", \"sulfalene\", \"sulfaleno\", \"sulfalenum\", \"sulfamethopyrazine\", \"sulfamethoxypyrazine\", \"sulfametopyrazine\", \"sulfametoxypyridazin\", \"sulphalene\", \"sulphametopyrazine\", \"vetkelfizina\")" 0.1 "g" "character(0)"
|
||||
"SZO" "J01ED09" 187764 "Sulfamazone" "Trimethoprims" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "" "c(\"sulfamazon\", \"sulfamazona\", \"sulfamazone\", \"sulfamazonum\")" 1.5 "g" "character(0)"
|
||||
"SLF3" "J01ED07" 5325 "Sulfamerazine" "Trimethoprims" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "" "c(\"cremomerazine\", \"kelamerazine\", \"mebacid\", \"mesulfa\", \"methylpyrimal\", \"methylsulfazin\", \"methylsulfazine\", \"metilsulfadiazin\", \"metilsulfazin\", \"nsulfanilamide\", \"percoccide\", \"pyralcid\", \"pyrimal m\", \"romezin\", \"septacil\", \"septosyl\", \"solfamerazina\", \"solumedin\", \"sulfameradine\", \"sulfamerazin\", \"sulfamerazina\", \"sulfamerazine\", \"sulfamerazinum\", \"sulfamethyldiazine\", \"sulphamerazine\", \"sumedine\", \"susfamerazine\")" 3 "g" "character(0)"
|
||||
"SLT3" "J01EE07" "Sulfamerazine/trimethoprim" "Trimethoprims" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "" "" ""
|
||||
"SUM" 5327 "Sulfamethazine" "Other antibacterials" "" "c(\"azolmetazin\", \"benzene sulfonamide\", \"calfspan\", \"calfspan tablets\", \"cremomethazine\", \"diazil\", \"diazilsulfadine\", \"dimezathine\", \"intradine\", \"kelametazine\", \"mermeth\", \"metazin\", \"neasina\", \"neazina\", \"nsulfanilamide\", \"panazin\", \"pirmazin\", \"primazin\", \"sa iii\", \"solfadimidina\", \"spanbolet\", \"sulfadimerazine\", \"sulfadimesin\", \"sulfadimesine\", \"sulfadimethyldiazine\", \"sulfadimezin\", \"sulfadimezine\", \"sulfadimezinum\", \"sulfadimidin\", \"sulfadimidina\", \"sulfadimidine\", \"sulfadimidinum\", \"sulfadine\",
|
||||
\"sulfametazina\", \"sulfametazyny\", \"sulfamethazine\", \"sulfamethiazine\", \"sulfamezathine\", \"sulfamidine\", \"sulfasure sr bolus\", \"sulfodimesin\", \"sulfodimezine\", \"sulka k boluses\", \"sulka s boluses\", \"sulmet\", \"sulphadimidine\", \"sulphamethasine\", \"sulphamethazine\", \"sulphamezathine\", \"sulphamidine\", \"sulphodimezine\", \"superseptil\", \"superseptyl\", \"vertolan\")" "87592-2"
|
||||
"SLF4" "J01EB02" 5328 "Sulfamethizole" "Trimethoprims" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "c(\"\", \"sfmz\")" "c(\"ayerlucil\", \"lucosil\", \"methazol\", \"microsul\", \"nsulfanilamide\", \"proklar\", \"renasul\", \"salimol\", \"solfametizolo\", \"sulamethizole\", \"sulfa gram\", \"sulfamethizol\", \"sulfamethizole\", \"sulfamethizolum\", \"sulfametizol\", \"sulfapyelon\", \"sulfstat\", \"sulfurine\", \"sulphamethizole\", \"tetracid\", \"thidicur\", \"thiosulfil\", \"thiosulfil forte\", \"ultrasul\", \"urocydal\", \"urodiaton\", \"urolucosil\", \"urosulfin\")" 4 "g" "c(\"60175-7\", \"60176-5\", \"60177-3\")"
|
||||
"SMX" "J01EC01" 5329 "Sulfamethoxazole" "Trimethoprims" "Sulfonamides and trimethoprim" "Intermediate-acting sulfonamides" "c(\"sfmx\", \"sulf\")" "c(\"azo gantanol\", \"eusaprim\", \"gamazole\", \"gantanol\", \"gantanol ds\", \"metoxal\", \"nsulfanilamide\", \"nsulphanilamide\", \"radonil\", \"septran\", \"septrin\", \"simsinomin\", \"sinomin\", \"solfametossazolo\", \"sulfamethalazole\", \"sulfamethoxazol\", \"sulfamethoxazole\", \"sulfamethoxazolum\", \"sulfamethoxizole\", \"sulfamethylisoxazole\", \"sulfametoxazol\", \"sulfisomezole\", \"sulphamethalazole\", \"sulphamethoxazol\", \"sulphamethoxazole\", \"sulphisomezole\", \"urobak\")" 2 "g" "c(\"10342-4\", \"25271-8\", \"39772-9\", \"59971-2\", \"59972-0\", \"60333-2\", \"72674-5\", \"80549-9\", \"80974-9\")"
|
||||
"SLF5" "J01ED05" 5330 "Sulfamethoxypyridazine" "Trimethoprims" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "" "c(\"altezol\", \"davosin\", \"depovernil\", \"kineks\", \"lederkyn\", \"lentac\", \"lisulfen\", \"longin\", \"medicel\", \"midicel\", \"midikel\", \"myasul\", \"nsulfanilamide\", \"opinsul\", \"paramid\", \"paramid supra\", \"petrisul\", \"piridolo\", \"quinoseptyl\", \"retamid\", \"retasulfin\", \"retasulphine\", \"slosul\", \"spofadazine\", \"sulfalex\", \"sulfapyridazine\", \"sulfdurazin\", \"sulfozona\", \"sultirene\", \"vinces\")" 0.5 "g" "character(0)"
|
||||
"SLF6" "J01ED03" 19596 "Sulfametomidine" "Trimethoprims" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "" "c(\"duroprocin\", \"methofadin\", \"methofazine\", \"nsulfanilamide\", \"solfametomidina\", \"sulfamethomidine\", \"sulfametomidin\", \"sulfametomidina\", \"sulfametomidine\", \"sulfametomidinum\")" "character(0)"
|
||||
"SLF7" "J01ED04" 5326 "Sulfametoxydiazine" "Trimethoprims" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "" "c(\"bayrena\", \"berlicid\", \"dairena\", \"durenat\", \"juvoxin\", \"kinecid\", \"kirocid\", \"longasulf\", \"methoxypyrimal\", \"nsulfanilamide\", \"solfametossidiazina\", \"sulfameter\", \"sulfamethorine\", \"sulfamethoxine\", \"sulfamethoxydiazin\", \"sulfamethoxydiazine\", \"sulfamethoxydin\", \"sulfamethoxydine\", \"sulfametin\", \"sulfametinum\", \"sulfametorin\", \"sulfametorine\", \"sulfametorinum\", \"sulfametoxidiazina\", \"sulfametoxidine\", \"sulfametoxydiazine\", \"sulfametoxydiazinum\", \"sulphameter\", \"sulphamethoxydiazine\", \"supramid\",
|
||||
\"ultrax\")" 0.5 "g" "character(0)"
|
||||
"SLT4" "J01EE03" "Sulfametrole/trimethoprim" "Trimethoprims" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "c(\"\", \"trsm\")" "" ""
|
||||
"SLF8" "J01EC03" 12894 "Sulfamoxole" "Trimethoprims" "Sulfonamides and trimethoprim" "Intermediate-acting sulfonamides" "" "c(\"justamil\", \"nsulfanilamide\", \"oxasulfa\", \"solfamossolo\", \"sulfadimethyloxazole\", \"sulfamoxol\", \"sulfamoxole\", \"sulfamoxolum\", \"sulfano\", \"sulfavigor\", \"sulfmidil\", \"sulfono\", \"sulfune\", \"sulfuno\", \"sulphamoxole\", \"tardamid\", \"tardamide\")" 1 "g" 1 "g" "character(0)"
|
||||
"SLT5" "J01EE04" "Sulfamoxole/trimethoprim" "Trimethoprims" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "" "" ""
|
||||
"SLF9" "J01EB06" 5333 "Sulfanilamide" "Trimethoprims" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "" "c(\"albexan\", \"albosal\", \"ambeside\", \"antistrept\", \"astreptine\", \"astrocid\", \"bacteramid\", \"bactesid\", \"collomide\", \"colsulanyde\", \"copticide\", \"deseptyl\", \"desseptyl\", \"dipron\", \"ergaseptine\", \"erysipan\", \"estreptocida\", \"exoseptoplix\", \"gerison\", \"gombardol\", \"infepan\", \"lysococcine\", \"neococcyl\", \"orgaseptine\", \"prontalbin\", \"prontosil album\", \"prontosil i\", \"prontosil white\", \"prontylin\", \"pronzin album\", \"proseptal\", \"proseptine\", \"proseptol\", \"pysococcine\", \"rubiazol a\", \"sanamid\", \"septamide album\",
|
||||
\"septanilam\", \"septinal\", \"septolix\", \"septoplex\", \"septoplix\", \"solfanilamide\", \"stopton album\", \"stramid\", \"strepamide\", \"strepsan\", \"streptagol\", \"streptamid\", \"streptamin\", \"streptasol\", \"streptocid\", \"streptocid album\", \"streptocide\", \"streptocide white\", \"streptocidum\", \"streptoclase\", \"streptocom\", \"streptol\", \"strepton\", \"streptopan\", \"streptosil\", \"streptozol\", \"streptozone\", \"streptrocide\", \"sulfamidyl\", \"sulfamine\", \"sulfana\", \"sulfanalone\", \"sulfanidyl\", \"sulfanil\", \"sulfanilamida\", \"sulfanilamide\",
|
||||
\"sulfanilamidum\", \"sulfanilimidic acid\", \"sulfanimide\", \"sulfocidin\", \"sulfocidine\", \"sulfonamide\", \"sulfonamide p\", \"sulfonylamide\", \"sulphanilamide\", \"sulphanilamide gr\", \"sulphonamide\", \"therapol\", \"tolder\", \"white streptocide\", \"wln: zswr dz\")" "character(0)"
|
||||
"SLF10" "J01ED06" 68933 "Sulfaperin" "Trimethoprims" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "" "c(\"anastaf\", \"archisulfa\", \"avissul\", \"chemiopen\", \"demosulfan\", \"durisan saft\", \"ipersulfidin sirup\", \"isosulfamerazine\", \"methylsulfadiazin\", \"novosul\", \"nsulfanilamide\", \"orosulfan\", \"pallidin\", \"retardon\", \"risulfasens\", \"sulfaperin\", \"sulfaperina\", \"sulfaperine\", \"sulfaperinum\", \"sulfatreis\", \"sulfopirimidine\", \"sulpenta\", \"ultrasulfon sirup\")" 0.5 "g" "character(0)"
|
||||
"SLF11" "J01ED08" 5335 "Sulfaphenazole" "Trimethoprims" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "" "c(\"depocid\", \"depotsulfonamide\", \"eftolon\", \"firmazolo\", \"inamil\", \"isarol\", \"isarol v\", \"merian\", \"microtan pirazolo\", \"nsulfanilamide\", \"orisul\", \"orisulf\", \"paidazolo\", \"phenylsulfapyrazole\", \"plisulfan\", \"raziosulfa\", \"solfafenazolo\", \"sulfabid\", \"sulfafenazol\", \"sulfafenazolo\", \"sulfaphenazol\", \"sulfaphenazole\", \"sulfaphenazolum\", \"sulfaphenazon\", \"sulfaphenylpipazol\", \"sulfaphenylpyrazol\", \"sulfaphenylpyrazole\", \"sulfonylpyrazol\", \"sulphaphenazole\", \"sulphenazole\")" 1 "g" "character(0)"
|
||||
"SLF12" "J01EB04" 5336 "Sulfapyridine" "Trimethoprims" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "" "c(\"adiplon\", \"coccoclase\", \"dagenan\", \"eubasin\", \"eubasinum\", \"haptocil\", \"piridazol\", \"plurazol\", \"pyriamid\", \"pyridazol\", \"relbapiridina\", \"septipulmon\", \"solfapiridina\", \"streptosilpyridine\", \"sulfapiridina\", \"sulfapyridin\", \"sulfapyridine\", \"sulfapyridinum\", \"sulfidin\", \"sulfidine\", \"sulphapyridin\", \"sulphapyridine\", \"thioseptal\", \"trianon\")" 1 "g" "c(\"14075-6\", \"55580-5\")"
|
||||
"SNA" 60582 "Sulfasuccinamide" "Other antibacterials" "" "c(\"ambesid\", \"derganil\", \"sulfasuccinamid\", \"sulfasuccinamida\", \"sulfasuccinamide\", \"sulfasuccinamidum\")" "character(0)"
|
||||
"SUT" "J01EB07" 5340 "Sulfathiazole" "Trimethoprims" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "" "c(\"azoquimiol\", \"azoseptale\", \"cerazol\", \"cerazole\", \"chemosept\", \"cibazol\", \"duatok\", \"dulana\", \"eleudron\", \"enterobiocine\", \"estafilol\", \"formosulfathiazole\", \"neostrepsan\", \"norsulfasol\", \"norsulfazol\", \"norsulfazole\", \"norsulfazolum\", \"nsulfanilamide\", \"planomide\", \"poliseptil\", \"sanotiazol\", \"septozol\", \"solfatiazolo\", \"streptosilthiazole\", \"sulfamul\", \"sulfathiazol\", \"sulfathiazole\", \"sulfathiazolum\", \"sulfatiazol\", \"sulfavitina\", \"sulfocerol\", \"sulphathiazole\", \"sulzol\", \"thiacoccine\", \"thiasulfol\",
|
||||
\"thiazamide\", \"thiozamide\", \"wintrazole\")" "87591-4"
|
||||
"SLF13" "J01EB08" 3000579 "Sulfathiourea" "Trimethoprims" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "" "c(\"badional\", \"baldinol\", \"fontamide\", \"salvoseptyl\", \"solfatiourea\", \"solufontamide\", \"sulfanilthiourea\", \"sulfathiocarbamid\", \"sulfathiocarbamide\", \"sulfathiocarbamidum\", \"sulfathiourea\", \"sulfathiouree\", \"sulfatiourea\", \"sulphathiourea\")" 6 "g" "character(0)"
|
||||
"SOX" 5344 "Sulfisoxazole" "Other antibacterials" "" "c(\"accuzole\", \"alphazole\", \"amidoxal\", \"astrazolo\", \"azo gantrisin\", \"azosulfizin\", \"bactesulf\", \"barazae\", \"chemouag\", \"cosoxazole\", \"dorsulfan\", \"dorsulfan warthausen\", \"entusil\", \"entusul\", \"eryzole\", \"gantrisin\", \"gantrisine\", \"gantrisona\", \"gantrizin\", \"gantrosan\", \"isoxamin\", \"neazolin\", \"neoxazoi\", \"neoxazol\", \"novazolo\", \"novosaxazole\", \"nsulfanilamide\", \"nsulphanilamide\", \"pancid\", \"pediazole\", \"renosulfan\", \"resoxol\", \"roxosul\", \"roxosul tablets\", \"roxoxol\", \"saxosozine\", \"sodizole\", \"solfafurazolo\",
|
||||
\"soxamide\", \"soxazole\", \"soxisol\", \"soxitabs\", \"soxomide\", \"stansin\", \"sulbio\", \"sulfafuraz ole\", \"sulfafurazol\", \"sulfafurazole\", \"sulfafurazolum\", \"sulfagan\", \"sulfagen\", \"sulfaisoxazole\", \"sulfalar\", \"sulfapolar\", \"sulfasol\", \"sulfasoxazole\", \"sulfasoxizole\", \"sulfazin\", \"sulfisin\", \"sulfisonazole\", \"sulfisoxasole\", \"sulfisoxazol\", \"sulfisoxazole\", \"sulfisoxazolum\", \"sulfizin\", \"sulfizol\", \"sulfizole\", \"sulfofurazole\", \"sulfoxol\", \"suloxsol\", \"sulphafuraz\", \"sulphafurazol\", \"sulphafurazole\", \"sulphafurazolum\",
|
||||
\"sulphaisoxazole\", \"sulphisoxazol\", \"sulphisoxazole\", \"sulphofurazole\", \"sulsoxin\", \"thiasin\", \"unisulf\", \"urisoxin\", \"uritrisin\", \"urogan\", \"vagilia\")" "9701-4"
|
||||
"SSS" 86225 "Sulfonamide" "Other antibacterials" "c(\"\", \"sfna\")" "" ""
|
||||
"SLP" 9950244 "Sulopenem" "Other antibacterials" "" "sulopenem" "character(0)"
|
||||
"SLT6" "J01CR04" 444022 "Sultamicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "" "c(\"sultamicilina\", \"sultamicillin\", \"sultamicillinum\")" 1.5 "g" "character(0)"
|
||||
"SUR" 46700778 "Surotomycin" "Other antibacterials" "" "surotomycin" "character(0)"
|
||||
"TAL" "J01CA15" 71447 "Talampicillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "" "c(\"talampicilina\", \"talampicillin\", \"talampicilline\", \"talampicillinum\")" 2 "g" "character(0)"
|
||||
"TLP" 163307 "Talmetoprim" "Other antibacterials" "" "talmetoprim" "character(0)"
|
||||
"TAZ" "J01CG02" 123630 "Tazobactam" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Beta-lactamase inhibitors" "tazo" "c(\"tazobactam\", \"tazobactam acid\", \"tazobactamum\", \"tazobactum\")" "character(0)"
|
||||
"TBP" 9800194 "Tebipenem" "Carbapenems" "" "" ""
|
||||
"TZD" "J01XX11" 11234049 "Tedizolid" "Oxazolidinones" "Other antibacterials" "Other antibacterials" "tedi" "c(\"tedizolid\", \"torezolid\")" 0.2 0.2 "character(0)"
|
||||
"TEC" "J01XA02" 16131923 "Teicoplanin" "Glycopeptides" "Other antibacterials" "Glycopeptide antibacterials" "c(\"tec\", \"tei\", \"teic\", \"tp\", \"tpl\", \"tpn\")" "c(\"targocid\", \"tecoplanina\", \"tecoplanine\", \"tecoplaninum\", \"teichomycin\", \"teicoplanina\", \"teicoplanine\", \"teicoplaninum\")" 0.4 "g" "c(\"25534-9\", \"25535-6\", \"34378-0\", \"34379-8\", \"4043-6\", \"80968-1\")"
|
||||
"TCM" "Teicoplanin-macromethod" "Glycopeptides" "" "" ""
|
||||
"TLV" "J01XA03" 3081362 "Telavancin" "Glycopeptides" "Other antibacterials" "Glycopeptide antibacterials" "tela" "c(\"telavancin\", \"vibativ\")" "character(0)"
|
||||
"TLT" "J01FA15" 3002190 "Telithromycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "c(\"\", \"teli\")" "levviax" 0.8 "g" "character(0)"
|
||||
"TMX" "J01MA05" 60021 "Temafloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"\", \"tema\")" "c(\"omniflox\", \"temafloxacin\", \"temafloxacina\", \"temafloxacine\", \"temafloxacinum\")" 0.8 "g" "character(0)"
|
||||
"TEM" "J01CA17" 171758 "Temocillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "c(\"\", \"temo\")" "c(\"temocilina\", \"temocillin\", \"temocillina\", \"temocilline\", \"temocillinum\")" 4 "g" "character(0)"
|
||||
"TRB" "D01BA02" 1549008 "Terbinafine" "Antifungals/antimycotics" "Antifungals for systemic use" "Antifungals for systemic use" "c(\"\", \"terb\")" "c(\"corbinal\", \"lamasil\", \"lamisil\", \"lamisil at\", \"lamisil tablet\", \"terbinafina\", \"terbinafine\", \"terbinafinum\", \"terbinex\")" 0.25 "g" "character(0)"
|
||||
"TRC" 441383 "Terconazole" "Antifungals/antimycotics" "" "c(\"fungistat\", \"panlomyc\", \"terazol\", \"terconazol\", \"terconazole\", \"terconazolum\", \"tercospor\", \"triaconazole\", \"zazole\")" "character(0)"
|
||||
"TRZ" "J04AK03" 65720 "Terizidone" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "" "c(\"terivalidin\", \"terizidon\", \"terizidona\", \"terizidone\", \"terizidonum\")" "character(0)"
|
||||
"TCY" "J01AA07" 54675776 "Tetracycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "c(\"tc\", \"te\", \"tet\", \"tetr\")" "c(\"abramycin\", \"abricycline\", \"achromycin\", \"achromycin v\", \"actisite\", \"agromicina\", \"ambramicina\", \"ambramycin\", \"amycin\", \"biocycline\", \"bristaciclin\", \"bristaciclina\", \"bristacycline\", \"cefracycline\", \"centet\", \"ciclibion\", \"copharlan\", \"criseociclina\", \"cyclomycin\", \"cyclopar\", \"cytome\", \"democracin\", \"deschlorobiomycin\", \"dumocyclin\", \"enterocycline\", \"hostacyclin\", \"lexacycline\", \"limecycline\", \"liquamycin\", \"medocycline\", \"mericycline\", \"micycline\", \"neocycline\", \"oletetrin\", \"omegamycin\",
|
||||
\"orlycycline\", \"panmycin\", \"piracaps\", \"polycycline\", \"polyotic\", \"purocyclina\", \"resteclin\", \"robitet\", \"roviciclina\", \"sigmamycin\", \"solvocin\", \"sumycin\", \"sumycin syrup\", \"tetrabon\", \"tetrachel\", \"tetraciclina\", \"tetracycl\", \"tetracyclin\", \"tetracycline\", \"tetracycline base\", \"tetracycline i\", \"tetracycline ii\", \"tetracyclinum\", \"tetracyn\", \"tetradecin\", \"tetrafil\", \"tetramed\", \"tetrasure\", \"tetraverine\", \"tetrazyklin\", \"tetrex\", \"topicycline\", \"tsiklomistsin\", \"tsiklomitsin\", \"veracin\", \"vetacyclinum\"
|
||||
)" 1 "g" 1 "g" "c(\"25272-6\", \"4045-1\", \"87590-6\")"
|
||||
"TET" 65450 "Tetroxoprim" "Other antibacterials" "" "c(\"tetroxoprim\", \"tetroxoprima\", \"tetroxoprime\", \"tetroxoprimum\")" "character(0)"
|
||||
"THA" 9568512 "Thiacetazone" "Oxazolidinones" "" "c(\"aktivan\", \"ambathizon\", \"amithiozone\", \"amithizone\", \"amitiozon\", \"benthiozone\", \"benzothiozane\", \"benzothiozon\", \"berculon a\", \"berkazon\", \"citazone\", \"conteben\", \"diasan\", \"diazan\", \"domakol\", \"ilbion\", \"livazone\", \"mirizone neustab\", \"mivizon\", \"myvizone\", \"neotibil\", \"neustab\", \"novakol\", \"nuclon argentinian\", \"panrone\", \"parazone\", \"seroden\", \"siocarbazone\", \"tebalon\", \"tebecure\", \"tebemar\", \"tebesone i\", \"tebethion\", \"tebethione\", \"tebezon\", \"thiacetazone\", \"thiacetone\", \"thiacetozone\",
|
||||
\"thibon\", \"thibone\", \"thioacetazon\", \"thioacetazone\", \"thioacetazonum\", \"thioazetazone\", \"thiocarbazil\", \"thiomicid\", \"thionicid\", \"thioparamizon\", \"thioparamizone\", \"thiosemicarbarzone\", \"thiosemicarbazone\", \"thiotebesin\", \"thiotebezin\", \"thiotebicina\", \"thizone\", \"tiacetazon\", \"tibicur\", \"tibion\", \"tibione\", \"tibizan\", \"tibone\", \"tioacetazon\", \"tioacetazona\", \"tioatsetazon\", \"tiobicina\", \"tiocarone\", \"tiosecolo\", \"tubercazon\", \"tubigal\")" "character(0)"
|
||||
"THI" "J01BA02" 27200 "Thiamphenicol" "Amphenicols" "Amphenicols" "Amphenicols" "" "c(\"descocin\", \"dexawin\", \"dextrosulfenidol\", \"dextrosulphenidol\", \"efnicol\", \"hyrazin\", \"igralin\", \"macphenicol\", \"masatirin\", \"neomyson\", \"racefenicol\", \"racefenicolo\", \"racefenicolum\", \"raceophenidol\", \"racephenicol\", \"rincrol\", \"thiamcol\", \"thiamphenicol\", \"thiamphenicolum\", \"thiocymetin\", \"thiomycetin\", \"thiophenicol\", \"tiamfenicol\", \"tiamfenicolo\", \"urfamicina\", \"urfamycine\", \"vicemycetin\")" 1.5 "g" 1.5 "g" "character(0)"
|
||||
"THI1" "J04AM04" "Thioacetazone/isoniazid" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "" "" ""
|
||||
"TIA" 656958 "Tiamulin" "Other antibacterials" "" "c(\"denagard\", \"tiamulin\", \"tiamulin pamoate\", \"tiamulina\", \"tiamuline\", \"tiamulinum\")" "87589-8"
|
||||
"TIC" "J01CA13" 36921 "Ticarcillin" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "c(\"tc\", \"ti\", \"tic\", \"tica\")" "c(\"ticarcilina\", \"ticarcillin\", \"ticarcilline\", \"ticarcillinum\", \"ticillin\")" 15 "g" "c(\"25254-4\", \"4054-3\", \"4055-0\")"
|
||||
"TCC" "J01CR03" 6437075 "Ticarcillin/clavulanic acid" "Beta-lactams/penicillins" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "c(\"t/c\", \"tcc\", \"ticl\", \"tim\", \"tlc\")" "timentin" 15 "g" "character(0)"
|
||||
"TGC" "J01AA12" 54686904 "Tigecycline" "Tetracyclines" "Tetracyclines" "Tetracyclines" "c(\"tgc\", \"tige\")" "c(\"haizheng li xing\", \"tigeciclina\", \"tigecyclin\", \"tigecycline\", \"tigecycline hydrate\", \"tigecyclinum\", \"tigilcycline\", \"tygacil\")" 0.1 "g" "character(0)"
|
||||
"TBQ" 65592 "Tilbroquinol" "Quinolones" "" "c(\"tilbroquinol\", \"tilbroquinolum\")" "character(0)"
|
||||
"TIP" 24860548 "Tildipirosin" "Macrolides/lincosamides" "" "c(\"tildipirosin\", \"zuprevo\")" "character(0)"
|
||||
"TIL" 5282521 "Tilmicosin" "Macrolides/lincosamides" "" "c(\"micotil\", \"pulmotil\", \"tilmicosin\", \"tilmicosina\", \"tilmicosine\", \"tilmicosinum\")" "87588-0"
|
||||
"TIN" "J01XD02" 5479 "Tinidazole" "Other antibacterials" "Other antibacterials" "Imidazole derivatives" "c(\"\", \"tini\")" "c(\"amtiba\", \"bioshik\", \"ethyl sulfone\", \"fasigin\", \"fasigyn\", \"fasigyntrade mark\", \"fasygin\", \"glongyn\", \"haisigyn\", \"pletil\", \"simplotan\", \"simplotantrade mark\", \"sorquetan\", \"tindamax\", \"tindamaxtrade mark\", \"tinidazol\", \"tinidazole\", \"tinidazolum\", \"tricolam\", \"trimonase\")" 1.5 "g" "character(0)"
|
||||
"TCR" "J04AD02" 3001386 "Tiocarlide" "Antimycobacterials" "Drugs for treatment of tuberculosis" "Thiocarbamide derivatives" "" "c(\"amixyl\", \"datanil\", \"disocarban\", \"disoxyl\", \"thiocarlide\", \"tiocarlid\", \"tiocarlida\", \"tiocarlide\", \"tiocarlidum\")" 7 "g" "character(0)"
|
||||
"TDC" 10247721 "Tiodonium chloride" "Other antibacterials" "" "c(\"cloruro de tiodonio\", \"tiodonii chloridum\", \"tiodonium chloride\")" "character(0)"
|
||||
"TXC" 65788 "Tioxacin" "Quinolones" "" "c(\"tioxacin\", \"tioxacine\", \"tioxacino\", \"tioxacinum\", \"tioxic acid\")" "character(0)"
|
||||
"TIZ" 394397 "Tizoxanide" "Other antibacterials" "" "ntzdes" "character(0)"
|
||||
"TOB" "J01GB01" 36294 "Tobramycin" "Aminoglycosides" "Aminoglycoside antibacterials" "Other aminoglycosides" "c(\"nn\", \"tm\", \"to\", \"tob\", \"tobr\")" "c(\"bethkis\", \"brulamycin\", \"deoxykanamycin b\", \"distobram\", \"gernebcin\", \"gotabiotic\", \"kitabis pak\", \"nebcin\", \"nebicin\", \"nebramycin\", \"nebramycin vi\", \"obramycin\", \"sybryx\", \"tenebrimycin\", \"tenemycin\", \"tobacin\", \"tobi podhaler\", \"tobracin\", \"tobradex\", \"tobradistin\", \"tobralex\", \"tobramaxin\", \"tobramicin\", \"tobramicina\", \"tobramitsetin\", \"tobramycetin\", \"tobramycin\", \"tobramycin base\", \"tobramycin sulfate\", \"tobramycine\", \"tobramycinum\", \"tobrased\", \"tobrasone\", \"tobrex\")" 0.24 "g" "c(\"13584-8\", \"17808-7\", \"22750-4\", \"22751-2\", \"22752-0\", \"31094-6\", \"31095-3\", \"31096-1\", \"35239-3\", \"35670-9\", \"4057-6\", \"4058-4\", \"4059-2\", \"50927-3\", \"52962-8\", \"59380-6\", \"80966-5\")"
|
||||
"TOH" "Tobramycin-high" "Aminoglycosides" "c(\"tobra high\", \"tobramycin high\", \"tohl\")" "" ""
|
||||
"TFX" 5517 "Tosufloxacin" "Quinolones" "" "tosufloxacin" "character(0)"
|
||||
"TMP" "J01EA01" 5578 "Trimethoprim" "Trimethoprims" "Sulfonamides and trimethoprim" "Trimethoprim and derivatives" "c(\"t\", \"tmp\", \"tr\", \"trim\", \"w\")" "c(\"abaprim\", \"alprim\", \"anitrim\", \"antrima\", \"antrimox\", \"bacdan\", \"bacidal\", \"bacide\", \"bacterial\", \"bacticel\", \"bactifor\", \"bactin\", \"bactoprim\", \"bactramin\", \"bactrim\", \"bencole\", \"bethaprim\", \"biosulten\", \"briscotrim\", \"chemotrin\", \"colizole\", \"colizole ds\", \"conprim\", \"cotrimel\", \"cotrimoxizole\", \"deprim\", \"dosulfin\", \"duocide\", \"esbesul\", \"espectrin\", \"euctrim\", \"exbesul\", \"fermagex\", \"fortrim\", \"idotrim\", \"ikaprim\", \"instalac\", \"kombinax\", \"lagatrim\", \"lagatrim forte\", \"lastrim\", \"lescot\",
|
||||
\"methoprim\", \"metoprim\", \"monoprim\", \"monotrim\", \"monotrimin\", \"novotrimel\", \"omstat\", \"oraprim\", \"pancidim\", \"polytrim\", \"priloprim\", \"primosept\", \"primsol\", \"proloprim\", \"protrin\", \"purbal\", \"resprim\", \"resprim forte\", \"roubac\", \"roubal\", \"salvatrim\", \"septrin ds\", \"septrin forte\", \"septrin s\", \"setprin\", \"sinotrim\", \"stopan\", \"streptoplus\", \"sugaprim\", \"sulfamar\", \"sulfamethoprim\", \"sulfoxaprim\", \"sulthrim\", \"sultrex\", \"syraprim\", \"tiempe\", \"tmp smx\", \"toprim\", \"trimanyl\", \"trimethioprim\", \"trimethopim\",
|
||||
\"trimethoprim\", \"trimethoprime\", \"trimethoprimum\", \"trimethopriom\", \"trimetoprim\", \"trimetoprima\", \"trimexazole\", \"trimexol\", \"trimezol\", \"trimogal\", \"trimono\", \"trimopan\", \"trimpex\", \"triprim\", \"trisul\", \"trisulcom\", \"trisulfam\", \"trisural\", \"uretrim\", \"urobactrim\", \"utetrin\", \"velaten\", \"wellcoprim\", \"wellcoprin\", \"xeroprim\", \"zamboprim\")" 0.4 "g" 0.4 "g" "c(\"11005-6\", \"17747-7\", \"25273-4\", \"32342-8\", \"4079-0\", \"4080-8\", \"4081-6\", \"55584-7\", \"80552-3\", \"80973-1\")"
|
||||
"SXT" "J01EE01" 358641 "Trimethoprim/sulfamethoxazole" "Trimethoprims" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "c(\"cot\", \"cotrim\", \"sxt\", \"t/s\", \"trsu\", \"trsx\", \"ts\")" "c(\"bactrim\", \"bactrimel\", \"belcomycine\", \"colimycin\", \"colimycin sulphate\", \"colisticin\", \"colistimethate\", \"colistimethate sodium\", \"colistin sulfate\", \"colistin sulphate\", \"colomycin\", \"coly-mycin\", \"cotrimazole\", \"cotrimoxazole\", \"polymyxin e\", \"polymyxin e. sulfate\", \"promixin\", \"septra\", \"totazina\")" "character(0)"
|
||||
"TRL" "J01FA08" 202225 "Troleandomycin" "Macrolides/lincosamides" "Macrolides, lincosamides and streptogramins" "Macrolides" "" "c(\"acetyloleandomycin\", \"aovine\", \"cyclamycin\", \"evramicina\", \"matromicina\", \"matromycin t\", \"oleandocetine\", \"t.a.o.\", \"treolmicina\", \"tribiocillina\", \"triocetin\", \"triolan\", \"troleandomicina\", \"troleandomycin\", \"troleandomycine\", \"troleandomycinum\", \"viamicina\", \"wytrion\")" 1 "g" "character(0)"
|
||||
"TRO" 55886 "Trospectomycin" "Other antibacterials" "" "c(\"trospectinomycin\", \"trospectomicina\", \"trospectomycin\", \"trospectomycine\", \"trospectomycinum\")" "character(0)"
|
||||
"TVA" "J01MA13" 62959 "Trovafloxacin" "Quinolones" "Quinolone antibacterials" "Fluoroquinolones" "c(\"\", \"trov\")" "c(\"trovafloxacin\", \"trovan\")" 0.2 "g" 0.2 "g" "character(0)"
|
||||
"TUL" 9832301 "Tulathromycin" "Macrolides/lincosamides" "" "c(\"draxxin\", \"tulathrmycin a\", \"tulathromycin\", \"tulathromycin a\")" "character(0)"
|
||||
"TYL" 5280440 "Tylosin" "Macrolides/lincosamides" "" "c(\"fradizine\", \"tilosina\", \"tylocine\", \"tylosin\", \"tylosin a\", \"tylosine\", \"tylosinum\")" "87587-2"
|
||||
"TYL1" "A07AA11" 6441094 "Tylvalosin" "Other antibacterials" "Intestinal antiinfectives" "Antibiotics" "" "" 0.6 "g" ""
|
||||
"PRU1" 124225 "Ulifloxacin (Prulifloxacin)" "Other antibacterials" "" "ulifloxacin" "character(0)"
|
||||
"VAN" "J01XA01" 14969 "Vancomycin" "Glycopeptides" "Other antibacterials" "Glycopeptide antibacterials" "c(\"va\", \"van\", \"vanc\")" "c(\"vancocin\", \"vancocin hcl\", \"vancoled\", \"vancomicina\", \"vancomycin\", \"vancomycin hcl\", \"vancomycine\", \"vancomycinum\", \"vancor\", \"viomycin derivative\")" 2 "g" "c(\"13586-3\", \"13587-1\", \"20578-1\", \"31012-8\", \"39092-2\", \"39796-8\", \"39797-6\", \"4089-9\", \"4090-7\", \"4091-5\", \"4092-3\", \"50938-0\", \"59381-4\")"
|
||||
"VAM" "Vancomycin-macromethod" "Glycopeptides" "" "" ""
|
||||
"VIO" 135398671 "Viomycin" "Antimycobacterials" "" "c(\"celiomycin\", \"florimycin\", \"floromycin\", \"viomicina\", \"viomycin\", \"viomycine\", \"viomycinum\")" "character(0)"
|
||||
"VIR" 11979535 "Virginiamycine" "Other antibacterials" "" "c(\"eskalin v\", \"mikamycin\", \"mikamycine\", \"mikamycinum\", \"ostreogrycinum\", \"pristinamycine\", \"pristinamycinum\", \"stafac\", \"stafytracine\", \"staphylomycin\", \"starfac\", \"streptogramin\", \"vernamycin\", \"virgimycin\", \"virgimycine\", \"virginiamycina\", \"virginiamycine\", \"virginiamycinum\")" "character(0)"
|
||||
"VOR" "J02AC03" 71616 "Voriconazole" "Antifungals/antimycotics" "Antimycotics for systemic use" "Triazole derivatives" "vori" "c(\"pfizer\", \"vfend i.v.\", \"voriconazol\", \"voriconazole\", \"voriconazolum\", \"vorikonazole\")" 0.4 "g" 0.4 "g" "c(\"38370-3\", \"53902-3\", \"73676-9\", \"80553-1\", \"80651-3\")"
|
||||
"XBR" "J01XX02" 72144 "Xibornol" "Other antibacterials" "Other antibacterials" "Other antibacterials" "" "c(\"bactacine\", \"bracen\", \"nanbacine\", \"xibornol\", \"xibornolo\", \"xibornolum\")" "character(0)"
|
||||
"ZID" 77846445 "Zidebactam" "Other antibacterials" "" "zidebactam" "character(0)"
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,103 +0,0 @@
|
||||
"atc" "cid" "name" "atc_group" "synonyms" "oral_ddd" "oral_units" "iv_ddd" "iv_units"
|
||||
"J05AF06" 441300 "Abacavir" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Abacavir\", \"Abacavir sulfate\", \"Ziagen\")" 0.6 "g"
|
||||
"J05AB01" 135398513 "Aciclovir" "Nucleosides and nucleotides excl. reverse transcriptase inhibitors" "c(\"Acicloftal\", \"Aciclovier\", \"Aciclovir\", \"Aciclovirum\", \"Activir\", \"AcycloFoam\", \"Acycloguanosine\", \"Acyclovir\", \"Acyclovir Lauriad\", \"ACYCLOVIR SODIUM\", \"Avirax\", \"Cargosil\", \"Cyclovir\", \"Genvir\", \"Gerpevir\", \"Hascovir\", \"Herpevir\", \"Maynar\", \"Poviral\", \"Sitavig\", \"Sitavir\", \"Vipral\", \"Virolex\", \"Viropump\", \"Virorax\", \"Zovirax\", \"Zovirax topical\", \"Zyclir\")" 4 "g" 4 "g"
|
||||
"J05AF08" 60871 "Adefovir dipivoxil" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Adefovir di ester\", \"Adefovir dipivoxil\", \"Adefovir Dipivoxil\", \"Adefovir dipivoxyl\", \"Adefovir pivoxil\", \"Adefovirdipivoxl\", \"Bisadenine\", \"BISADENINE\", \"BisPMEA\", \"Hepsera\", \"Preveon\", \"YouHeDing\")" 10 "mg"
|
||||
"J05AE05" 65016 "Amprenavir" "Protease inhibitors" "c(\"Agenerase\", \"Amprenavir\", \"Amprenavirum\", \"Prozei\", \"Vertex\")" 1.2 "g"
|
||||
"J05AP06" 16076883 "Asunaprevir" "Antivirals for treatment of HCV infections" "c(\"Asunaprevir\", \"Sunvepra\")"
|
||||
"J05AE08" 148192 "Atazanavir" "Protease inhibitors" "c(\"Atazanavir\", \"Atazanavir Base\", \"Latazanavir\", \"Reyataz\", \"Zrivada\")" 0.3 "g"
|
||||
"J05AR15" 86583336 "Atazanavir and cobicistat" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR23" "Atazanavir and ritonavir" "Antivirals for treatment of HIV infections, combinations" "" 0.3 "g"
|
||||
"J05AP03" 10324367 "Boceprevir" "Antivirals for treatment of HCV infections" "c(\"Bocepravir\", \"Boceprevir\", \"Victrelis\")" 2.4 "g"
|
||||
"J05AB15" 446727 "Brivudine" "Nucleosides and nucleotides excl. reverse transcriptase inhibitors" "c(\"Bridic\", \"Brivox\", \"Brivudin\", \"Brivudina\", \"Brivudine\", \"Brivudinum\", \"BrVdUrd\", \"Helpin\", \"Zerpex\", \"Zostex\")" 0.125 "g"
|
||||
"J05AB12" 60613 "Cidofovir" "Nucleosides and nucleotides excl. reverse transcriptase inhibitors" "c(\"Cidofovir\", \"Cidofovir anhydrous\", \"Cidofovir gel\", \"Cidofovirum\", \"Forvade\", \"Vistide\")" 25 "mg"
|
||||
"J05AF12" 73115 "Clevudine" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Clevudine\", \"Levovir\", \"Revovir\")" 30 "mg"
|
||||
"J05AP07" 25154714 "Daclatasvir" "Antivirals for treatment of HCV infections" "c(\"Daclatasvir\", \"Daklinza\")" 60 "mg"
|
||||
"J05AE10" 213039 "Darunavir" "Protease inhibitors" "c(\"Darunavir\", \"Darunavirum\", \"Prezista\", \"Prezista Naive\")" 1.2 "g"
|
||||
"J05AR14" "Darunavir and cobicistat" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AP09" 56640146 "Dasabuvir" "Antivirals for treatment of HCV infections" "Dasabuvir" 0.5 "g"
|
||||
"J05AP52" "Dasabuvir, ombitasvir, paritaprevir and ritonavir" "Antivirals for treatment of HCV infections" ""
|
||||
"J05AG02" 5625 "Delavirdine" "Non-nucleoside reverse transcriptase inhibitors" "c(\"BHAP der\", \"Delavirdin\", \"Delavirdina\", \"Delavirdine\", \"Delavirdinum\", \"PIPERAZINE\", \"Rescriptor\")" 1.2 "g"
|
||||
"J05AF02" 135398739 "Didanosine" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Didanosina\", \"Didanosine\", \"Didanosinum\", \"Dideoxyinosine\", \"DIDEOXYINOSINE\", \"Hypoxanthine ddN\", \"Videx\", \"Videx EC\")" 0.4 "g"
|
||||
"J05AX12" 54726191 "Dolutegravir" "Other antivirals" "c(\"Dolutegravir\", \"Dolutegravir Sodium\", \"Soltegravir\", \"Tivicay\")" 50 "mg"
|
||||
"J05AR21" 131801472 "Dolutegravir and rilpivirine" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AG06" 58460047 "Doravirine" "Non-nucleoside reverse transcriptase inhibitors" "c(\"Doravirine\", \"Pifeltro\")"
|
||||
"J05AG03" 64139 "Efavirenz" "Non-nucleoside reverse transcriptase inhibitors" "c(\"Efavirenz\", \"Efavirenzum\", \"Eravirenz\", \"Stocrin\", \"Strocin\", \"Sustiva\")" 0.6 "g"
|
||||
"J05AP54" 91669168 "Elbasvir and grazoprevir" "Antivirals for treatment of HCV infections" ""
|
||||
"J05AX11" 5277135 "Elvitegravir" "Other antivirals" "c(\"Elvitegravir\", \"Vitekta\")"
|
||||
"J05AF09" 60877 "Emtricitabine" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Coviracil\", \"Emtricitabin\", \"Emtricitabina\", \"Emtricitabine\", \"Emtricitabinum\", \"Emtritabine\", \"Emtriva\", \"Racivir\")" 0.2 "g"
|
||||
"J05AR17" 90469070 "Emtricitabine and tenofovir alafenamide" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR20" "Emtricitabine, tenofovir alafenamide and bictegravir" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR19" "Emtricitabine, tenofovir alafenamide and rilpivirine" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR22" "Emtricitabine, tenofovir alafenamide, darunavir and cobicistat" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR18" "Emtricitabine, tenofovir alafenamide, elvitegravir and cobicistat" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR06" "Emtricitabine, tenofovir disoproxil and efavirenz" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR08" "Emtricitabine, tenofovir disoproxil and rilpivirine" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR09" "Emtricitabine, tenofovir disoproxil, elvitegravir and cobicistat" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AX07" 16130199 "Enfuvirtide" "Other antivirals" "c(\"Enfurvitide\", \"Enfuvirtide\", \"Fuzeon\", \"Pentafuside\")" 0.18 "g"
|
||||
"J05AX17" 10089466 "Enisamium iodide" "Other antivirals" "Enisamium iodide" 1.5 "g"
|
||||
"J05AF10" 135398508 "Entecavir" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Baraclude\", \"Entecavir\", \"Entecavir anhydrous\", \"Entecavirum\")" 0.5 "mg"
|
||||
"J05AG04" 193962 "Etravirine" "Non-nucleoside reverse transcriptase inhibitors" "c(\"DAPY deriv\", \"Etravine\", \"Etravirine\", \"Intelence\")" 0.4 "g"
|
||||
"J05AP04" 42601552 "Faldaprevir" "Antivirals for treatment of HCV infections" "Faldaprevir"
|
||||
"J05AB09" 3324 "Famciclovir" "Nucleosides and nucleotides excl. reverse transcriptase inhibitors" "c(\"Famciclovir\", \"Famciclovirum\", \"Famvir\", \"Oravir\")" 0.75 "g"
|
||||
"J05AE07" 131536 "Fosamprenavir" "Protease inhibitors" "c(\"Amprenavir phosphate\", \"Fosamprenavir\", \"Lexiva\", \"Telzir\")" 1.4 "g"
|
||||
"J05AD01" 3415 "Foscarnet" "Phosphonic acid derivatives" "c(\"Forscarnet\", \"Forscarnet sodium\", \"Foscarmet\", \"Foscarnet\", \"Phosphonoformate\", \"Phosphonoformic acid\")" 6.5 "g"
|
||||
"J05AD02" 546 "Fosfonet" "Phosphonic acid derivatives" "c(\"Fosfonet\", \"Fosfonet sodium\", \"Fosfonet Sodium\", \"Fosfonoacetate\", \"Fosfonoacetic acid\", \"Phosphonacetate\", \"Phosphonacetic acid\")"
|
||||
"J05AB06" 135398740 "Ganciclovir" "Nucleosides and nucleotides excl. reverse transcriptase inhibitors" "c(\"Citovirax\", \"Cymevan\", \"Cymeven\", \"Cymevene\", \"Cytovene\", \"Cytovene IV\", \"Ganciclovir\", \"Ganciclovirum\", \"Gancyclovir\", \"Hydroxyacyclovir\", \"Virgan\", \"Vitrasert\", \"Zirgan\")" 3 "g" 0.5 "g"
|
||||
"J05AP57" "Glecaprevir and pibrentasvir" "Antivirals for treatment of HCV infections" ""
|
||||
"J05AX23" "Ibalizumab" "Other antivirals" ""
|
||||
"J05AB02" 5905 "Idoxuridine" "Nucleosides and nucleotides excl. reverse transcriptase inhibitors" "c(\"Antizona\", \"Dendrid\", \"Emanil\", \"Heratil\", \"Herpesil\", \"Herpid\", \"Herpidu\", \"Herplex\", \"HERPLEX\", \"Herplex liquifilm\", \"Idexur\", \"Idossuridina\", \"Idoxene\", \"Idoxuridin\", \"Idoxuridina\", \"Idoxuridine\", \"Idoxuridinum\", \"Idu Oculos\", \"Iducher\", \"Idulea\", \"Iduoculos\", \"Iduridin\", \"Iduviran\", \"Iododeoxyridine\", \"Iododeoxyuridine\", \"Iodoxuridine\", \"Joddeoxiuridin\", \"Kerecid\", \"Kerecide\", \"Ophthalmadine\", \"Spectanefran\", \"Stoxil\", \"Synmiol\", \"Virudox\")"
|
||||
"J05AE02" 5362440 "Indinavir" "Protease inhibitors" "c(\"Compound J\", \"Crixivan\", \"Indinavir\", \"Indinavir anhydrous\", \"Propolis+Indinavir\")" 2.4 "g"
|
||||
"J05AX05" 135449284 "Inosine pranobex" "Other antivirals" "c(\"Aviral\", \"Delimmun\", \"Immunovir\", \"Imunovir\", \"Inosine pranobex\", \"Inosiplex\", \"Isoprinosin\", \"Isoprinosina\", \"Isoprinosine\", \"Isoviral\", \"Methisoprinol\", \"Methysoprinol\", \"Metisoprinol\", \"Viruxan\")" 3 "g"
|
||||
"J05AF05" 60825 "Lamivudine" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Epivir\", \"Hepitec\", \"Heptivir\", \"Heptodin\", \"Heptovir\", \"Lamivir\", \"Lamivudin\", \"Lamivudina\", \"Lamivudine\", \"Lamivudinum\", \"Zeffix\")" 0.3 "g"
|
||||
"J05AR02" "Lamivudine and abacavir" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR16" 73386700 "Lamivudine and raltegravir" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR12" "Lamivudine and tenofovir disoproxil" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR13" "Lamivudine, abacavir and dolutegravir" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR24" "Lamivudine, tenofovir disoproxil and doravirine" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR11" "Lamivudine, tenofovir disoproxil and efavirenz" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AX18" 45138674 "Letermovir" "Other antivirals" "c(\"Letermovir\", \"Prevymis\")" 0.48 "g" 0.48 "g"
|
||||
"J05AR10" 11979606 "Lopinavir and ritonavir" "Antivirals for treatment of HIV infections, combinations" "c(\"Aluvia\", \"Kaletra\")" 0.8 "g"
|
||||
"J05AX02" 24839946 "Lysozyme" "Other antivirals" "c(\"Lysozyme chloride\", \"Lysozyme Chloride\", \"Lysozyme G\")"
|
||||
"J05AX09" 3002977 "Maraviroc" "Other antivirals" "c(\"Celsentri\", \"Maraviroc\", \"Selzentry\")" 0.6 "g"
|
||||
"J05AX10" 471161 "Maribavir" "Other antivirals" "c(\"Benzimidavir\", \"Camvia\", \"Maribavir\")"
|
||||
"J05AA01" 667492 "Metisazone" "Thiosemicarbazones" "c(\"Kemoviran\", \"Marboran\", \"Marborane\", \"Methisazon\", \"Methisazone\", \"Methsazone\", \"Metisazon\", \"Metisazona\", \"Metisazone\", \"Metisazonum\", \"Viruzona\")"
|
||||
"J05AX01" 71655 "Moroxydine" "Other antivirals" "c(\"Bimolin\", \"Flumidine\", \"Influmine\", \"Moroxidina\", \"Moroxydine\", \"Moroxydinum\", \"Vironil\", \"Virugon\", \"Virumin\", \"Wirumin\")" 0.3 "g"
|
||||
"J05AE04" 64143 "Nelfinavir" "Protease inhibitors" "c(\"Nelfinavir\", \"Viracept\")" 2.25 "g"
|
||||
"J05AG01" 4463 "Nevirapine" "Non-nucleoside reverse transcriptase inhibitors" "c(\"Nevirapine\", \"Nevirapine anhydrous\", \"Viramune\", \"Viramune IR\", \"Viramune XR\")" 0.4 "g"
|
||||
"J05AP53" "Ombitasvir, paritaprevir and ritonavir" "Antivirals for treatment of HCV infections" ""
|
||||
"J05AH02" 65028 "Oseltamivir" "Neuraminidase inhibitors" "c(\"Agucort\", \"Oseltamivir\", \"Tamiflu\", \"Tamvir\")" 0.15 "g"
|
||||
"J05AB13" 135398748 "Penciclovir" "Nucleosides and nucleotides excl. reverse transcriptase inhibitors" "c(\"Adenovir\", \"Denavir\", \"Penciceovir\", \"Penciclovir\", \"Penciclovirum\", \"Pencyclovir\", \"Vectavir\")"
|
||||
"J05AX21" 9942657 "Pentanedioic acid imidazolyl ethanamide" "Other antivirals" "Ingamine" 90 "mg"
|
||||
"J05AH03" 154234 "Peramivir" "Neuraminidase inhibitors" "c(\"PeramiFlu\", \"Peramivir\", \"Rapiacta\", \"RAPIVAB\")"
|
||||
"J05AX06" 1684 "Pleconaril" "Other antivirals" "c(\"Picovir\", \"Pleconaril\", \"Pleconarilis\")"
|
||||
"J05AX08" 54671008 "Raltegravir" "Other antivirals" "c(\"Isentress\", \"Raltegravir\")" 0.8 "g"
|
||||
"J05AP01" 37542 "Ribavirin" "Antivirals for treatment of HCV infections" "c(\"Copegus\", \"Cotronak\", \"Drug: Ribavirin\", \"Ravanex\", \"Rebetol\", \"Rebetron\", \"Rebretron\", \"Ribacine\", \"Ribamide\", \"Ribamidil\", \"Ribamidyl\", \"Ribasphere\", \"Ribavirin\", \"Ribavirin Capsules\", \"Ribavirina\", \"Ribavirine\", \"Ribavirinum\", \"Ribovirin\", \"Tribavirin\", \"Varazid\", \"Vilona\", \"Viramid\", \"Viramide\", \"Virazid\", \"Virazide\", \"Virazole\")" 1 "g"
|
||||
"J05AG05" 6451164 "Rilpivirine" "Non-nucleoside reverse transcriptase inhibitors" "c(\"Edurant\", \"Rilpivirine\")" 25 "mg"
|
||||
"J05AC02" 5071 "Rimantadine" "Cyclic amines" "c(\"Remantadine\", \"Riamantadine\", \"Rimant\", \"RIMANTADIN\", \"Rimantadin A\", \"Rimantadina\", \"Rimantadine\", \"Rimantadinum\")" 0.2 "g"
|
||||
"J05AE03" 392622 "Ritonavir" "Protease inhibitors" "c(\"Norvir\", \"Norvir Sec\", \"Norvir Softgel\", \"Ritonavir\", \"Ritonavire\", \"Ritonavirum\")" 1.2 "g"
|
||||
"J05AE01" 441243 "Saquinavir" "Protease inhibitors" "c(\"Fortovase\", \"Invirase\", \"Saquinavir\")" 1.8 "g"
|
||||
"J05AP05" 24873435 "Simeprevir" "Antivirals for treatment of HCV infections" "c(\"Olysio\", \"Simeprevir sodium\")" 0.15 "g"
|
||||
"J05AP08" 45375808 "Sofosbuvir" "Antivirals for treatment of HCV infections" "c(\"Hepcinat\", \"Hepcvir\", \"Sofosbuvir\", \"Sovaldi\", \"SOVALDI\", \"SoviHep\")" 0.4 "g"
|
||||
"J05AP51" 72734365 "Sofosbuvir and ledipasvir" "Antivirals for treatment of HCV infections" ""
|
||||
"J05AP55" 91885554 "Sofosbuvir and velpatasvir" "Antivirals for treatment of HCV infections" "Epclusa Tablet"
|
||||
"J05AP56" "Sofosbuvir, velpatasvir and voxilaprevir" "Antivirals for treatment of HCV infections" ""
|
||||
"J05AF04" 18283 "Stavudine" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Estavudina\", \"Sanilvudine\", \"Stavudin\", \"Stavudine\", \"Stavudinum\", \"Zerit Xr\", \"Zerut XR\")" 80 "mg"
|
||||
"J05AR07" 15979285 "Stavudine, lamivudine and nevirapine" "Antivirals for treatment of HIV infections, combinations" "STAVUDIINE"
|
||||
"J05AP02" 3010818 "Telaprevir" "Antivirals for treatment of HCV infections" "c(\"Incivek\", \"Incivo\", \"Telaprevir\", \"Telavic\")" 2.25 "g"
|
||||
"J05AF11" 159269 "Telbivudine" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Epavudine\", \"Sebivo\", \"Telbivudin\", \"Telbivudine\", \"Tyzeka\")" 0.6 "g"
|
||||
"J05AF13" 9574768 "Tenofovir alafenamide" "Nucleoside and nucleotide reverse transcriptase inhibitors" "Vemlidy" 25 "mg"
|
||||
"J05AF07" 5481350 "Tenofovir disoproxil" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"BisPMPA\", \"PMPA prodrug\", \"Tenofovir\", \"Viread\")" 0.245 "g"
|
||||
"J05AR03" "Tenofovir disoproxil and emtricitabine" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AX19" 5475 "Tilorone" "Other antivirals" "c(\"Amiksin\", \"Amixin\", \"Amixin IC\", \"Amyxin\", \"Tiloron\", \"Tilorona\", \"Tilorone\", \"Tiloronum\")" 0.125 "g"
|
||||
"J05AE09" 54682461 "Tipranavir" "Protease inhibitors" "c(\"Aptivus\", \"Tipranavir\")" 1 "g"
|
||||
"J05AC03" 64377 "Tromantadine" "Cyclic amines" "c(\"Tromantadina\", \"Tromantadine\", \"Tromantadinum\", \"Viruserol\")"
|
||||
"J05AX13" 131411 "Umifenovir" "Other antivirals" "c(\"Arbidol\", \"Arbidol base\", \"Umifenovir\")" 0.8 "g"
|
||||
"J05AB11" 135398742 "Valaciclovir" "Nucleosides and nucleotides excl. reverse transcriptase inhibitors" "c(\"Talavir\", \"Valaciclovir\", \"Valaciclovirum\", \"ValACV\", \"Valcivir\", \"Valcyclovir\", \"Valtrex\", \"Virval\", \"Zelitrex\")" 3 "g"
|
||||
"J05AB14" 135413535 "Valganciclovir" "Nucleosides and nucleotides excl. reverse transcriptase inhibitors" "c(\"Cymeval\", \"Valganciclovir\")" 0.9 "g"
|
||||
"J05AB03" 21704 "Vidarabine" "Nucleosides and nucleotides excl. reverse transcriptase inhibitors" "c(\"Adenine arabinoside\", \"Araadenosine\", \"Arabinoside adenine\", \"Arabinosyl adenine\", \"Arabinosyladenine\", \"Spongoadenosine\", \"Vidarabin\", \"Vidarabina\", \"Vidarabine\", \"Vidarabine anhydrous\", \"Vidarabinum\", \"Vira A\", \"Vira ATM\")"
|
||||
"J05AF03" 24066 "Zalcitabine" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Dideoxycytidine\", \"Interferon AD + ddC\", \"Zalcitabine\", \"Zalcitibine\")" 2.25 "mg"
|
||||
"J05AH01" 60855 "Zanamivir" "Neuraminidase inhibitors" "c(\"MODIFIED SIALIC ACID\", \"Relenza\", \"Zanamavir\", \"Zanamir\", \"Zanamivi\", \"Zanamivir\", \"Zanamivir hydrate\")"
|
||||
"J05AF01" 35370 "Zidovudine" "Nucleoside and nucleotide reverse transcriptase inhibitors" "c(\"Azidothymidine\", \"AZT Antiviral\", \"Beta interferon\", \"Compound S\", \"Propolis+AZT\", \"Retrovir\", \"Zidovudina\", \"Zidovudine\", \"ZIDOVUDINE\", \"Zidovudine EP III\", \"Zidovudinum\")" 0.6 "g" 0.6 "g"
|
||||
"J05AR01" "Zidovudine and lamivudine" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR04" "Zidovudine, lamivudine and abacavir" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
"J05AR05" "Zidovudine, lamivudine and nevirapine" "Antivirals for treatment of HIV infections, combinations" ""
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
7b6649442069d3d121f61ca3ff01843a
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
license_text <- readLines("docs/LICENSE-text.html")
|
||||
license_text <- paste(license_text, collapse = "|||")
|
||||
license_text <- gsub("licen(s|c)e", "Survey", license_text, ignore.case = TRUE)
|
||||
license_text <- gsub("<pre>.*</pre>", '<p>If no form is showing below, please <a href="https://forms.office.com/Pages/ResponsePage.aspx?id=-SJRM_TUZ02i_M1twg3ecDlnO1BBtdxGi-GnYu7DKfdUNTFLQ0xVSUlRVVlXTlVTNjZFMjdRUVpCSy4u" target="_blank">click here to open it</a>.</p><iframe width="100%" height= "500px" src= "https://forms.office.com/Pages/ResponsePage.aspx?id=-SJRM_TUZ02i_M1twg3ecDlnO1BBtdxGi-GnYu7DKfdUNTFLQ0xVSUlRVVlXTlVTNjZFMjdRUVpCSy4u&embed=true" frameborder= "0" marginwidth= "0" marginheight= "0" style= "border: none; max-width:100%; max-height:100vh" allowfullscreen webkitallowfullscreen mozallowfullscreen msallowfullscreen> </iframe>', license_text)
|
||||
writeLines(unlist(strsplit(license_text, "|||", fixed = TRUE)), "docs/survey.html")
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 48 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 43 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user