mirror of
https://github.com/msberends/AMR.git
synced 2026-08-19 23:19:26 +02:00
Compare commits
1 Commits
main
...
sir-s3-upd
| Author | SHA1 | Date | |
|---|---|---|---|
| d232666e49 |
@@ -9,7 +9,6 @@
|
||||
^_pkgdown\.yml$
|
||||
^appveyor\.yml$
|
||||
^codecov\.yml$
|
||||
^CLAUDE\.md$
|
||||
^cran-comments\.md$
|
||||
^CRAN-RELEASE$
|
||||
^\.github$
|
||||
@@ -41,5 +40,3 @@
|
||||
^CRAN-SUBMISSION$
|
||||
^PythonPackage$
|
||||
^README\.Rmd$
|
||||
^tools$
|
||||
\.no_include$
|
||||
|
||||
10
.github/ISSUE_TEMPLATE/1-bug-report.yml
vendored
10
.github/ISSUE_TEMPLATE/1-bug-report.yml
vendored
@@ -22,9 +22,9 @@ body:
|
||||
label: Minimal Reproducible Example (optional)
|
||||
description: Please include a short R code snippet that reproduces the problem, if possible.
|
||||
placeholder:
|
||||
e.g.
|
||||
```r
|
||||
ab_name("amoxicillin/clavulanic acid", language = "es")
|
||||
e.g.
|
||||
```r
|
||||
ab_name("amoxicillin/clavulanic acid", language = "es")
|
||||
```
|
||||
validations:
|
||||
required: false
|
||||
@@ -42,7 +42,7 @@ body:
|
||||
multiple: false
|
||||
options:
|
||||
- ''
|
||||
- Latest CRAN version (3.0.1)
|
||||
- One of the latest GitHub versions (3.0.1.9xxx)
|
||||
- Latest CRAN version (3.0.0)
|
||||
- One of the latest GitHub versions (3.0.0.9xxx)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
10
.github/prehooks/pre-commit
vendored
10
.github/prehooks/pre-commit
vendored
@@ -48,6 +48,7 @@ echo "Running prehook..."
|
||||
if command -v Rscript > /dev/null; then
|
||||
if [ "$(Rscript -e 'cat(all(c('"'pkgload'"', '"'devtools'"', '"'dplyr'"') %in% rownames(installed.packages())))')" = "TRUE" ]; then
|
||||
Rscript -e "source('data-raw/_pre_commit_checks.R')"
|
||||
currentpkg=$(Rscript -e "cat(pkgload::pkg_name())")
|
||||
echo "- Adding changed files in ./data-raw and ./man to this commit"
|
||||
git add data-raw/*
|
||||
git add data/*
|
||||
@@ -56,9 +57,11 @@ if command -v Rscript > /dev/null; then
|
||||
git add NAMESPACE
|
||||
else
|
||||
echo "- R package 'pkgload', 'devtools', or 'dplyr' not installed!"
|
||||
currentpkg="your"
|
||||
fi
|
||||
else
|
||||
echo "- R is not available on your system!"
|
||||
currentpkg="your"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -89,7 +92,7 @@ else
|
||||
|
||||
# Combine tag and commit number
|
||||
currentversion="$currenttag.$((currentcommit + 9001))"
|
||||
echo "- AMR pkg version set to ${currentversion}"
|
||||
echo "- ${currentpkg} pkg version set to ${currentversion}"
|
||||
|
||||
# Update version number and date in DESCRIPTION
|
||||
sed -i -- "s/^Version: .*/Version: ${currentversion}/" DESCRIPTION
|
||||
@@ -100,7 +103,10 @@ else
|
||||
|
||||
# Update version number in NEWS.md
|
||||
if [ -e "NEWS.md" ]; then
|
||||
sed -i -- "1s/.*/# AMR ${currentversion}/" NEWS.md
|
||||
if [ "$currentpkg" = "your" ]; then
|
||||
currentpkg=""
|
||||
fi
|
||||
sed -i -- "1s/.*/# ${currentpkg} ${currentversion}/" NEWS.md
|
||||
echo "- Updated version number in ./NEWS.md"
|
||||
rm -f NEWS.md--
|
||||
git add NEWS.md
|
||||
|
||||
38
.github/workflows/check-current-testthat.yaml
vendored
38
.github/workflows/check-current-testthat.yaml
vendored
@@ -29,11 +29,10 @@
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
# run in each PR in this repo (1 worker, see matrix logic below)
|
||||
# run in each PR in this repo
|
||||
branches: '**'
|
||||
push:
|
||||
# only on main; pushing to a PR branch is already covered by pull_request above
|
||||
branches: [main]
|
||||
branches: '**'
|
||||
schedule:
|
||||
# also run a schedule everyday at 1 AM.
|
||||
# this is to check that all dependencies are still available (see R/zzz.R)
|
||||
@@ -42,22 +41,7 @@ on:
|
||||
name: check-recent
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- id: set-matrix
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
echo 'matrix={"config":[{"os":"ubuntu-latest","r":"release","allowfail":false}]}' >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo 'matrix={"config":[{"os":"windows-latest","r":"devel","allowfail":false},{"os":"ubuntu-latest","r":"devel","allowfail":false,"http-user-agent":"release"},{"os":"macOS-latest","r":"release","allowfail":true},{"os":"windows-latest","r":"release","allowfail":false},{"os":"ubuntu-latest","r":"release","allowfail":false},{"os":"ubuntu-latest","r":"oldrel-1","allowfail":false},{"os":"ubuntu-latest","r":"oldrel-2","allowfail":false},{"os":"ubuntu-latest","r":"oldrel-3","allowfail":false},{"os":"ubuntu-latest","r":"oldrel-4","allowfail":false}]}' >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
R-code-check:
|
||||
needs: setup
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
|
||||
continue-on-error: ${{ matrix.config.allowfail }}
|
||||
@@ -66,7 +50,23 @@ jobs:
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
|
||||
matrix:
|
||||
config:
|
||||
# current development version, check all major OSes:
|
||||
# - {os: macOS-latest, r: 'devel', allowfail: true}
|
||||
- {os: windows-latest, r: 'devel', allowfail: false}
|
||||
- {os: ubuntu-latest, r: 'devel', allowfail: false, http-user-agent: 'release'}
|
||||
|
||||
# current 'release' version, check all major OSes:
|
||||
- {os: macOS-latest, r: 'release', allowfail: true}
|
||||
- {os: windows-latest, r: 'release', allowfail: false}
|
||||
- {os: ubuntu-latest, r: 'release', allowfail: false}
|
||||
|
||||
# older versions (see also check-old-tinytest.yaml for even older versions):
|
||||
- {os: ubuntu-latest, r: 'oldrel-1', allowfail: false}
|
||||
- {os: ubuntu-latest, r: 'oldrel-2', allowfail: false}
|
||||
- {os: ubuntu-latest, r: 'oldrel-3', allowfail: false}
|
||||
- {os: ubuntu-latest, r: 'oldrel-4', allowfail: false}
|
||||
|
||||
env:
|
||||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
25
.github/workflows/check-old-tinytest.yaml
vendored
25
.github/workflows/check-old-tinytest.yaml
vendored
@@ -29,8 +29,8 @@
|
||||
|
||||
on:
|
||||
push:
|
||||
# only run after a git push on the main branch
|
||||
branches: [main]
|
||||
# only run after a git push on any branch in this repo
|
||||
branches: '**'
|
||||
|
||||
name: check-old
|
||||
|
||||
@@ -49,12 +49,12 @@ jobs:
|
||||
# Test all old versions of R >= 3.0, we support them all!
|
||||
# For these old versions, dependencies and vignettes will not be checked.
|
||||
# For recent R versions, see check-recent.yaml (r-lib and tidyverse support the latest 5 major R releases).
|
||||
# - {os: ubuntu-latest, r: '3.6', allowfail: false}
|
||||
# - {os: windows-latest, r: '3.5', allowfail: false} # always fails, horrible with UTF-8
|
||||
# - {os: ubuntu-latest, r: '3.4', allowfail: false} # 3.1-3.4 now always fails with Error in grep(warn_re, lines, invert = TRUE, value = TRUE) attempt to set index 46/46 in SET_STRING_ELT
|
||||
# - {os: ubuntu-latest, r: '3.3', allowfail: false}
|
||||
# - {os: ubuntu-latest, r: '3.2', allowfail: false}
|
||||
# - {os: ubuntu-latest, r: '3.1', allowfail: false}
|
||||
- {os: ubuntu-latest, r: '3.6', allowfail: false}
|
||||
# - {os: windows-latest, r: '3.5', allowfail: true} # always fails, horrible with UTF-8
|
||||
- {os: ubuntu-latest, r: '3.4', allowfail: false}
|
||||
- {os: ubuntu-latest, r: '3.3', allowfail: false}
|
||||
- {os: ubuntu-latest, r: '3.2', allowfail: false}
|
||||
- {os: ubuntu-latest, r: '3.1', allowfail: false}
|
||||
- {os: ubuntu-latest, r: '3.0', allowfail: false}
|
||||
|
||||
env:
|
||||
@@ -76,14 +76,9 @@ jobs:
|
||||
|
||||
- uses: r-lib/actions/setup-pandoc@v2
|
||||
|
||||
- name: Install suggested pkgs (and tinytest) from CRAN
|
||||
- name: Install tinytest from CRAN
|
||||
run: |
|
||||
desc_lines <- readLines('DESCRIPTION')
|
||||
suggests <- readLines('DESCRIPTION')[grepl("^(Suggests:| )", readLines('DESCRIPTION'))]
|
||||
suggests <- suggests[(which(grepl("^Suggests", suggests)) + 1):length(suggests)]
|
||||
suggests <- gsub("[ ,]", "", suggests)
|
||||
pkgs <- unique(c(suggests, "tinytest"))
|
||||
for (p in pkgs) try(install.packages(p, repos = "https://cran.r-project.org"), silent = TRUE)
|
||||
install.packages("tinytest", repos = "https://cran.r-project.org")
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Show session info
|
||||
|
||||
8
.github/workflows/codecovr.yaml
vendored
8
.github/workflows/codecovr.yaml
vendored
@@ -28,12 +28,10 @@
|
||||
# ==================================================================== #
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
# run on every PR update (once per push)
|
||||
branches: '**'
|
||||
push:
|
||||
# only on main; PR pushes are already covered by pull_request above
|
||||
branches: [main]
|
||||
branches: '**'
|
||||
pull_request:
|
||||
branches: '**'
|
||||
|
||||
name: code-coverage
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# 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. #
|
||||
# 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. #
|
||||
@@ -29,33 +29,17 @@
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
schedule:
|
||||
# also run a schedule everyday at 1 AM.
|
||||
# this is to check that all dependencies are still available (see R/zzz.R)
|
||||
- cron: '0 1 * * *'
|
||||
branches: '**'
|
||||
pull_request:
|
||||
branches: '**'
|
||||
|
||||
name: check-recent-dev-pkgs
|
||||
name: lintr
|
||||
|
||||
jobs:
|
||||
R-code-check:
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
|
||||
continue-on-error: ${{ matrix.config.allowfail }}
|
||||
|
||||
name: ${{ matrix.config.os }} (dev-pkgs)
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
# current 'release' version on Ubuntu
|
||||
- {os: ubuntu-latest, r: 'release', allowfail: false}
|
||||
|
||||
lintr:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
R_KEEP_PKG_SOURCE: yes
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -63,21 +47,39 @@ jobs:
|
||||
|
||||
- uses: r-lib/actions/setup-r@v2
|
||||
with:
|
||||
r-version: ${{ matrix.config.r }}
|
||||
use-public-rspm: false
|
||||
extra-repositories: >
|
||||
https://tidyverse.r-universe.dev
|
||||
https://r-lib.r-universe.dev
|
||||
https://tidymodels.r-universe.dev
|
||||
https://yihui.r-universe.dev
|
||||
r-version: release
|
||||
# use RStudio Package Manager to quickly install packages
|
||||
use-public-rspm: true
|
||||
|
||||
- uses: r-lib/actions/setup-r-dependencies@v2
|
||||
with:
|
||||
extra-packages: any::rcmdcheck
|
||||
needs: check
|
||||
upgrade: 'TRUE'
|
||||
|
||||
- uses: r-lib/actions/check-r-package@v2
|
||||
with:
|
||||
upload-snapshots: true
|
||||
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
|
||||
extra-packages: |
|
||||
any::lintr
|
||||
any::cyclocomp
|
||||
any::roxygen2
|
||||
any::devtools
|
||||
any::usethis
|
||||
|
||||
- name: Remove unneeded folders
|
||||
run: |
|
||||
# do not check these folders
|
||||
rm -rf data-raw
|
||||
rm -rf tests
|
||||
rm -rf vignettes
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
# get ALL linters, not just default ones
|
||||
linters <- getNamespaceExports(asNamespace("lintr"))
|
||||
linters <- sort(linters[grepl("_linter$", linters)])
|
||||
# lose deprecated
|
||||
linters <- linters[!grepl("^(closed_curly|open_curly|paren_brace|semicolon_terminator|consecutive_stopifnot|no_tab|single_quotes|unnecessary_nested_if|unneeded_concatenation)_linter$", linters)]
|
||||
linters <- linters[linters != "linter"]
|
||||
# and the ones we find unnnecessary
|
||||
linters <- linters[!grepl("^(commented_code|extraction_operator|implicit_integer|indentation|line_length|namespace|nonportable_path|object_length|object_name|object_usage|is)_linter$", linters)]
|
||||
# put the functions in a list
|
||||
linters_list <- lapply(linters, function(l) eval(parse(text = paste0("lintr::", l, "()")), envir = asNamespace("lintr")))
|
||||
names(linters_list) <- linters
|
||||
# run them all!
|
||||
lintr::lint_package(linters = linters_list, exclusions = list("R/aa_helper_pm_functions.R"))
|
||||
shell: Rscript {0}
|
||||
7
.github/workflows/publish-to-pypi.yml
vendored
7
.github/workflows/publish-to-pypi.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
GH_REPO_SCOPE: ${{ secrets.GH_REPO_SCOPE }}
|
||||
PYPI_PAT: ${{ secrets.PYPI_PAT }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -78,7 +78,6 @@ jobs:
|
||||
cd PythonPackage/AMR
|
||||
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
|
||||
|
||||
# TODO - Support Miniconda and Anaconda too
|
||||
# - name: Set up Miniconda
|
||||
# continue-on-error: true
|
||||
# uses: conda-incubator/setup-miniconda@v2
|
||||
@@ -118,7 +117,7 @@ jobs:
|
||||
rm -rf PythonPackage
|
||||
|
||||
git init
|
||||
git remote add origin https://$GH_REPO_SCOPE@github.com/msberends/AMR
|
||||
git remote add origin https://$PYPI_PAT@github.com/msberends/AMR
|
||||
git checkout --orphan python-wrapper
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
@@ -126,4 +125,4 @@ jobs:
|
||||
git rm -rf . || true
|
||||
git add .
|
||||
git commit -m "Python wrapper update"
|
||||
git push https://$GH_REPO_SCOPE@github.com/msberends/AMR.git python-wrapper --force
|
||||
git push https://$PYPI_PAT@github.com/msberends/AMR.git python-wrapper --force
|
||||
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
GH_REPO_SCOPE: ${{ secrets.GH_REPO_SCOPE }}
|
||||
PYPI_PAT: ${{ secrets.PYPI_PAT }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -63,4 +63,4 @@ jobs:
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add latest_training_data.txt
|
||||
git commit -m "GPT training data update"
|
||||
git push https://$GH_REPO_SCOPE@github.com/msberends/amr-for-r-assistant.git main --force
|
||||
git push https://$PYPI_PAT@github.com/msberends/amr-for-r-assistant.git main --force
|
||||
|
||||
271
.github/workflows/todo-tracker.yml
vendored
271
.github/workflows/todo-tracker.yml
vendored
@@ -1,271 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, et al. (2022). #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data. #
|
||||
# Journal of Statistical Software, 104(3), 1-31. #
|
||||
# https://doi.org/10.18637/jss.v104.i03 #
|
||||
# #
|
||||
# Developed at the University of Groningen and the University Medical #
|
||||
# Center Groningen in The Netherlands, in collaboration with many #
|
||||
# colleagues from around the world, see our website. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR data analysis: https://amr-for-r.org #
|
||||
# ==================================================================== #
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: "main"
|
||||
|
||||
name: Update TODO Tracker
|
||||
|
||||
jobs:
|
||||
update-todo:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # full history required for git blame
|
||||
|
||||
- name: Generate TODO report
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_REPO_SCOPE }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
export TZ=Europe/Amsterdam
|
||||
|
||||
REPO="msberends/AMR"
|
||||
REPO_URL="https://github.com/$REPO/blob/main"
|
||||
NOW=$(date +%s)
|
||||
LAST_UPDATED=$(date +"%e %B %Y %H:%M:%S %Z" | sed 's/^ *//')
|
||||
STALE_DAYS=180
|
||||
|
||||
# ── helper: human-readable age ──────────────────────────────
|
||||
format_age() {
|
||||
local d=$1
|
||||
if [ "$d" -lt 0 ] 2>/dev/null; then echo "unknown"; return; fi
|
||||
local y=$((d / 365)) m=$(( (d % 365) / 30 ))
|
||||
if [ "$y" -gt 0 ] && [ "$m" -gt 0 ]; then echo "${y}y ${m}m"
|
||||
elif [ "$y" -gt 0 ]; then echo "${y}y"
|
||||
elif [ "$m" -gt 0 ]; then echo "${m}m"
|
||||
else echo "${d}d"
|
||||
fi
|
||||
}
|
||||
|
||||
export -f format_age
|
||||
|
||||
# ── step 1: find all markers ────────────────────────────────
|
||||
grep -rn \
|
||||
--include='*.R' --include='*.Rmd' --include='*.yaml' \
|
||||
--include='*.yml' --include='*.md' --include='*.css' \
|
||||
--include='*.js' \
|
||||
--exclude='todo-tracker.yml' --exclude='todo.md' \
|
||||
-E '\b(TODO|FIXME|HACK|XXX)\b' . > /tmp/raw.txt || true
|
||||
|
||||
if [ ! -s /tmp/raw.txt ]; then
|
||||
echo -e "## \`TODO\` Report\n\n**Last Updated: ${LAST_UPDATED}**\n\nNo markers found." > todo.md
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# ── step 2: enrich with git blame & extract issue refs ──────
|
||||
> /tmp/enriched.tsv
|
||||
> /tmp/issues_seen.txt
|
||||
|
||||
while IFS= read -r match; do
|
||||
clean=$(printf '%s\n' "$match" | sed 's|^\./||')
|
||||
file=$(printf '%s\n' "$clean" | cut -d: -f1)
|
||||
lineno=$(printf '%s\n' "$clean" | cut -d: -f2)
|
||||
text=$(printf '%s\n' "$clean" | cut -d: -f3-)
|
||||
|
||||
# determine marker type (first match wins, TODO is default)
|
||||
marker="TODO"
|
||||
for m in FIXME HACK XXX; do
|
||||
if printf '%s\n' "$text" | grep -qw "$m"; then marker="$m"; break; fi
|
||||
done
|
||||
|
||||
# git blame timestamp
|
||||
blame_ts=$(git blame -L "${lineno},${lineno}" --porcelain -- "$file" 2>/dev/null \
|
||||
| awk '/^author-time/{print $2}' || echo "0")
|
||||
blame_ts=${blame_ts:-0}
|
||||
|
||||
if [ "$blame_ts" -gt 0 ] 2>/dev/null; then
|
||||
age_days=$(( (NOW - blame_ts) / 86400 ))
|
||||
else
|
||||
age_days=-1
|
||||
fi
|
||||
|
||||
# extract issue references (#NNN)
|
||||
issues=$(printf '%s\n' "$text" | grep -oE '#[0-9]+' | sed 's/#//' | tr '\n' ',' | sed 's/,$//' || true)
|
||||
if [ -n "$issues" ]; then
|
||||
for inum in $(echo "$issues" | tr ',' ' '); do
|
||||
echo "$inum" >> /tmp/issues_seen.txt
|
||||
done
|
||||
fi
|
||||
|
||||
printf '%s\t%s\t%s\t%s\t%s\t%s\n' \
|
||||
"$file" "$lineno" "$marker" "$age_days" "$issues" "$text" >> /tmp/enriched.tsv
|
||||
done < /tmp/raw.txt
|
||||
|
||||
# ── step 3: query GitHub API for referenced issues ──────────
|
||||
> /tmp/issue_info.tsv
|
||||
if [ -s /tmp/issues_seen.txt ]; then
|
||||
sort -un /tmp/issues_seen.txt | while read -r inum; do
|
||||
info=$(gh api "/repos/$REPO/issues/$inum" \
|
||||
--jq '"\(.state)\t\(.title)"' 2>/dev/null \
|
||||
|| echo "unknown (could not fetch)")
|
||||
printf '%s\t%s\n' "$inum" "$info" >> /tmp/issue_info.tsv
|
||||
done
|
||||
fi
|
||||
|
||||
# ── step 4: build the report ────────────────────────────────
|
||||
{
|
||||
# ── header ──
|
||||
echo "## \`TODO\` Report"
|
||||
echo ""
|
||||
echo "**Last Updated: ${LAST_UPDATED}**"
|
||||
echo ""
|
||||
echo "_This overview is automatically updated on each push to \`main\`. It scans for \`TODO\`, \`FIXME\`, \`HACK\`, and \`XXX\` markers across the codebase._"
|
||||
echo ""
|
||||
|
||||
# ── summary table ──
|
||||
total=$(wc -l < /tmp/enriched.tsv | tr -d ' ')
|
||||
files_affected=$(awk -F'\t' '{print $1}' /tmp/enriched.tsv | sort -u | wc -l | tr -d ' ')
|
||||
todo_n=$(awk -F'\t' '$3=="TODO"' /tmp/enriched.tsv | wc -l | tr -d ' ')
|
||||
fixme_n=$(awk -F'\t' '$3=="FIXME"' /tmp/enriched.tsv | wc -l | tr -d ' ')
|
||||
hack_n=$(awk -F'\t' '$3=="HACK"' /tmp/enriched.tsv | wc -l | tr -d ' ')
|
||||
xxx_n=$(awk -F'\t' '$3=="XXX"' /tmp/enriched.tsv | wc -l | tr -d ' ')
|
||||
stale_n=$(awk -F'\t' -v s="$STALE_DAYS" '$4 > s' /tmp/enriched.tsv | wc -l | tr -d ' ')
|
||||
linked_n=$(awk -F'\t' '$5 != ""' /tmp/enriched.tsv | wc -l | tr -d ' ')
|
||||
unlinked_n=$(awk -F'\t' '$5 == ""' /tmp/enriched.tsv | wc -l | tr -d ' ')
|
||||
|
||||
# oldest marker
|
||||
oldest_line=$(awk -F'\t' '$4 >= 0' /tmp/enriched.tsv | sort -t$'\t' -k4 -rn | head -1)
|
||||
oldest_days=$(echo "$oldest_line" | cut -f4)
|
||||
oldest_file=$(echo "$oldest_line" | cut -f1)
|
||||
oldest_lineno=$(echo "$oldest_line" | cut -f2)
|
||||
oldest_age=$(format_age "$oldest_days")
|
||||
|
||||
echo "### Summary"
|
||||
echo ""
|
||||
echo "| Metric | Value |"
|
||||
echo "|:---|---:|"
|
||||
echo "| Total markers | **${total}** |"
|
||||
[ "$todo_n" -gt 0 ] && echo "| \`TODO\` | ${todo_n} |"
|
||||
[ "$fixme_n" -gt 0 ] && echo "| \`FIXME\` | ${fixme_n} |"
|
||||
[ "$hack_n" -gt 0 ] && echo "| \`HACK\` | ${hack_n} |"
|
||||
[ "$xxx_n" -gt 0 ] && echo "| \`XXX\` | ${xxx_n} |"
|
||||
echo "| Files affected | ${files_affected} |"
|
||||
echo "| Stale (> 6 months) | ${stale_n} |"
|
||||
echo "| Oldest marker | ${oldest_age}, \`${oldest_file}\` L${oldest_lineno} |"
|
||||
echo "| Linked to issues | ${linked_n} |"
|
||||
echo "| Unlinked (no issue ref) | ${unlinked_n} |"
|
||||
echo ""
|
||||
|
||||
# ── by referenced issue ──
|
||||
if [ -s /tmp/issue_info.tsv ]; then
|
||||
echo "### By Referenced Issue"
|
||||
echo ""
|
||||
|
||||
has_closed=false
|
||||
|
||||
while IFS=$'\t' read -r inum state title; do
|
||||
count=$(awk -F'\t' -v n="$inum" '$5 ~ "(^|,)"n"(,|$)"' /tmp/enriched.tsv | wc -l | tr -d ' ')
|
||||
[ "$state" = "closed" ] && has_closed=true
|
||||
|
||||
state_icon=""
|
||||
[ "$state" = "closed" ] && state_icon=" :warning:"
|
||||
|
||||
echo "<details><summary><b>#${inum}</b> (${state}): <i>${title}</i> — ${count} marker(s)${state_icon}</summary>"
|
||||
echo ""
|
||||
|
||||
awk -F'\t' -v n="$inum" '$5 ~ "(^|,)"n"(,|$)"' /tmp/enriched.tsv \
|
||||
| while IFS=$'\t' read -r f l m d refs txt; do
|
||||
age_str=$(format_age "$d")
|
||||
flag=""
|
||||
[ "$d" -gt "$STALE_DAYS" ] 2>/dev/null && flag=" :warning:"
|
||||
# re-read the actual source line and trim leading/trailing whitespace
|
||||
src_text=$(sed -n "${l}p" "$f" 2>/dev/null | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' || true)
|
||||
echo "- [\`${f}\` L${l}](${REPO_URL}/${f}#L${l}) (${age_str} ago)${flag}"
|
||||
[ -n "$src_text" ] && echo " \`${src_text}\`"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "</details>"
|
||||
echo ""
|
||||
done < /tmp/issue_info.tsv
|
||||
|
||||
if [ "$has_closed" = true ]; then
|
||||
echo "> **Warning:** some markers reference closed issues and may be stale."
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
|
||||
# ── by file ──
|
||||
echo "### By File"
|
||||
echo ""
|
||||
|
||||
prev_file=""
|
||||
prev_lineno=-99
|
||||
|
||||
while IFS=$'\t' read -r file lineno marker age_days issues text; do
|
||||
if [ "$file" != "$prev_file" ]; then
|
||||
# close previous code block
|
||||
if [ -n "$prev_file" ]; then
|
||||
echo '```'
|
||||
echo ""
|
||||
fi
|
||||
|
||||
file_count=$(awk -F'\t' -v f="$file" '$1==f' /tmp/enriched.tsv | wc -l | tr -d ' ')
|
||||
echo "#### [\`${file}\`](${REPO_URL}/${file}) — ${file_count} marker(s)"
|
||||
echo '```r'
|
||||
|
||||
prev_lineno=-99
|
||||
fi
|
||||
|
||||
# blank line between non-sequential lines (visual grouping)
|
||||
if [ "$file" = "$prev_file" ] && [ $((lineno - prev_lineno)) -gt 1 ]; then
|
||||
echo ""
|
||||
fi
|
||||
|
||||
age_str=$(format_age "$age_days")
|
||||
flag=""
|
||||
[ "$age_days" -gt "$STALE_DAYS" ] 2>/dev/null && flag=" !!"
|
||||
|
||||
# re-read the actual source line to avoid TSV round-trip corruption
|
||||
src_line=$(sed -n "${lineno}p" "$file" 2>/dev/null | sed 's/[[:space:]]*$//' || true)
|
||||
printf 'L%s: %s ◁ %s ago%s\n' "$lineno" "$src_line" "$age_str" "$flag"
|
||||
|
||||
prev_file="$file"
|
||||
prev_lineno="$lineno"
|
||||
done < <(sort -t$'\t' -k1,1 -k2,2n /tmp/enriched.tsv)
|
||||
|
||||
# close final code block
|
||||
if [ -n "$prev_file" ]; then
|
||||
echo '```'
|
||||
fi
|
||||
|
||||
} > todo.md
|
||||
|
||||
- name: Update GitHub issue
|
||||
uses: peter-evans/create-or-update-comment@v4
|
||||
with:
|
||||
token: ${{ secrets.GH_REPO_SCOPE }}
|
||||
issue-number: 231
|
||||
comment-id: 3253439219
|
||||
body-file: todo.md
|
||||
edit-mode: replace
|
||||
9
.github/workflows/website.yaml
vendored
9
.github/workflows/website.yaml
vendored
@@ -42,15 +42,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
# this is to keep timestamps, the default fetch-depth: 1 gets the timestamps of the moment of cloning
|
||||
# we need this for the download page on our website - dates must be of the files, not of the latest git push
|
||||
fetch-depth: 0
|
||||
|
||||
- name: restore timestamps
|
||||
uses: chetan/git-restore-mtime-action@v2
|
||||
- name: Preserve timestamps
|
||||
run: |
|
||||
sudo apt install git-restore-mtime
|
||||
git restore-mtime
|
||||
|
||||
- uses: r-lib/actions/setup-pandoc@v2
|
||||
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,5 @@
|
||||
Meta
|
||||
doc
|
||||
docs
|
||||
.Renviron
|
||||
.Rproj.user
|
||||
.Rhistory
|
||||
@@ -22,7 +21,6 @@ vignettes/*.R
|
||||
^CRAN-RELEASE$
|
||||
packrat/lib*/
|
||||
packrat/src/
|
||||
*~$*
|
||||
data-raw/taxa.txt
|
||||
data-raw/taxon.tab
|
||||
data-raw/CLSI*.pdf
|
||||
|
||||
@@ -2,7 +2,7 @@ Version: 1.0
|
||||
ProjectId: 5128c748-a412-44db-a5fb-45c68c93dd10
|
||||
|
||||
RestoreWorkspace: No
|
||||
SaveWorkspace: Ask
|
||||
SaveWorkspace: No
|
||||
AlwaysSaveHistory: Yes
|
||||
|
||||
EnableCodeIndexing: Yes
|
||||
|
||||
219
CLAUDE.md
219
CLAUDE.md
@@ -1,219 +0,0 @@
|
||||
# CLAUDE.md — AMR R Package
|
||||
|
||||
This file provides context for Claude Code when working in this repository.
|
||||
|
||||
## Project Overview
|
||||
|
||||
**AMR** is a zero-dependency R package for antimicrobial resistance (AMR) data analysis using a One Health approach. It is peer-reviewed, used in 175+ countries, and supports 28 languages.
|
||||
|
||||
Key capabilities:
|
||||
- SIR (Susceptible/Intermediate/Resistant) classification using EUCAST 2011–2025 and CLSI 2011–2025 breakpoints
|
||||
- Antibiogram generation: traditional, combined, syndromic, and WISCA
|
||||
- Microorganism taxonomy database (~79,000 species)
|
||||
- Antimicrobial drug database (~620 drugs)
|
||||
- Multi-drug resistant organism (MDRO) classification
|
||||
- First-isolate identification
|
||||
- Minimum Inhibitory Concentration (MIC) and disk diffusion handling
|
||||
- Multilingual output (28 languages)
|
||||
|
||||
## Common Commands
|
||||
|
||||
All commands run inside an R session:
|
||||
|
||||
```r
|
||||
# Rebuild documentation (roxygen2 → .Rd files + NAMESPACE)
|
||||
devtools::document()
|
||||
|
||||
# Run all tests
|
||||
devtools::test()
|
||||
|
||||
# Full package check (CRAN-level: docs + tests + checks)
|
||||
devtools::check()
|
||||
|
||||
# Build pkgdown website locally
|
||||
pkgdown::build_site()
|
||||
|
||||
# Code coverage report
|
||||
covr::package_coverage()
|
||||
```
|
||||
|
||||
From the shell:
|
||||
|
||||
```bash
|
||||
# CRAN check from parent directory
|
||||
R CMD check AMR
|
||||
```
|
||||
|
||||
## Repository Structure
|
||||
|
||||
```
|
||||
R/ # All R source files (62 files, ~28,000 lines)
|
||||
man/ # Auto-generated .Rd documentation (do not edit manually)
|
||||
tests/testthat/ # testthat test files (test-*.R) and helper-functions.R
|
||||
data/ # Pre-compiled .rda datasets
|
||||
data-raw/ # Scripts used to generate data/ files
|
||||
vignettes/ # Rmd vignette articles
|
||||
inst/ # Installed files (translations, etc.)
|
||||
_pkgdown.yml # pkgdown website configuration
|
||||
```
|
||||
|
||||
## R Source File Conventions
|
||||
|
||||
**Naming conventions in `R/`:**
|
||||
|
||||
| Prefix/Name | Purpose |
|
||||
|---|---|
|
||||
| `aa_*.R` | Loaded first (helpers, globals, options, package docs) |
|
||||
| `zz_deprecated.R` | Deprecated function wrappers |
|
||||
| `zzz.R` | `.onLoad` / `.onAttach` initialization |
|
||||
|
||||
**Key source files:**
|
||||
|
||||
- `aa_helper_functions.R` / `aa_helper_pm_functions.R` — internal utility functions (large; ~63 KB and ~37 KB)
|
||||
- `aa_globals.R` — global constants and breakpoint lookup structures
|
||||
- `aa_options.R` — `amr_options()` / `get_AMR_option()` system
|
||||
- `mo.R` / `mo_property.R` — microorganism lookup and properties
|
||||
- `ab.R` / `ab_property.R` — antimicrobial drug functions
|
||||
- `av.R` / `av_property.R` — antiviral drug functions
|
||||
- `sir.R` / `sir_calc.R` / `sir_df.R` — SIR classification engine
|
||||
- `mic.R` / `disk.R` — MIC and disk diffusion classes
|
||||
- `antibiogram.R` — antibiogram generation (traditional, combined, syndromic, WISCA)
|
||||
- `first_isolate.R` — first-isolate identification algorithms
|
||||
- `mdro.R` — MDRO classification (EUCAST, CLSI, CDC, custom guidelines)
|
||||
- `amr_selectors.R` — tidyselect helpers for selecting AMR columns
|
||||
- `interpretive_rules.R` / `custom_eucast_rules.R` — clinical interpretation rules
|
||||
- `translate.R` — 28-language translation system
|
||||
- `ggplot_sir.R` / `ggplot_pca.R` / `plotting.R` — visualisation functions
|
||||
|
||||
## Code Style
|
||||
|
||||
Follow the [tidyverse style guide](https://style.tidyverse.org/) precisely. Key rules:
|
||||
|
||||
- 2-space indentation; no tabs
|
||||
- `<-` for assignment, not `=`
|
||||
- Spaces around all binary operators and after commas; no spaces inside parentheses
|
||||
- When a function call must break across lines, place the first argument on a new line indented by 2 spaces, and put the closing `)` on its own line — **never align arguments to the opening parenthesis** (no hanging/forced mid-line indentation)
|
||||
|
||||
```r
|
||||
# good
|
||||
stop_(
|
||||
"some long message part one ",
|
||||
"part two"
|
||||
)
|
||||
|
||||
# bad — forces indentation to match the opening parenthesis
|
||||
stop_("some long message part one ",
|
||||
"part two")
|
||||
```
|
||||
|
||||
## Custom S3 Classes
|
||||
|
||||
The package defines five S3 classes with full print/format/plot/vctrs support:
|
||||
|
||||
| Class | Created by | Represents |
|
||||
|---|---|---|
|
||||
| `<mo>` | `as.mo()` | Microorganism code |
|
||||
| `<ab>` | `as.ab()` | Antimicrobial drug code |
|
||||
| `<av>` | `as.av()` | Antiviral drug code |
|
||||
| `<sir>` | `as.sir()` | SIR value (S/I/R/SDD) |
|
||||
| `<mic>` | `as.mic()` | Minimum inhibitory concentration |
|
||||
| `<disk>` | `as.disk()` | Disk diffusion diameter |
|
||||
|
||||
## Data Files
|
||||
|
||||
Pre-compiled in `data/` (do not edit directly; regenerate via `data-raw/` scripts):
|
||||
|
||||
| File | Contents |
|
||||
|---|---|
|
||||
| `microorganisms.rda` | ~79,000 microbial species with full taxonomy |
|
||||
| `antimicrobials.rda` | ~620 antimicrobial drugs with ATC codes |
|
||||
| `antivirals.rda` | Antiviral drugs |
|
||||
| `clinical_breakpoints.rda` | EUCAST + CLSI breakpoints (2011–2025) |
|
||||
| `intrinsic_resistant.rda` | Intrinsic resistance patterns |
|
||||
| `example_isolates.rda` | Example AMR dataset for documentation/testing |
|
||||
| `WHONET.rda` | Example WHONET-format dataset |
|
||||
|
||||
## Zero-Dependency Design
|
||||
|
||||
The package has **no `Imports`** in `DESCRIPTION`. All optional integrations (ggplot2, dplyr, data.table, tidymodels, cli, crayon, etc.) are listed in `Suggests` and guarded with:
|
||||
|
||||
```r
|
||||
if (requireNamespace("pkg", quietly = TRUE)) { ... }
|
||||
```
|
||||
|
||||
Never add packages to `Imports`. If new functionality requires an external package, add it to `Suggests` and guard usage appropriately.
|
||||
|
||||
## Testing
|
||||
|
||||
- **Framework:** `testthat` (R ≥ 3.1); legacy `tinytest` used for R 3.0–3.6 CI
|
||||
- **Test files:** `tests/testthat/test-*.R`
|
||||
- **Helpers:** `tests/testthat/helper-functions.R`
|
||||
- **CI matrix:** GitHub Actions across Windows / macOS / Linux × R devel / release / oldrel-1 through oldrel-4
|
||||
- **Coverage:** `covr` (some files excluded: `atc_online.R`, `mo_source.R`, `translate.R`, `resistance_predict.R`, `zz_deprecated.R`, helper files, `zzz.R`)
|
||||
|
||||
## Documentation
|
||||
|
||||
- All exported functions use **roxygen2** blocks (`RoxygenNote: 7.3.3`, markdown enabled)
|
||||
- Run `devtools::document()` after any change to roxygen comments
|
||||
- Never edit files in `man/` directly — they are auto-generated
|
||||
- Vignettes live in `vignettes/` as `.Rmd` files
|
||||
- The pkgdown website is configured in `_pkgdown.yml`
|
||||
|
||||
## Versioning
|
||||
|
||||
Version format: `major.minor.patch.dev` (e.g., `3.0.1.9021`)
|
||||
|
||||
- Development versions use a `.9xxx` suffix
|
||||
- Stable CRAN releases drop the dev suffix (e.g., `3.0.1`)
|
||||
- `NEWS.md` uses sections **New**, **Fixes**, **Updates** with GitHub issue references (`#NNN`)
|
||||
|
||||
### Version and date bump required for every PR
|
||||
|
||||
All PRs are **squash-merged**, so each PR lands as exactly **one commit** on the default branch. Version numbers are kept in sync with the cumulative commit count since the last released tag. Therefore **exactly one version bump is allowed per PR**, regardless of how many intermediate commits are made on the branch.
|
||||
|
||||
#### Computing the correct version number
|
||||
|
||||
**First, ensure `git` and `gh` are installed** — both are required for the version computation and for pushing changes. Install them if missing before doing anything else:
|
||||
|
||||
```bash
|
||||
which git || apt-get install -y git
|
||||
which gh || apt-get install -y gh
|
||||
# Also ensure all tags are fetched so git describe works
|
||||
git fetch --tags
|
||||
```
|
||||
|
||||
Then run the following from the repo root to determine the version string to use:
|
||||
|
||||
```bash
|
||||
currenttag=$(git describe --tags --abbrev=0 | sed 's/v//')
|
||||
currenttagfull=$(git describe --tags --abbrev=0)
|
||||
defaultbranch=$(git branch | cut -c 3- | grep -E '^master$|^main$')
|
||||
git fetch origin ${defaultbranch} --quiet
|
||||
currentcommit=$(git rev-list --count ${currenttagfull}..origin/${defaultbranch})
|
||||
currentversion="${currenttag}.$((currentcommit + 9001 + 1))"
|
||||
echo "$currentversion"
|
||||
```
|
||||
|
||||
The `+ 1` accounts for the fact that this PR's squash commit is not yet on the default branch. Set **both** of these files to the resulting version string (and only once per PR, even across multiple commits):
|
||||
|
||||
1. **`DESCRIPTION`** — the `Version:` field
|
||||
2. **`NEWS.md`** — **only replace line 1** (the `# AMR <version>` heading) with the new version number; do **not** create a new section. `NEWS.md` is a **continuous log** for the entire current `x.y.z.9nnn` development series: all changes since the last stable release accumulate under that single heading. After updating line 1, append the new change as a bullet under the appropriate sub-heading (`### New`, `### Fixes`, or `### Updates`).
|
||||
|
||||
Style rules for `NEWS.md` entries:
|
||||
- Be **extremely concise** — one short line per item
|
||||
- Do **not** end with a full stop (period)
|
||||
- No verbose explanations; just the essential fact
|
||||
|
||||
If `git describe` fails (e.g. no tags exist in the environment), fall back to reading the current version from `DESCRIPTION` and adding 1 to the last numeric component — but only if no bump has already been made in this PR.
|
||||
|
||||
#### Date field
|
||||
|
||||
The `Date:` field in `DESCRIPTION` must reflect the date of the **last commit to the PR** (not the first), in ISO format. Update it with every commit so it is always current:
|
||||
|
||||
```
|
||||
Date: 2026-03-07
|
||||
```
|
||||
|
||||
## Internal State
|
||||
|
||||
The package uses a private `AMR_env` environment (created in `aa_globals.R`) for caching expensive lookups (e.g., microorganism matching scores, breakpoint tables). This avoids re-computation within a session.
|
||||
@@ -1,3 +1,3 @@
|
||||
Version: 3.0.1
|
||||
Date: 2025-09-20 10:56:46 UTC
|
||||
SHA: 33fb1849eb5aa6d33828e643c8f5047dd93447e3
|
||||
Version: 3.0.0
|
||||
Date: 2025-06-01 16:52:53 UTC
|
||||
SHA: 79038fed2169a25a7fc067c80bb25d9d78be21d9
|
||||
|
||||
20
DESCRIPTION
20
DESCRIPTION
@@ -1,6 +1,6 @@
|
||||
Package: AMR
|
||||
Version: 3.0.1.9086
|
||||
Date: 2026-08-13
|
||||
Version: 3.0.0.9017
|
||||
Date: 2025-07-28
|
||||
Title: Antimicrobial Resistance Data Analysis
|
||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||
data analysis and to work with microbial and antimicrobial properties by
|
||||
@@ -27,28 +27,27 @@ Authors@R: c(
|
||||
person(given = c("Judith", "M."), family = "Fonville", role = "ctb"),
|
||||
person(given = c("Kathryn"), family = "Holt", role = "ctb", comment = c(ORCID = "0000-0003-3949-2471")),
|
||||
person(given = c("Larisse"), family = "Bolton", role = "ctb", comment = c(ORCID = "0000-0001-7879-2173")),
|
||||
person(given = c("Matthew"), family = "Saab", role = "ctb", comment = c(ORCID = "0009-0008-6626-7919")),
|
||||
person(given = c("Matthew"), family = "Saab", role = "ctb"),
|
||||
person(given = c("Natacha"), family = "Couto", role = "ctb", comment = c(ORCID = "0000-0002-9152-5464")),
|
||||
person(given = c("Peter"), family = "Dutey-Magni", role = "ctb", comment = c(ORCID = "0000-0002-8942-9836")),
|
||||
person(given = c("Rogier", "P."), family = "Schade", role = "ctb", comment = c(ORCID = "0000-0002-9487-4467")),
|
||||
person(given = c("Rogier", "P."), family = "Schade", role = "ctb"),
|
||||
person(given = c("Sofia"), family = "Ny", role = "ctb", comment = c(ORCID = "0000-0002-2017-1363")),
|
||||
person(given = c("Alex", "W."), family = "Friedrich", role = "ths", comment = c(ORCID = "0000-0003-4881-038X")),
|
||||
person(given = c("Bhanu", "N.", "M."), family = "Sinha", role = "ths", comment = c(ORCID = "0000-0003-1634-0010")),
|
||||
person(given = c("Casper", "J."), family = "Albers", role = "ths", comment = c(ORCID = "0000-0002-9213-6743")),
|
||||
person(given = c("Corinna"), family = "Glasner", role = "ths", comment = c(ORCID = "0000-0003-1241-1328")))
|
||||
Depends: R (>= 3.0.0)
|
||||
Suggests:
|
||||
Suggests:
|
||||
cleaner,
|
||||
cli,
|
||||
crayon,
|
||||
curl,
|
||||
data.table,
|
||||
dplyr,
|
||||
future,
|
||||
future.apply,
|
||||
ggplot2,
|
||||
knitr,
|
||||
openxlsx,
|
||||
parallelly,
|
||||
pillar,
|
||||
progress,
|
||||
readxl,
|
||||
@@ -64,13 +63,12 @@ Suggests:
|
||||
tidyselect,
|
||||
tinytest,
|
||||
vctrs,
|
||||
xml2,
|
||||
usethis
|
||||
xml2
|
||||
VignetteBuilder: knitr,rmarkdown
|
||||
URL: https://amr-for-r.org, https://github.com/msberends/AMR
|
||||
BugReports: https://github.com/msberends/AMR/issues
|
||||
License: GPL-2 | file LICENSE
|
||||
Encoding: UTF-8
|
||||
LazyData: true
|
||||
RoxygenNote: 7.3.3
|
||||
Roxygen: list(markdown = TRUE)
|
||||
RoxygenNote: 7.3.2
|
||||
Roxygen: list(markdown = TRUE, old_usage = TRUE)
|
||||
|
||||
23
NAMESPACE
23
NAMESPACE
@@ -12,6 +12,7 @@ S3method("[",deprecated_amr_dataset)
|
||||
S3method("[",disk)
|
||||
S3method("[",mic)
|
||||
S3method("[",mo)
|
||||
S3method("[",sir)
|
||||
S3method("[<-",ab)
|
||||
S3method("[<-",av)
|
||||
S3method("[<-",disk)
|
||||
@@ -24,6 +25,7 @@ S3method("[[",deprecated_amr_dataset)
|
||||
S3method("[[",disk)
|
||||
S3method("[[",mic)
|
||||
S3method("[[",mo)
|
||||
S3method("[[",sir)
|
||||
S3method("[[<-",ab)
|
||||
S3method("[[<-",av)
|
||||
S3method("[[<-",disk)
|
||||
@@ -49,7 +51,6 @@ S3method(as.data.frame,mo)
|
||||
S3method(as.double,mic)
|
||||
S3method(as.double,sir)
|
||||
S3method(as.list,custom_eucast_rules)
|
||||
S3method(as.list,custom_interpretive_rules)
|
||||
S3method(as.list,custom_mdro_guideline)
|
||||
S3method(as.list,mic)
|
||||
S3method(as.matrix,mic)
|
||||
@@ -67,7 +68,6 @@ S3method(c,ab)
|
||||
S3method(c,amr_selector)
|
||||
S3method(c,av)
|
||||
S3method(c,custom_eucast_rules)
|
||||
S3method(c,custom_interpretive_rules)
|
||||
S3method(c,custom_mdro_guideline)
|
||||
S3method(c,disk)
|
||||
S3method(c,mic)
|
||||
@@ -98,10 +98,10 @@ S3method(print,amr_selector)
|
||||
S3method(print,av)
|
||||
S3method(print,bug_drug_combinations)
|
||||
S3method(print,custom_eucast_rules)
|
||||
S3method(print,custom_interpretive_rules)
|
||||
S3method(print,custom_mdro_guideline)
|
||||
S3method(print,deprecated_amr_dataset)
|
||||
S3method(print,disk)
|
||||
S3method(print,interpreted_sir)
|
||||
S3method(print,mic)
|
||||
S3method(print,mo)
|
||||
S3method(print,mo_renamed)
|
||||
@@ -136,10 +136,8 @@ export("%like%")
|
||||
export("%like_case%")
|
||||
export("%unlike%")
|
||||
export("%unlike_case%")
|
||||
export(NA_ab_)
|
||||
export(NA_disk_)
|
||||
export(NA_mic_)
|
||||
export(NA_mo_)
|
||||
export(NA_sir_)
|
||||
export(ab_atc)
|
||||
export(ab_atc_group1)
|
||||
@@ -166,8 +164,6 @@ export(administrable_per_os)
|
||||
export(age)
|
||||
export(age_groups)
|
||||
export(all_antimicrobials)
|
||||
export(all_disk)
|
||||
export(all_disk_predictors)
|
||||
export(all_mic)
|
||||
export(all_mic_predictors)
|
||||
export(all_sir)
|
||||
@@ -175,7 +171,6 @@ export(all_sir_predictors)
|
||||
export(aminoglycosides)
|
||||
export(aminopenicillins)
|
||||
export(amr_class)
|
||||
export(amr_course)
|
||||
export(amr_distance_from_row)
|
||||
export(amr_selector)
|
||||
export(anti_join_microorganisms)
|
||||
@@ -220,7 +215,6 @@ export(cephalosporins_4th)
|
||||
export(cephalosporins_5th)
|
||||
export(clear_custom_antimicrobials)
|
||||
export(clear_custom_microorganisms)
|
||||
export(clsi_rules)
|
||||
export(count_I)
|
||||
export(count_IR)
|
||||
export(count_R)
|
||||
@@ -231,7 +225,6 @@ export(count_df)
|
||||
export(count_resistant)
|
||||
export(count_susceptible)
|
||||
export(custom_eucast_rules)
|
||||
export(custom_interpretive_rules)
|
||||
export(custom_mdro_guideline)
|
||||
export(eucast_dosage)
|
||||
export(eucast_exceptional_phenotypes)
|
||||
@@ -252,8 +245,6 @@ export(ggplot_sir_predict)
|
||||
export(glycopeptides)
|
||||
export(guess_ab_col)
|
||||
export(inner_join_microorganisms)
|
||||
export(interpretive_rules)
|
||||
export(ionophores)
|
||||
export(is.ab)
|
||||
export(is.av)
|
||||
export(is.disk)
|
||||
@@ -300,7 +291,6 @@ export(mo_is_yeast)
|
||||
export(mo_kingdom)
|
||||
export(mo_lpsn)
|
||||
export(mo_matching_score)
|
||||
export(mo_morphology)
|
||||
export(mo_mycobank)
|
||||
export(mo_name)
|
||||
export(mo_order)
|
||||
@@ -331,9 +321,7 @@ export(not_intrinsic_resistant)
|
||||
export(oxazolidinones)
|
||||
export(pca)
|
||||
export(penicillins)
|
||||
export(peptides)
|
||||
export(phenicols)
|
||||
export(phosphonics)
|
||||
export(polymyxins)
|
||||
export(proportion_I)
|
||||
export(proportion_IR)
|
||||
@@ -373,7 +361,6 @@ export(sir_df)
|
||||
export(sir_interpretation_history)
|
||||
export(sir_predict)
|
||||
export(skewness)
|
||||
export(spiropyrimidinetriones)
|
||||
export(step_mic_log2)
|
||||
export(step_sir_numeric)
|
||||
export(streptogramins)
|
||||
@@ -386,7 +373,6 @@ export(translate_AMR)
|
||||
export(trimethoprims)
|
||||
export(ureidopenicillins)
|
||||
export(wisca)
|
||||
export(wisca_plot)
|
||||
if(getRversion() >= "3.0.0") S3method(cleaner::freq, mo)
|
||||
if(getRversion() >= "3.0.0") S3method(cleaner::freq, sir)
|
||||
if(getRversion() >= "3.0.0") S3method(ggplot2::autoplot, antibiogram)
|
||||
@@ -398,8 +384,6 @@ if(getRversion() >= "3.0.0") S3method(ggplot2::fortify, disk)
|
||||
if(getRversion() >= "3.0.0") S3method(ggplot2::fortify, mic)
|
||||
if(getRversion() >= "3.0.0") S3method(ggplot2::fortify, resistance_predict)
|
||||
if(getRversion() >= "3.0.0") S3method(ggplot2::fortify, sir)
|
||||
if(getRversion() >= "3.0.0") S3method(ggplot2::scale_type, mic)
|
||||
if(getRversion() >= "3.0.0") S3method(ggplot2::scale_type, sir)
|
||||
if(getRversion() >= "3.0.0") S3method(knitr::knit_print, antibiogram)
|
||||
if(getRversion() >= "3.0.0") S3method(knitr::knit_print, formatted_bug_drug_combinations)
|
||||
if(getRversion() >= "3.0.0") S3method(pillar::pillar_shaft, ab)
|
||||
@@ -421,7 +405,6 @@ if(getRversion() >= "3.0.0") S3method(recipes::prep, step_mic_log2)
|
||||
if(getRversion() >= "3.0.0") S3method(recipes::prep, step_sir_numeric)
|
||||
if(getRversion() >= "3.0.0") S3method(recipes::tidy, step_mic_log2)
|
||||
if(getRversion() >= "3.0.0") S3method(recipes::tidy, step_sir_numeric)
|
||||
if(getRversion() >= "3.0.0") S3method(skimr::get_skimmers, ab)
|
||||
if(getRversion() >= "3.0.0") S3method(skimr::get_skimmers, disk)
|
||||
if(getRversion() >= "3.0.0") S3method(skimr::get_skimmers, mic)
|
||||
if(getRversion() >= "3.0.0") S3method(skimr::get_skimmers, mo)
|
||||
|
||||
79
NEWS.md
79
NEWS.md
@@ -1,69 +1,13 @@
|
||||
# AMR 3.0.1.9086
|
||||
# AMR 3.0.0.9017
|
||||
|
||||
Planned as v3.1.0, end of June 2026.
|
||||
|
||||
### Breaking Changes
|
||||
* The former *kingdoms* Bacteria and Archaea are now each divided into four kingdoms with new top-level *domains* 'Bacteria' and 'Archaea' (Göker and Oren, 2024, DOI: 10.1099/ijsem.0.006242). Following this, a new `domain` column in the `microorganisms` data set was added, and more importantly, `mo_kingdom()` now returns the formal kingdom (e.g. `"Pseudomonadati"` instead of `"Bacteria"`). Use `mo_domain()` for the old behaviour. For non-prokaryotic kingdoms (Fungi, Protozoa, etc.), `kingdom` and `domain` are identical.
|
||||
* Faster parallel computing via the `future` package for `as.sir()` and `wisca()`: a non-sequential plan (e.g. `future::plan(future::multisession)`) must be active before using `parallel = TRUE`.
|
||||
This is primarily a bugfix release, though we added one nice feature too.
|
||||
|
||||
### New
|
||||
* EUCAST 2026 and CLSI 2026 breakpoints: over 5,700 new breakpoints added to the `clinical_breakpoints` data set; EUCAST 2026 is now the default for all MIC and disk diffusion interpretations
|
||||
* Wildtype/Non-wildtype (WT/NWT) output when using ECOFF-based interpretation, by setting `breakpoint_type = "ECOFF"` in `as.sir()`; WT/NWT results are fully supported in all resistance/susceptibility functions and plots (#254)
|
||||
* *tidymodels* integration for using SIR, MIC and disk data in modelling pipelines: `step_mic_log2()`, `step_sir_numeric()`, and new column selectors `all_sir()`, `all_mic()`, `all_disk()`
|
||||
* New `esbl_isolates` data set for practising AMR modelling
|
||||
* New antimicrobial selectors: `ionophores()`, `peptides()`, `phosphonics()`, `spiropyrimidinetriones()`
|
||||
* New antimicrobials: cefepime/taniborbactam (`FTA`), ceftibuten/avibactam (`CTA`), clorobiocin (`CLB`), kasugamycin (`KAS`), ostreogrycin (`OST`), taniborbactam (`TAN`), thiostrepton (`THS`), xeruborbactam (`XER`), zorbamycin (`ZOR`)
|
||||
* New `interpretive_rules()`, a unified function for EUCAST and CLSI interpretive rules; `eucast_rules()` is now a wrapper around it (#235, #259)
|
||||
* New `morphology` column in the `microorganisms` data set and corresponding `mo_morphology()` function, returning the cell shape of bacteria. Data sourced from BacDive; values prefixed with "likely" are extrapolated from genus-level consensus. New `add_morphology` argument was added to `mo_gramstain()` to return combined results such as `"Gram-negative rods"`.
|
||||
* New `amr_course()` to download and unpack course or webinar materials from GitHub in one call
|
||||
* Typed missing value constants `NA_ab_` and `NA_mo_`, for use in pipelines that need missing values of a specific class
|
||||
* New `wisca_plot()` to assess the susceptibility and incidence distributions from the Monte Carlo simulations
|
||||
|
||||
### Fixed
|
||||
* Setting `options(AMR_guideline = "EUCAST 2012")` or any year-qualified value no longer causes errors or silent wrong behaviour in `interpretive_rules()`, `resistance()`, `susceptibility()`, `count_resistant()`, `count_susceptible()`, and SIR plotting/printing functions (#298)
|
||||
* `as.sir()`
|
||||
* On data frames: already-converted SIR columns no longer dropped on re-run (#278)
|
||||
* Metadata columns (e.g. `patient`, `ward`) no longer misidentified as antibiotic columns
|
||||
* `info = FALSE` now suppresses all messages, including for columns without breakpoints
|
||||
* Assumption of disk zones are now preferred over MIC values when input is only whole numbers (#291)
|
||||
* `as.mic()`: values in scientific notation (e.g. `1e-3`) now handled correctly
|
||||
* `as.ab()`: codes containing "PH" or "TH" (e.g. `ETH`, `PHE`) no longer return `NA` when mixed with unrecognised input (#245)
|
||||
* Combined MIC/SIR input values (e.g. `"<= 0.002; S"` or `"S; 0.002"`) now parsed correctly (#252)
|
||||
* `as.mo()`:
|
||||
* Input of the form `"X complex"` now falls back to `"X"` when the complex is not a distinct taxon in the database, preventing `NA` results for valid clinical descriptions such as `"Proteus vulgaris complex"` (#287)
|
||||
* Abbreviated-genus input (e.g. `"S. apiospermum"`) now correctly ranks candidates whose species epithet exactly matches the input above more-prevalent organisms whose species does not match; fixes `"S. apiospermum"` resolving to *Staphylococcus* instead of *Scedosporium apiospermum* (#288)
|
||||
* Abbreviated-genus input for species that have subspecies (e.g. `"P. ovale"`) now collapses to the species-rank record instead of incorrectly matching a more-prevalent organism; explicit subspecies queries (e.g. `"P. ovale curtisi"`) are preserved (#288)
|
||||
* `get_author_year()` in the microorganism reproduction script now strips `emend.` and everything after it, so `ref` reflects the combination authority rather than the emendation author (e.g. *Rhodococcus equi* now returns "Goodfellow et al., 1977" instead of "Nouioui et al., 2018")
|
||||
* BRMO classification now includes bacterial complexes (#275)
|
||||
* Translation fixes for Italian CoNS/CoPS names (#256), Dutch antimicrobials, and `sir_df()` foreign-language output (#272)
|
||||
* Fixed some EUCAST Expert Rules, mostly on *S. pneumoniae*
|
||||
|
||||
### Updated
|
||||
* `top_n_microorganisms()`: new `property_for_each` argument for sub-grouping within top *n* groups; rank ordering enforced (only lower taxonomic ranks allowed); fixed `property = NULL` not being accepted; inner filter now tracks original row indices to prevent cross-group contamination
|
||||
* Taxonomic update for all microorganisms, now updated to June 2026
|
||||
* `mo_kingdom()` now returns the formal taxonomic kingdom; a one-time note per session explains the change when querying bacterial or archaeal records.
|
||||
* `mo_taxonomy()` and `mo_info()` gained `domain` for the list output
|
||||
* `antibiogram()` and `wisca()` now also support parallel computing via the argument `parallel = TRUE` (#281)
|
||||
* `custom_eucast_rules()` renamed to `custom_interpretive_rules()`; old name deprecated but still works (#268)
|
||||
* `mdro()` can now infer resistance from a drug+inhibitor combination when the base drug column is absent (e.g. piperacillin inferred from piperacillin/tazobactam); controlled via new `infer_from_combinations` argument (default `TRUE`) (#209)
|
||||
* `wisca()` now more strictly follows Bielicki et al. (2016) by using $\text{Beta}(1, 9999)$ for intrinsically resistant pairs, forcing near-zero susceptibility regardless of observed data (based on EUCAST Expected Resistant Phenotypes)
|
||||
* `susceptibility()` / `resistance()`: new `guideline` argument (default EUCAST) to ensure the 'I' category is interpreted correctly per guideline
|
||||
* Capped MIC handling in `as.sir()` reworked into four clearly defined options: `"none"`, `"conservative"` (new default), `"standard"`, `"lenient"` (#243)
|
||||
* `as.mic()` / `rescale_mic()`: new `round_to_next_log2` argument to round values up to the nearest log2 dilution level (#255)
|
||||
* `antimicrobials$group` is now a `list`, so that drugs belonging to multiple groups are fully represented; use `ab_group(all_groups = TRUE)` to retrieve all groups for a drug (#246)
|
||||
* Improved console messages with clickable links throughout, powered by `cli` if it is installed (#191, #265)
|
||||
* `as.disk()`: input validation is now more strict, rejecting values that are not recognisable as a numeric disk zone diameter
|
||||
* `as.sir()` gains an `enforce_method` argument (`"auto"`, `"mic"`, or `"disk"`) to force the interpretation method when S3 class information is lost, e.g. when called from Python (#291)
|
||||
* `AMR for Python` vignette: added sections on installation channels (stable CRAN vs. development GitHub via `AMR.beta`) and on using `enforce_method` in `as_sir()` from Python
|
||||
|
||||
# AMR 3.0.1
|
||||
|
||||
This is a bugfix release following the release of v3.0.0 in June 2025.
|
||||
* Integration with the **tidymodels** framework to allow seamless use of MIC and SIR data in modelling pipelines via `recipes`
|
||||
- `step_mic_log2()` to transform `<mic>` columns with log2, and `step_sir_numeric()` to convert `<sir>` columns to numeric
|
||||
- New `tidyselect` helpers: `all_mic()`, `all_mic_predictors()`, `all_sir()`, `all_sir_predictors()`
|
||||
|
||||
### Changed
|
||||
* Fixed bugs introduced by `ggplot2` v4.0.0 (#236)
|
||||
* MIC scale functions (such as `scale_y_mic()`) will now be applied automatically when plotting values of class `mic`
|
||||
* SIR scale functions (such as `scale_x_sir()`) will now be applied automatically when plotting values of class `sir`
|
||||
* Fixed a bug in `antibiogram()` for when no antimicrobials are set
|
||||
* Fixed a bug in `antibiogram()` to allow column names containing the `+` character (#222)
|
||||
* Fixed a bug in `as.ab()` for antimicrobial codes with a number in it if they are preceded by a space
|
||||
@@ -71,19 +15,10 @@ This is a bugfix release following the release of v3.0.0 in June 2025.
|
||||
* Fixed a bug in `as.sir()` to allow any tidyselect language (#220)
|
||||
* Fixed a bug in `as.sir()` to pick right breakpoint when `uti = FALSE` (#216)
|
||||
* Fixed a bug in `ggplot_sir()` when using `combine_SI = FALSE` (#213)
|
||||
* Fixed a bug in `mdro()` to make sure all genes specified in arguments are acknowledged
|
||||
* Fixed a bug the `antimicrobials` data set to remove statins (#229)
|
||||
* Fixed a bug the `microorganisms` data set for MycoBank IDs and synonyms (#233)
|
||||
* Fixed ATC J01CR05 to map to piperacillin/tazobactam rather than piperacillin/sulbactam (#230)
|
||||
* Fixed skimmers (`skimr` package) of class `ab`, `sir`, and `disk` (#234)
|
||||
* Fixed all plotting to contain a separate colour for SDD (susceptible dose-dependent) (#223)
|
||||
* Fixed some specific Dutch translations for antimicrobials
|
||||
* Added a warning to `as.ab()` if input resembles antiviral codes or names (#232)
|
||||
* Added all reasons in verbose output of `mdro()` (#227)
|
||||
* Added `names` to `age_groups()` so that custom names can be given (#215)
|
||||
* Added note to `as.sir()` to make it explicit when higher-level taxonomic breakpoints are used (#218)
|
||||
* Added antibiotic codes from the Comprehensive Antibiotic Resistance Database (CARD) to the `antimicrobials` data set (#225)
|
||||
* Updated Fosfomycin to be of antibiotic class Phosphonics (#225)
|
||||
* Updated `random_mic()` and `random_disk()` to set skewedness of the distribution and allow multiple microorganisms
|
||||
|
||||
|
||||
@@ -92,7 +27,7 @@ This is a bugfix release following the release of v3.0.0 in June 2025.
|
||||
This package now supports not only tools for AMR data analysis in clinical settings, but also for veterinary and environmental microbiology. This was made possible through a collaboration with the [University of Prince Edward Island's Atlantic Veterinary College](https://www.upei.ca/avc), Canada. To celebrate this great improvement of the package, we also updated the package logo to reflect this change.
|
||||
|
||||
### Breaking
|
||||
* Data set `antibiotics` has been renamed to `antimicrobials` as the data set contains more than just antibiotics. Using `antibiotics` will still work, but now returns a warning.
|
||||
* Dataset `antibiotics` has been renamed to `antimicrobials` as the data set contains more than just antibiotics. Using `antibiotics` will still work, but now returns a warning.
|
||||
* Removed all functions and references that used the deprecated `rsi` class, which were all replaced with their `sir` equivalents over two years ago.
|
||||
* Functions `resistance_predict()` and `sir_predict()` are now deprecated and will be removed in a future version. Use the `tidymodels` framework instead, for which we [wrote a basic introduction](https://amr-for-r.org/articles/AMR_with_tidymodels.html).
|
||||
|
||||
@@ -104,7 +39,7 @@ This package now supports not only tools for AMR data analysis in clinical setti
|
||||
* `ab_atc()` now supports ATC codes of veterinary antimicrobials (that all start with "Q")
|
||||
* `ab_url()` now supports retrieving the WHOCC url of their ATCvet pages
|
||||
* **Support for WISCA antibiograms**
|
||||
* The `antibiogram()` function now supports creating true Weighted-Incidence Syndromic Combination Antibiograms (WISCA), a powerful Bayesian method for estimating regimen coverage probabilities using pathogen incidence and antimicrobial susceptibility data. WISCA offers improved precision for syndrome-specific treatment, even in data sets with sparse data. A dedicated `wisca()` function is also available for easy usage.
|
||||
* The `antibiogram()` function now supports creating true Weighted-Incidence Syndromic Combination Antibiograms (WISCA), a powerful Bayesian method for estimating regimen coverage probabilities using pathogen incidence and antimicrobial susceptibility data. WISCA offers improved precision for syndrome-specific treatment, even in datasets with sparse data. A dedicated `wisca()` function is also available for easy usage.
|
||||
* **More global coverage of languages**
|
||||
* Added full support for 8 new languages: Arabic, Bengali, Hindi, Indonesian, Korean, Swahili, Urdu, and Vietnamese. The `AMR` package is now available in 28 languages.
|
||||
* **Major update to fungal taxonomy and tools for mycologists**
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#'
|
||||
#' This work was published in the Journal of Statistical Software (Volume 104(3); \doi{10.18637/jss.v104.i03}) and formed the basis of two PhD theses (\doi{10.33612/diss.177417131} and \doi{10.33612/diss.192486375}).
|
||||
#'
|
||||
#' After installing this package, R knows [**`r AMR:::format_included_data_number(AMR::microorganisms)` distinct microbial species**](https://amr-for-r.org/reference/microorganisms.html) (updated `r format(AMR:::TAXONOMY_VERSION$GBIF$accessed_date, "%B %Y")`) and all [**`r AMR:::format_included_data_number(NROW(AMR::antimicrobials) + NROW(AMR::antivirals))` antimicrobial and antiviral drugs**](https://amr-for-r.org/reference/antimicrobials.html) by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("CLSI", guideline))$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("CLSI", guideline))$guideline)))` and EUCAST `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("EUCAST", guideline))$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("EUCAST", guideline))$guideline)))` are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). **It was designed to work in any setting, including those with very limited resources**. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the [University of Groningen](https://www.rug.nl) and the [University Medical Center Groningen](https://www.umcg.nl).
|
||||
#' After installing this package, R knows [**`r AMR:::format_included_data_number(AMR::microorganisms)` distinct microbial species**](https://amr-for-r.org/reference/microorganisms.html) (updated June 2024) and all [**`r AMR:::format_included_data_number(NROW(AMR::antimicrobials) + NROW(AMR::antivirals))` antimicrobial and antiviral drugs**](https://amr-for-r.org/reference/antimicrobials.html) by name and code (including ATC, EARS-Net, ASIARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid SIR and MIC values. The integral clinical breakpoint guidelines from CLSI `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("CLSI", guideline))$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("CLSI", guideline))$guideline)))` and EUCAST `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("EUCAST", guideline))$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("EUCAST", guideline))$guideline)))` are included, even with epidemiological cut-off (ECOFF) values. It supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). **It was designed to work in any setting, including those with very limited resources**. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the [University of Groningen](https://www.rug.nl) and the [University Medical Center Groningen](https://www.umcg.nl).
|
||||
#'
|
||||
#' The `AMR` package is available in `r vector_and(vapply(FUN.VALUE = character(1), LANGUAGES_SUPPORTED_NAMES, function(x) x$exonym), quotes = FALSE, sort = FALSE)`. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages.
|
||||
#' @section Download Our Reference Data:
|
||||
@@ -45,7 +45,7 @@
|
||||
#' For maximum compatibility, we also provide machine-readable, tab-separated plain text files suitable for use in any software, including laboratory information systems.
|
||||
#'
|
||||
#' Visit [our website for direct download links](https://amr-for-r.org/articles/datasets.html), or explore the actual files in [our GitHub repository](https://github.com/msberends/AMR/tree/main/data-raw/datasets).
|
||||
#' @references
|
||||
#' @source
|
||||
#' To cite AMR in publications use:
|
||||
#'
|
||||
#' Berends MS, Luz CF, Friedrich AW, Sinha BNM, Albers CJ, Glasner C (2022). "AMR: An R Package for Working with Antimicrobial Resistance Data." _Journal of Statistical Software_, *104*(3), 1-31. \doi{10.18637/jss.v104.i03}
|
||||
|
||||
@@ -27,50 +27,44 @@
|
||||
# how to conduct AMR data analysis: https://amr-for-r.org #
|
||||
# ==================================================================== #
|
||||
|
||||
# add new version numbers here, and add the rules themselves to "data-raw/interpretive_rules.tsv" and clinical_breakpoints
|
||||
# add new version numbers here, and add the rules themselves to "data-raw/eucast_rules.tsv" and clinical_breakpoints
|
||||
# (sourcing "data-raw/_pre_commit_checks.R" will process the TSV file)
|
||||
EUCAST_VERSION_BREAKPOINTS <- list(
|
||||
"16.0" = list(
|
||||
version_txt = "v16.0",
|
||||
year = 2026,
|
||||
title = "'EUCAST Clinical Breakpoint Tables'",
|
||||
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
|
||||
),
|
||||
"15.0" = list(
|
||||
version_txt = "v15.0",
|
||||
year = 2025,
|
||||
title = "'EUCAST Clinical Breakpoint Tables'",
|
||||
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
|
||||
url = "https://www.eucast.org/clinical_breakpoints/"
|
||||
),
|
||||
"14.0" = list(
|
||||
version_txt = "v14.0",
|
||||
year = 2024,
|
||||
title = "'EUCAST Clinical Breakpoint Tables'",
|
||||
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
|
||||
url = "https://www.eucast.org/clinical_breakpoints/"
|
||||
),
|
||||
"13.1" = list(
|
||||
version_txt = "v13.1",
|
||||
year = 2023,
|
||||
title = "'EUCAST Clinical Breakpoint Tables'",
|
||||
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
|
||||
url = "https://www.eucast.org/clinical_breakpoints/"
|
||||
),
|
||||
"12.0" = list(
|
||||
version_txt = "v12.0",
|
||||
year = 2022,
|
||||
title = "'EUCAST Clinical Breakpoint Tables'",
|
||||
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
|
||||
url = "https://www.eucast.org/clinical_breakpoints/"
|
||||
),
|
||||
"11.0" = list(
|
||||
version_txt = "v11.0",
|
||||
year = 2021,
|
||||
title = "'EUCAST Clinical Breakpoint Tables'",
|
||||
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
|
||||
url = "https://www.eucast.org/clinical_breakpoints/"
|
||||
),
|
||||
"10.0" = list(
|
||||
version_txt = "v10.0",
|
||||
year = 2020,
|
||||
title = "'EUCAST Clinical Breakpoint Tables'",
|
||||
url = "https://www.eucast.org/bacteria/document-archive/"
|
||||
url = "https://www.eucast.org/ast_of_bacteria/previous_versions_of_documents/"
|
||||
)
|
||||
)
|
||||
EUCAST_VERSION_EXPERT_RULES <- list(
|
||||
@@ -78,19 +72,19 @@ EUCAST_VERSION_EXPERT_RULES <- list(
|
||||
version_txt = "v3.3",
|
||||
year = 2021,
|
||||
title = "'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes'",
|
||||
url = "https://www.eucast.org/bacteria/important-additional-information/expert-rules/"
|
||||
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes"
|
||||
),
|
||||
"3.2" = list(
|
||||
version_txt = "v3.2",
|
||||
year = 2020,
|
||||
title = "'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes'",
|
||||
url = "https://www.eucast.org/bacteria/important-additional-information/expert-rules/"
|
||||
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes"
|
||||
),
|
||||
"3.1" = list(
|
||||
version_txt = "v3.1",
|
||||
year = 2016,
|
||||
title = "'EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes'",
|
||||
url = "https://www.eucast.org/bacteria/important-additional-information/expert-rules/"
|
||||
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes"
|
||||
)
|
||||
)
|
||||
EUCAST_VERSION_EXPECTED_PHENOTYPES <- list(
|
||||
@@ -98,33 +92,32 @@ EUCAST_VERSION_EXPECTED_PHENOTYPES <- list(
|
||||
version_txt = "v1.2",
|
||||
year = 2023,
|
||||
title = "'EUCAST Expected Resistant Phenotypes'",
|
||||
url = "https://www.eucast.org/bacteria/important-additional-information/expert-rules/"
|
||||
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes"
|
||||
)
|
||||
)
|
||||
|
||||
TAXONOMY_VERSION <- list(
|
||||
GBIF = list(
|
||||
name = "Global Biodiversity Information Facility (GBIF), via Catalogue of Life (COL)",
|
||||
accessed_date = as.Date("2026-05-07"),
|
||||
# take the citation from https://www.gbif.org/dataset/7ddf754f-d193-4cc9-b351-99906754a03b#citation
|
||||
citation = "Banki, O. *et al.* (2026). Catalogue of Life (2026-04-18 XR). Catalogue of Life Foundation, Amsterdam, Netherlands. \\doi{10.48580/dgxjw}.",
|
||||
name = "Global Biodiversity Information Facility (GBIF)",
|
||||
accessed_date = as.Date("2024-06-24"),
|
||||
citation = "GBIF Secretariat (2023). GBIF Backbone Taxonomy. Checklist dataset \\doi{10.15468/39omei}.",
|
||||
url = "https://www.gbif.org"
|
||||
),
|
||||
LPSN = list(
|
||||
name = "List of Prokaryotic names with Standing in Nomenclature (LPSN)",
|
||||
accessed_date = as.Date("2026-05-07"),
|
||||
citation = "Freese, HM *et al.* (2026). **TYGS and LPSN in 2025: a Global Core Biodata Resource for genome-based classification and nomenclature of prokaryotes within DSMZ Digital Diversity.** Nucleic Acids Research, 54, D884\u2013D891; \\doi{10.1093/nar/gkaf1110}.",
|
||||
accessed_date = as.Date("2024-06-24"),
|
||||
citation = "Parte, AC *et al.* (2020). **List of Prokaryotic names with Standing in Nomenclature (LPSN) moves to the DSMZ.** International Journal of Systematic and Evolutionary Microbiology, 70, 5607-5612; \\doi{10.1099/ijsem.0.004332}.",
|
||||
url = "https://lpsn.dsmz.de"
|
||||
),
|
||||
MycoBank = list(
|
||||
name = "MycoBank",
|
||||
accessed_date = as.Date("2026-05-07"),
|
||||
accessed_date = as.Date("2024-06-24"),
|
||||
citation = "Vincent, R *et al* (2013). **MycoBank gearing up for new horizons.** IMA Fungus, 4(2), 371-9; \\doi{10.5598/imafungus.2013.04.02.16}.",
|
||||
url = "https://www.mycobank.org"
|
||||
),
|
||||
BacDive = list(
|
||||
name = "BacDive",
|
||||
accessed_date = as.Date("2026-05-07"),
|
||||
accessed_date = as.Date("2024-07-16"),
|
||||
citation = "Reimer, LC *et al.* (2022). ***BacDive* in 2022: the knowledge base for standardized bacterial and archaeal data.** Nucleic Acids Res., 50(D1):D741-D74; \\doi{10.1093/nar/gkab961}.",
|
||||
url = "https://bacdive.dsmz.de"
|
||||
),
|
||||
@@ -149,13 +142,10 @@ TAXONOMY_VERSION <- list(
|
||||
)
|
||||
|
||||
globalVariables(c(
|
||||
".coverage",
|
||||
".GenericCallEnv",
|
||||
".lower",
|
||||
".mo",
|
||||
".rowid",
|
||||
".syndromic_group",
|
||||
".upper",
|
||||
"ab",
|
||||
"ab_txt",
|
||||
"affect_ab_name",
|
||||
@@ -191,7 +181,6 @@ globalVariables(c(
|
||||
"hjust",
|
||||
"host_index",
|
||||
"host_match",
|
||||
"incidence",
|
||||
"input",
|
||||
"input_given",
|
||||
"intrinsic_resistant",
|
||||
@@ -219,7 +208,6 @@ globalVariables(c(
|
||||
"old",
|
||||
"old_name",
|
||||
"p_susceptible",
|
||||
"pathogen",
|
||||
"pattern",
|
||||
"R",
|
||||
"rank_index",
|
||||
@@ -227,8 +215,6 @@ globalVariables(c(
|
||||
"reference.rule",
|
||||
"reference.rule_group",
|
||||
"reference.version",
|
||||
"regimen",
|
||||
"rule.provider",
|
||||
"rowid",
|
||||
"rule_group",
|
||||
"rule_name",
|
||||
@@ -247,7 +233,6 @@ globalVariables(c(
|
||||
"uti_index",
|
||||
"value",
|
||||
"varname",
|
||||
"where",
|
||||
"x",
|
||||
"xvar",
|
||||
"y",
|
||||
|
||||
605
R/aa_helper_functions.R
Executable file → Normal file
605
R/aa_helper_functions.R
Executable file → Normal file
@@ -253,9 +253,12 @@ search_type_in_df <- function(x, type, info = TRUE, add_col_prefix = TRUE) {
|
||||
# WHONET support
|
||||
found <- sort(colnames(x)[colnames_formatted %like_case% "^(specimen date|specimen_date|spec_date)"])
|
||||
if (!inherits(pm_pull(x, found), c("Date", "POSIXct"))) {
|
||||
stop_("Found column {.field ", font_bold(found), "} to be used as input for {.arg ", ifelse(add_col_prefix, "col_", ""), type,
|
||||
"}, but this column contains no valid dates. Transform its values to valid dates first.",
|
||||
call = FALSE
|
||||
stop(
|
||||
font_red(paste0(
|
||||
"Found column '", font_bold(found), "' to be used as input for `", ifelse(add_col_prefix, "col_", ""), type,
|
||||
"`, but this column contains no valid dates. Transform its values to valid dates first."
|
||||
)),
|
||||
call. = FALSE
|
||||
)
|
||||
}
|
||||
} else if (any(vapply(FUN.VALUE = logical(1), x, function(x) inherits(x, c("Date", "POSIXct"))))) {
|
||||
@@ -301,9 +304,9 @@ search_type_in_df <- function(x, type, info = TRUE, add_col_prefix = TRUE) {
|
||||
if (!is.null(found)) {
|
||||
# this column should contain logicals
|
||||
if (!is.logical(x[, found, drop = TRUE])) {
|
||||
message_(
|
||||
"Column {.field ", font_bold(found), "} found as input for {.arg ", ifelse(add_col_prefix, "col_", ""), type,
|
||||
"}, but this column does not contain {.code TRUE}/{.code FALSE} values and was ignored."
|
||||
message_("Column '", font_bold(found), "' found as input for `", ifelse(add_col_prefix, "col_", ""), type,
|
||||
"`, but this column does not contain 'logical' values (TRUE/FALSE) and was ignored.",
|
||||
add_fn = font_red
|
||||
)
|
||||
found <- NULL
|
||||
}
|
||||
@@ -314,9 +317,9 @@ search_type_in_df <- function(x, type, info = TRUE, add_col_prefix = TRUE) {
|
||||
|
||||
if (!is.null(found) && isTRUE(info)) {
|
||||
if (message_not_thrown_before("search_in_type", type)) {
|
||||
msg <- paste0("Using column {.field ", font_bold(found), "} as input for {.arg ", ifelse(add_col_prefix, "col_", ""), type, "}.")
|
||||
msg <- paste0("Using column '", font_bold(found), "' as input for `", ifelse(add_col_prefix, "col_", ""), type, "`.")
|
||||
if (type %in% c("keyantibiotics", "keyantimicrobials", "specimen")) {
|
||||
msg <- paste(msg, "Use {.arg ", paste0(ifelse(add_col_prefix, "col_", ""), type), "= FALSE} to prevent this.")
|
||||
msg <- paste(msg, "Use", font_bold(paste0(ifelse(add_col_prefix, "col_", ""), type), "= FALSE"), "to prevent this.")
|
||||
}
|
||||
message_(msg)
|
||||
}
|
||||
@@ -359,9 +362,9 @@ stop_ifnot_installed <- function(package) {
|
||||
if (any(!installed) && any(package == "rstudioapi")) {
|
||||
stop("This function only works in RStudio when using R >= 3.2.", call. = FALSE)
|
||||
} else if (any(!installed)) {
|
||||
stop_(
|
||||
"This requires the ", vector_and(paste0("{.pkg ", package[!installed], "}"), quotes = FALSE), " package.",
|
||||
"\nTry to install with {.fun install.packages}."
|
||||
stop("This requires the ", vector_and(package[!installed]), " package.",
|
||||
"\nTry to install with install.packages().",
|
||||
call. = FALSE
|
||||
)
|
||||
} else {
|
||||
return(invisible())
|
||||
@@ -384,18 +387,13 @@ import_fn <- function(name, pkg, error_on_fail = TRUE) {
|
||||
if (isTRUE(error_on_fail)) {
|
||||
stop_ifnot_installed(pkg)
|
||||
}
|
||||
if (pkg == "rstudioapi" && (!in_rstudio() || !interactive())) {
|
||||
# only allow rstudioapi to be imported if we're in RStudio
|
||||
return(NULL)
|
||||
}
|
||||
|
||||
tryCatch(
|
||||
# don't use get() to avoid fetching non-API functions
|
||||
getExportedValue(name = name, ns = asNamespace(pkg)),
|
||||
error = function(e) {
|
||||
if (isTRUE(error_on_fail)) {
|
||||
stop_("function {.code ", name, "()} is not an exported object from package '", pkg,
|
||||
"'. Please create an issue at https://github.com/msberends/AMR/issues. Many thanks!",
|
||||
stop_("function `", name, "()` is not an exported object from package '", pkg,
|
||||
"'. Please create an issue at ", font_url("https://github.com/msberends/AMR/issues"), ". Many thanks!",
|
||||
call = FALSE
|
||||
)
|
||||
} else {
|
||||
@@ -405,140 +403,30 @@ import_fn <- function(name, pkg, error_on_fail = TRUE) {
|
||||
)
|
||||
}
|
||||
|
||||
has_cli_rlang <- function() {
|
||||
pkg_is_available("cli", min_version = "3.0.0") && pkg_is_available("rlang", min_version = "1.0.3")
|
||||
}
|
||||
|
||||
highlight_code <- function(code) {
|
||||
if (has_cli_rlang()) {
|
||||
cli::code_highlight(code)
|
||||
} else {
|
||||
code
|
||||
}
|
||||
}
|
||||
|
||||
# Format a cli-markup string for output, with a plain-text fallback when cli is
|
||||
# unavailable. Unlike message_() / warning_() / stop_(), this function returns
|
||||
# the formatted string rather than emitting it, so it can be passed to any
|
||||
# output function (e.g. packageStartupMessage()).
|
||||
format_inline_ <- function(...) {
|
||||
msg <- paste0(c(...), collapse = "")
|
||||
if (has_cli_rlang()) {
|
||||
if (!cli::ansi_has_hyperlink_support()) {
|
||||
msg <- simplify_help_markup(msg)
|
||||
}
|
||||
cli::format_inline(msg)
|
||||
} else {
|
||||
cli_to_plain(msg, envir = parent.frame())
|
||||
}
|
||||
}
|
||||
|
||||
# Convert cli glue markup to plain text for the non-cli fallback path.
|
||||
# Called by message_(), warning_(), and stop_() when cli is not available.
|
||||
cli_to_plain <- function(msg, envir = parent.frame()) {
|
||||
resolve <- function(x) {
|
||||
# If x looks like {expr}, evaluate the inner expression
|
||||
if (grepl("^\\{.+\\}$", x)) {
|
||||
inner <- substring(x, 2L, nchar(x) - 1L)
|
||||
tryCatch(
|
||||
paste0(as.character(eval(parse(text = inner), envir = envir)), collapse = ", "),
|
||||
error = function(e) x
|
||||
)
|
||||
} else {
|
||||
x
|
||||
}
|
||||
}
|
||||
|
||||
apply_sub <- function(msg, pattern, formatter) {
|
||||
while (grepl(pattern, msg, perl = TRUE)) {
|
||||
m <- regexec(pattern, msg)
|
||||
matches <- regmatches(msg, m)[[1]]
|
||||
if (length(matches) < 2L) break
|
||||
full_match <- matches[1L]
|
||||
content <- matches[2L]
|
||||
replacement <- formatter(content)
|
||||
idx <- regexpr(full_match, msg, fixed = TRUE)
|
||||
if (idx == -1L) break
|
||||
msg <- paste0(
|
||||
substr(msg, 1L, idx - 1L),
|
||||
replacement,
|
||||
substr(msg, idx + nchar(full_match), nchar(msg))
|
||||
)
|
||||
}
|
||||
msg
|
||||
}
|
||||
|
||||
# cli inline markup -> plain-text equivalents (one level of glue nesting allowed)
|
||||
msg <- apply_sub(msg, "\\{\\.fun (\\{[^}]+\\}|[^}]+)\\}", function(c) paste0("`", resolve(c), "()`"))
|
||||
msg <- apply_sub(msg, "\\{\\.arg (\\{[^}]+\\}|[^}]+)\\}", function(c) paste0("`", resolve(c), "`"))
|
||||
msg <- apply_sub(msg, "\\{\\.code (\\{[^}]+\\}|[^}]+)\\}", function(c) paste0("`", resolve(c), "`"))
|
||||
msg <- apply_sub(msg, "\\{\\.val (\\{[^}]+\\}|[^}]+)\\}", function(c) paste0('"', resolve(c), '"'))
|
||||
msg <- apply_sub(msg, "\\{\\.field (\\{[^}]+\\}|[^}]+)\\}", function(c) paste0('"', resolve(c), '"'))
|
||||
msg <- apply_sub(msg, "\\{\\.cls (\\{[^}]+\\}|[^}]+)\\}", function(c) paste0("<", resolve(c), ">"))
|
||||
msg <- apply_sub(msg, "\\{\\.pkg (\\{[^}]+\\}|[^}]+)\\}", function(c) resolve(c))
|
||||
msg <- apply_sub(msg, "\\{\\.strong (\\{[^}]+\\}|[^}]+)\\}", function(c) paste0("*", resolve(c), "*"))
|
||||
msg <- apply_sub(msg, "\\{\\.emph (\\{[^}]+\\}|[^}]+)\\}", function(c) paste0("*", resolve(c), "*"))
|
||||
msg <- apply_sub(msg, "\\{\\.help ([^}]+)\\}", function(c) {
|
||||
# Handle [display text](topic) markdown link format: extract just the display text
|
||||
m <- regmatches(c, regexec("^\\[(.*)\\]\\([^)]*\\)$", c))[[1L]]
|
||||
if (length(m) >= 2L) m[2L] else paste0("`", resolve(c), "`")
|
||||
})
|
||||
msg <- apply_sub(msg, "\\{\\.topic ([^}]+)\\}", function(c) {
|
||||
# Handle [display text](topic) markdown link format: extract just the display text
|
||||
m <- regmatches(c, regexec("^\\[(.*)\\]\\([^)]*\\)$", c))[[1L]]
|
||||
if (length(m) >= 2L) m[2L] else paste0("?", resolve(c))
|
||||
})
|
||||
msg <- apply_sub(msg, "\\{\\.url (\\{[^}]+\\}|[^}]+)\\}", function(c) resolve(c))
|
||||
msg <- apply_sub(msg, "\\{\\.href ([^}]+)\\}", function(c) {
|
||||
# Handle [display text](url) markdown link format: extract just the URL
|
||||
m <- regmatches(c, regexec("^\\[.*\\]\\(([^)]+)\\)$", c))[[1L]]
|
||||
if (length(m) >= 2L) m[2L] else resolve(c)
|
||||
})
|
||||
|
||||
# bare {variable} or {expression} -> evaluate in caller's environment
|
||||
while (grepl("\\{[^{}]+\\}", msg)) {
|
||||
m <- regexec("\\{([^{}]+)\\}", msg)
|
||||
matches <- regmatches(msg, m)[[1]]
|
||||
if (length(matches) < 2L) break
|
||||
full_match <- matches[1L]
|
||||
inner <- matches[2L]
|
||||
replacement <- tryCatch(
|
||||
paste0(as.character(eval(parse(text = inner), envir = envir)), collapse = ", "),
|
||||
error = function(e) full_match
|
||||
)
|
||||
idx <- regexpr(full_match, msg, fixed = TRUE)
|
||||
if (idx == -1L) break
|
||||
msg <- paste0(
|
||||
substr(msg, 1L, idx - 1L),
|
||||
replacement,
|
||||
substr(msg, idx + nchar(full_match), nchar(msg))
|
||||
)
|
||||
}
|
||||
|
||||
msg
|
||||
}
|
||||
|
||||
# this alternative wrapper to the message(), warning() and stop() functions:
|
||||
# - wraps text to never break lines within words (plain-text fallback only)
|
||||
# - adds indentation for note-style messages (plain-text fallback only)
|
||||
# When cli is available this just returns the pasted input; cli handles formatting.
|
||||
# - wraps text to never break lines within words
|
||||
# - ignores formatted text while wrapping
|
||||
# - adds indentation dependent on the type of message (such as NOTE)
|
||||
# - can add additional formatting functions like blue or bold text
|
||||
word_wrap <- function(...,
|
||||
add_fn = list(),
|
||||
as_note = FALSE,
|
||||
width = 0.95 * getOption("width"),
|
||||
extra_indent = 0) {
|
||||
if (has_cli_rlang()) {
|
||||
return(paste0(c(...), collapse = ""))
|
||||
}
|
||||
msg <- paste0(c(...), collapse = "")
|
||||
|
||||
if (isTRUE(as_note)) {
|
||||
msg <- paste0(AMR_env$info_icon, " ", gsub("^note:? ?", "", msg, ignore.case = TRUE))
|
||||
}
|
||||
if (grepl("\n", msg, fixed = TRUE)) {
|
||||
|
||||
if (msg %like% "\n") {
|
||||
# run word_wraps() over every line here, bind them and return again
|
||||
return(paste0(
|
||||
vapply(
|
||||
FUN.VALUE = character(1),
|
||||
trimws(unlist(strsplit(msg, "\n", fixed = TRUE)), which = "right"),
|
||||
word_wrap,
|
||||
add_fn = add_fn,
|
||||
as_note = FALSE,
|
||||
width = width,
|
||||
extra_indent = extra_indent
|
||||
@@ -546,139 +434,155 @@ word_wrap <- function(...,
|
||||
collapse = "\n"
|
||||
))
|
||||
}
|
||||
wrapped <- paste0(strwrap(msg, width = width), collapse = "\n")
|
||||
if (grepl("\u2139 ", msg, fixed = TRUE)) {
|
||||
indentation <- 2L + extra_indent
|
||||
} else if (grepl("^=> ", msg)) {
|
||||
indentation <- 3L + extra_indent
|
||||
} else {
|
||||
indentation <- 0L + extra_indent
|
||||
}
|
||||
if (indentation > 0L) {
|
||||
wrapped <- gsub("\n", paste0("\n", strrep("\u00a0", indentation)), wrapped, fixed = TRUE)
|
||||
}
|
||||
gsub("(\n| )+$", "", wrapped)
|
||||
}
|
||||
|
||||
simplify_help_markup <- function(msg) {
|
||||
# {.help [{.fun fn}](pkg::fn)} -> {.code fn()}
|
||||
# {.help [display](topic)} -> {.code display}
|
||||
msg <- gsub(
|
||||
"\\{\\.help \\[\\{\\.fun ([^}]+)\\}\\]\\([^)]+\\)\\}",
|
||||
"{.code \\1()}",
|
||||
msg,
|
||||
perl = TRUE
|
||||
# correct for operators (will add the space later on)
|
||||
ops <- "([,./><\\]\\[])"
|
||||
msg <- gsub(paste0(ops, " ", ops), "\\1\\2", msg, perl = TRUE)
|
||||
# we need to correct for already applied style, that adds text like "\033[31m\"
|
||||
msg_stripped <- gsub("(.*)?\\033\\]8;;.*\\a(.*?)\\033\\]8;;\\a(.*)", "\\1\\2\\3", msg, perl = TRUE) # for font_url()
|
||||
msg_stripped <- font_stripstyle(msg_stripped)
|
||||
# where are the spaces now?
|
||||
msg_stripped_wrapped <- paste0(
|
||||
strwrap(msg_stripped,
|
||||
simplify = TRUE,
|
||||
width = width
|
||||
),
|
||||
collapse = "\n"
|
||||
)
|
||||
msg <- gsub(
|
||||
"\\{\\.help \\[([^]]+)\\]\\([^)]+\\)\\}",
|
||||
"{.code \\1}",
|
||||
msg,
|
||||
perl = TRUE
|
||||
)
|
||||
# {.topic [display](topic)} -> {.code ?display}
|
||||
msg <- gsub(
|
||||
"\\{\\.topic \\[([^]]+)\\]\\([^)]+\\)\\}",
|
||||
"{.code ?\\1}",
|
||||
msg,
|
||||
perl = TRUE
|
||||
msg_stripped_wrapped <- paste0(unlist(strsplit(msg_stripped_wrapped, "(\n|\\*\\|\\*)")),
|
||||
collapse = "\n"
|
||||
)
|
||||
msg_stripped_spaces <- which(unlist(strsplit(msg_stripped, "", fixed = TRUE)) == " ")
|
||||
msg_stripped_wrapped_spaces <- which(unlist(strsplit(msg_stripped_wrapped, "", fixed = TRUE)) != "\n")
|
||||
# so these are the indices of spaces that need to be replaced
|
||||
replace_spaces <- which(!msg_stripped_spaces %in% msg_stripped_wrapped_spaces)
|
||||
# put it together
|
||||
msg <- unlist(strsplit(msg, " ", fixed = TRUE))
|
||||
msg[replace_spaces] <- paste0(msg[replace_spaces], "\n")
|
||||
# add space around operators again
|
||||
msg <- gsub(paste0(ops, ops), "\\1 \\2", msg, perl = TRUE)
|
||||
msg <- paste0(msg, collapse = " ")
|
||||
msg <- gsub("\n ", "\n", msg, fixed = TRUE)
|
||||
|
||||
if (msg_stripped %like% "\u2139 ") {
|
||||
indentation <- 2 + extra_indent
|
||||
} else if (msg_stripped %like% "^=> ") {
|
||||
indentation <- 3 + extra_indent
|
||||
} else {
|
||||
indentation <- 0 + extra_indent
|
||||
}
|
||||
msg <- gsub("\n", paste0("\n", strrep(" ", indentation)), msg, fixed = TRUE)
|
||||
# remove trailing empty characters
|
||||
msg <- gsub("(\n| )+$", "", msg)
|
||||
|
||||
if (length(add_fn) > 0) {
|
||||
if (!is.list(add_fn)) {
|
||||
add_fn <- list(add_fn)
|
||||
}
|
||||
for (i in seq_len(length(add_fn))) {
|
||||
msg <- add_fn[[i]](msg)
|
||||
}
|
||||
}
|
||||
|
||||
# format backticks
|
||||
if (pkg_is_available("cli") &&
|
||||
tryCatch(isTRUE(getExportedValue("ansi_has_hyperlink_support", ns = asNamespace("cli"))()), error = function(e) FALSE) &&
|
||||
tryCatch(getExportedValue("isAvailable", ns = asNamespace("rstudioapi"))(), error = function(e) {
|
||||
return(FALSE)
|
||||
}) &&
|
||||
tryCatch(getExportedValue("versionInfo", ns = asNamespace("rstudioapi"))()$version > "2023.6.0.0", error = function(e) {
|
||||
return(FALSE)
|
||||
})) {
|
||||
# we are in a recent version of RStudio, so do something nice: add links to our help pages in the console.
|
||||
parts <- strsplit(msg, "`", fixed = TRUE)[[1]]
|
||||
cmds <- parts %in% paste0(ls(envir = asNamespace("AMR")), "()")
|
||||
# functions with a dot are not allowed: https://github.com/rstudio/rstudio/issues/11273#issuecomment-1156193252
|
||||
# lead them to the help page of our package
|
||||
parts[cmds & parts %like% "[.]"] <- font_url(
|
||||
url = paste0("ide:help:AMR::", gsub("()", "", parts[cmds & parts %like% "[.]"], fixed = TRUE)),
|
||||
txt = parts[cmds & parts %like% "[.]"]
|
||||
)
|
||||
# otherwise, give a 'click to run' popup
|
||||
parts[cmds & parts %unlike% "[.]"] <- font_url(
|
||||
url = paste0("ide:run:AMR::", parts[cmds & parts %unlike% "[.]"]),
|
||||
txt = parts[cmds & parts %unlike% "[.]"]
|
||||
)
|
||||
# datasets should give help page as well
|
||||
parts[parts %in% c("antimicrobials", "microorganisms", "microorganisms.codes", "microorganisms.groups")] <- font_url(
|
||||
url = paste0("ide:help:AMR::", gsub("()", "", parts[parts %in% c("antimicrobials", "microorganisms", "microorganisms.codes", "microorganisms.groups")], fixed = TRUE)),
|
||||
txt = parts[parts %in% c("antimicrobials", "microorganisms", "microorganisms.codes", "microorganisms.groups")]
|
||||
)
|
||||
# text starting with `?` must also lead to the help page
|
||||
parts[parts %like% "^[?].+"] <- font_url(
|
||||
url = paste0("ide:help:AMR::", gsub("?", "", parts[parts %like% "^[?].+"], fixed = TRUE)),
|
||||
txt = parts[parts %like% "^[?].+"]
|
||||
)
|
||||
msg <- paste0(parts, collapse = "`")
|
||||
}
|
||||
msg <- gsub("`(.+?)`", font_grey_bg("`\\1`"), msg)
|
||||
|
||||
# clean introduced whitespace in between fullstops
|
||||
msg <- gsub("[.] +[.]", "..", msg)
|
||||
# remove extra space that was introduced (e.g. "Smith et al. , 2022")
|
||||
msg <- gsub(". ,", ".,", msg, fixed = TRUE)
|
||||
msg <- gsub("[ ,", "[,", msg, fixed = TRUE)
|
||||
msg <- gsub("/ /", "//", msg, fixed = TRUE)
|
||||
|
||||
msg
|
||||
}
|
||||
|
||||
message_ <- function(...,
|
||||
appendLF = TRUE,
|
||||
as_note = TRUE,
|
||||
as_check = FALSE,
|
||||
extra_indent = 0,
|
||||
with_bullet = FALSE) {
|
||||
msg <- paste0(c(...), collapse = "")
|
||||
if (with_bullet == TRUE) {
|
||||
as_note <- FALSE
|
||||
msg <- paste0(AMR_env$bullet_icon, "\u00a0", msg)
|
||||
}
|
||||
if (extra_indent > 0) {
|
||||
msg <- paste0(strrep("\u00a0", extra_indent), msg)
|
||||
}
|
||||
if (has_cli_rlang()) {
|
||||
# prevent errors with single opening curly brackets, we don't evaluate cli's/glue's {} in AMR anyway
|
||||
msg <- gsub("\\{(?!\\.)", "", msg, perl = TRUE)
|
||||
if (!cli::ansi_has_hyperlink_support()) {
|
||||
msg <- simplify_help_markup(msg)
|
||||
}
|
||||
if (isTRUE(as_check)) {
|
||||
cli::cli_inform(c("v" = msg), .envir = parent.frame())
|
||||
} else if (isTRUE(as_note)) {
|
||||
cli::cli_inform(c("i" = msg), .envir = parent.frame())
|
||||
} else if (isTRUE(appendLF)) {
|
||||
cli::cli_inform(msg, .envir = parent.frame())
|
||||
} else {
|
||||
# This mirrors what rlang::inform() does internally (cat() to stderr), so it behaves consistently with cli_inform() output
|
||||
cat(format_inline_(msg), file = stderr())
|
||||
}
|
||||
} else {
|
||||
plain_msg <- cli_to_plain(msg, envir = parent.frame())
|
||||
message(word_wrap(plain_msg, as_note = as_note), appendLF = appendLF)
|
||||
}
|
||||
add_fn = list(font_blue),
|
||||
as_note = TRUE) {
|
||||
message(
|
||||
word_wrap(...,
|
||||
add_fn = add_fn,
|
||||
as_note = as_note
|
||||
),
|
||||
appendLF = appendLF
|
||||
)
|
||||
}
|
||||
|
||||
warning_ <- function(...,
|
||||
add_fn = list(),
|
||||
immediate = FALSE,
|
||||
call = FALSE,
|
||||
extra_indent = 0) {
|
||||
msg <- paste0(c(...), collapse = "")
|
||||
if (extra_indent > 0) {
|
||||
msg <- paste0(strrep("\u00a0", extra_indent), msg)
|
||||
}
|
||||
if (has_cli_rlang()) {
|
||||
# prevent errors with single opening curly brackets, we don't evaluate cli's/glue's {} in AMR anyway
|
||||
msg <- gsub("\\{(?!\\.)", "", msg, perl = TRUE)
|
||||
if (!cli::ansi_has_hyperlink_support()) {
|
||||
msg <- simplify_help_markup(msg)
|
||||
}
|
||||
cli::cli_warn(msg, .envir = parent.frame())
|
||||
} else {
|
||||
plain_msg <- cli_to_plain(msg, envir = parent.frame())
|
||||
warning(trimws2(word_wrap(plain_msg, as_note = FALSE)), immediate. = immediate, call. = call)
|
||||
}
|
||||
call = FALSE) {
|
||||
warning(
|
||||
trimws2(word_wrap(...,
|
||||
add_fn = add_fn,
|
||||
as_note = FALSE
|
||||
)),
|
||||
immediate. = immediate,
|
||||
call. = call
|
||||
)
|
||||
}
|
||||
|
||||
# this alternative to the stop() function:
|
||||
# - adds the function name where the error was thrown (plain-text fallback)
|
||||
# - wraps text to never break lines within words (plain-text fallback)
|
||||
stop_ <- function(...,
|
||||
call = TRUE,
|
||||
extra_indent = 0) {
|
||||
# - adds the function name where the error was thrown
|
||||
# - wraps text to never break lines within words
|
||||
stop_ <- function(..., call = TRUE) {
|
||||
msg <- paste0(c(...), collapse = "")
|
||||
if (extra_indent > 0) {
|
||||
msg <- paste0(strrep("\u00a0", extra_indent), msg)
|
||||
}
|
||||
# prevent errors with single opening curly brackets, we don't evaluate cli's/glue's {} in AMR anyway
|
||||
msg <- gsub("\\{(?!\\.)", "", msg, perl = TRUE)
|
||||
if (!cli::ansi_has_hyperlink_support()) {
|
||||
msg <- simplify_help_markup(msg)
|
||||
}
|
||||
if (has_cli_rlang()) {
|
||||
msg_call <- ""
|
||||
if (!isFALSE(call)) {
|
||||
if (isTRUE(call)) {
|
||||
call_obj <- sys.call(-1)
|
||||
} else if (!isFALSE(call)) {
|
||||
call_obj <- sys.call(call)
|
||||
call <- as.character(sys.call(-1)[1])
|
||||
} else {
|
||||
call_obj <- NULL
|
||||
# so you can go back more than 1 call, as used in sir_calc(), that now throws a reference to e.g. n_sir()
|
||||
call <- as.character(sys.call(call)[1])
|
||||
}
|
||||
cli::cli_abort(msg, call = call_obj, .envir = parent.frame())
|
||||
msg_call <- paste0("in ", call, "():")
|
||||
}
|
||||
msg <- trimws2(word_wrap(msg, add_fn = list(), as_note = FALSE))
|
||||
if (!is.null(AMR_env$cli_abort) && length(unlist(strsplit(msg, "\n", fixed = TRUE))) <= 1) {
|
||||
if (is.character(call)) {
|
||||
call <- as.call(str2lang(paste0(call, "()")))
|
||||
} else {
|
||||
call <- NULL
|
||||
}
|
||||
AMR_env$cli_abort(msg, call = call)
|
||||
} else {
|
||||
msg_call <- ""
|
||||
if (!isFALSE(call)) {
|
||||
if (isTRUE(call)) {
|
||||
call_name <- as.character(sys.call(-1)[1])
|
||||
} else {
|
||||
# go back more than 1 call, as used in sir_calc() to reference e.g. n_sir()
|
||||
call_name <- as.character(sys.call(call)[1])
|
||||
}
|
||||
msg_call <- paste0("in ", call_name, "():")
|
||||
}
|
||||
plain_msg <- cli_to_plain(trimws2(word_wrap(msg, as_note = FALSE)), envir = parent.frame())
|
||||
stop(paste(msg_call, plain_msg), call. = FALSE)
|
||||
stop(paste(msg_call, msg), call. = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,7 +612,7 @@ stop_ifnot <- function(expr, ..., call = TRUE) {
|
||||
}
|
||||
}
|
||||
|
||||
"%or_if_na%" <- function(x, y) {
|
||||
"%or%" <- function(x, y) {
|
||||
if (is.null(x) || is.null(y)) {
|
||||
if (is.null(x)) {
|
||||
return(y)
|
||||
@@ -721,7 +625,7 @@ stop_ifnot <- function(expr, ..., call = TRUE) {
|
||||
|
||||
return_after_integrity_check <- function(value, type, check_vector) {
|
||||
if (!all(value[!is.na(value)] %in% check_vector)) {
|
||||
warning_("invalid ", type, ", NA generated")
|
||||
warning_(paste0("invalid ", type, ", NA generated"))
|
||||
value[!value %in% check_vector] <- NA
|
||||
}
|
||||
value
|
||||
@@ -758,7 +662,7 @@ documentation_date <- function(d) {
|
||||
suffix[day %in% c(1, 21, 31)] <- "st"
|
||||
suffix[day %in% c(2, 22)] <- "nd"
|
||||
suffix[day %in% c(3, 23)] <- "rd"
|
||||
paste0(day, suffix, " of ", month.name[as.integer(format(d, "%m"))], ", ", format(d, "%Y"))
|
||||
paste0(month.name[as.integer(format(d, "%m"))], " ", day, suffix, ", ", format(d, "%Y"))
|
||||
}
|
||||
|
||||
format_included_data_number <- function(data) {
|
||||
@@ -782,71 +686,51 @@ format_included_data_number <- function(data) {
|
||||
paste0(ifelse(rounder == 0, "", "~"), format(round(n, rounder), decimal.mark = ".", big.mark = " "))
|
||||
}
|
||||
|
||||
vector_or <- function(v, quotes = TRUE, reverse = FALSE, sort = TRUE, initial_captital = FALSE, last_sep = " or ", documentation = FALSE) {
|
||||
vector_or <- function(v, quotes = TRUE, reverse = FALSE, sort = TRUE, initial_captital = FALSE, last_sep = " or ") {
|
||||
# makes unique and sorts, and this also removed NAs
|
||||
v <- unique(v)
|
||||
has_na <- anyNA(v)
|
||||
if (isTRUE(sort)) {
|
||||
v <- sort(v)
|
||||
if (has_na) {
|
||||
v <- c(v, NA)
|
||||
}
|
||||
}
|
||||
if (isTRUE(reverse)) {
|
||||
v <- rev(v)
|
||||
}
|
||||
if (isTRUE(quotes)) {
|
||||
if (isTRUE(documentation)) {
|
||||
quotes <- c("`\"", "\"`")
|
||||
} else {
|
||||
# use cli to format as values
|
||||
quotes <- c("{.val ", "}")
|
||||
}
|
||||
quotes <- '"'
|
||||
} else if (isFALSE(quotes)) {
|
||||
quotes <- ""
|
||||
} else {
|
||||
quotes <- quotes[1L]
|
||||
}
|
||||
if (length(quotes) == 1) {
|
||||
quotes <- c(quotes, quotes)
|
||||
}
|
||||
if (isTRUE(initial_captital)) {
|
||||
v[1] <- gsub("^([a-z])", "\\U\\1", v[1], perl = TRUE)
|
||||
}
|
||||
if (length(v) <= 1) {
|
||||
return(paste0(quotes[1], v, quotes[2]))
|
||||
return(paste0(quotes, v, quotes))
|
||||
}
|
||||
if (identical(v, c("I", "R", "S"))) {
|
||||
# class 'sir' should be sorted like this
|
||||
v <- c("S", "I", "R")
|
||||
}
|
||||
if (identical(v, sort(VALID_SIR_LEVELS))) {
|
||||
if (identical(v, c("I", "NI", "R", "S", "SDD"))) {
|
||||
# class 'sir' should be sorted like this
|
||||
v <- VALID_SIR_LEVELS
|
||||
v <- c("S", "SDD", "I", "R", "NI")
|
||||
}
|
||||
# oxford comma
|
||||
if (last_sep %in% c(" or ", " and ") && length(v) > 2) {
|
||||
last_sep <- paste0(",", last_sep)
|
||||
}
|
||||
NAs <- which(is.na(v))
|
||||
|
||||
if (is.numeric(v)) {
|
||||
v <- trimws(vapply(FUN.VALUE = character(1), v, format, scientific = FALSE))
|
||||
}
|
||||
quoted <- paste0(quotes[1], v, quotes[2])
|
||||
quoted[NAs] <- "NA"
|
||||
# all commas except for last item, so will become '"val1", "val2", "val3" or "val4"'
|
||||
paste0(
|
||||
paste(quoted[seq_len(length(quoted) - 1)], collapse = ", "),
|
||||
last_sep, quoted[length(quoted)]
|
||||
paste0(quotes, v[seq_len(length(v) - 1)], quotes, collapse = ", "),
|
||||
last_sep, paste0(quotes, v[length(v)], quotes)
|
||||
)
|
||||
}
|
||||
|
||||
vector_and <- function(v, quotes = TRUE, reverse = FALSE, sort = TRUE, initial_captital = FALSE, documentation = FALSE) {
|
||||
vector_and <- function(v, quotes = TRUE, reverse = FALSE, sort = TRUE, initial_captital = FALSE) {
|
||||
vector_or(
|
||||
v = v, quotes = quotes, reverse = reverse, sort = sort,
|
||||
initial_captital = initial_captital, documentation = documentation,
|
||||
last_sep = " and "
|
||||
initial_captital = initial_captital, last_sep = " and "
|
||||
)
|
||||
}
|
||||
|
||||
@@ -866,7 +750,7 @@ format_class <- function(class, plural = FALSE) {
|
||||
ifelse(plural, "s", "")
|
||||
)
|
||||
# exceptions
|
||||
class[class == "logical"] <- ifelse(plural, "a vector of {.code TRUE}/{.code FALSE}", "{.code TRUE} or {.code FALSE}")
|
||||
class[class == "logical"] <- ifelse(plural, "a vector of `TRUE`/`FALSE`", "`TRUE` or `FALSE`")
|
||||
class[class == "data.frame"] <- "a data set"
|
||||
if ("list" %in% class) {
|
||||
class <- "a list"
|
||||
@@ -875,12 +759,12 @@ format_class <- function(class, plural = FALSE) {
|
||||
class <- "a matrix"
|
||||
}
|
||||
if ("custom_eucast_rules" %in% class) {
|
||||
class <- "input created with {.fun custom_eucast_rules}"
|
||||
class <- "input created with `custom_eucast_rules()`"
|
||||
}
|
||||
if (any(c("mo", "ab", "sir") %in% class)) {
|
||||
class <- paste0("of class {.cls ", class[1L], "}")
|
||||
class <- paste0("of class '", class[1L], "'")
|
||||
}
|
||||
class[class == class.bak] <- paste0("of class {.cls ", class[class == class.bak], "}")
|
||||
class[class == class.bak] <- paste0("of class '", class[class == class.bak], "'")
|
||||
# output
|
||||
vector_or(class, quotes = FALSE, sort = FALSE)
|
||||
}
|
||||
@@ -915,11 +799,11 @@ meet_criteria <- function(object, # can be literally `list(...)` for `allow_argu
|
||||
AMR_env$meet_criteria_error_txt <- NULL
|
||||
|
||||
if (is.null(object)) {
|
||||
stop_if(allow_NULL == FALSE, "argument {.arg ", obj_name, "} must not be NULL", call = call_depth)
|
||||
stop_if(allow_NULL == FALSE, "argument `", obj_name, "` must not be NULL", call = call_depth)
|
||||
return(invisible())
|
||||
}
|
||||
if (is.null(dim(object)) && length(object) == 1 && suppressWarnings(is.na(object))) { # suppressWarnings for functions
|
||||
stop_if(allow_NA == FALSE, "argument {.arg ", obj_name, "} must not be NA", call = call_depth)
|
||||
stop_if(allow_NA == FALSE, "argument `", obj_name, "` must not be NA", call = call_depth)
|
||||
return(invisible())
|
||||
}
|
||||
|
||||
@@ -929,32 +813,32 @@ meet_criteria <- function(object, # can be literally `list(...)` for `allow_argu
|
||||
}
|
||||
|
||||
if (!is.null(allow_class) && !(suppressWarnings(all(is.na(object))) && allow_NA == TRUE)) {
|
||||
stop_ifnot(inherits(object, allow_class), "argument {.arg ", obj_name,
|
||||
"} must be ", format_class(allow_class, plural = isTRUE(has_length > 1)),
|
||||
stop_ifnot(inherits(object, allow_class), "argument `", obj_name,
|
||||
"` must be ", format_class(allow_class, plural = isTRUE(has_length > 1)),
|
||||
", i.e. not be ", format_class(class(object), plural = isTRUE(has_length > 1)),
|
||||
call = call_depth
|
||||
)
|
||||
# check data.frames for data
|
||||
if (inherits(object, "data.frame")) {
|
||||
stop_if(any(dim(object) == 0),
|
||||
"the data provided in argument {.arg ", obj_name,
|
||||
"} must contain rows and columns (current dimensions: ",
|
||||
"the data provided in argument `", obj_name,
|
||||
"` must contain rows and columns (current dimensions: ",
|
||||
paste(dim(object), collapse = "x"), ")",
|
||||
call = call_depth
|
||||
)
|
||||
}
|
||||
}
|
||||
if (!is.null(has_length)) {
|
||||
stop_ifnot(length(object) %in% has_length, "argument {.arg ", obj_name,
|
||||
"} must ", # ifelse(allow_NULL, "be NULL or must ", ""),
|
||||
stop_ifnot(length(object) %in% has_length, "argument `", obj_name,
|
||||
"` must ", # ifelse(allow_NULL, "be NULL or must ", ""),
|
||||
"be of length ", vector_or(has_length, quotes = FALSE),
|
||||
", not ", length(object),
|
||||
call = call_depth
|
||||
)
|
||||
}
|
||||
if (!is.null(looks_like)) {
|
||||
stop_ifnot(object %like% looks_like, "argument {.arg ", obj_name,
|
||||
"} must ", # ifelse(allow_NULL, "be NULL or must ", ""),
|
||||
stop_ifnot(object %like% looks_like, "argument `", obj_name,
|
||||
"` must ", # ifelse(allow_NULL, "be NULL or must ", ""),
|
||||
"resemble the regular expression \"", looks_like, "\"",
|
||||
call = call_depth
|
||||
)
|
||||
@@ -972,7 +856,7 @@ meet_criteria <- function(object, # can be literally `list(...)` for `allow_argu
|
||||
if ("logical" %in% allow_class) {
|
||||
or_values <- paste0(or_values, ", or TRUE or FALSE")
|
||||
}
|
||||
stop_ifnot(all(object %in% is_in.bak, na.rm = TRUE), "argument {.arg ", obj_name, "} ",
|
||||
stop_ifnot(all(object %in% is_in.bak, na.rm = TRUE), "argument `", obj_name, "` ",
|
||||
ifelse(!is.null(has_length) && length(has_length) == 1 && has_length == 1,
|
||||
"must be either ",
|
||||
"must only contain values "
|
||||
@@ -983,8 +867,8 @@ meet_criteria <- function(object, # can be literally `list(...)` for `allow_argu
|
||||
)
|
||||
}
|
||||
if (isTRUE(is_positive)) {
|
||||
stop_if(is.numeric(object) && !all(object > 0, na.rm = TRUE), "argument {.arg ", obj_name,
|
||||
"} must ",
|
||||
stop_if(is.numeric(object) && !all(object > 0, na.rm = TRUE), "argument `", obj_name,
|
||||
"` must ",
|
||||
ifelse(!is.null(has_length) && length(has_length) == 1 && has_length == 1,
|
||||
"be a number higher than zero",
|
||||
"all be numbers higher than zero"
|
||||
@@ -993,8 +877,8 @@ meet_criteria <- function(object, # can be literally `list(...)` for `allow_argu
|
||||
)
|
||||
}
|
||||
if (isTRUE(is_positive_or_zero)) {
|
||||
stop_if(is.numeric(object) && !all(object >= 0, na.rm = TRUE), "argument {.arg ", obj_name,
|
||||
"} must ",
|
||||
stop_if(is.numeric(object) && !all(object >= 0, na.rm = TRUE), "argument `", obj_name,
|
||||
"` must ",
|
||||
ifelse(!is.null(has_length) && length(has_length) == 1 && has_length == 1,
|
||||
"be zero or a positive number",
|
||||
"all be zero or numbers higher than zero"
|
||||
@@ -1003,8 +887,8 @@ meet_criteria <- function(object, # can be literally `list(...)` for `allow_argu
|
||||
)
|
||||
}
|
||||
if (isTRUE(is_finite)) {
|
||||
stop_if(is.numeric(object) && !all(is.finite(object[!is.na(object)]), na.rm = TRUE), "argument {.arg ", obj_name,
|
||||
"} must ",
|
||||
stop_if(is.numeric(object) && !all(is.finite(object[!is.na(object)]), na.rm = TRUE), "argument `", obj_name,
|
||||
"` must ",
|
||||
ifelse(!is.null(has_length) && length(has_length) == 1 && has_length == 1,
|
||||
"be a finite number",
|
||||
"all be finite numbers"
|
||||
@@ -1038,9 +922,9 @@ ascertain_sir_classes <- function(x, obj_name) {
|
||||
sirs <- vapply(FUN.VALUE = logical(1), x, is.sir)
|
||||
if (!any(sirs, na.rm = TRUE)) {
|
||||
warning_(
|
||||
"the data provided in argument {.arg ", obj_name,
|
||||
"} should contain at least one column of class {.cls sir}. Eligible SIR columns were now guessed. ",
|
||||
"See {.help [{.fun as.sir}](AMR::as.sir)}.",
|
||||
"the data provided in argument `", obj_name,
|
||||
"` should contain at least one column of class 'sir'. Eligible SIR column were now guessed. ",
|
||||
"See `?as.sir`.",
|
||||
immediate = TRUE
|
||||
)
|
||||
sirs_eligible <- is_sir_eligible(x)
|
||||
@@ -1086,13 +970,8 @@ get_current_data <- function(arg_name, call) {
|
||||
# an element `.data` will be in the environment when using dplyr::select()
|
||||
return(env$`.data`)
|
||||
} else if (valid_df(env$training)) {
|
||||
if (!is.null(env$x) && valid_df(env$x$template)) {
|
||||
# an element `x$template` will be in the environment when using some tidymodels functions such as `prep()`
|
||||
return(env$x$template)
|
||||
} else {
|
||||
# this is a fallback for some tidymodels functions such as `prep()`
|
||||
return(env$training)
|
||||
}
|
||||
# an element `training` will be in the environment when using some tidymodels functions such as `prep()`
|
||||
return(env$training)
|
||||
} else if (valid_df(env$data)) {
|
||||
# an element `data` will be in the environment when using older dplyr versions, or some tidymodels functions such as `fit()`
|
||||
return(env$data)
|
||||
@@ -1142,13 +1021,13 @@ get_current_data <- function(arg_name, call) {
|
||||
} else {
|
||||
examples <- ""
|
||||
}
|
||||
stop_("this function must be used inside a {.pkg dplyr} verb or {.cls data.frame} call",
|
||||
stop_("this function must be used inside a `dplyr` verb or `data.frame` call",
|
||||
examples,
|
||||
call = call
|
||||
)
|
||||
} else {
|
||||
# mimic a base R error that the argument is missing
|
||||
stop_("argument {.arg ", arg_name, "} is missing with no default", call = call)
|
||||
stop_("argument `", arg_name, "` is missing with no default", call = call)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1162,8 +1041,24 @@ get_current_column <- function() {
|
||||
|
||||
# cur_column() doesn't always work (only allowed for certain conditions set by dplyr), but it's probably still possible:
|
||||
frms <- lapply(sys.frames(), function(env) {
|
||||
if (all(c("dots", "i") %in% names(env))) {
|
||||
names(env$dots)[env$i]
|
||||
if (tryCatch(!is.null(env$i), error = function(e) FALSE)) {
|
||||
if (!is.null(env$tibble_vars)) {
|
||||
# for mutate_if()
|
||||
# TODO remove later, was part of older dplyr versions (at least not in dplyr 1.1.4)
|
||||
env$tibble_vars[env$i]
|
||||
} else {
|
||||
# for mutate(across())
|
||||
if (!is.null(env$data) && is.data.frame(env$data)) {
|
||||
df <- env$data
|
||||
} else {
|
||||
df <- tryCatch(get_current_data(NA, 0), error = function(e) NULL)
|
||||
}
|
||||
if (is.data.frame(df)) {
|
||||
colnames(df)[env$i]
|
||||
} else {
|
||||
env$i
|
||||
}
|
||||
}
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
@@ -1217,14 +1112,11 @@ format_custom_query_rule <- function(query, colours = has_colour()) {
|
||||
query <- gsub("any\\((.*)\\)$", paste0(font_black("any of "), "\\1"), query)
|
||||
query <- gsub("all\\((.*)\\)$", paste0(font_black("all of "), "\\1"), query)
|
||||
if (colours == TRUE) {
|
||||
query <- gsub("[\"']S[\"']", font_green_bg(" S "), query)
|
||||
query <- gsub("[\"']SDD[\"']", font_orange_bg(" SDD "), query)
|
||||
query <- gsub("[\"']I[\"']", font_orange_bg(" I "), query)
|
||||
query <- gsub("[\"']R[\"']", font_rose_bg(" R "), query)
|
||||
query <- gsub("[\"']SDD[\"']", font_orange_bg(" SDD "), query)
|
||||
query <- gsub("[\"']S[\"']", font_green_bg(" S "), query)
|
||||
query <- gsub("[\"']NI[\"']", font_grey_bg(font_black(" NI ")), query)
|
||||
query <- gsub("[\"']WT[\"']", font_green_bg(" SDD "), query)
|
||||
query <- gsub("[\"']NWT[\"']", font_rose_bg(" I "), query)
|
||||
query <- gsub("[\"']NS[\"']", font_rose_bg(" R "), query)
|
||||
query <- gsub("[\"']I[\"']", font_orange_bg(" I "), query)
|
||||
}
|
||||
# replace the black colour 'stops' with blue colour 'starts'
|
||||
query <- gsub("\033[39m", "\033[34m", as.character(query), fixed = TRUE)
|
||||
@@ -1296,13 +1188,6 @@ reset_all_thrown_messages <- function() {
|
||||
)
|
||||
}
|
||||
|
||||
in_rstudio <- function() {
|
||||
identical(Sys.getenv("RSTUDIO"), "1")
|
||||
}
|
||||
in_positron <- function() {
|
||||
identical(Sys.getenv("POSITRON"), "1")
|
||||
}
|
||||
|
||||
has_colour <- function() {
|
||||
if (is.null(AMR_env$supports_colour)) {
|
||||
if (Sys.getenv("EMACS") != "" || Sys.getenv("INSIDE_EMACS") != "") {
|
||||
@@ -1334,14 +1219,10 @@ try_colour <- function(..., before, after, collapse = " ") {
|
||||
}
|
||||
}
|
||||
is_dark <- function() {
|
||||
AMR_env$current_theme <- NULL
|
||||
current_theme_fn <- import_fn("getThemeInfo", "rstudioapi", error_on_fail = FALSE)
|
||||
if (!is.null(current_theme_fn)) {
|
||||
AMR_env$current_theme <- current_theme_fn()$editor
|
||||
}
|
||||
AMR_env$current_theme <- tryCatch(getExportedValue("getThemeInfo", ns = asNamespace("rstudioapi"))()$editor, error = function(e) NULL)
|
||||
if (!identical(AMR_env$current_theme, AMR_env$former_theme) || is.null(AMR_env$is_dark_theme)) {
|
||||
AMR_env$former_theme <- AMR_env$current_theme
|
||||
AMR_env$is_dark_theme <- !has_colour() || tryCatch(isTRUE(current_theme_fn()$dark), error = function(e) TRUE)
|
||||
AMR_env$is_dark_theme <- !has_colour() || tryCatch(isTRUE(getExportedValue("getThemeInfo", ns = asNamespace("rstudioapi"))()$dark), error = function(e) FALSE)
|
||||
}
|
||||
isTRUE(AMR_env$is_dark_theme)
|
||||
}
|
||||
@@ -1666,14 +1547,14 @@ add_MO_lookup_to_AMR_env <- function() {
|
||||
if (is.null(AMR_env$MO_lookup)) {
|
||||
MO_lookup <- AMR::microorganisms
|
||||
|
||||
MO_lookup$domain_index <- NA_real_
|
||||
MO_lookup[which(MO_lookup$domain == "Bacteria" | as.character(MO_lookup$mo) == "UNKNOWN"), "domain_index"] <- 1
|
||||
MO_lookup[which(MO_lookup$domain == "Fungi"), "domain_index"] <- 1.25
|
||||
MO_lookup[which(MO_lookup$domain == "Protozoa"), "domain_index"] <- 1.5
|
||||
MO_lookup[which(MO_lookup$domain == "Chromista"), "domain_index"] <- 1.75
|
||||
MO_lookup[which(MO_lookup$domain == "Archaea"), "domain_index"] <- 2
|
||||
MO_lookup$kingdom_index <- NA_real_
|
||||
MO_lookup[which(MO_lookup$kingdom == "Bacteria" | as.character(MO_lookup$mo) == "UNKNOWN"), "kingdom_index"] <- 1
|
||||
MO_lookup[which(MO_lookup$kingdom == "Fungi"), "kingdom_index"] <- 1.25
|
||||
MO_lookup[which(MO_lookup$kingdom == "Protozoa"), "kingdom_index"] <- 1.5
|
||||
MO_lookup[which(MO_lookup$kingdom == "Chromista"), "kingdom_index"] <- 1.75
|
||||
MO_lookup[which(MO_lookup$kingdom == "Archaea"), "kingdom_index"] <- 2
|
||||
# all the rest
|
||||
MO_lookup[which(is.na(MO_lookup$domain_index)), "domain_index"] <- 3
|
||||
MO_lookup[which(is.na(MO_lookup$kingdom_index)), "kingdom_index"] <- 3
|
||||
|
||||
# the fullname lowercase, important for the internal algorithms in as.mo()
|
||||
MO_lookup$fullname_lower <- tolower(trimws2(paste(
|
||||
@@ -1712,15 +1593,37 @@ readRDS_AMR <- function(file, refhook = NULL) {
|
||||
readRDS(con, refhook = refhook)
|
||||
}
|
||||
|
||||
get_n_cores <- function(max_cores = Inf) {
|
||||
if (pkg_is_available("parallelly", min_version = "0.8.0", also_load = FALSE)) {
|
||||
available_cores <- import_fn("availableCores", "parallelly")
|
||||
n_cores <- min(available_cores(), na.rm = TRUE)
|
||||
} else {
|
||||
# `parallel` is part of base R since 2.14.0, but detectCores() is not very precise on exotic systems like Docker and quota-set Linux environments
|
||||
n_cores <- parallel::detectCores()[1]
|
||||
if (is.na(n_cores)) {
|
||||
n_cores <- 1
|
||||
}
|
||||
}
|
||||
max_cores <- floor(max_cores)
|
||||
if (max_cores == 0) {
|
||||
n_cores <- 1
|
||||
} else if (max_cores < 0) {
|
||||
n_cores <- max(1, n_cores - abs(max_cores))
|
||||
} else if (max_cores > 0) {
|
||||
n_cores <- min(n_cores, max_cores)
|
||||
}
|
||||
n_cores
|
||||
}
|
||||
|
||||
# Support `where()` if tidyselect not installed ----
|
||||
if (!is.null(import_fn("where", "tidyselect", error_on_fail = FALSE))) {
|
||||
# tidyselect::where() exists, retrieve from their namespace to make `where()`s work across the package in default arguments
|
||||
where <- tidyselect::where
|
||||
# tidyselect::where() exists, load the namespace to make `where()`s work across the package in default arguments
|
||||
loadNamespace("tidyselect")
|
||||
} else {
|
||||
where <- function(fn) {
|
||||
# based on https://github.com/nathaneastwood/poorman/blob/52eb6947e0b4430cd588976ed8820013eddf955f/R/where.R#L17-L32
|
||||
if (!is.function(fn)) {
|
||||
stop_("{.fun ", deparse(substitute(fn)), "} is not a valid predicate function.")
|
||||
stop_("`", deparse(substitute(fn)), "()` is not a valid predicate function.")
|
||||
}
|
||||
df <- pm_select_env$.data
|
||||
cols <- pm_select_env$get_colnames()
|
||||
@@ -1735,7 +1638,7 @@ if (!is.null(import_fn("where", "tidyselect", error_on_fail = FALSE))) {
|
||||
},
|
||||
fn
|
||||
))
|
||||
if (!is.logical(preds)) stop_("{.fun where} must be used with functions that return {.code TRUE} or {.code FALSE}.")
|
||||
if (!is.logical(preds)) stop_("`where()` must be used with functions that return `TRUE` or `FALSE`.")
|
||||
data_cols <- cols
|
||||
cols <- data_cols[preds]
|
||||
which(data_cols %in% cols)
|
||||
@@ -1846,10 +1749,4 @@ if (getRversion() < "4.0.0") {
|
||||
}
|
||||
}
|
||||
|
||||
if (getRversion() < "4.4.0") {
|
||||
`%||%` <- function(x, y) {
|
||||
if (is.null(x)) y else x
|
||||
}
|
||||
}
|
||||
|
||||
# nolint end
|
||||
|
||||
@@ -29,27 +29,15 @@
|
||||
|
||||
#' Options for the AMR package
|
||||
#'
|
||||
#' @description
|
||||
#' This is an overview of all the package-specific options you can set in the `AMR` package. Set them using the [options()] function, e.g.:
|
||||
#'
|
||||
#' `options(AMR_guideline = "CLSI")`
|
||||
#' @section Options (alphabetical order):
|
||||
#' This is an overview of all the package-specific [options()] you can set in the `AMR` package.
|
||||
#' @section Options:
|
||||
#' * `AMR_antibiogram_formatting_type` \cr A [numeric] (1-22) to use in [antibiogram()], to indicate which formatting type to use.
|
||||
#' * `AMR_breakpoint_type` \cr A [character] to use in [as.sir()], to indicate which breakpoint type to use. This must be either `r vector_or(clinical_breakpoints$type, documentation = TRUE)`.
|
||||
#' * `AMR_capped_mic_handling` \cr A [character] to use in [as.sir()], to indicate how capped MIC values (`<`, `<=`, `>`, `>=`) should be interpreted. Must be one of `"none"`, `"conservative"`, `"standard"`, or `"lenient"` - the default is `"conservative"`.
|
||||
#' * `AMR_breakpoint_type` \cr A [character] to use in [as.sir()], to indicate which breakpoint type to use. This must be either `r vector_or(clinical_breakpoints$type)`.
|
||||
#' * `AMR_capped_mic_handling` \cr A [character] to use in [as.sir()], to indicate how capped MIC values (`<`, `<=`, `>`, `>=`) should be interpreted. Must be one of `"standard"`, `"strict"`, `"relaxed"`, or `"inverse"` - the default is `"standard"`.
|
||||
#' * `AMR_cleaning_regex` \cr A [regular expression][base::regex] (case-insensitive) to use in [as.mo()] and all [`mo_*`][mo_property()] functions, to clean the user input. The default is the outcome of [mo_cleaning_regex()], which removes texts between brackets and texts such as "species" and "serovar".
|
||||
#' * `AMR_custom_ab` \cr A file location to an RDS file, to use custom antimicrobial drugs with this package. This is explained in [add_custom_antimicrobials()].
|
||||
#' * `AMR_custom_mo` \cr A file location to an RDS file, to use custom microorganisms with this package. This is explained in [add_custom_microorganisms()].
|
||||
#' * `AMR_eucastrules` \cr A [character] to set the default types of rules for [eucast_rules()] function, must be one or more of: `"breakpoints"`, `"expert"`, `"other"`, `"custom"`, `"all"`, and defaults to `c("breakpoints", "expert")`.
|
||||
#' * `AMR_guideline` \cr A [character] to set the default guideline used throughout the `AMR` package wherever a `guideline` argument is available. This option is used as the default in e.g. [as.sir()], [resistance()], [susceptibility()], [interpretive_rules()] and many plotting functions. **While unset**, the AMR package uses the latest implemented EUCAST guideline (currently `r AMR::clinical_breakpoints$guideline[1]`).
|
||||
#'
|
||||
#' - For [as.sir()], this determines which clinical breakpoint guideline is used to interpret MIC values and disk diffusion diameters. It can be either the guideline name (e.g., `"CLSI"` or `"EUCAST"`) or the name including a year (e.g., `"CLSI 2019"`). Supported guidelines are EUCAST `r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))` to `r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`, and CLSI `r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))` to `r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`.
|
||||
#'
|
||||
#' - For [resistance()] and [susceptibility()], this setting determines how the `"I"` (Intermediate / Increased exposure) category is handled in calculations. Under CLSI, `"I"` is considered *resistant* in susceptibility calculations; under EUCAST, `"I"` is considered *susceptible* in susceptibility calculations. Explicitly setting this option ensures reproducible AMR proportion estimates.
|
||||
#'
|
||||
#' - For [interpretive_rules()], this determines which guideline-specific interpretive (expert) rules are applied to antimicrobial test results, either EUCAST or CLSI.
|
||||
#'
|
||||
#' - For many plotting functions (e.g., for MIC or disk diffusion values), supplying `mo` and `ab` enables automatic SIR-based interpretative colouring. These colours are derived from [as.sir()] in the background and therefore depend on the active `guideline` setting, which again uses `r AMR::clinical_breakpoints$guideline[1]` if not set explicitly.
|
||||
#' * `AMR_guideline` \cr A [character] to set the default guideline for interpreting MIC values and disk diffusion diameters with [as.sir()]. Can be only the guideline name (e.g., `"CLSI"`) or the name with a year (e.g. `"CLSI 2019"`). The default to the latest implemented EUCAST guideline, currently \code{"`r clinical_breakpoints$guideline[1]`"}. Supported guideline are currently EUCAST (`r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`) and CLSI (`r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`).
|
||||
#' * `AMR_ignore_pattern` \cr A [regular expression][base::regex] to ignore (i.e., make `NA`) any match given in [as.mo()] and all [`mo_*`][mo_property()] functions.
|
||||
#' * `AMR_include_PKPD` \cr A [logical] to use in [as.sir()], to indicate that PK/PD clinical breakpoints must be applied as a last resort - the default is `TRUE`.
|
||||
@@ -75,9 +63,9 @@
|
||||
#'
|
||||
#' ...to add Portuguese language support of antimicrobials, and allow PK/PD rules when interpreting MIC values with [as.sir()].
|
||||
#'
|
||||
#' ## Share Options Within Team
|
||||
#' ### Share Options Within Team
|
||||
#'
|
||||
#' For a more collaborative approach, e.g. within a (data) team, save an options file to a remote file location, such as a shared network drive, and have each user read in this file automatically at start-up. This would work in this way:
|
||||
#' For a more global approach, e.g. within a (data) team, save an options file to a remote file location, such as a shared network drive, and have each user read in this file automatically at start-up. This would work in this way:
|
||||
#'
|
||||
#' 1. Save a plain text file to e.g. "X:/team_folder/R_options.R" and fill it with preferred settings.
|
||||
#'
|
||||
|
||||
88
R/ab.R
88
R/ab.R
@@ -54,7 +54,7 @@
|
||||
#' @section Source:
|
||||
#' World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://atcddd.fhi.no/atc_ddd_index/}
|
||||
#'
|
||||
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{https://health.ec.europa.eu/documents/community-register/html/index_en.htm}
|
||||
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm}
|
||||
#' @aliases ab
|
||||
#' @return A [character] [vector] with additional class [`ab`]
|
||||
#' @seealso
|
||||
@@ -119,14 +119,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(),
|
||||
x[x %like_case% "^PENICILLIN" & x %unlike_case% "[ /+-]"] <- "benzylpenicillin"
|
||||
x_bak_clean <- x
|
||||
if (already_regex == FALSE) {
|
||||
x_bak_clean_before_gen <- x_bak_clean
|
||||
x_bak_clean <- generalise_antibiotic_name(x_bak_clean)
|
||||
# generalise_antibiotic_name() rewrites "PH"->"F" and "TH"->"T", which
|
||||
# mangles short valid AB codes (e.g. "ETH"->"ET", "PHN"->"FN", "STH"->"ST")
|
||||
# making them unrecognisable in the lookup. Restore any values that were
|
||||
# already valid AB codes before generalisation (#245).
|
||||
is_valid_ab_code <- x_bak_clean_before_gen %in% AMR_env$AB_lookup$ab
|
||||
x_bak_clean[is_valid_ab_code] <- x_bak_clean_before_gen[is_valid_ab_code]
|
||||
}
|
||||
|
||||
x <- unique(x_bak_clean) # this means that every x is in fact generalise_antibiotic_name(x)
|
||||
@@ -191,13 +184,12 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(),
|
||||
x_new[known_codes_cid] <- AMR_env$AB_lookup$ab[match(x[known_codes_cid], AMR_env$AB_lookup$cid)]
|
||||
previously_coerced <- x %in% AMR_env$ab_previously_coerced$x
|
||||
x_new[previously_coerced & is.na(x_new)] <- AMR_env$ab_previously_coerced$ab[match(x[is.na(x_new) & x %in% AMR_env$ab_previously_coerced$x], AMR_env$ab_previously_coerced$x)]
|
||||
previously_coerced_mention <- !is.na(x) & x %in% AMR_env$ab_previously_coerced$x & !x %in% AMR_env$AB_lookup$ab & !x %in% AMR_env$AB_lookup$generalised_name
|
||||
previously_coerced_mention <- x %in% AMR_env$ab_previously_coerced$x & !x %in% AMR_env$AB_lookup$ab & !x %in% AMR_env$AB_lookup$generalised_name
|
||||
if (any(previously_coerced_mention) && isTRUE(info) && message_not_thrown_before("as.ab", entire_session = TRUE)) {
|
||||
only_one <- length(unique(which(x[which(previously_coerced)] %in% x_bak_clean))) == 1
|
||||
message_(
|
||||
"Returning ", ifelse(only_one, "a ", ""), "previously coerced ",
|
||||
ifelse(only_one, "value for an antimicrobial", "values for various antimicrobials"),
|
||||
". Run {.help [{.fun ab_reset_session}](AMR::ab_reset_session)} to reset this. This note will be shown once per session."
|
||||
"Returning previously coerced ",
|
||||
ifelse(length(unique(which(x[which(previously_coerced)] %in% x_bak_clean))) > 1, "value for an antimicrobial", "values for various antimicrobials"),
|
||||
". Run `ab_reset_session()` to reset this. This note will be shown once per session."
|
||||
)
|
||||
}
|
||||
|
||||
@@ -210,9 +202,6 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(),
|
||||
if (sum(already_known) < length(x)) {
|
||||
progress <- progress_ticker(n = sum(!already_known), n_min = 25, print = info) # start if n >= 25
|
||||
on.exit(close(progress))
|
||||
if (any(x_new[!already_known & !is.na(x_new)] %in% unlist(AMR_env$AV_lookup$generalised_all, use.names = FALSE), na.rm = TRUE)) {
|
||||
warning_("in {.help [{.fun as.ab}](AMR::as.ab)}: some input seems to resemble antiviral drugs - use {.help [{.fun as.av}](AMR::as.av)} or e.g. {.help [{.fun av_name}](AMR::av_name)} for these, not {.help [{.fun as.ab}](AMR::as.ab)} or e.g. {.help [{.fun ab_name}](AMR::ab_name)}.")
|
||||
}
|
||||
}
|
||||
|
||||
for (i in which(!already_known)) {
|
||||
@@ -445,7 +434,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(),
|
||||
# take failed ATC codes apart from rest
|
||||
if (length(x_unknown_ATCs) > 0 && fast_mode == FALSE) {
|
||||
warning_(
|
||||
"in {.help [{.fun as.ab}](AMR::as.ab)}: these ATC codes are not (yet) in the antimicrobials data set: ",
|
||||
"in `as.ab()`: these ATC codes are not (yet) in the antimicrobials data set: ",
|
||||
vector_and(x_unknown_ATCs), "."
|
||||
)
|
||||
}
|
||||
@@ -459,14 +448,12 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(),
|
||||
x_unknown <- x_unknown[!x_unknown %in% c("", NA)]
|
||||
if (length(x_unknown) > 0 && fast_mode == FALSE) {
|
||||
warning_(
|
||||
"in {.help [{.fun as.ab}](AMR::as.ab)}: ", ifelse(length(unique(x_unknown)) == 1, "this value", "these values"), " could not be coerced to a valid antimicrobial ID: ",
|
||||
"in `as.ab()`: these values could not be coerced to a valid antimicrobial ID: ",
|
||||
vector_and(x_unknown), "."
|
||||
)
|
||||
}
|
||||
|
||||
# Throw note about uncertainties
|
||||
x_uncertain <- x_uncertain[!is.na(x_uncertain)]
|
||||
AMR_env$ab_previously_coerced <- AMR_env$ab_previously_coerced[!is.na(AMR_env$ab_previously_coerced$x), ]
|
||||
if (isTRUE(info) && length(x_uncertain) > 0 && fast_mode == FALSE) {
|
||||
x_uncertain <- unique(x_uncertain)
|
||||
if (message_not_thrown_before("as.ab", "uncertainties", x_bak)) {
|
||||
@@ -484,7 +471,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(),
|
||||
}
|
||||
message_(
|
||||
"Antimicrobial translation was uncertain for ", examples,
|
||||
". If required, use {.help [{.fun add_custom_antimicrobials}](AMR::add_custom_antimicrobials)} to add custom entries."
|
||||
". If required, use `add_custom_antimicrobials()` to add custom entries."
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -517,22 +504,14 @@ ab_reset_session <- function() {
|
||||
}
|
||||
}
|
||||
|
||||
#' @rdname as.ab
|
||||
#' @details `NA_ab_` is a missing value of the new `ab` class, analogous to e.g. base \R's [`NA_character_`][base::NA].
|
||||
#' @format NULL
|
||||
#' @export
|
||||
NA_ab_ <- set_clean_class(NA_character_,
|
||||
new_class = c("ab", "character")
|
||||
)
|
||||
|
||||
# this prevents the requirement for putting the dependency in Imports:
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(pillar::pillar_shaft, ab)
|
||||
pillar_shaft.ab <- function(x, ...) {
|
||||
out <- trimws(format(x))
|
||||
out[is.na(x)] <- pillar::style_na(NA)
|
||||
out[is.na(x)] <- font_na(NA)
|
||||
|
||||
# add the names to the drugs as mouse-over!
|
||||
if (in_rstudio()) {
|
||||
if (tryCatch(isTRUE(getExportedValue("ansi_has_hyperlink_support", ns = asNamespace("cli"))()), error = function(e) FALSE)) {
|
||||
out[!is.na(x)] <- font_url(
|
||||
url = paste0(x[!is.na(x)], ": ", ab_name(x[!is.na(x)])),
|
||||
txt = out[!is.na(x)]
|
||||
@@ -554,27 +533,16 @@ type_sum.ab <- function(x, ...) {
|
||||
print.ab <- function(x, ...) {
|
||||
if (!is.null(attributes(x)$amr_selector)) {
|
||||
function_name <- attributes(x)$amr_selector
|
||||
if (has_cli_rlang()) {
|
||||
cli::cli_inform(c(
|
||||
"i" = paste0("This {.cls ab} vector was retrieved using {.fun ", function_name, "}, which should normally be used inside a {.pkg dplyr} verb or {.cls data.frame} call, e.g.:"),
|
||||
paste0("\u00a0\u00a0", AMR_env$bullet_icon, " ", highlight_code(paste0("your_data %>% select(", function_name, "())"))),
|
||||
paste0("\u00a0\u00a0", AMR_env$bullet_icon, " ", highlight_code(paste0("your_data %>% select(column_a, column_b, ", function_name, "())"))),
|
||||
paste0("\u00a0\u00a0", AMR_env$bullet_icon, " ", highlight_code(paste0("your_data %>% filter(any(", function_name, "() == \"R\"))"))),
|
||||
paste0("\u00a0\u00a0", AMR_env$bullet_icon, " ", highlight_code(paste0("your_data[, ", function_name, "()]"))),
|
||||
paste0("\u00a0\u00a0", AMR_env$bullet_icon, " ", highlight_code(paste0("your_data[, c(\"column_a\", \"column_b\", ", function_name, "())]")))
|
||||
))
|
||||
} else {
|
||||
message(word_wrap(paste0(
|
||||
"This 'ab' vector was retrieved using `", function_name, "()`, which should normally be used inside a dplyr verb or data.frame call, e.g.:\n",
|
||||
"\u00a0\u00a0", AMR_env$bullet_icon, " your_data %>% select(", function_name, "())\n",
|
||||
"\u00a0\u00a0", AMR_env$bullet_icon, " your_data %>% select(column_a, column_b, ", function_name, "())\n",
|
||||
"\u00a0\u00a0", AMR_env$bullet_icon, " your_data %>% filter(any(", function_name, "() == \"R\"))\n",
|
||||
"\u00a0\u00a0", AMR_env$bullet_icon, " your_data[, ", function_name, "()]\n",
|
||||
"\u00a0\u00a0", AMR_env$bullet_icon, " your_data[, c(\"column_a\", \"column_b\", ", function_name, "())]"
|
||||
), as_note = TRUE))
|
||||
}
|
||||
message_(
|
||||
"This 'ab' vector was retrieved using `", function_name, "()`, which should normally be used inside a `dplyr` verb or `data.frame` call, e.g.:\n",
|
||||
" ", AMR_env$bullet_icon, " your_data %>% select(", function_name, "())\n",
|
||||
" ", AMR_env$bullet_icon, " your_data %>% select(column_a, column_b, ", function_name, "())\n",
|
||||
" ", AMR_env$bullet_icon, " your_data %>% filter(any(", function_name, "() == \"R\"))\n",
|
||||
" ", AMR_env$bullet_icon, " your_data[, ", function_name, "()]\n",
|
||||
" ", AMR_env$bullet_icon, " your_data[, c(\"column_a\", \"column_b\", ", function_name, "())]"
|
||||
)
|
||||
}
|
||||
cat(format_inline_("Class {.cls ab}\n"))
|
||||
cat("Class 'ab'\n")
|
||||
print(as.character(x), quote = FALSE)
|
||||
}
|
||||
|
||||
@@ -659,20 +627,6 @@ rep.ab <- function(x, ...) {
|
||||
out
|
||||
}
|
||||
|
||||
# this prevents the requirement for putting the dependency in Imports:
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(skimr::get_skimmers, ab)
|
||||
get_skimmers.ab <- function(column) {
|
||||
ab <- as.ab(column, info = FALSE)
|
||||
ab <- ab[!is.na(ab)]
|
||||
skimr::sfl(
|
||||
skim_type = "ab",
|
||||
n_unique = ~ length(unique(ab)),
|
||||
top_ab = ~ names(sort(-table(ab)))[1L],
|
||||
top_ab_name = ~ names(sort(-table(ab_name(ab, info = FALSE))))[1L],
|
||||
top_group = ~ names(sort(-table(ab_group(ab, info = FALSE))))[1L]
|
||||
)
|
||||
}
|
||||
|
||||
generalise_antibiotic_name <- function(x) {
|
||||
x <- toupper(x)
|
||||
# remove suffices
|
||||
@@ -718,8 +672,8 @@ get_translate_ab <- function(translate_ab) {
|
||||
} else {
|
||||
translate_ab <- tolower(translate_ab)
|
||||
stop_ifnot(translate_ab %in% colnames(AMR::antimicrobials),
|
||||
"invalid value for {.arg translate_ab}, this must be a column name of the {.help [antimicrobials](AMR::antimicrobials)} data set\n",
|
||||
"or {.code TRUE} (equals {.val name}) or {.code FALSE} to not translate at all.",
|
||||
"invalid value for 'translate_ab', this must be a column name of the `antimicrobials` data set\n",
|
||||
"or `TRUE` (equals 'name') or `FALSE` to not translate at all.",
|
||||
call = FALSE
|
||||
)
|
||||
translate_ab
|
||||
|
||||
@@ -212,7 +212,7 @@ ab_from_text <- function(text,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
stop_("{.arg type} must be either {.val drug}, {.val dose} or {.val administration}")
|
||||
stop_("`type` must be either 'drug', 'dose' or 'administration'")
|
||||
}
|
||||
|
||||
# collapse text if needed
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#' Use these functions to return a specific property of an antibiotic from the [antimicrobials] data set. All input values will be evaluated internally with [as.ab()].
|
||||
#' @param x Any (vector of) text that can be coerced to a valid antibiotic drug code with [as.ab()].
|
||||
#' @param tolower A [logical] to indicate whether the first [character] of every output should be transformed to a lower case [character]. This will lead to e.g. "polymyxin B" and not "polymyxin b".
|
||||
#' @param property One of the column names of one of the [antimicrobials] data set: `r vector_or(colnames(antimicrobials), documentation = TRUE, sort = FALSE)`.
|
||||
#' @param property One of the column names of one of the [antimicrobials] data set: `vector_or(colnames(antimicrobials), sort = FALSE)`.
|
||||
#' @param language Language of the returned text - the default is the current system language (see [get_AMR_locale()]) and can also be set with the package option [`AMR_locale`][AMR-options]. Use `language = NULL` or `language = ""` to prevent translation.
|
||||
#' @param administration Way of administration, either `"oral"` or `"iv"`.
|
||||
#' @param open Browse the URL using [utils::browseURL()].
|
||||
@@ -65,7 +65,6 @@
|
||||
#' ab_synonyms("AMX")
|
||||
#' ab_tradenames("AMX")
|
||||
#' ab_group("AMX")
|
||||
#' ab_group("AMX", all_groups = TRUE) # most specific to most general
|
||||
#' ab_atc_group1("AMX")
|
||||
#' ab_atc_group2("AMX")
|
||||
#' ab_url("AMX")
|
||||
@@ -164,32 +163,11 @@ ab_tradenames <- function(x, ...) {
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
#' @param all_groups A [logical] to indicate whether all antimicrobial groups must be return as a vector for each input value. For example, an antibiotic in the "aminopenicillins" group, is also in the "penicillins" and "beta-lactams" groups. Setting `all_groups = TRUE` would return all three for such an antibiotic, while `all_groups = FALSE` (default) only returns the most specific group name.
|
||||
#' @export
|
||||
ab_group <- function(x, language = get_AMR_locale(), all_groups = FALSE, ...) {
|
||||
ab_group <- function(x, language = get_AMR_locale(), ...) {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
language <- validate_language(language)
|
||||
meet_criteria(all_groups, allow_class = "logical", has_length = 1)
|
||||
|
||||
grps <- ab_validate(x = x, property = "group", ...)
|
||||
for (i in seq_along(grps)) {
|
||||
if (is.null(grps[[i]]) || all(is.na(grps[[i]]))) {
|
||||
grps[[i]] <- NA_character_
|
||||
}
|
||||
if (all_groups == FALSE) {
|
||||
# take the first match based on ABX_PRIORITY_LIST
|
||||
grps[[i]] <- grps[[i]][1]
|
||||
}
|
||||
if (language != "en") {
|
||||
grps[[i]] <- translate_into_language(grps[[i]], language = language, only_affect_ab_names = TRUE)
|
||||
}
|
||||
}
|
||||
names(grps) <- x
|
||||
if (length(grps) == 1 || all_groups == FALSE) {
|
||||
unname(unlist(grps))
|
||||
} else {
|
||||
grps
|
||||
}
|
||||
translate_into_language(ab_validate(x = x, property = "group", ...), language = language, only_affect_ab_names = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
@@ -265,7 +243,7 @@ ab_ddd <- function(x, administration = "oral", ...) {
|
||||
|
||||
if (any(ab_name(x, language = NULL) %like% "/" & is.na(out))) {
|
||||
warning_(
|
||||
"in {.help [{.fun ab_ddd}](AMR::ab_ddd)}: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
|
||||
"in `ab_ddd()`: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
|
||||
"Please refer to the WHOCC website:\n",
|
||||
"atcddd.fhi.no/ddd/list_of_ddds_combined_products/"
|
||||
)
|
||||
@@ -285,7 +263,7 @@ ab_ddd_units <- function(x, administration = "oral", ...) {
|
||||
|
||||
if (any(ab_name(x, language = NULL) %like% "/" & is.na(out))) {
|
||||
warning_(
|
||||
"in {.help [{.fun ab_ddd_units}](AMR::ab_ddd_units)}: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
|
||||
"in `ab_ddd_units()`: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
|
||||
"Please refer to the WHOCC website:\n",
|
||||
"atcddd.fhi.no/ddd/list_of_ddds_combined_products/"
|
||||
)
|
||||
@@ -304,7 +282,7 @@ ab_info <- function(x, language = get_AMR_locale(), ...) {
|
||||
ab = as.character(x),
|
||||
cid = ab_cid(x),
|
||||
name = ab_name(x, language = language),
|
||||
group = ab_group(x, language = language, all_groups = TRUE),
|
||||
group = ab_group(x, language = language),
|
||||
atc = ab_atc(x),
|
||||
atc_group1 = ab_atc_group1(x, language = language),
|
||||
atc_group2 = ab_atc_group2(x, language = language),
|
||||
@@ -341,12 +319,12 @@ ab_url <- function(x, open = FALSE, ...) {
|
||||
|
||||
NAs <- ab_name(ab, tolower = TRUE, language = NULL)[!is.na(ab) & is.na(atcs)]
|
||||
if (length(NAs) > 0) {
|
||||
warning_("in {.fun ab_url}: no ATC code available for ", vector_and(NAs, quotes = FALSE), ".")
|
||||
warning_("in `ab_url()`: no ATC code available for ", vector_and(NAs, quotes = FALSE), ".")
|
||||
}
|
||||
|
||||
if (open == TRUE) {
|
||||
if (length(u) > 1 && !is.na(u[1L])) {
|
||||
warning_("in {.fun ab_url}: only the first URL will be opened, as {.fun browseURL} only suports one string.")
|
||||
warning_("in `ab_url()`: only the first URL will be opened, as `browseURL()` only suports one string.")
|
||||
}
|
||||
if (!is.na(u[1L])) {
|
||||
utils::browseURL(u[1L])
|
||||
@@ -361,7 +339,7 @@ ab_property <- function(x, property = "name", language = get_AMR_locale(), ...)
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(property, is_in = colnames(AMR::antimicrobials), has_length = 1)
|
||||
language <- validate_language(language)
|
||||
translate_into_language(ab_validate(x = x, property = property, ...), language = language, only_affect_ab_names = TRUE)
|
||||
translate_into_language(ab_validate(x = x, property = property, ...), language = language)
|
||||
}
|
||||
|
||||
#' @rdname ab_property
|
||||
@@ -397,7 +375,7 @@ set_ab_names <- function(data, ..., property = "name", language = get_AMR_locale
|
||||
}
|
||||
vars <- get_column_abx(df, info = FALSE, only_sir_columns = FALSE, sort = FALSE, fn = "set_ab_names")
|
||||
if (length(vars) == 0) {
|
||||
message_("No columns with antibiotic results found for {.fun set_ab_names}, leaving names unchanged.")
|
||||
message_("No columns with antibiotic results found for `set_ab_names()`, leaving names unchanged.")
|
||||
return(data)
|
||||
}
|
||||
} else {
|
||||
@@ -424,7 +402,7 @@ set_ab_names <- function(data, ..., property = "name", language = get_AMR_locale
|
||||
)
|
||||
if (any(x %in% c("", NA))) {
|
||||
warning_(
|
||||
"in {.help [{.fun set_ab_names}](AMR::set_ab_names)}: no ", property, " found for column(s): ",
|
||||
"in `set_ab_names()`: no ", property, " found for column(s): ",
|
||||
vector_and(vars[x %in% c("", NA)], sort = FALSE)
|
||||
)
|
||||
x[x %in% c("", NA)] <- vars[x %in% c("", NA)]
|
||||
|
||||
12
R/age.R
12
R/age.R
@@ -67,7 +67,7 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...) {
|
||||
} else if (length(reference) == 1) {
|
||||
reference <- rep(reference, length(x))
|
||||
} else {
|
||||
stop_("{.arg x} and {.arg reference} must be of same length, or {.arg reference} must be of length 1.")
|
||||
stop_("`x` and `reference` must be of same length, or `reference` must be of length 1.")
|
||||
}
|
||||
}
|
||||
x <- as.POSIXlt(x, ...)
|
||||
@@ -109,10 +109,10 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...) {
|
||||
|
||||
if (any(ages < 0, na.rm = TRUE)) {
|
||||
ages[!is.na(ages) & ages < 0] <- NA
|
||||
warning_("in {.fun age}: NAs introduced for ages below 0.")
|
||||
warning_("in `age()`: NAs introduced for ages below 0.")
|
||||
}
|
||||
if (any(ages > 120, na.rm = TRUE)) {
|
||||
warning_("in {.fun age}: some ages are above 120.")
|
||||
warning_("in `age()`: some ages are above 120.")
|
||||
}
|
||||
|
||||
if (isTRUE(na.rm)) {
|
||||
@@ -191,7 +191,7 @@ age_groups <- function(x, split_at = c(0, 12, 25, 55, 75), names = NULL, na.rm =
|
||||
|
||||
if (any(x < 0, na.rm = TRUE)) {
|
||||
x[x < 0] <- NA
|
||||
warning_("in {.fun age_groups}: NAs introduced for ages below 0.")
|
||||
warning_("in `age_groups()`: NAs introduced for ages below 0.")
|
||||
}
|
||||
if (is.character(split_at)) {
|
||||
split_at <- split_at[1L]
|
||||
@@ -211,7 +211,7 @@ age_groups <- function(x, split_at = c(0, 12, 25, 55, 75), names = NULL, na.rm =
|
||||
split_at <- c(0, split_at)
|
||||
}
|
||||
split_at <- split_at[!is.na(split_at)]
|
||||
stop_if(length(split_at) == 1, "invalid value for {.arg split_at}.") # only 0 is available
|
||||
stop_if(length(split_at) == 1, "invalid value for `split_at`.") # only 0 is available
|
||||
|
||||
# turn input values to 'split_at' indices
|
||||
y <- x
|
||||
@@ -228,7 +228,7 @@ age_groups <- function(x, split_at = c(0, 12, 25, 55, 75), names = NULL, na.rm =
|
||||
agegroups <- factor(lbls[y], levels = lbls, ordered = TRUE)
|
||||
|
||||
if (!is.null(names)) {
|
||||
stop_ifnot(length(names) == length(levels(agegroups)), "{.arg names} must have the same length as the number of age groups (", length(levels(agegroups)), ").")
|
||||
stop_ifnot(length(names) == length(levels(agegroups)), "`names` must have the same length as the number of age groups (", length(levels(agegroups)), ").")
|
||||
levels(agegroups) <- names
|
||||
}
|
||||
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, et al. (2022). #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data. #
|
||||
# Journal of Statistical Software, 104(3), 1-31. #
|
||||
# https://doi.org/10.18637/jss.v104.i03 #
|
||||
# #
|
||||
# Developed at the University of Groningen and the University Medical #
|
||||
# Center Groningen in The Netherlands, in collaboration with many #
|
||||
# colleagues from around the world, see our website. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR data analysis: https://amr-for-r.org #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Download and Unpack an AMR Course Repository
|
||||
#'
|
||||
#' Downloads and unpacks a GitHub repository containing course materials, using [usethis::use_course()]. This is a convenience wrapper intended for use in educational settings, such as workshops or tutorials associated with the AMR package.
|
||||
#' @param github_repo A character string specifying the GitHub repository with username and repo name, e.g. `"https://github.com/username/repo"`.
|
||||
#' @param branch A character string specifying the branch to download. Defaults to `"main"`.
|
||||
#' @param ... Additional arguments passed on to [usethis::use_course()].
|
||||
#' @details
|
||||
#' This function constructs a ZIP archive URL from the provided `github_repo` and `branch`, then delegates to [usethis::use_course()] to handle the download and extraction.
|
||||
#'
|
||||
#' The function is designed for interactive use in course or workshop settings and is not intended for use in non-interactive or automated pipelines.
|
||||
#' @return
|
||||
#' Called for its side effect. [usethis::use_course()] will prompt the user to choose a destination and open the extracted project. Returns invisibly whatever [usethis::use_course()] returns.
|
||||
#' @seealso [usethis::use_course()]
|
||||
#' @export
|
||||
#' @examples
|
||||
#' \dontrun{
|
||||
#'
|
||||
#' # Let this run by users, e.g., webinar participants
|
||||
#' amr_course("https://github.com/my_user_name/our_AMR_course")
|
||||
#' }
|
||||
amr_course <- function(github_repo, branch = "main", ...) {
|
||||
if (!"usethis" %in% rownames(utils::installed.packages())) {
|
||||
if ("rlang" %in% rownames(utils::installed.packages())) {
|
||||
rlang::check_installed("usethis")
|
||||
} else {
|
||||
stop("Package usethis is not installed. Please run: install.packages(\"usethis\")", call. = FALSE)
|
||||
}
|
||||
}
|
||||
url <- paste0(github_repo, "/archive/refs/heads/", branch, ".zip")
|
||||
use_course <- import_fn("use_course", "usethis")
|
||||
message("This will download and unpack the contents of a repository.\n")
|
||||
use_course(url, ...)
|
||||
}
|
||||
@@ -202,7 +202,7 @@
|
||||
#' # data.table --------------------------------------------------------------
|
||||
#'
|
||||
#' # data.table is supported as well, just use it in the same way as with
|
||||
#' # base R, but add `with = FALSE` if using a single AMR selector.
|
||||
#' # base R, but add `with = FALSE` if using a single AB selector.
|
||||
#'
|
||||
#' if (require("data.table")) {
|
||||
#' dt <- as.data.table(example_isolates)
|
||||
@@ -215,7 +215,7 @@
|
||||
#' dt[, carbapenems(), with = FALSE]
|
||||
#' }
|
||||
#'
|
||||
#' # for multiple selections or AMR selectors, `with = FALSE` is not needed:
|
||||
#' # for multiple selections or AB selectors, `with = FALSE` is not needed:
|
||||
#' if (require("data.table")) {
|
||||
#' dt[, c("mo", aminoglycosides())]
|
||||
#' }
|
||||
@@ -352,14 +352,6 @@ glycopeptides <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
amr_select_exec("glycopeptides", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
ionophores <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(return_all, allow_class = "logical", has_length = 1)
|
||||
amr_select_exec("ionophores", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
isoxazolylpenicillins <- function(only_sir_columns = FALSE, only_treatable = TRUE, return_all = TRUE, ...) {
|
||||
@@ -425,14 +417,6 @@ penicillins <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
amr_select_exec("penicillins", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
peptides <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(return_all, allow_class = "logical", has_length = 1)
|
||||
amr_select_exec("peptides", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
phenicols <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
@@ -441,14 +425,6 @@ phenicols <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
amr_select_exec("phenicols", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
phosphonics <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(return_all, allow_class = "logical", has_length = 1)
|
||||
amr_select_exec("phosphonics", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
polymyxins <- function(only_sir_columns = FALSE, only_treatable = TRUE, return_all = TRUE, ...) {
|
||||
@@ -474,14 +450,6 @@ rifamycins <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
amr_select_exec("rifamycins", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
spiropyrimidinetriones <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(return_all, allow_class = "logical", has_length = 1)
|
||||
amr_select_exec("spiropyrimidinetriones", only_sir_columns = only_sir_columns, return_all = return_all)
|
||||
}
|
||||
|
||||
#' @rdname antimicrobial_selectors
|
||||
#' @export
|
||||
streptogramins <- function(only_sir_columns = FALSE, return_all = TRUE, ...) {
|
||||
@@ -678,7 +646,7 @@ not_intrinsic_resistant <- function(only_sir_columns = FALSE, col_mo = NULL, ver
|
||||
agents <- ab_in_data[ab_in_data %in% names(vars_df_R[which(vars_df_R)])]
|
||||
if (length(agents) > 0 &&
|
||||
message_not_thrown_before("not_intrinsic_resistant", sort(agents))) {
|
||||
agents_formatted <- paste0("{.field ", font_bold(agents, collapse = NULL), "}")
|
||||
agents_formatted <- paste0("'", font_bold(agents, collapse = NULL), "'")
|
||||
agents_names <- ab_name(names(agents), tolower = TRUE, language = NULL)
|
||||
need_name <- generalise_antibiotic_name(agents) != generalise_antibiotic_name(agents_names)
|
||||
agents_formatted[need_name] <- paste0(agents_formatted[need_name], " (", agents_names[need_name], ")")
|
||||
@@ -717,12 +685,12 @@ amr_select_exec <- function(function_name,
|
||||
}
|
||||
|
||||
# untreatable drugs
|
||||
untreatable <- AMR_env$AB_lookup$ab[which(AMR_env$AB_lookup$name %like% "(-high|EDTA|polysorbate|macromethod|screening|nacubactam|inducible)")]
|
||||
untreatable <- AMR_env$AB_lookup$ab[which(AMR_env$AB_lookup$name %like% "(-high|EDTA|polysorbate|macromethod|screening|nacubactam)")]
|
||||
if (!is.null(vars_df) && only_treatable == TRUE) {
|
||||
if (any(untreatable %in% names(ab_in_data))) {
|
||||
if (message_not_thrown_before(function_name, "amr_class", "untreatable")) {
|
||||
warning_(
|
||||
"in {.help [{.fun ", function_name, "}](AMR::", function_name, ")}: some drugs were ignored since they cannot be used for treatment: ",
|
||||
"in `", function_name, "()`: some drugs were ignored since they cannot be used for treatment: ",
|
||||
vector_and(
|
||||
ab_name(names(ab_in_data)[names(ab_in_data) %in% untreatable],
|
||||
language = NULL,
|
||||
@@ -745,9 +713,9 @@ amr_select_exec <- function(function_name,
|
||||
if (is.null(amr_class_args) || isTRUE(function_name %in% c("antifungals", "antimycobacterials"))) {
|
||||
ab_group <- NULL
|
||||
if (isTRUE(function_name == "antifungals")) {
|
||||
abx <- AMR_env$AB_lookup$ab[which(vapply(FUN.VALUE = logical(1), AMR_env$AB_lookup$group, function(x) "Antifungals" %in% x))]
|
||||
abx <- AMR_env$AB_lookup$ab[which(AMR_env$AB_lookup$group == "Antifungals")]
|
||||
} else if (isTRUE(function_name == "antimycobacterials")) {
|
||||
abx <- AMR_env$AB_lookup$ab[which(vapply(FUN.VALUE = logical(1), AMR_env$AB_lookup$group, function(x) "Antimycobacterials" %in% x))]
|
||||
abx <- AMR_env$AB_lookup$ab[which(AMR_env$AB_lookup$group == "Antimycobacterials")]
|
||||
} else {
|
||||
# their upper case equivalent are vectors with class 'ab', created in data-raw/_pre_commit_checks.R
|
||||
# carbapenems() gets its codes from AMR:::AB_CARBAPENEMS
|
||||
@@ -755,11 +723,7 @@ amr_select_exec <- function(function_name,
|
||||
# manually added codes from add_custom_antimicrobials() must also be supported
|
||||
if (length(AMR_env$custom_ab_codes) > 0) {
|
||||
custom_ab <- AMR_env$AB_lookup[which(AMR_env$AB_lookup$ab %in% AMR_env$custom_ab_codes), ]
|
||||
check_string <- paste0(
|
||||
vapply(FUN.VALUE = character(1), custom_ab$group, function(x) paste(x, collapse = " ")),
|
||||
custom_ab$atc_group1,
|
||||
custom_ab$atc_group2
|
||||
)
|
||||
check_string <- paste0(custom_ab$group, custom_ab$atc_group1, custom_ab$atc_group2)
|
||||
if (function_name == "betalactams") {
|
||||
find_group <- "beta[-]?lactams"
|
||||
} else if (function_name %like% "cephalosporins_") {
|
||||
@@ -797,14 +761,14 @@ amr_select_exec <- function(function_name,
|
||||
if (only_treatable == TRUE) {
|
||||
if (message_not_thrown_before(function_name, "amr_class", "untreatable")) {
|
||||
message_(
|
||||
"in {.help [{.fun ", function_name, "}](AMR::", function_name, ")}: ",
|
||||
"in `", function_name, "()`: ",
|
||||
vector_and(
|
||||
paste0(
|
||||
ab_name(abx[abx %in% untreatable],
|
||||
language = NULL,
|
||||
tolower = TRUE
|
||||
),
|
||||
" ({.field ", font_bold(abx[abx %in% untreatable], collapse = NULL), "})"
|
||||
" (`", abx[abx %in% untreatable], "`)"
|
||||
),
|
||||
quotes = FALSE,
|
||||
sort = TRUE,
|
||||
@@ -837,10 +801,10 @@ amr_select_exec <- function(function_name,
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.amr_selector <- function(x, ...) {
|
||||
warning_("It should never be needed to print an antimicrobial selector class. Are you using {.pkg data.table}? Then add the argument {.arg with = FALSE}, see our examples at {.help [{.fun amr_selector}](AMR::amr_selector)}.",
|
||||
warning_("It should never be needed to print an antimicrobial selector class. Are you using data.table? Then add the argument `with = FALSE`, see our examples at `?amr_selector`.",
|
||||
immediate = TRUE
|
||||
)
|
||||
cat(format_inline_("Class {.cls amr_selector}\n"))
|
||||
cat("Class 'amr_selector'\n")
|
||||
print(as.character(x), quote = FALSE)
|
||||
}
|
||||
|
||||
@@ -855,10 +819,10 @@ c.amr_selector <- function(...) {
|
||||
|
||||
all_any_amr_selector <- function(type, ..., na.rm = TRUE) {
|
||||
cols_ab <- c(...)
|
||||
result <- cols_ab[toupper(cols_ab) %in% VALID_SIR_LEVELS]
|
||||
result <- cols_ab[toupper(cols_ab) %in% c("S", "SDD", "I", "R", "NI")]
|
||||
if (length(result) == 0) {
|
||||
message_("Filtering ", type, " of columns ", vector_and(paste0("{.field ", font_bold(cols_ab, collapse = NULL), "}"), quotes = FALSE), " to only contain values ", vector_or(VALID_SIR_LEVELS))
|
||||
result <- VALID_SIR_LEVELS
|
||||
message_("Filtering ", type, " of columns ", vector_and(font_bold(cols_ab, collapse = NULL), quotes = "'"), ' to contain value "S", "I" or "R"')
|
||||
result <- c("S", "SDD", "I", "R", "NI")
|
||||
}
|
||||
cols_ab <- cols_ab[!cols_ab %in% result]
|
||||
df <- get_current_data(arg_name = NA, call = -3)
|
||||
@@ -937,7 +901,7 @@ any.amr_selector_any_all <- function(..., na.rm = FALSE) {
|
||||
if (length(e1) > 1) {
|
||||
message_(
|
||||
"Assuming a filter on ", type, " ", length(e1), " ", gsub("[\\(\\)]", "", fn_name),
|
||||
". Wrap around {.fun all} or {.fun any} to prevent this note."
|
||||
". Wrap around `all()` or `any()` to prevent this note."
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -962,12 +926,12 @@ any.amr_selector_any_all <- function(..., na.rm = FALSE) {
|
||||
if (length(e1) > 1) {
|
||||
message_(
|
||||
"Assuming a filter on ", type, " ", length(e1), " ", gsub("[\\(\\)]", "", fn_name),
|
||||
". Wrap around {.fun all} or {.fun any} to prevent this note."
|
||||
". Wrap around `all()` or `any()` to prevent this note."
|
||||
)
|
||||
}
|
||||
}
|
||||
# this is `!=`, so turn around the values
|
||||
sir <- VALID_SIR_LEVELS
|
||||
sir <- c("S", "SDD", "I", "R", "NI")
|
||||
e2 <- sir[sir != e2]
|
||||
structure(all_any_amr_selector(type = type, e1, e2),
|
||||
class = c("amr_selector_any_all", "logical")
|
||||
@@ -1037,11 +1001,11 @@ find_ab_names <- function(ab_group, n = 3) {
|
||||
# try popular first, they have DDDs
|
||||
drugs <- AMR_env$AB_lookup[which((!is.na(AMR_env$AB_lookup$iv_ddd) | !is.na(AMR_env$AB_lookup$oral_ddd)) &
|
||||
AMR_env$AB_lookup$name %unlike% " " &
|
||||
vapply(FUN.VALUE = character(1), AMR_env$AB_lookup$group, function(x) paste(x, collapse = " ")) %like% ab_group &
|
||||
AMR_env$AB_lookup$group %like% ab_group &
|
||||
AMR_env$AB_lookup$ab %unlike% "[0-9]$"), ]$name
|
||||
if (length(drugs) < n) {
|
||||
# now try it all
|
||||
drugs <- AMR_env$AB_lookup[which((vapply(FUN.VALUE = character(1), AMR_env$AB_lookup$group, function(x) paste(x, collapse = " ")) %like% ab_group |
|
||||
drugs <- AMR_env$AB_lookup[which((AMR_env$AB_lookup$group %like% ab_group |
|
||||
AMR_env$AB_lookup$atc_group1 %like% ab_group |
|
||||
AMR_env$AB_lookup$atc_group2 %like% ab_group) &
|
||||
AMR_env$AB_lookup$ab %unlike% "[0-9]$"), ]$name
|
||||
@@ -1062,7 +1026,7 @@ message_agent_names <- function(function_name, agents, ab_group = NULL, examples
|
||||
if (message_not_thrown_before(function_name, sort(agents))) {
|
||||
if (length(agents) == 0) {
|
||||
if (is.null(ab_group)) {
|
||||
message_("For {.help [{.fun ", function_name, "}](AMR::", function_name, ")} no antimicrobial drugs found", examples, ".")
|
||||
message_("For `", function_name, "()` no antimicrobial drugs found", examples, ".")
|
||||
} else if (ab_group == "administrable_per_os") {
|
||||
message_("No orally administrable drugs found", examples, ".")
|
||||
} else if (ab_group == "administrable_iv") {
|
||||
@@ -1071,12 +1035,12 @@ message_agent_names <- function(function_name, agents, ab_group = NULL, examples
|
||||
message_("No antimicrobial drugs of class '", ab_group, "' found", examples, ".")
|
||||
}
|
||||
} else {
|
||||
agents_formatted <- paste0("{.field ", font_bold(agents, collapse = NULL), "}")
|
||||
agents_formatted <- paste0("'", font_bold(agents, collapse = NULL), "'")
|
||||
agents_names <- ab_name(names(agents), tolower = TRUE, language = NULL)
|
||||
need_name <- generalise_antibiotic_name(agents) != generalise_antibiotic_name(agents_names)
|
||||
agents_formatted[need_name] <- paste0(agents_formatted[need_name], " (", agents_names[need_name], ")")
|
||||
message_(
|
||||
"For {.help [", function_name, "(",
|
||||
"For `", function_name, "(",
|
||||
ifelse(function_name == "amr_class",
|
||||
paste0("\"", amr_class_args, "\""),
|
||||
ifelse(!is.null(call),
|
||||
@@ -1084,7 +1048,7 @@ message_agent_names <- function(function_name, agents, ab_group = NULL, examples
|
||||
""
|
||||
)
|
||||
),
|
||||
")](AMR::", function_name, ")} using ",
|
||||
")` using ",
|
||||
ifelse(length(agents) == 1, "column ", "columns "),
|
||||
vector_and(agents_formatted, quotes = FALSE, sort = FALSE)
|
||||
)
|
||||
|
||||
1156
R/antibiogram.R
1156
R/antibiogram.R
File diff suppressed because it is too large
Load Diff
@@ -99,12 +99,12 @@ atc_online_property <- function(atc_code,
|
||||
read_html <- import_fn("read_html", "xml2")
|
||||
|
||||
if (!all(atc_code %in% unlist(AMR::antimicrobials$atc))) {
|
||||
missing <- atc_code %unlike% "[A-Z][0-9][0-9][A-Z][A-Z][0-9][0-9]"
|
||||
atc_code[missing] <- as.character(ab_atc(atc_code[missing], only_first = TRUE))
|
||||
atc_code <- as.character(ab_atc(atc_code, only_first = TRUE))
|
||||
}
|
||||
|
||||
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)))
|
||||
@@ -180,7 +180,7 @@ atc_online_property <- function(atc_code,
|
||||
colnames(out) <- gsub("^atc.*", "atc", tolower(colnames(out)))
|
||||
|
||||
if (length(out) == 0) {
|
||||
message_("{.help [{.fun atc_online_property}](AMR::atc_online_property)}: no properties found for ATC ", atc_code[i], ". Please check {.href ", atc_url, " this WHOCC webpage}.")
|
||||
message_("in `atc_online_property()`: no properties found for ATC ", atc_code[i], ". Please check ", font_url(atc_url, "this WHOCC webpage"), ".")
|
||||
returnvalue[i] <- NA
|
||||
next
|
||||
}
|
||||
|
||||
12
R/av.R
12
R/av.R
@@ -51,7 +51,7 @@
|
||||
#' @section Source:
|
||||
#' World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://atcddd.fhi.no/atc_ddd_index/}
|
||||
#'
|
||||
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{https://health.ec.europa.eu/documents/community-register/html/reg_hum_atc.htm}
|
||||
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm}
|
||||
#' @aliases av
|
||||
#' @return A [character] [vector] with additional class [`ab`]
|
||||
#' @seealso
|
||||
@@ -475,7 +475,7 @@ as.av <- function(x, flag_multiple_results = TRUE, info = interactive(), ...) {
|
||||
# take failed ATC codes apart from rest
|
||||
if (length(x_unknown_ATCs) > 0 && fast_mode == FALSE) {
|
||||
warning_(
|
||||
"in {.help [{.fun as.av}](AMR::as.av)}: these ATC codes are not (yet) in the antivirals data set: ",
|
||||
"in `as.av()`: these ATC codes are not (yet) in the antivirals data set: ",
|
||||
vector_and(x_unknown_ATCs), "."
|
||||
)
|
||||
}
|
||||
@@ -486,7 +486,7 @@ as.av <- function(x, flag_multiple_results = TRUE, info = interactive(), ...) {
|
||||
)
|
||||
if (length(x_unknown) > 0 && fast_mode == FALSE) {
|
||||
warning_(
|
||||
"in {.help [{.fun as.av}](AMR::as.av)}: these values could not be coerced to a valid antiviral drug ID: ",
|
||||
"in `as.av()`: these values could not be coerced to a valid antiviral drug ID: ",
|
||||
vector_and(x_unknown), "."
|
||||
)
|
||||
}
|
||||
@@ -511,8 +511,8 @@ is.av <- function(x) {
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(pillar::pillar_shaft, av)
|
||||
pillar_shaft.av <- function(x, ...) {
|
||||
out <- trimws(format(x))
|
||||
out[!is.na(x)] <- gsub("+", pillar::style_subtle("+"), out[!is.na(x)], fixed = TRUE)
|
||||
out[is.na(x)] <- pillar::style_na(NA)
|
||||
out[!is.na(x)] <- gsub("+", font_subtle("+"), out[!is.na(x)], fixed = TRUE)
|
||||
out[is.na(x)] <- font_na(NA)
|
||||
create_pillar_column(out, align = "left", min_width = 4)
|
||||
}
|
||||
|
||||
@@ -526,7 +526,7 @@ type_sum.av <- function(x, ...) {
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.av <- function(x, ...) {
|
||||
cat(format_inline_("Class {.cls av}\n"))
|
||||
cat("Class 'av'\n")
|
||||
print(as.character(x), quote = FALSE)
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ av_from_text <- function(text,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
stop_("{.arg type} must be either {.val drug}, {.val dose} or {.val administration}")
|
||||
stop_("`type` must be either 'drug', 'dose' or 'administration'")
|
||||
}
|
||||
|
||||
# collapse text if needed
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#' Use these functions to return a specific property of an antiviral drug from the [antivirals] data set. All input values will be evaluated internally with [as.av()].
|
||||
#' @param x Any (vector of) text that can be coerced to a valid antiviral drug code with [as.av()].
|
||||
#' @param tolower A [logical] to indicate whether the first [character] of every output should be transformed to a lower case [character].
|
||||
#' @param property One of the column names of one of the [antivirals] data set: `r vector_or(colnames(antivirals), documentation = TRUE, sort = FALSE)`.
|
||||
#' @param property One of the column names of one of the [antivirals] data set: `vector_or(colnames(antivirals), sort = FALSE)`.
|
||||
#' @param language Language of the returned text - the default is system language (see [get_AMR_locale()]) and can also be set with the package option [`AMR_locale`][AMR-options]. Use `language = NULL` or `language = ""` to prevent translation.
|
||||
#' @param administration Way of administration, either `"oral"` or `"iv"`.
|
||||
#' @param open Browse the URL using [utils::browseURL()].
|
||||
@@ -162,7 +162,7 @@ av_ddd <- function(x, administration = "oral", ...) {
|
||||
|
||||
if (any(av_name(x, language = NULL) %like% "/" & is.na(out))) {
|
||||
warning_(
|
||||
"in {.help [{.fun av_ddd}](AMR::av_ddd)}: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
|
||||
"in `av_ddd()`: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
|
||||
"Please refer to the WHOCC website:\n",
|
||||
"atcddd.fhi.no/ddd/list_of_ddds_combined_products/"
|
||||
)
|
||||
@@ -182,7 +182,7 @@ av_ddd_units <- function(x, administration = "oral", ...) {
|
||||
|
||||
if (any(av_name(x, language = NULL) %like% "/" & is.na(out))) {
|
||||
warning_(
|
||||
"in {.help [{.fun av_ddd_units}](AMR::av_ddd_units)}: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
|
||||
"in `av_ddd_units()`: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
|
||||
"Please refer to the WHOCC website:\n",
|
||||
"atcddd.fhi.no/ddd/list_of_ddds_combined_products/"
|
||||
)
|
||||
@@ -233,12 +233,12 @@ av_url <- function(x, open = FALSE, ...) {
|
||||
|
||||
NAs <- av_name(av, tolower = TRUE, language = NULL)[!is.na(av) & is.na(atcs)]
|
||||
if (length(NAs) > 0) {
|
||||
warning_("in {.fun av_url}: no ATC code available for ", vector_and(NAs, quotes = FALSE), ".")
|
||||
warning_("in `av_url()`: no ATC code available for ", vector_and(NAs, quotes = FALSE), ".")
|
||||
}
|
||||
|
||||
if (open == TRUE) {
|
||||
if (length(u) > 1 && !is.na(u[1L])) {
|
||||
warning_("in {.fun av_url}: only the first URL will be opened, as {.fun browseURL} only suports one string.")
|
||||
warning_("in `av_url()`: only the first URL will be opened, as `browseURL()` only suports one string.")
|
||||
}
|
||||
if (!is.na(u[1L])) {
|
||||
utils::browseURL(u[1L])
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#' @details The function [format()] calculates the resistance per bug-drug combination and returns a table ready for reporting/publishing. Use `combine_SI = TRUE` (default) to test R vs. S+I and `combine_SI = FALSE` to test R+I vs. S. This table can also directly be used in R Markdown / Quarto without the need for e.g. [knitr::kable()].
|
||||
#' @export
|
||||
#' @rdname bug_drug_combinations
|
||||
#' @return The function [bug_drug_combinations()] returns a [data.frame] with columns "mo", "ab", "S", "SDD", "I", "R", "WT, "NWT", and "total".
|
||||
#' @return The function [bug_drug_combinations()] returns a [data.frame] with columns "mo", "ab", "S", "SDD", "I", "R", and "total".
|
||||
#' @examples
|
||||
#' # example_isolates is a data set available in the AMR package.
|
||||
#' # run ?example_isolates for more info.
|
||||
@@ -82,9 +82,9 @@ bug_drug_combinations <- function(x,
|
||||
# -- mo
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(x = x, type = "mo")
|
||||
stop_if(is.null(col_mo), "{.arg col_mo} must be set")
|
||||
stop_if(is.null(col_mo), "`col_mo` must be set")
|
||||
} else {
|
||||
stop_ifnot(col_mo %in% colnames(x), "column {.field ", font_bold(col_mo), "} ({.arg col_mo}) not found")
|
||||
stop_ifnot(col_mo %in% colnames(x), "column '", col_mo, "' (`col_mo`) not found")
|
||||
}
|
||||
|
||||
x.bak <- x
|
||||
@@ -111,8 +111,6 @@ bug_drug_combinations <- function(x,
|
||||
SDD = integer(0),
|
||||
I = integer(0),
|
||||
R = integer(0),
|
||||
WT = integer(0),
|
||||
NWT = integer(0),
|
||||
total = integer(0),
|
||||
total_rows = integer(0),
|
||||
stringsAsFactors = FALSE
|
||||
@@ -129,21 +127,13 @@ bug_drug_combinations <- function(x,
|
||||
# turn and merge everything
|
||||
pivot <- lapply(x_mo_filter, function(x) {
|
||||
m <- as.matrix(table(as.sir(x), useNA = "always"))
|
||||
na_idx <- which(is.na(rownames(m)))
|
||||
get_row <- function(lbl) {
|
||||
idx <- which(rownames(m) == lbl)
|
||||
if (length(idx) == 1L) unname(m[idx, ]) else rep(0L, ncol(m))
|
||||
}
|
||||
data.frame(
|
||||
S = get_row("S"),
|
||||
SDD = get_row("SDD"),
|
||||
I = get_row("I"),
|
||||
R = get_row("R"),
|
||||
NI = get_row("NI"),
|
||||
WT = get_row("WT"),
|
||||
NWT = get_row("NWT"),
|
||||
NS = get_row("NS"),
|
||||
na = if (length(na_idx) == 1L) unname(m[na_idx, ]) else rep(0L, ncol(m)),
|
||||
S = m["S", ],
|
||||
SDD = m["SDD", ],
|
||||
I = m["I", ],
|
||||
R = m["R", ],
|
||||
NI = m["NI", ],
|
||||
na = m[which(is.na(rownames(m))), ],
|
||||
stringsAsFactors = FALSE
|
||||
)
|
||||
})
|
||||
@@ -156,11 +146,8 @@ bug_drug_combinations <- function(x,
|
||||
I = merged$I,
|
||||
R = merged$R,
|
||||
NI = merged$NI,
|
||||
WT = merged$WT,
|
||||
NWT = merged$NWT,
|
||||
NS = merged$NS,
|
||||
total = merged$S + merged$SDD + merged$I + merged$R + merged$NI + merged$WT + merged$NWT + merged$NS,
|
||||
total_rows = merged$S + merged$SDD + merged$I + merged$R + merged$NI + merged$WT + merged$NWT + merged$NS + merged$na,
|
||||
total = merged$S + merged$SDD + merged$I + merged$R + merged$NI,
|
||||
total_rows = merged$S + merged$SDD + merged$I + merged$R + merged$NI + merged$na,
|
||||
stringsAsFactors = FALSE
|
||||
)
|
||||
if (data_has_groups) {
|
||||
@@ -231,7 +218,7 @@ format.bug_drug_combinations <- function(x,
|
||||
x.bak <- x
|
||||
if (inherits(x, "grouped")) {
|
||||
# bug_drug_combinations() has been run on groups, so de-group here
|
||||
warning_("in {.fun format}: formatting the output of {.fun bug_drug_combinations} does not support grouped variables, they were ignored")
|
||||
warning_("in `format()`: formatting the output of `bug_drug_combinations()` does not support grouped variables, they were ignored")
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
idx <- split(seq_len(nrow(x)), paste0(x$mo, "%%", x$ab))
|
||||
x <- data.frame(
|
||||
@@ -242,17 +229,12 @@ format.bug_drug_combinations <- function(x,
|
||||
I = vapply(FUN.VALUE = double(1), idx, function(i) sum(x$I[i], na.rm = TRUE)),
|
||||
R = vapply(FUN.VALUE = double(1), idx, function(i) sum(x$R[i], na.rm = TRUE)),
|
||||
NI = vapply(FUN.VALUE = double(1), idx, function(i) sum(x$NI[i], na.rm = TRUE)),
|
||||
WT = vapply(FUN.VALUE = double(1), idx, function(i) sum(x$WT[i], na.rm = TRUE)),
|
||||
NWT = vapply(FUN.VALUE = double(1), idx, function(i) sum(x$NWT[i], na.rm = TRUE)),
|
||||
NS = vapply(FUN.VALUE = double(1), idx, function(i) sum(x$NS[i], na.rm = TRUE)),
|
||||
total = vapply(FUN.VALUE = double(1), idx, function(i) {
|
||||
sum(x$S[i], na.rm = TRUE) +
|
||||
sum(x$SDD[i], na.rm = TRUE) +
|
||||
sum(x$I[i], na.rm = TRUE) +
|
||||
sum(x$R[i], na.rm = TRUE) +
|
||||
sum(x$WT[i], na.rm = TRUE) +
|
||||
sum(x$NWT[i], na.rm = TRUE) +
|
||||
sum(x$NS[i], na.rm = TRUE)
|
||||
sum(x$NI[i], na.rm = TRUE)
|
||||
}),
|
||||
stringsAsFactors = FALSE
|
||||
)
|
||||
@@ -264,10 +246,10 @@ format.bug_drug_combinations <- function(x,
|
||||
if (remove_intrinsic_resistant == TRUE) {
|
||||
x <- subset(x, R != total)
|
||||
}
|
||||
|
||||
x$isolates <- x$R + x$NWT
|
||||
if (combine_SI == TRUE) {
|
||||
x$isolates <- x$isolates + x$I + x$SDD
|
||||
x$isolates <- x$R
|
||||
} else {
|
||||
x$isolates <- x$R + x$I + x$SDD
|
||||
}
|
||||
|
||||
give_ab_name <- function(ab, format, language) {
|
||||
|
||||
57
R/count.R
57
R/count.R
@@ -33,16 +33,13 @@
|
||||
#'
|
||||
#' [count_resistant()] should be used to count resistant isolates, [count_susceptible()] should be used to count susceptible isolates.
|
||||
#' @param ... One or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with [as.sir()] if needed.
|
||||
#' @param guideline Either `"EUCAST"` (default) or `"CLSI"`. With EUCAST, the 'I' category will be considered as susceptible (see [EUCAST website](https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/definition-of-s-i-and-r/)), but with with CLSI, it will be considered resistant. Therefore:
|
||||
#' * EUCAST: [count_susceptible()] \eqn{= N_{S} + N_{I}}, [count_resistant()] \eqn{= N_{R}}
|
||||
#' * CLSI: [count_susceptible()] \eqn{= N_{S} + N_{SDD}}, [count_resistant()] \eqn{= N_{I} + N_{R}}
|
||||
#'
|
||||
#' You can also use e.g. [count_R()] or [count_S()] instead, to be explicit.
|
||||
#' @inheritParams proportion
|
||||
#' @inheritSection as.sir Interpretation of SIR
|
||||
#' @details These functions are meant to count isolates. Use the [resistance()]/[susceptibility()] functions to calculate microbial resistance/susceptibility.
|
||||
#'
|
||||
#' The function [n_sir()] is an alias of [count_all()]. They can be used to count all available isolates, i.e. where all input antimicrobials have an available result (S, I or R). Their use is equal to `dplyr`'s `n_distinct()`. Their function is equal to `count_susceptible(...) + count_resistant(...)`.
|
||||
#' The function [count_resistant()] is equal to the function [count_R()]. The function [count_susceptible()] is equal to the function [count_SI()].
|
||||
#'
|
||||
#' The function [n_sir()] is an alias of [count_all()]. They can be used to count all available isolates, i.e. where all input antimicrobials have an available result (S, I or R). Their use is equal to `n_distinct()`. Their function is equal to `count_susceptible(...) + count_resistant(...)`.
|
||||
#'
|
||||
#' The function [count_df()] takes any variable from `data` that has an [`sir`] class (created with [as.sir()]) and counts the number of S's, I's and R's. It also supports grouped variables. The function [sir_df()] works exactly like [count_df()], but adds the percentage of S, I and R.
|
||||
#' @inheritSection proportion Combination Therapy
|
||||
@@ -122,26 +119,10 @@
|
||||
#' count_df(translate = FALSE)
|
||||
#' }
|
||||
#' }
|
||||
count_resistant <- function(...,
|
||||
only_all_tested = FALSE,
|
||||
guideline = getOption("AMR_guideline", "EUCAST")) {
|
||||
# other arguments for meet_criteria are handled by sir_calc()
|
||||
if (guideline %like% "EUCAST") {
|
||||
guideline <- "EUCAST"
|
||||
} else if (guideline %like% "CLSI") {
|
||||
guideline <- "CLSI"
|
||||
}
|
||||
meet_criteria(guideline, allow_class = "character", is_in = c("EUCAST", "CLSI"), has_length = 1)
|
||||
if (is.null(getOption("AMR_guideline")) && missing(guideline) && message_not_thrown_before("count_resistant", "eucast_default", entire_session = TRUE)) {
|
||||
message_("{.help [{.fun count_resistant}](AMR::count_resistant)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic [AMR-options](AMR::AMR-options)}.")
|
||||
message_("This message will be shown once per session.")
|
||||
}
|
||||
count_resistant <- function(..., only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c(
|
||||
"R", "NWT", "NS",
|
||||
if (identical(guideline, "CLSI")) "I"
|
||||
),
|
||||
ab_result = "R",
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE
|
||||
),
|
||||
@@ -151,26 +132,10 @@ count_resistant <- function(...,
|
||||
|
||||
#' @rdname count
|
||||
#' @export
|
||||
count_susceptible <- function(...,
|
||||
only_all_tested = FALSE,
|
||||
guideline = getOption("AMR_guideline", "EUCAST")) {
|
||||
# other arguments for meet_criteria are handled by sir_calc()
|
||||
if (guideline %like% "EUCAST") {
|
||||
guideline <- "EUCAST"
|
||||
} else if (guideline %like% "CLSI") {
|
||||
guideline <- "CLSI"
|
||||
}
|
||||
meet_criteria(guideline, allow_class = "character", is_in = c("EUCAST", "CLSI"), has_length = 1)
|
||||
if (is.null(getOption("AMR_guideline")) && missing(guideline) && message_not_thrown_before("count_susceptible", "eucast_default", entire_session = TRUE)) {
|
||||
message_("{.help [{.fun count_susceptible}](AMR::count_susceptible)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic [AMR-options](AMR::AMR-options)}.")
|
||||
message_("This message will be shown once per session.")
|
||||
}
|
||||
count_susceptible <- function(..., only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c(
|
||||
"S", "SDD", "WT",
|
||||
if (identical(guideline, "EUCAST")) "I"
|
||||
),
|
||||
ab_result = c("S", "SDD", "I"),
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE
|
||||
),
|
||||
@@ -196,7 +161,7 @@ count_S <- function(..., only_all_tested = FALSE) {
|
||||
count_SI <- function(..., only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c("S", "SDD", "I", "WT"),
|
||||
ab_result = c("S", "SDD", "I"),
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE
|
||||
),
|
||||
@@ -222,7 +187,7 @@ count_I <- function(..., only_all_tested = FALSE) {
|
||||
count_IR <- function(..., only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c("I", "SDD", "R", "NWT"),
|
||||
ab_result = c("I", "SDD", "R"),
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE
|
||||
),
|
||||
@@ -235,7 +200,7 @@ count_IR <- function(..., only_all_tested = FALSE) {
|
||||
count_R <- function(..., only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c("R", "NWT", "NS"),
|
||||
ab_result = "R",
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE
|
||||
),
|
||||
@@ -248,7 +213,7 @@ count_R <- function(..., only_all_tested = FALSE) {
|
||||
count_all <- function(..., only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = VALID_SIR_LEVELS,
|
||||
ab_result = c("S", "SDD", "I", "R", "NI"),
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE
|
||||
),
|
||||
|
||||
@@ -155,7 +155,7 @@ add_custom_antimicrobials <- function(x) {
|
||||
|
||||
AMR_env$ab_previously_coerced <- AMR_env$ab_previously_coerced[which(!AMR_env$ab_previously_coerced$ab %in% c(x$ab, x$generalised_name) & !AMR_env$ab_previously_coerced$x %in% c(x$ab, x$generalised_name)), , drop = FALSE]
|
||||
class(AMR_env$AB_lookup$ab) <- c("ab", "character")
|
||||
message_("Added ", nr2char(nrow(x)), " record", ifelse(nrow(x) > 1, "s", ""), " to the internal {.code antimicrobials} data set.")
|
||||
message_("Added ", nr2char(nrow(x)), " record", ifelse(nrow(x) > 1, "s", ""), " to the internal `antimicrobials` data set.")
|
||||
}
|
||||
|
||||
#' @rdname add_custom_antimicrobials
|
||||
@@ -166,5 +166,5 @@ clear_custom_antimicrobials <- function() {
|
||||
n2 <- nrow(AMR_env$AB_lookup)
|
||||
AMR_env$custom_ab_codes <- character(0)
|
||||
AMR_env$ab_previously_coerced <- AMR_env$ab_previously_coerced[which(AMR_env$ab_previously_coerced$ab %in% AMR_env$AB_lookup$ab), , drop = FALSE]
|
||||
message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal {.help [antimicrobials](AMR::antimicrobials)} data set.")
|
||||
message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal `antimicrobials` data set.")
|
||||
}
|
||||
|
||||
@@ -27,27 +27,27 @@
|
||||
# how to conduct AMR data analysis: https://amr-for-r.org #
|
||||
# ==================================================================== #
|
||||
|
||||
#' Define Custom Interpretive Rules
|
||||
#' Define Custom EUCAST Rules
|
||||
#'
|
||||
#' Define custom interpretive rules for your organisation or specific analysis and use the output of this function in [interpretive_rules()].
|
||||
#' Define custom EUCAST rules for your organisation or specific analysis and use the output of this function in [eucast_rules()].
|
||||
#' @param ... Rules in [formula][base::tilde] notation, see below for instructions, and in *Examples*.
|
||||
#' @details
|
||||
#' Some organisations have their own adoption of interpretive rules. This function can be used to define custom rules to be used in the [interpretive_rules()] function.
|
||||
#' Some organisations have their own adoption of EUCAST rules. This function can be used to define custom EUCAST rules to be used in the [eucast_rules()] function.
|
||||
#'
|
||||
#' ### Basics
|
||||
#'
|
||||
#' If you are familiar with the [`case_when()`][dplyr::case_when()] function of the `dplyr` package, you will recognise the input method to set your own rules. Rules must be set using what \R considers to be the 'formula notation'. The rule itself is written *before* the tilde (`~`) and the consequence of the rule is written *after* the tilde:
|
||||
#'
|
||||
#' ```r
|
||||
#' x <- custom_interpretive_rules(TZP == "S" ~ aminopenicillins == "S",
|
||||
#' TZP == "R" ~ aminopenicillins == "R")
|
||||
#' x <- custom_eucast_rules(TZP == "S" ~ aminopenicillins == "S",
|
||||
#' TZP == "R" ~ aminopenicillins == "R")
|
||||
#' ```
|
||||
#'
|
||||
#' These are two custom interpretive rules: if TZP (piperacillin/tazobactam) is "S", all aminopenicillins (ampicillin and amoxicillin) must be made "S", and if TZP is "R", aminopenicillins must be made "R". These rules can also be printed to the console, so it is immediately clear how they work:
|
||||
#' These are two custom EUCAST rules: if TZP (piperacillin/tazobactam) is "S", all aminopenicillins (ampicillin and amoxicillin) must be made "S", and if TZP is "R", aminopenicillins must be made "R". These rules can also be printed to the console, so it is immediately clear how they work:
|
||||
#'
|
||||
#' ```r
|
||||
#' x
|
||||
#' #> A set of custom interpretive rules:
|
||||
#' #> A set of custom EUCAST rules:
|
||||
#' #>
|
||||
#' #> 1. If TZP is "S" then set to S :
|
||||
#' #> amoxicillin (AMX), ampicillin (AMP)
|
||||
@@ -68,11 +68,11 @@
|
||||
#' #> 1 Escherichia coli R S S
|
||||
#' #> 2 Klebsiella pneumoniae R S S
|
||||
#'
|
||||
#' interpretive_rules(df,
|
||||
#' rules = "custom",
|
||||
#' custom_rules = x,
|
||||
#' info = FALSE,
|
||||
#' overwrite = TRUE)
|
||||
#' eucast_rules(df,
|
||||
#' rules = "custom",
|
||||
#' custom_rules = x,
|
||||
#' info = FALSE,
|
||||
#' overwrite = TRUE)
|
||||
#' #> mo TZP ampi cipro
|
||||
#' #> 1 Escherichia coli R R S
|
||||
#' #> 2 Klebsiella pneumoniae R R S
|
||||
@@ -80,19 +80,19 @@
|
||||
#'
|
||||
#' ### Using taxonomic properties in rules
|
||||
#'
|
||||
#' There is one exception in columns used for the rules: all column names of the [microorganisms] data set can also be used, but do not have to exist in the data set. These column names are: `r vector_and(colnames(microorganisms), sort = FALSE, documentation = TRUE)`. Thus, this next example will work as well, despite the fact that the `df` data set does not contain a column `genus`:
|
||||
#' There is one exception in columns used for the rules: all column names of the [microorganisms] data set can also be used, but do not have to exist in the data set. These column names are: `r vector_and(colnames(microorganisms), sort = FALSE)`. Thus, this next example will work as well, despite the fact that the `df` data set does not contain a column `genus`:
|
||||
#'
|
||||
#' ```r
|
||||
#' y <- custom_interpretive_rules(
|
||||
#' y <- custom_eucast_rules(
|
||||
#' TZP == "S" & genus == "Klebsiella" ~ aminopenicillins == "S",
|
||||
#' TZP == "R" & genus == "Klebsiella" ~ aminopenicillins == "R"
|
||||
#' )
|
||||
#'
|
||||
#' interpretive_rules(df,
|
||||
#' rules = "custom",
|
||||
#' custom_rules = y,
|
||||
#' info = FALSE,
|
||||
#' overwrite = TRUE)
|
||||
#' eucast_rules(df,
|
||||
#' rules = "custom",
|
||||
#' custom_rules = y,
|
||||
#' info = FALSE,
|
||||
#' overwrite = TRUE)
|
||||
#' #> mo TZP ampi cipro
|
||||
#' #> 1 Escherichia coli R S S
|
||||
#' #> 2 Klebsiella pneumoniae R R S
|
||||
@@ -109,9 +109,9 @@
|
||||
#' Rules can also be applied to multiple antimicrobials and antimicrobial groups simultaneously. Use the `c()` function to combine multiple antimicrobials. For instance, the following example sets all aminopenicillins and ureidopenicillins to "R" if column TZP (piperacillin/tazobactam) is "R":
|
||||
#'
|
||||
#' ```r
|
||||
#' x <- custom_interpretive_rules(TZP == "R" ~ c(aminopenicillins, ureidopenicillins) == "R")
|
||||
#' x <- custom_eucast_rules(TZP == "R" ~ c(aminopenicillins, ureidopenicillins) == "R")
|
||||
#' x
|
||||
#' #> A set of custom interpretive rules:
|
||||
#' #> A set of custom EUCAST rules:
|
||||
#' #>
|
||||
#' #> 1. If TZP is "R" then set to "R":
|
||||
#' #> amoxicillin (AMX), ampicillin (AMP), azlocillin (AZL), mezlocillin (MEZ), piperacillin (PIP), piperacillin/tazobactam (TZP)
|
||||
@@ -123,7 +123,7 @@
|
||||
#' @returns A [list] containing the custom rules
|
||||
#' @export
|
||||
#' @examples
|
||||
#' x <- custom_interpretive_rules(
|
||||
#' x <- custom_eucast_rules(
|
||||
#' AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R",
|
||||
#' AMC == "I" & genus == "Klebsiella" ~ aminopenicillins == "I"
|
||||
#' )
|
||||
@@ -141,24 +141,24 @@
|
||||
#' # combine rule sets
|
||||
#' x2 <- c(
|
||||
#' x,
|
||||
#' custom_interpretive_rules(TZP == "R" ~ carbapenems == "R")
|
||||
#' custom_eucast_rules(TZP == "R" ~ carbapenems == "R")
|
||||
#' )
|
||||
#' x2
|
||||
custom_interpretive_rules <- function(...) {
|
||||
custom_eucast_rules <- function(...) {
|
||||
dots <- tryCatch(list(...),
|
||||
error = function(e) "error"
|
||||
)
|
||||
stop_if(
|
||||
identical(dots, "error"),
|
||||
"rules must be a valid formula inputs (e.g., using '~'), see {.help [{.fun custom_interpretive_rules}](AMR::custom_interpretive_rules)}"
|
||||
"rules must be a valid formula inputs (e.g., using '~'), see `?custom_eucast_rules`"
|
||||
)
|
||||
n_dots <- length(dots)
|
||||
stop_if(n_dots == 0, "no custom rules were set. Please read the documentation using {.help [{.fun custom_interpretive_rules}](AMR::custom_interpretive_rules)}.")
|
||||
stop_if(n_dots == 0, "no custom rules were set. Please read the documentation using `?custom_eucast_rules`.")
|
||||
out <- vector("list", n_dots)
|
||||
for (i in seq_len(n_dots)) {
|
||||
stop_ifnot(
|
||||
inherits(dots[[i]], "formula"),
|
||||
"rule ", i, " must be a valid formula input (e.g., using '~'), see {.help [{.fun custom_interpretive_rules}](AMR::custom_interpretive_rules)}"
|
||||
"rule ", i, " must be a valid formula input (e.g., using '~'), see `?custom_eucast_rules`"
|
||||
)
|
||||
|
||||
# Query
|
||||
@@ -180,7 +180,7 @@ custom_interpretive_rules <- function(...) {
|
||||
result <- dots[[i]][[3]]
|
||||
stop_ifnot(
|
||||
deparse(result) %like% "==",
|
||||
"the result of rule ", i, " (the part after the `~`) must contain `==`, such as in `... ~ ampicillin == \"R\"`, see {.help [{.fun custom_interpretive_rules}](AMR::custom_interpretive_rules)}"
|
||||
"the result of rule ", i, " (the part after the `~`) must contain `==`, such as in `... ~ ampicillin == \"R\"`, see `?custom_eucast_rules`"
|
||||
)
|
||||
result_group <- as.character(result)[[2]]
|
||||
result_group <- as.character(str2lang(result_group))
|
||||
@@ -220,8 +220,8 @@ custom_interpretive_rules <- function(...) {
|
||||
result_value <- as.character(result)[[3]]
|
||||
result_value[result_value == "NA"] <- NA
|
||||
stop_ifnot(
|
||||
result_value %in% c(VALID_SIR_LEVELS, NA),
|
||||
paste0("the resulting value of rule ", i, " must be either ", vector_or(c(VALID_SIR_LEVELS, NA), sort = FALSE))
|
||||
result_value %in% c("S", "SDD", "I", "R", "NI", NA),
|
||||
"the resulting value of rule ", i, " must be either \"S\", \"SDD\", \"I\", \"R\", \"NI\" or NA"
|
||||
)
|
||||
result_value <- as.sir(result_value)
|
||||
|
||||
@@ -230,13 +230,13 @@ custom_interpretive_rules <- function(...) {
|
||||
}
|
||||
|
||||
names(out) <- paste0("rule", seq_len(n_dots))
|
||||
set_clean_class(out, new_class = c("custom_interpretive_rules", "list"))
|
||||
set_clean_class(out, new_class = c("custom_eucast_rules", "list"))
|
||||
}
|
||||
|
||||
#' @method c custom_interpretive_rules
|
||||
#' @method c custom_eucast_rules
|
||||
#' @noRd
|
||||
#' @export
|
||||
c.custom_interpretive_rules <- function(x, ...) {
|
||||
c.custom_eucast_rules <- function(x, ...) {
|
||||
if (length(list(...)) == 0) {
|
||||
return(x)
|
||||
}
|
||||
@@ -245,21 +245,21 @@ c.custom_interpretive_rules <- function(x, ...) {
|
||||
out <- c(out, unclass(e))
|
||||
}
|
||||
names(out) <- paste0("rule", seq_len(length(out)))
|
||||
set_clean_class(out, new_class = c("custom_interpretive_rules", "list"))
|
||||
set_clean_class(out, new_class = c("custom_eucast_rules", "list"))
|
||||
}
|
||||
|
||||
#' @method as.list custom_interpretive_rules
|
||||
#' @method as.list custom_eucast_rules
|
||||
#' @noRd
|
||||
#' @export
|
||||
as.list.custom_interpretive_rules <- function(x, ...) {
|
||||
as.list.custom_eucast_rules <- function(x, ...) {
|
||||
c(x, ...)
|
||||
}
|
||||
|
||||
#' @method print custom_interpretive_rules
|
||||
#' @method print custom_eucast_rules
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.custom_interpretive_rules <- function(x, ...) {
|
||||
cat("A set of custom interpretive rules:\n")
|
||||
print.custom_eucast_rules <- function(x, ...) {
|
||||
cat("A set of custom EUCAST rules:\n")
|
||||
for (i in seq_len(length(x))) {
|
||||
rule <- x[[i]]
|
||||
rule$query <- format_custom_query_rule(rule$query)
|
||||
@@ -291,19 +291,3 @@ print.custom_interpretive_rules <- function(x, ...) {
|
||||
cat("\n ", rule_if, "\n", rule_then, "\n", sep = "")
|
||||
}
|
||||
}
|
||||
|
||||
# Backward-compat S3 dispatch for objects created with the old custom_eucast_rules() function
|
||||
#' @method c custom_eucast_rules
|
||||
#' @noRd
|
||||
#' @export
|
||||
c.custom_eucast_rules <- function(x, ...) c.custom_interpretive_rules(x, ...)
|
||||
|
||||
#' @method as.list custom_eucast_rules
|
||||
#' @noRd
|
||||
#' @export
|
||||
as.list.custom_eucast_rules <- function(x, ...) as.list.custom_interpretive_rules(x, ...)
|
||||
|
||||
#' @method print custom_eucast_rules
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.custom_eucast_rules <- function(x, ...) print.custom_interpretive_rules(x, ...)
|
||||
@@ -145,15 +145,15 @@ custom_mdro_guideline <- function(..., as_factor = TRUE) {
|
||||
)
|
||||
stop_if(
|
||||
identical(dots, "error"),
|
||||
"rules must be a valid formula inputs (e.g., using '~'), see {.help [{.fun mdro}](AMR::mdro)}"
|
||||
"rules must be a valid formula inputs (e.g., using '~'), see `?mdro`"
|
||||
)
|
||||
n_dots <- length(dots)
|
||||
stop_if(n_dots == 0, "no custom rules were set. Please read the documentation using {.help [{.fun mdro}](AMR::mdro)}.")
|
||||
stop_if(n_dots == 0, "no custom rules were set. Please read the documentation using `?mdro`.")
|
||||
out <- vector("list", n_dots)
|
||||
for (i in seq_len(n_dots)) {
|
||||
stop_ifnot(
|
||||
inherits(dots[[i]], "formula"),
|
||||
"rule ", i, " must be a valid formula input (e.g., using '~'), see {.help [{.fun mdro}](AMR::mdro)}"
|
||||
"rule ", i, " must be a valid formula input (e.g., using '~'), see `?mdro`"
|
||||
)
|
||||
|
||||
# Query
|
||||
@@ -202,7 +202,7 @@ c.custom_mdro_guideline <- function(x, ..., as_factor = NULL) {
|
||||
}
|
||||
for (g in list(...)) {
|
||||
stop_ifnot(inherits(g, "custom_mdro_guideline"),
|
||||
"for combining custom MDRO guidelines, all rules must be created with {.help [{.fun custom_mdro_guideline}](AMR::custom_mdro_guideline)}",
|
||||
"for combining custom MDRO guidelines, all rules must be created with `custom_mdro_guideline()`",
|
||||
call = FALSE
|
||||
)
|
||||
vals <- attributes(x)$values
|
||||
@@ -235,9 +235,9 @@ print.custom_mdro_guideline <- function(x, ...) {
|
||||
for (i in seq_len(length(x))) {
|
||||
rule <- x[[i]]
|
||||
rule$query <- format_custom_query_rule(rule$query)
|
||||
cat("\u00a0\u00a0", i, ". ", font_bold("If "), font_blue(rule$query), font_bold(" then: "), font_red(rule$value), "\n", sep = "")
|
||||
cat(" ", i, ". ", font_bold("If "), font_blue(rule$query), font_bold(" then: "), font_red(rule$value), "\n", sep = "")
|
||||
}
|
||||
cat("\u00a0\u00a0", i + 1, ". ", font_bold("Otherwise: "), font_red(paste0("Negative")), "\n", sep = "")
|
||||
cat(" ", i + 1, ". ", font_bold("Otherwise: "), font_red(paste0("Negative")), "\n", sep = "")
|
||||
cat("\nUnmatched rows will return ", font_red("NA"), ".\n", sep = "")
|
||||
if (isTRUE(attributes(x)$as_factor)) {
|
||||
cat("Results will be of class 'factor', with ordered levels: ", paste0(attributes(x)$values, collapse = " < "), "\n", sep = "")
|
||||
@@ -259,15 +259,16 @@ run_custom_mdro_guideline <- function(df, guideline, info) {
|
||||
}
|
||||
)
|
||||
if (identical(qry, "error")) {
|
||||
warning_("in {.help [{.fun custom_mdro_guideline}](AMR::custom_mdro_guideline)}: rule ", i,
|
||||
" ({.code ", as.character(guideline[[i]]$query), "}) was ignored because of this error message: ",
|
||||
warning_("in `custom_mdro_guideline()`: rule ", i,
|
||||
" (`", as.character(guideline[[i]]$query), "`) was ignored because of this error message: ",
|
||||
AMR_env$err_msg,
|
||||
call = FALSE
|
||||
call = FALSE,
|
||||
add_fn = font_red
|
||||
)
|
||||
next
|
||||
}
|
||||
stop_ifnot(is.logical(qry), "in {.help [{.fun custom_mdro_guideline}](AMR::custom_mdro_guideline)}: rule ", i, " ({.code ", guideline[[i]]$query,
|
||||
"}) must return {.code TRUE} or {.code FALSE}, not ",
|
||||
stop_ifnot(is.logical(qry), "in custom_mdro_guideline(): rule ", i, " (`", guideline[[i]]$query,
|
||||
"`) must return `TRUE` or `FALSE`, not ",
|
||||
format_class(class(qry), plural = FALSE),
|
||||
call = FALSE
|
||||
)
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
#' }
|
||||
add_custom_microorganisms <- function(x) {
|
||||
meet_criteria(x, allow_class = "data.frame")
|
||||
stop_ifnot("genus" %in% tolower(colnames(x)), "{.arg x} must contain column {.code genus}.")
|
||||
stop_ifnot("genus" %in% tolower(colnames(x)), paste0("`x` must contain column 'genus'."))
|
||||
|
||||
add_MO_lookup_to_AMR_env()
|
||||
|
||||
@@ -195,13 +195,11 @@ add_custom_microorganisms <- function(x) {
|
||||
if (!"fullname" %in% colnames(x)) {
|
||||
x$fullname <- trimws2(paste(x$genus, x$species, x$subspecies))
|
||||
}
|
||||
if (!"domain" %in% colnames(x)) x$domain <- ""
|
||||
if (!"kingdom" %in% colnames(x)) x$kingdom <- ""
|
||||
if (!"phylum" %in% colnames(x)) x$phylum <- ""
|
||||
if (!"class" %in% colnames(x)) x$class <- ""
|
||||
if (!"order" %in% colnames(x)) x$order <- ""
|
||||
if (!"family" %in% colnames(x)) x$family <- ""
|
||||
x$domain[is.na(x$domain)] <- ""
|
||||
x$kingdom[is.na(x$kingdom)] <- ""
|
||||
x$phylum[is.na(x$phylum)] <- ""
|
||||
x$class[is.na(x$class)] <- ""
|
||||
@@ -219,7 +217,6 @@ add_custom_microorganisms <- function(x) {
|
||||
|
||||
# fill in taxonomy based on genus
|
||||
genus_to_check <- gsub("^(.*)[^a-zA-Z].*", "\\1", x$genus, perl = TRUE)
|
||||
x$domain[which(x$domain == "" & genus_to_check != "")] <- AMR_env$MO_lookup$domain[match(genus_to_check[which(x$domain == "" & genus_to_check != "")], AMR_env$MO_lookup$genus)]
|
||||
x$kingdom[which(x$kingdom == "" & genus_to_check != "")] <- AMR_env$MO_lookup$kingdom[match(genus_to_check[which(x$kingdom == "" & genus_to_check != "")], AMR_env$MO_lookup$genus)]
|
||||
x$phylum[which(x$phylum == "" & genus_to_check != "")] <- AMR_env$MO_lookup$phylum[match(genus_to_check[which(x$phylum == "" & genus_to_check != "")], AMR_env$MO_lookup$genus)]
|
||||
x$class[which(x$class == "" & genus_to_check != "")] <- AMR_env$MO_lookup$class[match(genus_to_check[which(x$class == "" & genus_to_check != "")], AMR_env$MO_lookup$genus)]
|
||||
@@ -232,9 +229,9 @@ add_custom_microorganisms <- function(x) {
|
||||
x$prevalence[is.na(x$prevalence)] <- 1.25
|
||||
x$status <- "accepted"
|
||||
x$ref <- paste("Self-added,", format(Sys.Date(), "%Y"))
|
||||
x$domain_index <- AMR_env$MO_lookup$domain_index[match(genus_to_check, AMR_env$MO_lookup$genus)]
|
||||
# complete missing domain index, so mo_matching_score() will not return NA
|
||||
x$domain_index[is.na(x$domain_index)] <- 1
|
||||
x$kingdom_index <- AMR_env$MO_lookup$kingdom_index[match(genus_to_check, AMR_env$MO_lookup$genus)]
|
||||
# complete missing kingdom index, so mo_matching_score() will not return NA
|
||||
x$kingdom_index[is.na(x$kingdom_index)] <- 1
|
||||
x$fullname_lower <- tolower(x$fullname)
|
||||
x$full_first <- substr(x$fullname_lower, 1, 1)
|
||||
x$species_first <- tolower(substr(x$species, 1, 1))
|
||||
@@ -284,9 +281,9 @@ add_custom_microorganisms <- function(x) {
|
||||
AMR_env$MO_lookup <- unique(rbind_AMR(AMR_env$MO_lookup, new_df))
|
||||
class(AMR_env$MO_lookup$mo) <- c("mo", "character")
|
||||
if (nrow(x) <= 3) {
|
||||
message_("Added ", vector_and(italicise(x$fullname), quotes = FALSE), " to the internal {.code microorganisms} data set.")
|
||||
message_("Added ", vector_and(italicise(x$fullname), quotes = FALSE), " to the internal `microorganisms` data set.")
|
||||
} else {
|
||||
message_("Added ", nr2char(nrow(x)), " records to the internal {.code microorganisms} data set.")
|
||||
message_("Added ", nr2char(nrow(x)), " records to the internal `microorganisms` data set.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +303,7 @@ clear_custom_microorganisms <- function() {
|
||||
AMR_env$custom_mo_codes <- character(0)
|
||||
AMR_env$mo_previously_coerced <- AMR_env$mo_previously_coerced[which(AMR_env$mo_previously_coerced$mo %in% AMR_env$MO_lookup$mo), , drop = FALSE]
|
||||
AMR_env$mo_uncertainties <- AMR_env$mo_uncertainties[0, , drop = FALSE]
|
||||
message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal {.code microorganisms} data set.")
|
||||
message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal `microorganisms` data set.")
|
||||
}
|
||||
|
||||
abbreviate_mo <- function(x, minlength = 5, prefix = "", hyphen_as_space = FALSE, ...) {
|
||||
|
||||
53
R/data.R
53
R/data.R
@@ -38,7 +38,7 @@
|
||||
#' - `ab`\cr antimicrobial ID as used in this package (such as `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available. ***This is a unique identifier.***
|
||||
#' - `cid`\cr Compound ID as found in PubChem. ***This is a unique identifier.***
|
||||
#' - `name`\cr Official name as used by WHONET/EARS-Net or the WHO. ***This is a unique identifier.***
|
||||
#' - `group`\cr One or more short and concise group names, based on WHONET and WHOCC definitions
|
||||
#' - `group`\cr A short and concise group name, based on WHONET and WHOCC definitions
|
||||
#' - `atc`\cr ATC codes (Anatomical Therapeutic Chemical) as defined by the WHOCC, like `J01CR02` (last updated `r documentation_date(TAXONOMY_VERSION$ATC_DDD$accessed_date)`):
|
||||
#' - `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"`
|
||||
@@ -77,13 +77,13 @@
|
||||
#'
|
||||
#' Synonyms (i.e. trade names) were derived from the PubChem Compound ID (column `cid`) and are consequently only available where a CID is available.
|
||||
#' @inheritSection AMR Download Our Reference Data
|
||||
#' @references
|
||||
#' @source
|
||||
#'
|
||||
#' * `r TAXONOMY_VERSION$ATC_DDD$citation` Accessed from <`r TAXONOMY_VERSION$ATC_DDD$url`> on `r documentation_date(TAXONOMY_VERSION$ATC_DDD$accessed_date)`.
|
||||
#'
|
||||
#' * `r TAXONOMY_VERSION$LOINC$citation` Accessed from <`r TAXONOMY_VERSION$LOINC$url`> on `r documentation_date(TAXONOMY_VERSION$LOINC$accessed_date)`.
|
||||
#'
|
||||
#' * European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: <https://ec.europa.eu/health/documents/community-register/html/index_en.htm>
|
||||
#' * European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: <https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm>
|
||||
#' @inheritSection WHOCC WHOCC
|
||||
#' @seealso [microorganisms], [intrinsic_resistant]
|
||||
#' @examples
|
||||
@@ -100,19 +100,18 @@
|
||||
#' Data Set with `r format(nrow(microorganisms), big.mark = " ")` Taxonomic Records of Microorganisms
|
||||
#'
|
||||
#' @description
|
||||
#' A data set containing the full microbial taxonomy (**last updated: `r documentation_date(max(TAXONOMY_VERSION$GBIF$accessed_date, TAXONOMY_VERSION$LPSN$accessed_date, TAXONOMY_VERSION$MycoBank$accessed_date))`**) of `r nr2char(length(unique(microorganisms$domain[!microorganisms$domain %like% "unknown"])))` domains. This data set is the backbone of this `AMR` package. MO codes can be looked up using [as.mo()] and microorganism properties can be looked up using any of the [`mo_*`][mo_property()] functions.
|
||||
#' A data set containing the full microbial taxonomy (**last updated: `r documentation_date(max(TAXONOMY_VERSION$GBIF$accessed_date, TAXONOMY_VERSION$LPSN$accessed_date, TAXONOMY_VERSION$MycoBank$accessed_date))`**) of `r nr2char(length(unique(microorganisms$kingdom[!microorganisms$kingdom %like% "unknown"])))` kingdoms. This data set is the backbone of this `AMR` package. MO codes can be looked up using [as.mo()] and microorganism properties can be looked up using any of the [`mo_*`][mo_property()] functions.
|
||||
#'
|
||||
#' This data set is carefully crafted, yet made 100% reproducible from public and authoritative taxonomic sources (using [this script](https://github.com/msberends/AMR/blob/main/data-raw/_reproduction_scripts/reproduction_of_microorganisms.R)), namely: *`r TAXONOMY_VERSION$LPSN$name`* for bacteria, *`r TAXONOMY_VERSION$MycoBank$name`* for fungi, and *`r TAXONOMY_VERSION$GBIF$name`* for all others taxons.
|
||||
#' @format A [tibble][tibble::tibble] with `r format(nrow(microorganisms), big.mark = " ")` observations and `r ncol(microorganisms)` variables:
|
||||
#' - `mo`\cr ID of microorganism as used by this package. ***This is a unique identifier.***
|
||||
#' - `fullname`\cr Full name, like `"Escherichia coli"`. For the taxonomic ranks genus, species and subspecies, this is the 'pasted' text of genus, species, and subspecies. For all taxonomic ranks higher than genus, this is the name of the taxon. ***This is a unique identifier.***
|
||||
#' - `status` \cr Status of the taxon, either `r vector_or(microorganisms$status, documentation = TRUE)`
|
||||
#' - `domain`, `kingdom`, `phylum`, `class`, `order`, `family`, `genus`, `species`, `subspecies`\cr Taxonomic rank of the microorganism. Note that for fungi, *phylum* is used for their taxonomic *division*. Also, for fungi, *subkingdom* and *subdivision* were left out since they do not occur in the bacterial taxonomy. For all species outside the domains of Bacteria and Archaea, the `domain` and `kingdom` are identical.
|
||||
#' - `status` \cr Status of the taxon, either `r vector_or(microorganisms$status)`
|
||||
#' - `kingdom`, `phylum`, `class`, `order`, `family`, `genus`, `species`, `subspecies`\cr Taxonomic rank of the microorganism. Note that for fungi, *phylum* is equal to their taxonomic *division*. Also, for fungi, *subkingdom* and *subdivision* were left out since they do not occur in the bacterial taxonomy.
|
||||
#' - `rank`\cr Text of the taxonomic rank of the microorganism, such as `"species"` or `"genus"`
|
||||
#' - `ref`\cr Abbreviated authority citation for the nomenclatural act that established the current name combination, following ICNP conventions. For species described in their current genus (*sp. nov.*), this is the original description author(s) and year. For species transferred to a different genus (*comb. nov.*), this is the reclassification author(s) and year. Emendations are excluded. For synonyms, this is the authority under which the synonym was originally published. This field is directly retrieved from the source specified in the column `source`. Diacritics were removed to comply with CRAN, that only allows ASCII characters.
|
||||
#' - `oxygen_tolerance` \cr Oxygen tolerance, either `r vector_or(microorganisms$oxygen_tolerance, documentation = TRUE)`. These data were retrieved from BacDive (see *Source*). Items that contain "likely" are missing from BacDive and were extrapolated from other species within the same genus to guess the oxygen tolerance. Currently `r round(length(microorganisms$oxygen_tolerance[which(!is.na(microorganisms$oxygen_tolerance))]) / nrow(microorganisms[which(microorganisms$domain == "Bacteria"), ]) * 100, 1)`% of all `r format_included_data_number(nrow(microorganisms[which(microorganisms$domain == "Bacteria"), ]))` bacteria in the data set contain an oxygen tolerance.
|
||||
#' - `morphology` \cr Morphology (cell shape), either `r vector_or(microorganisms$morphology, documentation = TRUE)`. These data were retrieved from BacDive (see *Source*). Genera that are clinically established as coccobacilli (the HACEK group and beyond, such as *Haemophilus* and *Acinetobacter*) are classified as such regardless of BacDive majority vote. Items that contain "likely" are missing from BacDive and were extrapolated from other species within the same genus. Currently `r round(length(microorganisms$morphology[which(!is.na(microorganisms$morphology))]) / nrow(microorganisms[which(microorganisms$domain == "Bacteria"), ]) * 100, 1)`% of all `r format_included_data_number(nrow(microorganisms[which(microorganisms$domain == "Bacteria"), ]))` bacteria in the data set contain a morphology.
|
||||
#' - `source`\cr Either `r vector_or(microorganisms$source, documentation = TRUE)` (see *Source*)
|
||||
#' - `ref`\cr Author(s) and year of related scientific publication. This contains only the *first surname* and year of the *latest* authors, e.g. "Wallis *et al.* 2006 *emend.* Smith and Jones 2018" becomes "Smith *et al.*, 2018". This field is directly retrieved from the source specified in the column `source`. Moreover, accents were removed to comply with CRAN that only allows ASCII characters.
|
||||
#' - `oxygen_tolerance` \cr Oxygen tolerance, either `r vector_or(microorganisms$oxygen_tolerance)`. These data were retrieved from BacDive (see *Source*). Items that contain "likely" are missing from BacDive and were extrapolated from other species within the same genus to guess the oxygen tolerance. Currently `r round(length(microorganisms$oxygen_tolerance[which(!is.na(microorganisms$oxygen_tolerance))]) / nrow(microorganisms[which(microorganisms$kingdom == "Bacteria"), ]) * 100, 1)`% of all `r format_included_data_number(nrow(microorganisms[which(microorganisms$kingdom == "Bacteria"), ]))` bacteria in the data set contain an oxygen tolerance.
|
||||
#' - `source`\cr Either `r vector_or(microorganisms$source)` (see *Source*)
|
||||
#' - `lpsn`\cr Identifier ('Record number') of `r TAXONOMY_VERSION$LPSN$name`. This will be the first/highest LPSN identifier to keep one identifier per row. For example, *Acetobacter ascendens* has LPSN Record number 7864 and 11011. Only the first is available in the `microorganisms` data set. ***This is a unique identifier***, though available for only `r format_included_data_number(sum(!is.na(microorganisms$lpsn)))` records.
|
||||
#' - `lpsn_parent`\cr LPSN identifier of the parent taxon
|
||||
#' - `lpsn_renamed_to`\cr LPSN identifier of the currently valid taxon
|
||||
@@ -131,26 +130,27 @@
|
||||
#'
|
||||
#' @section Included Taxa:
|
||||
#' Included taxonomic data from [LPSN](`r TAXONOMY_VERSION$LPSN$url`), [MycoBank](`r TAXONOMY_VERSION$MycoBank$url`), and [GBIF](`r TAXONOMY_VERSION$GBIF$url`) are:
|
||||
#' - All `r format_included_data_number(microorganisms[which(microorganisms$domain %in% c("Archeae", "Bacteria")), , drop = FALSE])` (sub)species from the domains of Archaea and Bacteria
|
||||
#' - `r format_included_data_number(microorganisms[which(microorganisms$domain == "Fungi"), , drop = FALSE])` species from the kingdom of Fungi. 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. Only relevant fungi are covered (such as all species of *Aspergillus*, *Candida*, *Cryptococcus*, *Histoplasma*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*).
|
||||
#' - All `r format_included_data_number(microorganisms[which(microorganisms$kingdom %in% c("Archeae", "Bacteria")), , drop = FALSE])` (sub)species from the kingdoms of Archaea and Bacteria
|
||||
#' - `r format_included_data_number(microorganisms[which(microorganisms$kingdom == "Fungi"), , drop = FALSE])` species from the kingdom of Fungi. 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. Only relevant fungi are covered (such as all species of *Aspergillus*, *Candida*, *Cryptococcus*, *Histoplasma*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*).
|
||||
#' - `r format_included_data_number(microorganisms[which(microorganisms$kingdom == "Protozoa"), , drop = FALSE])` (sub)species from the kingdom of Protozoa
|
||||
#' - `r format_included_data_number(microorganisms[which(microorganisms$kingdom == "Animalia"), , drop = FALSE])` (sub)species from `r format_included_data_number(microorganisms[which(microorganisms$kingdom == "Animalia"), "genus", drop = TRUE])` other relevant genera from the kingdom of Animalia (such as *Strongyloides* and *Taenia*)
|
||||
#' - All `r format_included_data_number(microorganisms[which(microorganisms$status != "accepted"), , drop = FALSE])` previously accepted names of all included (sub)species (these were taxonomically renamed)
|
||||
#' - The complete taxonomic tree of all included (sub)species: from domain to subspecies
|
||||
#' - The complete taxonomic tree of all included (sub)species: from kingdom to subspecies
|
||||
#' - The identifier of the parent taxons
|
||||
#' - The year and first author of the related scientific publication
|
||||
#'
|
||||
#' ### Manual additions
|
||||
#' For convenience, some entries were added manually:
|
||||
#'
|
||||
#' - All `r format_included_data_number(length(which(microorganisms$rank == "species group")))` groups and complexes of the [microorganisms.groups] data set, for cross-reference (examples include beta-haemolytic *Streptococcus* groups A to K, coagulase-negative *Staphylococcus* (CoNS), *Mycobacterium tuberculosis* complex, etc.)
|
||||
#' - `r format_included_data_number(microorganisms[which(microorganisms$source == "manually added" & microorganisms$genus == "Salmonella"), , drop = FALSE])` entries of *Salmonella*, such as the city-like serovars and groups A to H
|
||||
#' - `r format_included_data_number(length(which(microorganisms$rank == "species group")))` species groups (such as the beta-haemolytic *Streptococcus* groups A to K, coagulase-negative *Staphylococcus* (CoNS), *Mycobacterium tuberculosis* complex, etc.), of which the group compositions are stored in the [microorganisms.groups] data set
|
||||
#' - 1 entry of *Blastocystis* (*B. hominis*), although it officially does not exist (Noel *et al.* 2005, PMID 15634993)
|
||||
#' - `r sum(microorganisms$fullname %like% "unknown")` other 'undefined' entries (unknown, unknown Gram-negatives, unknown Gram-positives, unknown yeast, unknown fungus, and unknown anaerobic Gram-pos/Gram-neg bacteria)
|
||||
#' - 1 entry of *Moraxella* (*M. catarrhalis*), which was formally named *Branhamella catarrhalis* (Catlin, 1970) though this change was never accepted within the field of clinical microbiology
|
||||
#' - 8 other 'undefined' entries (unknown, unknown Gram-negatives, unknown Gram-positives, unknown yeast, unknown fungus, and unknown anaerobic Gram-pos/Gram-neg bacteria)
|
||||
#'
|
||||
#' The syntax used to transform the original data to a cleansed \R format, can be [found here](https://github.com/msberends/AMR/blob/main/data-raw/_reproduction_scripts/reproduction_of_microorganisms.R).
|
||||
#' @inheritSection AMR Download Our Reference Data
|
||||
#' @references
|
||||
#' @source
|
||||
#' Taxonomic entries were imported in this order of importance:
|
||||
#' 1. `r TAXONOMY_VERSION$LPSN$name`:\cr\cr
|
||||
#' `r TAXONOMY_VERSION$LPSN$citation` Accessed from <`r TAXONOMY_VERSION$LPSN$url`> on `r documentation_date(TAXONOMY_VERSION$LPSN$accessed_date)`.
|
||||
@@ -222,8 +222,8 @@
|
||||
#' - `date`\cr Date of receipt at the laboratory
|
||||
#' - `patient`\cr ID of the patient
|
||||
#' - `age`\cr Age of the patient
|
||||
#' - `gender`\cr Gender of the patient, either `r vector_or(example_isolates$gender, documentation = TRUE)`
|
||||
#' - `ward`\cr Ward type where the patient was admitted, either `r vector_or(example_isolates$ward, documentation = TRUE)`
|
||||
#' - `gender`\cr Gender of the patient, either `r vector_or(example_isolates$gender)`
|
||||
#' - `ward`\cr Ward type where the patient was admitted, either `r vector_or(example_isolates$ward)`
|
||||
#' - `mo`\cr ID of microorganism created with [as.mo()], see also the [microorganisms] data set
|
||||
#' - `PEN:RIF`\cr `r sum(vapply(FUN.VALUE = logical(1), example_isolates, is.sir))` different antimicrobials with class [`sir`] (see [as.sir()]); these column names occur in the [antimicrobials] data set and can be translated with [set_ab_names()] or [ab_name()]
|
||||
#' @inheritSection AMR Download Our Reference Data
|
||||
@@ -282,7 +282,7 @@
|
||||
|
||||
#' Data Set with Clinical Breakpoints for SIR Interpretation
|
||||
#'
|
||||
#' @description Data set containing clinical breakpoints to interpret MIC and disk diffusion to SIR values, according to international guidelines. This data set contains breakpoints for humans, `r length(unique(clinical_breakpoints$host[!clinical_breakpoints$host %in% clinical_breakpoints$type]))` different animal groups, and ECOFFs.
|
||||
#' @description Data set containing clinical breakpoints to interpret MIC and disk diffusion to SIR values, according to international guidelines. This dataset contain breakpoints for humans, `r length(unique(clinical_breakpoints$host[!clinical_breakpoints$host %in% clinical_breakpoints$type]))` different animal groups, and ECOFFs.
|
||||
#'
|
||||
#' These breakpoints are currently implemented:
|
||||
#' - For **clinical microbiology**: EUCAST `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "EUCAST" & type == "human")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "EUCAST" & type == "human")$guideline)))` and CLSI `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "CLSI" & type == "human")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "CLSI" & type == "human")$guideline)))`;
|
||||
@@ -292,9 +292,9 @@
|
||||
#' Use [as.sir()] to transform MICs or disks measurements to SIR values.
|
||||
#' @format A [tibble][tibble::tibble] with `r format(nrow(clinical_breakpoints), big.mark = " ")` observations and `r ncol(clinical_breakpoints)` variables:
|
||||
#' - `guideline`\cr Name of the guideline
|
||||
#' - `type`\cr Breakpoint type, either `r vector_or(clinical_breakpoints$type, documentation = TRUE)`
|
||||
#' - `host`\cr Host of infectious agent. This is mostly useful for veterinary breakpoints and is either `r vector_or(clinical_breakpoints$host, documentation = TRUE)`
|
||||
#' - `method`\cr Testing method, either `r vector_or(clinical_breakpoints$method, documentation = TRUE)`
|
||||
#' - `type`\cr Breakpoint type, either `r vector_or(clinical_breakpoints$type)`
|
||||
#' - `host`\cr Host of infectious agent. This is mostly useful for veterinary breakpoints and is either `r vector_or(clinical_breakpoints$host)`
|
||||
#' - `method`\cr Testing method, either `r vector_or(clinical_breakpoints$method)`
|
||||
#' - `site`\cr Body site for which the breakpoint must be applied, e.g. "Oral" or "Respiratory"
|
||||
#' - `mo`\cr Microbial ID, see [as.mo()]
|
||||
#' - `rank_index`\cr Taxonomic rank index of `mo` from 1 (subspecies/infraspecies) to 5 (unknown microorganism)
|
||||
@@ -307,7 +307,7 @@
|
||||
#' - `is_SDD`\cr A [logical] value (`TRUE`/`FALSE`) to indicate whether the intermediate range between "S" and "R" should be interpreted as "SDD", instead of "I". This currently applies to `r sum(clinical_breakpoints$is_SDD)` breakpoints.
|
||||
#' @details
|
||||
#' ### Different Types of Breakpoints
|
||||
#' Supported types of breakpoints are `r vector_and(clinical_breakpoints$type, quotes = FALSE)`. ECOFF (Epidemiological cut-off) values are used in antimicrobial susceptibility testing to differentiate between wild-type and non-wild-type strains of bacteria or fungi.
|
||||
#' Supported types of breakpoints are `r vector_and(clinical_breakpoints$type, quote = FALSE)`. ECOFF (Epidemiological cut-off) values are used in antimicrobial susceptibility testing to differentiate between wild-type and non-wild-type strains of bacteria or fungi.
|
||||
#'
|
||||
#' The default is `"human"`, which can also be set with the package option [`AMR_breakpoint_type`][AMR-options]. Use [`as.sir(..., breakpoint_type = ...)`][as.sir()] to interpret raw data using a specific breakpoint type, e.g. `as.sir(..., breakpoint_type = "ECOFF")` to use ECOFFs.
|
||||
#'
|
||||
@@ -339,7 +339,6 @@
|
||||
#' This data set is internally used by:
|
||||
#' * [not_intrinsic_resistant()] (an [antimicrobial selector][antimicrobial_selectors])
|
||||
#' * [mo_is_intrinsic_resistant()]
|
||||
#' * [wisca()] to model \eqn{\beta(1, 9999)} for resistant bug-drug combinations, per \doi{10.1093/jac/dkv397}
|
||||
#' @inheritSection AMR Download Our Reference Data
|
||||
#' @examples
|
||||
#' intrinsic_resistant
|
||||
@@ -351,10 +350,10 @@
|
||||
#' @format A [tibble][tibble::tibble] with `r format(nrow(dosage), big.mark = " ")` observations and `r ncol(dosage)` variables:
|
||||
#' - `ab`\cr Antimicrobial ID as used in this package (such as `AMC`), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available
|
||||
#' - `name`\cr Official name of the antimicrobial drug as used by WHONET/EARS-Net or the WHO
|
||||
#' - `type`\cr Type of the dosage, either `r vector_or(dosage$type, documentation = TRUE)`
|
||||
#' - `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, documentation = TRUE)`
|
||||
#' - `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, either `r vector_or(dosage$eucast_version, quotes = FALSE, sort = TRUE, reverse = TRUE)`
|
||||
@@ -369,7 +368,7 @@
|
||||
#' @format A [tibble][tibble::tibble] with `r format(nrow(esbl_isolates), big.mark = " ")` observations and `r ncol(esbl_isolates)` variables:
|
||||
#' - `esbl`\cr Logical indicator if the isolate is ESBL-producing
|
||||
#' - `genus`\cr Genus of the microorganism
|
||||
#' - `AMC:COL`\cr MIC values for 17 antimicrobial drugs, transformed to class [`mic`] (see [as.mic()])
|
||||
#' - `AMC:COL`\cr MIC values for 17 antimicrobial agents, transformed to class [`mic`] (see [as.mic()])
|
||||
#' @details See our [tidymodels integration][amr-tidymodels] for an example using this data set.
|
||||
#' @examples
|
||||
#' esbl_isolates
|
||||
|
||||
65
R/disk.R
65
R/disk.R
@@ -83,31 +83,34 @@ as.disk <- function(x, na.rm = FALSE) {
|
||||
|
||||
na_before <- length(x[is.na(x)])
|
||||
|
||||
# extract a plausible numeric disk zone value from character input
|
||||
extract_disk_value <- function(x) {
|
||||
x <- as.character(x)
|
||||
# normalise decimal separators
|
||||
# heavily based on cleaner::clean_double():
|
||||
clean_double2 <- function(x, remove = "[^0-9.,-]", fixed = FALSE) {
|
||||
x <- gsub(",", ".", x, fixed = TRUE)
|
||||
# strip known context: leading/trailing whitespace, SIR interpretations,
|
||||
# comparison operators, semicolons, and surrounding whitespace
|
||||
x <- trimws(x)
|
||||
# remove trailing SIR interpretation (e.g., "42; S", "28 R")
|
||||
x <- gsub("[;[:space:]]+[SIRsir]$", "", x)
|
||||
# remove leading comparison operators (e.g., ">=20", "<=6")
|
||||
x <- gsub("^[<>=]+\\s*", "", x)
|
||||
x <- trimws(x)
|
||||
# now the remainder must be a plausible standalone number
|
||||
out <- rep(NA_real_, length(x))
|
||||
is_numeric <- grepl("^[0-9]+\\.?[0-9]*$", x)
|
||||
out[is_numeric] <- as.double(x[is_numeric])
|
||||
out
|
||||
# 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.double(gsub("[^0-9.]+", "", x_clean))
|
||||
}
|
||||
|
||||
# round up and coerce to integer
|
||||
x <- as.integer(ceiling(extract_disk_value(x)))
|
||||
# valid disk diffusion zones: 0-50 mm
|
||||
x[x < 0 | x > 50] <- NA_integer_
|
||||
# round up and make it an integer
|
||||
x <- as.integer(ceiling(clean_double2(x)))
|
||||
|
||||
# disks can never be less than 0 mm or more than 50 mm
|
||||
x[x < 0 | x > 99] <- NA_integer_
|
||||
x[x > 50] <- 50L
|
||||
na_after <- length(x[is.na(x)])
|
||||
|
||||
if (na_before != na_after) {
|
||||
@@ -116,9 +119,9 @@ as.disk <- function(x, na.rm = FALSE) {
|
||||
sort() %pm>%
|
||||
vector_and(quotes = TRUE)
|
||||
cur_col <- get_current_column()
|
||||
warning_("in {.help [{.fun as.disk}](AMR::as.disk)}: ", na_after - na_before, " result",
|
||||
warning_("in `as.disk()`: ", na_after - na_before, " result",
|
||||
ifelse(na_after - na_before > 1, "s", ""),
|
||||
ifelse(is.null(cur_col), "", paste0(" in column {.field ", font_bold(cur_col, collapse = NULL), "}")),
|
||||
ifelse(is.null(cur_col), "", paste0(" in index '", cur_col, "'")),
|
||||
" truncated (",
|
||||
round(((na_after - na_before) / length(x)) * 100),
|
||||
"%) that were invalid disk zones: ",
|
||||
@@ -159,7 +162,7 @@ is.disk <- function(x) {
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(pillar::pillar_shaft, disk)
|
||||
pillar_shaft.disk <- function(x, ...) {
|
||||
out <- trimws(format(x))
|
||||
out[is.na(x)] <- pillar::style_na(NA)
|
||||
out[is.na(x)] <- font_na(NA)
|
||||
create_pillar_column(out, align = "right", width = 2)
|
||||
}
|
||||
|
||||
@@ -167,7 +170,7 @@ pillar_shaft.disk <- function(x, ...) {
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.disk <- function(x, ...) {
|
||||
cat(format_inline_("Class {.cls disk}\n"))
|
||||
cat("Class 'disk'\n")
|
||||
print(as.integer(x), quote = FALSE)
|
||||
}
|
||||
|
||||
@@ -233,14 +236,12 @@ rep.disk <- function(x, ...) {
|
||||
# this prevents the requirement for putting the dependency in Imports:
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(skimr::get_skimmers, disk)
|
||||
get_skimmers.disk <- function(column) {
|
||||
column <- as.integer(column)
|
||||
skimr::sfl(
|
||||
skim_type = "disk",
|
||||
p0 = ~ stats::quantile(column, probs = 0, na.rm = TRUE, names = FALSE),
|
||||
p25 = ~ stats::quantile(column, probs = 0.25, na.rm = TRUE, names = FALSE),
|
||||
p50 = ~ stats::quantile(column, probs = 0.5, na.rm = TRUE, names = FALSE),
|
||||
p75 = ~ stats::quantile(column, probs = 0.75, na.rm = TRUE, names = FALSE),
|
||||
p100 = ~ stats::quantile(column, probs = 1, na.rm = TRUE, names = FALSE),
|
||||
hist = ~ skimr::inline_hist(stats::na.omit(column), 10)
|
||||
min = ~ min(as.double(.), na.rm = TRUE),
|
||||
max = ~ max(as.double(.), na.rm = TRUE),
|
||||
median = ~ stats::median(as.double(.), na.rm = TRUE),
|
||||
n_unique = ~ length(unique(stats::na.omit(.))),
|
||||
hist = ~ skimr::inline_hist(stats::na.omit(as.double(.)))
|
||||
)
|
||||
}
|
||||
|
||||
@@ -53,44 +53,42 @@ format_eucast_version_nr <- function(version, markdown = TRUE) {
|
||||
vector_and(txt, quotes = FALSE)
|
||||
}
|
||||
|
||||
#' Apply Interpretive Rules
|
||||
#' Apply EUCAST Rules
|
||||
#'
|
||||
#' @description
|
||||
#' Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by e.g. the European Committee on Antimicrobial Susceptibility Testing (EUCAST, <https://www.eucast.org>), see *Source*. Use [eucast_dosage()] to get a [data.frame] with advised dosages of a certain bug-drug combination, which is based on the [dosage] data set.
|
||||
#' Apply rules from clinical breakpoints notes and expected resistant phenotypes as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, <https://www.eucast.org>), see *Source*. Use [eucast_dosage()] to get a [data.frame] with advised dosages of a certain bug-drug combination, which is based on the [dosage] data set.
|
||||
#'
|
||||
#' To improve the interpretation of the antibiogram before CLSI/EUCAST interpretive rules are applied, some AMR-specific rules can be applied at default, see *Details*.
|
||||
#' To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see *Details*.
|
||||
#' @param x A data set with antimicrobials columns, such as `amox`, `AMX` and `AMC`.
|
||||
#' @param info A [logical] to indicate whether progress should be printed to the console - the default is only print while in interactive sessions.
|
||||
#' @param guideline A guideline name, either "EUCAST" (default) or "CLSI". This can be set with the package option [`AMR_guideline`][AMR-options].
|
||||
#' @param rules A [character] vector that specifies which rules should be applied. Must be one or more of `"breakpoints"`, `"expected_phenotypes"`, `"expert"`, `"other"`, `"custom"`, `"all"`, and defaults to `c("breakpoints", "expected_phenotypes")`. The default value can be set to another value using the package option [`AMR_interpretive_rules`][AMR-options]: `options(AMR_interpretive_rules = "all")`. If using `"custom"`, be sure to fill in argument `custom_rules` too. Custom rules can be created with [custom_interpretive_rules()].
|
||||
#' @param rules A [character] vector that specifies which rules should be applied. Must be one or more of `"breakpoints"`, `"expected_phenotypes"`, `"expert"`, `"other"`, `"custom"`, `"all"`, and defaults to `c("breakpoints", "expected_phenotypes")`. The default value can be set to another value using the package option [`AMR_eucastrules`][AMR-options]: `options(AMR_eucastrules = "all")`. If using `"custom"`, be sure to fill in argument `custom_rules` too. Custom rules can be created with [custom_eucast_rules()].
|
||||
#' @param verbose A [logical] to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way. Using Verbose mode takes a lot more time.
|
||||
#' @param version_breakpoints The version number to use for the EUCAST Clinical Breakpoints guideline. Can be `r vector_or(names(EUCAST_VERSION_BREAKPOINTS), documentation = TRUE, reverse = TRUE)`.
|
||||
#' @param version_expected_phenotypes The version number to use for the EUCAST Expected Phenotypes. Can be `r vector_or(names(EUCAST_VERSION_EXPECTED_PHENOTYPES), documentation = TRUE, reverse = TRUE)`.
|
||||
#' @param version_expertrules The version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be `r vector_or(names(EUCAST_VERSION_EXPERT_RULES), documentation = TRUE, reverse = TRUE)`.
|
||||
#' @param ampc_cephalosporin_resistance (only applies when `rules` contains `"expert"` or `"all"`) a [character] value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants - the default is `NA`. Currently only works when `version_expertrules` is `3.2` and higher; these versions of '*EUCAST Expert Rules on Enterobacterales*' state that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three drugs. A value of `NA` (the default) for this argument will remove results for these three drugs, while e.g. a value of `"R"` will make the results for these drugs resistant. Use `NULL` or `FALSE` to not alter results for these three drugs of AmpC de-repressed cephalosporin-resistant mutants. Using `TRUE` is equal to using `"R"`. \cr For *EUCAST Expert Rules* v3.2, this rule applies to: `r vector_and(gsub("[^a-zA-Z ]+", "", unlist(strsplit(INTERPRETIVE_RULES_DF[which(INTERPRETIVE_RULES_DF$reference.version %in% c(3.2, 3.3) & INTERPRETIVE_RULES_DF$reference.rule %like% "ampc"), "this_value"][1], "|", fixed = TRUE))), quotes = "*")`.
|
||||
#' @param version_breakpoints The version number to use for the EUCAST Clinical Breakpoints guideline. Can be `r vector_or(names(EUCAST_VERSION_BREAKPOINTS), reverse = TRUE)`.
|
||||
#' @param version_expected_phenotypes The version number to use for the EUCAST Expected Phenotypes. Can be `r vector_or(names(EUCAST_VERSION_EXPECTED_PHENOTYPES), reverse = TRUE)`.
|
||||
#' @param version_expertrules The version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be `r vector_or(names(EUCAST_VERSION_EXPERT_RULES), reverse = TRUE)`.
|
||||
#' @param ampc_cephalosporin_resistance (only applies when `rules` contains `"expert"` or `"all"`) a [character] value that should be applied to cefotaxime, ceftriaxone and ceftazidime for AmpC de-repressed cephalosporin-resistant mutants - the default is `NA`. Currently only works when `version_expertrules` is `3.2` and higher; these versions of '*EUCAST Expert Rules on Enterobacterales*' state that results of cefotaxime, ceftriaxone and ceftazidime should be reported with a note, or results should be suppressed (emptied) for these three drugs. A value of `NA` (the default) for this argument will remove results for these three drugs, while e.g. a value of `"R"` will make the results for these drugs resistant. Use `NULL` or `FALSE` to not alter results for these three drugs of AmpC de-repressed cephalosporin-resistant mutants. Using `TRUE` is equal to using `"R"`. \cr For *EUCAST Expert Rules* v3.2, this rule applies to: `r vector_and(gsub("[^a-zA-Z ]+", "", unlist(strsplit(EUCAST_RULES_DF[which(EUCAST_RULES_DF$reference.version %in% c(3.2, 3.3) & EUCAST_RULES_DF$reference.rule %like% "ampc"), "this_value"][1], "|", fixed = TRUE))), quotes = "*")`.
|
||||
#' @param ... Column names of antimicrobials. To automatically detect antimicrobial column names, do not provide any named arguments; [guess_ab_col()] will then be used for detection. To manually specify a column, provide its name (case-insensitive) as an argument, e.g. `AMX = "amoxicillin"`. To skip a specific antimicrobial, set it to `NULL`, e.g. `TIC = NULL` to exclude ticarcillin. If a manually defined column does not exist in the data, it will be skipped with a warning.
|
||||
#' @param ab Any (vector of) text that can be coerced to a valid antimicrobial drug code with [as.ab()].
|
||||
#' @param administration Route of administration, either `r vector_or(dosage$administration, documentation = TRUE)`.
|
||||
#' @param administration Route of administration, either `r vector_or(dosage$administration)`.
|
||||
#' @param only_sir_columns A [logical] to indicate whether only antimicrobial columns must be included that were transformed to class [sir][as.sir()] on beforehand. Defaults to `FALSE` if no columns of `x` have a class [sir][as.sir()].
|
||||
#' @param custom_rules Custom rules to apply, created with [custom_interpretive_rules()].
|
||||
#' @param custom_rules Custom rules to apply, created with [custom_eucast_rules()].
|
||||
#' @param overwrite A [logical] indicating whether to overwrite existing SIR values (default: `FALSE`). When `FALSE`, only non-SIR values are modified (i.e., any value that is not already S, I or R). To ensure compliance with EUCAST guidelines, **this should remain** `FALSE`, as EUCAST notes often state that an organism "should be tested for susceptibility to individual agents or be reported resistant".
|
||||
#' @param add_if_missing A [logical] indicating whether rules should also be applied to missing (`NA`) values (default: `TRUE`). When `FALSE`, rules are only applied to cells that already contain an SIR value; cells with `NA` are left untouched. This is particularly useful when using `overwrite = TRUE` with custom rules and you want to update reported results without imputing values for untested drugs.
|
||||
#' @inheritParams first_isolate
|
||||
#' @details
|
||||
#' **Note:** This function does not translate MIC or disk values to SIR values. Use [as.sir()] for that. \cr
|
||||
#' **Note:** This function does not translate MIC values to SIR values. Use [as.sir()] for that. \cr
|
||||
#' **Note:** When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance. \cr
|
||||
#'
|
||||
#' The file containing all interpretive rules is located here: <https://github.com/msberends/AMR/blob/main/data-raw/interpretive_rules.tsv>. **Note:** Old taxonomic names are replaced with the current taxonomy where applicable. For example, *Ochrobactrum anthropi* was renamed to *Brucella anthropi* in 2020; the original EUCAST rules v3.1 and v3.2 did not yet contain this new taxonomic name. The `AMR` package contains the full microbial taxonomy updated until `r documentation_date(max(TAXONOMY_VERSION$GBIF$accessed_date, TAXONOMY_VERSION$LPSN$accessed_date))`, see [microorganisms].
|
||||
#' The file containing all EUCAST rules is located here: <https://github.com/msberends/AMR/blob/main/data-raw/eucast_rules.tsv>. **Note:** Old taxonomic names are replaced with the current taxonomy where applicable. For example, *Ochrobactrum anthropi* was renamed to *Brucella anthropi* in 2020; the original EUCAST rules v3.1 and v3.2 did not yet contain this new taxonomic name. The `AMR` package contains the full microbial taxonomy updated until `r documentation_date(max(TAXONOMY_VERSION$GBIF$accessed_date, TAXONOMY_VERSION$LPSN$accessed_date))`, see [microorganisms].
|
||||
#'
|
||||
#' ### Custom Rules
|
||||
#'
|
||||
#' Custom rules can be created using [custom_interpretive_rules()], e.g.:
|
||||
#' Custom rules can be created using [custom_eucast_rules()], e.g.:
|
||||
#'
|
||||
#' ```r
|
||||
#' x <- custom_interpretive_rules(AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R",
|
||||
#' AMC == "I" & genus == "Klebsiella" ~ aminopenicillins == "I")
|
||||
#' x <- custom_eucast_rules(AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R",
|
||||
#' AMC == "I" & genus == "Klebsiella" ~ aminopenicillins == "I")
|
||||
#'
|
||||
#' interpretive_rules(example_isolates, rules = "custom", custom_rules = x)
|
||||
#' eucast_rules(example_isolates, rules = "custom", custom_rules = x)
|
||||
#' ```
|
||||
#'
|
||||
#' ### 'Other' Rules
|
||||
@@ -102,16 +100,21 @@ format_eucast_version_nr <- function(version, markdown = TRUE) {
|
||||
#'
|
||||
#' Important examples include amoxicillin and amoxicillin/clavulanic acid, and trimethoprim and trimethoprim/sulfamethoxazole. Needless to say, for these rules to work, both drugs must be available in the data set.
|
||||
#'
|
||||
#' Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include `"other"` to the `rules` argument, or use `interpretive_rules(..., rules = "all")`. You can also set the package option [`AMR_interpretive_rules`][AMR-options], i.e. run `options(AMR_interpretive_rules = "all")`.
|
||||
#' Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include `"other"` to the `rules` argument, or use `eucast_rules(..., rules = "all")`. You can also set the package option [`AMR_eucastrules`][AMR-options], i.e. run `options(AMR_eucastrules = "all")`.
|
||||
#' @aliases EUCAST
|
||||
#' @rdname interpretive_rules
|
||||
#' @rdname eucast_rules
|
||||
#' @export
|
||||
#' @return The input of `x`, possibly with edited values of antimicrobials. Or, if `verbose = TRUE`, a [data.frame] with all original and new values of the affected bug-drug combinations.
|
||||
#' @references
|
||||
#' @source
|
||||
#' - EUCAST Expert Rules. Version 2.0, 2012.\cr
|
||||
#' Leclercq et al. **EUCAST expert rules in antimicrobial susceptibility testing.** *Clin Microbiol Infect.* 2013;19(2):141-60; \doi{https://doi.org/10.1111/j.1469-0691.2011.03703.x}
|
||||
#' - EUCAST Expected Phenotypes. [(link)](https://www.eucast.org/bacteria/important-additional-information/expected-phenotypes/)
|
||||
#' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. [(link)](https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/)
|
||||
#' - EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf)
|
||||
#' - EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.2, 2020. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf)
|
||||
#' - EUCAST Intrinsic Resistance and Unusual Phenotypes. Version 3.3, 2021. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2021/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.3_20211018.pdf)
|
||||
#' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx)
|
||||
#' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 10.0, 2020. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_10.0_Breakpoint_Tables.xlsx)
|
||||
#' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 11.0, 2021. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_11.0_Breakpoint_Tables.xlsx)
|
||||
#' - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 12.0, 2022. [(link)](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_12.0_Breakpoint_Tables.xlsx)
|
||||
#' @inheritSection AMR Download Our Reference Data
|
||||
#' @examples
|
||||
#' \donttest{
|
||||
@@ -153,29 +156,21 @@ format_eucast_version_nr <- function(version, markdown = TRUE) {
|
||||
#' eucast_dosage(c("tobra", "genta", "cipro"), "iv")
|
||||
#'
|
||||
#' eucast_dosage(c("tobra", "genta", "cipro"), "iv", version_breakpoints = 10)
|
||||
interpretive_rules <- function(x,
|
||||
col_mo = NULL,
|
||||
info = interactive(),
|
||||
rules = getOption("AMR_interpretive_rules", default = c("breakpoints", "expected_phenotypes")),
|
||||
guideline = getOption("AMR_guideline", "EUCAST"),
|
||||
verbose = FALSE,
|
||||
version_breakpoints = 16.0,
|
||||
version_expected_phenotypes = 1.2,
|
||||
version_expertrules = 3.3,
|
||||
ampc_cephalosporin_resistance = NA,
|
||||
only_sir_columns = any(is.sir(x)),
|
||||
custom_rules = NULL,
|
||||
overwrite = FALSE,
|
||||
add_if_missing = TRUE,
|
||||
...) {
|
||||
eucast_rules <- function(x,
|
||||
col_mo = NULL,
|
||||
info = interactive(),
|
||||
rules = getOption("AMR_eucastrules", default = c("breakpoints", "expected_phenotypes")),
|
||||
verbose = FALSE,
|
||||
version_breakpoints = 15.0,
|
||||
version_expected_phenotypes = 1.2,
|
||||
version_expertrules = 3.3,
|
||||
ampc_cephalosporin_resistance = NA,
|
||||
only_sir_columns = any(is.sir(x)),
|
||||
custom_rules = NULL,
|
||||
overwrite = FALSE,
|
||||
...) {
|
||||
meet_criteria(x, allow_class = "data.frame")
|
||||
meet_criteria(col_mo, allow_class = "character", has_length = 1, is_in = colnames(x), allow_NULL = TRUE)
|
||||
if (guideline %like% "EUCAST") {
|
||||
guideline <- "EUCAST"
|
||||
} else if (guideline %like% "CLSI") {
|
||||
guideline <- "CLSI"
|
||||
}
|
||||
meet_criteria(guideline, allow_class = "character", has_length = 1, is_in = c("EUCAST", "CLSI"))
|
||||
meet_criteria(info, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(rules, allow_class = "character", has_length = c(1, 2, 3, 4, 5, 6), is_in = c("breakpoints", "expected_phenotypes", "expert", "other", "all", "custom"))
|
||||
meet_criteria(verbose, allow_class = "logical", has_length = 1)
|
||||
@@ -184,30 +179,24 @@ interpretive_rules <- function(x,
|
||||
meet_criteria(version_expertrules, allow_class = c("numeric", "integer"), has_length = 1, is_in = as.double(names(EUCAST_VERSION_EXPERT_RULES)))
|
||||
meet_criteria(ampc_cephalosporin_resistance, allow_class = c("logical", "character", "sir"), has_length = 1, allow_NA = TRUE, allow_NULL = TRUE)
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(custom_rules, allow_class = c("custom_interpretive_rules", "custom_eucast_rules"), allow_NULL = TRUE)
|
||||
meet_criteria(custom_rules, allow_class = "custom_eucast_rules", allow_NULL = TRUE)
|
||||
meet_criteria(overwrite, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(add_if_missing, allow_class = "logical", has_length = 1)
|
||||
|
||||
stop_if(
|
||||
!overwrite && !add_if_missing,
|
||||
"Either set {.arg overwrite} or {.arg add_if_missing} to {.code TRUE}, or both."
|
||||
)
|
||||
|
||||
stop_if(
|
||||
!is.na(ampc_cephalosporin_resistance) && !any(c("expert", "all") %in% rules),
|
||||
"For the {.arg ampc_cephalosporin_resistance} argument to work, the {.arg rules} argument must contain {.code \"expert\"} or {.code \"all\"}."
|
||||
"For the `ampc_cephalosporin_resistance` argument to work, the `rules` argument must contain `\"expert\"` or `\"all\"`."
|
||||
)
|
||||
|
||||
add_MO_lookup_to_AMR_env()
|
||||
|
||||
if ("custom" %in% rules && is.null(custom_rules)) {
|
||||
warning_("in {.help [{.fun interpretive_rules}](AMR::interpretive_rules)}: no custom rules were set with the {.arg custom_rules} argument",
|
||||
warning_("in `eucast_rules()`: no custom rules were set with the `custom_rules` argument",
|
||||
immediate = TRUE
|
||||
)
|
||||
rules <- rules[rules != "custom"]
|
||||
if (length(rules) == 0) {
|
||||
if (isTRUE(info)) {
|
||||
message_("No other rules were set, returning original data", as_note = FALSE)
|
||||
message_("No other rules were set, returning original data", add_fn = font_red, as_note = FALSE)
|
||||
}
|
||||
return(x)
|
||||
}
|
||||
@@ -224,18 +213,18 @@ interpretive_rules <- function(x,
|
||||
|
||||
if (interactive() && isTRUE(verbose) && isTRUE(info)) {
|
||||
txt <- paste0(
|
||||
"WARNING: In Verbose mode, the interpretive_rules() function does not apply rules to the data, but instead returns a data set in logbook form with comprehensive info about which rows and columns would be effected and in which way.",
|
||||
"WARNING: In Verbose mode, the eucast_rules() function does not apply rules to the data, but instead returns a data set in logbook form with comprehensive info about which rows and columns would be effected and in which way.",
|
||||
"\n\nThis may overwrite your existing data if you use e.g.:",
|
||||
"\ndata <- interpretive_rules(data, verbose = TRUE)\n\nDo you want to continue?"
|
||||
"\ndata <- eucast_rules(data, verbose = TRUE)\n\nDo you want to continue?"
|
||||
)
|
||||
showQuestion <- import_fn("showQuestion", "rstudioapi", error_on_fail = FALSE)
|
||||
if (!is.null(showQuestion)) {
|
||||
q_continue <- showQuestion("Using verbose = TRUE with interpretive_rules()", txt)
|
||||
q_continue <- showQuestion("Using verbose = TRUE with eucast_rules()", txt)
|
||||
} else {
|
||||
q_continue <- utils::menu(choices = c("OK", "Cancel"), graphics = FALSE, title = txt)
|
||||
}
|
||||
if (q_continue %in% c(FALSE, 2)) {
|
||||
message_("Cancelled, returning original data", as_note = FALSE)
|
||||
message_("Cancelled, returning original data", add_fn = font_red, as_note = FALSE)
|
||||
return(x)
|
||||
}
|
||||
}
|
||||
@@ -244,7 +233,7 @@ interpretive_rules <- function(x,
|
||||
# -- mo
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(x = x, type = "mo", info = info)
|
||||
stop_if(is.null(col_mo), "{.arg col_mo} must be set")
|
||||
stop_if(is.null(col_mo), "`col_mo` must be set")
|
||||
}
|
||||
|
||||
decimal.mark <- getOption("OutDec")
|
||||
@@ -325,14 +314,14 @@ interpretive_rules <- function(x,
|
||||
verbose = verbose,
|
||||
info = info,
|
||||
only_sir_columns = only_sir_columns,
|
||||
fn = "interpretive_rules",
|
||||
fn = "eucast_rules",
|
||||
...
|
||||
)
|
||||
|
||||
if (!"AMP" %in% names(cols_ab) && "AMX" %in% names(cols_ab)) {
|
||||
# ampicillin column is missing, but amoxicillin is available
|
||||
if (isTRUE(info)) {
|
||||
message_("Using column {.field ", font_bold(cols_ab[names(cols_ab) == "AMX"]), "} as input for ampicillin since many EUCAST rules depend on it.")
|
||||
message_("Using column '", cols_ab[names(cols_ab) == "AMX"], "' as input for ampicillin since many EUCAST rules depend on it.")
|
||||
}
|
||||
cols_ab <- c(cols_ab, c(AMP = unname(cols_ab[names(cols_ab) == "AMX"])))
|
||||
}
|
||||
@@ -462,7 +451,7 @@ interpretive_rules <- function(x,
|
||||
x$gramstain <- mo_gramstain(x[, col_mo, drop = TRUE], language = NULL, info = FALSE)
|
||||
x$genus_species <- trimws(paste(x$genus, x$species))
|
||||
if (isTRUE(info) && NROW(x.bak) > 10000) {
|
||||
message_("OK.", as_note = FALSE)
|
||||
message_("OK.", add_fn = list(font_green, font_bold), as_note = FALSE)
|
||||
}
|
||||
|
||||
n_added <- 0
|
||||
@@ -479,13 +468,14 @@ interpretive_rules <- function(x,
|
||||
if (any(c("all", "other") %in% rules)) {
|
||||
if (isTRUE(info)) {
|
||||
cat(paste0("\n", font_grey(strrep("-", 0.95 * getOption("width", 100))), "\n"))
|
||||
message_(
|
||||
"Rules by the ",
|
||||
font_bold(paste0("AMR package v", utils::packageDescription("AMR")$Version)),
|
||||
" (", format(as.Date(utils::packageDescription("AMR")$Date), format = "%Y"),
|
||||
"), see {.help [{.fun interpretive_rules}](AMR::interpretive_rules)}",
|
||||
as_note = FALSE
|
||||
)
|
||||
cat(word_wrap(
|
||||
paste0(
|
||||
"Rules by the ",
|
||||
font_bold(paste0("AMR package v", utils::packageDescription("AMR")$Version)),
|
||||
" (", format(as.Date(utils::packageDescription("AMR")$Date), format = "%Y"),
|
||||
"), see `?eucast_rules`\n"
|
||||
)
|
||||
))
|
||||
cat("\n\n")
|
||||
}
|
||||
ab_enzyme <- subset(AMR::antimicrobials, name %like% "/")[, c("ab", "name"), drop = FALSE]
|
||||
@@ -512,15 +502,14 @@ interpretive_rules <- function(x,
|
||||
|
||||
## Set base to R where base + enzyme inhibitor is R ----
|
||||
rule_current <- paste0(
|
||||
ab_enzyme$base_name[i], " ({.field ", font_bold(col_base), "}) = R if ",
|
||||
tolower(ab_enzyme$enzyme_name[i]), " ({.field ", font_bold(col_enzyme), "}) = R"
|
||||
ab_enzyme$base_name[i], " (`", col_base, "`) = R if ",
|
||||
tolower(ab_enzyme$enzyme_name[i]), " (`", col_enzyme, "`) = R"
|
||||
)
|
||||
if (isTRUE(info)) {
|
||||
message_(rule_current,
|
||||
as_note = FALSE,
|
||||
appendLF = FALSE,
|
||||
cat(word_wrap(rule_current,
|
||||
width = getOption("width") - 30,
|
||||
extra_indent = 6
|
||||
)
|
||||
))
|
||||
}
|
||||
run_changes <- edit_sir(
|
||||
x = x,
|
||||
@@ -536,8 +525,7 @@ interpretive_rules <- function(x,
|
||||
warned = warned,
|
||||
info = info,
|
||||
verbose = verbose,
|
||||
overwrite = overwrite,
|
||||
add_if_missing = add_if_missing
|
||||
overwrite = overwrite
|
||||
)
|
||||
n_added <- n_added + run_changes$added
|
||||
n_changed <- n_changed + run_changes$changed
|
||||
@@ -555,8 +543,8 @@ interpretive_rules <- function(x,
|
||||
|
||||
## Set base + enzyme inhibitor to S where base is S ----
|
||||
rule_current <- paste0(
|
||||
ab_enzyme$enzyme_name[i], " ({.field ", font_bold(col_enzyme), "}) = S if ",
|
||||
tolower(ab_enzyme$base_name[i]), " ({.field ", font_bold(col_base), "}) = S"
|
||||
ab_enzyme$enzyme_name[i], " (`", col_enzyme, "`) = S if ",
|
||||
tolower(ab_enzyme$base_name[i]), " (`", col_base, "`) = S"
|
||||
)
|
||||
|
||||
if (isTRUE(info)) {
|
||||
@@ -579,8 +567,7 @@ interpretive_rules <- function(x,
|
||||
warned = warned,
|
||||
info = info,
|
||||
verbose = verbose,
|
||||
overwrite = overwrite,
|
||||
add_if_missing = add_if_missing
|
||||
overwrite = overwrite
|
||||
)
|
||||
n_added <- n_added + run_changes$added
|
||||
n_changed <- n_changed + run_changes$changed
|
||||
@@ -600,69 +587,75 @@ interpretive_rules <- function(x,
|
||||
} else {
|
||||
if (isTRUE(info)) {
|
||||
cat("\n")
|
||||
message_("Skipping inhibitor-inheritance rules defined by this AMR package: setting S to drug+inhibitor where drug is S, and setting R to drug where drug+inhibitor is R. Add {.val other} or {.val all} to the {.arg rules} argument to apply those rules.")
|
||||
message_(paste0(
|
||||
font_red("Skipping inhibitor-inheritance rules defined by this AMR package: setting "),
|
||||
font_green_bg(" S "),
|
||||
font_red(" to drug+inhibitor where drug is "),
|
||||
font_green_bg(" S "),
|
||||
font_red(", and setting "),
|
||||
font_rose_bg(" R "),
|
||||
font_red(" to drug where drug+inhibitor is "),
|
||||
font_rose_bg(" R "),
|
||||
font_red(". Add \"other\" or \"all\" to the `rules` argument to apply those rules.")
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
if (!any(c("all", "custom") %in% rules) && !is.null(custom_rules)) {
|
||||
if (isTRUE(info)) {
|
||||
message_("Skipping custom interpretive rules, since the {.arg rules} argument does not contain {.code \"custom\"}.")
|
||||
message_("Skipping custom EUCAST rules, since the `rules` argument does not contain \"custom\".")
|
||||
}
|
||||
custom_rules <- NULL
|
||||
}
|
||||
|
||||
# >>> Apply Official interpretive rules <<< ---------------------------------------------------
|
||||
# >>> Apply Official EUCAST rules <<< ---------------------------------------------------
|
||||
eucast_notification_shown <- FALSE
|
||||
if (!is.null(list(...)$interpretive_rules_df)) {
|
||||
# this allows: interpretive_rules(x, interpretive_rules_df = AMR:::INTERPRETIVE_RULES_DF |> filter(is.na(have_these_values)))
|
||||
interpretive_rules_df_total <- list(...)$interpretive_rules_df
|
||||
} else if (!is.null(list(...)$eucast_rules_df)) {
|
||||
# deprecated parameter name kept for backward compatibility
|
||||
interpretive_rules_df_total <- list(...)$eucast_rules_df
|
||||
warning("Used interpretive_rules(x, eucast_rules_df = ...) - Do use newer argument interpretive_rules_df now.")
|
||||
if (!is.null(list(...)$eucast_rules_df)) {
|
||||
# this allows: eucast_rules(x, eucast_rules_df = AMR:::EUCAST_RULES_DF %>% filter(is.na(have_these_values)))
|
||||
eucast_rules_df_total <- list(...)$eucast_rules_df
|
||||
} else {
|
||||
# internal data file, created in data-raw/_pre_commit_checks.R
|
||||
interpretive_rules_df_total <- INTERPRETIVE_RULES_DF
|
||||
# otherwise internal data file, created in data-raw/_pre_commit_checks.R
|
||||
eucast_rules_df_total <- EUCAST_RULES_DF
|
||||
}
|
||||
|
||||
## filter on guideline provider and user-set guideline versions ----
|
||||
interpretive_rules_df <- data.frame()
|
||||
## filter on user-set guideline versions ----
|
||||
eucast_rules_df <- data.frame()
|
||||
if (any(c("all", "breakpoints") %in% rules)) {
|
||||
interpretive_rules_df <- interpretive_rules_df %pm>%
|
||||
rbind_AMR(interpretive_rules_df_total %pm>%
|
||||
subset(rule.provider == guideline & reference.rule_group %like% "breakpoint" & reference.version == version_breakpoints))
|
||||
eucast_rules_df <- eucast_rules_df %pm>%
|
||||
rbind_AMR(eucast_rules_df_total %pm>%
|
||||
subset(reference.rule_group %like% "breakpoint" & reference.version == version_breakpoints))
|
||||
}
|
||||
if (any(c("all", "expected_phenotypes") %in% rules)) {
|
||||
interpretive_rules_df <- interpretive_rules_df %pm>%
|
||||
rbind_AMR(interpretive_rules_df_total %pm>%
|
||||
subset(rule.provider == guideline & reference.rule_group %like% "expected" & reference.version == version_expected_phenotypes))
|
||||
eucast_rules_df <- eucast_rules_df %pm>%
|
||||
rbind_AMR(eucast_rules_df_total %pm>%
|
||||
subset(reference.rule_group %like% "expected" & reference.version == version_expected_phenotypes))
|
||||
}
|
||||
if (any(c("all", "expert") %in% rules)) {
|
||||
interpretive_rules_df <- interpretive_rules_df %pm>%
|
||||
rbind_AMR(interpretive_rules_df_total %pm>%
|
||||
subset(rule.provider == guideline & reference.rule_group %like% "expert" & reference.version == version_expertrules))
|
||||
eucast_rules_df <- eucast_rules_df %pm>%
|
||||
rbind_AMR(eucast_rules_df_total %pm>%
|
||||
subset(reference.rule_group %like% "expert" & reference.version == version_expertrules))
|
||||
}
|
||||
## filter out AmpC de-repressed cephalosporin-resistant mutants ----
|
||||
# no need to filter on version number here - the rules contain these version number, so are inherently filtered
|
||||
# cefotaxime, ceftriaxone, ceftazidime
|
||||
if (is.null(ampc_cephalosporin_resistance) || isFALSE(ampc_cephalosporin_resistance)) {
|
||||
interpretive_rules_df <- subset(
|
||||
interpretive_rules_df,
|
||||
eucast_rules_df <- subset(
|
||||
eucast_rules_df,
|
||||
reference.rule %unlike% "ampc"
|
||||
)
|
||||
} else {
|
||||
if (isTRUE(ampc_cephalosporin_resistance)) {
|
||||
ampc_cephalosporin_resistance <- "R"
|
||||
}
|
||||
if (!is.null(interpretive_rules_df$reference.rule)) {
|
||||
interpretive_rules_df[which(interpretive_rules_df$reference.rule %like% "ampc"), "to_value"] <- as.character(ampc_cephalosporin_resistance)
|
||||
if (!is.null(eucast_rules_df$reference.rule)) {
|
||||
eucast_rules_df[which(eucast_rules_df$reference.rule %like% "ampc"), "to_value"] <- as.character(ampc_cephalosporin_resistance)
|
||||
}
|
||||
}
|
||||
|
||||
# sometimes, the screenings are missing but the names are actually available
|
||||
# we only hints on remaining rows in `interpretive_rules_df`
|
||||
# we only hints on remaining rows in `eucast_rules_df`
|
||||
screening_abx <- as.character(AMR::antimicrobials$ab[which(AMR::antimicrobials$ab %like% "-S$")])
|
||||
screening_abx <- screening_abx[screening_abx %in% unique(unlist(strsplit(interpretive_rules_df_total$and_these_antibiotics[!is.na(interpretive_rules_df_total$and_these_antibiotics)], ", *")))]
|
||||
screening_abx <- screening_abx[screening_abx %in% unique(unlist(strsplit(EUCAST_RULES_DF$and_these_antibiotics[!is.na(EUCAST_RULES_DF$and_these_antibiotics)], ", *")))]
|
||||
if (isTRUE(info)) {
|
||||
cat("\n")
|
||||
}
|
||||
@@ -670,10 +663,10 @@ interpretive_rules <- function(x,
|
||||
ab <- gsub("-S$", "", ab_s)
|
||||
if (ab %in% names(cols_ab) && !ab_s %in% names(cols_ab)) {
|
||||
if (isTRUE(info)) {
|
||||
message_(
|
||||
"Using column {.field ", font_bold(cols_ab[names(cols_ab) == ab]),
|
||||
"} as ", ab_name(ab_s, language = NULL, tolower = TRUE),
|
||||
" since a column {.code ", ab_s, "} is missing but required for the chosen rules"
|
||||
message_("Using column '", cols_ab[names(cols_ab) == ab],
|
||||
"' as ", ab_name(ab_s, language = NULL, tolower = TRUE),
|
||||
" since a column '", ab_s, "' is missing but required for the chosen rules",
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
cols_ab <- c(cols_ab, stats::setNames(unname(cols_ab[names(cols_ab) == ab]), ab_s))
|
||||
@@ -681,12 +674,12 @@ interpretive_rules <- function(x,
|
||||
}
|
||||
|
||||
## Go over all rules and apply them ----
|
||||
for (i in seq_len(nrow(interpretive_rules_df))) {
|
||||
rule_previous <- interpretive_rules_df[max(1, i - 1), "reference.rule", drop = TRUE]
|
||||
rule_current <- interpretive_rules_df[i, "reference.rule", drop = TRUE]
|
||||
rule_next <- interpretive_rules_df[min(nrow(interpretive_rules_df), i + 1), "reference.rule", drop = TRUE]
|
||||
rule_group_previous <- interpretive_rules_df[max(1, i - 1), "reference.rule_group", drop = TRUE]
|
||||
rule_group_current <- interpretive_rules_df[i, "reference.rule_group", drop = TRUE]
|
||||
for (i in seq_len(nrow(eucast_rules_df))) {
|
||||
rule_previous <- eucast_rules_df[max(1, i - 1), "reference.rule", drop = TRUE]
|
||||
rule_current <- eucast_rules_df[i, "reference.rule", drop = TRUE]
|
||||
rule_next <- eucast_rules_df[min(nrow(eucast_rules_df), i + 1), "reference.rule", drop = TRUE]
|
||||
rule_group_previous <- eucast_rules_df[max(1, i - 1), "reference.rule_group", drop = TRUE]
|
||||
rule_group_current <- eucast_rules_df[i, "reference.rule_group", drop = TRUE]
|
||||
# don't apply rules if user doesn't want to apply them
|
||||
if (rule_group_current %like% "breakpoint" && !any(c("all", "breakpoints") %in% rules)) {
|
||||
next
|
||||
@@ -701,16 +694,16 @@ interpretive_rules <- function(x,
|
||||
if (isFALSE(info) || isFALSE(verbose)) {
|
||||
rule_text <- ""
|
||||
} else {
|
||||
if (is.na(interpretive_rules_df[i, "and_these_antibiotics", drop = TRUE])) {
|
||||
rule_text <- paste0("always report as '", interpretive_rules_df[i, "to_value", drop = TRUE], "': ", get_antibiotic_names(interpretive_rules_df[i, "then_change_these_antibiotics", drop = TRUE]))
|
||||
if (is.na(eucast_rules_df[i, "and_these_antibiotics", drop = TRUE])) {
|
||||
rule_text <- paste0("always report as '", eucast_rules_df[i, "to_value", drop = TRUE], "': ", get_antibiotic_names(eucast_rules_df[i, "then_change_these_antibiotics", drop = TRUE]))
|
||||
} else {
|
||||
rule_text <- paste0(
|
||||
"report as '", interpretive_rules_df[i, "to_value", drop = TRUE], "' when ",
|
||||
"report as '", eucast_rules_df[i, "to_value", drop = TRUE], "' when ",
|
||||
format_antibiotic_names(
|
||||
ab_names = get_antibiotic_names(interpretive_rules_df[i, "and_these_antibiotics", drop = TRUE]),
|
||||
ab_results = interpretive_rules_df[i, "have_these_values", drop = TRUE]
|
||||
ab_names = get_antibiotic_names(eucast_rules_df[i, "and_these_antibiotics", drop = TRUE]),
|
||||
ab_results = eucast_rules_df[i, "have_these_values", drop = TRUE]
|
||||
), ": ",
|
||||
get_antibiotic_names(interpretive_rules_df[i, "then_change_these_antibiotics", drop = TRUE])
|
||||
get_antibiotic_names(eucast_rules_df[i, "then_change_these_antibiotics", drop = TRUE])
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -719,7 +712,7 @@ interpretive_rules <- function(x,
|
||||
rule_previous <- ""
|
||||
rule_group_previous <- ""
|
||||
}
|
||||
if (i == nrow(interpretive_rules_df)) {
|
||||
if (i == nrow(eucast_rules_df)) {
|
||||
rule_next <- ""
|
||||
}
|
||||
|
||||
@@ -788,13 +781,13 @@ interpretive_rules <- function(x,
|
||||
}
|
||||
|
||||
## Get rule from file ------------------------------------------------------
|
||||
if_mo_property <- trimws(interpretive_rules_df[i, "if_mo_property", drop = TRUE])
|
||||
like_is_one_of <- trimws(interpretive_rules_df[i, "like.is.one_of", drop = TRUE])
|
||||
mo_value <- trimws(interpretive_rules_df[i, "this_value", drop = TRUE])
|
||||
source_antibiotics <- interpretive_rules_df[i, "and_these_antibiotics", drop = TRUE]
|
||||
source_value <- trimws(unlist(strsplit(interpretive_rules_df[i, "have_these_values", drop = TRUE], ",", fixed = TRUE)))
|
||||
target_antibiotics <- interpretive_rules_df[i, "then_change_these_antibiotics", drop = TRUE]
|
||||
target_value <- interpretive_rules_df[i, "to_value", drop = TRUE]
|
||||
if_mo_property <- trimws(eucast_rules_df[i, "if_mo_property", drop = TRUE])
|
||||
like_is_one_of <- trimws(eucast_rules_df[i, "like.is.one_of", drop = TRUE])
|
||||
mo_value <- trimws(eucast_rules_df[i, "this_value", drop = TRUE])
|
||||
source_antibiotics <- eucast_rules_df[i, "and_these_antibiotics", drop = TRUE]
|
||||
source_value <- trimws(unlist(strsplit(eucast_rules_df[i, "have_these_values", drop = TRUE], ",", fixed = TRUE)))
|
||||
target_antibiotics <- eucast_rules_df[i, "then_change_these_antibiotics", drop = TRUE]
|
||||
target_value <- eucast_rules_df[i, "to_value", drop = TRUE]
|
||||
|
||||
# if amo_value contains a group name, expand that name with all species in it
|
||||
if (any(trimws(strsplit(mo_value, ",")[[1]]) %in% AMR::microorganisms.groups$mo_group_name, na.rm = TRUE)) {
|
||||
@@ -815,7 +808,7 @@ interpretive_rules <- function(x,
|
||||
")$"
|
||||
)
|
||||
} else if (like_is_one_of != "like") {
|
||||
stop("invalid value for column {.field like.is.one_of}", call. = FALSE)
|
||||
stop("invalid value for column 'like.is.one_of'", call. = FALSE)
|
||||
}
|
||||
|
||||
if (is.na(source_antibiotics)) {
|
||||
@@ -871,8 +864,7 @@ interpretive_rules <- function(x,
|
||||
warned = warned,
|
||||
info = info,
|
||||
verbose = verbose,
|
||||
overwrite = overwrite,
|
||||
add_if_missing = add_if_missing
|
||||
overwrite = overwrite
|
||||
)
|
||||
n_added <- n_added + run_changes$added
|
||||
n_changed <- n_changed + run_changes$changed
|
||||
@@ -893,12 +885,12 @@ interpretive_rules <- function(x,
|
||||
if (!is.null(custom_rules)) {
|
||||
if (isTRUE(info)) {
|
||||
cat("\n")
|
||||
cat(font_bold("Custom interpretive rules, set by user"), "\n")
|
||||
cat(font_bold("Custom EUCAST rules, set by user"), "\n")
|
||||
}
|
||||
for (i in seq_len(length(custom_rules))) {
|
||||
rule <- custom_rules[[i]]
|
||||
rows <- tryCatch(which(eval(parse(text = rule$query), envir = x)),
|
||||
error = function(e) stop_(conditionMessage(e), " (check available data and compare with the custom rules set)", call = FALSE)
|
||||
error = function(e) stop_(paste0(conditionMessage(e), font_red(" (check available data and compare with the custom rules set)")), call = FALSE)
|
||||
)
|
||||
cols <- as.character(rule$result_group)
|
||||
cols <- c(
|
||||
@@ -928,8 +920,8 @@ interpretive_rules <- function(x,
|
||||
to = target_value,
|
||||
rule = c(
|
||||
rule_text,
|
||||
"Custom interpretive rules",
|
||||
paste0("Custom interpretive rule ", i),
|
||||
"Custom EUCAST rules",
|
||||
paste0("Custom EUCAST rule ", i),
|
||||
paste0(
|
||||
"Object '", deparse(substitute(custom_rules)),
|
||||
"' consisting of ", length(custom_rules), " custom rules"
|
||||
@@ -942,8 +934,7 @@ interpretive_rules <- function(x,
|
||||
warned = warned,
|
||||
info = info,
|
||||
verbose = verbose,
|
||||
overwrite = overwrite,
|
||||
add_if_missing = add_if_missing
|
||||
overwrite = overwrite
|
||||
)
|
||||
n_added <- n_added + run_changes$added
|
||||
n_changed <- n_changed + run_changes$changed
|
||||
@@ -1062,9 +1053,9 @@ interpretive_rules <- function(x,
|
||||
cat(paste0(font_grey(strrep("-", 0.95 * getOption("width", 100))), "\n"))
|
||||
|
||||
if (isFALSE(verbose) && total_n_added + total_n_changed > 0) {
|
||||
cat("\n", word_wrap("Use ", highlight_code("eucast_rules(..., verbose = TRUE)"), " (on your original data) to get a data.frame with all specified edits instead."), "\n\n", sep = "")
|
||||
cat("\n", word_wrap("Use `eucast_rules(..., verbose = TRUE)` (on your original data) to get a data.frame with all specified edits instead."), "\n\n", sep = "")
|
||||
} else if (isTRUE(verbose)) {
|
||||
cat("\n", word_wrap("Used 'Verbose mode' ({.code verbose = TRUE}), which returns a data.frame with all specified edits.\nUse {.code verbose = FALSE} to apply the rules on your data."), "\n\n", sep = "")
|
||||
cat("\n", word_wrap("Used 'Verbose mode' (`verbose = TRUE`), which returns a data.frame with all specified edits.\nUse `verbose = FALSE` to apply the rules on your data."), "\n\n", sep = "")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1074,13 +1065,13 @@ interpretive_rules <- function(x,
|
||||
warn_lacking_sir_class <- warn_lacking_sir_class[order(colnames(x.bak))]
|
||||
warn_lacking_sir_class <- warn_lacking_sir_class[!is.na(warn_lacking_sir_class)]
|
||||
warning_(
|
||||
"in {.help [{.fun interpretive_rules}](AMR::interpretive_rules)}: not all columns with antimicrobial results are of class {.cls sir}. Transform them on beforehand, e.g.:\n\n",
|
||||
"\u00a0\u00a0", AMR_env$bullet_icon, " ", highlight_code(paste0(x_deparsed, " |> as.sir(", ifelse(length(warn_lacking_sir_class) == 1,
|
||||
"in `eucast_rules()`: not all columns with antimicrobial results are of class 'sir'. Transform them on beforehand, with e.g.:\n",
|
||||
" - ", x_deparsed, " %>% as.sir(", ifelse(length(warn_lacking_sir_class) == 1,
|
||||
warn_lacking_sir_class,
|
||||
paste0(warn_lacking_sir_class[1], ":", warn_lacking_sir_class[length(warn_lacking_sir_class)])
|
||||
), ")")), "\n\n",
|
||||
"\u00a0\u00a0", AMR_env$bullet_icon, " ", highlight_code(paste0(x_deparsed, " |> mutate_if(is_sir_eligible, as.sir)")), "\n\n",
|
||||
"\u00a0\u00a0", AMR_env$bullet_icon, " ", highlight_code(paste0(x_deparsed, " |> mutate(across(where(is_sir_eligible), as.sir))"))
|
||||
), ")\n",
|
||||
" - ", x_deparsed, " %>% mutate_if(is_sir_eligible, as.sir)\n",
|
||||
" - ", x_deparsed, " %>% mutate(across(where(is_sir_eligible), as.sir))"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1101,29 +1092,6 @@ interpretive_rules <- function(x,
|
||||
}
|
||||
}
|
||||
|
||||
#' @rdname interpretive_rules
|
||||
#' @export
|
||||
eucast_rules <- function(x,
|
||||
col_mo = NULL,
|
||||
info = interactive(),
|
||||
rules = getOption("AMR_interpretive_rules", default = c("breakpoints", "expected_phenotypes")),
|
||||
...) {
|
||||
if (!is.null(getOption("AMR_eucastrules", default = NULL))) {
|
||||
warning_("The global option {.code AMR_eucastrules} that you have set is now invalid was ignored - set {.code AMR_interpretive_rules} instead. See {.topic [AMR-options](AMR::AMR-options)}.")
|
||||
}
|
||||
interpretive_rules(x = x, col_mo = col_mo, info = info, rules = rules, guideline = "EUCAST", ...)
|
||||
}
|
||||
|
||||
#' @rdname interpretive_rules
|
||||
#' @export
|
||||
clsi_rules <- function(x,
|
||||
col_mo = NULL,
|
||||
info = interactive(),
|
||||
rules = getOption("AMR_interpretive_rules", default = c("breakpoints", "expected_phenotypes")),
|
||||
...) {
|
||||
interpretive_rules(x = x, col_mo = col_mo, info = info, rules = rules, guideline = "CLSI", ...)
|
||||
}
|
||||
|
||||
# helper function for editing the table ----
|
||||
edit_sir <- function(x,
|
||||
to,
|
||||
@@ -1135,10 +1103,8 @@ edit_sir <- function(x,
|
||||
warned,
|
||||
info,
|
||||
verbose,
|
||||
overwrite,
|
||||
add_if_missing) {
|
||||
overwrite) {
|
||||
cols <- unique(cols[!is.na(cols) & !is.null(cols)])
|
||||
rows <- unique(rows)
|
||||
|
||||
# for Verbose Mode, keep track of all changes and return them
|
||||
track_changes <- list(
|
||||
@@ -1165,60 +1131,42 @@ edit_sir <- function(x,
|
||||
track_changes$sir_warn <- cols[!vapply(FUN.VALUE = logical(1), x[, cols, drop = FALSE], is.sir)]
|
||||
}
|
||||
isNA <- is.na(new_edits[rows, cols])
|
||||
isSIR <- !isNA &
|
||||
(new_edits[rows, cols] == "S" |
|
||||
new_edits[rows, cols] == "I" |
|
||||
new_edits[rows, cols] == "R" |
|
||||
new_edits[rows, cols] == "SDD" |
|
||||
new_edits[rows, cols] == "NI" |
|
||||
new_edits[rows, cols] == "WT" |
|
||||
new_edits[rows, cols] == "NWT" |
|
||||
new_edits[rows, cols] == "NS")
|
||||
isSIR <- !isNA & (new_edits[rows, cols] == "S" | new_edits[rows, cols] == "I" | new_edits[rows, cols] == "R" | new_edits[rows, cols] == "SDD" | new_edits[rows, cols] == "NI")
|
||||
non_SIR <- !isSIR
|
||||
if (isFALSE(overwrite) && any(isSIR) && message_not_thrown_before("edit_sir.warning_overwrite")) {
|
||||
warning_("in {.help [{.fun interpretive_rules}](AMR::interpretive_rules)}: some columns had SIR values which were not overwritten, since {.code overwrite = FALSE}.")
|
||||
warning_("Some values had SIR values and were not overwritten, since `overwrite = FALSE`.")
|
||||
}
|
||||
# determine which cells to modify based on overwrite and add_if_missing
|
||||
if (isTRUE(overwrite)) {
|
||||
if (isTRUE(add_if_missing)) {
|
||||
apply_mask <- rep(TRUE, length(isSIR))
|
||||
} else {
|
||||
apply_mask <- isSIR
|
||||
}
|
||||
} else {
|
||||
# overwrite = FALSE, add_if_missing = TRUE: fill missing and placeholder cells only
|
||||
apply_mask <- !isSIR
|
||||
}
|
||||
|
||||
do_assign <- function() {
|
||||
subset <- new_edits[rows, cols, drop = FALSE]
|
||||
mask <- matrix(apply_mask, nrow = nrow(subset), ncol = ncol(subset))
|
||||
subset[mask] <- to
|
||||
new_edits[rows, cols] <<- subset
|
||||
}
|
||||
|
||||
tryCatch(
|
||||
do_assign(),
|
||||
# insert into original table
|
||||
if (isTRUE(overwrite)) {
|
||||
new_edits[rows, cols] <- to
|
||||
} else {
|
||||
new_edits[rows, cols][non_SIR] <- to
|
||||
},
|
||||
warning = function(w) {
|
||||
if (w$message %like% "invalid factor level") {
|
||||
vapply(FUN.VALUE = logical(1), cols, function(col) {
|
||||
xyz <- vapply(FUN.VALUE = logical(1), cols, function(col) {
|
||||
new_edits[, col] <<- factor(
|
||||
x = as.character(pm_pull(new_edits, col)),
|
||||
levels = unique(c(to, levels(pm_pull(new_edits, col))))
|
||||
)
|
||||
TRUE
|
||||
})
|
||||
suppressWarnings(do_assign())
|
||||
if (isTRUE(overwrite)) {
|
||||
suppressWarnings(new_edits[rows, cols] <<- to)
|
||||
} else {
|
||||
suppressWarnings(new_edits[rows, cols][non_SIR] <<- to)
|
||||
}
|
||||
warning_(
|
||||
"in {.help [{.fun interpretive_rules}](AMR::interpretive_rules)}: value \"", to, "\" added to the factor levels of column",
|
||||
"in `eucast_rules()`: value \"", to, "\" added to the factor levels of column",
|
||||
ifelse(length(cols) == 1, "", "s"),
|
||||
" ", vector_and(cols, quotes = "`", sort = FALSE),
|
||||
" because this value was not an existing factor level."
|
||||
)
|
||||
txt_warning()
|
||||
warned <<- FALSE
|
||||
warned <- FALSE
|
||||
} else {
|
||||
warning_("in {.help [{.fun interpretive_rules}](AMR::interpretive_rules)}: ", w$message)
|
||||
warning_("in `eucast_rules()`: ", w$message)
|
||||
txt_warning()
|
||||
}
|
||||
},
|
||||
@@ -1282,7 +1230,7 @@ edit_sir <- function(x,
|
||||
return(track_changes)
|
||||
}
|
||||
|
||||
#' @rdname interpretive_rules
|
||||
#' @rdname eucast_rules
|
||||
#' @export
|
||||
eucast_dosage <- function(ab, administration = "iv", version_breakpoints = 15) {
|
||||
meet_criteria(ab, allow_class = c("character", "numeric", "integer", "factor"))
|
||||
83
R/first_isolate.R
Executable file → Normal file
83
R/first_isolate.R
Executable file → Normal file
@@ -61,7 +61,7 @@
|
||||
#'
|
||||
#' All isolates with a microbial ID of `NA` will be excluded as first isolate.
|
||||
#'
|
||||
#' ## Different methods
|
||||
#' ### Different methods
|
||||
#'
|
||||
#' According to previously-mentioned sources, there are different methods (algorithms) to select first isolates with increasing reliability: isolate-based, patient-based, episode-based and phenotype-based. All methods select on a combination of the taxonomic genus and species (not subspecies).
|
||||
#'
|
||||
@@ -89,29 +89,21 @@
|
||||
#' | - Major difference in any antimicrobial result | - `first_isolate(x, type = "points")` |
|
||||
#' | - Any difference in key antimicrobial results | - `first_isolate(x, type = "keyantimicrobials")` |
|
||||
#'
|
||||
#' **Isolate-based**
|
||||
#'
|
||||
#' _Minimum variables required: Microorganism identifier_
|
||||
#' ### Isolate-based
|
||||
#'
|
||||
#' This method does not require any selection, as all isolates should be included. It does, however, respect all arguments set in the [first_isolate()] function. For example, the default setting for `include_unknown` (`FALSE`) will omit selection of rows without a microbial ID.
|
||||
#'
|
||||
#' **Patient-based**
|
||||
#' ### Patient-based
|
||||
#'
|
||||
#' _Minimum variables required: Microorganism identifier, Patient identifier_
|
||||
#' To include every genus-species combination per patient once, set the `episode_days` to `Inf`. This method makes sure that no duplicate isolates are selected from the same patient. This method is preferred to e.g. identify the first MRSA finding of each patient to determine the incidence. Conversely, in a large longitudinal data set, this could mean that isolates are *excluded* that were found years after the initial isolate.
|
||||
#'
|
||||
#' This method includes every genus-species combination per patient once. This method makes sure that no duplicate isolates are selected from the same patient. This method is preferred to e.g. identify the first MRSA finding of each patient to determine the incidence. Conversely, in a large longitudinal data set, this could mean that isolates are *excluded* that were found years after the initial isolate.
|
||||
#' ### Episode-based
|
||||
#'
|
||||
#' **Episode-based**
|
||||
#'
|
||||
#' _Minimum variables required: Microorganism identifier, Patient identifier, Date_
|
||||
#'
|
||||
#' To include every genus-species combination per patient episode once, set the `episode_days` to a sensible number of days. Depending on the type of analysis, this could be e.g., 14, 30, 60 or 365. Short episodes are common for analysing specific hospital or ward data or ICU cases, long episodes are common for analysing regional and national data.
|
||||
#' To include every genus-species combination per patient episode once, set the `episode_days` to a sensible number of days. Depending on the type of analysis, this could be 14, 30, 60 or 365. Short episodes are common for analysing specific hospital or ward data or ICU cases, long episodes are common for analysing regional and national data.
|
||||
#'
|
||||
#' This is the most common method to correct for duplicate isolates. Patients are categorised into episodes based on their ID and dates (e.g., the date of specimen receipt or laboratory result). While this is a common method, it does not take into account antimicrobial test results. This means that e.g. a methicillin-resistant *Staphylococcus aureus* (MRSA) isolate cannot be differentiated from a wildtype *Staphylococcus aureus* isolate.
|
||||
#'
|
||||
#' **Phenotype-based**
|
||||
#'
|
||||
#' _Minimum variables required: Microorganism identifier, Patient identifier, Date, Antimicrobial test results_
|
||||
#' ### Phenotype-based
|
||||
#'
|
||||
#' This is a more reliable method, since it also *weighs* the antibiogram (antimicrobial test results) yielding so-called 'first weighted isolates'. There are two different methods to weigh the antibiogram:
|
||||
#'
|
||||
@@ -134,7 +126,7 @@
|
||||
#' @seealso [key_antimicrobials()]
|
||||
#' @export
|
||||
#' @return A [logical] vector
|
||||
#' @references Methodology of these functions is strictly based on:
|
||||
#' @source Methodology of these functions is strictly based on:
|
||||
#'
|
||||
#' - **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition**, 2022, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
|
||||
#'
|
||||
@@ -246,7 +238,7 @@ first_isolate <- function(x = NULL,
|
||||
FUN.VALUE = logical(1),
|
||||
X = x,
|
||||
# check only first 10,000 rows
|
||||
FUN = function(x) any(as.character(x[1:10000]) %in% VALID_SIR_LEVELS, na.rm = TRUE),
|
||||
FUN = function(x) any(as.character(x[1:10000]) %in% c("S", "SDD", "I", "R", "NI"), na.rm = TRUE),
|
||||
USE.NAMES = FALSE
|
||||
))
|
||||
if (method == "phenotype-based" && !any_col_contains_sir) {
|
||||
@@ -263,7 +255,8 @@ first_isolate <- function(x = NULL,
|
||||
),
|
||||
""
|
||||
)
|
||||
)
|
||||
),
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
|
||||
@@ -271,7 +264,7 @@ first_isolate <- function(x = NULL,
|
||||
# -- mo
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(x = x, type = "mo", info = info)
|
||||
stop_if(is.null(col_mo), "{.arg col_mo} must be set")
|
||||
stop_if(is.null(col_mo), "`col_mo` must be set")
|
||||
}
|
||||
|
||||
# methods ----
|
||||
@@ -308,7 +301,7 @@ first_isolate <- function(x = NULL,
|
||||
# -- date
|
||||
if (is.null(col_date)) {
|
||||
col_date <- search_type_in_df(x = x, type = "date", info = info)
|
||||
stop_if(is.null(col_date), "{.arg col_date} must be set")
|
||||
stop_if(is.null(col_date), "`col_date` must be set")
|
||||
}
|
||||
|
||||
# -- patient id
|
||||
@@ -317,11 +310,11 @@ first_isolate <- function(x = NULL,
|
||||
# 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 {.arg col_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", info = info)
|
||||
}
|
||||
stop_if(is.null(col_patient_id), "{.arg col_patient_id} must be set")
|
||||
stop_if(is.null(col_patient_id), "`col_patient_id` must be set")
|
||||
}
|
||||
|
||||
# -- specimen
|
||||
@@ -333,7 +326,7 @@ first_isolate <- function(x = NULL,
|
||||
check_columns_existance <- function(column, tblname = x) {
|
||||
if (!is.null(column)) {
|
||||
stop_ifnot(column %in% colnames(tblname),
|
||||
"Column {.code ", column, "} not found.",
|
||||
"Column '", column, "' not found.",
|
||||
call = FALSE
|
||||
)
|
||||
}
|
||||
@@ -362,7 +355,9 @@ first_isolate <- function(x = NULL,
|
||||
}
|
||||
# remove testcodes
|
||||
if (!is.null(testcodes_exclude) && isTRUE(info) && message_not_thrown_before("first_isolate", "excludingtestcodes")) {
|
||||
message_("Excluding test codes: ", vector_and(testcodes_exclude, quotes = TRUE))
|
||||
message_("Excluding test codes: ", vector_and(testcodes_exclude, quotes = TRUE),
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
|
||||
if (is.null(col_specimen)) {
|
||||
@@ -373,7 +368,9 @@ first_isolate <- function(x = NULL,
|
||||
if (!is.null(specimen_group)) {
|
||||
check_columns_existance(col_specimen, x)
|
||||
if (isTRUE(info) && message_not_thrown_before("first_isolate", "excludingspecimen")) {
|
||||
message_("Excluding other than specimen group '", specimen_group, "'")
|
||||
message_("Excluding other than specimen group '", specimen_group, "'",
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
}
|
||||
if (!is.null(col_keyantimicrobials)) {
|
||||
@@ -415,6 +412,7 @@ first_isolate <- function(x = NULL,
|
||||
if (abs(row.start) == Inf || abs(row.end) == Inf) {
|
||||
if (isTRUE(info)) {
|
||||
message_("=> Found ", font_bold("no isolates"),
|
||||
add_fn = font_black,
|
||||
as_note = FALSE
|
||||
)
|
||||
}
|
||||
@@ -423,6 +421,7 @@ first_isolate <- function(x = NULL,
|
||||
if (row.start == row.end) {
|
||||
if (isTRUE(info)) {
|
||||
message_("=> Found ", font_bold("1 first isolate"), ", as the data only contained 1 row",
|
||||
add_fn = font_black,
|
||||
as_note = FALSE
|
||||
)
|
||||
}
|
||||
@@ -430,8 +429,9 @@ first_isolate <- function(x = NULL,
|
||||
}
|
||||
if (length(c(row.start:row.end)) == pm_n_distinct(x[c(row.start:row.end), col_mo, drop = TRUE])) {
|
||||
if (isTRUE(info)) {
|
||||
n_rows <- length(c(row.start:row.end))
|
||||
message_("=> Found {.strong ", n_rows, " first isolates}, as all isolates were different microbial species",
|
||||
message_("=> Found ", font_bold(paste(length(c(row.start:row.end)), "first isolates")),
|
||||
", as all isolates were different microbial species",
|
||||
add_fn = font_black,
|
||||
as_note = FALSE
|
||||
)
|
||||
}
|
||||
@@ -448,16 +448,16 @@ first_isolate <- function(x = NULL,
|
||||
if (!is.null(col_keyantimicrobials)) {
|
||||
if (isTRUE(info) && message_not_thrown_before("first_isolate", "type")) {
|
||||
if (type == "keyantimicrobials") {
|
||||
message_(
|
||||
"Basing inclusion on key antimicrobials, ",
|
||||
message_("Basing inclusion on key antimicrobials, ",
|
||||
ifelse(ignore_I == FALSE, "not ", ""),
|
||||
"ignoring I"
|
||||
"ignoring I",
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
if (type == "points") {
|
||||
message_(
|
||||
"Basing inclusion on all antimicrobial results, using a points threshold of ",
|
||||
points_threshold
|
||||
message_("Basing inclusion on all antimicrobial results, using a points threshold of ",
|
||||
points_threshold,
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -516,7 +516,9 @@ first_isolate <- function(x = NULL,
|
||||
if (any(!is.na(x$newvar_is_icu)) && any(x$newvar_is_icu == TRUE, na.rm = TRUE)) {
|
||||
if (icu_exclude == TRUE) {
|
||||
if (isTRUE(info)) {
|
||||
message_("Excluding ", format(sum(x$newvar_is_icu, na.rm = TRUE), decimal.mark = decimal.mark, big.mark = big.mark), " isolates from ICU.")
|
||||
message_("Excluding ", format(sum(x$newvar_is_icu, na.rm = TRUE), decimal.mark = decimal.mark, big.mark = big.mark), " isolates from ICU.",
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
x[which(x$newvar_is_icu), "newvar_first_isolate"] <- FALSE
|
||||
} else if (isTRUE(info)) {
|
||||
@@ -540,8 +542,9 @@ first_isolate <- function(x = NULL,
|
||||
paste0('"', x, '"')
|
||||
}
|
||||
})
|
||||
message_("\nGroup: ", toString(paste0(names(group), " = ", group)), "\n",
|
||||
as_note = FALSE
|
||||
message_("\nGroup: ", paste0(names(group), " = ", group, collapse = ", "), "\n",
|
||||
as_note = FALSE,
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -554,7 +557,8 @@ first_isolate <- function(x = NULL,
|
||||
format(sum(x$newvar_mo == "UNKNOWN", na.rm = TRUE),
|
||||
decimal.mark = decimal.mark, big.mark = big.mark
|
||||
),
|
||||
" isolates with a microbial ID 'UNKNOWN' (in column {.field ", font_bold(col_mo), "})"
|
||||
" isolates with a microbial ID 'UNKNOWN' (in column '", font_bold(col_mo), "')",
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
x[which(x$newvar_mo == "UNKNOWN"), "newvar_first_isolate"] <- include_unknown
|
||||
@@ -565,7 +569,8 @@ first_isolate <- function(x = NULL,
|
||||
"Excluding ", format(sum(is.na(x$newvar_mo), na.rm = TRUE),
|
||||
decimal.mark = decimal.mark, big.mark = big.mark
|
||||
),
|
||||
" isolates with a microbial ID `NA` (in column {.field ", font_bold(col_mo), "})"
|
||||
" isolates with a microbial ID `NA` (in column '", font_bold(col_mo), "')",
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
x[which(is.na(x$newvar_mo)), "newvar_first_isolate"] <- FALSE
|
||||
@@ -611,7 +616,7 @@ first_isolate <- function(x = NULL,
|
||||
),
|
||||
p_found_total, " of total where a microbial ID was available)"
|
||||
),
|
||||
as_note = FALSE
|
||||
add_fn = font_black, as_note = FALSE
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
2
R/get_episode.R
Executable file → Normal file
2
R/get_episode.R
Executable file → Normal file
@@ -215,7 +215,7 @@ is_new_episode <- function(x, episode_days = NULL, case_free_days = NULL, ...) {
|
||||
|
||||
exec_episode <- function(x, episode_days, case_free_days, ...) {
|
||||
stop_ifnot(is.null(episode_days) || is.null(case_free_days),
|
||||
"either argument {.arg episode_days} or argument {.arg case_free_days} must be set.",
|
||||
"either argument `episode_days` or argument `case_free_days` must be set.",
|
||||
call = -2
|
||||
)
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ geom_sir <- function(position = NULL,
|
||||
...) {
|
||||
x <- x[1]
|
||||
stop_ifnot_installed("ggplot2")
|
||||
stop_if(is.data.frame(position), "{.arg position} is invalid. Did you accidentally use {.code %>%} instead of {.code +}?")
|
||||
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)
|
||||
|
||||
@@ -79,6 +79,7 @@ guess_ab_col <- function(x = NULL, search_string = NULL, verbose = FALSE, only_s
|
||||
if (isTRUE(verbose)) {
|
||||
message_("No column found as input for ", search_string,
|
||||
" (", ab_name(search_string, language = NULL, tolower = TRUE), ").",
|
||||
add_fn = font_black,
|
||||
as_note = FALSE
|
||||
)
|
||||
}
|
||||
@@ -86,7 +87,7 @@ guess_ab_col <- function(x = NULL, search_string = NULL, verbose = FALSE, only_s
|
||||
} else {
|
||||
if (isTRUE(verbose)) {
|
||||
message_(
|
||||
"Using column {.field ", font_bold(ab_result), "} as input for ", search_string,
|
||||
"Using column '", font_bold(ab_result), "' as input for ", search_string,
|
||||
" (", ab_name(search_string, language = NULL, tolower = TRUE), ")."
|
||||
)
|
||||
}
|
||||
@@ -146,7 +147,7 @@ get_column_abx <- function(x,
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(sort, allow_class = "logical", has_length = 1)
|
||||
|
||||
if (isTRUE(info) && message_not_thrown_before("get_column_abx", colnames(x))) {
|
||||
if (isTRUE(info)) {
|
||||
message_("Auto-guessing columns suitable for analysis", appendLF = FALSE, as_note = FALSE)
|
||||
}
|
||||
|
||||
@@ -210,7 +211,7 @@ get_column_abx <- function(x,
|
||||
newnames <- suppressWarnings(as.ab(names(dots), info = FALSE))
|
||||
if (anyNA(newnames)) {
|
||||
if (isTRUE(info)) {
|
||||
message_("WARNING: some columns returned NA for {.help [{.fun as.ab}](AMR::as.ab)}", as_note = FALSE)
|
||||
message_(paste0(font_yellow(font_bold(" WARNING: ")), "some columns returned `NA` for `as.ab()`"), as_note = FALSE)
|
||||
}
|
||||
warning_("Invalid antibiotic reference(s): ", vector_and(names(dots)[is.na(newnames)], quotes = FALSE),
|
||||
call = FALSE,
|
||||
@@ -221,7 +222,7 @@ get_column_abx <- function(x,
|
||||
unexisting_cols <- which(!vapply(FUN.VALUE = logical(1), dots, function(col) all(col %in% x_columns)))
|
||||
if (length(unexisting_cols) > 0) {
|
||||
if (isTRUE(info)) {
|
||||
message_(" ERROR", as_note = FALSE)
|
||||
message_(" ERROR", add_fn = list(font_red, font_bold), as_note = FALSE)
|
||||
}
|
||||
stop_("Column(s) not found: ", vector_and(unlist(dots[[unexisting_cols]]), quotes = FALSE),
|
||||
call = FALSE
|
||||
@@ -265,17 +266,17 @@ get_column_abx <- function(x,
|
||||
|
||||
if (isTRUE(info)) {
|
||||
if (all_okay == TRUE) {
|
||||
message_(" OK.", as_note = FALSE)
|
||||
message_(" OK.", add_fn = list(font_green, font_bold), as_note = FALSE)
|
||||
} else if (!isFALSE(dups)) {
|
||||
message_("WARNING: some results from {.help [{.fun as.ab}](AMR::as.ab)} are duplicated: ", vector_and(dups, quotes = FALSE), as_note = FALSE)
|
||||
message_(paste0(font_yellow(font_bold(" WARNING: ")), "some results from `as.ab()` are duplicated: ", vector_and(dups, quotes = "`")), as_note = FALSE)
|
||||
} else {
|
||||
message_(" WARNING.", as_note = FALSE)
|
||||
message_(" WARNING.", add_fn = list(font_yellow, font_bold), as_note = FALSE)
|
||||
}
|
||||
|
||||
for (i in seq_len(length(out))) {
|
||||
if (isTRUE(verbose) && !out[i] %in% duplicates) {
|
||||
message_(
|
||||
"Using column {.field ", font_bold(out[i]), "} as input for ", names(out)[i],
|
||||
"Using column '", font_bold(out[i]), "' as input for ", names(out)[i],
|
||||
" (", ab_name(names(out)[i], tolower = TRUE, language = NULL), ")."
|
||||
)
|
||||
}
|
||||
@@ -284,10 +285,11 @@ get_column_abx <- function(x,
|
||||
if (names(out)[i] != already_set_as) {
|
||||
message_(
|
||||
paste0(
|
||||
"Column {.field ", font_bold(out[i]), "} will not be used for ",
|
||||
"Column '", font_bold(out[i]), "' will not be used for ",
|
||||
names(out)[i], " (", suppressMessages(ab_name(names(out)[i], tolower = TRUE, language = NULL, fast_mode = TRUE)), ")",
|
||||
", as this antimicrobial has already been set."
|
||||
)
|
||||
),
|
||||
add_fn = font_red
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,9 +143,9 @@ join_microorganisms <- function(type, x, by, suffix, ...) {
|
||||
if (is.null(by) && NCOL(x) == 1) {
|
||||
by <- colnames(x)[1L]
|
||||
} else {
|
||||
stop_if(is.null(by), "no column with microorganism names or codes found, set this column with {.arg by}", call = -2)
|
||||
stop_if(is.null(by), "no column with microorganism names or codes found, set this column with `by`", call = -2)
|
||||
}
|
||||
message_("Joining, by = \"", by, "\"", as_note = FALSE) # message same as dplyr::join functions
|
||||
message_('Joining, by = "', by, '"', add_fn = font_black, as_note = FALSE) # message same as dplyr::join functions
|
||||
}
|
||||
if (!all(x[, by, drop = TRUE] %in% AMR_env$MO_lookup$mo, na.rm = TRUE)) {
|
||||
x$join.mo <- as.mo(x[, by, drop = TRUE])
|
||||
@@ -185,7 +185,7 @@ join_microorganisms <- function(type, x, by, suffix, ...) {
|
||||
}
|
||||
|
||||
if (type %like% "full|left|right|inner" && NROW(joined) > NROW(x)) {
|
||||
warning_("in {.fun ", type, "_microorganisms}: the newly joined data set contains ", nrow(joined) - nrow(x), " rows more than the number of rows of {.arg x}.")
|
||||
warning_("in `", type, "_microorganisms()`: the newly joined data set contains ", nrow(joined) - nrow(x), " rows more than the number of rows of `x`.")
|
||||
}
|
||||
|
||||
as_original_data_class(joined, class(x.bak)) # will remove tibble groups
|
||||
|
||||
@@ -159,13 +159,13 @@ key_antimicrobials <- function(x = NULL,
|
||||
col_mo <- search_type_in_df(x = x, type = "mo", info = FALSE)
|
||||
}
|
||||
if (is.null(col_mo)) {
|
||||
warning_("in {.fun key_antimicrobials}: no column found for {.arg col_mo}, ignoring antibiotics set in {.arg gram_negative} and {.arg gram_positive}, and antimycotics set in {.arg antifungal}")
|
||||
warning_("in `key_antimicrobials()`: no column found for `col_mo`, ignoring antibiotics set in `gram_negative` and `gram_positive`, and antimycotics set in `antifungal`")
|
||||
gramstain <- NA_character_
|
||||
domain <- NA_character_
|
||||
kingdom <- NA_character_
|
||||
} else {
|
||||
x.mo <- as.mo(x[, col_mo, drop = TRUE])
|
||||
gramstain <- mo_gramstain(x.mo, language = NULL)
|
||||
domain <- mo_domain(x.mo, language = NULL)
|
||||
kingdom <- mo_kingdom(x.mo, language = NULL)
|
||||
}
|
||||
|
||||
AMR_string <- function(x, values, name, filter, cols = cols) {
|
||||
@@ -182,12 +182,12 @@ key_antimicrobials <- function(x = NULL,
|
||||
any(filter, na.rm = TRUE) &&
|
||||
message_not_thrown_before("key_antimicrobials", name)) {
|
||||
warning_(
|
||||
"in {.help [{.fun key_antimicrobials}](AMR::key_antimicrobials)}: ",
|
||||
"in `key_antimicrobials()`: ",
|
||||
ifelse(values_new_length == 0,
|
||||
"No columns available ",
|
||||
paste0("Only using ", values_new_length, " out of ", values_old_length, " defined columns ")
|
||||
),
|
||||
"as key antimicrobials for ", name, "s. See {.help [{.fun key_antimicrobials}](AMR::key_antimicrobials)}."
|
||||
"as key antimicrobials for ", name, "s. See `?key_antimicrobials`."
|
||||
)
|
||||
}
|
||||
|
||||
@@ -219,11 +219,11 @@ key_antimicrobials <- function(x = NULL,
|
||||
cols = cols
|
||||
)
|
||||
|
||||
key_ab[which(domain == "Fungi")] <- AMR_string(
|
||||
key_ab[which(kingdom == "Fungi")] <- AMR_string(
|
||||
x = x,
|
||||
values = antifungal,
|
||||
name = "antifungal",
|
||||
filter = domain == "Fungi",
|
||||
filter = kingdom == "Fungi",
|
||||
cols = cols
|
||||
)
|
||||
|
||||
@@ -237,7 +237,7 @@ key_antimicrobials <- function(x = NULL,
|
||||
)
|
||||
|
||||
if (length(unique(key_ab)) == 1) {
|
||||
warning_("in {.fun key_antimicrobials}: no distinct key antibiotics determined.")
|
||||
warning_("in `key_antimicrobials()`: no distinct key antibiotics determined.")
|
||||
}
|
||||
|
||||
key_ab
|
||||
@@ -282,9 +282,6 @@ generate_antimicrobials_string <- function(df) {
|
||||
function(x) {
|
||||
x <- toupper(as.character(x))
|
||||
x[x == "SDD"] <- "I"
|
||||
x[x == "WT"] <- "S"
|
||||
x[x == "NWT"] <- "R"
|
||||
x[x == "NS"] <- "R"
|
||||
# ignore "NI" here, no use for determining first isolates
|
||||
x[!x %in% c("S", "I", "R")] <- "."
|
||||
paste(x)
|
||||
@@ -310,12 +307,14 @@ antimicrobials_equal <- function(y,
|
||||
meet_criteria(type, allow_class = "character", has_length = 1, is_in = c("points", "keyantimicrobials"))
|
||||
meet_criteria(ignore_I, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(points_threshold, allow_class = c("numeric", "integer"), has_length = 1, is_positive = TRUE, is_finite = TRUE)
|
||||
stop_ifnot(length(y) == length(z), "length of {.arg y} and {.arg z} must be equal")
|
||||
stop_ifnot(length(y) == length(z), "length of `y` and `z` must be equal")
|
||||
|
||||
key2sir <- function(val) {
|
||||
val <- strsplit(val, "", fixed = TRUE)[[1L]]
|
||||
val.int <- rep(NA_real_, length(val))
|
||||
val.int[val %in% VALID_SIR_LEVELS] <- as.double(as.sir(val[val %in% VALID_SIR_LEVELS]))
|
||||
val.int[val == "S"] <- 1
|
||||
val.int[val %in% c("I", "SDD")] <- 2
|
||||
val.int[val == "R"] <- 3
|
||||
val.int
|
||||
}
|
||||
# only run on uniques
|
||||
|
||||
209
R/mdro.R
209
R/mdro.R
@@ -31,7 +31,7 @@
|
||||
#'
|
||||
#' Determine which isolates are multidrug-resistant organisms (MDRO) according to international, national, or custom guidelines.
|
||||
#' @param x A [data.frame] with antimicrobials columns, like `AMX` or `amox`. Can be left blank for automatic determination.
|
||||
#' @param guideline A specific guideline to follow, see sections *Supported International / National Guidelines* and *Using Custom Guidelines* below. When left empty, the publication by Magiorakos *et al.* (see below) will be followed.
|
||||
#' @param guideline A specific guideline to follow, see sections *Supported international / national guidelines* and *Using Custom Guidelines* below. When left empty, the publication by Magiorakos *et al.* (see below) will be followed.
|
||||
#' @param esbl [logical] values, or a column name containing logical values, indicating the presence of an ESBL gene (or production of its proteins).
|
||||
#' @param carbapenemase [logical] values, or a column name containing logical values, indicating the presence of a carbapenemase gene (or production of its proteins).
|
||||
#' @param mecA [logical] values, or a column name containing logical values, indicating the presence of a *mecA* gene (or production of its proteins).
|
||||
@@ -41,8 +41,7 @@
|
||||
#' @inheritParams eucast_rules
|
||||
#' @param pct_required_classes Minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for *S. aureus*. Setting this `pct_required_classes` argument to `0.5` (default) means that for every *S. aureus* isolate at least 8 different classes must be available. Any lower number of available classes will return `NA` for that isolate.
|
||||
#' @param combine_SI A [logical] to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the [mdro()] function, it follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using `combine_SI = FALSE`, resistance is considered when isolates are R or I.
|
||||
#' @param verbose A [logical] to turn Verbose mode on and off (default is off). In Verbose mode, the function returns a data set with the MDRO results in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.
|
||||
#' @param infer_from_combinations A [logical] to indicate whether resistance for a missing base beta-lactam drug should be inferred from an available drug+inhibitor combination (e.g., piperacillin from piperacillin/tazobactam). The clinical basis is that resistance in a combination always implies resistance in the base drug, since the enzyme inhibitor provides no benefit when the organism is truly resistant. Only resistance is inferred; susceptibility in a combination does **not** imply susceptibility in the base drug (the inhibitor may be responsible). Defaults to `TRUE`.
|
||||
#' @param verbose A [logical] to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.
|
||||
#' @details
|
||||
#' These functions are context-aware. This means that the `x` argument can be left blank if used inside a [data.frame] call, see *Examples*.
|
||||
#'
|
||||
@@ -84,7 +83,7 @@
|
||||
#'
|
||||
#' * `guideline = "BRMO 2024"` (or simply `guideline = "BRMO"`)
|
||||
#'
|
||||
#' The Dutch national guideline - Samenwerkingverband Richtlijnen Infectiepreventie (SRI) (2024) "Bijzonder Resistente Micro-Organismen (BRMO)" ([link](https://richtlijnendatabase.nl/richtlijn/bijzonder_resistente_micro-organismen_brmo))
|
||||
#' The Dutch national guideline - Samenwerkingverband Richtlijnen Infectiepreventie (SRI) (2024) "Bijzonder Resistente Micro-Organismen (BRMO)" ([link](https://www.sri-richtlijnen.nl/brmo))
|
||||
#'
|
||||
#' Also:
|
||||
#'
|
||||
@@ -144,7 +143,6 @@ mdro <- function(x = NULL,
|
||||
combine_SI = TRUE,
|
||||
verbose = FALSE,
|
||||
only_sir_columns = any(is.sir(x)),
|
||||
infer_from_combinations = TRUE,
|
||||
...) {
|
||||
if (is_null_or_grouped_tbl(x)) {
|
||||
# when `x` is left blank, auto determine it (get_current_data() searches underlying data within call)
|
||||
@@ -167,32 +165,57 @@ mdro <- function(x = NULL,
|
||||
meet_criteria(combine_SI, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(verbose, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(infer_from_combinations, allow_class = "logical", has_length = 1)
|
||||
|
||||
|
||||
if (isTRUE(only_sir_columns) && !any(is.sir(x))) {
|
||||
stop_("There were no SIR columns found in the data set, despite {.arg only_sir_columns} being {.code TRUE}. Transform columns with {.help [{.fun as.sir}](AMR::as.sir)} for valid antimicrobial interpretations.")
|
||||
stop_("There were no SIR columns found in the data set, despite `only_sir_columns` being `TRUE`. Transform columns with `as.sir()` for valid antimicrobial interpretations.")
|
||||
} else if (!isTRUE(only_sir_columns) && !any(is.sir(x)) && !any(is_sir_eligible(x))) {
|
||||
stop_("There were no eligible SIR columns found in the data set. Transform columns with {.help [{.fun as.sir}](AMR::as.sir)} for valid antimicrobial interpretations.")
|
||||
stop_("There were no eligible SIR columns found in the data set. Transform columns with `as.sir()` for valid antimicrobial interpretations.")
|
||||
}
|
||||
|
||||
# get gene values as TRUE/FALSE
|
||||
resolve_gene_var <- function(x, gene, varname) {
|
||||
if (is.character(gene)) {
|
||||
meet_criteria(gene, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||
gene <- x[[gene]]
|
||||
meet_criteria(gene, allow_class = "logical", allow_NA = TRUE)
|
||||
} else if (length(gene) == 1) {
|
||||
gene <- rep(gene, NROW(x))
|
||||
}
|
||||
x[[varname]] <- gene
|
||||
x
|
||||
if (is.character(esbl)) {
|
||||
meet_criteria(esbl, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||
esbl <- x[[esbl]]
|
||||
meet_criteria(esbl, allow_class = "logical", allow_NA = TRUE)
|
||||
} else if (length(esbl) == 1) {
|
||||
esbl <- rep(esbl, NROW(x))
|
||||
}
|
||||
if (is.character(carbapenemase)) {
|
||||
meet_criteria(carbapenemase, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||
carbapenemase <- x[[carbapenemase]]
|
||||
meet_criteria(carbapenemase, allow_class = "logical", allow_NA = TRUE)
|
||||
} else if (length(carbapenemase) == 1) {
|
||||
carbapenemase <- rep(carbapenemase, NROW(x))
|
||||
}
|
||||
if (is.character(mecA)) {
|
||||
meet_criteria(mecA, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||
mecA <- x[[mecA]]
|
||||
meet_criteria(mecA, allow_class = "logical", allow_NA = TRUE)
|
||||
} else if (length(mecA) == 1) {
|
||||
mecA <- rep(mecA, NROW(x))
|
||||
}
|
||||
if (is.character(mecC)) {
|
||||
meet_criteria(mecC, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||
mecC <- x[[mecC]]
|
||||
meet_criteria(mecC, allow_class = "logical", allow_NA = TRUE)
|
||||
} else if (length(mecC) == 1) {
|
||||
mecC <- rep(mecC, NROW(x))
|
||||
}
|
||||
if (is.character(vanA)) {
|
||||
meet_criteria(vanA, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||
vanA <- x[[vanA]]
|
||||
meet_criteria(vanA, allow_class = "logical", allow_NA = TRUE)
|
||||
} else if (length(vanA) == 1) {
|
||||
vanA <- rep(vanA, NROW(x))
|
||||
}
|
||||
if (is.character(vanB)) {
|
||||
meet_criteria(vanB, is_in = colnames(x), allow_NA = FALSE, has_length = 1)
|
||||
vanB <- x[[vanB]]
|
||||
meet_criteria(vanB, allow_class = "logical", allow_NA = TRUE)
|
||||
} else if (length(vanB) == 1) {
|
||||
vanB <- rep(vanB, NROW(x))
|
||||
}
|
||||
x <- resolve_gene_var(x, esbl, "esbl")
|
||||
x <- resolve_gene_var(x, carbapenemase, "carbapenemase")
|
||||
x <- resolve_gene_var(x, mecA, "mecA")
|
||||
x <- resolve_gene_var(x, mecC, "mecC")
|
||||
x <- resolve_gene_var(x, vanA, "vanA")
|
||||
x <- resolve_gene_var(x, vanB, "vanB")
|
||||
|
||||
info.bak <- info
|
||||
# don't throw info's more than once per call
|
||||
@@ -213,7 +236,7 @@ mdro <- function(x = NULL,
|
||||
q_continue <- utils::menu(choices = c("OK", "Cancel"), graphics = FALSE, title = txt)
|
||||
}
|
||||
if (q_continue %in% c(FALSE, 2)) {
|
||||
message_("Cancelled, returning original data", as_note = FALSE)
|
||||
message_("Cancelled, returning original data", add_fn = font_red, as_note = FALSE)
|
||||
return(x)
|
||||
}
|
||||
}
|
||||
@@ -251,7 +274,7 @@ mdro <- function(x = NULL,
|
||||
guideline.bak <- guideline
|
||||
if (is.list(guideline)) {
|
||||
# Custom MDRO guideline ---------------------------------------------------
|
||||
stop_ifnot(inherits(guideline, "custom_mdro_guideline"), "use {.help [{.fun custom_mdro_guideline}](AMR::custom_mdro_guideline)} to create custom guidelines")
|
||||
stop_ifnot(inherits(guideline, "custom_mdro_guideline"), "use `custom_mdro_guideline()` to create custom guidelines")
|
||||
if (isTRUE(info)) {
|
||||
txt <- paste0(
|
||||
"Determining MDROs based on custom rules",
|
||||
@@ -328,13 +351,13 @@ mdro <- function(x = NULL,
|
||||
}
|
||||
if (is.null(col_mo) && guideline$code == "tb") {
|
||||
message_(
|
||||
"No column found as input for {.arg col_mo}, ",
|
||||
"No column found as input for `col_mo`, ",
|
||||
font_bold(paste0("assuming all rows contain ", font_italic("Mycobacterium tuberculosis"), "."))
|
||||
)
|
||||
x$mo <- as.mo("Mycobacterium tuberculosis", keep_synonyms = TRUE)
|
||||
col_mo <- "mo"
|
||||
}
|
||||
stop_if(is.null(col_mo), "{.arg col_mo} must be set")
|
||||
stop_if(is.null(col_mo), "`col_mo` must be set")
|
||||
|
||||
if (guideline$code == "cmi2012") {
|
||||
guideline$name <- "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance."
|
||||
@@ -379,7 +402,7 @@ mdro <- function(x = NULL,
|
||||
guideline$name <- "Bijzonder Resistente Micro-organismen (BRMO)"
|
||||
guideline$author <- "Samenwerkingsverband Richtlijnen Infectiepreventie (SRI)"
|
||||
guideline$version <- "November 2024"
|
||||
guideline$source_url <- font_url("https://richtlijnendatabase.nl/richtlijn/bijzonder_resistente_micro-organismen_brmo", "Direct link")
|
||||
guideline$source_url <- font_url("https://www.sri-richtlijnen.nl/brmo", "Direct link")
|
||||
guideline$type <- "BRMOs"
|
||||
} else if (guideline$code == "brmo2017") {
|
||||
guideline$name <- "WIP-Richtlijn Bijzonder Resistente Micro-organismen (BRMO)"
|
||||
@@ -476,58 +499,12 @@ mdro <- function(x = NULL,
|
||||
if (!"AMP" %in% names(cols_ab) && "AMX" %in% names(cols_ab)) {
|
||||
# ampicillin column is missing, but amoxicillin is available
|
||||
if (isTRUE(info)) {
|
||||
message_("Using column {.field ", font_bold(cols_ab[names(cols_ab) == "AMX"]), "} as input for ampicillin since many MDRO rules depend on it.")
|
||||
message_("Using column '", cols_ab[names(cols_ab) == "AMX"], "' as input for ampicillin since many MDRO rules depend on it.", add_fn = font_red)
|
||||
}
|
||||
cols_ab <- c(cols_ab, c(AMP = unname(cols_ab[names(cols_ab) == "AMX"])))
|
||||
}
|
||||
cols_ab <- cols_ab[!duplicated(cols_ab)]
|
||||
|
||||
# Infer resistance for missing base drugs ----
|
||||
if (isTRUE(infer_from_combinations)) {
|
||||
.combos_in_data <- AB_BETALACTAMS_WITH_INHIBITOR[AB_BETALACTAMS_WITH_INHIBITOR %in% names(cols_ab)]
|
||||
if (length(.combos_in_data) > 0) {
|
||||
.base_drugs <- suppressMessages(
|
||||
as.ab(gsub("/.*", "", ab_name(as.character(.combos_in_data), language = NULL)))
|
||||
)
|
||||
.unique_bases <- unique(.base_drugs[!is.na(.base_drugs)])
|
||||
for (.base in .unique_bases) {
|
||||
.base_code <- as.character(.base)
|
||||
if (!.base_code %in% names(cols_ab)) {
|
||||
# Base drug column absent; find all available combo columns for this base drug
|
||||
.combos <- .combos_in_data[!is.na(.base_drugs) & as.character(.base_drugs) == .base_code]
|
||||
.combo_cols <- unname(cols_ab[as.character(.combos)])
|
||||
.combo_cols <- .combo_cols[!is.na(.combo_cols)]
|
||||
if (length(.combo_cols) > 0) {
|
||||
# Vectorised: if ANY combination is R, infer base drug as R; otherwise NA
|
||||
.sir_chars <- as.data.frame(
|
||||
lapply(x[, .combo_cols, drop = FALSE], function(col) as.character(as.sir(col))),
|
||||
stringsAsFactors = FALSE
|
||||
)
|
||||
.new_col <- paste0(.base_code, ".inferred_sir_proxy_from#", paste0(.combos, collapse = "/"), "#")
|
||||
x[[.new_col]] <- ifelse(rowSums(.sir_chars == "R", na.rm = TRUE) > 0L, "R", NA_character_)
|
||||
cols_ab <- c(cols_ab, stats::setNames(.new_col, .base_code))
|
||||
if (isTRUE(info.bak)) {
|
||||
message_(
|
||||
"Inferring resistance for ",
|
||||
ab_name(.base_code, language = NULL, tolower = TRUE),
|
||||
" (", font_italic("missing"), ") from ",
|
||||
vector_or(
|
||||
quotes = FALSE,
|
||||
last_sep = " and/or ",
|
||||
paste0(
|
||||
ab_name(.combos, language = NULL, tolower = TRUE),
|
||||
" ({.field ", font_bold(.combo_cols, collapse = NULL), "}, ", font_italic("available"), ")"
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cols_ab <- cols_ab[!duplicated(names(cols_ab))]
|
||||
}
|
||||
}
|
||||
|
||||
# nolint start
|
||||
AMC <- cols_ab["AMC"]
|
||||
AMK <- cols_ab["AMK"]
|
||||
@@ -722,16 +699,6 @@ mdro <- function(x = NULL,
|
||||
x
|
||||
}
|
||||
|
||||
ab_without_inhibitor <- function(ab_codes) {
|
||||
# Get the base drug AB code from a drug+inhibitor combination.
|
||||
# e.g., AMC (amoxicillin/clavulanic acid) -> AMX (amoxicillin)
|
||||
# TZP (piperacillin/tazobactam) -> PIP (piperacillin)
|
||||
# SAM (ampicillin/sulbactam) -> AMP (ampicillin)
|
||||
combo_names <- ab_name(ab_codes, language = NULL)
|
||||
base_names <- gsub("/.*", "", combo_names)
|
||||
suppressMessages(as.ab(base_names))
|
||||
}
|
||||
|
||||
# antimicrobial classes
|
||||
# nolint start
|
||||
aminoglycosides <- c(TOB, GEN)
|
||||
@@ -805,7 +772,7 @@ mdro <- function(x = NULL,
|
||||
)
|
||||
}
|
||||
x[rows_to_change, "MDRO"] <<- to
|
||||
x[rows_to_change, "reason"] <<- paste0(x[rows_to_change, "reason", drop = TRUE], "; ", reason)
|
||||
x[rows_to_change, "reason"] <<- reason
|
||||
x[rows_not_to_change, "reason"] <<- "guideline criteria not met"
|
||||
}
|
||||
}
|
||||
@@ -835,7 +802,7 @@ mdro <- function(x = NULL,
|
||||
sum(vapply(
|
||||
FUN.VALUE = logical(1),
|
||||
group_tbl,
|
||||
function(group) any(unlist(x[row, group[!is.na(group)], drop = TRUE]) %in% VALID_SIR_LEVELS[VALID_SIR_LEVELS != "NI"])
|
||||
function(group) any(unlist(x[row, group[!is.na(group)], drop = TRUE]) %in% c("S", "SDD", "I", "R"))
|
||||
))
|
||||
}
|
||||
)
|
||||
@@ -875,7 +842,7 @@ mdro <- function(x = NULL,
|
||||
}
|
||||
|
||||
if (isTRUE(info)) {
|
||||
message_(" OK.", as_note = FALSE)
|
||||
message_(" OK.", add_fn = list(font_green, font_bold), as_note = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -887,7 +854,7 @@ mdro <- function(x = NULL,
|
||||
x <- left_join_microorganisms(x, by = col_mo)
|
||||
x$MDRO <- ifelse(!is.na(x$genus), 1, NA_integer_)
|
||||
x$row_number <- seq_len(nrow(x))
|
||||
x$reason <- ""
|
||||
x$reason <- NA_character_
|
||||
x$all_nonsusceptible_columns <- ""
|
||||
|
||||
if (guideline$code == "cmi2012") {
|
||||
@@ -1511,8 +1478,8 @@ mdro <- function(x = NULL,
|
||||
fluoroquinolones <- c(CIP, NOR, LVX) # note 5: ciprofloxacin or norfloxacin or levofloxacin
|
||||
carbapenems <- carbapenems[!is.na(carbapenems)]
|
||||
carbapenems_without_imipenem <- carbapenems[carbapenems != IPM]
|
||||
amino <- AMX %or_if_na% AMP
|
||||
third <- CAZ %or_if_na% CTX
|
||||
amino <- AMX %or% AMP
|
||||
third <- CAZ %or% CTX
|
||||
ESBLs <- c(amino, third)
|
||||
ESBLs <- ESBLs[!is.na(ESBLs)]
|
||||
if (length(ESBLs) != 2) {
|
||||
@@ -1524,14 +1491,14 @@ mdro <- function(x = NULL,
|
||||
trans_tbl(
|
||||
2, # positive, unconfirmed
|
||||
rows = which(x$order == "Enterobacterales" & col_values(x, ESBLs[1]) == "R" & col_values(x, ESBLs[2]) == "R" & is.na(esbl)),
|
||||
cols = c(AMX %or_if_na% AMP, cephalosporins_3rd),
|
||||
cols = c(AMX %or% AMP, cephalosporins_3rd),
|
||||
any_all = "all",
|
||||
reason = "Enterobacterales: potential ESBL"
|
||||
)
|
||||
}
|
||||
trans_tbl(
|
||||
3, # positive
|
||||
rows = which(x$order == "Enterobacterales" & x$esbl == TRUE),
|
||||
rows = which(x$order == "Enterobacterales" & esbl == TRUE),
|
||||
cols = "any",
|
||||
any_all = "any",
|
||||
reason = "Enterobacterales: ESBL"
|
||||
@@ -1552,19 +1519,17 @@ mdro <- function(x = NULL,
|
||||
)
|
||||
trans_tbl(
|
||||
3,
|
||||
rows = which(x$order == "Enterobacterales" & x$carbapenemase == TRUE),
|
||||
rows = which(x$order == "Enterobacterales" & carbapenemase == TRUE),
|
||||
cols = "any",
|
||||
any_all = "any",
|
||||
reason = "Enterobacterales: carbapenemase"
|
||||
)
|
||||
c.freundii_complex <- AMR::microorganisms.groups$mo_name[AMR::microorganisms.groups$mo_group_name == "Citrobacter freundii complex"]
|
||||
c.freundii_complex <- paste(c.freundii_complex, collapse = "|")
|
||||
trans_tbl(
|
||||
3,
|
||||
rows = which(col_values(x, SXT) == "R" &
|
||||
(col_values(x, GEN) == "R" | col_values(x, TOB) == "R" | col_values(x, AMK) == "R") &
|
||||
(col_values(x, CIP) == "R" | col_values(x, NOR) == "R" | col_values(x, LVX) == "R") &
|
||||
(x$fullname %like_case% c.freundii_complex | x$genus %in% c("Enterobacter", "Providencia") | paste(x$genus, x$species) %in% c("Klebsiella aerogenes", "Hafnia alvei", "Morganella morganii"))),
|
||||
(x$genus %in% c("Enterobacter", "Providencia") | paste(x$genus, x$species) %in% c("Citrobacter freundii", "Klebsiella aerogenes", "Hafnia alvei", "Morganella morganii"))),
|
||||
cols = c(SXT, aminoglycosides, fluoroquinolones),
|
||||
any_all = "any",
|
||||
reason = "Enterobacterales group II: aminoglycoside + fluoroquinolone + cotrimoxazol"
|
||||
@@ -1581,27 +1546,25 @@ mdro <- function(x = NULL,
|
||||
)
|
||||
|
||||
# Acinetobacter baumannii-calcoaceticus complex
|
||||
a.baumannii_complex <- AMR::microorganisms.groups$mo_name[AMR::microorganisms.groups$mo_group_name == "Acinetobacter baumannii complex"]
|
||||
a.baumannii_complex <- paste(a.baumannii_complex, collapse = "|")
|
||||
trans_tbl(
|
||||
3,
|
||||
rows = which((col_values(x, GEN) == "R" | col_values(x, TOB) == "R" | col_values(x, AMK) == "R") &
|
||||
(col_values(x, CIP) == "R" | col_values(x, LVX) == "R") &
|
||||
x$fullname %like_case% a.baumannii_complex),
|
||||
x[[col_mo]] %in% AMR::microorganisms.groups$mo[AMR::microorganisms.groups$mo_group_name == "Acinetobacter baumannii complex"]),
|
||||
cols = c(aminoglycosides, CIP, LVX),
|
||||
any_all = "any",
|
||||
reason = "A. baumannii-calcoaceticus complex: aminoglycoside + ciprofloxacin or levofloxacin"
|
||||
)
|
||||
trans_tbl(
|
||||
2, # unconfirmed
|
||||
rows = which(x$fullname %like_case% a.baumannii_complex & is.na(x$carbapenemase)),
|
||||
rows = which(x[[col_mo]] %in% AMR::microorganisms.groups$mo[AMR::microorganisms.groups$mo_group_name == "Acinetobacter baumannii complex"] & is.na(carbapenemase)),
|
||||
cols = carbapenems,
|
||||
any_all = "any",
|
||||
reason = "A. baumannii-calcoaceticus complex: potential carbapenemase"
|
||||
)
|
||||
trans_tbl(
|
||||
3,
|
||||
rows = which(x$fullname %like_case% a.baumannii_complex & x$carbapenemase == TRUE),
|
||||
rows = which(x[[col_mo]] %in% AMR::microorganisms.groups$mo[AMR::microorganisms.groups$mo_group_name == "Acinetobacter baumannii complex"] & carbapenemase == TRUE),
|
||||
cols = carbapenems,
|
||||
any_all = "any",
|
||||
reason = "A. baumannii-calcoaceticus complex: carbapenemase"
|
||||
@@ -1611,7 +1574,6 @@ mdro <- function(x = NULL,
|
||||
x$psae <- 0
|
||||
x$psae <- x$psae + ifelse(NA_as_FALSE(col_values(x, TOB) == "R") | NA_as_FALSE(col_values(x, AMK) == "R"), 1, 0)
|
||||
x$psae <- x$psae + ifelse(NA_as_FALSE(col_values(x, IPM) == "R") | NA_as_FALSE(col_values(x, MEM) == "R"), 1, 0)
|
||||
x$psae <- x$psae + ifelse(NA_as_FALSE(x$carbapenemase), 1, 0)
|
||||
x$psae <- x$psae + ifelse(NA_as_FALSE(col_values(x, PIP) == "R") | NA_as_FALSE(col_values(x, TZP) == "R"), 1, 0)
|
||||
x$psae <- x$psae + ifelse(NA_as_FALSE(col_values(x, CAZ) == "R") | NA_as_FALSE(col_values(x, CZA) == "R"), 1, 0)
|
||||
x$psae <- x$psae + ifelse(NA_as_FALSE(col_values(x, CIP) == "R") | NA_as_FALSE(col_values(x, NOR) == "R") | NA_as_FALSE(col_values(x, LVX) == "R"), 1, 0)
|
||||
@@ -1634,13 +1596,13 @@ mdro <- function(x = NULL,
|
||||
trans_tbl(
|
||||
3,
|
||||
rows = which(x$genus == "Enterococcus" & x$species == "faecium"),
|
||||
cols = c(PEN %or_if_na% AMX %or_if_na% AMP, VAN),
|
||||
cols = c(PEN %or% AMX %or% AMP, VAN),
|
||||
any_all = "all",
|
||||
reason = "E. faecium: vancomycin + penicillin group"
|
||||
)
|
||||
trans_tbl(
|
||||
3,
|
||||
rows = which(x$genus == "Enterococcus" & x$species == "faecium" & (x$vanA == TRUE | x$vanB == TRUE)),
|
||||
rows = which(x$genus == "Enterococcus" & x$species == "faecium" & (vanA == TRUE | vanB == TRUE)),
|
||||
cols = c(PEN, AMX, AMP, VAN),
|
||||
any_all = "any",
|
||||
reason = "E. faecium: vanA/vanB gene + penicillin group"
|
||||
@@ -1649,14 +1611,14 @@ mdro <- function(x = NULL,
|
||||
# Staphylococcus aureus complex (= aureus, argenteus or schweitzeri)
|
||||
trans_tbl(
|
||||
2,
|
||||
rows = which(x$genus == "Staphylococcus" & x$species %in% c("aureus", "argenteus", "schweitzeri") & (is.na(x$mecA) | is.na(x$mecC))),
|
||||
rows = which(x$genus == "Staphylococcus" & x$species %in% c("aureus", "argenteus", "schweitzeri") & (is.na(mecA) | is.na(mecC))),
|
||||
cols = c(AMC, TZP, FLC, OXA, FOX, FOX1),
|
||||
any_all = "any",
|
||||
reason = "S. aureus complex: potential MRSA"
|
||||
)
|
||||
trans_tbl(
|
||||
3,
|
||||
rows = which(x$genus == "Staphylococcus" & x$species %in% c("aureus", "argenteus", "schweitzeri") & (x$mecA == TRUE | x$mecC == TRUE)),
|
||||
rows = which(x$genus == "Staphylococcus" & x$species %in% c("aureus", "argenteus", "schweitzeri") & (mecA == TRUE | mecC == TRUE)),
|
||||
cols = "any",
|
||||
any_all = "any",
|
||||
reason = "S. aureus complex: mecA/mecC gene"
|
||||
@@ -1677,8 +1639,8 @@ mdro <- function(x = NULL,
|
||||
aminoglycosides <- aminoglycosides[!is.na(aminoglycosides)]
|
||||
fluoroquinolones <- fluoroquinolones[!is.na(fluoroquinolones)]
|
||||
carbapenems <- carbapenems[!is.na(carbapenems)]
|
||||
amino <- AMX %or_if_na% AMP
|
||||
third <- CAZ %or_if_na% CTX
|
||||
amino <- AMX %or% AMP
|
||||
third <- CAZ %or% CTX
|
||||
ESBLs <- c(amino, third)
|
||||
ESBLs <- ESBLs[!is.na(ESBLs)]
|
||||
if (length(ESBLs) != 2) {
|
||||
@@ -1854,7 +1816,6 @@ mdro <- function(x = NULL,
|
||||
|
||||
if (isTRUE(info.bak)) {
|
||||
cat(group_msg)
|
||||
cat("\n")
|
||||
if (sum(!is.na(x$MDRO)) == 0) {
|
||||
cat(font_bold(paste0("=> Found 0 MDROs since no isolates are covered by the guideline")))
|
||||
} else {
|
||||
@@ -1877,15 +1838,14 @@ mdro <- function(x = NULL,
|
||||
))
|
||||
if (length(rows_empty) > 0) {
|
||||
if (isTRUE(info.bak)) {
|
||||
cat(font_italic(paste0("\n (another ", length(rows_empty), " isolates had no test results)\n")))
|
||||
cat(font_italic(paste0(" (", length(rows_empty), " isolates had no test results)\n")))
|
||||
}
|
||||
} else if (isTRUE(info.bak)) {
|
||||
cat("\n")
|
||||
}
|
||||
|
||||
if (isTRUE(info.bak) && !isTRUE(verbose)) {
|
||||
cat("\n")
|
||||
cat(format_inline_("Rerun with {.code verbose = TRUE} to retrieve detailed info and reasons for every MDRO classification.\n"))
|
||||
cat("\nRerun with 'verbose = TRUE' to retrieve detailed info and reasons for every MDRO classification.\n")
|
||||
}
|
||||
|
||||
# Results ----
|
||||
@@ -1893,8 +1853,8 @@ mdro <- function(x = NULL,
|
||||
if (any(x$MDRO == -1, na.rm = TRUE)) {
|
||||
if (message_not_thrown_before("mdro", "availability")) {
|
||||
warning_(
|
||||
"in {.help [{.fun mdro}](AMR::mdro)}: NA introduced for isolates where the available percentage of antimicrobial classes was below ",
|
||||
percentage(pct_required_classes), " (set with {.arg pct_required_classes})"
|
||||
"in `mdro()`: NA introduced for isolates where the available percentage of antimicrobial classes was below ",
|
||||
percentage(pct_required_classes), " (set with `pct_required_classes`)"
|
||||
)
|
||||
}
|
||||
# set these -1s to NA
|
||||
@@ -1939,15 +1899,10 @@ mdro <- function(x = NULL,
|
||||
# fill in empty reasons
|
||||
x$reason[is.na(x$reason)] <- "not covered by guideline"
|
||||
x[rows_empty, "reason"] <- paste(x[rows_empty, "reason"], "(note: no available test results)")
|
||||
# starting semicolons must be removed
|
||||
x$reason <- trimws(gsub("^;", "", x$reason))
|
||||
# if criteria were not met initially, but later they were, then they have a following semicolon; remove the initial lack of meeting criteria
|
||||
x$reason <- trimws(gsub("guideline criteria not met;", "", x$reason, fixed = TRUE))
|
||||
# format data set
|
||||
colnames(x)[colnames(x) == col_mo] <- "microorganism"
|
||||
x$microorganism <- mo_name(x$microorganism, language = NULL)
|
||||
x$guideline <- paste0(guideline$author, " - ", guideline$name, ifelse(is.na(guideline$version), "", paste0(" (", guideline$version, ")")))
|
||||
x$all_nonsusceptible_columns <- gsub(".inferred_sir_proxy_from#(.*?)#", " (inferred from \\1)", x$all_nonsusceptible_columns, perl = TRUE)
|
||||
x$guideline <- paste0(guideline$author, " - ", guideline$name, ", ", guideline$version, ")")
|
||||
x[, c(
|
||||
"row_number",
|
||||
"microorganism",
|
||||
@@ -1970,7 +1925,7 @@ brmo <- function(x = NULL, only_sir_columns = any(is.sir(x)), ...) {
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
stop_if(
|
||||
"guideline" %in% names(list(...)),
|
||||
"argument {.arg guideline} must not be set since this is a guideline-specific function"
|
||||
"argument `guideline` must not be set since this is a guideline-specific function"
|
||||
)
|
||||
mdro(x = x, only_sir_columns = only_sir_columns, guideline = "BRMO", ...)
|
||||
}
|
||||
@@ -1983,7 +1938,7 @@ mrgn <- function(x = NULL, only_sir_columns = any(is.sir(x)), verbose = FALSE, .
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
stop_if(
|
||||
"guideline" %in% names(list(...)),
|
||||
"argument {.arg guideline} must not be set since this is a guideline-specific function"
|
||||
"argument `guideline` must not be set since this is a guideline-specific function"
|
||||
)
|
||||
mdro(x = x, only_sir_columns = only_sir_columns, verbose = verbose, guideline = "MRGN", ...)
|
||||
}
|
||||
@@ -1995,7 +1950,7 @@ mdr_tb <- function(x = NULL, only_sir_columns = any(is.sir(x)), verbose = FALSE,
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
stop_if(
|
||||
"guideline" %in% names(list(...)),
|
||||
"argument {.arg guideline} must not be set since this is a guideline-specific function"
|
||||
"argument `guideline` must not be set since this is a guideline-specific function"
|
||||
)
|
||||
mdro(x = x, only_sir_columns = only_sir_columns, verbose = verbose, guideline = "TB", ...)
|
||||
}
|
||||
@@ -2007,7 +1962,7 @@ mdr_cmi2012 <- function(x = NULL, only_sir_columns = any(is.sir(x)), verbose = F
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
stop_if(
|
||||
"guideline" %in% names(list(...)),
|
||||
"argument {.arg guideline} must not be set since this is a guideline-specific function"
|
||||
"argument `guideline` must not be set since this is a guideline-specific function"
|
||||
)
|
||||
mdro(x = x, only_sir_columns = only_sir_columns, verbose = verbose, guideline = "CMI 2012", ...)
|
||||
}
|
||||
@@ -2019,7 +1974,7 @@ eucast_exceptional_phenotypes <- function(x = NULL, only_sir_columns = any(is.si
|
||||
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
|
||||
stop_if(
|
||||
"guideline" %in% names(list(...)),
|
||||
"argument {.arg guideline} must not be set since this is a guideline-specific function"
|
||||
"argument `guideline` must not be set since this is a guideline-specific function"
|
||||
)
|
||||
mdro(x = x, only_sir_columns = only_sir_columns, verbose = verbose, guideline = "EUCAST", ...)
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ mean_amr_distance.disk <- function(x, ...) {
|
||||
mean_amr_distance.sir <- function(x, ..., combine_SI = TRUE) {
|
||||
meet_criteria(combine_SI, allow_class = "logical", has_length = 1, .call_depth = -1)
|
||||
if (isTRUE(combine_SI)) {
|
||||
x[x %in% c("I", "SDD")] <- "S" # do not acknowledge CLSI/EUCAST guideline here to keep the numeric mean_amr_distance consistent between systems
|
||||
x[x %in% c("I", "SDD")] <- "S"
|
||||
}
|
||||
mean_amr_distance(as.double(x))
|
||||
}
|
||||
|
||||
90
R/mic.R
Executable file → Normal file
90
R/mic.R
Executable file → Normal file
@@ -63,7 +63,6 @@ COMMON_MIC_VALUES <- c(
|
||||
#' @param x A [character] or [numeric] vector.
|
||||
#' @param na.rm A [logical] indicating whether missing values should be removed.
|
||||
#' @param keep_operators A [character] specifying how to handle operators (such as `>` and `<=`) in the input. Accepts one of three values: `"all"` (or `TRUE`) to keep all operators, `"none"` (or `FALSE`) to remove all operators, or `"edges"` to keep operators only at both ends of the range.
|
||||
#' @param round_to_next_log2 A [logical] to round up all values to the next log2 level, that are not either `r vector_or(COMMON_MIC_VALUES, quotes = F)`. Values that are already in this list (with or without operators), are left unchanged (including any operators).
|
||||
#' @param ... Arguments passed on to methods.
|
||||
#' @details To interpret MIC values as SIR values, use [as.sir()] on MIC values. It supports guidelines from EUCAST (`r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`) and CLSI (`r min(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(clinical_breakpoints, guideline %like% "CLSI")$guideline)))`).
|
||||
#'
|
||||
@@ -72,7 +71,7 @@ COMMON_MIC_VALUES <- c(
|
||||
#' ```
|
||||
#' x <- random_mic(10)
|
||||
#' x
|
||||
#' #> Class <mic>
|
||||
#' #> Class 'mic'
|
||||
#' #> [1] 16 1 8 8 64 >=128 0.0625 32 32 16
|
||||
#'
|
||||
#' is.factor(x)
|
||||
@@ -89,7 +88,7 @@ COMMON_MIC_VALUES <- c(
|
||||
#'
|
||||
#' ```
|
||||
#' x[x > 4]
|
||||
#' #> Class <mic>
|
||||
#' #> Class 'mic'
|
||||
#' #> [1] 16 8 8 64 >=128 32 32 16
|
||||
#'
|
||||
#' df <- data.frame(x, hospital = "A")
|
||||
@@ -126,7 +125,7 @@ COMMON_MIC_VALUES <- c(
|
||||
#' # this can also coerce combined MIC/SIR values:
|
||||
#' as.mic("<=0.002; S")
|
||||
#'
|
||||
#' # mathematical processing treats MICs as, and returns, numeric values
|
||||
#' # mathematical processing treats MICs as numeric values
|
||||
#' fivenum(mic_data)
|
||||
#' quantile(mic_data)
|
||||
#' all(mic_data < 512)
|
||||
@@ -134,10 +133,6 @@ COMMON_MIC_VALUES <- c(
|
||||
#' # rescale MICs using rescale_mic()
|
||||
#' rescale_mic(mic_data, mic_range = c(4, 16))
|
||||
#'
|
||||
#' # round up to nearest log2 level, e.g. for CLSI breakpoint interpretation:
|
||||
#' c(1:8)
|
||||
#' as.mic(c(1:8), round_to_next_log2 = TRUE)
|
||||
#'
|
||||
#' # interpret MIC values
|
||||
#' as.sir(
|
||||
#' x = as.mic(2),
|
||||
@@ -162,22 +157,17 @@ COMMON_MIC_VALUES <- c(
|
||||
#' if (require("ggplot2")) {
|
||||
#' autoplot(mic_data, mo = "E. coli", ab = "cipro", language = "nl") # Dutch
|
||||
#' }
|
||||
as.mic <- function(x, na.rm = FALSE, keep_operators = "all", round_to_next_log2 = FALSE) {
|
||||
as.mic <- function(x, na.rm = FALSE, keep_operators = "all") {
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
meet_criteria(na.rm, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(keep_operators, allow_class = c("character", "logical"), is_in = c("all", "none", "edges", FALSE, TRUE), has_length = 1)
|
||||
meet_criteria(round_to_next_log2, allow_class = "logical", has_length = 1)
|
||||
|
||||
if (isTRUE(keep_operators)) {
|
||||
keep_operators <- "all"
|
||||
} else if (isFALSE(keep_operators)) {
|
||||
keep_operators <- "none"
|
||||
}
|
||||
|
||||
if (any(is.mic(x)) && (keep_operators == "all" || !any(x %like% "[>=<]", na.rm = TRUE))) {
|
||||
if (isTRUE(round_to_next_log2)) {
|
||||
x <- roundup_to_nearest_log2(x)
|
||||
}
|
||||
if (is.mic(x) && (keep_operators == "all" || !any(x %like% "[>=<]", na.rm = TRUE))) {
|
||||
if (!identical(levels(x), VALID_MIC_LEVELS)) {
|
||||
# might be from an older AMR version - just update MIC factor levels
|
||||
x <- set_clean_class(factor(as.character(x), levels = VALID_MIC_LEVELS, ordered = TRUE),
|
||||
@@ -217,9 +207,8 @@ as.mic <- function(x, na.rm = FALSE, keep_operators = "all", round_to_next_log2
|
||||
warning_("Some MICs were combined values, only the first values are kept")
|
||||
x[x %like% "[0-9]/.*[0-9]"] <- gsub("/.*", "", x[x %like% "[0-9]/.*[0-9]"])
|
||||
}
|
||||
x <- trimws2(gsub("[^e\\P{L}]", "", x, perl = TRUE)) # \p{L} is the Unicode category for all letters, including those with diacritics
|
||||
# remove other invalid characters
|
||||
x <- gsub("[^0-9e.><= -]+", "", x, perl = TRUE)
|
||||
x <- gsub("[^a-zA-Z0-9.><= -]+", "", x, perl = TRUE)
|
||||
# transform => to >= and =< to <=
|
||||
x <- gsub("=<", "<=", x, fixed = TRUE)
|
||||
x <- gsub("=>", ">=", x, fixed = TRUE)
|
||||
@@ -269,9 +258,9 @@ as.mic <- function(x, na.rm = FALSE, keep_operators = "all", round_to_next_log2
|
||||
sort() %pm>%
|
||||
vector_and(quotes = TRUE)
|
||||
cur_col <- get_current_column()
|
||||
warning_("in {.help [{.fun as.mic}](AMR::as.mic)}: ", na_after - na_before, " result",
|
||||
warning_("in `as.mic()`: ", na_after - na_before, " result",
|
||||
ifelse(na_after - na_before > 1, "s", ""),
|
||||
ifelse(is.null(cur_col), "", paste0(" in column {.field ", font_bold(cur_col, collapse = NULL), "}")),
|
||||
ifelse(is.null(cur_col), "", paste0(" in index '", cur_col, "'")),
|
||||
" truncated (",
|
||||
round(((na_after - na_before) / length(x)) * 100),
|
||||
"%) that were invalid MICs: ",
|
||||
@@ -290,10 +279,6 @@ as.mic <- function(x, na.rm = FALSE, keep_operators = "all", round_to_next_log2
|
||||
x[!x %in% keep] <- gsub("[>=<]", "", x[!x %in% keep])
|
||||
}
|
||||
|
||||
if (isTRUE(round_to_next_log2)) {
|
||||
x <- roundup_to_nearest_log2(x)
|
||||
}
|
||||
|
||||
set_clean_class(factor(x, levels = VALID_MIC_LEVELS, ordered = TRUE),
|
||||
new_class = c("mic", "ordered", "factor")
|
||||
)
|
||||
@@ -320,19 +305,18 @@ NA_mic_ <- set_clean_class(factor(NA, levels = VALID_MIC_LEVELS, ordered = TRUE)
|
||||
#' @rdname as.mic
|
||||
#' @param mic_range A manual range to rescale the MIC values, e.g., `mic_range = c(0.001, 32)`. Use `NA` to prevent rescaling on one side, e.g., `mic_range = c(NA, 32)`.
|
||||
#' @export
|
||||
rescale_mic <- function(x, mic_range, keep_operators = "edges", as.mic = TRUE, round_to_next_log2 = FALSE) {
|
||||
rescale_mic <- function(x, mic_range, keep_operators = "edges", as.mic = TRUE) {
|
||||
meet_criteria(mic_range, allow_class = c("numeric", "integer", "logical", "mic"), has_length = 2, allow_NA = TRUE, allow_NULL = TRUE)
|
||||
|
||||
if (is.numeric(mic_range)) {
|
||||
mic_range <- trimws(format(mic_range, scientific = FALSE))
|
||||
mic_range <- gsub("[.]0+$", "", mic_range)
|
||||
mic_range[mic_range == "NA"] <- NA_character_
|
||||
} else if (any(is.mic(mic_range))) {
|
||||
} else if (is.mic(mic_range)) {
|
||||
mic_range <- as.character(mic_range)
|
||||
}
|
||||
stop_ifnot(
|
||||
all(mic_range %in% c(VALID_MIC_LEVELS, NA)),
|
||||
"Values in {.arg mic_range} must be valid MIC values. ",
|
||||
"Values in `mic_range` must be valid MIC values. ",
|
||||
"The allowed range is ", format(as.double(as.mic(VALID_MIC_LEVELS)[1]), scientific = FALSE), " to ", format(as.double(as.mic(VALID_MIC_LEVELS)[length(VALID_MIC_LEVELS)]), scientific = FALSE), ". ",
|
||||
"Unvalid: ", vector_and(mic_range[!mic_range %in% c(VALID_MIC_LEVELS, NA)], quotes = FALSE), "."
|
||||
)
|
||||
@@ -352,7 +336,7 @@ rescale_mic <- function(x, mic_range, keep_operators = "edges", as.mic = TRUE, r
|
||||
x[x > max_mic] <- max_mic
|
||||
}
|
||||
|
||||
x <- as.mic(x, keep_operators = ifelse(keep_operators == "edges", "none", keep_operators), round_to_next_log2 = round_to_next_log2)
|
||||
x <- as.mic(x, keep_operators = ifelse(keep_operators == "edges", "none", keep_operators))
|
||||
|
||||
if (isTRUE(as.mic)) {
|
||||
if (keep_operators == "edges" && length(unique(x)) > 1) {
|
||||
@@ -442,19 +426,23 @@ all_valid_mics <- function(x) {
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(pillar::pillar_shaft, mic)
|
||||
pillar_shaft.mic <- function(x, ...) {
|
||||
if (!identical(levels(x), VALID_MIC_LEVELS) && message_not_thrown_before("pillar_shaft.mic")) {
|
||||
warning_(AMR_env$sup_1_icon, " These columns contain an outdated or altered structure - convert with {.fun as.mic} to update",
|
||||
warning_(AMR_env$sup_1_icon, " These columns contain an outdated or altered structure - convert with `as.mic()` to update",
|
||||
call = FALSE
|
||||
)
|
||||
}
|
||||
crude_numbers <- as.double(x)
|
||||
operators <- gsub("[^<=>]+", "", as.character(x))
|
||||
# colourise operators
|
||||
operators[!is.na(operators) & operators != ""] <- pillar::style_subtle(operators[!is.na(operators) & operators != ""])
|
||||
operators[!is.na(operators) & operators != ""] <- font_silver(operators[!is.na(operators) & operators != ""], collapse = NULL)
|
||||
out <- trimws(paste0(operators, trimws(format(crude_numbers))))
|
||||
out[is.na(x)] <- pillar::style_na(NA)
|
||||
out[is.na(x)] <- font_na(NA)
|
||||
# make trailing zeroes less visible
|
||||
out[out %like% "[.]"] <- gsub("([.]?0+)$", pillar::style_subtle("\\1"), out[out %like% "[.]"], perl = TRUE)
|
||||
|
||||
if (is_dark()) {
|
||||
fn <- font_silver
|
||||
} else {
|
||||
fn <- font_white
|
||||
}
|
||||
out[out %like% "[.]"] <- gsub("([.]?0+)$", fn("\\1"), out[out %like% "[.]"], perl = TRUE)
|
||||
create_pillar_column(out, align = "right", width = max(nchar(font_stripstyle(out))))
|
||||
}
|
||||
|
||||
@@ -472,7 +460,7 @@ type_sum.mic <- function(x, ...) {
|
||||
#' @export
|
||||
#' @noRd
|
||||
print.mic <- function(x, ...) {
|
||||
cat(format_inline_("Class {.cls mic}"))
|
||||
cat("Class 'mic'")
|
||||
if (!identical(levels(x), VALID_MIC_LEVELS)) {
|
||||
cat(font_red(" with an outdated or altered structure - convert with `as.mic()` to update"))
|
||||
}
|
||||
@@ -505,7 +493,7 @@ as.vector.mic <- function(x, mode = "numneric", ...) {
|
||||
y <- as.mic(y)
|
||||
calls <- unlist(lapply(sys.calls(), as.character))
|
||||
if (any(calls %in% c("rbind", "cbind")) && message_not_thrown_before("as.vector.mic")) {
|
||||
warning_("Functions {.fun rbind} and {.fun cbind} cannot preserve the structure of MIC values. Use {.pkg dplyr}'s {.fun bind_rows} or {.fun bind_cols} instead.", call = FALSE)
|
||||
warning_("Functions `rbind()` and `cbind()` cannot preserve the structure of MIC values. Use dplyr's `bind_rows()` or `bind_cols()` instead.", call = FALSE)
|
||||
}
|
||||
y
|
||||
}
|
||||
@@ -598,7 +586,7 @@ sort.mic <- function(x, decreasing = FALSE, ...) {
|
||||
#' @export
|
||||
#' @noRd
|
||||
hist.mic <- function(x, ...) {
|
||||
warning_("in {.fun hist}: use {.fun plot} or {.pkg ggplot2}'s {.fun autoplot} for optimal plotting of MIC values")
|
||||
warning_("in `hist()`: use `plot()` or ggplot2's `autoplot()` for optimal plotting of MIC values")
|
||||
hist(log2(x))
|
||||
}
|
||||
|
||||
@@ -608,33 +596,15 @@ get_skimmers.mic <- function(column) {
|
||||
column <- as.mic(column) # make sure that currently implemented MIC levels are used
|
||||
skimr::sfl(
|
||||
skim_type = "mic",
|
||||
p0 = ~ stats::quantile(column, probs = 0, na.rm = TRUE, names = FALSE),
|
||||
p25 = ~ stats::quantile(column, probs = 0.25, na.rm = TRUE, names = FALSE),
|
||||
p50 = ~ stats::quantile(column, probs = 0.5, na.rm = TRUE, names = FALSE),
|
||||
p75 = ~ stats::quantile(column, probs = 0.75, na.rm = TRUE, names = FALSE),
|
||||
p100 = ~ stats::quantile(column, probs = 1, na.rm = TRUE, names = FALSE),
|
||||
hist = ~ skimr::inline_hist(log2(stats::na.omit(column)), 10)
|
||||
p0 = ~ stats::quantile(., probs = 0, na.rm = TRUE, names = FALSE),
|
||||
p25 = ~ stats::quantile(., probs = 0.25, na.rm = TRUE, names = FALSE),
|
||||
p50 = ~ stats::quantile(., probs = 0.5, na.rm = TRUE, names = FALSE),
|
||||
p75 = ~ stats::quantile(., probs = 0.75, na.rm = TRUE, names = FALSE),
|
||||
p100 = ~ stats::quantile(., probs = 1, na.rm = TRUE, names = FALSE),
|
||||
hist = ~ skimr::inline_hist(log2(stats::na.omit(.)), 5)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
roundup_to_nearest_log2 <- function(x) {
|
||||
x_dbl <- suppressWarnings(as.double(gsub("[>=<]", "", x)))
|
||||
x_new <- vapply(
|
||||
FUN.VALUE = double(1),
|
||||
x_dbl,
|
||||
function(val) {
|
||||
if (is.na(val)) {
|
||||
NA_real_
|
||||
} else {
|
||||
COMMON_MIC_VALUES[which(COMMON_MIC_VALUES >= val)][1]
|
||||
}
|
||||
}
|
||||
)
|
||||
x[!x_dbl %in% COMMON_MIC_VALUES] <- x_new[!x_dbl %in% COMMON_MIC_VALUES]
|
||||
x
|
||||
}
|
||||
|
||||
# Miscellaneous mathematical functions ------------------------------------
|
||||
|
||||
#' @method mean mic
|
||||
|
||||
282
R/mo.R
282
R/mo.R
@@ -29,7 +29,7 @@
|
||||
|
||||
#' Transform Arbitrary Input to Valid Microbial Taxonomy
|
||||
#'
|
||||
#' Use this function to get a valid microorganism code ([`mo`]) based on arbitrary user input. Determination is done using intelligent rules and the complete taxonomic tree of the domains `r vector_and(unique(microorganisms$domain[which(!grepl("(unknown|Fungi)", microorganisms$domain))]), quotes = FALSE)`, and most microbial species from the domain Fungi (see *Source*). The input can be almost anything: a full name (like `"Staphylococcus aureus"`), an abbreviated name (such as `"S. aureus"`), an abbreviation known in the field (such as `"MRSA"`), or just a genus. See *Examples*.
|
||||
#' Use this function to get a valid microorganism code ([`mo`]) based on arbitrary user input. Determination is done using intelligent rules and the complete taxonomic tree of the kingdoms `r vector_and(unique(microorganisms$kingdom[which(!grepl("(unknown|Fungi)", microorganisms$kingdom))]), quotes = FALSE)`, and most microbial species from the kingdom Fungi (see *Source*). The input can be almost anything: a full name (like `"Staphylococcus aureus"`), an abbreviated name (such as `"S. aureus"`), an abbreviation known in the field (such as `"MRSA"`), or just a genus. See *Examples*.
|
||||
#' @param x A [character] vector or a [data.frame] with one or two columns.
|
||||
#' @param Becker A [logical] to indicate whether staphylococci should be categorised into coagulase-negative staphylococci ("CoNS") and coagulase-positive staphylococci ("CoPS") instead of their own species, according to Karsten Becker *et al.* (see *Source*). Please see *Details* for a full list of staphylococcal species that will be converted.
|
||||
#'
|
||||
@@ -37,16 +37,14 @@
|
||||
#' @param Lancefield A [logical] to indicate whether a beta-haemolytic *Streptococcus* should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield (see *Source*). These streptococci will be categorised in their first group, e.g. *Streptococcus dysgalactiae* will be group C, although officially it was also categorised into groups G and L. . Please see *Details* for a full list of streptococcal species that will be converted.
|
||||
#'
|
||||
#' This excludes enterococci at default (who are in group D), use `Lancefield = "all"` to also categorise all enterococci as group D.
|
||||
#' @param minimum_matching_score A numeric value to set as the lower limit for the [MO matching score][mo_matching_score()]. When left blank, this will be determined automatically based on the character length of `x`, its [taxonomic domain][microorganisms] and [human pathogenicity][mo_matching_score()].
|
||||
#' @param keep_synonyms A [logical] to indicate if outdated, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. Do note that the term "synonym" is in this case jargon from the field of microbial taxonomy - it is not in place to denote that e.g. "Streptococcus Group A" is a synonym of *S. pyogenes*. Though this is practically the case, taxonomically it is not as "Streptococcus Group A" is not even a valid taxonomic name.
|
||||
#'
|
||||
#' The default is `FALSE`, which will return a note if outdated taxonomic names were processed. The default can be set with the package option [`AMR_keep_synonyms`][AMR-options], i.e. `options(AMR_keep_synonyms = TRUE)` or `options(AMR_keep_synonyms = FALSE)`.
|
||||
#' @param minimum_matching_score A numeric value to set as the lower limit for the [MO matching score][mo_matching_score()]. When left blank, this will be determined automatically based on the character length of `x`, its [taxonomic kingdom][microorganisms] and [human pathogenicity][mo_matching_score()].
|
||||
#' @param keep_synonyms A [logical] to indicate if old, previously valid taxonomic names must be preserved and not be corrected to currently accepted names. The default is `FALSE`, which will return a note if old taxonomic names were processed. The default can be set with the package option [`AMR_keep_synonyms`][AMR-options], i.e. `options(AMR_keep_synonyms = TRUE)` or `options(AMR_keep_synonyms = FALSE)`.
|
||||
#' @param reference_df A [data.frame] to be used for extra reference when translating `x` to a valid [`mo`]. See [set_mo_source()] and [get_mo_source()] to automate the usage of your own codes (e.g. used in your analysis or organisation).
|
||||
#' @param ignore_pattern A Perl-compatible [regular expression][base::regex] (case-insensitive) of which all matches in `x` must return `NA`. This can be convenient to exclude known non-relevant input and can also be set with the package option [`AMR_ignore_pattern`][AMR-options], e.g. `options(AMR_ignore_pattern = "(not reported|contaminated flora)")`.
|
||||
#' @param cleaning_regex A Perl-compatible [regular expression][base::regex] (case-insensitive) to clean the input of `x`. Every matched part in `x` will be removed. At default, this is the outcome of [mo_cleaning_regex()], which removes texts between brackets and texts such as "species" and "serovar". The default can be set with the package option [`AMR_cleaning_regex`][AMR-options].
|
||||
#' @param only_fungi A [logical] to indicate if only fungi must be found, making sure that e.g. misspellings always return records from the domain of Fungi. This can be set globally for [all microorganism functions][mo_property()] with the package option [`AMR_only_fungi`][AMR-options], i.e. `options(AMR_only_fungi = TRUE)`.
|
||||
#' @param only_fungi A [logical] to indicate if only fungi must be found, making sure that e.g. misspellings always return records from the kingdom of Fungi. This can be set globally for [all microorganism functions][mo_property()] with the package option [`AMR_only_fungi`][AMR-options], i.e. `options(AMR_only_fungi = TRUE)`.
|
||||
#' @param language Language to translate text like "no growth", which defaults to the system language (see [get_AMR_locale()]).
|
||||
#' @param info A [logical] to indicate that info must be printed, e.g. a progress bar when more than 25 items are to be coerced, or a list with outdated taxonomic names. The default is `TRUE` only in interactive mode.
|
||||
#' @param info A [logical] to indicate that info must be printed, e.g. a progress bar when more than 25 items are to be coerced, or a list with old taxonomic names. The default is `TRUE` only in interactive mode.
|
||||
#' @param ... Other arguments passed on to functions.
|
||||
#' @rdname as.mo
|
||||
#' @aliases mo
|
||||
@@ -64,7 +62,7 @@
|
||||
#' | | | \---> subspecies, a 3-5 letter acronym
|
||||
#' | | \----> species, a 3-6 letter acronym
|
||||
#' | \----> genus, a 4-8 letter acronym
|
||||
#' \----> domain: A (Archaea), AN (Animalia), B (Bacteria),
|
||||
#' \----> kingdom: A (Archaea), AN (Animalia), B (Bacteria),
|
||||
#' C (Chromista), F (Fungi), PL (Plantae),
|
||||
#' P (Protozoa)
|
||||
#' ```
|
||||
@@ -77,14 +75,14 @@
|
||||
#'
|
||||
#' ### Coping with Uncertain Results
|
||||
#'
|
||||
#' Results of non-exact taxonomic input are based on their [matching score][mo_matching_score()]. The lowest allowed score can be set with the `minimum_matching_score` argument. At default this will be determined based on the character length of the input, the [taxonomic domain][microorganisms], and the [human pathogenicity][mo_matching_score()] of the taxonomic outcome. If values are matched with uncertainty, a message will be shown to suggest the user to inspect the results with [mo_uncertainties()], which returns a [data.frame] with all specifications.
|
||||
#' Results of non-exact taxonomic input are based on their [matching score][mo_matching_score()]. The lowest allowed score can be set with the `minimum_matching_score` argument. At default this will be determined based on the character length of the input, the [taxonomic kingdom][microorganisms], and the [human pathogenicity][mo_matching_score()] of the taxonomic outcome. If values are matched with uncertainty, a message will be shown to suggest the user to inspect the results with [mo_uncertainties()], which returns a [data.frame] with all specifications.
|
||||
#'
|
||||
#' To increase the quality of matching, the `cleaning_regex` argument is used to clean the input. This must be a [regular expression][base::regex] that matches parts of the input that should be removed before the input is matched against the [available microbial taxonomy][microorganisms]. It will be matched Perl-compatible and case-insensitive. The default value of `cleaning_regex` is the outcome of the helper function [mo_cleaning_regex()].
|
||||
#'
|
||||
#' There are three helper functions that can be run after using the [as.mo()] function:
|
||||
#' - Use [mo_uncertainties()] to get a [data.frame] that prints in a pretty format with all taxonomic names that were guessed. The output contains the matching score for all matches (see *Matching Score for Microorganisms* below).
|
||||
#' - Use [mo_failures()] to get a [character] [vector] with all values that could not be coerced to a valid value.
|
||||
#' - Use [mo_renamed()] to get a [data.frame] with all values that could be coerced based on outdated, previously accepted taxonomic names.
|
||||
#' - Use [mo_renamed()] to get a [data.frame] with all values that could be coerced based on old, previously accepted taxonomic names.
|
||||
#'
|
||||
#' ### For Mycologists
|
||||
#'
|
||||
@@ -241,7 +239,7 @@ as.mo <- function(x,
|
||||
out[is.na(out) & toupper(x) %in% AMR_env$MO_lookup$mo] <- toupper(x[is.na(out) & toupper(x) %in% AMR_env$MO_lookup$mo])
|
||||
# From full name ----
|
||||
out[is.na(out) & x_lower %in% AMR_env$MO_lookup$fullname_lower] <- AMR_env$MO_lookup$mo[match(x_lower[is.na(out) & x_lower %in% AMR_env$MO_lookup$fullname_lower], AMR_env$MO_lookup$fullname_lower)]
|
||||
# one exception: "Fungi" matches the domain, but instead it should return the 'unknown' code for fungi
|
||||
# one exception: "Fungi" matches the kingdom, but instead it should return the 'unknown' code for fungi
|
||||
out[out == "F_[KNG]_FUNGI"] <- "F_FUNGUS"
|
||||
# From known codes ----
|
||||
ind <- is.na(out) & toupper(x) %in% AMR::microorganisms.codes$code
|
||||
@@ -249,7 +247,7 @@ as.mo <- function(x,
|
||||
if (length(which(ind)) > 0 && isTRUE(info) && message_not_thrown_before("as.mo_microorganisms.codes", is.na(out), toupper(x))) {
|
||||
message_(
|
||||
"Retrieved value", ifelse(sum(ind) > 1, "s", ""),
|
||||
" from the {.help [microorganisms.codes](AMR::microorganisms.codes)} data set for ", vector_and(toupper(x)[ind]), "."
|
||||
" from the `microorganisms.codes` data set for ", vector_and(toupper(x)[ind]), "."
|
||||
)
|
||||
}
|
||||
# From SNOMED ----
|
||||
@@ -267,7 +265,7 @@ as.mo <- function(x,
|
||||
if (isTRUE(info) && message_not_thrown_before("as.mo", old, new, entire_session = TRUE) && any(is.na(old) & !is.na(new), na.rm = TRUE)) {
|
||||
message_(
|
||||
"Returning previously coerced value", ifelse(sum(is.na(old) & !is.na(new)) > 1, "s", ""),
|
||||
" for ", vector_and(x[is.na(old) & !is.na(new)]), ". Run {.help [{.fun mo_reset_session}](AMR::mo_reset_session)} to reset this. This note will be shown once per session for this input."
|
||||
" for ", vector_and(x[is.na(old) & !is.na(new)]), ". Run `mo_reset_session()` to reset this. This note will be shown once per session for this input."
|
||||
)
|
||||
}
|
||||
|
||||
@@ -300,7 +298,7 @@ as.mo <- function(x,
|
||||
|
||||
MO_lookup_current <- AMR_env$MO_lookup
|
||||
if (isTRUE(only_fungi)) {
|
||||
MO_lookup_current <- MO_lookup_current[MO_lookup_current$domain == "Fungi", , drop = FALSE]
|
||||
MO_lookup_current <- MO_lookup_current[MO_lookup_current$kingdom == "Fungi", , drop = FALSE]
|
||||
}
|
||||
|
||||
# run it
|
||||
@@ -322,15 +320,6 @@ as.mo <- function(x,
|
||||
return(as.character(MO_lookup_current$mo[match(x_out, MO_lookup_current$fullname_lower)]))
|
||||
}
|
||||
|
||||
# Issue #287: "X complex" is not a distinct taxon - strip " complex" and try "X"
|
||||
if (grepl(" complex$", x_out, ignore.case = FALSE)) {
|
||||
x_out <- sub(" complex$", "", x_out)
|
||||
x_search_cleaned <- sub(" [Cc]omplex$", "", x_search_cleaned)
|
||||
if (x_out %in% MO_lookup_current$fullname_lower) {
|
||||
return(as.character(MO_lookup_current$mo[match(x_out, MO_lookup_current$fullname_lower)]))
|
||||
}
|
||||
}
|
||||
|
||||
# input must not be too short
|
||||
if (nchar(x_out) < 3) {
|
||||
return("UNKNOWN")
|
||||
@@ -352,36 +341,6 @@ as.mo <- function(x,
|
||||
(MO_lookup_current$species_first == substr(x_parts[2], 1, 1) |
|
||||
MO_lookup_current$subspecies_first == substr(x_parts[2], 1, 1) |
|
||||
MO_lookup_current$subspecies_first == substr(x_parts[3], 1, 1)))
|
||||
# Issue #288 (extended): if the species (and subspecies) word(s) in the input
|
||||
# exactly match candidates that all belong to one and the same genus, bypass the
|
||||
# 0.55 cutoff. A species together with its subspecies/autonyms (e.g. Plasmodium
|
||||
# ovale + curtisi + wallikeri) is the same taxon, so for a genus+species input we
|
||||
# collapse to the species-rank record (subspecies == ""). This prevents prevalent
|
||||
# bacteria from outranking a rarer organism whose species epithet is an
|
||||
# unambiguous exact match, e.g. "S. apiospermum" -> Scedosporium, "P. ovale" ->
|
||||
# Plasmodium ovale. If two different genera share the epithet, the genus check
|
||||
# stays FALSE and the normal matching score arbitrates.
|
||||
sp_exact <- tolower(MO_lookup_current$species[filtr]) == x_parts[2]
|
||||
if (length(x_parts) == 3) {
|
||||
sp_exact <- sp_exact & tolower(MO_lookup_current$subspecies[filtr]) == x_parts[3]
|
||||
}
|
||||
exact_idx <- filtr[sp_exact]
|
||||
if (length(exact_idx) >= 1 &&
|
||||
length(unique(MO_lookup_current$genus_lower[exact_idx])) == 1) {
|
||||
if (length(x_parts) == 2) {
|
||||
# genus + species only: collapse to the species-rank record (subspecies == "")
|
||||
is_species_rank <- MO_lookup_current$subspecies[exact_idx] == ""
|
||||
if (any(is_species_rank)) {
|
||||
filtr <- exact_idx[is_species_rank][1]
|
||||
} else {
|
||||
filtr <- exact_idx[1]
|
||||
}
|
||||
} else {
|
||||
# explicit subspecies given, unambiguous within the genus
|
||||
filtr <- exact_idx[1]
|
||||
}
|
||||
minimum_matching_score <- 0
|
||||
}
|
||||
} else {
|
||||
filtr <- which(MO_lookup_current$full_first == substr(x_parts[1], 1, 1) |
|
||||
MO_lookup_current$species_first == substr(x_parts[2], 1, 1) |
|
||||
@@ -424,8 +383,8 @@ as.mo <- function(x,
|
||||
minimum_matching_score_current <- min(0.6, min(10, nchar(x_search_cleaned)) * 0.08)
|
||||
# correct back for prevalence
|
||||
minimum_matching_score_current <- minimum_matching_score_current / MO_lookup_current$prevalence[match(mo_to_search, MO_lookup_current$fullname)]
|
||||
# correct back for domain
|
||||
minimum_matching_score_current <- minimum_matching_score_current / MO_lookup_current$domain_index[match(mo_to_search, MO_lookup_current$fullname)]
|
||||
# correct back for kingdom
|
||||
minimum_matching_score_current <- minimum_matching_score_current / MO_lookup_current$kingdom_index[match(mo_to_search, MO_lookup_current$fullname)]
|
||||
minimum_matching_score_current <- pmax(minimum_matching_score_current, m)
|
||||
if (length(x_parts) > 1 && all(m <= 0.55, na.rm = TRUE)) {
|
||||
# if the highest score is 0.5, we have nothing serious - 0.5 is the lowest for pathogenic group 1
|
||||
@@ -441,14 +400,7 @@ as.mo <- function(x,
|
||||
|
||||
top_hits <- mo_to_search[order(m, decreasing = TRUE, na.last = NA)] # na.last = NA will remove the NAs
|
||||
if (length(top_hits) == 0) {
|
||||
warning_("No hits found for \"", x_search, "\" with minimum_matching_score = ",
|
||||
ifelse(is.null(minimum_matching_score),
|
||||
paste0("NULL (=", round(min(minimum_matching_score_current, na.rm = TRUE), 3), ")"),
|
||||
minimum_matching_score
|
||||
),
|
||||
". Try setting this value lower or even to 0.",
|
||||
call = FALSE
|
||||
)
|
||||
warning_("No hits found for \"", x_search, "\" with minimum_matching_score = ", ifelse(is.null(minimum_matching_score), paste0("NULL (=", round(min(minimum_matching_score_current, na.rm = TRUE), 3), ")"), minimum_matching_score), ". Try setting this value lower or even to 0.", call = FALSE)
|
||||
result_mo <- NA_character_
|
||||
} else {
|
||||
result_mo <- MO_lookup_current$mo[match(top_hits[1], MO_lookup_current$fullname)]
|
||||
@@ -494,8 +446,8 @@ as.mo <- function(x,
|
||||
if (length(AMR_env$mo_uncertainties$original_input) <= 3) {
|
||||
examples <- vector_and(
|
||||
paste0(
|
||||
"{.val ", AMR_env$mo_uncertainties$original_input,
|
||||
"} (assumed ", italicise(AMR_env$mo_uncertainties$fullname), ")"
|
||||
'"', AMR_env$mo_uncertainties$original_input,
|
||||
'" (assumed ', italicise(AMR_env$mo_uncertainties$fullname), ")"
|
||||
),
|
||||
quotes = FALSE
|
||||
)
|
||||
@@ -504,7 +456,7 @@ as.mo <- function(x,
|
||||
}
|
||||
msg <- c(msg, paste0(
|
||||
"Microorganism translation was uncertain for ", examples,
|
||||
". Run {.help [{.fun mo_uncertainties}](AMR::mo_uncertainties)} to review ", plural[2], ", or use {.help [{.fun add_custom_microorganisms}](AMR::add_custom_microorganisms)} to add custom entries."
|
||||
". Run `mo_uncertainties()` to review ", plural[2], ", or use `add_custom_microorganisms()` to add custom entries."
|
||||
))
|
||||
|
||||
for (m in msg) {
|
||||
@@ -520,11 +472,11 @@ as.mo <- function(x,
|
||||
if (isFALSE(keep_synonyms)) {
|
||||
out[!is.na(out_current)] <- out_current[!is.na(out_current)]
|
||||
if (isTRUE(info) && length(AMR_env$mo_renamed$old) > 0) {
|
||||
print(mo_renamed(), extra_txt = " (use {.arg keep_synonyms = TRUE} to leave uncorrected)")
|
||||
print(mo_renamed(), extra_txt = " (use `keep_synonyms = TRUE` to leave uncorrected)")
|
||||
}
|
||||
} else if (is.null(getOption("AMR_keep_synonyms")) && length(AMR_env$mo_renamed$old) > 0 && message_not_thrown_before("as.mo", "keep_synonyms_warning", entire_session = TRUE)) {
|
||||
# keep synonyms is TRUE, so check if any do have synonyms
|
||||
warning_("{.help [{.fun as.mo}](AMR::as.mo)} returned ", nr2char(length(unique(AMR_env$mo_renamed$old))), " outdated taxonomic name", ifelse(length(unique(AMR_env$mo_renamed$old)) > 1, "s", ""), ". Use {.arg keep_synonyms = FALSE} to clean the input to currently accepted taxonomic names, or set the R option {.code AMR_keep_synonyms} to {.code FALSE}. This warning will be shown once per session.", call = FALSE)
|
||||
warning_("Function `as.mo()` returned ", nr2char(length(unique(AMR_env$mo_renamed$old))), " old taxonomic name", ifelse(length(unique(AMR_env$mo_renamed$old)) > 1, "s", ""), ". Use `as.mo(..., keep_synonyms = FALSE)` to clean the input to currently accepted taxonomic names, or set the R option `AMR_keep_synonyms` to `FALSE`. This warning will be shown once per session.", call = FALSE)
|
||||
}
|
||||
|
||||
# Apply Becker ----
|
||||
@@ -541,7 +493,7 @@ as.mo <- function(x,
|
||||
)
|
||||
if (any(out %in% AMR_env$MO_lookup$mo[match(post_Becker, AMR_env$MO_lookup$fullname)])) {
|
||||
if (message_not_thrown_before("as.mo", "becker")) {
|
||||
warning_("in {.help [{.fun as.mo}](AMR::as.mo)}: Becker ", font_italic("et al."), " (2014, 2019, 2020) does not contain these species named after their publication: ",
|
||||
warning_("in `as.mo()`: Becker ", font_italic("et al."), " (2014, 2019, 2020) does not contain these species named after their publication: ",
|
||||
vector_and(font_italic(gsub("Staphylococcus", "S.", post_Becker, fixed = TRUE), collapse = NULL), quotes = FALSE),
|
||||
". Categorisation to CoNS/CoPS was taken from the original scientific publication(s).",
|
||||
immediate = TRUE, call = FALSE
|
||||
@@ -586,7 +538,7 @@ as.mo <- function(x,
|
||||
out[is.na(out) & !is.na(x)] <- "UNKNOWN"
|
||||
AMR_env$mo_failures <- unique(x[out == "UNKNOWN" & !toupper(x) %in% c("UNKNOWN", "CON", "UNK") & !x %like_case% "^[(]unknown [a-z]+[)]$" & !is.na(x)])
|
||||
if (length(AMR_env$mo_failures) > 0) {
|
||||
warning_("The following input could not be coerced and was returned as \"UNKNOWN\": ", vector_and(AMR_env$mo_failures, quotes = TRUE), ".\nYou can retrieve this list with {.fun mo_failures}.", call = FALSE)
|
||||
warning_("The following input could not be coerced and was returned as \"UNKNOWN\": ", vector_and(AMR_env$mo_failures, quotes = TRUE), ".\nYou can retrieve this list with `mo_failures()`.", call = FALSE)
|
||||
}
|
||||
|
||||
# Return class ----
|
||||
@@ -671,14 +623,6 @@ mo_cleaning_regex <- function() {
|
||||
)
|
||||
}
|
||||
|
||||
#' @rdname as.mo
|
||||
#' @details `NA_mo_` is a missing value of the new `mo` class, analogous to e.g. base \R's [`NA_character_`][base::NA].
|
||||
#' @format NULL
|
||||
#' @export
|
||||
NA_mo_ <- set_clean_class(NA_character_,
|
||||
new_class = c("mo", "character")
|
||||
)
|
||||
|
||||
# UNDOCUMENTED METHODS ----------------------------------------------------
|
||||
|
||||
# this prevents the requirement for putting the dependency in Imports:
|
||||
@@ -686,14 +630,14 @@ NA_mo_ <- set_clean_class(NA_character_,
|
||||
pillar_shaft.mo <- function(x, ...) {
|
||||
add_MO_lookup_to_AMR_env()
|
||||
out <- trimws(format(x))
|
||||
# grey out the domain (part until first "_")
|
||||
out[!is.na(x)] <- gsub("^([A-Z]+_)(.*)", paste0(pillar::style_subtle("\\1"), "\\2"), out[!is.na(x)], perl = TRUE)
|
||||
# grey out the kingdom (part until first "_")
|
||||
out[!is.na(x)] <- gsub("^([A-Z]+_)(.*)", paste0(font_subtle("\\1"), "\\2"), out[!is.na(x)], perl = TRUE)
|
||||
# and grey out every _
|
||||
out[!is.na(x)] <- gsub("_", pillar::style_subtle("_"), out[!is.na(x)])
|
||||
out[!is.na(x)] <- gsub("_", font_subtle("_"), out[!is.na(x)])
|
||||
|
||||
# markup NA and UNKNOWN
|
||||
out[is.na(x)] <- pillar::style_na(" NA")
|
||||
out[x == "UNKNOWN"] <- pillar::style_na(" UNKNOWN")
|
||||
out[is.na(x)] <- font_na(" NA")
|
||||
out[x == "UNKNOWN"] <- font_na(" UNKNOWN")
|
||||
|
||||
# markup manual codes
|
||||
out[x %in% AMR_env$MO_lookup$mo & !x %in% AMR::microorganisms$mo] <- font_blue(out[x %in% AMR_env$MO_lookup$mo & !x %in% AMR::microorganisms$mo], collapse = NULL)
|
||||
@@ -712,24 +656,26 @@ pillar_shaft.mo <- function(x, ...) {
|
||||
(!is.null(df) && !all(unlist(df[, which(mo_cols), drop = FALSE]) %in% all_mos))) {
|
||||
# markup old mo codes
|
||||
out[!x %in% all_mos] <- font_italic(
|
||||
pillar::style_na(x[!x %in% all_mos]),
|
||||
font_na(x[!x %in% all_mos],
|
||||
collapse = NULL
|
||||
),
|
||||
collapse = NULL
|
||||
)
|
||||
# throw a warning with the affected column name(s)
|
||||
if (!is.null(mo_cols)) {
|
||||
col <- paste0("Column ", vector_or(paste0("{.field ", font_bold(colnames(df)[mo_cols], collapse = NULL), "}"), quotes = TRUE, sort = FALSE))
|
||||
col <- paste0("Column ", vector_or(colnames(df)[mo_cols], quotes = TRUE, sort = FALSE))
|
||||
} else {
|
||||
col <- "The data"
|
||||
}
|
||||
warning_(
|
||||
col, " contains old MO codes (from another AMR package version). ",
|
||||
"Please update your MO codes with {.help [{.fun as.mo}](AMR::as.mo)}.",
|
||||
col, " contains old MO codes (from a previous AMR package version). ",
|
||||
"Please update your MO codes with `as.mo()`.",
|
||||
call = FALSE
|
||||
)
|
||||
}
|
||||
|
||||
# add the names to the bugs as mouse-over!
|
||||
if (in_rstudio()) {
|
||||
if (tryCatch(isTRUE(getExportedValue("ansi_has_hyperlink_support", ns = asNamespace("cli"))()), error = function(e) FALSE)) {
|
||||
out[!x %in% c("UNKNOWN", NA)] <- font_url(
|
||||
url = paste0(
|
||||
x[!x %in% c("UNKNOWN", NA)], ": ",
|
||||
@@ -801,17 +747,13 @@ freq.mo <- function(x, ...) {
|
||||
# this prevents the requirement for putting the dependency in Imports:
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(skimr::get_skimmers, mo)
|
||||
get_skimmers.mo <- function(column) {
|
||||
mo <- as.mo(column, keep_synonyms = TRUE, language = NULL, info = FALSE)
|
||||
mo <- mo[!is.na(mo)]
|
||||
spp <- mo[mo_species(mo, keep_synonyms = TRUE, language = NULL, info = FALSE) != ""]
|
||||
skimr::sfl(
|
||||
skim_type = "mo",
|
||||
n_unique = ~ length(unique(mo)),
|
||||
gram_negative = ~ sum(mo_is_gram_negative(mo, keep_synonyms = TRUE, language = NULL, info = FALSE), na.rm = TRUE),
|
||||
gram_positive = ~ sum(mo_is_gram_positive(mo, keep_synonyms = TRUE, language = NULL, info = FALSE), na.rm = TRUE),
|
||||
yeast = ~ sum(mo_is_yeast(mo, keep_synonyms = TRUE, language = NULL, info = FALSE), na.rm = TRUE),
|
||||
top_genus = ~ names(sort(-table(mo_genus(mo, keep_synonyms = TRUE, language = NULL, info = FALSE))))[1L],
|
||||
top_species = ~ names(sort(-table(mo_name(spp, keep_synonyms = TRUE, language = NULL, info = FALSE))))[1L],
|
||||
unique_total = ~ length(unique(stats::na.omit(.))),
|
||||
gram_negative = ~ sum(mo_is_gram_negative(.), na.rm = TRUE),
|
||||
gram_positive = ~ sum(mo_is_gram_positive(.), na.rm = TRUE),
|
||||
top_genus = ~ names(sort(-table(mo_genus(stats::na.omit(.), language = NULL))))[1L],
|
||||
top_species = ~ names(sort(-table(mo_name(stats::na.omit(.), language = NULL))))[1L]
|
||||
)
|
||||
}
|
||||
|
||||
@@ -820,7 +762,7 @@ get_skimmers.mo <- function(column) {
|
||||
#' @noRd
|
||||
print.mo <- function(x, print.shortnames = FALSE, ...) {
|
||||
add_MO_lookup_to_AMR_env()
|
||||
cat(format_inline_("Class {.cls mo}\n"))
|
||||
cat("Class 'mo'\n")
|
||||
x_names <- names(x)
|
||||
if (is.null(x_names) & print.shortnames == TRUE) {
|
||||
x_names <- tryCatch(mo_shortname(x, ...), error = function(e) NULL)
|
||||
@@ -829,8 +771,8 @@ print.mo <- function(x, print.shortnames = FALSE, ...) {
|
||||
names(x) <- x_names
|
||||
if (!all(x %in% c(AMR_env$MO_lookup$mo, NA))) {
|
||||
warning_(
|
||||
"Some MO codes are from another AMR package version. ",
|
||||
"Please update the MO codes with {.help [{.fun as.mo}](AMR::as.mo)}.",
|
||||
"Some MO codes are from a previous AMR package version. ",
|
||||
"Please update the MO codes with `as.mo()`.",
|
||||
call = FALSE
|
||||
)
|
||||
}
|
||||
@@ -863,8 +805,8 @@ as.data.frame.mo <- function(x, ...) {
|
||||
add_MO_lookup_to_AMR_env()
|
||||
if (!all(x %in% c(AMR_env$MO_lookup$mo, NA))) {
|
||||
warning_(
|
||||
"The data contains old MO codes (from another AMR package version). ",
|
||||
"Please update your MO codes with {.help [{.fun as.mo}](AMR::as.mo)}."
|
||||
"The data contains old MO codes (from a previous AMR package version). ",
|
||||
"Please update your MO codes with `as.mo()`."
|
||||
)
|
||||
}
|
||||
nm <- deparse1(substitute(x))
|
||||
@@ -946,16 +888,14 @@ rep.mo <- function(x, ...) {
|
||||
print.mo_uncertainties <- function(x, n = 10, ...) {
|
||||
more_than_50 <- FALSE
|
||||
if (NROW(x) == 0) {
|
||||
message_("No uncertainties to show. Only uncertainties of the last call to {.help [{.fun as.mo}](AMR::as.mo)} or any {.help [{.fun mo_*}](AMR::mo_property)} function are stored.")
|
||||
cat(word_wrap("No uncertainties to show. Only uncertainties of the last call to `as.mo()` or any `mo_*()` function are stored.\n\n", add_fn = font_blue))
|
||||
return(invisible(NULL))
|
||||
} else if (NROW(x) > 50) {
|
||||
more_than_50 <- TRUE
|
||||
x <- x[1:50, , drop = FALSE]
|
||||
}
|
||||
|
||||
message_("Matching scores are based on the resemblance between the input and the full taxonomic name, and the pathogenicity in humans. See {.help [{.fun mo_matching_score}](AMR::mo_matching_score)}.",
|
||||
as_note = FALSE
|
||||
)
|
||||
cat(word_wrap("Matching scores are based on the resemblance between the input and the full taxonomic name, and the pathogenicity in humans. See `?mo_matching_score`.\n\n", add_fn = font_blue))
|
||||
|
||||
add_MO_lookup_to_AMR_env()
|
||||
|
||||
@@ -965,12 +905,12 @@ print.mo_uncertainties <- function(x, n = 10, ...) {
|
||||
col_green <- function(x) font_green_bg(x, collapse = NULL)
|
||||
|
||||
if (has_colour()) {
|
||||
cat(word_wrap(
|
||||
"Colour keys: ",
|
||||
cat(word_wrap("Colour keys: ",
|
||||
col_red(" 0.000-0.549 "),
|
||||
col_orange(" 0.550-0.649 "),
|
||||
col_yellow(" 0.650-0.749 "),
|
||||
col_green(" 0.750-1.000")
|
||||
col_green(" 0.750-1.000"),
|
||||
add_fn = font_blue
|
||||
), font_green_bg(" "), "\n", sep = "")
|
||||
}
|
||||
|
||||
@@ -1002,6 +942,21 @@ print.mo_uncertainties <- function(x, n = 10, ...) {
|
||||
# sort on descending scores
|
||||
candidates_formatted <- candidates_formatted[order(1 - scores)]
|
||||
scores_formatted <- scores_formatted[order(1 - scores)]
|
||||
|
||||
candidates <- word_wrap(
|
||||
paste0(
|
||||
"Also matched: ",
|
||||
vector_and(
|
||||
paste0(
|
||||
candidates_formatted,
|
||||
font_blue(paste0(" (", scores_formatted, ")"), collapse = NULL)
|
||||
),
|
||||
quotes = FALSE, sort = FALSE
|
||||
)
|
||||
),
|
||||
extra_indent = nchar("Also matched: "),
|
||||
width = 0.9 * getOption("width", 100)
|
||||
)
|
||||
} else {
|
||||
candidates <- ""
|
||||
}
|
||||
@@ -1011,56 +966,46 @@ print.mo_uncertainties <- function(x, n = 10, ...) {
|
||||
n = x[i, ]$fullname
|
||||
)
|
||||
score_formatted <- trimws(formatC(round(score, 3), format = "f", digits = 3))
|
||||
|
||||
out <- paste0(
|
||||
txt <- paste(txt,
|
||||
paste0(
|
||||
"", strrep(font_grey("-"), times = getOption("width", 100) - 1), "\n",
|
||||
"{.val ", x[i, ]$original_input, "}",
|
||||
" -> ",
|
||||
paste0(
|
||||
font_bold(italicise(x[i, ]$fullname)),
|
||||
" (", x[i, ]$mo, ", ", score_set_colour(score_formatted, score), ")"
|
||||
)
|
||||
),
|
||||
collapse = "\n"
|
||||
)
|
||||
message_(out, as_note = FALSE)
|
||||
|
||||
if (x[i, ]$mo %in% AMR_env$MO_lookup$mo[which(AMR_env$MO_lookup$status == "synonym")]) {
|
||||
out2 <- paste0(
|
||||
strrep(" ", nchar(x[i, ]$original_input) + 6),
|
||||
ifelse(x[i, ]$keep_synonyms == FALSE,
|
||||
# Add note if result was coerced to accepted taxonomic name
|
||||
font_red(paste0("This outdated taxonomic name was converted to ", font_italic(AMR_env$MO_lookup$fullname[match(synonym_mo_to_accepted_mo(x[i, ]$mo), AMR_env$MO_lookup$mo)], collapse = NULL), " (", synonym_mo_to_accepted_mo(x[i, ]$mo), ")."), collapse = NULL),
|
||||
# Or add note if result is currently another taxonomic name
|
||||
font_red(paste0(font_bold("Note: "), "The current name is ", font_italic(AMR_env$MO_lookup$fullname[match(synonym_mo_to_accepted_mo(x[i, ]$mo), AMR_env$MO_lookup$mo)], collapse = NULL), " (", AMR_env$MO_lookup$ref[match(synonym_mo_to_accepted_mo(x[i, ]$mo), AMR_env$MO_lookup$mo)], ")."), collapse = NULL)
|
||||
)
|
||||
)
|
||||
message_(out2, as_note = FALSE)
|
||||
}
|
||||
|
||||
if (x[i, ]$candidates != "") {
|
||||
other_matches <- paste0(
|
||||
"Also matched: ",
|
||||
vector_and(
|
||||
"", strrep(font_grey("-"), times = getOption("width", 100)), "\n",
|
||||
'"', x[i, ]$original_input, '"',
|
||||
" -> ",
|
||||
paste0(
|
||||
candidates_formatted,
|
||||
font_blue(paste0(" (", scores_formatted, ")"), collapse = NULL)
|
||||
),
|
||||
quotes = FALSE, sort = FALSE
|
||||
)
|
||||
)
|
||||
message_(other_matches, as_note = FALSE)
|
||||
}
|
||||
font_bold(italicise(x[i, ]$fullname)),
|
||||
" (", x[i, ]$mo, ", ", score_set_colour(score_formatted, score), ")"
|
||||
)
|
||||
),
|
||||
collapse = "\n"
|
||||
),
|
||||
ifelse(x[i, ]$mo %in% AMR_env$MO_lookup$mo[which(AMR_env$MO_lookup$status == "synonym")],
|
||||
paste0(
|
||||
strrep(" ", nchar(x[i, ]$original_input) + 6),
|
||||
ifelse(x[i, ]$keep_synonyms == FALSE,
|
||||
# Add note if result was coerced to accepted taxonomic name
|
||||
font_red(paste0("This outdated taxonomic name was converted to ", font_italic(AMR_env$MO_lookup$fullname[match(synonym_mo_to_accepted_mo(x[i, ]$mo), AMR_env$MO_lookup$mo)], collapse = NULL), " (", synonym_mo_to_accepted_mo(x[i, ]$mo), ")."), collapse = NULL),
|
||||
# Or add note if result is currently another taxonomic name
|
||||
font_red(paste0(font_bold("Note: "), "The current name is ", font_italic(AMR_env$MO_lookup$fullname[match(synonym_mo_to_accepted_mo(x[i, ]$mo), AMR_env$MO_lookup$mo)], collapse = NULL), " (", AMR_env$MO_lookup$ref[match(synonym_mo_to_accepted_mo(x[i, ]$mo), AMR_env$MO_lookup$mo)], ")."), collapse = NULL)
|
||||
)
|
||||
),
|
||||
""
|
||||
),
|
||||
candidates,
|
||||
sep = "\n"
|
||||
)
|
||||
txt <- gsub("[\n]+", "\n", txt)
|
||||
# remove first and last break
|
||||
txt <- gsub("(^[\n]|[\n]$)", "", txt)
|
||||
txt <- paste0("\n", txt, "\n")
|
||||
}
|
||||
|
||||
cat(txt)
|
||||
if (isTRUE(any_maxed_out)) {
|
||||
cat("\n")
|
||||
message_("Only the first ", n, " other matches of each record are shown. Run {.help [`print(mo_uncertainties(), n = ...)`](AMR::mo_uncertainties)} to view more entries, or save {.help [{.fun mo_uncertainties}](AMR::mo_uncertainties)} to an object.")
|
||||
cat(font_blue(word_wrap("\nOnly the first ", n, " other matches of each record are shown. Run `print(mo_uncertainties(), n = ...)` to view more entries, or save `mo_uncertainties()` to an object.")))
|
||||
}
|
||||
if (isTRUE(more_than_50)) {
|
||||
cat("\n")
|
||||
message_("Only the first 50 uncertainties are shown. Run {.help [`View(mo_uncertainties())`](AMR::mo_uncertainties)} to view all entries, or save {.help [{.fun mo_uncertainties}](AMR::mo_uncertainties)} to an object.")
|
||||
cat(font_blue(word_wrap("\nOnly the first 50 uncertainties are shown. Run `View(mo_uncertainties())` to view all entries, or save `mo_uncertainties()` to an object.")))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1069,7 +1014,7 @@ print.mo_uncertainties <- function(x, n = 10, ...) {
|
||||
#' @noRd
|
||||
print.mo_renamed <- function(x, extra_txt = "", n = 25, ...) {
|
||||
if (NROW(x) == 0) {
|
||||
message_("No renamed taxonomy to show. Only renamed taxonomy of the last call of {.help [{.fun as.mo}](AMR::as.mo)} or any {.help [{.fun mo_*}](AMR::mo_property)} function are stored.")
|
||||
cat(word_wrap("No renamed taxonomy to show. Only renamed taxonomy of the last call of `as.mo()` or any `mo_*()` function are stored.\n", add_fn = font_blue))
|
||||
return(invisible(NULL))
|
||||
}
|
||||
|
||||
@@ -1080,17 +1025,14 @@ print.mo_renamed <- function(x, extra_txt = "", n = 25, ...) {
|
||||
|
||||
rows <- seq_len(min(NROW(x), n))
|
||||
|
||||
message_("The following microorganism", ifelse(NROW(x) > 1, "s were", " was"), " taxonomically renamed", extra_txt, ":")
|
||||
old_format <- format(paste0(font_italic(x$old[rows], collapse = NULL), x$ref_old[rows])) # format() will set trailing spaces for textual alignment
|
||||
old_format <- gsub(" ", "\u00a0", old_format, fixed = TRUE)
|
||||
for (old_tax in rows) {
|
||||
message_("\u00a0\u00a0", AMR_env$bullet_icon, " ", old_format[old_tax], " -> ", font_italic(x$new[old_tax]), x$ref_new[old_tax], as_note = FALSE)
|
||||
}
|
||||
if (NROW(x) > n) {
|
||||
message_("\u00a0\u00a0Only the first ", n, " (out of ", NROW(x), ") are shown. Run {.code print(mo_renamed(), n = ...)} to view more entries (might be slow), or save {.fun mo_renamed} to an object.",
|
||||
as_note = FALSE
|
||||
)
|
||||
}
|
||||
message_(
|
||||
"The following microorganism", ifelse(NROW(x) > 1, "s were", " was"), " taxonomically renamed", extra_txt, ":\n",
|
||||
paste0(" ", AMR_env$bullet_icon, " ", font_italic(x$old[rows], collapse = NULL), x$ref_old[rows],
|
||||
" -> ", font_italic(x$new[rows], collapse = NULL), x$ref_new[rows],
|
||||
collapse = "\n"
|
||||
),
|
||||
ifelse(NROW(x) > n, paste0("\n\nOnly the first ", n, " (out of ", NROW(x), ") are shown. Run `print(mo_renamed(), n = ...)` to view more entries (might be slow), or save `mo_renamed()` to an object."), "")
|
||||
)
|
||||
}
|
||||
|
||||
# UNDOCUMENTED HELPER FUNCTIONS -------------------------------------------
|
||||
@@ -1267,13 +1209,13 @@ replace_old_mo_codes <- function(x, property) {
|
||||
solved_unique <- unlist(lapply(
|
||||
strsplit(affected_unique, ""),
|
||||
function(m) {
|
||||
domain <- paste0("^", m[1])
|
||||
kingdom <- paste0("^", m[1])
|
||||
name <- m[3:length(m)]
|
||||
name[name == "_"] <- " "
|
||||
name <- tolower(paste0(name, ".*", collapse = ""))
|
||||
name <- gsub(" .*", " ", name, fixed = TRUE)
|
||||
name <- paste0("^", name)
|
||||
results <- AMR_env$MO_lookup$mo[AMR_env$MO_lookup$domain %like_case% domain &
|
||||
results <- AMR_env$MO_lookup$mo[AMR_env$MO_lookup$kingdom %like_case% kingdom &
|
||||
AMR_env$MO_lookup$fullname_lower %like_case% name]
|
||||
if (length(results) > 1) {
|
||||
all_direct_matches <<- FALSE
|
||||
@@ -1295,16 +1237,16 @@ replace_old_mo_codes <- function(x, property) {
|
||||
}
|
||||
if (property != "mo") {
|
||||
warning_(
|
||||
"in {.help [{.fun mo_", property, "}](AMR::mo_", property, ")}: the input contained ", n_matched,
|
||||
"in `mo_", property, "()`: the input contained ", n_matched,
|
||||
" old MO code", ifelse(n_matched == 1, "", "s"),
|
||||
" (", n_unique, "from another AMR package version). ",
|
||||
"Please update your MO codes with {.help [{.fun as.mo}](AMR::as.mo)} to increase speed."
|
||||
" (", n_unique, "from a previous AMR package version). ",
|
||||
"Please update your MO codes with `as.mo()` to increase speed."
|
||||
)
|
||||
} else {
|
||||
warning_(
|
||||
"in {.help [{.fun as.mo}](AMR::as.mo)}: the input contained ", n_matched,
|
||||
"in `as.mo()`: the input contained ", n_matched,
|
||||
" old MO code", ifelse(n_matched == 1, "", "s"),
|
||||
" (", n_unique, "from another AMR package version). ",
|
||||
" (", n_unique, "from a previous AMR package version). ",
|
||||
n_solved, " old MO code", ifelse(n_solved == 1, "", "s"),
|
||||
ifelse(n_solved == 1, " was", " were"),
|
||||
ifelse(all_direct_matches, " updated ", font_bold(" guessed ")),
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#' * \eqn{l_n} is the length of \eqn{n};
|
||||
#' * \eqn{lev} is the [Levenshtein distance function](https://en.wikipedia.org/wiki/Levenshtein_distance) (counting any insertion as 1, and any deletion or substitution as 2) that is needed to change \eqn{x} into \eqn{n};
|
||||
#' * \eqn{p_n} is the human pathogenic prevalence group of \eqn{n}, as described below;
|
||||
#' * \eqn{k_n} is the taxonomic domain ('kingdom' until taxonomic reclassification of 2024) of \eqn{n}, set as Bacteria = 1, Fungi = 1.25, Protozoa = 1.5, Chromista = 1.75, Archaea = 2, others = 3.
|
||||
#' * \eqn{k_n} is the taxonomic kingdom of \eqn{n}, set as Bacteria = 1, Fungi = 1.25, Protozoa = 1.5, Chromista = 1.75, Archaea = 2, others = 3.
|
||||
#'
|
||||
#' The grouping into human pathogenic prevalence \eqn{p} is based on recent work from Bartlett *et al.* (2022, \doi{10.1099/mic.0.001269}) who extensively studied medical-scientific literature to categorise all bacterial species into these groups:
|
||||
#'
|
||||
@@ -122,8 +122,8 @@ mo_matching_score <- function(x, n) {
|
||||
|
||||
# human pathogenic prevalence (1 to 3), see ?as.mo
|
||||
p_n <- AMR_env$MO_lookup[match(n, AMR_env$MO_lookup$fullname), "prevalence", drop = TRUE]
|
||||
# domain index (Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5)
|
||||
k_n <- AMR_env$MO_lookup[match(n, AMR_env$MO_lookup$fullname), "domain_index", drop = TRUE]
|
||||
# kingdom index (Bacteria = 1, Fungi = 2, Protozoa = 3, Archaea = 4, others = 5)
|
||||
k_n <- AMR_env$MO_lookup[match(n, AMR_env$MO_lookup$fullname), "kingdom_index", drop = TRUE]
|
||||
|
||||
# matching score:
|
||||
(l_n - 0.5 * l_n.lev) / (l_n * p_n * k_n)
|
||||
|
||||
128
R/mo_property.R
128
R/mo_property.R
@@ -31,7 +31,7 @@
|
||||
#'
|
||||
#' 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. See *Examples*.
|
||||
#' @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, see *Examples*.
|
||||
#' @param property One of the column names of the [microorganisms] data set: `r vector_or(colnames(microorganisms), sort = FALSE, documentation = TRUE)`, or must be `"shortname"`.
|
||||
#' @param property One of the column names of the [microorganisms] data set: `r vector_or(colnames(microorganisms), sort = FALSE, quotes = TRUE)`, or must be `"shortname"`.
|
||||
#' @inheritParams as.mo
|
||||
#' @param ... Other arguments passed on to [as.mo()], such as 'minimum_matching_score', 'ignore_pattern', and 'remove_from_input'.
|
||||
#' @param ab Any (vector of) text that can be coerced to a valid antibiotic drug code with [as.ab()].
|
||||
@@ -42,23 +42,21 @@
|
||||
#' - `mo_ref("Enterobacter aerogenes")` will return `"Tindall et al., 2017"` (with a note about the renaming)
|
||||
#' - `mo_ref("Enterobacter aerogenes", keep_synonyms = TRUE)` will return `"Hormaeche et al., 1960"` (with a once-per-session warning that the name is outdated)
|
||||
#'
|
||||
#' [mo_ref()] returns the abbreviated authority of the nomenclatural act that created the queried name combination. When `keep_synonyms = FALSE` (default), this is the authority of the currently accepted name. When `keep_synonyms = TRUE`, this is the authority under which the queried (possibly outdated) name was published. Emendations (changes to the species description without a name change) are not reflected; only the combination or original description authority is returned.
|
||||
#' The short name ([mo_shortname()]) returns the first character of the genus and the full species, such as `"E. coli"`, for species and subspecies. 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*. As a result, `mo_fullname(mo_shortname("Entamoeba coli"))` returns `"Escherichia coli"`.
|
||||
#'
|
||||
#' The short name ([mo_shortname()]) returns the first character of the genus and the full species, such as `"E. coli"`, for species and subspecies. 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 always be considered *Escherichia coli*. As a result, `mo_fullname(mo_shortname("Entamoeba coli"))` returns `"Escherichia coli"`.
|
||||
#'
|
||||
#' Following the formal introduction of the new kingdom rank into prokaryotic nomenclature in 2024 (\doi{10.1099/ijsem.0.006242}), [mo_kingdom()] and [mo_domain()] return different results for bacteria and archaea: [mo_kingdom()] returns the new formal kingdom (e.g. "Pseudomonadati", "Bacillati"), while [mo_domain()] returns the new domain (e.g. "Bacteria", "Archaea"). For non-prokaryotic organisms, both functions return identical results.
|
||||
#' 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.
|
||||
#'
|
||||
#' Determination of human pathogenicity ([mo_pathogenicity()]) is strongly based on Bartlett *et al.* (2022, \doi{10.1099/mic.0.001269}). This function returns a [factor] with the levels *Pathogenic*, *Potentially pathogenic*, *Non-pathogenic*, and *Unknown*.
|
||||
#'
|
||||
#' Determination of the Gram stain ([mo_gramstain()] is based on the taxonomic kingdom and phylum. Originally, Cavalier-Smith defined the so-called subkingdoms Negibacteria and Posibacteria (2002, [PMID 11837318](https://pubmed.ncbi.nlm.nih.gov/11837318/)), and only considered these phyla as Posibacteria: Actinobacteria, Chloroflexi, Firmicutes, and Tenericutes. These phyla were later renamed to Actinomycetota, Chloroflexota, Bacillota, and Mycoplasmatota (2021, [PMID 34694987](https://pubmed.ncbi.nlm.nih.gov/34694987/)). Bacteria in these phyla are considered Gram-positive in this `AMR` package, except for members of the class Negativicutes (within phylum Bacillota) which are Gram-negative. 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` (or `NA` 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 the Gram stain ([mo_gramstain()]) will be based on the taxonomic kingdom and phylum. Originally, Cavalier-Smith defined the so-called subkingdoms Negibacteria and Posibacteria (2002, [PMID 11837318](https://pubmed.ncbi.nlm.nih.gov/11837318/)), and only considered these phyla as Posibacteria: Actinobacteria, Chloroflexi, Firmicutes, and Tenericutes. These phyla were later renamed to Actinomycetota, Chloroflexota, Bacillota, and Mycoplasmatota (2021, [PMID 34694987](https://pubmed.ncbi.nlm.nih.gov/34694987/)). Bacteria in these phyla are considered Gram-positive in this `AMR` package, except for members of the class Negativicutes (within phylum Bacillota) which are Gram-negative. 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` (or `NA` 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()]) is based on the taxonomic kingdom and class. *Budding yeasts* are yeasts that reproduce asexually through a process called budding, where a new cell develops from a small protrusion on the parent cell. Taxonomically, these are members of the phylum Ascomycota, class Saccharomycetes (also called Hemiascomycetes) or Pichiomycetes. *True yeasts* quite specifically refers to yeasts in the underlying order Saccharomycetales (such as *Saccharomyces cerevisiae*). Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes or Pichiomycetes, the function will return `TRUE`. It returns `FALSE` otherwise (or `NA` when the input is `NA` or the MO code is `UNKNOWN`).
|
||||
#' Determination of yeasts ([mo_is_yeast()]) will be based on the taxonomic kingdom and class. *Budding yeasts* are yeasts that reproduce asexually through a process called budding, where a new cell develops from a small protrusion on the parent cell. Taxonomically, these are members of the phylum Ascomycota, class Saccharomycetes (also called Hemiascomycetes) or Pichiomycetes. *True yeasts* quite specifically refers to yeasts in the underlying order Saccharomycetales (such as *Saccharomyces cerevisiae*). Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes or Pichiomycetes, the function will return `TRUE`. It returns `FALSE` otherwise (or `NA` when the input is `NA` or the MO code is `UNKNOWN`).
|
||||
#'
|
||||
#' Determination of intrinsic resistance ([mo_is_intrinsic_resistant()]) is based on the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(names(EUCAST_VERSION_EXPECTED_PHENOTYPES[1]))`. The [mo_is_intrinsic_resistant()] function can be vectorised over both argument `x` (input for microorganisms) and `ab` (input for antimicrobials).
|
||||
#' Determination of intrinsic resistance ([mo_is_intrinsic_resistant()]) will be based on the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(names(EUCAST_VERSION_EXPECTED_PHENOTYPES[1]))`. The [mo_is_intrinsic_resistant()] function can be vectorised over both argument `x` (input for microorganisms) and `ab` (input for antimicrobials).
|
||||
#'
|
||||
#' Determination of both bacterial oxygen tolerance ([mo_oxygen_tolerance()]) and morphology ([mo_morphology()]) are based on BacDive, see *Source*. The function [mo_is_anaerobic()] only returns `TRUE` if the oxygen tolerance is `"anaerobe"`, indicating an obligate anaerobic species or genus. It always returns `FALSE` for species outside the taxonomic kingdom of Bacteria.
|
||||
#' Determination of bacterial oxygen tolerance ([mo_oxygen_tolerance()]) will be based on BacDive, see *Source*. The function [mo_is_anaerobic()] only returns `TRUE` if the oxygen tolerance is `"anaerobe"`, indicting an obligate anaerobic species or genus. It always returns `FALSE` for species outside the taxonomic kingdom of Bacteria.
|
||||
#'
|
||||
#' The function [mo_url()] will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species. [This MycoBank URL](`r TAXONOMY_VERSION$MycoBank$url`) is used for fungi wherever available , [this LPSN URL](`r TAXONOMY_VERSION$MycoBank$url`) for bacteria wherever available, and [this GBIF link](`r TAXONOMY_VERSION$GBIF$url`) otherwise.
|
||||
#' The function [mo_url()] will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species. [This MycoBank URL](`r TAXONOMY_VERSION$MycoBank$url`) will be used for fungi wherever available , [this LPSN URL](`r TAXONOMY_VERSION$MycoBank$url`) for bacteria wherever available, and [this GBIF link](`r TAXONOMY_VERSION$GBIF$url`) otherwise.
|
||||
#'
|
||||
#' SNOMED codes ([mo_snomed()]) was last updated on `r documentation_date(TAXONOMY_VERSION$SNOMED$accessed_date)`. See *Source* and the [microorganisms] data set for more info.
|
||||
#'
|
||||
@@ -83,7 +81,6 @@
|
||||
#' @examples
|
||||
#' # taxonomic tree -----------------------------------------------------------
|
||||
#'
|
||||
#' mo_domain("Klebsiella pneumoniae")
|
||||
#' mo_kingdom("Klebsiella pneumoniae")
|
||||
#' mo_phylum("Klebsiella pneumoniae")
|
||||
#' mo_class("Klebsiella pneumoniae")
|
||||
@@ -93,8 +90,6 @@
|
||||
#' mo_species("Klebsiella pneumoniae")
|
||||
#' mo_subspecies("Klebsiella pneumoniae")
|
||||
#'
|
||||
#' # all in one go
|
||||
#' mo_taxonomy("Klebsiella pneumoniae")
|
||||
#'
|
||||
#' # full names and short names -----------------------------------------------
|
||||
#'
|
||||
@@ -105,17 +100,14 @@
|
||||
#'
|
||||
#' # other properties ---------------------------------------------------------
|
||||
#'
|
||||
#' mo_morphology("Klebsiella pneumoniae")
|
||||
#' mo_gramstain("Klebsiella pneumoniae")
|
||||
#' mo_gramstain("Klebsiella pneumoniae", add_morphology = TRUE)
|
||||
#' mo_pathogenicity("Klebsiella pneumoniae")
|
||||
#' mo_gramstain("Klebsiella pneumoniae")
|
||||
#' mo_snomed("Klebsiella pneumoniae")
|
||||
#' mo_type("Klebsiella pneumoniae")
|
||||
#' mo_rank("Klebsiella pneumoniae")
|
||||
#' mo_url("Klebsiella pneumoniae")
|
||||
#' mo_is_yeast(c("Candida", "Trichophyton", "Klebsiella"))
|
||||
#'
|
||||
#' mo_group_members("Streptococcus group A")
|
||||
#' mo_group_members(c(
|
||||
#' "Streptococcus group A",
|
||||
#' "Streptococcus group C",
|
||||
@@ -159,7 +151,6 @@
|
||||
#'
|
||||
#' mo_fullname("Staph epidermidis")
|
||||
#' mo_fullname("Staph epidermidis", Becker = TRUE)
|
||||
#'
|
||||
#' mo_shortname("Staph epidermidis")
|
||||
#' mo_shortname("Staph epidermidis", Becker = TRUE)
|
||||
#'
|
||||
@@ -168,7 +159,6 @@
|
||||
#'
|
||||
#' mo_fullname("Strep agalactiae")
|
||||
#' mo_fullname("Strep agalactiae", Lancefield = TRUE)
|
||||
#'
|
||||
#' mo_shortname("Strep agalactiae")
|
||||
#' mo_shortname("Strep agalactiae", Lancefield = TRUE)
|
||||
#'
|
||||
@@ -181,10 +171,10 @@
|
||||
#' mo_gramstain("Klebsiella pneumoniae", language = "el") # Greek
|
||||
#' mo_gramstain("Klebsiella pneumoniae", language = "uk") # Ukrainian
|
||||
#'
|
||||
#' # mo_type is equal to mo_domain, but mo_domain will remain untranslated
|
||||
#' mo_domain("Klebsiella pneumoniae")
|
||||
#' # mo_type is equal to mo_kingdom, but mo_kingdom will remain untranslated
|
||||
#' mo_kingdom("Klebsiella pneumoniae")
|
||||
#' mo_type("Klebsiella pneumoniae")
|
||||
#' mo_domain("Klebsiella pneumoniae", language = "zh") # Chinese, no effect
|
||||
#' mo_kingdom("Klebsiella pneumoniae", language = "zh") # Chinese, no effect
|
||||
#' mo_type("Klebsiella pneumoniae", language = "zh") # Chinese, translated
|
||||
#'
|
||||
#' mo_fullname("S. pyogenes", Lancefield = TRUE, language = "de")
|
||||
@@ -259,8 +249,8 @@ mo_shortname <- function(x, language = get_AMR_locale(), keep_synonyms = getOpti
|
||||
}
|
||||
|
||||
# get first char of genus and complete species in English
|
||||
genera <- mo_genus(x.mo, language = NULL, keep_synonyms = keep_synonyms, ...)
|
||||
shortnames <- paste0(substr(genera, 1, 1), ". ", replace_empty(mo_species(x.mo, language = NULL, keep_synonyms = keep_synonyms, ...)))
|
||||
genera <- mo_genus(x.mo, language = NULL, keep_synonyms = keep_synonyms)
|
||||
shortnames <- paste0(substr(genera, 1, 1), ". ", replace_empty(mo_species(x.mo, language = NULL, keep_synonyms = keep_synonyms)))
|
||||
|
||||
# exceptions for where no species is known
|
||||
shortnames[shortnames %like% ".[.] spp[.]"] <- genera[shortnames %like% ".[.] spp[.]"]
|
||||
@@ -272,7 +262,7 @@ mo_shortname <- function(x, language = get_AMR_locale(), keep_synonyms = getOpti
|
||||
# unknown species etc.
|
||||
shortnames[shortnames %like% "unknown"] <- paste0("(", trimws2(gsub("[^a-zA-Z -]", "", shortnames[shortnames %like% "unknown"], perl = TRUE)), ")")
|
||||
|
||||
shortnames[mo_rank(x.mo, keep_synonyms = TRUE, ...) %in% c("domain", "kingdom", "phylum", "class", "order", "family")] <- mo_name(x.mo[mo_rank(x.mo, keep_synonyms = TRUE, ...) %in% c("domain", "kingdom", "phylum", "class", "order", "family")], language = NULL, keep_synonyms = keep_synonyms, ...)
|
||||
shortnames[mo_rank(x.mo) %in% c("kingdom", "phylum", "class", "order", "family")] <- mo_name(x.mo[mo_rank(x.mo) %in% c("kingdom", "phylum", "class", "order", "family")], language = NULL, keep_synonyms = keep_synonyms)
|
||||
|
||||
shortnames[is.na(x.mo)] <- NA_character_
|
||||
load_mo_uncertainties(metadata)
|
||||
@@ -280,6 +270,7 @@ mo_shortname <- function(x, language = get_AMR_locale(), keep_synonyms = getOpti
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_subspecies <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) {
|
||||
@@ -389,18 +380,7 @@ mo_kingdom <- function(x, language = get_AMR_locale(), keep_synonyms = getOption
|
||||
language <- validate_language(language)
|
||||
meet_criteria(keep_synonyms, allow_class = "logical", has_length = 1)
|
||||
|
||||
x.mo <- as.mo(x, language = language, keep_synonyms = keep_synonyms, ...)
|
||||
for (new_kingdom in c("Archaea", "Bacteria")) {
|
||||
if (any(mo_domain(x.mo) == new_kingdom, na.rm = TRUE) && message_not_thrown_before("mo_kingdom", new_kingdom, entire_session = TRUE)) {
|
||||
message_(
|
||||
"Since {.pkg AMR v3.1.0}, {.help [{.fun mo_kingdom}](AMR::mo_kingdom)} returns the taxonomic kingdom as defined by G\u00f6ker and Oren (2024), who formally introduced a new kingdom rank into prokaryotic nomenclature ({.href [DOI: 10.1099/ijsem.0.006242](https://doi.org/10.1099/ijsem.0.006242)}). ",
|
||||
"{.strong The former kingdom of ", new_kingdom, "} was divided into four new kingdoms under the {.strong new domain of ", new_kingdom, "}. ",
|
||||
"For the old behaviour, use {.help [{.fun mo_domain}](AMR::mo_domain)}. ",
|
||||
"This note will be shown once per session."
|
||||
)
|
||||
}
|
||||
}
|
||||
translate_into_language(mo_validate(x = x.mo, property = "kingdom", language = language, keep_synonyms = keep_synonyms, ...), language = language, only_unknown = TRUE)
|
||||
translate_into_language(mo_validate(x = x, property = "kingdom", language = language, keep_synonyms = keep_synonyms, ...), language = language, only_unknown = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
@@ -410,11 +390,7 @@ mo_domain <- function(x, language = get_AMR_locale(), keep_synonyms = getOption(
|
||||
# this tries to find the data and an 'mo' column
|
||||
x <- find_mo_col(fn = "mo_domain")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
language <- validate_language(language)
|
||||
meet_criteria(keep_synonyms, allow_class = "logical", has_length = 1)
|
||||
|
||||
translate_into_language(mo_validate(x = x, property = "domain", language = language, keep_synonyms = keep_synonyms, ...), language = language, only_unknown = TRUE)
|
||||
mo_kingdom(x = x, language = language, keep_synonyms = keep_synonyms, ...)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
@@ -429,8 +405,7 @@ mo_type <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("A
|
||||
meet_criteria(keep_synonyms, allow_class = "logical", has_length = 1)
|
||||
|
||||
x.mo <- as.mo(x, language = language, keep_synonyms = keep_synonyms, ...)
|
||||
out <- mo_domain(x.mo, language = NULL, keep_synonyms = keep_synonyms)
|
||||
out <- gsub(" \\{.*\\}", "", out) # strip curly brackets
|
||||
out <- mo_kingdom(x.mo, language = NULL, keep_synonyms = keep_synonyms)
|
||||
out[which(mo_is_yeast(x.mo, keep_synonyms = keep_synonyms))] <- "Yeasts"
|
||||
translate_into_language(out, language = language, only_unknown = FALSE)
|
||||
}
|
||||
@@ -466,7 +441,7 @@ mo_pathogenicity <- function(x, language = get_AMR_locale(), keep_synonyms = get
|
||||
metadata <- get_mo_uncertainties()
|
||||
|
||||
prev <- AMR_env$MO_lookup$prevalence[match(x.mo, AMR_env$MO_lookup$mo)]
|
||||
kngd <- AMR_env$MO_lookup$domain[match(x.mo, AMR_env$MO_lookup$mo)]
|
||||
kngd <- AMR_env$MO_lookup$kingdom[match(x.mo, AMR_env$MO_lookup$mo)]
|
||||
rank <- AMR_env$MO_lookup$rank[match(x.mo, AMR_env$MO_lookup$mo)]
|
||||
|
||||
out <- factor(
|
||||
@@ -486,9 +461,8 @@ mo_pathogenicity <- function(x, language = get_AMR_locale(), keep_synonyms = get
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @param add_morphology a [logical] to indicate whether the morphology (from [mo_morphology()]) should be added to the Gram stain result, e.g. `"Gram-negative rods"` instead of `"Gram-negative"`. The default is `FALSE`.
|
||||
#' @export
|
||||
mo_gramstain <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), add_morphology = FALSE, ...) {
|
||||
mo_gramstain <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an 'mo' column
|
||||
x <- find_mo_col(fn = "mo_gramstain")
|
||||
@@ -496,14 +470,13 @@ mo_gramstain <- function(x, language = get_AMR_locale(), keep_synonyms = getOpti
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
language <- validate_language(language)
|
||||
meet_criteria(keep_synonyms, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(add_morphology, allow_class = "logical", has_length = 1)
|
||||
|
||||
x.mo <- as.mo(x, language = language, keep_synonyms = keep_synonyms, ...)
|
||||
metadata <- get_mo_uncertainties()
|
||||
|
||||
x <- rep(NA_character_, length(x))
|
||||
# make all bacteria Gram negative
|
||||
x[mo_domain(x.mo, language = NULL, keep_synonyms = keep_synonyms) == "Bacteria"] <- "Gram-negative"
|
||||
x[mo_kingdom(x.mo, language = NULL, keep_synonyms = keep_synonyms) == "Bacteria"] <- "Gram-negative"
|
||||
# overwrite these 4 phyla with Gram-positives
|
||||
# Source: https://itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=956097 (Cavalier-Smith, 2002)
|
||||
x[(mo_phylum(x.mo, language = NULL, keep_synonyms = keep_synonyms) %in% c(
|
||||
@@ -522,12 +495,6 @@ mo_gramstain <- function(x, language = get_AMR_locale(), keep_synonyms = getOpti
|
||||
# and of course our own ID for Gram-positives
|
||||
| x.mo %in% c("B_GRAMP", "B_ANAER-POS")] <- "Gram-positive"
|
||||
|
||||
if (isTRUE(add_morphology)) {
|
||||
morphs <- mo_morphology(x.mo, language = NULL)
|
||||
morphs[is.na(x)] <- ""
|
||||
x[!is.na(x)] <- paste(x[!is.na(x)], tolower(morphs[!is.na(x)]))
|
||||
}
|
||||
|
||||
load_mo_uncertainties(metadata)
|
||||
translate_into_language(x, language = language, only_unknown = FALSE)
|
||||
}
|
||||
@@ -586,12 +553,12 @@ mo_is_yeast <- function(x, language = get_AMR_locale(), keep_synonyms = getOptio
|
||||
x.mo <- as.mo(x, language = language, keep_synonyms = keep_synonyms, ...)
|
||||
metadata <- get_mo_uncertainties()
|
||||
|
||||
x.domain <- mo_domain(x.mo, language = NULL, keep_synonyms = keep_synonyms)
|
||||
x.kingdom <- mo_kingdom(x.mo, language = NULL, keep_synonyms = keep_synonyms)
|
||||
x.class <- mo_class(x.mo, language = NULL, keep_synonyms = keep_synonyms)
|
||||
|
||||
load_mo_uncertainties(metadata)
|
||||
|
||||
out <- x.mo == "F_YEAST" | (x.domain == "Fungi" & x.class %in% c("Saccharomycetes", "Pichiomycetes"))
|
||||
out <- x.mo == "F_YEAST" | (x.kingdom == "Fungi" & x.class %in% c("Saccharomycetes", "Pichiomycetes"))
|
||||
out[x.mo %in% c(NA_character_, "UNKNOWN")] <- NA
|
||||
out
|
||||
}
|
||||
@@ -617,7 +584,7 @@ mo_is_intrinsic_resistant <- function(x, ab, language = get_AMR_locale(), keep_s
|
||||
ab <- rep(ab, length(x))
|
||||
}
|
||||
if (length(x) != length(ab)) {
|
||||
stop_("length of {.arg x} and {.arg ab} must be equal, or one of them must be of length 1.")
|
||||
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 (AMR_env will reload every session)
|
||||
@@ -668,21 +635,6 @@ mo_is_anaerobic <- function(x, language = get_AMR_locale(), keep_synonyms = getO
|
||||
out
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_morphology <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) {
|
||||
if (missing(x)) {
|
||||
# this tries to find the data and an 'mo' column
|
||||
x <- find_mo_col(fn = "mo_morphology")
|
||||
}
|
||||
meet_criteria(x, allow_NA = TRUE)
|
||||
language <- validate_language(language)
|
||||
meet_criteria(keep_synonyms, allow_class = "logical", has_length = 1)
|
||||
|
||||
out <- mo_validate(x = x, property = "morphology", language = language, keep_synonyms = keep_synonyms, ...)
|
||||
gsub("^(\\w)", "\\U\\1", out, perl = TRUE)
|
||||
}
|
||||
|
||||
#' @rdname mo_property
|
||||
#' @export
|
||||
mo_snomed <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) {
|
||||
@@ -813,19 +765,18 @@ mo_taxonomy <- function(x, language = get_AMR_locale(), keep_synonyms = getOptio
|
||||
language <- validate_language(language)
|
||||
meet_criteria(keep_synonyms, allow_class = "logical", has_length = 1)
|
||||
|
||||
x.mo <- as.mo(x, language = language, keep_synonyms = keep_synonyms, ...)
|
||||
x <- as.mo(x, language = language, keep_synonyms = keep_synonyms, ...)
|
||||
metadata <- get_mo_uncertainties()
|
||||
|
||||
out <- list(
|
||||
domain = mo_domain(x.mo, language = language, keep_synonyms = keep_synonyms),
|
||||
kingdom = suppressMessages(mo_kingdom(x.mo, language = language, keep_synonyms = keep_synonyms)),
|
||||
phylum = mo_phylum(x.mo, language = language, keep_synonyms = keep_synonyms),
|
||||
class = mo_class(x.mo, language = language, keep_synonyms = keep_synonyms),
|
||||
order = mo_order(x.mo, language = language, keep_synonyms = keep_synonyms),
|
||||
family = mo_family(x.mo, language = language, keep_synonyms = keep_synonyms),
|
||||
genus = mo_genus(x.mo, language = language, keep_synonyms = keep_synonyms),
|
||||
species = mo_species(x.mo, language = language, keep_synonyms = keep_synonyms),
|
||||
subspecies = mo_subspecies(x.mo, language = language, keep_synonyms = keep_synonyms)
|
||||
kingdom = mo_kingdom(x, language = language, keep_synonyms = keep_synonyms),
|
||||
phylum = mo_phylum(x, language = language, keep_synonyms = keep_synonyms),
|
||||
class = mo_class(x, language = language, keep_synonyms = keep_synonyms),
|
||||
order = mo_order(x, language = language, keep_synonyms = keep_synonyms),
|
||||
family = mo_family(x, language = language, keep_synonyms = keep_synonyms),
|
||||
genus = mo_genus(x, language = language, keep_synonyms = keep_synonyms),
|
||||
species = mo_species(x, language = language, keep_synonyms = keep_synonyms),
|
||||
subspecies = mo_subspecies(x, language = language, keep_synonyms = keep_synonyms)
|
||||
)
|
||||
|
||||
load_mo_uncertainties(metadata)
|
||||
@@ -935,7 +886,6 @@ mo_info <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("A
|
||||
status = mo_status(y, language = language, keep_synonyms = keep_synonyms),
|
||||
synonyms = mo_synonyms(y, keep_synonyms = keep_synonyms),
|
||||
gramstain = mo_gramstain(y, language = language, keep_synonyms = keep_synonyms),
|
||||
morphology = mo_morphology(y, language = language, keep_synonyms = keep_synonyms),
|
||||
oxygen_tolerance = mo_oxygen_tolerance(y, language = language, keep_synonyms = keep_synonyms),
|
||||
url = unname(mo_url(y, open = FALSE, keep_synonyms = keep_synonyms)),
|
||||
ref = mo_ref(y, keep_synonyms = keep_synonyms),
|
||||
@@ -993,7 +943,7 @@ mo_url <- function(x, open = FALSE, language = get_AMR_locale(), keep_synonyms =
|
||||
|
||||
if (isTRUE(open)) {
|
||||
if (length(u) > 1) {
|
||||
warning_("in {.fun mo_url}: only the first URL will be opened, as R's built-in function {.fun browseURL} only suports one string.")
|
||||
warning_("in `mo_url()`: only the first URL will be opened, as R's built-in function `browseURL()` only suports one string.")
|
||||
}
|
||||
utils::browseURL(u[1L])
|
||||
}
|
||||
@@ -1029,11 +979,11 @@ mo_validate <- function(x, property, language, keep_synonyms = keep_synonyms, ..
|
||||
|
||||
dots <- list(...)
|
||||
Becker <- dots$Becker
|
||||
if (is.null(Becker) || property %in% c("domain", "kingdom", "phylum", "class", "order", "family", "genus")) {
|
||||
if (is.null(Becker) || property %in% c("kingdom", "phylum", "class", "order", "family", "genus")) {
|
||||
Becker <- FALSE
|
||||
}
|
||||
Lancefield <- dots$Lancefield
|
||||
if (is.null(Lancefield) || property %in% c("domain", "kingdom", "phylum", "class", "order", "family", "genus")) {
|
||||
if (is.null(Lancefield) || property %in% c("kingdom", "phylum", "class", "order", "family", "genus")) {
|
||||
Lancefield <- FALSE
|
||||
}
|
||||
has_Becker_or_Lancefield <- Becker %in% c(TRUE, "all") || Lancefield %in% c(TRUE, "all")
|
||||
@@ -1093,10 +1043,10 @@ find_mo_col <- function(fn) {
|
||||
)
|
||||
if (!is.null(df) && !is.null(mo) && is.data.frame(df)) {
|
||||
if (message_not_thrown_before(fn = fn)) {
|
||||
message_("Using column {.field ", font_bold(mo), "} as input for {.help [{.fun ", fn, "}](AMR::", fn, ")}")
|
||||
message_("Using column '", font_bold(mo), "' as input for `", fn, "()`")
|
||||
}
|
||||
return(df[, mo, drop = TRUE])
|
||||
} else {
|
||||
stop_("argument {.arg x} is missing and no column with info about microorganisms could be found.", call = -2)
|
||||
stop_("argument `x` is missing and no column with info about microorganisms could be found.", call = -2)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
#'
|
||||
#' ```
|
||||
#' as.mo("lab_mo_ecoli")
|
||||
#' #> Class <mo>
|
||||
#' #> Class 'mo'
|
||||
#' #> [1] B_ESCHR_COLI
|
||||
#'
|
||||
#' mo_genus("lab_mo_kpneumoniae")
|
||||
@@ -85,7 +85,7 @@
|
||||
#' 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>
|
||||
#' #> Class 'mo'
|
||||
#' #> [1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI
|
||||
#' ```
|
||||
#'
|
||||
@@ -108,7 +108,7 @@
|
||||
#' #> 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>
|
||||
#' #> Class 'mo'
|
||||
#' #> [1] B_ESCHR_COLI
|
||||
#'
|
||||
#' mo_genus("lab_Staph_aureus")
|
||||
@@ -129,7 +129,7 @@ set_mo_source <- function(path, destination = getOption("AMR_mo_source", "~/mo_s
|
||||
|
||||
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 {.arg destination} must be a file location with file extension .rds.")
|
||||
stop_ifnot(destination %like% "[.]rds$", "the `destination` must be a file location with file extension .rds.")
|
||||
mo_source_destination <- path.expand(destination)
|
||||
|
||||
if (is.null(path) || path %in% c(FALSE, "")) {
|
||||
@@ -137,6 +137,7 @@ set_mo_source <- function(path, destination = getOption("AMR_mo_source", "~/mo_s
|
||||
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
|
||||
)
|
||||
}
|
||||
@@ -249,7 +250,7 @@ get_mo_source <- function(destination = getOption("AMR_mo_source", "~/mo_source.
|
||||
current_ext <- regexpr("\\.([[:alnum:]]+)$", destination)
|
||||
current_ext <- ifelse(current_ext > -1L, substring(destination, current_ext + 1L), "")
|
||||
vowel <- ifelse(current_ext %like% "^[AEFHILMNORSX]", "n", "")
|
||||
stop_("The AMR mo source must be an RDS file, not a", vowel, " ", toupper(current_ext), " file. If \"", basename(destination), "\" was meant as your input file, use {.help [{.fun set_mo_source}](AMR::set_mo_source)} on this file. In any case, the option {.code AMR_mo_source} must be set to another path.")
|
||||
stop_("The AMR mo source must be an RDS file, not a", vowel, " ", toupper(current_ext), " file. If `\"", basename(destination), "\"` was meant as your input file, use `set_mo_source()` on this file. In any case, the option `AMR_mo_source` must be set to another path.")
|
||||
}
|
||||
if (is.null(AMR_env$mo_source)) {
|
||||
AMR_env$mo_source <- readRDS_AMR(path.expand(destination))
|
||||
@@ -289,7 +290,7 @@ check_validity_mo_source <- function(x, refer_to_name = "`reference_df`", stop_o
|
||||
}
|
||||
if (!"mo" %in% colnames(x)) {
|
||||
if (stop_on_error == TRUE) {
|
||||
stop_(refer_to_name, " must contain a column {.code mo}", call = FALSE)
|
||||
stop_(refer_to_name, " must contain a column 'mo'", call = FALSE)
|
||||
} else {
|
||||
return(FALSE)
|
||||
}
|
||||
@@ -313,14 +314,14 @@ check_validity_mo_source <- function(x, refer_to_name = "`reference_df`", stop_o
|
||||
}
|
||||
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 {.field ", font_bold(colnames(x)[1]), "}", call = FALSE)
|
||||
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 {.field ", font_bold(colnames(x)[2]), "}", call = FALSE)
|
||||
stop_(refer_to_name, " contains duplicate values in column '", colnames(x)[2], "'", call = FALSE)
|
||||
} else {
|
||||
return(FALSE)
|
||||
}
|
||||
|
||||
10
R/pca.R
10
R/pca.R
@@ -66,12 +66,12 @@
|
||||
#'
|
||||
#' # new ggplot2 plotting method using this package:
|
||||
#' if (require("dplyr") && require("ggplot2")) {
|
||||
#' ggplot_pca(pca_result)
|
||||
#' ggplot_pca(pca_result)
|
||||
#' }
|
||||
#' if (require("dplyr") && require("ggplot2")) {
|
||||
#' ggplot_pca(pca_result) +
|
||||
#' scale_colour_viridis_d() +
|
||||
#' labs(title = "Title here")
|
||||
#' ggplot_pca(pca_result) +
|
||||
#' scale_colour_viridis_d() +
|
||||
#' labs(title = "Title here")
|
||||
#' }
|
||||
#' }
|
||||
pca <- function(x,
|
||||
@@ -114,7 +114,7 @@ pca <- function(x,
|
||||
|
||||
x <- as.data.frame(new_list, stringsAsFactors = FALSE)
|
||||
if (any(vapply(FUN.VALUE = logical(1), x, function(y) !is.numeric(y)))) {
|
||||
warning_("in {.fun pca}: be sure to first calculate the resistance (or susceptibility) of variables with antimicrobial test results, since PCA works with numeric variables only. See {.help [{.fun pca}](AMR::pca)}.", call = FALSE)
|
||||
warning_("in `pca()`: be sure to first calculate the resistance (or susceptibility) of variables with antimicrobial test results, since PCA works with numeric variables only. See Examples in `?pca`.", call = FALSE)
|
||||
}
|
||||
|
||||
# set column names
|
||||
|
||||
273
R/plotting.R
273
R/plotting.R
@@ -52,19 +52,11 @@
|
||||
#' @details
|
||||
#' ### The `scale_*_mic()` Functions
|
||||
#'
|
||||
#' The functions [scale_x_mic()], [scale_y_mic()], [scale_colour_mic()], and [scale_fill_mic()] functions allow to plot the [mic][as.mic()] class (MIC values) on a continuous, logarithmic scale.
|
||||
#'
|
||||
#' There is normally no need to add these scale functions to your plot, as they are applied automatically when plotting values of class [mic][as.mic()].
|
||||
#'
|
||||
#' When manually added though, they allow to rescale the MIC range with an 'inside' or 'outside' range if required, and provide the option to retain the operators in MIC values (such as `>=`). Missing intermediate log2 levels will always be plotted too.
|
||||
#' The functions [scale_x_mic()], [scale_y_mic()], [scale_colour_mic()], and [scale_fill_mic()] functions allow to plot the [mic][as.mic()] class (MIC values) on a continuous, logarithmic scale. They also allow to rescale the MIC range with an 'inside' or 'outside' range if required, and retain the operators in MIC values (such as `>=`) if desired. Missing intermediate log2 levels will be plotted too.
|
||||
#'
|
||||
#' ### The `scale_*_sir()` Functions
|
||||
#'
|
||||
#' The functions [scale_x_sir()], [scale_colour_sir()], and [scale_fill_sir()] functions allow to plot the [sir][as.sir()] class in the right order (`r paste(levels(NA_sir_), collapse = " < ")`).
|
||||
#'
|
||||
#' There is normally no need to add these scale functions to your plot, as they are applied automatically when plotting values of class [sir][as.sir()].
|
||||
#'
|
||||
#' At default, they translate the S/I/R values to an interpretative text ("Susceptible", "Resistant", etc.) in any of the `r length(AMR:::LANGUAGES_SUPPORTED)` supported languages (use `language = NULL` to keep S/I/R). Also, except for [scale_x_sir()], they set colour-blind friendly colours to the `colour` and `fill` aesthetics.
|
||||
#' The functions [scale_x_sir()], [scale_colour_sir()], and [scale_fill_sir()] functions allow to plot the [sir][as.sir()] class in the right order (`r paste(levels(NA_sir_), collapse = " < ")`). At default, they translate the S/I/R values to an interpretative text ("Susceptible", "Resistant", etc.) in any of the `r length(AMR:::LANGUAGES_SUPPORTED)` supported languages (use `language = NULL` to keep S/I/R). Also, except for [scale_x_sir()], they set colour-blind friendly colours to the `colour` and `fill` aesthetics.
|
||||
#'
|
||||
#' ### Additional `ggplot2` Functions
|
||||
#'
|
||||
@@ -122,12 +114,17 @@
|
||||
#' ) +
|
||||
#' geom_col()
|
||||
#' mic_plot +
|
||||
#' labs(title = "scale_x_mic() automatically applied")
|
||||
#' labs(title = "without scale_x_mic()")
|
||||
#' }
|
||||
#' if (require("ggplot2")) {
|
||||
#' mic_plot +
|
||||
#' scale_x_mic(keep_operators = "none") +
|
||||
#' labs(title = "with scale_x_mic() keeping no operators")
|
||||
#' scale_x_mic() +
|
||||
#' labs(title = "with scale_x_mic()")
|
||||
#' }
|
||||
#' if (require("ggplot2")) {
|
||||
#' mic_plot +
|
||||
#' scale_x_mic(keep_operators = "all") +
|
||||
#' labs(title = "with scale_x_mic() keeping all operators")
|
||||
#' }
|
||||
#' if (require("ggplot2")) {
|
||||
#' mic_plot +
|
||||
@@ -154,7 +151,7 @@
|
||||
#' ) +
|
||||
#' geom_boxplot() +
|
||||
#' geom_violin(linetype = 2, colour = "grey30", fill = NA) +
|
||||
#' labs(title = "scale_y_mic() automatically applied")
|
||||
#' scale_y_mic()
|
||||
#' }
|
||||
#' if (require("ggplot2")) {
|
||||
#' ggplot(
|
||||
@@ -186,7 +183,7 @@
|
||||
#'
|
||||
#' # Plotting using scale_y_mic() and scale_colour_sir() ------------------
|
||||
#' if (require("ggplot2")) {
|
||||
#' mic_sir_plot <- ggplot(
|
||||
#' plain <- ggplot(
|
||||
#' data.frame(
|
||||
#' mic = some_mic_values,
|
||||
#' group = some_groups,
|
||||
@@ -200,16 +197,21 @@
|
||||
#' theme_minimal() +
|
||||
#' geom_boxplot(fill = NA, colour = "grey30") +
|
||||
#' geom_jitter(width = 0.25)
|
||||
#' labs(title = "scale_y_mic()/scale_colour_sir() automatically applied")
|
||||
#'
|
||||
#' mic_sir_plot
|
||||
#' plain
|
||||
#' }
|
||||
#' if (require("ggplot2")) {
|
||||
#' mic_sir_plot +
|
||||
#' # and now with our MIC and SIR scale functions:
|
||||
#' plain +
|
||||
#' scale_y_mic() +
|
||||
#' scale_colour_sir()
|
||||
#' }
|
||||
#' if (require("ggplot2")) {
|
||||
#' plain +
|
||||
#' scale_y_mic(mic_range = c(0.005, 32), name = "Our MICs!") +
|
||||
#' scale_colour_sir(
|
||||
#' language = "pt", # Portuguese
|
||||
#' name = "Support in 28 languages"
|
||||
#' language = "pt",
|
||||
#' name = "Support in 27 languages"
|
||||
#' )
|
||||
#' }
|
||||
#' }
|
||||
@@ -227,9 +229,6 @@
|
||||
#' plot(some_sir_values)
|
||||
NULL
|
||||
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(ggplot2::scale_type, mic)
|
||||
scale_type.mic <- function(x) c("mic", "discrete")
|
||||
|
||||
create_scale_mic <- function(aest, keep_operators, mic_range = NULL, ...) {
|
||||
ggplot_fn <- getExportedValue(paste0("scale_", aest, "_continuous"),
|
||||
ns = asNamespace("ggplot2")
|
||||
@@ -248,7 +247,6 @@ create_scale_mic <- function(aest, keep_operators, mic_range = NULL, ...) {
|
||||
as.double(rescale_mic(x = as.double(as.mic(x)), keep_operators = keep_operators, mic_range = mic_range, as.mic = TRUE))
|
||||
}
|
||||
scale$transform_df <- function(self, df) {
|
||||
out <- list()
|
||||
if (!aest %in% colnames(df)) {
|
||||
# support for geom_hline(), geom_vline(), etc
|
||||
other_x <- c("xintercept", "xmin", "xmax", "xend", "width")
|
||||
@@ -258,15 +256,15 @@ create_scale_mic <- function(aest, keep_operators, mic_range = NULL, ...) {
|
||||
} else if (any(other_x %in% colnames(df))) {
|
||||
aest_val <- intersect(other_x, colnames(df))[1]
|
||||
} else {
|
||||
stop_("No support for plotting df with {.fun scale_", aest, "_mic} with columns ", vector_and(colnames(df), sort = FALSE))
|
||||
stop_("No support for plotting df with `scale_", aest, "_mic()` with columns ", vector_and(colnames(df), sort = FALSE))
|
||||
}
|
||||
mics <- rescale_mic(x = as.double(as.mic(df[[aest_val]])), keep_operators = "none", mic_range = NULL, as.mic = TRUE)
|
||||
if (!is.null(self$mic_values_rescaled) && any(mics < min(self$mic_values_rescaled, na.rm = TRUE) | mics > max(self$mic_values_rescaled, na.rm = TRUE), na.rm = TRUE)) {
|
||||
warning_("The value for {.field ", font_bold(aest_val), "} is outside the plotted MIC range, consider using/updating the {.arg mic_range} argument in {.fun scale_", aest, "_mic}.")
|
||||
out <- rescale_mic(x = as.double(as.mic(df[[aest_val]])), keep_operators = "none", mic_range = NULL, as.mic = TRUE)
|
||||
if (!is.null(self$mic_values_rescaled) && any(out < min(self$mic_values_rescaled, na.rm = TRUE) | out > max(self$mic_values_rescaled, na.rm = TRUE), na.rm = TRUE)) {
|
||||
warning_("The value for `", aest_val, "` is outside the plotted MIC range, consider using/updating the `mic_range` argument in `scale_", aest, "_mic()`.")
|
||||
}
|
||||
out[[aest_val]] <- log2(as.double(mics))
|
||||
df[[aest_val]] <- log2(as.double(out))
|
||||
} else {
|
||||
self$mic_values_rescaled <- rescale_mic(x = as.character(df[[aest]]), keep_operators = keep_operators, mic_range = mic_range, as.mic = TRUE)
|
||||
self$mic_values_rescaled <- rescale_mic(x = as.double(as.mic(df[[aest]])), keep_operators = keep_operators, mic_range = mic_range, as.mic = TRUE)
|
||||
# create new breaks and labels here
|
||||
lims <- range(self$mic_values_rescaled, na.rm = TRUE)
|
||||
# support inner and outer 'mic_range' settings (e.g., the data ranges 0.5-8 and 'mic_range' is set to 0.025-32)
|
||||
@@ -280,33 +278,19 @@ create_scale_mic <- function(aest, keep_operators, mic_range = NULL, ...) {
|
||||
ind_max <- which(COMMON_MIC_VALUES >= lims[2])[which.min(abs(COMMON_MIC_VALUES[COMMON_MIC_VALUES >= lims[2]] - lims[2]))] # Closest index where COMMON_MIC_VALUES >= lims[2]
|
||||
|
||||
self$mic_values_levels <- as.mic(COMMON_MIC_VALUES[ind_min:ind_max])
|
||||
if (length(unique(self$mic_values_levels)) > 1) {
|
||||
if (keep_operators == "all" && !all(self$mic_values_rescaled %in% self$mic_values_levels, na.rm = TRUE)) {
|
||||
self$mic_values_levels <- unique(sort(c(self$mic_values_levels, self$mic_values_rescaled)))
|
||||
|
||||
# collision = same log2 position, but different string labels
|
||||
log_positions <- log2(as.double(self$mic_values_levels))
|
||||
dup_positions <- log_positions[duplicated(log_positions) | duplicated(log_positions, fromLast = TRUE)]
|
||||
colliding_labels <- as.character(self$mic_values_levels)[log_positions %in% dup_positions]
|
||||
self$warn_keep_all_operators <- length(unique(colliding_labels)) > 1
|
||||
} else if (keep_operators == "edges") {
|
||||
self$mic_values_levels[1] <- paste0("<=", self$mic_values_levels[1])
|
||||
self$mic_values_levels[length(self$mic_values_levels)] <- paste0(">=", self$mic_values_levels[length(self$mic_values_levels)])
|
||||
}
|
||||
if (keep_operators %in% c("edges", "all") && length(unique(self$mic_values_levels)) > 1) {
|
||||
self$mic_values_levels[1] <- paste0("<=", self$mic_values_levels[1])
|
||||
self$mic_values_levels[length(self$mic_values_levels)] <- paste0(">=", self$mic_values_levels[length(self$mic_values_levels)])
|
||||
}
|
||||
|
||||
self$mic_values_log <- log2(as.double(self$mic_values_rescaled))
|
||||
|
||||
if (aest == "y" && "group" %in% colnames(df)) {
|
||||
if (!"x" %in% colnames(df) || all(is.na(df$x))) {
|
||||
out$group <- 1
|
||||
} else {
|
||||
out$group <- as.integer(factor(df$x))
|
||||
}
|
||||
if (aest == "y" && "group" %in% colnames(df) && "x" %in% colnames(df)) {
|
||||
df$group <- as.integer(factor(df$x))
|
||||
}
|
||||
out[[aest]] <- self$mic_values_log
|
||||
df[[aest]] <- self$mic_values_log
|
||||
}
|
||||
out
|
||||
df
|
||||
}
|
||||
|
||||
scale$breaks <- function(..., self) {
|
||||
@@ -322,26 +306,7 @@ create_scale_mic <- function(aest, keep_operators, mic_range = NULL, ...) {
|
||||
}
|
||||
scale$labels <- function(..., self) {
|
||||
if (is.null(self$mic_breaks_set)) {
|
||||
if (isTRUE(self$warn_keep_all_operators)) {
|
||||
lookup <- tapply(
|
||||
as.character(self$mic_values_rescaled),
|
||||
self$mic_values_log,
|
||||
function(x) paste(unique(x), collapse = ", ")
|
||||
)
|
||||
level_log <- as.character(log2(as.double(self$mic_values_levels)))
|
||||
|
||||
if (any(grepl(", ", lookup))) {
|
||||
warning_("Using {.arg keep_operators = \"all\"} caused MIC values with different operators to share the same log2 position on the axis. These have been combined into a single label (e.g., {.val ", lookup[grepl(", ", lookup)][1], "}).", call = FALSE)
|
||||
}
|
||||
|
||||
ifelse(
|
||||
level_log %in% names(lookup),
|
||||
lookup[level_log],
|
||||
as.character(self$mic_values_levels)
|
||||
)
|
||||
} else {
|
||||
self$mic_values_levels
|
||||
}
|
||||
self$mic_values_levels
|
||||
} else {
|
||||
breaks <- tryCatch(scale$breaks(), error = function(e) NULL)
|
||||
if (!is.null(breaks)) {
|
||||
@@ -352,6 +317,7 @@ create_scale_mic <- function(aest, keep_operators, mic_range = NULL, ...) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scale$limits <- function(x, ..., self) {
|
||||
if (!is.null(self$mic_limits_set)) {
|
||||
if (is.function(self$mic_limits_set)) {
|
||||
@@ -363,7 +329,7 @@ create_scale_mic <- function(aest, keep_operators, mic_range = NULL, ...) {
|
||||
rng <- range(log2(as.mic(self$mic_values_levels)))
|
||||
# add 0.5 extra space
|
||||
rng <- c(rng[1] - 0.5, rng[2] + 0.5)
|
||||
if (!is.null(x) && !is.na(x[1]) && x[1] == 0) {
|
||||
if (!is.na(x[1]) && x[1] == 0) {
|
||||
# scale that start at 0 must remain so, e.g. in case of geom_col()
|
||||
rng[1] <- 0
|
||||
}
|
||||
@@ -411,9 +377,6 @@ scale_fill_mic <- function(keep_operators = "edges", mic_range = NULL, ...) {
|
||||
create_scale_mic("fill", keep_operators = keep_operators, mic_range = mic_range, ...)
|
||||
}
|
||||
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(ggplot2::scale_type, sir)
|
||||
scale_type.sir <- function(x) c("sir", "discrete")
|
||||
|
||||
create_scale_sir <- function(aesthetics, colours_SIR, language, eucast_I, ...) {
|
||||
args <- list(...)
|
||||
args[c("value", "labels", "limits")] <- NULL
|
||||
@@ -428,12 +391,7 @@ create_scale_sir <- function(aesthetics, colours_SIR, language, eucast_I, ...) {
|
||||
args,
|
||||
list(
|
||||
aesthetics = aesthetics,
|
||||
values = c(colours_SIR,
|
||||
NI = "grey30",
|
||||
WT = unname(colours_SIR[1]),
|
||||
NWT = unname(colours_SIR[4]),
|
||||
NS = unname(colours_SIR[4])
|
||||
)
|
||||
values = c(colours_SIR, NI = "grey30")
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -441,7 +399,7 @@ create_scale_sir <- function(aesthetics, colours_SIR, language, eucast_I, ...) {
|
||||
|
||||
scale$labels <- function(x) {
|
||||
stop_ifnot(all(x %in% c(levels(NA_sir_), "SI", "IR", NA)),
|
||||
"Apply `scale_", aesthetics[1], "_sir()` to a variable of class {.cls sir}, see {.help [{.fun as.sir}](AMR::as.sir)}.",
|
||||
"Apply `scale_", aesthetics[1], "_sir()` to a variable of class 'sir', see `?as.sir`.",
|
||||
call = FALSE
|
||||
)
|
||||
x <- as.character(x)
|
||||
@@ -458,9 +416,6 @@ create_scale_sir <- function(aesthetics, colours_SIR, language, eucast_I, ...) {
|
||||
x[x == "SI"] <- "(S/I) Susceptible"
|
||||
x[x == "IR"] <- "(I/R) Non-susceptible"
|
||||
x[x == "NI"] <- "(NI) Non-interpretable"
|
||||
x[x == "WT"] <- "(WT) Wildtype"
|
||||
x[x == "NWT"] <- "(NWT) Non-wildtype"
|
||||
x[x == "NS"] <- "(NS) Non-susceptible"
|
||||
x <- translate_AMR(x, language = language)
|
||||
}
|
||||
x
|
||||
@@ -482,7 +437,7 @@ scale_x_sir <- function(colours_SIR = c(
|
||||
R = "#ED553B"
|
||||
),
|
||||
language = get_AMR_locale(),
|
||||
eucast_I = getOption("AMR_guideline", "EUCAST") %like% "EUCAST",
|
||||
eucast_I = getOption("AMR_guideline", "EUCAST") == "EUCAST",
|
||||
...) {
|
||||
meet_criteria(colours_SIR, allow_class = "character", has_length = c(1, 3, 4))
|
||||
language <- validate_language(language)
|
||||
@@ -499,7 +454,7 @@ scale_colour_sir <- function(colours_SIR = c(
|
||||
R = "#ED553B"
|
||||
),
|
||||
language = get_AMR_locale(),
|
||||
eucast_I = getOption("AMR_guideline", "EUCAST") %like% "EUCAST",
|
||||
eucast_I = getOption("AMR_guideline", "EUCAST") == "EUCAST",
|
||||
...) {
|
||||
meet_criteria(colours_SIR, allow_class = "character", has_length = c(1, 3, 4))
|
||||
language <- validate_language(language)
|
||||
@@ -528,7 +483,7 @@ scale_fill_sir <- function(colours_SIR = c(
|
||||
R = "#ED553B"
|
||||
),
|
||||
language = get_AMR_locale(),
|
||||
eucast_I = getOption("AMR_guideline", "EUCAST") %like% "EUCAST",
|
||||
eucast_I = getOption("AMR_guideline", "EUCAST") == "EUCAST",
|
||||
...) {
|
||||
meet_criteria(colours_SIR, allow_class = "character", has_length = c(1, 3, 4))
|
||||
language <- validate_language(language)
|
||||
@@ -574,16 +529,11 @@ plot.mic <- function(x,
|
||||
meet_criteria(colours_SIR, allow_class = "character", has_length = c(1, 3, 4))
|
||||
language <- validate_language(language)
|
||||
meet_criteria(expand, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(include_PKPD, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(breakpoint_type, allow_class = "character", is_in = AMR::clinical_breakpoints$type, has_length = 1)
|
||||
|
||||
x <- as.mic(x) # make sure that currently implemented MIC levels are used
|
||||
main <- gsub(" +", " ", paste0(main, collapse = " "))
|
||||
colours_SIR <- expand_SIR_colours(colours_SIR)
|
||||
|
||||
# wildtype/Non-wildtype
|
||||
is_wt_nwt <- identical(breakpoint_type, "ECOFF")
|
||||
|
||||
x <- plotrange_as_table(x, expand = expand)
|
||||
cols_sub <- plot_colours_subtitle_guideline(
|
||||
x = x,
|
||||
@@ -614,14 +564,10 @@ plot.mic <- function(x,
|
||||
if (any(colours_SIR %in% cols_sub$cols)) {
|
||||
legend_txt <- character(0)
|
||||
legend_col <- character(0)
|
||||
if (!is_wt_nwt & any(cols_sub$cols == colours_SIR[1] & cols_sub$count > 0)) {
|
||||
if (any(cols_sub$cols == colours_SIR[1] & cols_sub$count > 0)) {
|
||||
legend_txt <- c(legend_txt, "(S) Susceptible")
|
||||
legend_col <- colours_SIR[1]
|
||||
}
|
||||
if (is_wt_nwt & any(cols_sub$cols == colours_SIR[1] & cols_sub$count > 0)) {
|
||||
legend_txt <- c(legend_txt, "(WT) Wildtype")
|
||||
legend_col <- colours_SIR[1]
|
||||
}
|
||||
if (any(cols_sub$cols == colours_SIR[2] & cols_sub$count > 0)) {
|
||||
legend_txt <- c(legend_txt, "(SDD) Susceptible dose-dependent")
|
||||
legend_col <- c(legend_col, colours_SIR[2])
|
||||
@@ -630,14 +576,10 @@ plot.mic <- function(x,
|
||||
legend_txt <- c(legend_txt, paste("(I)", plot_name_of_I(cols_sub$guideline)))
|
||||
legend_col <- c(legend_col, colours_SIR[3])
|
||||
}
|
||||
if (!is_wt_nwt & any(cols_sub$cols == colours_SIR[4] & cols_sub$count > 0)) {
|
||||
if (any(cols_sub$cols == colours_SIR[4] & cols_sub$count > 0)) {
|
||||
legend_txt <- c(legend_txt, "(R) Resistant")
|
||||
legend_col <- c(legend_col, colours_SIR[4])
|
||||
}
|
||||
if (is_wt_nwt & any(cols_sub$cols == colours_SIR[4] & cols_sub$count > 0)) {
|
||||
legend_txt <- c(legend_txt, "(NWT) Non-wildtype")
|
||||
legend_col <- c(legend_col, colours_SIR[4])
|
||||
}
|
||||
|
||||
legend("top",
|
||||
x.intersp = 0.5,
|
||||
@@ -730,8 +672,6 @@ autoplot.mic <- function(object,
|
||||
meet_criteria(colours_SIR, allow_class = "character", has_length = c(1, 3, 4))
|
||||
language <- validate_language(language)
|
||||
meet_criteria(expand, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(include_PKPD, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(breakpoint_type, allow_class = "character", is_in = AMR::clinical_breakpoints$type, has_length = 1)
|
||||
|
||||
if ("main" %in% names(list(...))) {
|
||||
title <- list(...)$main
|
||||
@@ -742,9 +682,6 @@ autoplot.mic <- function(object,
|
||||
|
||||
colours_SIR <- expand_SIR_colours(colours_SIR)
|
||||
|
||||
# wildtype/Non-wildtype
|
||||
is_wt_nwt <- identical(breakpoint_type, "ECOFF")
|
||||
|
||||
object <- as.mic(object) # make sure that currently implemented MIC levels are used
|
||||
x <- plotrange_as_table(object, expand = expand)
|
||||
cols_sub <- plot_colours_subtitle_guideline(
|
||||
@@ -763,21 +700,17 @@ autoplot.mic <- function(object,
|
||||
df <- as.data.frame(x, stringsAsFactors = TRUE)
|
||||
colnames(df) <- c("mic", "count")
|
||||
df$cols <- cols_sub$cols
|
||||
df$cols[df$cols == colours_SIR[1] & !is_wt_nwt] <- "(S) Susceptible"
|
||||
df$cols[df$cols == colours_SIR[1] & is_wt_nwt] <- "(WT) Wildtype"
|
||||
df$cols[df$cols == colours_SIR[1]] <- "(S) Susceptible"
|
||||
df$cols[df$cols == colours_SIR[2]] <- "(SDD) Susceptible dose-dependent"
|
||||
df$cols[df$cols == colours_SIR[3]] <- paste("(I)", plot_name_of_I(cols_sub$guideline))
|
||||
df$cols[df$cols == colours_SIR[4] & !is_wt_nwt] <- "(R) Resistant"
|
||||
df$cols[df$cols == colours_SIR[4] & is_wt_nwt] <- "(NWT) Non-wildtype"
|
||||
df$cols[df$cols == colours_SIR[4]] <- "(R) Resistant"
|
||||
df$cols <- factor(translate_into_language(df$cols, language = language),
|
||||
levels = translate_into_language(
|
||||
c(
|
||||
"(S) Susceptible",
|
||||
"(SDD) Susceptible dose-dependent",
|
||||
paste("(I)", plot_name_of_I(cols_sub$guideline)),
|
||||
"(R) Resistant",
|
||||
"(WT) Wildtype",
|
||||
"(NWT) Non-wildtype"
|
||||
"(R) Resistant"
|
||||
),
|
||||
language = language
|
||||
),
|
||||
@@ -792,9 +725,7 @@ autoplot.mic <- function(object,
|
||||
"(I) Susceptible, incr. exp." = colours_SIR[3],
|
||||
"(I) Intermediate" = colours_SIR[3],
|
||||
"(R) Resistant" = colours_SIR[4],
|
||||
"(NI) Non-interpretable" = "grey30",
|
||||
"(WT) Wildtype" = colours_SIR[1],
|
||||
"(NWT) Non-wildtype" = colours_SIR[4]
|
||||
"(NI) Non-interpretable" = "grey30"
|
||||
)
|
||||
names(vals) <- translate_into_language(names(vals), language = language)
|
||||
p <- p +
|
||||
@@ -858,15 +789,10 @@ plot.disk <- function(x,
|
||||
meet_criteria(colours_SIR, allow_class = "character", has_length = c(1, 3, 4))
|
||||
language <- validate_language(language)
|
||||
meet_criteria(expand, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(include_PKPD, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(breakpoint_type, allow_class = "character", is_in = AMR::clinical_breakpoints$type, has_length = 1)
|
||||
|
||||
main <- gsub(" +", " ", paste0(main, collapse = " "))
|
||||
colours_SIR <- expand_SIR_colours(colours_SIR)
|
||||
|
||||
# wildtype/Non-wildtype
|
||||
is_wt_nwt <- identical(breakpoint_type, "ECOFF")
|
||||
|
||||
x <- plotrange_as_table(x, expand = expand)
|
||||
cols_sub <- plot_colours_subtitle_guideline(
|
||||
x = x,
|
||||
@@ -898,14 +824,10 @@ plot.disk <- function(x,
|
||||
if (any(colours_SIR %in% cols_sub$cols)) {
|
||||
legend_txt <- character(0)
|
||||
legend_col <- character(0)
|
||||
if (!is_wt_nwt & any(cols_sub$cols == colours_SIR[4] & cols_sub$count > 0)) {
|
||||
if (any(cols_sub$cols == colours_SIR[4] & cols_sub$count > 0)) {
|
||||
legend_txt <- "(R) Resistant"
|
||||
legend_col <- colours_SIR[4]
|
||||
}
|
||||
if (is_wt_nwt & any(cols_sub$cols == colours_SIR[4] & cols_sub$count > 0)) {
|
||||
legend_txt <- "(NWT) Non-wildtype"
|
||||
legend_col <- colours_SIR[4]
|
||||
}
|
||||
if (any(cols_sub$cols == colours_SIR[3] & cols_sub$count > 0)) {
|
||||
legend_txt <- c(legend_txt, paste("(I)", plot_name_of_I(cols_sub$guideline)))
|
||||
legend_col <- c(legend_col, colours_SIR[3])
|
||||
@@ -914,14 +836,10 @@ plot.disk <- function(x,
|
||||
legend_txt <- c(legend_txt, "(SDD) Susceptible dose-dependent")
|
||||
legend_col <- c(legend_col, colours_SIR[2])
|
||||
}
|
||||
if (!is_wt_nwt & any(cols_sub$cols == colours_SIR[1] & cols_sub$count > 0)) {
|
||||
if (any(cols_sub$cols == colours_SIR[1] & cols_sub$count > 0)) {
|
||||
legend_txt <- c(legend_txt, "(S) Susceptible")
|
||||
legend_col <- c(legend_col, colours_SIR[1])
|
||||
}
|
||||
if (is_wt_nwt & any(cols_sub$cols == colours_SIR[1] & cols_sub$count > 0)) {
|
||||
legend_txt <- c(legend_txt, "(WT) Wildtype")
|
||||
legend_col <- c(legend_col, colours_SIR[1])
|
||||
}
|
||||
legend("top",
|
||||
x.intersp = 0.5,
|
||||
legend = translate_into_language(legend_txt, language = language),
|
||||
@@ -953,8 +871,6 @@ barplot.disk <- function(height,
|
||||
),
|
||||
language = get_AMR_locale(),
|
||||
expand = TRUE,
|
||||
include_PKPD = getOption("AMR_include_PKPD", TRUE),
|
||||
breakpoint_type = getOption("AMR_breakpoint_type", "human"),
|
||||
...) {
|
||||
meet_criteria(main, allow_class = "character", has_length = 1, allow_NULL = TRUE)
|
||||
meet_criteria(ylab, allow_class = "character", has_length = 1)
|
||||
@@ -965,8 +881,6 @@ barplot.disk <- function(height,
|
||||
meet_criteria(colours_SIR, allow_class = "character", has_length = c(1, 3, 4))
|
||||
language <- validate_language(language)
|
||||
meet_criteria(expand, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(include_PKPD, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(breakpoint_type, allow_class = "character", is_in = AMR::clinical_breakpoints$type, has_length = 1)
|
||||
|
||||
main <- gsub(" +", " ", paste0(main, collapse = " "))
|
||||
|
||||
@@ -979,10 +893,6 @@ barplot.disk <- function(height,
|
||||
ab = ab,
|
||||
guideline = guideline,
|
||||
colours_SIR = colours_SIR,
|
||||
language = language,
|
||||
expand = expand,
|
||||
include_PKPD = include_PKPD,
|
||||
breakpoint_type = breakpoint_type,
|
||||
...
|
||||
)
|
||||
}
|
||||
@@ -1029,9 +939,6 @@ autoplot.disk <- function(object,
|
||||
|
||||
colours_SIR <- expand_SIR_colours(colours_SIR)
|
||||
|
||||
# wildtype/Non-wildtype
|
||||
is_wt_nwt <- identical(breakpoint_type, "ECOFF")
|
||||
|
||||
x <- plotrange_as_table(object, expand = expand)
|
||||
cols_sub <- plot_colours_subtitle_guideline(
|
||||
x = x,
|
||||
@@ -1049,26 +956,23 @@ autoplot.disk <- function(object,
|
||||
df <- as.data.frame(x, stringsAsFactors = TRUE)
|
||||
colnames(df) <- c("disk", "count")
|
||||
df$cols <- cols_sub$cols
|
||||
df$cols[df$cols == colours_SIR[1] & !is_wt_nwt] <- "(S) Susceptible"
|
||||
df$cols[df$cols == colours_SIR[1] & is_wt_nwt] <- "(WT) Wildtype"
|
||||
df$cols[df$cols == colours_SIR[1]] <- "(S) Susceptible"
|
||||
df$cols[df$cols == colours_SIR[2]] <- "(SDD) Susceptible dose-dependent"
|
||||
df$cols[df$cols == colours_SIR[3]] <- paste("(I)", plot_name_of_I(cols_sub$guideline))
|
||||
df$cols[df$cols == colours_SIR[4] & !is_wt_nwt] <- "(R) Resistant"
|
||||
df$cols[df$cols == colours_SIR[4] & is_wt_nwt] <- "(NWT) Non-wildtype"
|
||||
df$cols[df$cols == colours_SIR[4]] <- "(R) Resistant"
|
||||
df$cols <- factor(translate_into_language(df$cols, language = language),
|
||||
levels = translate_into_language(
|
||||
c(
|
||||
"(S) Susceptible",
|
||||
paste("(I)", plot_name_of_I(cols_sub$guideline)),
|
||||
"(R) Resistant",
|
||||
"(WT) Wildtype",
|
||||
"(NWT) Non-wildtype"
|
||||
"(R) Resistant"
|
||||
),
|
||||
language = language
|
||||
),
|
||||
ordered = TRUE
|
||||
)
|
||||
p <- ggplot2::ggplot(df)
|
||||
|
||||
if (any(colours_SIR %in% cols_sub$cols)) {
|
||||
vals <- c(
|
||||
"(S) Susceptible" = colours_SIR[1],
|
||||
@@ -1076,9 +980,7 @@ autoplot.disk <- function(object,
|
||||
"(I) Susceptible, incr. exp." = colours_SIR[3],
|
||||
"(I) Intermediate" = colours_SIR[3],
|
||||
"(R) Resistant" = colours_SIR[4],
|
||||
"(NI) Non-interpretable" = "grey30",
|
||||
"(WT) Wildtype" = colours_SIR[1],
|
||||
"(NWT) Non-wildtype" = colours_SIR[4]
|
||||
"(NI) Non-interpretable" = "grey30"
|
||||
)
|
||||
names(vals) <- translate_into_language(names(vals), language = language)
|
||||
p <- p +
|
||||
@@ -1126,25 +1028,25 @@ plot.sir <- function(x,
|
||||
data <- as.data.frame(table(x), stringsAsFactors = FALSE)
|
||||
colnames(data) <- c("x", "n")
|
||||
data$s <- round((data$n / sum(data$n)) * 100, 1)
|
||||
data <- data[which(data$n > 0), ]
|
||||
|
||||
if (!all(data$x %in% c("WT", "NWT"), na.rm = TRUE)) {
|
||||
# # be sure to have at least S, I, and R
|
||||
if (!"S" %in% data$x) {
|
||||
data <- rbind_AMR(data, data.frame(x = "S", n = 0, s = 0, stringsAsFactors = FALSE))
|
||||
}
|
||||
if (!"I" %in% data$x) {
|
||||
data <- rbind_AMR(data, data.frame(x = "I", n = 0, s = 0, stringsAsFactors = FALSE))
|
||||
}
|
||||
if (!"R" %in% data$x) {
|
||||
data <- rbind_AMR(data, data.frame(x = "R", n = 0, s = 0, stringsAsFactors = FALSE))
|
||||
}
|
||||
lvls <- VALID_SIR_LEVELS[VALID_SIR_LEVELS %in% c(data$x, c("S", "I", "R"))]
|
||||
} else {
|
||||
lvls <- c("WT", "NWT")
|
||||
if (!"S" %in% data$x) {
|
||||
data <- rbind_AMR(data, data.frame(x = "S", n = 0, s = 0, stringsAsFactors = FALSE))
|
||||
}
|
||||
if (!"SDD" %in% data$x) {
|
||||
data <- rbind_AMR(data, data.frame(x = "SDD", n = 0, s = 0, stringsAsFactors = FALSE))
|
||||
}
|
||||
if (!"I" %in% data$x) {
|
||||
data <- rbind_AMR(data, data.frame(x = "I", n = 0, s = 0, stringsAsFactors = FALSE))
|
||||
}
|
||||
if (!"R" %in% data$x) {
|
||||
data <- rbind_AMR(data, data.frame(x = "R", n = 0, s = 0, stringsAsFactors = FALSE))
|
||||
}
|
||||
if (!"NI" %in% data$x) {
|
||||
data <- rbind_AMR(data, data.frame(x = "NI", n = 0, s = 0, stringsAsFactors = FALSE))
|
||||
}
|
||||
|
||||
data$x <- factor(data$x, levels = lvls, ordered = TRUE)
|
||||
data <- data[!(data$n == 0 & data$x %in% c("SDD", "I", "NI")), , drop = FALSE]
|
||||
data$x <- factor(data$x, levels = intersect(unique(data$x), c("S", "SDD", "I", "R", "NI")), ordered = TRUE)
|
||||
|
||||
ymax <- pm_if_else(max(data$s) > 95, 105, 100)
|
||||
|
||||
@@ -1159,7 +1061,7 @@ plot.sir <- function(x,
|
||||
axes = FALSE
|
||||
)
|
||||
# x axis
|
||||
axis(side = 1, at = seq_along(lvls), labels = lvls, lwd = 0)
|
||||
axis(side = 1, at = 1:pm_n_distinct(data$x), labels = levels(data$x), lwd = 0)
|
||||
# y axis, 0-100%
|
||||
axis(side = 2, at = seq(0, 100, 5))
|
||||
|
||||
@@ -1202,14 +1104,9 @@ barplot.sir <- function(height,
|
||||
main <- gsub(" +", " ", paste0(main, collapse = " "))
|
||||
|
||||
x <- table(height)
|
||||
if (all(height %in% c("WT", "NWT"), na.rm = TRUE)) {
|
||||
colours_SIR <- colours_SIR[c(1, 4)]
|
||||
x <- x[names(x) %in% c("WT", "NWT")]
|
||||
} else {
|
||||
# remove missing I, SDD, and N
|
||||
colours_SIR <- colours_SIR[!(names(x) %in% c("SDD", "I", "NI") & x == 0)]
|
||||
x <- x[!(names(x) %in% c("SDD", "I", "NI") & x == 0)]
|
||||
}
|
||||
# remove missing I, SDD, and N
|
||||
colours_SIR <- colours_SIR[!(names(x) %in% c("SDD", "I", "NI") & x == 0)]
|
||||
x <- x[!(names(x) %in% c("SDD", "I", "NI") & x == 0)]
|
||||
# plot it
|
||||
barplot(x,
|
||||
col = colours_SIR,
|
||||
@@ -1255,11 +1152,6 @@ autoplot.sir <- function(object,
|
||||
df <- as.data.frame(table(object), stringsAsFactors = TRUE)
|
||||
colnames(df) <- c("x", "n")
|
||||
df <- df[!(df$n == 0 & df$x %in% c("SDD", "I", "NI")), , drop = FALSE]
|
||||
if (all(object %in% c("WT", "NWT"), na.rm = TRUE)) {
|
||||
df <- df[which(df$x %in% c("WT", "NWT")), ]
|
||||
} else {
|
||||
df <- df[which(!df$x %in% c("WT", "NWT", "NS")), ]
|
||||
}
|
||||
ggplot2::ggplot(df) +
|
||||
ggplot2::geom_col(ggplot2::aes(x = x, y = n, fill = x)) +
|
||||
# limits = force is needed because of a ggplot2 >= 3.3.4 bug (#4511)
|
||||
@@ -1269,9 +1161,7 @@ autoplot.sir <- function(object,
|
||||
"SDD" = colours_SIR[2],
|
||||
"I" = colours_SIR[3],
|
||||
"R" = colours_SIR[4],
|
||||
"NI" = "grey30",
|
||||
"WT" = colours_SIR[1],
|
||||
"NWT" = colours_SIR[4]
|
||||
"NI" = "grey30"
|
||||
),
|
||||
limits = force
|
||||
) +
|
||||
@@ -1400,9 +1290,6 @@ plot_colours_subtitle_guideline <- function(x, mo, ab, guideline, colours_SIR, f
|
||||
cols[sir == "I"] <- colours_SIR[3]
|
||||
cols[sir == "R"] <- colours_SIR[4]
|
||||
cols[sir == "NI"] <- "grey30"
|
||||
cols[sir == "WT"] <- colours_SIR[1]
|
||||
cols[sir == "NWT"] <- colours_SIR[4]
|
||||
cols[sir == "NS"] <- colours_SIR[4]
|
||||
sub <- bquote(.(abname) ~ "-" ~ italic(.(moname)) ~ .(guideline_txt))
|
||||
} else {
|
||||
cols <- "#BEBEBE"
|
||||
@@ -1472,10 +1359,10 @@ scale_sir_colours <- function(...,
|
||||
meet_criteria(colours_SIR, allow_class = "character", has_length = c(1, 3, 4))
|
||||
|
||||
if ("fill" %in% aesthetics && message_not_thrown_before("scale_sir_colours", "fill", entire_session = TRUE)) {
|
||||
warning_("Using {.fun scale_sir_colours} for the {.code fill} aesthetic has been superseded by {.fun scale_fill_sir}, please use that instead. This warning will be shown once per session.")
|
||||
warning_("Using `scale_sir_colours()` for the `fill` aesthetic has been superseded by `scale_fill_sir()`, please use that instead. This warning will be shown once per session.")
|
||||
}
|
||||
if (any(c("colour", "color") %in% aesthetics) && message_not_thrown_before("scale_sir_colours", "colour", entire_session = TRUE)) {
|
||||
warning_("Using {.fun scale_sir_colours} for the {.code colour} aesthetic has been superseded by {.fun scale_colour_sir}, please use that instead. This warning will be shown once per session.")
|
||||
warning_("Using `scale_sir_colours()` for the `colour` aesthetic has been superseded by `scale_colour_sir()`, please use that instead. This warning will be shown once per session.")
|
||||
}
|
||||
|
||||
if ("colours" %in% names(list(...))) {
|
||||
@@ -1619,7 +1506,7 @@ expand_SIR_colours <- function(colours_SIR, unname = TRUE) {
|
||||
# named input: match and reorder
|
||||
stop_ifnot(
|
||||
all(names(colours_SIR) %in% sir_order),
|
||||
"Unknown names in {.arg colours_SIR}. Expected any of: ", vector_or(levels(NA_sir_), quotes = FALSE, sort = FALSE), "."
|
||||
"Unknown names in `colours_SIR`. Expected any of: ", vector_or(levels(NA_sir_), quotes = FALSE, sort = FALSE), "."
|
||||
)
|
||||
if (length(colours_SIR) == 4) {
|
||||
# add colours for SI (same as S) and IR (same as R)
|
||||
|
||||
59
R/proportion.R
Executable file → Normal file
59
R/proportion.R
Executable file → Normal file
@@ -38,11 +38,6 @@
|
||||
#' @param only_all_tested (for combination therapies, i.e. using more than one variable for `...`): a [logical] to indicate that isolates must be tested for all antimicrobials, see section *Combination Therapy* below.
|
||||
#' @param data A [data.frame] containing columns with class [`sir`] (see [as.sir()]).
|
||||
#' @param translate_ab A column name of the [antimicrobials] data set to translate the antibiotic abbreviations to, using [ab_property()].
|
||||
#' @param guideline Either `"EUCAST"` (default) or `"CLSI"`. With EUCAST, the 'I' category will be considered as susceptible (see [EUCAST website](https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/definition-of-s-i-and-r/)), but with with CLSI, it will be considered resistant. Therefore:
|
||||
#' * EUCAST: [susceptibility()] \eqn{= \%S + \%I}, [resistance()] \eqn{= \%R}
|
||||
#' * CLSI: [susceptibility()] \eqn{= \%S + \%SDD}, [resistance()] \eqn{= \%I + \%R}
|
||||
#'
|
||||
#' You can also use e.g. [proportion_R()] or [proportion_S()] instead, to be explicit.
|
||||
#' @inheritParams ab_property
|
||||
#' @param combine_SI A [logical] to indicate whether all values of S, SDD, and I must be merged into one, so the output only consists of S+SDD+I vs. R (susceptible vs. resistant) - the default is `TRUE`.
|
||||
#' @param ab_result Antibiotic results to test against, must be one or more values of "S", "SDD", "I", or "R".
|
||||
@@ -100,7 +95,7 @@
|
||||
#' ```
|
||||
#'
|
||||
#' Using `only_all_tested` has no impact when only using one antibiotic as input.
|
||||
#' @references **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition**, 2022, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
|
||||
#' @source **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition**, 2022, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
|
||||
#' @seealso [AMR::count()] to count resistant and susceptible isolates.
|
||||
#' @return A [double] or, when `as_percent = TRUE`, a [character].
|
||||
#' @rdname proportion
|
||||
@@ -233,25 +228,10 @@
|
||||
resistance <- function(...,
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE,
|
||||
guideline = getOption("AMR_guideline", "EUCAST")) {
|
||||
# other arguments for meet_criteria are handled by sir_calc()
|
||||
if (guideline %like% "EUCAST") {
|
||||
guideline <- "EUCAST"
|
||||
} else if (guideline %like% "CLSI") {
|
||||
guideline <- "CLSI"
|
||||
}
|
||||
meet_criteria(guideline, allow_class = "character", is_in = c("EUCAST", "CLSI"), has_length = 1)
|
||||
if (is.null(getOption("AMR_guideline")) && missing(guideline) && message_not_thrown_before("resistance", "eucast_default", entire_session = TRUE)) {
|
||||
message_("{.help [{.fun resistance}](AMR::resistance)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic [AMR-options](AMR::AMR-options)}.")
|
||||
message_("This message will be shown once per session.")
|
||||
}
|
||||
only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c(
|
||||
"R", "NWT", "NS",
|
||||
if (identical(guideline, "CLSI")) "I"
|
||||
),
|
||||
ab_result = "R",
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
@@ -266,25 +246,10 @@ resistance <- function(...,
|
||||
susceptibility <- function(...,
|
||||
minimum = 30,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE,
|
||||
guideline = getOption("AMR_guideline", "EUCAST")) {
|
||||
# other arguments for meet_criteria are handled by sir_calc()
|
||||
if (guideline %like% "EUCAST") {
|
||||
guideline <- "EUCAST"
|
||||
} else if (guideline %like% "CLSI") {
|
||||
guideline <- "CLSI"
|
||||
}
|
||||
meet_criteria(guideline, allow_class = "character", is_in = c("EUCAST", "CLSI"), has_length = 1)
|
||||
if (is.null(getOption("AMR_guideline")) && missing(guideline) && message_not_thrown_before("susceptibility", "eucast_default", entire_session = TRUE)) {
|
||||
message_("{.help [{.fun susceptibility}](AMR::susceptibility)} assumes the EUCAST guideline and thus considers the 'I' category susceptible. Set the {.arg guideline} argument or the {.code AMR_guideline} option to either \"CLSI\" or \"EUCAST\", see {.topic [AMR-options](AMR::AMR-options)}.")
|
||||
message_("This message will be shown once per session.")
|
||||
}
|
||||
only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c(
|
||||
"S", "SDD", "WT",
|
||||
if (identical(guideline, "EUCAST")) "I"
|
||||
),
|
||||
ab_result = c("S", "SDD", "I"),
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
@@ -304,7 +269,7 @@ sir_confidence_interval <- function(...,
|
||||
confidence_level = 0.95,
|
||||
side = "both",
|
||||
collapse = FALSE) {
|
||||
meet_criteria(ab_result, allow_class = c("character", "sir"), has_length = seq_along(VALID_SIR_LEVELS), is_in = VALID_SIR_LEVELS)
|
||||
meet_criteria(ab_result, allow_class = c("character", "sir"), has_length = c(1:5), is_in = c("S", "SDD", "I", "R", "NI"))
|
||||
meet_criteria(minimum, allow_class = c("numeric", "integer"), has_length = 1, is_positive_or_zero = TRUE, is_finite = TRUE)
|
||||
meet_criteria(as_percent, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(only_all_tested, allow_class = "logical", has_length = 1)
|
||||
@@ -322,7 +287,7 @@ sir_confidence_interval <- function(...,
|
||||
)
|
||||
n <- tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = VALID_SIR_LEVELS,
|
||||
ab_result = c("S", "SDD", "I", "R", "NI"),
|
||||
only_all_tested = only_all_tested,
|
||||
only_count = TRUE
|
||||
),
|
||||
@@ -356,7 +321,7 @@ sir_confidence_interval <- function(...,
|
||||
if (n < minimum) {
|
||||
warning_("Introducing NA: ",
|
||||
ifelse(n == 0, "no", paste("only", n)),
|
||||
" results available for {.help [{.fun sir_confidence_interval}](AMR::sir_confidence_interval)} (whilst {.arg minimum = ", minimum, "}).",
|
||||
" results available for `sir_confidence_interval()` (`minimum` = ", minimum, ").",
|
||||
call = FALSE
|
||||
)
|
||||
if (is.character(out)) {
|
||||
@@ -376,7 +341,7 @@ proportion_R <- function(...,
|
||||
only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c("R", "NWT", "NS"),
|
||||
ab_result = "R",
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
@@ -394,7 +359,7 @@ proportion_IR <- function(...,
|
||||
only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c("I", "SDD", "R", "NWT", "NS"),
|
||||
ab_result = c("I", "SDD", "R"),
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
@@ -430,7 +395,7 @@ proportion_SI <- function(...,
|
||||
only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c("S", "I", "SDD", "WT"),
|
||||
ab_result = c("S", "I", "SDD"),
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
@@ -448,7 +413,7 @@ proportion_S <- function(...,
|
||||
only_all_tested = FALSE) {
|
||||
tryCatch(
|
||||
sir_calc(...,
|
||||
ab_result = c("S", "WT"),
|
||||
ab_result = "S",
|
||||
minimum = minimum,
|
||||
as_percent = as_percent,
|
||||
only_all_tested = only_all_tested,
|
||||
|
||||
@@ -138,7 +138,7 @@ resistance_predict <- function(x,
|
||||
extra_msg = paste0("Use the tidymodels framework instead, for which we have written a basic and short introduction on our website: ", font_url("https://amr-for-r.org/articles/AMR_with_tidymodels.html", txt = font_bold("AMR with tidymodels")))
|
||||
)
|
||||
|
||||
stop_if(is.null(model), 'choose a regression model with the {.arg model} argument, e.g. {.code resistance_predict(..., model = "binomial")}')
|
||||
stop_if(is.null(model), 'choose a regression model with the `model` argument, e.g. resistance_predict(..., model = "binomial")')
|
||||
|
||||
x.bak <- x
|
||||
x <- as.data.frame(x, stringsAsFactors = FALSE)
|
||||
@@ -146,11 +146,11 @@ resistance_predict <- function(x,
|
||||
# -- date
|
||||
if (is.null(col_date)) {
|
||||
col_date <- search_type_in_df(x = x, type = "date")
|
||||
stop_if(is.null(col_date), "{.arg col_date} must be set")
|
||||
stop_if(is.null(col_date), "`col_date` must be set")
|
||||
}
|
||||
stop_ifnot(
|
||||
col_date %in% colnames(x),
|
||||
"column {.code ", col_date, "} not found"
|
||||
"column '", col_date, "' not found"
|
||||
)
|
||||
|
||||
year <- function(x) {
|
||||
@@ -238,7 +238,7 @@ resistance_predict <- function(x,
|
||||
prediction <- predictmodel$fit
|
||||
se <- predictmodel$se.fit
|
||||
} else {
|
||||
stop("no valid model selected. See {.help [{.fun resistance_predict}](AMR::resistance_predict)}.")
|
||||
stop("no valid model selected. See `?resistance_predict`.")
|
||||
}
|
||||
|
||||
# prepare the output dataframe
|
||||
@@ -357,7 +357,7 @@ ggplot_sir_predict <- function(x,
|
||||
meet_criteria(ribbon, allow_class = "logical", has_length = 1)
|
||||
|
||||
stop_ifnot_installed("ggplot2")
|
||||
stop_ifnot(inherits(x, "resistance_predict"), "{.arg x} must be a resistance prediction model created with {.fun resistance_predict}")
|
||||
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"
|
||||
|
||||
35
R/sir_calc.R
35
R/sir_calc.R
@@ -41,7 +41,7 @@ sir_calc <- function(...,
|
||||
as_percent = FALSE,
|
||||
only_all_tested = FALSE,
|
||||
only_count = FALSE) {
|
||||
meet_criteria(ab_result, allow_class = c("character", "sir"), has_length = seq_along(VALID_SIR_LEVELS), is_in = VALID_SIR_LEVELS)
|
||||
meet_criteria(ab_result, allow_class = c("character", "numeric", "integer"), has_length = c(1:5))
|
||||
meet_criteria(minimum, allow_class = c("numeric", "integer"), has_length = 1, is_positive_or_zero = TRUE, is_finite = TRUE)
|
||||
meet_criteria(as_percent, allow_class = "logical", has_length = 1)
|
||||
meet_criteria(only_all_tested, allow_class = "logical", has_length = 1)
|
||||
@@ -60,6 +60,11 @@ sir_calc <- function(...,
|
||||
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)) {
|
||||
@@ -112,8 +117,6 @@ sir_calc <- function(...,
|
||||
print_warning <- FALSE
|
||||
|
||||
ab_result <- as.sir(ab_result)
|
||||
denominator_vals <- levels(ab_result)
|
||||
denominator_vals <- denominator_vals[denominator_vals != "NI"]
|
||||
|
||||
if (is.data.frame(x)) {
|
||||
sir_integrity_check <- character(0)
|
||||
@@ -139,15 +142,15 @@ sir_calc <- function(...,
|
||||
FUN = min
|
||||
)
|
||||
if ("SDD" %in% ab_result && "SDD" %in% y && message_not_thrown_before("sir_calc", only_count, ab_result, entire_session = TRUE)) {
|
||||
message_("Note that {.fun ", ifelse(only_count, "count", "proportion"), "_", ifelse("S" %in% ab_result, "S", ""), "I", ifelse("R" %in% ab_result, "R", ""), "} will also include dose-dependent susceptibility, {.val SDD}. This note will be shown once for this session.", as_note = FALSE)
|
||||
message_("Note that `", ifelse(only_count, "count", "proportion"), "_", ifelse("S" %in% ab_result, "S", ""), "I", ifelse("R" %in% ab_result, "R", ""), "()` will also include dose-dependent susceptibility, 'SDD'. This note will be shown once for this session.", as_note = FALSE)
|
||||
}
|
||||
numerator <- sum(!is.na(y) & y %in% as.double(ab_result), na.rm = TRUE)
|
||||
denominator <- sum(vapply(FUN.VALUE = logical(1), x_transposed, function(y) !(anyNA(y))))
|
||||
} else {
|
||||
# may contain NAs in any column
|
||||
other_values <- setdiff(c(NA, denominator_vals), ab_result)
|
||||
other_values <- setdiff(c(NA, levels(ab_result)), ab_result)
|
||||
if ("SDD" %in% ab_result && "SDD" %in% unlist(x_transposed) && message_not_thrown_before("sir_calc", only_count, ab_result, entire_session = TRUE)) {
|
||||
message_("Note that {.fun ", ifelse(only_count, "count", "proportion"), "_", ifelse("S" %in% ab_result, "S", ""), "I", ifelse("R" %in% ab_result, "R", ""), "} will also include dose-dependent susceptibility, {.val SDD}. This note will be shown once for this session.", as_note = FALSE)
|
||||
message_("Note that `", ifelse(only_count, "count", "proportion"), "_", ifelse("S" %in% ab_result, "S", ""), "I", ifelse("R" %in% ab_result, "R", ""), "()` will also include dose-dependent susceptibility, 'SDD'. This note will be shown once for this session.", as_note = FALSE)
|
||||
}
|
||||
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) & anyNA(y))))
|
||||
@@ -159,16 +162,16 @@ sir_calc <- function(...,
|
||||
print_warning <- TRUE
|
||||
}
|
||||
if ("SDD" %in% ab_result && "SDD" %in% x && message_not_thrown_before("sir_calc", only_count, ab_result, entire_session = TRUE)) {
|
||||
message_("Note that `", ifelse(only_count, "count", "proportion"), "_", ifelse("S" %in% ab_result, "S", ""), "I", ifelse("R" %in% ab_result, "R", ""), "()` will also include dose-dependent susceptibility, {.val SDD}. This note will be shown once for this session.", as_note = FALSE)
|
||||
message_("Note that `", ifelse(only_count, "count", "proportion"), "_", ifelse("S" %in% ab_result, "S", ""), "I", ifelse("R" %in% ab_result, "R", ""), "()` will also include dose-dependent susceptibility, 'SDD'. This note will be shown once for this session.", as_note = FALSE)
|
||||
}
|
||||
numerator <- sum(x %in% ab_result, na.rm = TRUE)
|
||||
denominator <- sum(x %in% denominator_vals, na.rm = TRUE)
|
||||
denominator <- sum(x %in% levels(ab_result), na.rm = TRUE)
|
||||
}
|
||||
|
||||
if (print_warning == TRUE) {
|
||||
if (message_not_thrown_before("sir_calc")) {
|
||||
warning_("Increase speed by transforming to class {.cls sir} on beforehand:\n",
|
||||
highlight_code(" your_data %>% mutate_if(is_sir_eligible, as.sir)"),
|
||||
warning_("Increase speed by transforming to class 'sir' on beforehand:\n",
|
||||
" your_data %>% mutate_if(is_sir_eligible, as.sir)",
|
||||
call = FALSE
|
||||
)
|
||||
}
|
||||
@@ -204,7 +207,7 @@ sir_calc <- function(...,
|
||||
ifelse(denominator == 0, "no", paste("only", denominator)),
|
||||
" results available",
|
||||
data_vars,
|
||||
" (whilst {.arg minimum = ", minimum, "}).",
|
||||
" (`minimum` = ", minimum, ").",
|
||||
call = FALSE
|
||||
)
|
||||
fraction <- NA_real_
|
||||
@@ -256,13 +259,13 @@ sir_calc_df <- function(type, # "proportion", "count" or "both"
|
||||
for (i in seq_len(ncol(data))) {
|
||||
# transform SIR columns
|
||||
if (is.sir(data[, i, drop = TRUE])) {
|
||||
data[, i] <- as.character(as.sir(data[, i, drop = TRUE]))
|
||||
data[which(data[, i, drop = TRUE] %in% c("S", "SDD", "WT")), i] <- "S"
|
||||
data[which(data[, i, drop = TRUE] %in% c("R", "NWT", "NS")), i] <- "R"
|
||||
data[, i] <- as.character(data[, i, drop = TRUE])
|
||||
if (isTRUE(combine_SI)) {
|
||||
data[which(data[, i, drop = TRUE] %in% c("I", "S")), i] <- "SI"
|
||||
if ("SDD" %in% data[, i, drop = TRUE] && message_not_thrown_before("sir_calc_df", combine_SI, entire_session = TRUE)) {
|
||||
message_("Note that `sir_calc_df()` will also count dose-dependent susceptibility, 'SDD', as 'SI' when `combine_SI = TRUE`. This note will be shown once for this session.", as_note = FALSE)
|
||||
}
|
||||
data[, i] <- gsub("(I|S|SDD)", "SI", data[, i, drop = TRUE])
|
||||
}
|
||||
data[which(!data[, i, drop = TRUE] %in% c("S", "SI", "I", "R")), i] <- NA_character_
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
R/sysdata.rda
BIN
R/sysdata.rda
Binary file not shown.
57
R/tidymodels.R
Executable file → Normal file
57
R/tidymodels.R
Executable file → Normal file
@@ -1,26 +1,26 @@
|
||||
#' AMR Extensions for Tidymodels
|
||||
#'
|
||||
#' This family of functions allows using AMR-specific data types such as `<sir>` and `<mic>` inside `tidymodels` pipelines.
|
||||
#' This family of functions allows using AMR-specific data types such as `<mic>` and `<sir>` inside `tidymodels` pipelines.
|
||||
#' @inheritParams recipes::step_center
|
||||
#' @details
|
||||
#' You can read more in our online [AMR with tidymodels introduction](https://amr-for-r.org/articles/AMR_with_tidymodels.html).
|
||||
#'
|
||||
#' Tidyselect helpers include:
|
||||
#' - [all_sir()] and [all_sir_predictors()] to select [`<sir>`][as.sir()] columns
|
||||
#' - [all_mic()] and [all_mic_predictors()] to select [`<mic>`][as.mic()] columns
|
||||
#' - [all_disk()] and [all_disk_predictors()] to select [`<disk>`][as.disk()] columns
|
||||
#' - [all_mic()] and [all_mic_predictors()] to select `<mic>` columns
|
||||
#' - [all_sir()] and [all_sir_predictors()] to select `<sir>` columns
|
||||
#'
|
||||
#' Pre-processing pipeline steps include:
|
||||
#' - [step_sir_numeric()] to convert SIR columns to numeric (via `as.numeric()`), to be used with [all_sir_predictors()]: `"S"` = 1, `"I"`/`"SDD"` = 2, `"R"` = 3. All other values are rendered `NA`. Keep this in mind for further processing, especially if the model does not allow for `NA` values.
|
||||
#' - [step_mic_log2()] to convert MIC columns to numeric (via `as.numeric()`) and apply a log2 transform, to be used with [all_mic_predictors()]
|
||||
#' - [step_sir_numeric()] to convert SIR columns to numeric (via `as.numeric()`), to be used with [all_sir_predictors()]: `"S"` = 1, `"I"`/`"SDD"` = 2, `"R"` = 3. All other values are rendered `NA`. Keep this in mind for further processing, especially if the model does not allow for `NA` values.
|
||||
#'
|
||||
#' These steps integrate with `recipes::recipe()` and work like standard preprocessing steps. They are useful for preparing data for modelling, especially with classification models.
|
||||
#' @seealso [recipes::recipe()], [as.sir()], [as.mic()], [as.disk()]
|
||||
#' @seealso [recipes::recipe()], [as.mic()], [as.sir()]
|
||||
#' @name amr-tidymodels
|
||||
#' @keywords internal
|
||||
#' @export
|
||||
#' @examples
|
||||
#' if (require("tidymodels")) {
|
||||
#'
|
||||
#' # The below approach formed the basis for this paper: DOI 10.3389/fmicb.2025.1582703
|
||||
#' # Presence of ESBL genes was predicted based on raw MIC values.
|
||||
#'
|
||||
@@ -39,10 +39,13 @@
|
||||
#'
|
||||
#' # Create and prep a recipe with MIC log2 transformation
|
||||
#' mic_recipe <- recipe(esbl ~ ., data = training_data) %>%
|
||||
#'
|
||||
#' # Optionally remove non-predictive variables
|
||||
#' remove_role(genus, old_role = "predictor") %>%
|
||||
#'
|
||||
#' # Apply the log2 transformation to all MIC predictors
|
||||
#' step_mic_log2(all_mic_predictors()) %>%
|
||||
#'
|
||||
#' # And apply the preparation steps
|
||||
#' prep()
|
||||
#'
|
||||
@@ -63,57 +66,35 @@
|
||||
#' bind_cols(out_testing)
|
||||
#'
|
||||
#' # Evaluate predictions using standard classification metrics
|
||||
#' our_metrics <- metric_set(
|
||||
#' accuracy,
|
||||
#' recall,
|
||||
#' precision,
|
||||
#' sensitivity,
|
||||
#' specificity,
|
||||
#' ppv,
|
||||
#' npv
|
||||
#' )
|
||||
#' our_metrics <- metric_set(accuracy, kap, ppv, npv)
|
||||
#' metrics <- our_metrics(predictions, truth = esbl, estimate = .pred_class)
|
||||
#'
|
||||
#' # Show performance
|
||||
#' metrics
|
||||
#' }
|
||||
all_sir <- function() {
|
||||
x <- tidymodels_amr_select(class = "sir")
|
||||
names(x)
|
||||
}
|
||||
|
||||
#' @rdname amr-tidymodels
|
||||
#' @export
|
||||
all_sir_predictors <- function() {
|
||||
x <- tidymodels_amr_select(class = "sir")
|
||||
intersect(x, recipes::has_role("predictor"))
|
||||
}
|
||||
|
||||
#' @rdname amr-tidymodels
|
||||
#' @export
|
||||
all_mic <- function() {
|
||||
x <- tidymodels_amr_select(class = "mic")
|
||||
x <- tidymodels_amr_select(levels(NA_mic_))
|
||||
names(x)
|
||||
}
|
||||
|
||||
#' @rdname amr-tidymodels
|
||||
#' @export
|
||||
all_mic_predictors <- function() {
|
||||
x <- tidymodels_amr_select(class = "mic")
|
||||
x <- tidymodels_amr_select(levels(NA_mic_))
|
||||
intersect(x, recipes::has_role("predictor"))
|
||||
}
|
||||
|
||||
#' @rdname amr-tidymodels
|
||||
#' @export
|
||||
all_disk <- function() {
|
||||
x <- tidymodels_amr_select(class = "disk")
|
||||
all_sir <- function() {
|
||||
x <- tidymodels_amr_select(levels(NA_sir_))
|
||||
names(x)
|
||||
}
|
||||
|
||||
#' @rdname amr-tidymodels
|
||||
#' @export
|
||||
all_disk_predictors <- function() {
|
||||
x <- tidymodels_amr_select(class = "disk")
|
||||
all_sir_predictors <- function() {
|
||||
x <- tidymodels_amr_select(levels(NA_sir_))
|
||||
intersect(x, recipes::has_role("predictor"))
|
||||
}
|
||||
|
||||
@@ -179,6 +160,7 @@ bake.step_mic_log2 <- function(object, new_data, ...) {
|
||||
print.step_mic_log2 <- function(x, width = max(20, options()$width - 35), ...) {
|
||||
title <- "Log2 transformation of MIC columns"
|
||||
recipes::print_step(x$columns, x$terms, x$trained, title, width)
|
||||
invisible(x)
|
||||
}
|
||||
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(recipes::tidy, step_mic_log2)
|
||||
@@ -254,6 +236,7 @@ bake.step_sir_numeric <- function(object, new_data, ...) {
|
||||
print.step_sir_numeric <- function(x, width = max(20, options()$width - 35), ...) {
|
||||
title <- "Numeric transformation of SIR columns"
|
||||
recipes::print_step(x$columns, x$terms, x$trained, title, width)
|
||||
invisible(x)
|
||||
}
|
||||
|
||||
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(recipes::tidy, step_sir_numeric)
|
||||
@@ -267,13 +250,13 @@ tidy.step_sir_numeric <- function(x, ...) {
|
||||
res
|
||||
}
|
||||
|
||||
tidymodels_amr_select <- function(class) {
|
||||
tidymodels_amr_select <- function(check_vector) {
|
||||
df <- get_current_data()
|
||||
ind <- which(
|
||||
vapply(
|
||||
FUN.VALUE = logical(1),
|
||||
df,
|
||||
function(x) inherits(x, class),
|
||||
function(x) all(x %in% c(check_vector, NA), na.rm = TRUE) & any(x %in% check_vector),
|
||||
USE.NAMES = TRUE
|
||||
),
|
||||
useNames = TRUE
|
||||
|
||||
@@ -29,88 +29,73 @@
|
||||
|
||||
#' Filter Top *n* Microorganisms
|
||||
#'
|
||||
#' Filters a data set to include only the top *n* microorganisms based on a specified property, such as taxonomic family or genus. For example, it can filter a data set to the top 3 species, to any species in the top 5 genera, or to the top 3 species in each of the top 5 genera.
|
||||
#' This function filters a data set to include only the top *n* microorganisms based on a specified property, such as taxonomic family or genus. For example, it can filter a data set to the top 3 species, or to any species in the top 5 genera, or to the top 3 species in each of the top 5 genera.
|
||||
#' @param x A data frame containing microbial data.
|
||||
#' @param n A positive whole number specifying the maximum number of unique values of `property` to include in the output.
|
||||
#' @param property A character string indicating the microorganism property to use for filtering. Must be one of the column names of the [microorganisms] data set: `r vector_or(colnames(microorganisms), sort = FALSE, documentation = TRUE)`. If `NULL`, the raw values from `col_mo` will be used without transformation. When using `"species"` (default) or `"subspecies"`, the genus is prepended to ensure each name is unambiguous.
|
||||
#' @param n_for_each An optional positive whole number specifying the maximum number of distinct microorganism groups at the level of `property_for_each` to retain within each of the top *n* groups. Only used when `property_for_each` is also set.
|
||||
#' @param property_for_each The microorganism property to use for sub-grouping within each top *n* group. Must be one of the column names of the [microorganisms] data set and at a strictly lower taxonomic rank than `property` (allowed order: domain > kingdom > phylum > class > order > family > genus > species > subspecies). Defaults to `"species"`. Only relevant when `n_for_each` is set.
|
||||
#' @param n An integer specifying the maximum number of unique values of the `property` to include in the output.
|
||||
#' @param property A character string indicating the microorganism property to use for filtering. Must be one of the column names of the [microorganisms] data set: `r vector_or(colnames(microorganisms), sort = FALSE, quotes = TRUE)`. If `NULL`, the raw values from `col_mo` will be used without transformation. When using `"species"` (default) or `"subpecies"`, the genus will be added to make sure each (sub)species still belongs to the right genus.
|
||||
#' @param n_for_each An optional integer specifying the maximum number of rows to retain for each value of the selected property. If `NULL`, all rows within the top *n* groups will be included.
|
||||
#' @param col_mo A character string indicating the column in `x` that contains microorganism names or codes. Defaults to the first column of class [`mo`]. Values will be coerced using [as.mo()].
|
||||
#' @param ... Additional arguments passed on to [mo_property()] when `property` is not `NULL`.
|
||||
#' @details This function is useful for preprocessing data before creating [antibiograms][antibiogram()] or other analyses that require focused subsets of microbial data.
|
||||
#' @details This function is useful for preprocessing data before creating [antibiograms][antibiogram()] or other analyses that require focused subsets of microbial data. For example, it can filter a data set to only include isolates from the top 10 species.
|
||||
#' @export
|
||||
#' @seealso [mo_property()], [as.mo()], [antibiogram()]
|
||||
#' @examples
|
||||
#' # filter to the top 3 species:
|
||||
#' top_n_microorganisms(example_isolates, n = 3)
|
||||
#' top_n_microorganisms(example_isolates,
|
||||
#' n = 3
|
||||
#' )
|
||||
#'
|
||||
#' # filter to any species in the top 5 genera:
|
||||
#' top_n_microorganisms(example_isolates, n = 5, property = "genus")
|
||||
#' top_n_microorganisms(example_isolates,
|
||||
#' n = 5, property = "genus"
|
||||
#' )
|
||||
#'
|
||||
#' # filter to the top 3 species in each of the top 5 genera:
|
||||
#' top_n_microorganisms(example_isolates,
|
||||
#' n = 5, property = "genus", n_for_each = 3
|
||||
#' )
|
||||
#'
|
||||
#' # filter to the top 2 genera in each of the top 3 families:
|
||||
#' top_n_microorganisms(example_isolates,
|
||||
#' n = 3, property = "family", n_for_each = 2, property_for_each = "genus"
|
||||
#' )
|
||||
top_n_microorganisms <- function(x, n, property = "species", n_for_each = NULL, property_for_each = "species", col_mo = NULL, ...) {
|
||||
top_n_microorganisms <- function(x, n, property = "species", n_for_each = NULL, col_mo = NULL, ...) {
|
||||
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
|
||||
meet_criteria(n, allow_class = c("numeric", "integer"), has_length = 1, is_finite = TRUE, is_positive = TRUE)
|
||||
meet_criteria(property, allow_class = "character", has_length = 1, is_in = colnames(AMR::microorganisms), allow_NULL = TRUE)
|
||||
meet_criteria(property, allow_class = "character", has_length = 1, is_in = colnames(AMR::microorganisms))
|
||||
meet_criteria(n_for_each, allow_class = c("numeric", "integer"), has_length = 1, is_finite = TRUE, is_positive = TRUE, allow_NULL = TRUE)
|
||||
meet_criteria(property_for_each, allow_class = "character", has_length = 1, is_in = colnames(AMR::microorganisms), allow_NULL = TRUE)
|
||||
meet_criteria(col_mo, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
|
||||
|
||||
if (is.null(col_mo)) {
|
||||
col_mo <- search_type_in_df(x = x, type = "mo", info = TRUE)
|
||||
stop_if(is.null(col_mo), "{.arg col_mo} must be set")
|
||||
}
|
||||
|
||||
.taxonomic_ranks <- c("domain", "kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies")
|
||||
if (!is.null(n_for_each) && !is.null(property) && !is.null(property_for_each)) {
|
||||
prop_rank <- match(property, .taxonomic_ranks)
|
||||
each_rank <- match(property_for_each, .taxonomic_ranks)
|
||||
if (!is.na(prop_rank) && !is.na(each_rank) && each_rank <= prop_rank) {
|
||||
stop_(
|
||||
"`property_for_each` (\"", property_for_each, "\") must be at a lower ",
|
||||
"taxonomic rank than `property` (\"", property, "\")"
|
||||
)
|
||||
}
|
||||
stop_if(is.null(col_mo), "`col_mo` must be set")
|
||||
}
|
||||
|
||||
x.bak <- x
|
||||
|
||||
x[, col_mo] <- as.mo(x[, col_mo, drop = TRUE], keep_synonyms = TRUE)
|
||||
|
||||
get_prop_val <- function(prop) {
|
||||
if (is.null(prop)) {
|
||||
x[[col_mo]]
|
||||
} else if (prop == "species") {
|
||||
paste(mo_genus(x[[col_mo]], ...), mo_species(x[[col_mo]], ...))
|
||||
} else if (prop == "subspecies") {
|
||||
paste(mo_genus(x[[col_mo]], ...), mo_species(x[[col_mo]], ...), mo_subspecies(x[[col_mo]], ...))
|
||||
} else {
|
||||
mo_property(x[[col_mo]], property = prop, ...)
|
||||
}
|
||||
if (is.null(property)) {
|
||||
x$prop_val <- x[[col_mo]]
|
||||
} else if (property == "species") {
|
||||
x$prop_val <- paste(mo_genus(x[[col_mo]], ...), mo_species(x[[col_mo]], ...))
|
||||
} else if (property == "subspecies") {
|
||||
x$prop_val <- paste(mo_genus(x[[col_mo]], ...), mo_species(x[[col_mo]], ...), mo_subspecies(x[[col_mo]], ...))
|
||||
} else {
|
||||
x$prop_val <- mo_property(x[[col_mo]], property = property, ...)
|
||||
}
|
||||
|
||||
x$prop_val <- get_prop_val(property)
|
||||
counts <- sort(table(x$prop_val), decreasing = TRUE)
|
||||
n <- min(as.integer(n), length(counts))
|
||||
filtered_rows <- which(x$prop_val %in% names(counts)[seq_len(n)])
|
||||
|
||||
n <- as.integer(n)
|
||||
if (length(counts) < n) {
|
||||
n <- length(counts)
|
||||
}
|
||||
count_values <- names(counts)[seq_len(n)]
|
||||
filtered_rows <- which(x$prop_val %in% count_values)
|
||||
|
||||
if (!is.null(n_for_each)) {
|
||||
n_for_each <- as.integer(n_for_each)
|
||||
x$prop_val_each <- get_prop_val(property_for_each)
|
||||
filtered_x <- x[filtered_rows, , drop = FALSE]
|
||||
filtered_x$.orig_row <- filtered_rows
|
||||
filtered_rows <- do.call(
|
||||
c,
|
||||
lapply(split(filtered_x, filtered_x$prop_val), function(group) {
|
||||
top_each <- names(sort(table(group$prop_val_each), decreasing = TRUE)[seq_len(n_for_each)])
|
||||
group$.orig_row[group$prop_val_each %in% top_each[!is.na(top_each)]]
|
||||
top_values <- names(sort(table(group[[col_mo]]), decreasing = TRUE)[seq_len(n_for_each)])
|
||||
top_values <- top_values[!is.na(top_values)]
|
||||
which(x[[col_mo]] %in% top_values)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ translate_into_language <- function(from,
|
||||
any_form_in_patterns <- tryCatch(
|
||||
any(from_unique %like% paste0("(", paste(gsub(" +\\(.*", "", df_trans$pattern), collapse = "|"), ")")),
|
||||
error = function(e) {
|
||||
warning_("Translation not possible. Please create an issue at {.url https://github.com/msberends/AMR/issues}. Many thanks!")
|
||||
warning_("Translation not possible. Please create an issue at ", font_url("https://github.com/msberends/AMR/issues"), ". Many thanks!")
|
||||
return(FALSE)
|
||||
}
|
||||
)
|
||||
@@ -263,27 +263,19 @@ translate_into_language <- function(from,
|
||||
df_trans$pattern[df_trans$regular_expr == TRUE] <- gsub("$$", "$", df_trans$pattern[df_trans$regular_expr == TRUE], fixed = TRUE)
|
||||
}
|
||||
|
||||
# non-regex part
|
||||
translate_exec <- function(term) {
|
||||
# sort trans file on length of pattern
|
||||
trns <- df_trans[order(nchar(df_trans$pattern), decreasing = TRUE), ]
|
||||
for (i in seq_len(nrow(trns))) {
|
||||
term <- gsub(
|
||||
pattern = trns$pattern[i],
|
||||
replacement = trns[i, lang, drop = TRUE],
|
||||
x = term,
|
||||
ignore.case = !trns$case_sensitive[i] & trns$regular_expr[i],
|
||||
fixed = !trns$regular_expr[i],
|
||||
perl = trns$regular_expr[i],
|
||||
lapply(
|
||||
# starting with longest pattern, since more general translations are shorter, such as 'Group'
|
||||
order(nchar(df_trans$pattern), decreasing = TRUE),
|
||||
function(i) {
|
||||
from_unique_translated <<- gsub(
|
||||
pattern = df_trans$pattern[i],
|
||||
replacement = df_trans[i, lang, drop = TRUE],
|
||||
x = from_unique_translated,
|
||||
ignore.case = !df_trans$case_sensitive[i] & df_trans$regular_expr[i],
|
||||
fixed = !df_trans$regular_expr[i],
|
||||
perl = df_trans$regular_expr[i]
|
||||
)
|
||||
}
|
||||
term
|
||||
}
|
||||
from_unique_translated[order(nchar(from_unique_translated), decreasing = TRUE)] <- vapply(
|
||||
FUN.VALUE = character(1),
|
||||
USE.NAMES = FALSE,
|
||||
from_unique_translated[order(nchar(from_unique_translated), decreasing = TRUE)],
|
||||
translate_exec
|
||||
)
|
||||
|
||||
# force UTF-8 for diacritics
|
||||
@@ -293,11 +285,11 @@ translate_into_language <- function(from,
|
||||
out <- from_unique_translated[match(from.bak, from_unique)]
|
||||
|
||||
if (!identical(from.bak, out) && get_AMR_locale() == lang && is.null(getOption("AMR_locale", default = NULL)) && message_not_thrown_before("translation", entire_session = TRUE) && interactive()) {
|
||||
message(font_blue(word_wrap(
|
||||
message(word_wrap(
|
||||
"Assuming the ", LANGUAGES_SUPPORTED_NAMES[[lang]]$exonym, " language (",
|
||||
LANGUAGES_SUPPORTED_NAMES[[lang]]$endonym, ") for the AMR package. See `set_AMR_locale()` to change this or to silence this once-per-session note.",
|
||||
as_note = TRUE
|
||||
)))
|
||||
add_fn = list(font_blue), as_note = TRUE
|
||||
))
|
||||
}
|
||||
|
||||
out
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#'
|
||||
#' 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:
|
||||
#' 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://atcddd.fhi.no>) and the Pharmaceuticals Community Register of the European Commission (<https://ec.europa.eu/health/documents/community-register/html/index_en.htm>).
|
||||
#' 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://atcddd.fhi.no>) and the Pharmaceuticals Community Register of the European Commission (<https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm>).
|
||||
#'
|
||||
#' These have become the gold standard for international drug utilisation monitoring and research.
|
||||
#'
|
||||
|
||||
@@ -70,13 +70,6 @@ as.data.frame.deprecated_amr_dataset <- function(x, ...) {
|
||||
# - `antibiotics` in `antibiogram()`
|
||||
# - `converse_capped_values` in `as.sir()`
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
custom_eucast_rules <- function(...) {
|
||||
deprecation_warning("custom_eucast_rules", "custom_interpretive_rules", is_function = TRUE)
|
||||
custom_interpretive_rules(...)
|
||||
}
|
||||
|
||||
#' @rdname AMR-deprecated
|
||||
#' @export
|
||||
ab_class <- function(...) {
|
||||
@@ -131,7 +124,7 @@ deprecation_warning <- function(old = NULL, new = NULL, fn = NULL, extra_msg = N
|
||||
". The old name will be removed in future version, so please update your code.",
|
||||
ifelse(type == "argument",
|
||||
". While the old argument still works, it will be removed in a future version, so please update your code.",
|
||||
" and will be removed in a future version, see {.topic [AMR-deprecated](AMR::AMR-deprecated)}."
|
||||
" and will be removed in a future version, see `?AMR-deprecated`."
|
||||
)
|
||||
),
|
||||
ifelse(!is.null(extra_msg),
|
||||
|
||||
26
R/zzz.R
26
R/zzz.R
@@ -86,10 +86,10 @@ AMR_env$chmatch <- import_fn("chmatch", "data.table", error_on_fail = FALSE)
|
||||
AMR_env$chin <- import_fn("%chin%", "data.table", error_on_fail = FALSE)
|
||||
|
||||
# take cli symbols and error function if available
|
||||
AMR_env$bullet_icon <- import_fn("symbol", "cli", error_on_fail = FALSE)$bullet %||% "*"
|
||||
AMR_env$ellipsis_icon <- import_fn("symbol", "cli", error_on_fail = FALSE)$ellipsis %||% "..."
|
||||
AMR_env$info_icon <- import_fn("symbol", "cli", error_on_fail = FALSE)$info %||% "i"
|
||||
AMR_env$sup_1_icon <- import_fn("symbol", "cli", error_on_fail = FALSE)$sup_1 %||% "*"
|
||||
AMR_env$bullet_icon <- import_fn("symbol", "cli", error_on_fail = FALSE)$bullet %or% "*"
|
||||
AMR_env$ellipsis_icon <- import_fn("symbol", "cli", error_on_fail = FALSE)$ellipsis %or% "..."
|
||||
AMR_env$info_icon <- import_fn("symbol", "cli", error_on_fail = FALSE)$info %or% "i"
|
||||
AMR_env$sup_1_icon <- import_fn("symbol", "cli", error_on_fail = FALSE)$sup_1 %or% "*"
|
||||
AMR_env$cli_abort <- import_fn("cli_abort", "cli", error_on_fail = FALSE)
|
||||
AMR_env$cross_icon <- if (isTRUE(base::l10n_info()$`UTF-8`)) "\u00d7" else "x"
|
||||
|
||||
@@ -115,41 +115,35 @@ AMR_env$cross_icon <- if (isTRUE(base::l10n_info()$`UTF-8`)) "\u00d7" else "x"
|
||||
}
|
||||
|
||||
.onAttach <- function(libname, pkgname) {
|
||||
if (interactive() && is.null(getOption("AMR_guideline"))) {
|
||||
packageStartupMessage(format_inline_(
|
||||
"Assuming ", AMR::clinical_breakpoints$guideline[1], " as the default AMR guideline, see {.topic [AMR-options](AMR::AMR-options)} to change this."
|
||||
))
|
||||
}
|
||||
|
||||
# if custom ab option is available, load it
|
||||
if (!is.null(getOption("AMR_custom_ab")) && file.exists(getOption("AMR_custom_ab", default = ""))) {
|
||||
if (getOption("AMR_custom_ab") %unlike% "[.]rds$") {
|
||||
packageStartupMessage(format_inline_("The file with custom antimicrobials must be an RDS file. Set the option {.code AMR_custom_ab} to another path."))
|
||||
packageStartupMessage("The file with custom antimicrobials must be an RDS file. Set the option `AMR_custom_ab` to another path.")
|
||||
} else {
|
||||
packageStartupMessage(format_inline_("Adding custom antimicrobials from '", getOption("AMR_custom_ab"), "'..."), appendLF = FALSE)
|
||||
packageStartupMessage("Adding custom antimicrobials from '", getOption("AMR_custom_ab"), "'...", appendLF = FALSE)
|
||||
x <- readRDS_AMR(getOption("AMR_custom_ab"))
|
||||
tryCatch(
|
||||
{
|
||||
suppressWarnings(suppressMessages(add_custom_antimicrobials(x)))
|
||||
packageStartupMessage("OK.")
|
||||
},
|
||||
error = function(e) packageStartupMessage(format_inline_("Failed: ", conditionMessage(e)))
|
||||
error = function(e) packageStartupMessage("Failed: ", conditionMessage(e))
|
||||
)
|
||||
}
|
||||
}
|
||||
# if custom mo option is available, load it
|
||||
if (!is.null(getOption("AMR_custom_mo")) && file.exists(getOption("AMR_custom_mo", default = ""))) {
|
||||
if (getOption("AMR_custom_mo") %unlike% "[.]rds$") {
|
||||
packageStartupMessage(format_inline_("The file with custom microorganisms must be an RDS file. Set the option {.code AMR_custom_mo} to another path."))
|
||||
packageStartupMessage("The file with custom microorganisms must be an RDS file. Set the option `AMR_custom_mo` to another path.")
|
||||
} else {
|
||||
packageStartupMessage(format_inline_("Adding custom microorganisms from '", getOption("AMR_custom_mo"), "'..."), appendLF = FALSE)
|
||||
packageStartupMessage("Adding custom microorganisms from '", getOption("AMR_custom_mo"), "'...", appendLF = FALSE)
|
||||
x <- readRDS_AMR(getOption("AMR_custom_mo"))
|
||||
tryCatch(
|
||||
{
|
||||
suppressWarnings(suppressMessages(add_custom_microorganisms(x)))
|
||||
packageStartupMessage("OK.")
|
||||
},
|
||||
error = function(e) packageStartupMessage(format_inline_("Failed: ", conditionMessage(e)))
|
||||
error = function(e) packageStartupMessage("Failed: ", conditionMessage(e))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
14
README.Rmd
14
README.Rmd
@@ -11,7 +11,6 @@ knitr::opts_chunk$set(
|
||||
# fig.path = "man/figures/README-",
|
||||
out.width = "100%"
|
||||
)
|
||||
options(width = 100)
|
||||
AMR:::reset_all_thrown_messages()
|
||||
```
|
||||
|
||||
@@ -22,8 +21,8 @@ Please visit our comprehensive package website <https://amr-for-r.org> to read m
|
||||
Overview:
|
||||
|
||||
* Provides an **all-in-one solution** for antimicrobial resistance (AMR) data analysis in a One Health approach
|
||||
* **Peer-reviewed**, used in over 175 countries, cited over 100 times, available in `r length(AMR:::LANGUAGES_SUPPORTED)` languages
|
||||
* Generates **antibiograms** - WISCA for empiric coverage estimates, or traditional/syndromic for AMR surveillance
|
||||
* Peer-reviewed, used in over 175 countries, available in `r length(AMR:::LANGUAGES_SUPPORTED)` languages
|
||||
* Generates **antibiograms** - traditional, combined, syndromic, and even WISCA
|
||||
* Provides the **full microbiological taxonomy** of `r AMR:::format_included_data_number(AMR::microorganisms)` distinct species and extensive info of `r AMR:::format_included_data_number(NROW(AMR::antimicrobials) + NROW(AMR::antivirals))` antimicrobial drugs
|
||||
* Applies **CLSI `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("CLSI", guideline))$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("CLSI", guideline))$guideline)))`** and **EUCAST `r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("EUCAST", guideline))$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, grepl("EUCAST", guideline))$guideline)))`** clinical and veterinary breakpoints, and ECOFFs, for MIC and disk zone interpretation
|
||||
* Corrects for duplicate isolates, **calculates** and **predicts** AMR per antimicrobial class
|
||||
@@ -32,9 +31,7 @@ Overview:
|
||||
|
||||
----
|
||||
|
||||
The `AMR` package is a peer-reviewed, free and open-source R package with zero dependencies 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 has always been to provide a standard** for clean and reproducible AMR data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.
|
||||
The `AMR` package is a peer-reviewed, free and open-source R package with zero dependencies 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 AMR data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.
|
||||
|
||||
The `AMR` package supports and can read any data format, including WHONET data. This package works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). **It was designed to work in any setting, including those with very limited resources**. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the [University of Groningen](https://www.rug.nl) and the [University Medical Center Groningen](https://www.umcg.nl).
|
||||
|
||||
@@ -52,11 +49,8 @@ To install the latest 'beta' version:
|
||||
|
||||
```{r, eval = FALSE}
|
||||
install.packages("AMR", repos = "beta.amr-for-r.org")
|
||||
```
|
||||
|
||||
If this does not work, try to install directly from GitHub using the `remotes` package:
|
||||
|
||||
```{r, eval = FALSE}
|
||||
# if this does not work, try to install directly from GitHub using the 'remotes' package:
|
||||
remotes::install_github("msberends/AMR")
|
||||
```
|
||||
|
||||
|
||||
26
README.md
26
README.md
@@ -10,13 +10,12 @@ Overview:
|
||||
|
||||
- Provides an **all-in-one solution** for antimicrobial resistance (AMR)
|
||||
data analysis in a One Health approach
|
||||
- **Peer-reviewed**, used in over 175 countries, cited over 100 times,
|
||||
available in 28 languages
|
||||
- Generates **antibiograms** - WISCA for empiric coverage estimates, or
|
||||
traditional/syndromic for AMR surveillance
|
||||
- Provides the **full microbiological taxonomy** of ~97 000 distinct
|
||||
- Peer-reviewed, used in over 175 countries, available in 28 languages
|
||||
- Generates **antibiograms** - traditional, combined, syndromic, and
|
||||
even WISCA
|
||||
- Provides the **full microbiological taxonomy** of ~79 000 distinct
|
||||
species and extensive info of ~620 antimicrobial drugs
|
||||
- Applies **CLSI 2011-2026** and **EUCAST 2011-2026** clinical and
|
||||
- Applies **CLSI 2011-2025** and **EUCAST 2011-2025** clinical and
|
||||
veterinary breakpoints, and ECOFFs, for MIC and disk zone
|
||||
interpretation
|
||||
- Corrects for duplicate isolates, **calculates** and **predicts** AMR
|
||||
@@ -32,11 +31,10 @@ The `AMR` package is a peer-reviewed, free and open-source R package
|
||||
with zero dependencies 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 has always been to provide a standard** for clean and
|
||||
reproducible AMR data analysis, that can therefore empower
|
||||
epidemiological analyses to continuously enable surveillance and
|
||||
treatment evaluation in any setting.
|
||||
**Our aim is to provide a standard** for clean and reproducible AMR data
|
||||
analysis, that can therefore empower epidemiological analyses to
|
||||
continuously enable surveillance and treatment evaluation in any
|
||||
setting.
|
||||
|
||||
The `AMR` package supports and can read any data format, including
|
||||
WHONET data. This package works on Windows, macOS and Linux with all
|
||||
@@ -60,12 +58,8 @@ To install the latest ‘beta’ version:
|
||||
|
||||
``` r
|
||||
install.packages("AMR", repos = "beta.amr-for-r.org")
|
||||
```
|
||||
|
||||
If this does not work, try to install directly from GitHub using the
|
||||
`remotes` package:
|
||||
|
||||
``` r
|
||||
# if this does not work, try to install directly from GitHub using the 'remotes' package:
|
||||
remotes::install_github("msberends/AMR")
|
||||
```
|
||||
|
||||
|
||||
20
_pkgdown.yml
20
_pkgdown.yml
@@ -56,7 +56,7 @@ footer:
|
||||
left: [devtext]
|
||||
right: [logo]
|
||||
components:
|
||||
devtext: '<code>AMR</code> (for R). Free and open-source, licenced under the <a target="_blank" href="https://github.com/msberends/AMR/blob/main/LICENSE">GNU GPL 2.0</a>. Developed at the <a target="_blank" href="https://www.rug.nl">University of Groningen</a> and <a target="_blank" href="https://www.umcg.nl">University Medical Center Groningen</a> in The Netherlands, in collaboration with <a href="https://amr-for-r.org/authors.html">many colleagues from around the world</a>.'
|
||||
devtext: '<code>AMR</code> (for R). Free and open-source, licenced under the <a target="_blank" href="https://github.com/msberends/AMR/blob/main/LICENSE">GNU General Public License version 2.0 (GPL-2)</a>.<br>Developed at the <a target="_blank" href="https://www.rug.nl">University of Groningen</a> and <a target="_blank" href="https://www.umcg.nl">University Medical Center Groningen</a> in The Netherlands.'
|
||||
logo: '<a target="_blank" href="https://www.rug.nl"><img src="https://amr-for-r.org/logo_rug.svg" style="max-width: 150px;"></a><a target="_blank" href="https://www.umcg.nl"><img src="https://amr-for-r.org/logo_umcg.svg" style="max-width: 150px;"></a>'
|
||||
|
||||
home:
|
||||
@@ -156,17 +156,17 @@ reference:
|
||||
- "`atc_online_property`"
|
||||
- "`add_custom_antimicrobials`"
|
||||
|
||||
- title: "Interpreting data: antimicrobial results"
|
||||
- title: "Preparing data: antimicrobial results"
|
||||
desc: >
|
||||
With `as.mic()` and `as.disk()` you can transform your raw input to valid MIC or disk diffusion values.
|
||||
Use `as.sir()` for cleaning raw data to let it only contain "R", "I" and "S", or to interpret MIC or disk diffusion values as SIR based on the lastest EUCAST and CLSI guidelines.
|
||||
Afterwards, you can extend antibiotic interpretations by applying interpretive rules, for example [from EUCAST](https://www.eucast.org/expert_rules_and_intrinsic_resistance/) with `interpretive_rules()`.
|
||||
Afterwards, you can extend antibiotic interpretations by applying [EUCAST rules](https://www.eucast.org/expert_rules_and_intrinsic_resistance/) with `eucast_rules()`.
|
||||
contents:
|
||||
- "`as.sir`"
|
||||
- "`as.mic`"
|
||||
- "`as.disk`"
|
||||
- "`interpretive_rules`"
|
||||
- "`custom_interpretive_rules`"
|
||||
- "`eucast_rules`"
|
||||
- "`custom_eucast_rules`"
|
||||
|
||||
- title: "Analysing data"
|
||||
desc: >
|
||||
@@ -245,14 +245,12 @@ reference:
|
||||
|
||||
- title: "Other: miscellaneous functions"
|
||||
desc: >
|
||||
Miscellaneous functions that support various parts of an AMR analysis,
|
||||
such as working with ages, joining tables, principal component analysis,
|
||||
and other utilities. Especially the 'like' function can be useful:
|
||||
`if (x %like% y) {...}`.
|
||||
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`"
|
||||
- "`amr_course`"
|
||||
- "`export_ncbi_biosample`"
|
||||
- "`availability`"
|
||||
- "`get_AMR_locale`"
|
||||
@@ -265,7 +263,7 @@ reference:
|
||||
|
||||
- title: "Other: statistical tests"
|
||||
desc: >
|
||||
Some statistical tests or methods usable for AMR analyses are not part of base R and were added to this package for convenience.
|
||||
Some statistical tests or methods are not part of base R and were added to this package for convenience.
|
||||
contents:
|
||||
- "`g.test`"
|
||||
- "`kurtosis`"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
This version is a bugfix release (v3.0.1) following the release of v3.0.0 in June 2025.
|
||||
|
||||
As with all previous >20 releases, some CHECKs on `oldrel` may return a `NOTE` for narrowly exceeding the installation size limit. This has been reduced to a minimum in prior coordination with CRAN maintainers and currently returns only an `INFO` on `release` and `devel`.
|
||||
|
||||
We treat this as a high-impact package: it was published in the *Journal of Statistical Software* (2022), is listed in the CRAN Task View "Epidemiology", and (based on cranlogs download statistics) is used globally. If there is anything to address, we would appreciate being informed before archiving the current version. We conduct extensive automated unit testing and have no indication of unresolved issues.
|
||||
|
||||
@@ -15,10 +15,8 @@ library(readr)
|
||||
library(tidyr)
|
||||
|
||||
# WHONET version of 16th Feb 2024
|
||||
whonet_breakpoints <- read_tsv("WHONET/Resources/Breakpoints.txt",
|
||||
na = c("", "NA", "-"),
|
||||
show_col_types = FALSE, guess_max = Inf
|
||||
) %>%
|
||||
whonet_breakpoints <- read_tsv("WHONET/Resources/Breakpoints.txt", na = c("", "NA", "-"),
|
||||
show_col_types = FALSE, guess_max = Inf) %>%
|
||||
filter(GUIDELINES %in% c("CLSI", "EUCAST"))
|
||||
|
||||
dim(whonet_breakpoints)
|
||||
@@ -50,9 +48,9 @@ whonet_breakpoints |>
|
||||
|
||||
```{r}
|
||||
whonet_breakpoints |>
|
||||
filter(HOST == "Cats", YEAR >= 2021) |>
|
||||
select(GUIDELINES, YEAR, TEST_METHOD, ORGANISM_CODE, R, S) |>
|
||||
mutate(MO_NAME = AMR::mo_shortname(ORGANISM_CODE), .before = R) |>
|
||||
filter(HOST == "Cats", YEAR >= 2021) |>
|
||||
select(GUIDELINES, YEAR, TEST_METHOD, ORGANISM_CODE, R, S) |>
|
||||
mutate(MO_NAME = AMR::mo_shortname(ORGANISM_CODE), .before = R) |>
|
||||
as.data.frame()
|
||||
```
|
||||
|
||||
@@ -60,14 +58,12 @@ whonet_breakpoints |>
|
||||
|
||||
```{r}
|
||||
whonet_breakpoints |>
|
||||
filter(HOST == "Cats", YEAR == 2023) |>
|
||||
mutate(
|
||||
MO = AMR::mo_shortname(ORGANISM_CODE),
|
||||
AB = AMR::ab_name(WHONET_ABX_CODE),
|
||||
SITE_OF_INFECTION = substr(SITE_OF_INFECTION, 1, 25)
|
||||
) |>
|
||||
arrange(MO, AB) |>
|
||||
select(MO, AB, SITE_OF_INFECTION) |>
|
||||
filter(HOST == "Cats", YEAR == 2023) |>
|
||||
mutate(MO = AMR::mo_shortname(ORGANISM_CODE),
|
||||
AB = AMR::ab_name(WHONET_ABX_CODE),
|
||||
SITE_OF_INFECTION = substr(SITE_OF_INFECTION, 1, 25)) |>
|
||||
arrange(MO, AB) |>
|
||||
select(MO, AB, SITE_OF_INFECTION) |>
|
||||
as.data.frame()
|
||||
```
|
||||
|
||||
|
||||
@@ -33,20 +33,18 @@
|
||||
rm -rf ../PythonPackage/AMR/*
|
||||
mkdir -p ../PythonPackage/AMR/AMR
|
||||
|
||||
# Output files
|
||||
# Output Python file
|
||||
setup_file="../PythonPackage/AMR/setup.py"
|
||||
init_file="../PythonPackage/AMR/AMR/__init__.py"
|
||||
engine_file="../PythonPackage/AMR/AMR/_engine.py"
|
||||
datasets_file="../PythonPackage/AMR/AMR/datasets.py"
|
||||
functions_file="../PythonPackage/AMR/AMR/functions.py"
|
||||
beta_file="../PythonPackage/AMR/AMR/beta.py"
|
||||
datasets_file="../PythonPackage/AMR/AMR/datasets.py"
|
||||
init_file="../PythonPackage/AMR/AMR/__init__.py"
|
||||
description_file="../DESCRIPTION"
|
||||
|
||||
# ---- _engine.py: R environment setup and installation logic ---- #
|
||||
|
||||
cat <<'EOL' > "$engine_file"
|
||||
# Write header to the datasets Python file, including the convert_to_python function
|
||||
cat <<EOL > "$datasets_file"
|
||||
import os
|
||||
import sys
|
||||
import pandas as pd
|
||||
import importlib.metadata as metadata
|
||||
|
||||
# Get the path to the virtual environment
|
||||
@@ -58,127 +56,48 @@ os.makedirs(r_lib_path, exist_ok=True)
|
||||
os.environ['R_LIBS_SITE'] = r_lib_path
|
||||
|
||||
from rpy2 import robjects
|
||||
from rpy2.robjects.vectors import StrVector
|
||||
from rpy2.robjects.conversion import localconverter
|
||||
from rpy2.robjects import default_converter, numpy2ri, pandas2ri
|
||||
from rpy2.robjects.packages import importr, isinstalled
|
||||
|
||||
# Import base and utils once
|
||||
# Import base and utils
|
||||
base = importr('base')
|
||||
utils = importr('utils')
|
||||
|
||||
# Silence R console output entirely
|
||||
robjects.r('suppressMessages(suppressWarnings(sink(tempfile())))')
|
||||
base.options(warn=-1)
|
||||
|
||||
# Ensure library paths explicitly
|
||||
base._libPaths(r_lib_path)
|
||||
|
||||
_installed_source = None
|
||||
# Check if the AMR package is installed in R
|
||||
if not isinstalled('AMR', lib_loc=r_lib_path):
|
||||
print(f"AMR: Installing latest AMR R package to {r_lib_path}...", flush=True)
|
||||
utils.install_packages('AMR', repos='beta.amr-for-r.org', quiet=True)
|
||||
|
||||
def _r_version():
|
||||
"""Return the currently installed AMR R package version, or None."""
|
||||
# Retrieve Python AMR version
|
||||
try:
|
||||
python_amr_version = str(metadata.version('AMR'))
|
||||
except metadata.PackageNotFoundError:
|
||||
python_amr_version = str('')
|
||||
|
||||
# Retrieve R AMR version
|
||||
r_amr_version = robjects.r(f'as.character(packageVersion("AMR", lib.loc = "{r_lib_path}"))')
|
||||
r_amr_version = str(r_amr_version[0])
|
||||
|
||||
# Compare R and Python package versions
|
||||
if r_amr_version != python_amr_version:
|
||||
try:
|
||||
return str(robjects.r(
|
||||
f'as.character(packageVersion("AMR", lib.loc = "{r_lib_path}"))')[0])
|
||||
except Exception:
|
||||
return None
|
||||
print(f"AMR: Updating AMR package in {r_lib_path}...", flush=True)
|
||||
utils.install_packages('AMR', repos='beta.amr-for-r.org', quiet=True)
|
||||
except Exception as e:
|
||||
print(f"AMR: Could not update: {e}", flush=True)
|
||||
|
||||
def _py_version():
|
||||
"""Return the Python AMR package version from metadata, or empty string."""
|
||||
try:
|
||||
return str(metadata.version('AMR'))
|
||||
except metadata.PackageNotFoundError:
|
||||
return ''
|
||||
print(f"AMR: Setting up R environment and AMR datasets...", flush=True)
|
||||
|
||||
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
|
||||
EOL
|
||||
|
||||
# ---- datasets.py: only dataset loading ---- #
|
||||
|
||||
cat <<'EOL' > "$datasets_file"
|
||||
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('''
|
||||
# Activate the automatic conversion between R and pandas DataFrames
|
||||
with localconverter(default_converter + numpy2ri.converter + pandas2ri.converter):
|
||||
# example_isolates
|
||||
example_isolates = robjects.r('''
|
||||
df <- AMR::example_isolates
|
||||
df[] <- lapply(df, function(x) {
|
||||
if (inherits(x, c("Date", "POSIXt", "factor"))) {
|
||||
@@ -190,72 +109,26 @@ def _load_example_isolates():
|
||||
df <- df[, !sapply(df, is.list)]
|
||||
df
|
||||
''')
|
||||
df['date'] = pd.to_datetime(df['date'])
|
||||
return df
|
||||
example_isolates['date'] = pd.to_datetime(example_isolates['date'])
|
||||
|
||||
def get(name, source="cran"):
|
||||
"""Retrieve a dataset by name, installing AMR if needed."""
|
||||
_load_datasets(source)
|
||||
return _cache[name]
|
||||
# microorganisms
|
||||
microorganisms = robjects.r('AMR::microorganisms[, !sapply(AMR::microorganisms, is.list)]')
|
||||
antimicrobials = robjects.r('AMR::antimicrobials[, !sapply(AMR::antimicrobials, is.list)]')
|
||||
clinical_breakpoints = robjects.r('AMR::clinical_breakpoints[, !sapply(AMR::clinical_breakpoints, is.list)]')
|
||||
|
||||
base.options(warn = 0)
|
||||
|
||||
print(f"AMR: Done.", flush=True)
|
||||
EOL
|
||||
|
||||
# ---- __init__.py: lazy module, CRAN by default ---- #
|
||||
echo "from .datasets import example_isolates" >> $init_file
|
||||
echo "from .datasets import microorganisms" >> $init_file
|
||||
echo "from .datasets import antimicrobials" >> $init_file
|
||||
echo "from .datasets import clinical_breakpoints" >> $init_file
|
||||
|
||||
cat <<'EOL' > "$init_file"
|
||||
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
|
||||
EOL
|
||||
|
||||
# ---- beta.py: GitHub development version ---- #
|
||||
|
||||
cat <<'EOL' > "$beta_file"
|
||||
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
|
||||
EOL
|
||||
|
||||
# ---- functions.py: R-to-Python wrapper functions ---- #
|
||||
|
||||
cat <<'EOL' > "$functions_file"
|
||||
# Write header to the functions Python file, including the convert_to_python function
|
||||
cat <<EOL > "$functions_file"
|
||||
import functools
|
||||
import rpy2.robjects as robjects
|
||||
from rpy2.robjects.packages import importr
|
||||
@@ -265,38 +138,9 @@ 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")
|
||||
# Import the AMR R package
|
||||
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):
|
||||
@@ -322,23 +166,21 @@ def convert_to_python(r_output):
|
||||
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."""
|
||||
"""Decorator that runs an rpy2 function under a localconverter
|
||||
and then applies convert_to_python to its output."""
|
||||
@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
|
||||
EOL
|
||||
|
||||
# ---- Generate wrapper functions from .Rd files ---- #
|
||||
|
||||
# Directory where the .Rd files are stored (update path as needed)
|
||||
rd_dir="../man"
|
||||
|
||||
# Iterate through each .Rd file in the man directory
|
||||
for rd_file in "$rd_dir"/*.Rd; do
|
||||
# Extract function names and their arguments from the .Rd files
|
||||
awk '
|
||||
BEGIN {
|
||||
usage_started = 0
|
||||
@@ -421,19 +263,18 @@ for rd_file in "$rd_dir"/*.Rd; do
|
||||
' "$rd_file"
|
||||
done
|
||||
|
||||
# Output completion message
|
||||
echo "Python wrapper functions generated in $functions_file."
|
||||
echo "Python wrapper functions listed in $init_file."
|
||||
|
||||
# ---- README ---- #
|
||||
|
||||
cp ../vignettes/AMR_for_Python.Rmd ../PythonPackage/AMR/README.md
|
||||
sed -i '1,/^# Introduction$/d' ../PythonPackage/AMR/README.md
|
||||
echo "README copied."
|
||||
|
||||
# ---- setup.py ---- #
|
||||
echo "README copied"
|
||||
|
||||
# Extract the relevant fields from DESCRIPTION
|
||||
version=$(grep "^Version:" "$description_file" | awk '{print $2}')
|
||||
|
||||
# Write the setup.py file
|
||||
cat <<EOL > "$setup_file"
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
@@ -464,10 +305,11 @@ setup(
|
||||
)
|
||||
EOL
|
||||
|
||||
echo "setup.py generated."
|
||||
|
||||
# ---- Build ---- #
|
||||
# Output completion message
|
||||
echo "setup.py has been generated in $setup_file."
|
||||
|
||||
cd ../PythonPackage/AMR
|
||||
pip3 install build
|
||||
python3 -m build
|
||||
# python3 setup.py sdist bdist_wheel
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ pre_commit_lst <- list()
|
||||
|
||||
usethis::ui_info(paste0("Updating internal package data"))
|
||||
|
||||
# See 'data-raw/interpretive_rules.tsv' for the interpretive rules reference file
|
||||
pre_commit_lst$INTERPRETIVE_RULES_DF <- utils::read.delim(
|
||||
file = "data-raw/interpretive_rules.tsv",
|
||||
# See 'data-raw/eucast_rules.tsv' for the EUCAST reference file
|
||||
pre_commit_lst$EUCAST_RULES_DF <- utils::read.delim(
|
||||
file = "data-raw/eucast_rules.tsv",
|
||||
skip = 9,
|
||||
sep = "\t",
|
||||
stringsAsFactors = FALSE,
|
||||
@@ -109,11 +109,11 @@ create_species_cons_cops <- function(type = c("CoNS", "CoPS")) {
|
||||
which(MO_staph$species %in% c(
|
||||
"coagulase-negative", "argensis", "arlettae",
|
||||
"auricularis", "borealis", "caeli", "capitis", "caprae",
|
||||
"carnosus", "casei", "caseorum", "caseolyticus", "chromogenes", "cohnii", "condimenti",
|
||||
"carnosus", "casei", "caseolyticus", "chromogenes", "cohnii", "condimenti",
|
||||
"croceilyticus",
|
||||
"debuckii", "devriesei", "edaphicus", "epidermidis",
|
||||
"equorum", "felis", "fleurettii", "gallinarum", "halotolerans",
|
||||
"haemolyticus", "hominis", "hsinchuensis", "jettensis", "kloosii",
|
||||
"equorum", "felis", "fleurettii", "gallinarum",
|
||||
"haemolyticus", "hominis", "jettensis", "kloosii",
|
||||
"lentus", "lugdunensis", "massiliensis", "microti",
|
||||
"muscae", "nepalensis", "pasteuri", "petrasii",
|
||||
"pettenkoferi", "piscifermentans", "pragensis", "pseudoxylosus",
|
||||
@@ -142,8 +142,7 @@ create_species_cons_cops <- function(type = c("CoNS", "CoPS")) {
|
||||
"pseudintermedius", "pseudointermedius",
|
||||
"schweitzeri", "simiae",
|
||||
"roterodami",
|
||||
"singaporensis",
|
||||
"ursi"
|
||||
"singaporensis"
|
||||
) |
|
||||
# old, now renamed to S. coagulans (but still as synonym in our data of course):
|
||||
(MO_staph$species == "schleiferi" & MO_staph$subspecies == "coagulans")),
|
||||
@@ -281,7 +280,6 @@ pre_commit_lst$MO_RELEVANT_GENERA <- c(
|
||||
"Malbranchea",
|
||||
"Metagonimus",
|
||||
"Meyerozyma",
|
||||
"Microascus",
|
||||
"Microsporidium",
|
||||
"Microsporum",
|
||||
"Millerozyma",
|
||||
@@ -308,7 +306,6 @@ pre_commit_lst$MO_RELEVANT_GENERA <- c(
|
||||
"Piedraia",
|
||||
"Pithomyces",
|
||||
"Pityrosporum",
|
||||
"Plasmodium",
|
||||
"Pneumocystis",
|
||||
"Pseudallescheria",
|
||||
"Pseudoscopulariopsis",
|
||||
@@ -326,7 +323,6 @@ pre_commit_lst$MO_RELEVANT_GENERA <- c(
|
||||
"Sarcoptes",
|
||||
"Scedosporium",
|
||||
"Schistosoma",
|
||||
"Schizophyllum",
|
||||
"Schizosaccharomyces",
|
||||
"Scolecobasidium",
|
||||
"Scopulariopsis",
|
||||
@@ -368,14 +364,11 @@ pre_commit_lst$MO_RELEVANT_GENERA <- c(
|
||||
)
|
||||
|
||||
# antibiotic groups
|
||||
# (these will also be used for interpretive_rules() and understanding data-raw/interpretive_rules.tsv)
|
||||
# (these will also be used for eucast_rules() and understanding data-raw/eucast_rules.tsv)
|
||||
pre_commit_lst$AB_AMINOGLYCOSIDES <- antimicrobials %>%
|
||||
filter(group %like% "aminoglycoside|paromomycin|spectinomycin") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_AMINOPENICILLINS <- as.ab(c("AMP", "AMX", "AMC"))
|
||||
pre_commit_lst$AB_AMINOCOUMARINS <- antimicrobials %>%
|
||||
filter(name %like% "novobiocin|clorobiocin") %>%
|
||||
filter(group %like% "aminoglycoside") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_AMINOPENICILLINS <- as.ab(c("AMP", "AMX"))
|
||||
pre_commit_lst$AB_ANTIFUNGALS <- antimicrobials %>%
|
||||
filter(group %like% "antifungal") %>%
|
||||
pull(ab)
|
||||
@@ -404,28 +397,26 @@ pre_commit_lst$AB_CEPHALOSPORINS_5TH <- antimicrobials %>%
|
||||
filter(group %like% "cephalosporin.*5") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_CEPHALOSPORINS_EXCEPT_CAZ <- pre_commit_lst$AB_CEPHALOSPORINS[pre_commit_lst$AB_CEPHALOSPORINS != "CAZ"]
|
||||
pre_commit_lst$AB_FLUOROQUINOLONES <- antimicrobials %>%
|
||||
# see DOI 10.23937/2378-3656/1410369, more specifically this table: https://www.clinmedjournals.org/articles/cmrcr/cmrcr-8-369-table1.html
|
||||
filter((group %like% "quinolone" | atc_group1 %like% "quinolone" | atc_group2 %like% "quinolone") & name %unlike% " acid|nalidixic|cinoxacin|flumequine|oxolinic|piromidic|pipemidic|rosoxacin") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_GLYCOPEPTIDES <- antimicrobials %>%
|
||||
filter(group %like% "glycopeptide") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_FUSIDANES <- antimicrobials %>%
|
||||
filter(name %like% "fusi") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_IONOPHORES <- antimicrobials %>%
|
||||
filter(name %like% "alamethicin|beauvericin|calcimycin|chloroquine|clioquinol|diiodohydroxyquinoline|dithiocarbamates|enniatin|epigallocatechin|gramicidin|hinokitiol|ionomycin|laidlomycin|lasalocid|maduramicin|monensin|narasin|nigericin|nonactin|nystatin|pyrazole|pyrithione|quercetin|salinomycin|semduramicin|valinomycin|zincophorin") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_ISOXAZOLYLPENICILLINS <- antimicrobials %>%
|
||||
filter(name %like% "oxacillin|cloxacillin|dicloxacillin|flucloxacillin|meth?icillin") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_LIPOGLYCOPEPTIDES <- as.ab(c("DAL", "ORI", "TLV")) # dalba/orita/tela
|
||||
pre_commit_lst$AB_GLYCOPEPTIDES_EXCEPT_LIPO <- pre_commit_lst$AB_GLYCOPEPTIDES[!pre_commit_lst$AB_GLYCOPEPTIDES %in% pre_commit_lst$AB_LIPOGLYCOPEPTIDES]
|
||||
pre_commit_lst$AB_LINCOSAMIDES <- antimicrobials %>%
|
||||
filter(atc_group2 %like% "lincosamide" | (group %like% "lincosamide" & is.na(atc_group2) & name %like% "^(pirlimycin|clinda)")) %>%
|
||||
filter(atc_group2 %like% "lincosamide" | (group %like% "lincosamide" & is.na(atc_group2) & name %like% "^(pirlimycin)" & name %unlike% "screening|inducible")) %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_MACROLIDES <- antimicrobials %>%
|
||||
filter(atc_group2 %like% "macrolide" | (group %like% "macrolide" & is.na(atc_group2)) | name %like% "^(acetylmidecamycin|acetylspiramycin|gamith?romycin|kitasamycin|meleumycin|nafith?romycin|primycin|solith?romycin|tildipirosin|tilmicosin|tulath?romycin|tylosin|tylvalosin)") %>%
|
||||
filter(atc_group2 %like% "macrolide" | (group %like% "macrolide" & is.na(atc_group2) & name %like% "^(acetylmidecamycin|acetylspiramycin|gamith?romycin|kitasamycin|meleumycin|nafith?romycin|solith?romycin|tildipirosin|tilmicosin|tulath?romycin|tylosin|tylvalosin)" & name %unlike% "screening|inducible")) %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_MONOBACTAMS <- antimicrobials %>%
|
||||
filter(group %like% "monobactam" | name %like% "aztreonam|carumonam|tigemonam") %>%
|
||||
filter(group %like% "monobactam") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_NITROFURANS <- antimicrobials %>%
|
||||
filter(name %like% "^furaz|nitrofura" | atc_group2 %like% "nitrofuran") %>%
|
||||
@@ -436,178 +427,56 @@ pre_commit_lst$AB_OXAZOLIDINONES <- antimicrobials %>%
|
||||
pre_commit_lst$AB_PENICILLINS <- antimicrobials %>%
|
||||
filter(group %like% "penicillin" & !(name %unlike% "/" & name %like% ".*bactam$")) %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_PEPTIDES <- antimicrobials %>%
|
||||
filter(ab %in% pre_commit_lst$AB_GLYCOPEPTIDES | name %like% "thiostrepton|actinomycin|bacitracin|daptomycin|vancomycin|teixobactin|tyrocidine|gramicidin|zwittermicin|epothilone|fabclavine|bleomycin|ciclosporin|cyclosporine|siderophores|pyoverdine|enterobactin|myxochelin") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_PHENICOLS <- antimicrobials %>%
|
||||
filter(group %like% "phenicol" | atc_group1 %like% "phenicol" | atc_group2 %like% "phenicol") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_PHOSPHONICS <- antimicrobials %>%
|
||||
filter(group %like% "phosphonic" | name %like% "fosfo") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_PLEUROMUTILINS <- antimicrobials %>%
|
||||
filter(name %like% "retapamulin|tiamulin|pleuromutilin") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_POLYMYXINS <- antimicrobials %>%
|
||||
filter(group %like% "polymyxin") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_QUINOLONES <- antimicrobials %>%
|
||||
filter(group %like% "quinolone" | atc_group1 %like% "quinolone" | atc_group2 %like% "quinolone" | name %like% "ozenoxacin") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_FLUOROQUINOLONES <- antimicrobials %>%
|
||||
# see DOI 10.23937/2378-3656/1410369, more specifically this table: https://www.clinmedjournals.org/articles/cmrcr/cmrcr-8-369-table1.html
|
||||
filter(ab %in% pre_commit_lst$AB_QUINOLONES & name %unlike% " acid|nalidixic|cinoxacin|flumequine|oxolinic|ozenoxacin|piromidic|pipemidic|rosoxacin") %>%
|
||||
filter(group %like% "quinolone" | atc_group1 %like% "quinolone" | atc_group2 %like% "quinolone") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_RIFAMYCINS <- antimicrobials %>%
|
||||
filter(name %like% "Rifampi|Rifabutin|Rifapentine|rifamy") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_SPIROPYRIMIDINETRIONES <- antimicrobials %>%
|
||||
filter(name %like% "zoliflodacin") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_STREPTOGRAMINS <- antimicrobials %>%
|
||||
filter(atc_group2 %like% "streptogramin" | name %like% "streptogramin|virginiamycin|ostreogrycin") %>%
|
||||
filter(atc_group2 %like% "streptogramin") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_TETRACYCLINES <- antimicrobials %>%
|
||||
filter(atc_group1 %like% "tetracycline" | atc_group2 %like% "tetracycline" | name %like% "chlortetracycline|cetocycline|demeclocycline|doxycycline|eravacycline|lymecycline|meclocycline|meth?acycline|minocycline|omadacycline|oxytetracycline|rolitetracycline|sarecycline|tetracycline|tigecycline") %>%
|
||||
filter(group %like% "tetracycline") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_TETRACYCLINES_EXCEPT_TGC <- pre_commit_lst$AB_TETRACYCLINES[pre_commit_lst$AB_TETRACYCLINES != "TGC"]
|
||||
pre_commit_lst$AB_TRIMETHOPRIMS <- antimicrobials %>%
|
||||
filter(atc_group1 %like% "trimethoprim" | atc_group2 %like% "trimethoprim" | name %like% "trimethoprim|ormetroprim|iclaprim") %>%
|
||||
filter(group %like% "trimethoprim") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_SULFONAMIDES <- antimicrobials %>%
|
||||
filter(name %like% "(^|/)sulf[oai]") %>%
|
||||
filter(group %like% "trimethoprim" & name %unlike% "trimethoprim") %>%
|
||||
pull(ab)
|
||||
pre_commit_lst$AB_UREIDOPENICILLINS <- as.ab(c("PIP", "TZP", "AZL", "MEZ"))
|
||||
pre_commit_lst$AB_BETALACTAMS <- sort(c(
|
||||
pre_commit_lst$AB_PENICILLINS,
|
||||
pre_commit_lst$AB_CEPHALOSPORINS,
|
||||
pre_commit_lst$AB_CARBAPENEMS,
|
||||
pre_commit_lst$AB_MONOBACTAMS
|
||||
))
|
||||
pre_commit_lst$AB_BETALACTAMASE_INHIBITORS <- antimicrobials %>%
|
||||
filter(atc_group2 %like% "Beta-lactamase inhibitors" | name %like% "bactam") %>%
|
||||
pull(ab)
|
||||
# for EUCAST:
|
||||
pre_commit_lst$AB_BETALACTAMS <- sort(c(pre_commit_lst$AB_PENICILLINS, pre_commit_lst$AB_CEPHALOSPORINS, pre_commit_lst$AB_CARBAPENEMS, pre_commit_lst$AB_MONOBACTAMS))
|
||||
pre_commit_lst$AB_BETALACTAMS_WITH_INHIBITOR <- antimicrobials %>%
|
||||
filter(ab %in% pre_commit_lst$AB_BETALACTAMS & name %like% "/" & name %unlike% "EDTA") %>%
|
||||
filter(name %like% "/" & name %unlike% "EDTA" & ab %in% pre_commit_lst$AB_BETALACTAMS) %>%
|
||||
pull(ab)
|
||||
# this will be used for documentation:
|
||||
pre_commit_lst$DEFINED_AB_GROUPS <- sort(names(pre_commit_lst)[names(pre_commit_lst) %like% "^AB_" & names(pre_commit_lst) != "AB_LOOKUP"])
|
||||
|
||||
# Check that all AB_* groups with >= 4 members have a corresponding function
|
||||
for (grp in pre_commit_lst$DEFINED_AB_GROUPS[pre_commit_lst$DEFINED_AB_GROUPS %unlike% "BETALACTAMASE_INHIBITORS|EXCEPT"]) {
|
||||
if (length(pre_commit_lst[[grp]]) >= 4) {
|
||||
fn_name <- tolower(gsub("^AB_", "", grp))
|
||||
if (!fn_name %in% ls(envir = asNamespace("AMR"))) {
|
||||
stop("Group '", grp, "' has ", length(pre_commit_lst[[grp]]),
|
||||
" members (", toString(ab_name(pre_commit_lst[[grp]], tolower = T)), ") but no corresponding function '", fn_name, "()' exists in the AMR namespace.",
|
||||
call. = FALSE
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Update the antimicrobials$group column
|
||||
usethis::ui_info("Updating 'group' column in antimicrobials data set from AB_* vectors")
|
||||
prettify_group_name <- function(name) {
|
||||
raw <- gsub("^AB_", "", name)
|
||||
pretty <- tools::toTitleCase(gsub("_", " ", tolower(raw)))
|
||||
pretty[pretty %like% " (except|with) "] <- ""
|
||||
pretty <- gsub(" (1st|2nd|3rd|4th|5th|6th)", " (\\1 gen.)", pretty)
|
||||
pretty <- gsub("([Bb])eta[-]?", "\\1eta-", pretty)
|
||||
pretty <- gsub(" Inhibitor", " inhibitor", pretty)
|
||||
pretty <- pretty[pretty != ""]
|
||||
return(pretty)
|
||||
}
|
||||
group_map <- vector("list", length = nrow(antimicrobials))
|
||||
names(group_map) <- antimicrobials$ab
|
||||
for (group_name in pre_commit_lst$DEFINED_AB_GROUPS) {
|
||||
ab_vector <- pre_commit_lst[[group_name]]
|
||||
pretty_name <- prettify_group_name(group_name)
|
||||
for (ab in ab_vector) {
|
||||
ab_chr <- as.character(ab)
|
||||
group_map[[ab_chr]] <- sort(unique(c(group_map[[ab_chr]], pretty_name)))
|
||||
}
|
||||
}
|
||||
for (i in seq_along(group_map)) {
|
||||
if (is.null(group_map[[i]])) {
|
||||
group_map[[i]] <- "Other"
|
||||
if (antimicrobials$group[i] %unlike% "other") {
|
||||
usethis::ui_warn(paste0("AB had a group but not anymore: ", antimicrobials$name[i], " (", antimicrobials$ab[i], "), was ", toString(antimicrobials$group[i])))
|
||||
}
|
||||
}
|
||||
group_map[[i]] <- group_map[[i]][order(nchar(group_map[[i]]))]
|
||||
}
|
||||
|
||||
# create priority list for ab_group()
|
||||
pre_commit_lst$ABX_PRIORITY_LIST <- c(
|
||||
"Aminopenicillins",
|
||||
"Isoxazolylpenicillins",
|
||||
"Ureidopenicillins",
|
||||
"Oxazolidinones",
|
||||
"Carbapenems",
|
||||
"Cephalosporins (1st gen.)",
|
||||
"Cephalosporins (2nd gen.)",
|
||||
"Cephalosporins (3rd gen.)",
|
||||
"Cephalosporins (4th gen.)",
|
||||
"Cephalosporins (5th gen.)",
|
||||
"Cephalosporins",
|
||||
"Penicillins",
|
||||
"Monobactams",
|
||||
"Aminoglycosides",
|
||||
"Lipoglycopeptides",
|
||||
"Glycopeptides",
|
||||
"Peptides",
|
||||
"Lincosamides",
|
||||
"Streptogramins",
|
||||
"Macrolides",
|
||||
"Nitrofurans",
|
||||
"Phenicols",
|
||||
"Phosphonics",
|
||||
"Polymyxins",
|
||||
"Fluoroquinolones",
|
||||
"Quinolones",
|
||||
"Rifamycins",
|
||||
"Spiropyrimidinetriones",
|
||||
"Trimethoprims",
|
||||
"Sulfonamides",
|
||||
"Tetracyclines",
|
||||
"Ionophores",
|
||||
"Antifungals",
|
||||
"Antimycobacterials",
|
||||
"Fusidanes",
|
||||
"Beta-lactams",
|
||||
"Beta-lactamase inhibitors",
|
||||
"Pleuromutilins",
|
||||
"Aminocoumarins",
|
||||
"Other"
|
||||
)
|
||||
if (!all(unlist(antimicrobials$group) %in% pre_commit_lst$ABX_PRIORITY_LIST)) {
|
||||
stop("Missing group(s) in priority list: ", paste(setdiff(unlist(antimicrobials$group), pre_commit_lst$ABX_PRIORITY_LIST), collapse = ", "))
|
||||
}
|
||||
for (i in seq_along(group_map)) {
|
||||
group_map[[i]] <- intersect(pre_commit_lst$ABX_PRIORITY_LIST, group_map[[i]])
|
||||
}
|
||||
antimicrobials$group <- unname(group_map)
|
||||
usethis::use_data(antimicrobials, overwrite = TRUE, version = 2, compress = "xz")
|
||||
|
||||
pre_commit_lst$AB_LOOKUP <- create_AB_AV_lookup(antimicrobials)
|
||||
pre_commit_lst$AV_LOOKUP <- create_AB_AV_lookup(antivirals)
|
||||
|
||||
# Export to package as internal data ----
|
||||
# usethis::use_data() must receive unquoted object names, which is not flexible at all.
|
||||
# we'll use good old base::save() instead
|
||||
save(
|
||||
list = names(pre_commit_lst),
|
||||
file = "R/sysdata.rda",
|
||||
envir = as.environment(pre_commit_lst),
|
||||
compress = "xz",
|
||||
version = 2,
|
||||
ascii = FALSE
|
||||
)
|
||||
save(list = names(pre_commit_lst),
|
||||
file = "R/sysdata.rda",
|
||||
envir = as.environment(pre_commit_lst),
|
||||
compress = "xz",
|
||||
version = 2,
|
||||
ascii = FALSE)
|
||||
usethis::ui_done("Saved to {usethis::ui_value('R/sysdata.rda')}")
|
||||
|
||||
|
||||
|
||||
|
||||
# Export data sets to the repository in different formats -----------------
|
||||
|
||||
for (pkg in c("haven", "openxlsx2", "arrow")) {
|
||||
@@ -629,9 +498,7 @@ write_md5 <- function(object) {
|
||||
}
|
||||
changed_md5 <- function(object) {
|
||||
path <- paste0("data-raw/", deparse(substitute(object)), ".md5")
|
||||
if (!file.exists(path)) {
|
||||
return(TRUE)
|
||||
}
|
||||
if (!file.exists(path)) return(TRUE)
|
||||
tryCatch(
|
||||
{
|
||||
conn <- file(path)
|
||||
@@ -769,55 +636,24 @@ devtools::load_all(quiet = TRUE)
|
||||
suppressMessages(set_AMR_locale("English"))
|
||||
|
||||
files_changed <- function(paths = "^(R|data)/") {
|
||||
tryCatch(
|
||||
{
|
||||
changed_files <- system("git status", intern = TRUE)
|
||||
changed_files <- unlist(strsplit(changed_files, " "))
|
||||
any(changed_files %like% paths[paths != "R/sysdata.rda"])
|
||||
},
|
||||
error = function(e) TRUE
|
||||
)
|
||||
tryCatch({
|
||||
changed_files <- system("git status", intern = TRUE)
|
||||
changed_files <- unlist(strsplit(changed_files, " "))
|
||||
any(changed_files %like% paths[paths != "R/sysdata.rda"])
|
||||
}, error = function(e) TRUE)
|
||||
}
|
||||
|
||||
# Update URLs -------------------------------------------------------------
|
||||
if (files_changed()) {
|
||||
usethis::ui_info("Checking URLs for redirects")
|
||||
# Step 1: Get sources from tools (excluding man/)
|
||||
sources <- tools:::url_db_from_package_sources(".")
|
||||
sources <- sources[!grepl("^man/", sources$Parent), ]
|
||||
# Step 2: Get URLs from .R files in R/
|
||||
r_files <- list.files("R", pattern = "\\.R$", full.names = TRUE)
|
||||
# Function to extract URLs from a file
|
||||
extract_urls_from_file <- function(file_path) {
|
||||
lines <- readLines(file_path, warn = FALSE)
|
||||
urls <- stringr::str_extract_all(lines, "https?://[^\\s)\"'>]+")
|
||||
urls <- unlist(urls)
|
||||
if (length(urls) == 0) {
|
||||
return(NULL)
|
||||
}
|
||||
# Remove trailing punctuation (e.g., .,), etc.)
|
||||
urls <- stringr::str_replace(urls, "[\\.,;)]+$", "")
|
||||
data.frame(
|
||||
URL = urls,
|
||||
Parent = gsub("^\\./", "", file_path),
|
||||
stringsAsFactors = FALSE
|
||||
)
|
||||
}
|
||||
r_file_urls <- do.call(rbind, lapply(r_files, extract_urls_from_file))
|
||||
# Step 3: Combine the two sources
|
||||
total <- rbind(sources, r_file_urls)
|
||||
# Step 4: Check URLs and update
|
||||
results <- urlchecker::url_check(db = total)
|
||||
invisible(urlchecker::url_update(results = results))
|
||||
invisible(urlchecker::url_update("."))
|
||||
}
|
||||
|
||||
# Style pkg ---------------------------------------------------------------
|
||||
if (files_changed(paths = "^(R|tests)/")) {
|
||||
usethis::ui_info("Styling package")
|
||||
styler::style_pkg(
|
||||
include_roxygen_examples = FALSE,
|
||||
exclude_dirs = list.dirs(full.names = FALSE, recursive = FALSE)[!list.dirs(full.names = FALSE, recursive = FALSE) %in% c("R", "tests")]
|
||||
)
|
||||
styler::style_pkg(include_roxygen_examples = FALSE,
|
||||
exclude_dirs = list.dirs(full.names = FALSE, recursive = FALSE)[!list.dirs(full.names = FALSE, recursive = FALSE) %in% c("R", "tests")])
|
||||
}
|
||||
|
||||
# Document pkg ------------------------------------------------------------
|
||||
@@ -828,13 +664,13 @@ if (files_changed()) {
|
||||
|
||||
# Update index.md and README.md -------------------------------------------
|
||||
if (files_changed("README.Rmd") ||
|
||||
files_changed("index.Rmd") ||
|
||||
files_changed("man/microorganisms.Rd") ||
|
||||
files_changed("man/antimicrobials.Rd") ||
|
||||
files_changed("man/clinical_breakpoints.Rd") ||
|
||||
files_changed("man/antibiogram.Rd") ||
|
||||
files_changed("R/antibiogram.R") ||
|
||||
files_changed("data-raw/translations.tsv")) {
|
||||
files_changed("index.Rmd") ||
|
||||
files_changed("man/microorganisms.Rd") ||
|
||||
files_changed("man/antimicrobials.Rd") ||
|
||||
files_changed("man/clinical_breakpoints.Rd") ||
|
||||
files_changed("man/antibiogram.Rd") ||
|
||||
files_changed("R/antibiogram.R") ||
|
||||
files_changed("data-raw/translations.tsv")) {
|
||||
usethis::ui_info("Rendering {usethis::ui_field('index.md')} and {usethis::ui_field('README.md')}")
|
||||
suppressWarnings(rmarkdown::render("index.Rmd", quiet = TRUE))
|
||||
suppressWarnings(rmarkdown::render("README.Rmd", quiet = TRUE))
|
||||
@@ -843,6 +679,5 @@ if (files_changed("README.Rmd") ||
|
||||
}
|
||||
|
||||
# Finished ----------------------------------------------------------------
|
||||
rm(antimicrobials)
|
||||
usethis::ui_done("All done")
|
||||
suppressMessages(reset_AMR_locale())
|
||||
|
||||
@@ -262,9 +262,9 @@ get_synonyms <- function(CID, clean = TRUE) {
|
||||
if (is.na(CID[i])) {
|
||||
next
|
||||
}
|
||||
|
||||
|
||||
all_cids <- CID[i]
|
||||
|
||||
|
||||
# we will now get the closest compounds with a 96% threshold
|
||||
similar_cids <- tryCatch(
|
||||
data.table::fread(
|
||||
@@ -281,7 +281,7 @@ get_synonyms <- function(CID, clean = TRUE) {
|
||||
# leave out all CIDs that we have in our antimicrobials dataset to prevent duplication
|
||||
similar_cids <- similar_cids[!similar_cids %in% antimicrobials$cid[!is.na(antimicrobials$cid)]]
|
||||
all_cids <- unique(c(all_cids, similar_cids))
|
||||
|
||||
|
||||
# for each one, we are getting the synonyms
|
||||
current_syns <- character(0)
|
||||
for (j in seq_len(length(all_cids))) {
|
||||
@@ -297,9 +297,9 @@ get_synonyms <- function(CID, clean = TRUE) {
|
||||
)[[1]],
|
||||
error = function(e) NA_character_
|
||||
)
|
||||
|
||||
|
||||
Sys.sleep(0.05)
|
||||
|
||||
|
||||
if (clean == TRUE) {
|
||||
# remove text between brackets
|
||||
synonyms_txt <- trimws(gsub(
|
||||
@@ -319,16 +319,16 @@ get_synonyms <- function(CID, clean = TRUE) {
|
||||
synonyms_txt <- gsub("[^a-z]+$", "", ignore.case = TRUE, synonyms_txt)
|
||||
# only length 5 to 20 and lower-case names starting with a capital letter
|
||||
synonyms_txt <- synonyms_txt[nchar(synonyms_txt) %in% c(5:20) &
|
||||
grepl("^[A-Z][a-z]+$", synonyms_txt, ignore.case = FALSE)]
|
||||
grepl("^[A-Z][a-z]+$", synonyms_txt, ignore.case = FALSE)]
|
||||
synonyms_txt <- unlist(strsplit(synonyms_txt, ";", fixed = TRUE))
|
||||
}
|
||||
|
||||
|
||||
# synonyms must not be set for other agents, so remove the duplicates
|
||||
synonyms_txt <- synonyms_txt[!synonyms_txt %in% unlist(synonyms)]
|
||||
|
||||
|
||||
current_syns <- c(current_syns, synonyms_txt)
|
||||
}
|
||||
|
||||
|
||||
current_syns <- unique(trimws(current_syns[tolower(current_syns) %in% unique(tolower(current_syns))]))
|
||||
synonyms[i] <- list(sort(current_syns))
|
||||
}
|
||||
@@ -763,12 +763,10 @@ antimicrobials[which(antimicrobials$ab %in% c("CYC", "LNZ", "THA", "TZD")), "gro
|
||||
# add efflux
|
||||
effl <- antimicrobials |>
|
||||
filter(ab == "ACM") |>
|
||||
mutate(
|
||||
ab = as.character("EFF"),
|
||||
cid = NA_real_,
|
||||
name = "Efflux",
|
||||
group = "Other"
|
||||
)
|
||||
mutate(ab = as.character("EFF"),
|
||||
cid = NA_real_,
|
||||
name = "Efflux",
|
||||
group = "Other")
|
||||
antimicrobials <- antimicrobials |>
|
||||
mutate(ab = as.character(ab)) |>
|
||||
bind_rows(effl)
|
||||
@@ -779,11 +777,9 @@ antimicrobials[which(antimicrobials$ab == "EFF"), "abbreviations"][[1]] <- list(
|
||||
# add clindamycin inducible screening
|
||||
clin <- antimicrobials |>
|
||||
filter(ab == "FOX1") |>
|
||||
mutate(
|
||||
ab = as.character("CLI-S"),
|
||||
name = "Clindamycin inducible screening",
|
||||
group = "Macrolides/lincosamides"
|
||||
)
|
||||
mutate(ab = as.character("CLI-S"),
|
||||
name = "Clindamycin inducible screening",
|
||||
group = "Macrolides/lincosamides")
|
||||
antimicrobials <- antimicrobials |>
|
||||
mutate(ab = as.character(ab)) |>
|
||||
bind_rows(clin)
|
||||
@@ -795,123 +791,109 @@ antimicrobials <- antimicrobials |>
|
||||
bind_rows(
|
||||
antimicrobials |>
|
||||
filter(ab == "EFF") |>
|
||||
mutate(
|
||||
ab = "BLA-S",
|
||||
name = paste("Beta-lactamase", "screening test"),
|
||||
cid = NA_real_,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("beta-lactamase", "betalactamase", "bl screen", "blt screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))
|
||||
),
|
||||
mutate(ab = "BLA-S",
|
||||
name = paste("Beta-lactamase", "screening test"),
|
||||
cid = NA_real_,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("beta-lactamase", "betalactamase", "bl screen", "blt screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))),
|
||||
antimicrobials |>
|
||||
filter(ab == "PEN") |>
|
||||
mutate(
|
||||
ab = "PEN-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("pen screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))
|
||||
),
|
||||
mutate(ab = "PEN-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("pen screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))),
|
||||
antimicrobials |>
|
||||
filter(ab == "OXA") |>
|
||||
mutate(
|
||||
ab = "OXA-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("oxa screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))
|
||||
),
|
||||
mutate(ab = "OXA-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("oxa screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))),
|
||||
antimicrobials |>
|
||||
filter(ab == "PEF") |>
|
||||
mutate(
|
||||
ab = "PEF-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("pef screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))
|
||||
),
|
||||
mutate(ab = "PEF-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("pef screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))),
|
||||
antimicrobials |>
|
||||
filter(ab == "NAL") |>
|
||||
mutate(
|
||||
ab = "NAL-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("nal screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))
|
||||
),
|
||||
mutate(ab = "NAL-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("nal screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))),
|
||||
antimicrobials |>
|
||||
filter(ab == "NOR") |>
|
||||
mutate(
|
||||
ab = "NOR-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("nor screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))
|
||||
),
|
||||
mutate(ab = "NOR-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("nor screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))),
|
||||
antimicrobials |>
|
||||
filter(ab == "TCY") |>
|
||||
mutate(
|
||||
ab = "TCY-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("tcy screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0))
|
||||
)
|
||||
mutate(ab = "TCY-S",
|
||||
name = paste(name, "screening test"),
|
||||
cid = NA,
|
||||
atc = list(character(0)),
|
||||
atc_group1 = NA_character_,
|
||||
atc_group2 = NA_character_,
|
||||
abbreviations = list(c("tcy screen")),
|
||||
synonyms = list(character(0)),
|
||||
oral_ddd = NA_real_,
|
||||
oral_units = NA_character_,
|
||||
iv_ddd = NA_real_,
|
||||
iv_units = NA_character_,
|
||||
loinc = list(character(0)))
|
||||
)
|
||||
|
||||
|
||||
@@ -930,94 +912,7 @@ antimicrobials <- antimicrobials %>%
|
||||
oral_ddd = NA_real_
|
||||
))
|
||||
|
||||
# add Taniborbactam and Cefepime/taniborbactam
|
||||
antimicrobials <- antimicrobials |>
|
||||
mutate(ab = as.character(ab)) |>
|
||||
bind_rows(
|
||||
antimicrobials |>
|
||||
filter(ab == "FPE") |>
|
||||
mutate(ab = as.character(ab)) |>
|
||||
mutate(
|
||||
ab = "FTA",
|
||||
name = "Cefepime/taniborbactam",
|
||||
cid = NA_real_
|
||||
),
|
||||
antimicrobials |>
|
||||
filter(ab == "TBP") |>
|
||||
mutate(ab = as.character(ab)) |>
|
||||
mutate(
|
||||
ab = "TAN",
|
||||
name = "Taniborbactam",
|
||||
cid = 76902493,
|
||||
abbreviations = list("VNRX-5133")
|
||||
)
|
||||
)
|
||||
|
||||
antimicrobials <- antimicrobials |>
|
||||
mutate(ab = as.character(ab)) |>
|
||||
bind_rows(
|
||||
antimicrobials |>
|
||||
filter(ab == "CTB") |>
|
||||
mutate(
|
||||
ab = "CTA",
|
||||
cid = NA_real_,
|
||||
name = "Ceftibuten/avibactam"
|
||||
) |>
|
||||
select(1:4),
|
||||
antimicrobials |>
|
||||
filter(ab == "KAC") |>
|
||||
mutate(
|
||||
ab = "KAS",
|
||||
cid = NA_real_,
|
||||
name = "Kasugamycin"
|
||||
) |>
|
||||
select(1:4),
|
||||
antimicrobials |>
|
||||
filter(ab == "PRI") |>
|
||||
mutate(
|
||||
ab = "OST",
|
||||
cid = NA_real_,
|
||||
name = "Ostreogrycin"
|
||||
) |>
|
||||
select(1:4),
|
||||
antimicrobials |>
|
||||
filter(ab == "PRI") |>
|
||||
mutate(
|
||||
ab = "THS",
|
||||
cid = NA_real_,
|
||||
name = "Thiostrepton"
|
||||
) |>
|
||||
select(1, 3),
|
||||
antimicrobials |>
|
||||
filter(ab == "CLA1") |>
|
||||
mutate(
|
||||
ab = "XER",
|
||||
cid = NA_real_,
|
||||
name = "Xeruborbactam"
|
||||
) |>
|
||||
select(1:4),
|
||||
antimicrobials |>
|
||||
filter(ab == "BLM") |>
|
||||
mutate(
|
||||
ab = "ZOR",
|
||||
cid = NA_real_,
|
||||
name = "Zorbamycin"
|
||||
) |>
|
||||
select(1:4),
|
||||
)
|
||||
|
||||
antimicrobials <- antimicrobials |>
|
||||
mutate(ab = as.character(ab)) |>
|
||||
bind_rows(
|
||||
antimicrobials |>
|
||||
filter(ab == "NOV") |>
|
||||
mutate(
|
||||
ab = "CLB",
|
||||
cid = 54706138,
|
||||
name = "Clorobiocin"
|
||||
) |>
|
||||
select(1:4),
|
||||
)
|
||||
|
||||
# update ATC codes from WHOCC website -------------------------------------
|
||||
|
||||
@@ -1026,7 +921,7 @@ get_atc_table <- function(ab_name, type = "human") {
|
||||
if (type == "human") {
|
||||
url <- "https://atcddd.fhi.no/atc_ddd_index/"
|
||||
} else if (type == "veterinary") {
|
||||
url <- "https://atcddd.fhi.no/atcvet/atcvet_index/"
|
||||
url <- "https://atcddd.fhi.no/atcvet/atcvet_index/"
|
||||
} else {
|
||||
stop("invalid type")
|
||||
}
|
||||
@@ -1091,10 +986,8 @@ to_update <- 1:nrow(antimicrobials)
|
||||
# or just the empty ones:
|
||||
to_update <- which(sapply(antimicrobials$atc, function(x) length(x[!is.na(x)])) == 0)
|
||||
|
||||
updated_atc <- lapply(
|
||||
seq_len(length(to_update)),
|
||||
function(x) NA_character_
|
||||
)
|
||||
updated_atc <- lapply(seq_len(length(to_update)),
|
||||
function(x) NA_character_)
|
||||
|
||||
|
||||
# this takes around 10 minutes for the whole table (some ABx are skipped and go faster)
|
||||
@@ -1196,14 +1089,13 @@ for (i in 1:nrow(antimicrobials)) {
|
||||
syn <- as.character(sort(unique(tolower(unname(unlist(antimicrobials[i, "synonyms", drop = TRUE]))))))
|
||||
syn <- gsub("[^a-z]", "", syn)
|
||||
syn <- gsub(" +", " ", syn)
|
||||
pharm_terms <- "(antibiotic|pa?ediatric|injection|oral|inhale|otic|sulfate|sulphate|sodium|base|anhydrous|anhydrate|stearate|syrup|natrium|hydrate|x?hcl|gsalt|vet[.]?)"
|
||||
pharm_terms <- "(pa?ediatric|injection|oral|inhale|otic|sulfate|sulphate|sodium|base|anhydrous|anhydrate|stearate|syrup|natrium|hydrate|x?hcl|gsalt|vet[.]?)"
|
||||
syn <- gsub(paste0(" ", pharm_terms, "$"), "", syn)
|
||||
syn <- gsub(paste0("^", pharm_terms, " "), "", syn)
|
||||
syn <- trimws(syn)
|
||||
syn <- gsub(" [a-z]{1,3}$", "", syn, perl = TRUE)
|
||||
syn <- trimws(syn)
|
||||
syn <- syn[syn != "" & syn %unlike% ":" & !syn %in% tolower(antimicrobials$name)]
|
||||
syn <- syn[!syn %in% c("antibiotic", "antimicrobial")]
|
||||
# remove synonyms that are names in the data set
|
||||
syn <- syn[!sapply(syn, function(s) any(grepl(transform_syn(s), antimicrobials$name)))]
|
||||
syn <- unique(syn)
|
||||
@@ -1220,11 +1112,6 @@ for (i in 1:nrow(antimicrobials)) {
|
||||
antimicrobials[i, "loinc"][[1]] <- ifelse(length(loinc) == 0, list(NA_character_), list(loinc))
|
||||
}
|
||||
}
|
||||
antimicrobials$group <- unname(antimicrobials$group)
|
||||
antimicrobials$atc <- unname(antimicrobials$atc)
|
||||
antimicrobials$abbreviations <- unname(antimicrobials$abbreviations)
|
||||
antimicrobials$synonyms <- unname(antimicrobials$synonyms)
|
||||
antimicrobials$loinc <- unname(antimicrobials$loinc)
|
||||
|
||||
|
||||
usethis::use_data(antimicrobials, overwrite = TRUE, version = 2, compress = "xz")
|
||||
|
||||
@@ -35,49 +35,42 @@ library(readr)
|
||||
library(tidyr)
|
||||
devtools::load_all()
|
||||
|
||||
# BE SURE TO RUN data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R FIRST TO GET THE GROUPS!
|
||||
# Install the WHONET software on Windows (http://www.whonet.org/software.html),
|
||||
# and copy the folder C:\WHONET\Resources to the data-raw/WHONET/ folder
|
||||
# (for ASIARS-Net update, also copy C:\WHONET\Codes to the data-raw/WHONET/ folder)
|
||||
|
||||
# For non-interactive use
|
||||
if (!interactive()) {
|
||||
View <- glimpse
|
||||
}
|
||||
# BE SURE TO RUN data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R FIRST TO GET THE GROUPS!
|
||||
|
||||
# READ DATA ----
|
||||
|
||||
# files are retrieved from https://github.com/AClark-WHONET/AMRIE
|
||||
|
||||
github_repo <- "https://raw.github.com/AClark-WHONET/AMRIE/main/Interpretation%20Engine/Resources"
|
||||
file_organisms <- file.path(github_repo, "Organisms.txt")
|
||||
file_breakpoints <- file.path(github_repo, "Breakpoints.txt")
|
||||
file_antibiotics <- file.path(github_repo, "Antibiotics.txt")
|
||||
|
||||
whonet_organisms_raw <- read_tsv(file_organisms, na = c("", "NA", "-"), show_col_types = FALSE, guess_max = Inf) |>
|
||||
whonet_organisms <- read_tsv("data-raw/WHONET/Resources/Organisms.txt", na = c("", "NA", "-"), show_col_types = FALSE) |>
|
||||
# remove old taxonomic names
|
||||
filter(TAXONOMIC_STATUS == "C") |>
|
||||
mutate(ORGANISM_CODE = toupper(WHONET_ORG_CODE))
|
||||
|
||||
whonet_breakpoints_raw <- read_tsv(file_breakpoints, na = c("", "NA", "-"), show_col_types = FALSE, guess_max = Inf) |>
|
||||
whonet_breakpoints <- read_tsv("data-raw/WHONET/Resources/Breakpoints.txt", na = c("", "NA", "-"),
|
||||
show_col_types = FALSE, guess_max = Inf) |>
|
||||
filter(GUIDELINES %in% c("CLSI", "EUCAST"))
|
||||
|
||||
whonet_antibiotics_raw <- read_tsv(file_antibiotics, na = c("", "NA", "-"), show_col_types = FALSE, guess_max = Inf) |>
|
||||
whonet_antibiotics <- read_tsv("data-raw/WHONET/Resources/Antibiotics.txt", na = c("", "NA", "-"), show_col_types = FALSE) |>
|
||||
arrange(WHONET_ABX_CODE) |>
|
||||
distinct(WHONET_ABX_CODE, .keep_all = TRUE)
|
||||
|
||||
# MICROORGANISMS WHONET CODES ----
|
||||
|
||||
whonet_organisms <- whonet_organisms_raw |>
|
||||
whonet_organisms <- whonet_organisms |>
|
||||
select(ORGANISM_CODE, ORGANISM, SPECIES_GROUP, GBIF_TAXON_ID) |>
|
||||
mutate(
|
||||
# this one was called Issatchenkia orientalis, but it should be:
|
||||
ORGANISM = if_else(ORGANISM_CODE == "ckr", "Candida krusei", ORGANISM)
|
||||
) |>
|
||||
# try to match on GBIF identifier
|
||||
left_join(microorganisms |> distinct(mo, gbif, status) |> filter(!is.na(gbif)), by = c("GBIF_TAXON_ID" = "gbif")) |>
|
||||
left_join(microorganisms |> distinct(mo, gbif, status) |> filter(!is.na(gbif)), by = c("GBIF_TAXON_ID" = "gbif")) |>
|
||||
# remove duplicates
|
||||
arrange(ORGANISM_CODE, GBIF_TAXON_ID, status) |>
|
||||
distinct(ORGANISM_CODE, .keep_all = TRUE) |>
|
||||
distinct(ORGANISM_CODE, .keep_all = TRUE) |>
|
||||
# add Enterobacterales, which is a subkingdom code in their data
|
||||
bind_rows(data.frame(ORGANISM_CODE = "ebc", ORGANISM = "Enterobacterales", mo = as.mo("Enterobacterales"))) |>
|
||||
bind_rows(data.frame(ORGANISM_CODE = "ebc", ORGANISM = "Enterobacterales", mo = as.mo("Enterobacterales"))) |>
|
||||
arrange(ORGANISM)
|
||||
|
||||
|
||||
@@ -88,78 +81,55 @@ unmatched <- whonet_organisms |> filter(is.na(mo))
|
||||
|
||||
# generate the mo codes and add their names
|
||||
message("Getting MO codes for WHONET input...")
|
||||
unmatched <- unmatched |>
|
||||
mutate(
|
||||
mo = as.mo(gsub("(sero[a-z]*| nontypable| non[-][a-zA-Z]+|var[.]| not .*|sp[.],.*|, .*variant.*|, .*toxin.*|, microaer.*| beta-haem[.])", "", ORGANISM),
|
||||
minimum_matching_score = 0.55,
|
||||
keep_synonyms = TRUE,
|
||||
language = "en"
|
||||
),
|
||||
mo = case_when(
|
||||
ORGANISM %like% "Anaerobic" & ORGANISM %like% "negative" ~ as.mo("B_ANAER-NEG"),
|
||||
ORGANISM %like% "Anaerobic" & ORGANISM %like% "positive" ~ as.mo("B_ANAER-POS"),
|
||||
ORGANISM %like% "Anaerobic" ~ as.mo("B_ANAER"),
|
||||
TRUE ~ mo
|
||||
),
|
||||
mo_name = mo_name(mo,
|
||||
keep_synonyms = TRUE,
|
||||
language = "en"
|
||||
)
|
||||
)
|
||||
unmatched <- unmatched |>
|
||||
mutate(mo = as.mo(gsub("(sero[a-z]*| nontypable| non[-][a-zA-Z]+|var[.]| not .*|sp[.],.*|, .*variant.*|, .*toxin.*|, microaer.*| beta-haem[.])", "", ORGANISM),
|
||||
minimum_matching_score = 0.55,
|
||||
keep_synonyms = TRUE,
|
||||
language = "en"),
|
||||
mo = case_when(ORGANISM %like% "Anaerobic" & ORGANISM %like% "negative" ~ as.mo("B_ANAER-NEG"),
|
||||
ORGANISM %like% "Anaerobic" & ORGANISM %like% "positive" ~ as.mo("B_ANAER-POS"),
|
||||
ORGANISM %like% "Anaerobic" ~ as.mo("B_ANAER"),
|
||||
TRUE ~ mo),
|
||||
mo_name = mo_name(mo,
|
||||
keep_synonyms = TRUE,
|
||||
language = "en"))
|
||||
# check if coercion at least resembles the first part (genus)
|
||||
unmatched <- unmatched |>
|
||||
unmatched <- unmatched |>
|
||||
mutate(
|
||||
first_part = sapply(ORGANISM, function(x) strsplit(gsub("[^a-zA-Z _-]+", "", x), " ")[[1]][1], USE.NAMES = FALSE),
|
||||
keep = mo_name %like_case% first_part | ORGANISM %like% "Gram " | ORGANISM == "Other" | ORGANISM %like% "anaerobic"
|
||||
) |>
|
||||
keep = mo_name %like_case% first_part | ORGANISM %like% "Gram " | ORGANISM == "Other" | ORGANISM %like% "anaerobic") |>
|
||||
arrange(keep)
|
||||
unmatched |> View()
|
||||
unmatched <- unmatched |>
|
||||
filter(keep == TRUE)
|
||||
|
||||
organisms <- matched |>
|
||||
transmute(code = toupper(ORGANISM_CODE), group = SPECIES_GROUP, mo) |>
|
||||
bind_rows(unmatched |> transmute(code = toupper(ORGANISM_CODE), group = SPECIES_GROUP, mo)) |>
|
||||
mutate(name = mo_name(mo, keep_synonyms = TRUE)) |>
|
||||
organisms <- matched |> transmute(code = toupper(ORGANISM_CODE), group = SPECIES_GROUP, mo) |>
|
||||
bind_rows(unmatched |> transmute(code = toupper(ORGANISM_CODE), group = SPECIES_GROUP, mo)) |>
|
||||
mutate(name = mo_name(mo, keep_synonyms = TRUE)) |>
|
||||
arrange(code)
|
||||
|
||||
# self-defined codes in the MO table must be retained
|
||||
existing_codes <- microorganisms$fullname[microorganisms$fullname %like% ".* \\("]
|
||||
existing_codes <- gsub(".*\\((.*)\\)", "\\1", existing_codes)
|
||||
|
||||
organisms <- organisms |>
|
||||
filter(!code %in% existing_codes)
|
||||
|
||||
# some subspecies exist, while their upper species do not, add them as the species level:
|
||||
subspp <- organisms |>
|
||||
filter(mo_species(mo, keep_synonyms = TRUE) == mo_subspecies(mo, keep_synonyms = TRUE) &
|
||||
mo_species(mo, keep_synonyms = TRUE) != "" &
|
||||
mo_genus(mo, keep_synonyms = TRUE) != "Salmonella") |>
|
||||
mutate(
|
||||
mo = as.mo(
|
||||
paste(
|
||||
mo_genus(mo, keep_synonyms = TRUE),
|
||||
mo_species(mo, keep_synonyms = TRUE)
|
||||
),
|
||||
keep_synonyms = TRUE
|
||||
),
|
||||
name = mo_name(mo, keep_synonyms = TRUE)
|
||||
)
|
||||
mo_species(mo, keep_synonyms = TRUE) != "" &
|
||||
mo_genus(mo, keep_synonyms = TRUE) != "Salmonella") |>
|
||||
mutate(mo = as.mo(paste(mo_genus(mo, keep_synonyms = TRUE),
|
||||
mo_species(mo, keep_synonyms = TRUE)),
|
||||
keep_synonyms = TRUE),
|
||||
name = mo_name(mo, keep_synonyms = TRUE))
|
||||
organisms <- organisms |>
|
||||
filter(!code %in% subspp$code) |>
|
||||
bind_rows(subspp) |>
|
||||
arrange(code)
|
||||
|
||||
# add the groups
|
||||
organisms <- organisms |>
|
||||
bind_rows(tibble(
|
||||
code = organisms |> filter(!is.na(group)) |> pull(group) |> unique(),
|
||||
group = NA,
|
||||
mo = organisms |> filter(!is.na(group)) |> pull(group) |> unique() |> as.mo(keep_synonyms = TRUE),
|
||||
name = mo_name(mo, keep_synonyms = TRUE)
|
||||
)) |>
|
||||
arrange(code, group) |>
|
||||
select(-group) |>
|
||||
organisms <- organisms |>
|
||||
bind_rows(tibble(code = organisms |> filter(!is.na(group)) |> pull(group) |> unique(),
|
||||
group = NA,
|
||||
mo = organisms |> filter(!is.na(group)) |> pull(group) |> unique() |> as.mo(keep_synonyms = TRUE),
|
||||
name = mo_name(mo, keep_synonyms = TRUE))) |>
|
||||
arrange(code, group) |>
|
||||
select(-group) |>
|
||||
distinct()
|
||||
# no XXX
|
||||
organisms <- organisms |> filter(code != "XXX")
|
||||
@@ -167,10 +137,9 @@ organisms <- organisms |> filter(code != "XXX")
|
||||
# 2023-07-08 SGM is also Strep gamma in WHONET, must only be Slowly-growing Mycobacterium
|
||||
# 2024-06-14 still the case
|
||||
# 2025-04-20 still the case
|
||||
# 2026-03-27 still the case, but fixed using `existing_codes` above
|
||||
organisms |> filter(code == "SGM")
|
||||
# organisms <- organisms |>
|
||||
# filter(!(code == "SGM" & name %like% "Streptococcus"))
|
||||
organisms <- organisms |>
|
||||
filter(!(code == "SGM" & name %like% "Streptococcus"))
|
||||
# this must be empty:
|
||||
organisms$code[organisms$code |> duplicated()]
|
||||
|
||||
@@ -181,17 +150,17 @@ saveRDS(organisms, "data-raw/organisms.rds", version = 2)
|
||||
#---
|
||||
|
||||
# update microorganisms.codes with the latest WHONET codes
|
||||
microorganisms.codes2 <- microorganisms.codes |>
|
||||
microorganisms.codes2 <- microorganisms.codes |>
|
||||
# remove all old WHONET codes, whether we (in the end) keep them or not
|
||||
filter(!toupper(code) %in% toupper(organisms$code)) |>
|
||||
filter(!toupper(code) %in% toupper(organisms$code)) |>
|
||||
# and add the new ones
|
||||
bind_rows(organisms |> select(code, mo)) |>
|
||||
arrange(code) |>
|
||||
bind_rows(organisms |> select(code, mo)) |>
|
||||
arrange(code) |>
|
||||
distinct(code, .keep_all = TRUE)
|
||||
# new codes:
|
||||
microorganisms.codes2$code[which(!microorganisms.codes2$code %in% microorganisms.codes$code)]
|
||||
mo_name(microorganisms.codes2$mo[which(!microorganisms.codes2$code %in% microorganisms.codes$code)], keep_synonyms = TRUE)
|
||||
microorganisms.codes <- microorganisms.codes2 |> distinct()
|
||||
microorganisms.codes <- microorganisms.codes2
|
||||
|
||||
# Run this part to update ASIARS-Net:
|
||||
# 2024-06-14: file not available anymore
|
||||
@@ -230,53 +199,42 @@ devtools::load_all()
|
||||
|
||||
# now that we have the correct MO codes, get the breakpoints and convert them
|
||||
|
||||
whonet_breakpoints_raw |>
|
||||
count(GUIDELINES, BREAKPOINT_TYPE) |>
|
||||
pivot_wider(names_from = BREAKPOINT_TYPE, values_from = n) |>
|
||||
janitor::adorn_totals(where = c("row", "col"))
|
||||
whonet_breakpoints_raw |>
|
||||
filter(YEAR == format(Sys.Date(), "%Y")) |>
|
||||
count(GUIDELINES, YEAR, BREAKPOINT_TYPE) |>
|
||||
pivot_wider(names_from = BREAKPOINT_TYPE, values_from = n) |>
|
||||
whonet_breakpoints |>
|
||||
count(GUIDELINES, BREAKPOINT_TYPE) |>
|
||||
pivot_wider(names_from = BREAKPOINT_TYPE, values_from = n) |>
|
||||
janitor::adorn_totals(where = c("row", "col"))
|
||||
# compared to current
|
||||
AMR::clinical_breakpoints |>
|
||||
count(GUIDELINES = gsub("[^a-zA-Z]", "", guideline), type) |>
|
||||
arrange(tolower(type)) |>
|
||||
pivot_wider(names_from = type, values_from = n) |>
|
||||
pivot_wider(names_from = type, values_from = n) |>
|
||||
as.data.frame() |>
|
||||
janitor::adorn_totals(where = c("row", "col"))
|
||||
|
||||
breakpoints <- whonet_breakpoints_raw |>
|
||||
breakpoints <- whonet_breakpoints |>
|
||||
mutate(code = toupper(ORGANISM_CODE)) |>
|
||||
left_join(bind_rows(
|
||||
microorganisms.codes |> filter(!code %in% c("ALL", "GEN")),
|
||||
# GEN (Generic) and ALL (All) are PK/PD codes
|
||||
data.frame(
|
||||
code = c("ALL", "GEN"),
|
||||
mo = rep(as.mo("UNKNOWN"), 2)
|
||||
)
|
||||
))
|
||||
left_join(bind_rows(microorganisms.codes |> filter(!code %in% c("ALL", "GEN")),
|
||||
# GEN (Generic) and ALL (All) are PK/PD codes
|
||||
data.frame(code = c("ALL", "GEN"),
|
||||
mo = rep(as.mo("UNKNOWN"), 2))))
|
||||
# these ones lack an MO name, they cannot be used:
|
||||
unknown <- breakpoints |>
|
||||
filter(is.na(mo)) |>
|
||||
pull(code) |>
|
||||
unique()
|
||||
breakpoints |>
|
||||
filter(code %in% unknown) |>
|
||||
breakpoints |>
|
||||
filter(code %in% unknown) |>
|
||||
count(GUIDELINES, YEAR, ORGANISM_CODE, BREAKPOINT_TYPE, sort = TRUE)
|
||||
# 2025-04-20: these codes are currently: cps, fso. No clue (are not in MO list of WHONET), and they are only ECOFFs, so remove them:
|
||||
breakpoints <- breakpoints |>
|
||||
breakpoints <- breakpoints |>
|
||||
filter(!is.na(mo))
|
||||
|
||||
# and these ones have unknown antibiotics according to WHONET itself:
|
||||
breakpoints |>
|
||||
filter(!WHONET_ABX_CODE %in% whonet_antibiotics_raw$WHONET_ABX_CODE) |>
|
||||
breakpoints |>
|
||||
filter(!WHONET_ABX_CODE %in% whonet_antibiotics$WHONET_ABX_CODE) |>
|
||||
count(GUIDELINES, WHONET_ABX_CODE) |>
|
||||
mutate(
|
||||
ab = as.ab(WHONET_ABX_CODE, fast_mode = TRUE),
|
||||
ab_name = ab_name(ab)
|
||||
)
|
||||
mutate(ab = as.ab(WHONET_ABX_CODE, fast_mode = TRUE),
|
||||
ab_name = ab_name(ab))
|
||||
# 2025-04-20: these codes are currently: CFC, ROX, FIX, and N/A. All have the right replacements in `antimicrobials`, so we can safely use as.ab() later on
|
||||
# the NAs are for M. tuberculosis, they are empty breakpoints
|
||||
breakpoints <- breakpoints |>
|
||||
@@ -286,14 +244,14 @@ breakpoints <- breakpoints |>
|
||||
## Build new breakpoints table ----
|
||||
|
||||
breakpoints_new <- breakpoints |>
|
||||
filter(!is.na(WHONET_ABX_CODE)) |>
|
||||
filter(!is.na(WHONET_ABX_CODE)) |>
|
||||
transmute(
|
||||
guideline = paste(GUIDELINES, YEAR),
|
||||
type = ifelse(BREAKPOINT_TYPE == "ECOFF", "ECOFF", tolower(BREAKPOINT_TYPE)),
|
||||
host = ifelse(BREAKPOINT_TYPE == "ECOFF", "ECOFF", tolower(HOST)),
|
||||
method = TEST_METHOD,
|
||||
site = SITE_OF_INFECTION,
|
||||
mo = as.mo(mo),
|
||||
mo,
|
||||
rank_index = case_when(
|
||||
is.na(mo_rank(mo, keep_synonyms = TRUE)) ~ 6, # for UNKNOWN, B_GRAMN, B_ANAER, B_ANAER-NEG, etc.
|
||||
mo_rank(mo, keep_synonyms = TRUE) %like% "(infra|sub)" ~ 1,
|
||||
@@ -323,39 +281,31 @@ breakpoints_new <- breakpoints |>
|
||||
distinct(guideline, type, host, ab, mo, method, site, breakpoint_S, .keep_all = TRUE)
|
||||
|
||||
# fix reference table names
|
||||
breakpoints_new |>
|
||||
filter(guideline %like% "EUCAST", is.na(ref_tbl)) |>
|
||||
View()
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
mutate(ref_tbl = case_when(
|
||||
is.na(ref_tbl) & guideline %like% "EUCAST 202" ~ lead(ref_tbl),
|
||||
is.na(ref_tbl) ~ "Unknown",
|
||||
TRUE ~ ref_tbl
|
||||
))
|
||||
breakpoints_new |> filter(guideline %like% "EUCAST", is.na(ref_tbl)) |> View()
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
mutate(ref_tbl = case_when(is.na(ref_tbl) & guideline %like% "EUCAST 202" ~ lead(ref_tbl),
|
||||
is.na(ref_tbl) ~ "Unknown",
|
||||
TRUE ~ ref_tbl))
|
||||
|
||||
# clean disk zones
|
||||
breakpoints_new[which(breakpoints_new$method == "DISK"), "breakpoint_S"] <- as.double(as.disk(breakpoints_new[which(breakpoints_new$method == "DISK"), "breakpoint_S", drop = TRUE]))
|
||||
breakpoints_new[which(breakpoints_new$method == "DISK"), "breakpoint_R"] <- as.double(as.disk(breakpoints_new[which(breakpoints_new$method == "DISK"), "breakpoint_R", drop = TRUE]))
|
||||
|
||||
# regarding animal breakpoints, CLSI has adults and foals for horses, but only for amikacin - only keep adult horses
|
||||
breakpoints_new |>
|
||||
breakpoints_new |>
|
||||
filter(host %like% "foal") |>
|
||||
count(guideline, host, ab)
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
filter(host %unlike% "foal") |>
|
||||
count(guideline, host)
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
filter(host %unlike% "foal") |>
|
||||
mutate(host = ifelse(host %like% "horse", "horse", host))
|
||||
|
||||
# FIXES FOR WHONET ERRORS ----
|
||||
m <- unique(as.double(as.mic(levels(as.mic(1)))))
|
||||
|
||||
# WHONET has no >1024 but instead uses 1025, 513, and 129, so as.mic() cannot be used to clean.
|
||||
# WHONET has no >1024 but instead uses 1025, 513, etc, so as.mic() cannot be used to clean.
|
||||
# instead, raise these one higher valid MIC factor level:
|
||||
breakpoints_new |>
|
||||
filter(method == "MIC" & (!breakpoint_S %in% c(m, NA))) |>
|
||||
distinct(breakpoint_S)
|
||||
breakpoints_new |>
|
||||
filter(method == "MIC" & (!breakpoint_R %in% c(m, NA))) |>
|
||||
distinct(breakpoint_R)
|
||||
breakpoints_new |> filter(method == "MIC" & (!breakpoint_S %in% c(m, NA))) |> distinct(breakpoint_S)
|
||||
breakpoints_new |> filter(method == "MIC" & (!breakpoint_R %in% c(m, NA))) |> distinct(breakpoint_R)
|
||||
breakpoints_new[which(breakpoints_new$breakpoint_R == 129), "breakpoint_R"] <- m[which(m == 128) + 1]
|
||||
breakpoints_new[which(breakpoints_new$breakpoint_R == 257), "breakpoint_R"] <- m[which(m == 256) + 1]
|
||||
breakpoints_new[which(breakpoints_new$breakpoint_R == 513), "breakpoint_R"] <- m[which(m == 512) + 1]
|
||||
@@ -366,7 +316,6 @@ anyNA(breakpoints_new$breakpoint_S)
|
||||
|
||||
# a lot of R breakpoints are missing, but for CLSI this is required and can be set using as.sir(..., substitute_missing_r_breakpoint = TRUE/FALSE, ...)
|
||||
# 2025-04-20/ For EUCAST, this should not be the case, only happens to old guideline now it seems
|
||||
# 2026-03-27/ Now 2026 is in it as well, but making R same to S is fine
|
||||
breakpoints_new |>
|
||||
filter(method == "MIC" & guideline %like% "EUCAST" & is.na(breakpoint_R)) |>
|
||||
count(guideline)
|
||||
@@ -374,21 +323,16 @@ breakpoints_new[which(breakpoints_new$method == "MIC" & breakpoints_new$guidelin
|
||||
|
||||
|
||||
# fix streptococci in WHONET table of EUCAST: Strep A, B, C and G must only include these groups and not all streptococci:
|
||||
# 2026-03-27/ Only erroneous in EUCAST until 2024, it's fixed for 2025 and 2026, but we need to fix this historically too
|
||||
breakpoints_new$mo[breakpoints_new$guideline %like% "EUCAST" & breakpoints_new$mo == "B_STRPT" & breakpoints_new$ref_tbl %like% "^strep.* a.* b.*c.*g"] <- as.mo("B_STRPT_ABCG")
|
||||
breakpoints_new$mo[breakpoints_new$mo == "B_STRPT" & breakpoints_new$ref_tbl %like% "^strep.* a.* b.*c.*g"] <- as.mo("B_STRPT_ABCG")
|
||||
# Haemophilus same error (must only be H. influenzae)
|
||||
# 2026-03-27/ Only erroneous in EUCAST until 2024, it's fixed for 2025 and 2026, but we need to fix this historically too
|
||||
breakpoints_new$mo[breakpoints_new$guideline %like% "EUCAST" & breakpoints_new$mo == "B_HMPHL" & breakpoints_new$ref_tbl %like% "^h.* influenzae"] <- as.mo("B_HMPHL_INFL")
|
||||
breakpoints_new$mo[breakpoints_new$mo == "B_HMPHL" & breakpoints_new$ref_tbl %like% "^h.* influenzae"] <- as.mo("B_HMPHL_INFL")
|
||||
# EUCAST says that for H. parainfluenzae the H. influenza rules can be used, so add them
|
||||
breakpoints_new |>
|
||||
filter(method == "MIC" & guideline %like% "EUCAST" & mo %like% as.mo("B_HMPHL")) |>
|
||||
count(guideline, mo)
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
bind_rows(
|
||||
breakpoints_new |>
|
||||
filter(guideline %like% "EUCAST", mo == "B_HMPHL_INFL") |>
|
||||
filter(guideline %like% "EUCAST", mo == "B_HMPHL_INFL") |>
|
||||
mutate(mo = as.mo("B_HMPHL_PRNF"))
|
||||
) |>
|
||||
) |>
|
||||
arrange(desc(guideline), mo, ab, type, host, method) |>
|
||||
distinct()
|
||||
# Achromobacter denitrificans is in WHONET included in their A. xylosoxidans table, must be removed
|
||||
@@ -399,63 +343,24 @@ breakpoints_new |> filter(mo == as.mo("Streptococcus viridans") & ab == "GEH")
|
||||
breakpoints_new <- breakpoints_new |> filter(!(mo == as.mo("Streptococcus viridans") & ab == "GEN"))
|
||||
# Nitrofurantoin in Staph (EUCAST) only applies to S. saprophyticus, while WHONET has the DISK correct but the MIC on genus level
|
||||
breakpoints_new$mo[breakpoints_new$mo == "B_STPHY" & breakpoints_new$ab == "NIT" & breakpoints_new$guideline %like% "EUCAST"] <- as.mo("B_STPHY_SPRP")
|
||||
|
||||
# WHONET contains breakpoint for EUCAST that are not actually in EUCAST:
|
||||
# IPM in M. morganii is not in it since v10
|
||||
wrong <- with(breakpoints_new, guideline %like% "EUCAST" & ab == "IPM" & mo == as.mo("M. morganii") & ref_tbl != "ECOFF")
|
||||
breakpoints_new |> filter(wrong)
|
||||
breakpoints_new <- breakpoints_new |> filter(!wrong)
|
||||
# Breakpoints for COPS were part of EUCAST until v11
|
||||
wrong <- with(breakpoints_new, guideline %like% "EUCAST" & mo == as.mo("CoPS") & ref_tbl != "ECOFF")
|
||||
breakpoints_new |> filter(wrong)
|
||||
breakpoints_new <- breakpoints_new |> filter(!wrong)
|
||||
|
||||
# WHONET sets the 2023 breakpoints for SAM to MIC of 16/32 for Enterobacterales, should be MIC 8/32 like AMC (see issue #123 on github.com/msberends/AMR)
|
||||
# 2024-02-22/ fixed now
|
||||
|
||||
# There's a problem with C. diff in EUCAST where breakpoint_R is missing - they are listed as normal human breakpoints but are ECOFF
|
||||
# 2025-04-20/ fixed now
|
||||
|
||||
# WHONET sets for EUCAST 2026 TMP breakpoints for all Klebsiella, but this is now only for non-aerogenes species
|
||||
kleb_spp <- microorganisms |>
|
||||
filter(rank == "species", genus == "Klebsiella", !species %in% c("", "aerogenes")) |>
|
||||
pull(mo)
|
||||
kleb_tmp_mic <- breakpoints_new |>
|
||||
filter(guideline == "EUCAST 2026", method == "MIC", ab == "TMP", mo == as.mo("Klebsiella")) |>
|
||||
uncount(length(kleb_spp)) |>
|
||||
mutate(mo = kleb_spp)
|
||||
kleb_tmp_disk <- breakpoints_new |>
|
||||
filter(guideline == "EUCAST 2026", method == "DISK", ab == "TMP", mo == as.mo("Klebsiella")) |>
|
||||
uncount(length(kleb_spp)) |>
|
||||
mutate(mo = kleb_spp)
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
filter(!(guideline == "EUCAST 2026" & method == "MIC" & ab == "TMP" & mo == as.mo("Klebsiella"))) |>
|
||||
bind_rows(
|
||||
kleb_tmp_mic,
|
||||
kleb_tmp_disk
|
||||
)
|
||||
|
||||
# WHONET contains wrong EUCAST breakpoints for enterococci/SXT: disk should be 23/23, not 21/50, and MIC should be 1/1, not 0.032/1
|
||||
# applies to all previous years, since v11 (2011)
|
||||
breakpoints_new |> filter(guideline %like% "EUCAST", ab == "SXT", mo == as.mo("Enterococcus"), type == "human")
|
||||
breakpoints_new$breakpoint_S[breakpoints_new$guideline %like% "EUCAST" & breakpoints_new$ab == "SXT" & breakpoints_new$mo == as.mo("Enterococcus") & breakpoints_new$type == "human" & breakpoints_new$method == "DISK"] <- 23
|
||||
breakpoints_new$breakpoint_R[breakpoints_new$guideline %like% "EUCAST" & breakpoints_new$ab == "SXT" & breakpoints_new$mo == as.mo("Enterococcus") & breakpoints_new$type == "human" & breakpoints_new$method == "DISK"] <- 23
|
||||
breakpoints_new$breakpoint_S[breakpoints_new$guideline %like% "EUCAST" & breakpoints_new$ab == "SXT" & breakpoints_new$mo == as.mo("Enterococcus") & breakpoints_new$type == "human" & breakpoints_new$method == "MIC"] <- 1
|
||||
breakpoints_new$breakpoint_R[breakpoints_new$guideline %like% "EUCAST" & breakpoints_new$ab == "SXT" & breakpoints_new$mo == as.mo("Enterococcus") & breakpoints_new$type == "human" & breakpoints_new$method == "MIC"] <- 1
|
||||
# Also wrong EUCAST breakpoints for enterococci/TMP: disk should be 21/21, not 21/50, and MIC should be 1/1, not 0.032/1
|
||||
breakpoints_new |> filter(guideline %like% "EUCAST", ab == "TMP", mo == as.mo("Enterococcus"), type == "human")
|
||||
breakpoints_new$breakpoint_S[breakpoints_new$guideline %like% "EUCAST" & breakpoints_new$ab == "TMP" & breakpoints_new$mo == as.mo("Enterococcus") & breakpoints_new$type == "human" & breakpoints_new$method == "DISK"] <- 21
|
||||
breakpoints_new$breakpoint_R[breakpoints_new$guideline %like% "EUCAST" & breakpoints_new$ab == "TMP" & breakpoints_new$mo == as.mo("Enterococcus") & breakpoints_new$type == "human" & breakpoints_new$method == "DISK"] <- 21
|
||||
breakpoints_new$breakpoint_S[breakpoints_new$guideline %like% "EUCAST" & breakpoints_new$ab == "TMP" & breakpoints_new$mo == as.mo("Enterococcus") & breakpoints_new$type == "human" & breakpoints_new$method == "MIC"] <- 1
|
||||
breakpoints_new$breakpoint_R[breakpoints_new$guideline %like% "EUCAST" & breakpoints_new$ab == "TMP" & breakpoints_new$mo == as.mo("Enterococcus") & breakpoints_new$type == "human" & breakpoints_new$method == "MIC"] <- 1
|
||||
|
||||
# WHONET still contains PK/PD rules for EUCAST >= 2024, but this was ended from v14 (2024) on
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
filter(!(guideline %like% "EUCAST (2024|2025|2026)" & ref_tbl == "PK/PD"))
|
||||
|
||||
# WHONET still contains generic anaerobic rules for EUCAST >= 2021, but this was ended from v12 (2022) on
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
filter(!(guideline %like% "EUCAST (2022|2023|2024|2025|2026)" & ref_tbl %like% "anaerob"))
|
||||
# determine rank again now that some changes were made on taxonomic level (genus -> species)
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
mutate(rank_index = case_when(
|
||||
mo_rank(mo, keep_synonyms = TRUE) %like% "(infra|sub)" ~ 1,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "species" ~ 2,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "species group" ~ 2.5,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "genus" ~ 3,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "family" ~ 4,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "order" ~ 5,
|
||||
mo != "UNKNOWN" ~ 6, # for B_ANAER, etc.
|
||||
TRUE ~ 7
|
||||
))
|
||||
|
||||
# WHONET adds one log2 level to the R breakpoint for their software, e.g. in AMC in Enterobacterales:
|
||||
# EUCAST 2023 guideline: S <= 8 and R > 8
|
||||
@@ -476,24 +381,24 @@ breakpoints_new <- breakpoints_new |>
|
||||
breakpoint_R
|
||||
))
|
||||
|
||||
|
||||
# check the strange duplicates
|
||||
breakpoints_new |>
|
||||
breakpoints_new |>
|
||||
mutate(id = paste(guideline, type, host, method, site, mo, ab, uti)) %>%
|
||||
filter(id %in% .$id[which(duplicated(id))]) |>
|
||||
filter(id %in% .$id[which(duplicated(id))]) |>
|
||||
arrange(desc(guideline)) |>
|
||||
View()
|
||||
# 2024-06-19/ mostly ECOFFs, but there's no explanation in the whonet_breakpoints_raw df, we have to remove duplicates
|
||||
# 2024-06-19/ mostly ECOFFs, but there's no explanation in the whonet_breakpoints file, we have to remove duplicates
|
||||
# 2025-04-20/ same, most important one seems M. tuberculosis in CLSI (also in 2025)
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
distinct(guideline, type, host, method, site, mo, ab, uti, .keep_all = TRUE)
|
||||
|
||||
|
||||
# CHECKS ----
|
||||
# CHECKS AND SAVE TO PACKAGE ----
|
||||
|
||||
breakpoints_new |> filter(guideline == "EUCAST 2026", ab == "AMC", mo == "B_[ORD]_ENTRBCTR", method == "MIC")
|
||||
# check again
|
||||
breakpoints_new |> filter(guideline == "EUCAST 2025", ab == "AMC", mo == "B_[ORD]_ENTRBCTR", method == "MIC")
|
||||
# compare with current version
|
||||
clinical_breakpoints |> filter(guideline == "EUCAST 2025", ab == "AMC", mo == "B_[ORD]_ENTRBCTR", method == "MIC")
|
||||
clinical_breakpoints |> filter(guideline == "EUCAST 2024", ab == "AMC", mo == "B_[ORD]_ENTRBCTR", method == "MIC")
|
||||
|
||||
# must have "human" and "ECOFF"
|
||||
breakpoints_new |> filter(mo == "B_STRPT_PNMN", ab == "AMP", guideline == "EUCAST 2020", method == "MIC")
|
||||
@@ -502,90 +407,6 @@ breakpoints_new |> filter(mo == "B_STRPT_PNMN", ab == "AMP", guideline == "EUCAS
|
||||
dim(breakpoints_new)
|
||||
dim(clinical_breakpoints)
|
||||
|
||||
|
||||
# Correct anaerobic bacteria in EUCAST ----
|
||||
|
||||
eucast_anaerobe_corrections <- tibble::tribble(
|
||||
~guideline, ~type, ~host, ~method, ~site, ~mo, ~rank_index, ~ab, ~ref_tbl, ~disk_dose, ~breakpoint_S, ~breakpoint_R, ~uti, ~is_SDD,
|
||||
|
||||
# Prevotella spp.
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Prevotella"), 3, as.ab("AMP"), "Prevotella", NA, 0.5, 0.5, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Prevotella"), 3, as.ab("AMP"), "Prevotella", "2 mcg", 25, 25, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Prevotella"), 3, as.ab("SAM"), "Prevotella", "10/10 mcg", 33, 33, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Prevotella"), 3, as.ab("AMX"), "Prevotella", NA, 0.25, 0.25, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Prevotella"), 3, as.ab("AMC"), "Prevotella", "2/1 mcg", 24, 24, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Prevotella"), 3, as.ab("ETP"), "Prevotella", NA, 0.5, 0.5, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Prevotella"), 3, as.ab("ETP"), "Prevotella", "10 mcg", 29, 29, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Prevotella"), 3, as.ab("IPM"), "Prevotella", NA, 0.125, 0.125, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Prevotella"), 3, as.ab("IPM"), "Prevotella", "10 mcg", 35, 35, FALSE, FALSE,
|
||||
|
||||
# Fusobacterium necrophorum
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("AMP"), "F. necrophorum", NA, 0.5, 0.5, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("AMP"), "F. necrophorum", "2 mcg", 27, 27, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("SAM"), "F. necrophorum", NA, 0.5, 0.5, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("SAM"), "F. necrophorum", "10/10 mcg", 33, 33, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("AMX"), "F. necrophorum", NA, 0.5, 0.5, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("AMC"), "F. necrophorum", NA, 0.5, 0.5, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("AMC"), "F. necrophorum", "2/1 mcg", 23, 23, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("ETP"), "F. necrophorum", NA, 0.06, 0.06, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("ETP"), "F. necrophorum", "10 mcg", 35, 35, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("IPM"), "F. necrophorum", NA, 0.125, 0.125, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Fusobacterium necrophorum"), 2, as.ab("IPM"), "F. necrophorum", "10 mcg", 36, 36, FALSE, FALSE,
|
||||
|
||||
# Clostridium perfringens
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Clostridium perfringens"), 2, as.ab("AMP"), "C. perfringens", NA, 0.25, 0.25, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Clostridium perfringens"), 2, as.ab("AMP"), "C. perfringens", "2 mcg", 23, 23, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Clostridium perfringens"), 2, as.ab("SAM"), "C. perfringens", NA, 0.25, 0.25, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Clostridium perfringens"), 2, as.ab("SAM"), "C. perfringens", "10/10 mcg", 27, 27, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Clostridium perfringens"), 2, as.ab("AMX"), "C. perfringens", NA, 0.25, 0.25, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Clostridium perfringens"), 2, as.ab("AMC"), "C. perfringens", NA, 0.25, 0.25, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Clostridium perfringens"), 2, as.ab("AMC"), "C. perfringens", "2/1 mcg", 23, 23, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Clostridium perfringens"), 2, as.ab("ETP"), "C. perfringens", NA, 0.5, 0.5, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Clostridium perfringens"), 2, as.ab("ETP"), "C. perfringens", "10 mcg", 24, 24, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Clostridium perfringens"), 2, as.ab("IPM"), "C. perfringens", NA, 0.5, 0.5, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Clostridium perfringens"), 2, as.ab("IPM"), "C. perfringens", "10 mcg", 25, 25, FALSE, FALSE,
|
||||
|
||||
# Cutibacterium acnes
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Cutibacterium acnes"), 2, as.ab("AMP"), "C. acnes", NA, 0.25, 0.25, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Cutibacterium acnes"), 2, as.ab("AMP"), "C. acnes", "2 mcg", 23, 23, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Cutibacterium acnes"), 2, as.ab("SAM"), "C. acnes", "10/10 mcg", 33, 33, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Cutibacterium acnes"), 2, as.ab("AMX"), "C. acnes", NA, 0.25, 0.25, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Cutibacterium acnes"), 2, as.ab("AMC"), "C. acnes", "2/1 mcg", 24, 24, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Cutibacterium acnes"), 2, as.ab("CTX"), "C. acnes", "5 mcg", 26, 26, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Cutibacterium acnes"), 2, as.ab("CRO"), "C. acnes", NA, 0.06, 0.06, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Cutibacterium acnes"), 2, as.ab("CRO"), "C. acnes", "30 mcg", 33, 33, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Cutibacterium acnes"), 2, as.ab("ETP"), "C. acnes", NA, 0.25, 0.25, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Cutibacterium acnes"), 2, as.ab("ETP"), "C. acnes", "10 mcg", 28, 28, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Cutibacterium acnes"), 2, as.ab("IPM"), "C. acnes", NA, 0.03, 0.03, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Cutibacterium acnes"), 2, as.ab("IPM"), "C. acnes", "10 mcg", 39, 39, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "MIC", NA, as.mo("Cutibacterium acnes"), 2, as.ab("LNZ"), "C. acnes", NA, 2, 2, FALSE, FALSE,
|
||||
"EUCAST 2025", "human", "human", "DISK", NA, as.mo("Cutibacterium acnes"), 2, as.ab("LNZ"), "C. acnes", "10 mcg", 34, 34, FALSE, FALSE
|
||||
)
|
||||
|
||||
breakpoints_new <- clinical_breakpoints |>
|
||||
bind_rows(eucast_anaerobe_corrections) |>
|
||||
bind_rows(eucast_anaerobe_corrections |> mutate(guideline = "EUCAST 2026")) |>
|
||||
bind_rows(eucast_anaerobe_corrections |> mutate(guideline = "EUCAST 2023")) |>
|
||||
bind_rows(eucast_anaerobe_corrections |> mutate(guideline = "EUCAST 2024"))
|
||||
|
||||
|
||||
# SAVE TO PACKAGE ----
|
||||
|
||||
# determine rank again now that some changes were made on taxonomic level (genus -> species)
|
||||
breakpoints_new <- breakpoints_new |>
|
||||
mutate(rank_index = case_when(
|
||||
mo_rank(mo, keep_synonyms = TRUE) %like% "(infra|sub)" ~ 1,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "species" ~ 2,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "species group" ~ 2.5,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "genus" ~ 3,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "family" ~ 4,
|
||||
mo_rank(mo, keep_synonyms = TRUE) == "order" ~ 5,
|
||||
mo != "UNKNOWN" ~ 6, # for B_ANAER, etc.
|
||||
TRUE ~ 7
|
||||
)) |>
|
||||
# and arrange
|
||||
arrange(desc(guideline), mo, ab, type, host, method)
|
||||
|
||||
clinical_breakpoints <- breakpoints_new
|
||||
clinical_breakpoints <- clinical_breakpoints |> dataset_UTF8_to_ASCII()
|
||||
usethis::use_data(clinical_breakpoints, overwrite = TRUE, compress = "xz", version = 2)
|
||||
|
||||
@@ -1,725 +0,0 @@
|
||||
# ==================================================================== #
|
||||
# TITLE: #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data #
|
||||
# #
|
||||
# SOURCE CODE: #
|
||||
# https://github.com/msberends/AMR #
|
||||
# #
|
||||
# PLEASE CITE THIS SOFTWARE AS: #
|
||||
# Berends MS, Luz CF, Friedrich AW, et al. (2022). #
|
||||
# AMR: An R Package for Working with Antimicrobial Resistance Data. #
|
||||
# Journal of Statistical Software, 104(3), 1-31. #
|
||||
# https://doi.org/10.18637/jss.v104.i03 #
|
||||
# #
|
||||
# Developed at the University of Groningen and the University Medical #
|
||||
# Center Groningen in The Netherlands, in collaboration with many #
|
||||
# colleagues from around the world, see our website. #
|
||||
# #
|
||||
# This R package is free software; you can freely use and distribute #
|
||||
# it for both personal and commercial purposes under the terms of the #
|
||||
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
|
||||
# the Free Software Foundation. #
|
||||
# We created this package for both routine data analysis and academic #
|
||||
# research and it was publicly released in the hope that it will be #
|
||||
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
|
||||
# #
|
||||
# Visit our website for the full manual and a complete tutorial about #
|
||||
# how to conduct AMR data analysis: https://amr-for-r.org #
|
||||
# ==================================================================== #
|
||||
|
||||
# Generic parser for EUCAST Clinical Breakpoint Table xlsx files.
|
||||
# Works for any organism sheet by auto-detecting:
|
||||
# - Header rows (via "MIC breakpoint" in col 2)
|
||||
# - Sub-header rows (via "S " pattern in col 2, one row below header)
|
||||
# - Organism names (row 1 for single-organism sheets, or discovered above
|
||||
# each header row for multi-organism sheets like Anaerobic bacteria)
|
||||
# - Data rows (between sub-header and next header/end)
|
||||
# - Notes (col 9, resolved per-row via superscript references)
|
||||
#
|
||||
# Uses tidyxl to parse rich text cells, separating base values from
|
||||
# superscript footnote references that EUCAST uses for notes.
|
||||
#
|
||||
# Output mimics the AMR::clinical_breakpoints structure with added columns:
|
||||
# version, is_screening, note
|
||||
|
||||
|
||||
library(tidyxl)
|
||||
library(dplyr, warn.conflicts = FALSE)
|
||||
library(purrr)
|
||||
devtools::load_all()
|
||||
|
||||
# ==============================================================================
|
||||
# 1. Rich text parser
|
||||
# ==============================================================================
|
||||
split_rich_text <- function(fmt_list) {
|
||||
map_dfr(fmt_list, function(fmt) {
|
||||
if (is.null(fmt) || nrow(fmt) == 0)
|
||||
return(tibble(base_text = NA_character_, note_super = NA_character_))
|
||||
is_super <- !is.na(fmt$vertAlign) & fmt$vertAlign == "superscript"
|
||||
tibble(
|
||||
base_text = paste0(fmt$character[!is_super], collapse = ""),
|
||||
note_super = paste0(fmt$character[is_super], collapse = "")
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# 2. Notes block parser
|
||||
# ==============================================================================
|
||||
parse_notes_block <- function(txt) {
|
||||
if (is.na(txt) || txt == "") return(list())
|
||||
|
||||
txt <- gsub("\r\n", "\n", txt)
|
||||
txt <- gsub("\r", "\n", txt)
|
||||
txt <- gsub("\u00A0", " ", txt)
|
||||
|
||||
find_keys <- function(pattern, txt) {
|
||||
m <- gregexpr(pattern, txt, perl = TRUE)[[1]]
|
||||
if (m[1] == -1)
|
||||
return(data.frame(pos = integer(0), key = character(0),
|
||||
mlen = integer(0), stringsAsFactors = FALSE))
|
||||
lens <- attr(m, "match.length")
|
||||
keys <- gsub("[.\\s]+$", "", trimws(substring(txt, m, m + lens - 1)))
|
||||
data.frame(pos = as.integer(m), key = keys, mlen = as.integer(lens),
|
||||
stringsAsFactors = FALSE)
|
||||
}
|
||||
|
||||
# Combined key: 1/A. or 5/A.
|
||||
r1 <- find_keys("(?:^|(?<=\\n)|(?<=\\.))\\s*\\d+/[A-Z]\\.\\s*", txt)
|
||||
# Numbered with dot: "1." "2."
|
||||
r2 <- find_keys("(?:^|(?<=\\n)|(?<=\\.))\\s*\\d+\\.\\s+", txt)
|
||||
# Lettered: "A." followed by uppercase (not species names like "C. difficile")
|
||||
r3 <- find_keys("(?:^|(?<=\\n)|(?<=\\.)|(?<=\\s))\\s*[A-Z]\\.\\s+(?=[A-Z])", txt)
|
||||
# Numbered without dot (e.g. C. difficile style): digit space uppercase
|
||||
r4 <- find_keys("(?:^|(?<=\\n))\\d+\\s+(?=[A-Z])", txt)
|
||||
|
||||
all_keys <- rbind(r1, r2, r3, r4)
|
||||
if (nrow(all_keys) == 0) return(list())
|
||||
all_keys <- all_keys[order(all_keys$pos), ]
|
||||
|
||||
# Remove overlapping matches (keep longer/more specific)
|
||||
keep <- rep(TRUE, nrow(all_keys))
|
||||
for (i in seq_len(nrow(all_keys))) {
|
||||
if (!keep[i]) next
|
||||
for (j in seq_len(nrow(all_keys))) {
|
||||
if (i == j || !keep[j]) next
|
||||
if (all_keys$pos[j] >= all_keys$pos[i] &&
|
||||
all_keys$pos[j] < all_keys$pos[i] + all_keys$mlen[i]) {
|
||||
if (nchar(all_keys$key[i]) >= nchar(all_keys$key[j])) {
|
||||
keep[j] <- FALSE
|
||||
} else {
|
||||
keep[i] <- FALSE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
all_keys <- all_keys[keep, ]
|
||||
|
||||
# Build note lookup, allowing multiple bodies per key
|
||||
notes <- list()
|
||||
add_note <- function(key, body) {
|
||||
if (is.null(notes[[key]])) {
|
||||
notes[[key]] <<- body
|
||||
} else if (!body %in% notes[[key]]) {
|
||||
notes[[key]] <<- c(notes[[key]], body)
|
||||
}
|
||||
}
|
||||
|
||||
for (i in seq_len(nrow(all_keys))) {
|
||||
body_start <- all_keys$pos[i] + all_keys$mlen[i]
|
||||
body_end <- if (i < nrow(all_keys)) all_keys$pos[i + 1] - 1 else nchar(txt)
|
||||
body <- trimws(substr(txt, body_start, body_end))
|
||||
key <- all_keys$key[i]
|
||||
|
||||
if (grepl("/", key)) {
|
||||
subkeys <- unlist(strsplit(key, "/"))
|
||||
for (sk in subkeys) add_note(sk, body)
|
||||
add_note(key, body)
|
||||
} else {
|
||||
add_note(key, body)
|
||||
}
|
||||
}
|
||||
notes
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# 3. Note resolver
|
||||
# ==============================================================================
|
||||
resolve_notes <- function(notes_list, mic_super, disk_super) {
|
||||
nl <- notes_list
|
||||
if (is.null(nl) || length(nl) == 0) return(NA_character_)
|
||||
|
||||
mic_refs <- character(0)
|
||||
disk_refs <- character(0)
|
||||
if (!is.na(mic_super) && mic_super != "")
|
||||
mic_refs <- trimws(unlist(strsplit(mic_super, ",")))
|
||||
if (!is.na(disk_super) && disk_super != "")
|
||||
disk_refs <- trimws(unlist(strsplit(disk_super, ",")))
|
||||
all_refs <- unique(c(mic_refs, disk_refs))
|
||||
if (length(all_refs) == 0) return(NA_character_)
|
||||
|
||||
# Detect combined keys (e.g. "1/A")
|
||||
combined_keys <- grep("/", names(nl), value = TRUE)
|
||||
used_combined <- character(0)
|
||||
consumed_refs <- character(0)
|
||||
|
||||
for (ck in combined_keys) {
|
||||
parts <- unlist(strsplit(ck, "/"))
|
||||
if (all(parts %in% all_refs)) {
|
||||
used_combined <- c(used_combined, ck)
|
||||
consumed_refs <- c(consumed_refs, parts)
|
||||
}
|
||||
}
|
||||
|
||||
remaining_refs <- setdiff(all_refs, consumed_refs)
|
||||
|
||||
parts_out <- character(0)
|
||||
bodies_seen <- character(0)
|
||||
|
||||
# Combined notes
|
||||
for (ck in used_combined) {
|
||||
bodies <- nl[[ck]]
|
||||
if (!is.null(bodies)) {
|
||||
for (body in bodies) {
|
||||
if (!body %in% bodies_seen) {
|
||||
parts_out <- c(parts_out, paste0("[", ck, "] ", body))
|
||||
bodies_seen <- c(bodies_seen, body)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Remaining individual notes: prefer duplicated over missing
|
||||
for (ref in remaining_refs) {
|
||||
if (!is.null(nl[[ref]])) {
|
||||
for (body in nl[[ref]]) {
|
||||
# Include all notes, even if body was already seen under a combined key
|
||||
entry <- paste0("[", ref, "] ", body)
|
||||
if (!entry %in% parts_out) {
|
||||
parts_out <- c(parts_out, entry)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (length(parts_out) == 0) return(NA_character_)
|
||||
paste(parts_out, collapse = " | ")
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# 4. Cell helpers
|
||||
# ==============================================================================
|
||||
get_cell <- function(df, r, c) {
|
||||
hit <- df[df$row == r & df$col == c, ]
|
||||
if (nrow(hit) == 0) return(list(base = NA_character_, super = NA_character_))
|
||||
list(base = hit$base_text[1], super = hit$note_super[1])
|
||||
}
|
||||
|
||||
parse_bp <- function(txt) {
|
||||
if (is.na(txt) || txt == "") return(NA_real_)
|
||||
t <- trimws(txt)
|
||||
# if (toupper(t) %in% c("NOTE", "IE", "IP", "NA", "-")) return(NA_real_)
|
||||
if (toupper(t) %in% c("NA", "-")) return(NA_real_)
|
||||
t <- gsub("^\\((.+)\\)$", "\\1", t)
|
||||
# suppressWarnings(as.numeric(t))
|
||||
t
|
||||
}
|
||||
|
||||
is_screening_fn <- function(txt) {
|
||||
if (is.na(txt)) return(FALSE)
|
||||
grepl("^\\(.+\\)$", trimws(txt))
|
||||
}
|
||||
|
||||
format_disk_dose <- function(dose) {
|
||||
if (is.na(dose) || dose == "") return(NA_character_)
|
||||
d <- trimws(dose)
|
||||
if (grepl("mcg|unit", d, ignore.case = TRUE)) return(d)
|
||||
d <- gsub("-", "/", d)
|
||||
paste0(d, " mcg")
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# 5. Detect version and guideline from workbook
|
||||
# ==============================================================================
|
||||
detect_version <- function(cells) {
|
||||
# Version string is typically in col 5+ of row 1 (or sometimes col 9)
|
||||
# e.g. "EUCAST Clinical Breakpoint Tables v. 13.1, valid from 2023-06-29"
|
||||
version_cells <- cells |>
|
||||
filter(row == 1, !is_blank, col >= 5) |>
|
||||
mutate(text = coalesce(character, ""))
|
||||
version_text <- paste(version_cells$text, collapse = " ")
|
||||
|
||||
version <- regmatches(version_text,
|
||||
regexpr("v\\.?\\s*[\\d.]+", version_text, perl = TRUE))
|
||||
version <- gsub("v\\.?\\s*", "", version)
|
||||
if (length(version) == 0) version <- NA_character_
|
||||
|
||||
major <- suppressWarnings(as.integer(sub("\\..*", "", version)))
|
||||
guideline <- if (!is.na(major)) paste0("EUCAST ", major + 2010) else NA_character_
|
||||
|
||||
list(version = version, guideline = guideline)
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# 6. Main parser: parse a single sheet
|
||||
# ==============================================================================
|
||||
parse_sheet <- function(xlsx_path, sheet_name) {
|
||||
cells <- xlsx_cells(xlsx_path, sheets = sheet_name)
|
||||
|
||||
# --- Detect version ---
|
||||
ver <- detect_version(cells)
|
||||
|
||||
# --- Parse rich text for cols A:I ---
|
||||
target <- cells |> filter(col >= 1, col <= 9, !is_blank)
|
||||
rich <- split_rich_text(target$character_formatted)
|
||||
|
||||
parsed <- target |>
|
||||
bind_cols(rich) |>
|
||||
mutate(
|
||||
base_text = case_when(
|
||||
!is.na(base_text) & base_text != "" ~ trimws(base_text),
|
||||
!is.na(character) ~ trimws(character),
|
||||
!is.na(numeric) ~ as.character(numeric),
|
||||
TRUE ~ NA_character_
|
||||
),
|
||||
note_super = if_else(is.na(note_super) | note_super == "",
|
||||
NA_character_, note_super)
|
||||
) |>
|
||||
select(row, col, base_text, note_super)
|
||||
|
||||
# --- Detect header rows (col 2 contains "MIC breakpoint") ---
|
||||
header_rows <- parsed |>
|
||||
filter(col == 2, grepl("MIC breakpoint", base_text, fixed = TRUE)) |>
|
||||
pull(row) |>
|
||||
sort()
|
||||
|
||||
if (length(header_rows) == 0) {
|
||||
message(" No MIC breakpoint headers found in sheet '", sheet_name, "', skipping")
|
||||
return(NULL)
|
||||
}
|
||||
|
||||
# Sub-header rows: one row below each header (contains "S " pattern)
|
||||
sub_header_rows <- header_rows + 1
|
||||
|
||||
# --- Detect sheet type: single-organism vs multi-organism ---
|
||||
# Multi-organism: col A at header rows contains "Antimicrobial agent"
|
||||
header_col_a <- parsed |>
|
||||
filter(row %in% header_rows, col == 1) |>
|
||||
pull(base_text)
|
||||
|
||||
is_multi_organism <- all(grepl("Antimicrobial agent", header_col_a, fixed = TRUE))
|
||||
|
||||
# --- Detect organisms and their table ranges ---
|
||||
max_data_row <- max(parsed$row)
|
||||
|
||||
if (is_multi_organism) {
|
||||
# Multi-organism: discover organism names above each header row.
|
||||
# Organism name is a standalone row (col A only, no data in B:H)
|
||||
# found between the previous table's end and this header row.
|
||||
rows_with_b <- parsed |> filter(col == 2) |> pull(row)
|
||||
|
||||
tables <- list()
|
||||
for (i in seq_along(header_rows)) {
|
||||
hr <- header_rows[i]
|
||||
shr <- sub_header_rows[i]
|
||||
|
||||
# Search backwards from the header row for the organism name
|
||||
search_from <- if (i == 1) 1 else sub_header_rows[i - 1] + 1
|
||||
candidates <- parsed |>
|
||||
filter(col == 1, row >= search_from, row < hr,
|
||||
!row %in% rows_with_b) |>
|
||||
# Exclude known non-organism text patterns
|
||||
filter(!grepl("Antimicrobial|MIC determination|Disk diffusion|Breakpoints for|Expert Rules|For abbreviations|For species|Examples of|haze|Isolated|Ignore haemolysis|Numbered|Lettered|Medium:|Inoculum:|Incubation:|Reading:|Quality control:|See disk",
|
||||
base_text))
|
||||
|
||||
# Take the last candidate (closest to the header)
|
||||
if (nrow(candidates) > 0) {
|
||||
org_row <- candidates |> slice_max(row, n = 1)
|
||||
organism <- org_row$base_text
|
||||
} else {
|
||||
# Fallback: use sheet name
|
||||
organism <- sheet_name
|
||||
}
|
||||
|
||||
# Data range: from sub_header + 1 to the row before the next organism
|
||||
# or end of data
|
||||
first_data <- shr + 1
|
||||
if (i < length(header_rows)) {
|
||||
# End before the next organism name (or header)
|
||||
last_data <- header_rows[i + 1] - 1
|
||||
# Walk back to find actual last data row
|
||||
while (last_data >= first_data) {
|
||||
has_data <- nrow(parsed |> filter(row == last_data, col %in% 2:8)) > 0
|
||||
if (has_data) break
|
||||
last_data <- last_data - 1
|
||||
}
|
||||
} else {
|
||||
last_data <- max_data_row
|
||||
while (last_data >= first_data) {
|
||||
has_data <- nrow(parsed |> filter(row == last_data, col %in% 2:8)) > 0
|
||||
if (has_data) break
|
||||
last_data <- last_data - 1
|
||||
}
|
||||
}
|
||||
|
||||
# Notes cell: col 9, in the data range (usually at first_data, merged)
|
||||
note_cell <- parsed |> filter(col == 9, row >= first_data, row <= last_data) |>
|
||||
slice_min(row, n = 1)
|
||||
note_text <- if (nrow(note_cell) > 0) note_cell$base_text[1] else NA_character_
|
||||
notes_parsed <- parse_notes_block(note_text)
|
||||
|
||||
tables[[i]] <- list(organism = organism, first_data = first_data,
|
||||
last_data = last_data, notes = notes_parsed)
|
||||
}
|
||||
} else {
|
||||
# Single-organism: organism name from row 1, col A
|
||||
org_cell <- parsed |> filter(row == 1, col == 1)
|
||||
organism <- if (nrow(org_cell) > 0) org_cell$base_text[1] else sheet_name
|
||||
# Clean: remove trailing * or whitespace
|
||||
organism <- gsub("[*]+$", "", trimws(organism))
|
||||
|
||||
# Notes: col 9, within each class section
|
||||
# For single-organism sheets, there is one notes block per class.
|
||||
# Notes cell is at the header row or first data row of each class.
|
||||
tables <- list()
|
||||
for (i in seq_along(header_rows)) {
|
||||
hr <- header_rows[i]
|
||||
shr <- sub_header_rows[i]
|
||||
first_data <- shr + 1
|
||||
|
||||
if (i < length(header_rows)) {
|
||||
last_data <- header_rows[i + 1] - 1
|
||||
while (last_data >= first_data) {
|
||||
has_data <- nrow(parsed |> filter(row == last_data, col %in% 2:8)) > 0
|
||||
if (has_data) break
|
||||
last_data <- last_data - 1
|
||||
}
|
||||
} else {
|
||||
last_data <- max_data_row
|
||||
while (last_data >= first_data) {
|
||||
has_data <- nrow(parsed |> filter(row == last_data, col %in% 2:8)) > 0
|
||||
if (has_data) break
|
||||
last_data <- last_data - 1
|
||||
}
|
||||
}
|
||||
|
||||
# Notes: look in col 9 from header row through end of section
|
||||
note_cells <- parsed |>
|
||||
filter(col == 9, row >= hr, row <= last_data,
|
||||
!grepl("^Notes", base_text))
|
||||
note_text <- if (nrow(note_cells) > 0) {
|
||||
paste(note_cells$base_text, collapse = "\n")
|
||||
} else {
|
||||
NA_character_
|
||||
}
|
||||
notes_parsed <- parse_notes_block(note_text)
|
||||
|
||||
tables[[i]] <- list(organism = organism, first_data = first_data,
|
||||
last_data = last_data, notes = notes_parsed)
|
||||
}
|
||||
}
|
||||
|
||||
# --- Extract breakpoint rows ---
|
||||
results <- vector("list", 500)
|
||||
idx <- 0L
|
||||
|
||||
for (tbl in tables) {
|
||||
org <- tbl$organism
|
||||
nl <- tbl$notes
|
||||
|
||||
for (r in tbl$first_data:tbl$last_data) {
|
||||
agent <- get_cell(parsed, r, 1)
|
||||
if (is.na(agent$base)) next
|
||||
# Skip category headers (rows that have col A text but no data in B:H)
|
||||
has_any_data <- any(!is.na(c(
|
||||
get_cell(parsed, r, 2)$base,
|
||||
get_cell(parsed, r, 3)$base,
|
||||
get_cell(parsed, r, 5)$base,
|
||||
get_cell(parsed, r, 6)$base,
|
||||
get_cell(parsed, r, 7)$base
|
||||
)))
|
||||
if (!has_any_data) next
|
||||
|
||||
mic_s <- get_cell(parsed, r, 2)
|
||||
mic_r <- get_cell(parsed, r, 3)
|
||||
mic_atu <- get_cell(parsed, r, 4)
|
||||
disk_dose_cell <- get_cell(parsed, r, 5)
|
||||
disk_s <- get_cell(parsed, r, 6)
|
||||
disk_r <- get_cell(parsed, r, 7)
|
||||
disk_atu <- get_cell(parsed, r, 8)
|
||||
|
||||
note_text <- resolve_notes(nl, mic_s$super, disk_s$super)
|
||||
|
||||
# MIC row
|
||||
s_val <- parse_bp(mic_s$base)
|
||||
r_val <- parse_bp(mic_r$base)
|
||||
if (!is.na(s_val) || !is.na(r_val)) {
|
||||
idx <- idx + 1L
|
||||
results[[idx]] <- tibble(
|
||||
guideline = ver$guideline,
|
||||
version = ver$version,
|
||||
type = "human",
|
||||
host = "human",
|
||||
method = "MIC",
|
||||
site = NA_character_,
|
||||
mo = org,
|
||||
rank_index = NA_integer_,
|
||||
ab = agent$base,
|
||||
ref_tbl = org,
|
||||
disk_dose = NA_character_,
|
||||
breakpoint_S = s_val,
|
||||
breakpoint_R = r_val,
|
||||
uti = FALSE,
|
||||
is_SDD = FALSE,
|
||||
is_screening = is_screening_fn(mic_s$base),
|
||||
note = note_text
|
||||
)
|
||||
}
|
||||
|
||||
# DISK row
|
||||
s_val <- parse_bp(disk_s$base)
|
||||
r_val <- parse_bp(disk_r$base)
|
||||
if (!is.na(s_val) || !is.na(r_val)) {
|
||||
idx <- idx + 1L
|
||||
results[[idx]] <- tibble(
|
||||
guideline = ver$guideline,
|
||||
version = ver$version,
|
||||
type = "human",
|
||||
host = "human",
|
||||
method = "DISK",
|
||||
site = NA_character_,
|
||||
mo = org,
|
||||
rank_index = NA_integer_,
|
||||
ab = agent$base,
|
||||
ref_tbl = org,
|
||||
disk_dose = format_disk_dose(disk_dose_cell$base),
|
||||
breakpoint_S = s_val,
|
||||
breakpoint_R = r_val,
|
||||
uti = FALSE,
|
||||
is_SDD = FALSE,
|
||||
is_screening = is_screening_fn(disk_s$base),
|
||||
note = note_text
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (idx == 0) return(NULL)
|
||||
bind_rows(results[seq_len(idx)])
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# 7. Parse "Topical agents" sheet (transposed layout)
|
||||
# ==============================================================================
|
||||
parse_topical_sheet <- function(xlsx_path) {
|
||||
cells <- xlsx_cells(xlsx_path, sheets = "Topical agents")
|
||||
|
||||
ver <- detect_version(cells)
|
||||
|
||||
target <- cells |> filter(!is_blank)
|
||||
rich <- split_rich_text(target$character_formatted)
|
||||
parsed <- target |>
|
||||
bind_cols(rich) |>
|
||||
mutate(
|
||||
base_text = case_when(
|
||||
!is.na(base_text) & base_text != "" ~ trimws(base_text),
|
||||
!is.na(character) ~ trimws(character),
|
||||
!is.na(numeric) ~ as.character(numeric),
|
||||
TRUE ~ NA_character_
|
||||
),
|
||||
note_super = if_else(is.na(note_super) | note_super == "",
|
||||
NA_character_, note_super)
|
||||
) |>
|
||||
select(row, col, base_text, note_super)
|
||||
|
||||
# Antimicrobial names from row 6, cols 4:18
|
||||
ab_cols <- 4:18
|
||||
ab_info <- list()
|
||||
for (col_idx in ab_cols) {
|
||||
name_cell <- get_cell(parsed, 6, col_idx)
|
||||
dose_cell <- get_cell(parsed, 10, col_idx)
|
||||
if (is.na(name_cell$base)) next
|
||||
ab_info[[as.character(col_idx)]] <- list(
|
||||
name = gsub("\r\n", " ", name_cell$base),
|
||||
name_super = name_cell$super,
|
||||
dose = if (!is.na(dose_cell$base) && !dose_cell$base %in% c("-", "ND"))
|
||||
paste0(dose_cell$base, " mcg") else NA_character_
|
||||
)
|
||||
}
|
||||
|
||||
# Organism rows: col 1 from row 11 onwards, excluding "Notes"
|
||||
org_cells <- parsed |>
|
||||
filter(col == 1, row >= 11, !grepl("^Notes", base_text))
|
||||
|
||||
organism_pairs <- list()
|
||||
for (i in seq_len(nrow(org_cells))) {
|
||||
mic_row <- org_cells$row[i]
|
||||
disk_row <- mic_row + 1
|
||||
mic_check <- get_cell(parsed, mic_row, 2)
|
||||
disk_check <- get_cell(parsed, disk_row, 2)
|
||||
if (is.na(mic_check$base) || !grepl("MIC", mic_check$base)) next
|
||||
if (is.na(disk_check$base) || !grepl("Zone", disk_check$base)) next
|
||||
organism_pairs[[length(organism_pairs) + 1]] <- list(
|
||||
organism = gsub("\r\n", " ", org_cells$base_text[i]),
|
||||
mic_row = mic_row, disk_row = disk_row
|
||||
)
|
||||
}
|
||||
|
||||
# Notes: find in col 1, rows after the last organism data row
|
||||
last_data_row <- if (length(organism_pairs) > 0)
|
||||
max(vapply(organism_pairs, function(x) x$disk_row, numeric(1))) else 0L
|
||||
notes_cells <- parsed |>
|
||||
filter(col == 1, row > last_data_row, !grepl("^Notes$", base_text))
|
||||
notes_text <- if (nrow(notes_cells) > 0)
|
||||
paste(notes_cells$base_text, collapse = "\n") else ""
|
||||
if (is.na(notes_text)) notes_text <- ""
|
||||
notes_lookup <- parse_notes_block(notes_text)
|
||||
|
||||
results <- vector("list", 200)
|
||||
idx <- 0L
|
||||
|
||||
for (od in organism_pairs) {
|
||||
for (col_idx in ab_cols) {
|
||||
cc <- as.character(col_idx)
|
||||
if (is.null(ab_info[[cc]])) next
|
||||
ab_entry <- ab_info[[cc]]
|
||||
ab_name <- ab_entry$name
|
||||
ab_super <- ab_entry$name_super
|
||||
ab_dose <- ab_entry$dose
|
||||
|
||||
# MIC
|
||||
mic_cell <- get_cell(parsed, od$mic_row, col_idx)
|
||||
mic_val <- parse_bp(mic_cell$base)
|
||||
# Combine superscripts from the cell and the agent name
|
||||
all_supers <- c(mic_cell$super, ab_super)
|
||||
all_supers <- all_supers[!is.na(all_supers) & all_supers != ""]
|
||||
mic_note <- resolve_notes(notes_lookup, paste(all_supers, collapse = ","), NA)
|
||||
|
||||
if (!is.na(mic_val)) {
|
||||
idx <- idx + 1L
|
||||
results[[idx]] <- tibble(
|
||||
guideline = ver$guideline, version = ver$version,
|
||||
type = "human", host = "human", method = "MIC",
|
||||
site = "Topical", mo = od$organism, rank_index = NA_integer_,
|
||||
ab = ab_name, ref_tbl = "Topical agents",
|
||||
disk_dose = NA_character_,
|
||||
breakpoint_S = mic_val, breakpoint_R = mic_val,
|
||||
uti = FALSE, is_SDD = FALSE, is_screening = TRUE,
|
||||
note = mic_note
|
||||
)
|
||||
}
|
||||
|
||||
# DISK
|
||||
disk_cell <- get_cell(parsed, od$disk_row, col_idx)
|
||||
disk_val <- parse_bp(disk_cell$base)
|
||||
all_supers_d <- c(disk_cell$super, ab_super)
|
||||
all_supers_d <- all_supers_d[!is.na(all_supers_d) & all_supers_d != ""]
|
||||
disk_note <- resolve_notes(notes_lookup, NA, paste(all_supers_d, collapse = ","))
|
||||
|
||||
if (!is.na(disk_val)) {
|
||||
idx <- idx + 1L
|
||||
results[[idx]] <- tibble(
|
||||
guideline = ver$guideline, version = ver$version,
|
||||
type = "human", host = "human", method = "DISK",
|
||||
site = "Topical", mo = od$organism, rank_index = NA_integer_,
|
||||
ab = ab_name, ref_tbl = "Topical agents",
|
||||
disk_dose = ab_dose,
|
||||
breakpoint_S = disk_val, breakpoint_R = disk_val,
|
||||
uti = FALSE, is_SDD = FALSE, is_screening = TRUE,
|
||||
note = disk_note
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (idx == 0) return(NULL)
|
||||
bind_rows(results[seq_len(idx)])
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# 8. Parse all data sheets
|
||||
# ==============================================================================
|
||||
parse_workbook <- function(xlsx_path,
|
||||
skip_sheets = c("Content", "Changes", "Notes",
|
||||
"Guidance", "Dosages",
|
||||
"Technical uncertainty",
|
||||
"Non-species related breakpoints",
|
||||
"PKPD breakpoints",
|
||||
"PK PD breakpoints")) {
|
||||
all_sheets <- xlsx_sheet_names(xlsx_path)
|
||||
data_sheets <- setdiff(all_sheets, skip_sheets)
|
||||
|
||||
results <- list()
|
||||
for (s in data_sheets) {
|
||||
message("Parsing ", basename(xlsx_path), ": ", s)
|
||||
res <- tryCatch({
|
||||
if (s == "Topical agents") {
|
||||
parse_topical_sheet(xlsx_path)
|
||||
} else {
|
||||
parse_sheet(xlsx_path, s)
|
||||
}
|
||||
},
|
||||
error = function(e) {
|
||||
message(" ERROR: ", conditionMessage(e))
|
||||
NULL
|
||||
})
|
||||
if (!is.null(res) && nrow(res) > 0) {
|
||||
res$sheet <- s
|
||||
results[[s]] <- res
|
||||
message(" -> ", nrow(res), " rows")
|
||||
}
|
||||
}
|
||||
|
||||
bind_rows(results)
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# 8. Run
|
||||
# ==============================================================================
|
||||
|
||||
breakpoint_files <- list.files(path = "data-raw",
|
||||
pattern = "breakpoint_table.*xlsx",
|
||||
full.names = TRUE,
|
||||
recursive = FALSE,
|
||||
ignore.case = TRUE)
|
||||
breakpoint_files <- breakpoint_files[breakpoint_files %unlike% "dosages"]
|
||||
|
||||
breakpoints_eucast <- tibble()
|
||||
|
||||
for (xlsx_path in breakpoint_files) {
|
||||
|
||||
message("Parsing ", basename(xlsx_path))
|
||||
result <- suppressMessages(parse_workbook(xlsx_path))
|
||||
|
||||
# cat("\n============================\n")
|
||||
cat("Total rows:", nrow(result), "\n\n")
|
||||
# glimpse(result)
|
||||
|
||||
# cat("\n--- Rows per sheet ---\n")
|
||||
# result |> count(sheet) |> print(n = 40)
|
||||
|
||||
# cat("\n--- Rows per organism (top 20) ---\n")
|
||||
# result |> count(mo) |> arrange(desc(n)) |> head(20) |> print()
|
||||
|
||||
breakpoints_eucast <- breakpoints_eucast |>
|
||||
bind_rows(result)
|
||||
|
||||
# saveRDS(result, "/home/claude/eucast_all_breakpoints.rds")
|
||||
# write.csv(result, "/home/claude/eucast_all_breakpoints.csv", row.names = FALSE)
|
||||
# cat("\nSaved.\n")
|
||||
}
|
||||
|
||||
breakpoints_eucast_raw <- breakpoints_eucast
|
||||
|
||||
saveRDS(breakpoints_eucast_raw, "data-raw/breakpoints_eucast_raw.rds")
|
||||
write.csv(breakpoints_eucast_raw, "data-raw/breakpoints_eucast_raw.csv", row.names = FALSE)
|
||||
|
||||
breakpoints_eucast <- breakpoints_eucast_raw |>
|
||||
filter(!breakpoint_S %in% c("NOTE", "IE", "IP", "NA", "-"),
|
||||
!breakpoint_R %in% c("NOTE", "IE", "IP", "NA", "-")) |>
|
||||
mutate(breakpoint_S = as.numeric(breakpoint_S),
|
||||
breakpoint_R = as.numeric(breakpoint_R),
|
||||
uti = uti | ab %like_case% "UTI") |>
|
||||
filter(!(is.na(breakpoint_S) & is.na(breakpoint_R)))
|
||||
|
||||
breakpoints_eucast %>% count(guideline, version)
|
||||
@@ -35,13 +35,13 @@ for (i in seq_len(nrow(antimicrobials))) {
|
||||
colnames(int_resis)[ncol(int_resis)] <- antimicrobials$ab[i]
|
||||
}
|
||||
|
||||
int_resis <- interpretive_rules(int_resis,
|
||||
interpretive_rules_df = subset(
|
||||
AMR:::INTERPRETIVE_RULES_DF,
|
||||
is.na(have_these_values) & reference.rule_group == "Expected phenotypes" & reference.version == 1.2
|
||||
),
|
||||
overwrite = TRUE,
|
||||
info = FALSE
|
||||
int_resis <- eucast_rules(int_resis,
|
||||
eucast_rules_df = subset(
|
||||
AMR:::EUCAST_RULES_DF,
|
||||
is.na(have_these_values) & reference.rule_group == "Expected phenotypes" & reference.version == 1.2
|
||||
),
|
||||
overwrite = TRUE,
|
||||
info = FALSE
|
||||
)
|
||||
|
||||
int_resis2 <- int_resis[, sapply(int_resis, function(x) any(!is.sir(x) | x == "R")), drop = FALSE] %>%
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,7 @@
|
||||
# how to conduct AMR data analysis: https://amr-for-r.org #
|
||||
# ==================================================================== #
|
||||
|
||||
# This data set is being referenced from in the clinical_breakpoints data set, and also by as.sir().
|
||||
# This data set is being used in the clinical_breakpoints data set, and thus by as.sir().
|
||||
# It prevents the breakpoints table from being extremely long for species that are part of a species group.
|
||||
# Also used by eucast_rules() to expand group names.
|
||||
|
||||
@@ -36,6 +36,10 @@ library(readr)
|
||||
library(tidyr)
|
||||
devtools::load_all()
|
||||
|
||||
# Install the WHONET software on Windows (http://www.whonet.org/software.html),
|
||||
# and copy the folder C:\WHONET\Resources to the data-raw/WHONET/ folder
|
||||
|
||||
|
||||
# BACTERIAL COMPLEXES
|
||||
# find all bacterial complex in the NCBI Taxonomy Browser here:
|
||||
# https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Undef&id=2&lvl=6&lin=f&keep=1&srchmode=1&unlock
|
||||
@@ -44,14 +48,9 @@ devtools::load_all()
|
||||
|
||||
# READ DATA ----
|
||||
|
||||
# files are retrieved from https://github.com/AClark-WHONET/AMRIE
|
||||
|
||||
github_repo <- "https://raw.github.com/AClark-WHONET/AMRIE/main/Interpretation%20Engine/Resources"
|
||||
file_organisms <- file.path(github_repo, "Organisms.txt")
|
||||
|
||||
whonet_organisms <- read_tsv(file_organisms, na = c("", "NA", "-"), show_col_types = FALSE, guess_max = Inf) |>
|
||||
whonet_organisms <- read_tsv("data-raw/WHONET/Resources/Organisms.txt", na = c("", "NA", "-"), show_col_types = FALSE) %>%
|
||||
# remove old taxonomic names
|
||||
filter(TAXONOMIC_STATUS == "C") |>
|
||||
filter(TAXONOMIC_STATUS == "C") %>%
|
||||
mutate(ORGANISM_CODE = toupper(WHONET_ORG_CODE))
|
||||
|
||||
whonet_organisms <- whonet_organisms %>%
|
||||
@@ -59,101 +58,72 @@ whonet_organisms <- whonet_organisms %>%
|
||||
mutate(
|
||||
# this one was called Issatchenkia orientalis, but it should be:
|
||||
ORGANISM = if_else(ORGANISM_CODE == "ckr", "Candida krusei", ORGANISM)
|
||||
) %>%
|
||||
) %>%
|
||||
# try to match on GBIF identifier
|
||||
left_join(microorganisms %>% distinct(mo, gbif, status) %>% filter(!is.na(gbif)), by = c("GBIF_TAXON_ID" = "gbif")) %>%
|
||||
left_join(microorganisms %>% distinct(mo, gbif, status) %>% filter(!is.na(gbif)), by = c("GBIF_TAXON_ID" = "gbif")) %>%
|
||||
# remove duplicates
|
||||
arrange(ORGANISM_CODE, GBIF_TAXON_ID, status) %>%
|
||||
distinct(ORGANISM_CODE, .keep_all = TRUE) %>%
|
||||
distinct(ORGANISM_CODE, .keep_all = TRUE) %>%
|
||||
# add Enterobacterales, which is a subkingdom code in their data
|
||||
bind_rows(data.frame(ORGANISM_CODE = "ebc", ORGANISM = "Enterobacterales", mo = as.mo("Enterobacterales"))) %>%
|
||||
bind_rows(data.frame(ORGANISM_CODE = "ebc", ORGANISM = "Enterobacterales", mo = as.mo("Enterobacterales"))) %>%
|
||||
arrange(ORGANISM)
|
||||
|
||||
# check non-existing species groups in the microorganisms table
|
||||
whonet_organisms %>%
|
||||
filter(!is.na(SPECIES_GROUP)) %>%
|
||||
group_by(SPECIES_GROUP) %>%
|
||||
summarise(
|
||||
complex = ORGANISM[ORGANISM %like% " (group|complex)"][1],
|
||||
organisms = paste0(n(), ": ", paste(sort(unique(ORGANISM)), collapse = ", "))
|
||||
) %>%
|
||||
summarise(complex = ORGANISM[ORGANISM %like% " (group|complex)"][1],
|
||||
organisms = paste0(n(), ": ", paste(sort(unique(ORGANISM)), collapse = ", "))) %>%
|
||||
filter(!SPECIES_GROUP %in% microorganisms.codes$code)
|
||||
|
||||
# create the species group data set ----
|
||||
microorganisms.groups <- whonet_organisms %>%
|
||||
# these will not be translated well
|
||||
filter(!ORGANISM %in% c(
|
||||
"Trueperella pyogenes-like bacteria",
|
||||
"Mycobacterium suricattae",
|
||||
"Mycobacterium canetti"
|
||||
)) %>%
|
||||
filter(!ORGANISM %in% c("Trueperella pyogenes-like bacteria",
|
||||
"Mycobacterium suricattae",
|
||||
"Mycobacterium canetti")) %>%
|
||||
filter(!is.na(SPECIES_GROUP), SPECIES_GROUP != ORGANISM_CODE) %>%
|
||||
transmute(
|
||||
mo_group = as.mo(SPECIES_GROUP),
|
||||
mo = ifelse(is.na(mo),
|
||||
as.character(as.mo(ORGANISM, keep_synonyms = TRUE, minimum_matching_score = 0)),
|
||||
mo
|
||||
)
|
||||
) %>%
|
||||
# add our own CoNS and CoPS, WHONET does not strictly follow Becker et al. (2014, 2019, 2020)
|
||||
filter(mo_group != as.mo("CoNS")) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("CoNS"), mo = MO_CONS)) %>%
|
||||
filter(mo_group != as.mo("CoPS")) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("CoPS"), mo = MO_COPS)) %>%
|
||||
transmute(mo_group = as.mo(SPECIES_GROUP),
|
||||
mo = ifelse(is.na(mo),
|
||||
as.character(as.mo(ORGANISM, keep_synonyms = TRUE, minimum_matching_score = 0)),
|
||||
mo)) %>%
|
||||
# add our own CoNS and CoPS, WHONET does not strictly follow Becker et al (2014, 2019, 2020)
|
||||
filter(mo_group != as.mo("CoNS")) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("CoNS"), mo = MO_CONS)) %>%
|
||||
filter(mo_group != as.mo("CoPS")) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("CoPS"), mo = MO_COPS)) %>%
|
||||
# at least all our Lancefield-grouped streptococci must be in the beta-haemolytic group:
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Beta-haemolytic streptococcus"),
|
||||
mo = c(
|
||||
MO_LANCEFIELD,
|
||||
microorganisms %>% filter(fullname %like% "^Streptococcus Group") %>% pull(mo)
|
||||
)
|
||||
)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("Beta-haemolytic streptococcus"),
|
||||
mo = c(MO_LANCEFIELD,
|
||||
microorganisms %>% filter(fullname %like% "^Streptococcus Group") %>% pull(mo)))) %>%
|
||||
# and per Streptococcus group as well:
|
||||
# group A - S. pyogenes
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group A"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_PYGN(_|$)")]
|
||||
)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("Streptococcus Group A"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_PYGN(_|$)")])) %>%
|
||||
# group B - S. agalactiae
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group B"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_AGLC(_|$)")]
|
||||
)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("Streptococcus Group B"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_AGLC(_|$)")])) %>%
|
||||
# group C - all subspecies within S. dysgalactiae and S. equi (such as S. equi zooepidemicus)
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group C"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(DYSG|EQUI)(_|$)")]
|
||||
)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("Streptococcus Group C"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(DYSG|EQUI)(_|$)")])) %>%
|
||||
# group F - Milleri group == S. anginosus group, which incl. S. anginosus, S. constellatus, S. intermedius
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group F"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(ANGN|CNST|INTR)(_|$)")]
|
||||
)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("Streptococcus Group F"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(ANGN|CNST|INTR)(_|$)")])) %>%
|
||||
# group G - S. dysgalactiae and S. canis (though dysgalactiae is also group C and will be matched there)
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group G"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(DYSG|CANS)(_|$)")]
|
||||
)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("Streptococcus Group G"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(DYSG|CANS)(_|$)")])) %>%
|
||||
# group H - S. sanguinis
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group H"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_SNGN(_|$)")]
|
||||
)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("Streptococcus Group H"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_SNGN(_|$)")])) %>%
|
||||
# group K - S. salivarius, incl. S. salivarius salivariuss and S. salivarius thermophilus
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group K"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_SLVR(_|$)")]
|
||||
)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("Streptococcus Group K"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_SLVR(_|$)")])) %>%
|
||||
# group L - only S. dysgalactiae
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group L"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_DYSG(_|$)")]
|
||||
)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("Streptococcus Group L"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_DYSG(_|$)")])) %>%
|
||||
# and for EUCAST: Strep group A, B, C, G
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("Streptococcus Group A, B, C, G"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(PYGN|AGLC|DYSG|EQUI|CANS|GRPA|GRPB|GRPC|GRPG)(_|$)")]
|
||||
)) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("Streptococcus Group A, B, C, G"),
|
||||
mo = microorganisms$mo[which(microorganisms$mo %like% "^B_STRPT_(PYGN|AGLC|DYSG|EQUI|CANS|GRPA|GRPB|GRPC|GRPG)(_|$)")])) %>%
|
||||
# HACEK is:
|
||||
# - Haemophilus species
|
||||
# - Aggregatibacter species
|
||||
@@ -162,46 +132,38 @@ microorganisms.groups <- whonet_organisms %>%
|
||||
# - Kingella species
|
||||
# - and previously Actinobacillus actinomycetemcomitans
|
||||
# see https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3656887/
|
||||
filter(mo_group != as.mo("HACEK")) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = microorganisms %>% filter(genus == "Haemophilus") %>% pull(mo))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = microorganisms %>% filter(genus == "Aggregatibacter") %>% pull(mo))) %>%
|
||||
filter(mo_group != as.mo("HACEK")) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = microorganisms %>% filter(genus == "Haemophilus") %>% pull(mo))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = microorganisms %>% filter(genus == "Aggregatibacter") %>% pull(mo))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = as.mo("Cardiobacterium hominis", keep_synonyms = TRUE))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = as.mo("Eikenella corrodens", keep_synonyms = TRUE))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = microorganisms %>% filter(genus == "Kingella") %>% pull(mo))) %>%
|
||||
bind_rows(tibble(mo_group = as.mo("HACEK"), mo = as.mo("Actinobacillus actinomycetemcomitans", keep_synonyms = TRUE))) %>%
|
||||
# Citrobacter freundii complex in the NCBI Taxonomy Browser:
|
||||
# https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=1344959
|
||||
filter(mo_group != "B_CTRBC_FRND-C") %>%
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("B_CTRBC_FRND-C"),
|
||||
mo = paste("Citrobacter", c("freundii", "braakii", "gillenii", "murliniae", "portucalensis", "sedlakii", "werkmanii", "youngae")) %>% as.mo(keep_synonyms = TRUE)
|
||||
)) %>%
|
||||
filter(mo_group != "B_CTRBC_FRND-C") %>%
|
||||
bind_rows(tibble(mo_group = as.mo("B_CTRBC_FRND-C"),
|
||||
mo = paste("Citrobacter", c("freundii", "braakii", "gillenii", "murliniae", "portucalensis", "sedlakii", "werkmanii", "youngae")) %>% as.mo(keep_synonyms = TRUE))) %>%
|
||||
# Klebsiella pneumoniae complex
|
||||
filter(mo_group != "B_KLBSL_PNMN-C") %>%
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("B_KLBSL_PNMN-C"),
|
||||
mo = paste("Klebsiella", c("africana", "pneumoniae", "quasipneumoniae", "quasivariicola", "variicola")) %>% as.mo(keep_synonyms = TRUE)
|
||||
)) %>%
|
||||
filter(mo_group != "B_KLBSL_PNMN-C") %>%
|
||||
bind_rows(tibble(mo_group = as.mo("B_KLBSL_PNMN-C"),
|
||||
mo = paste("Klebsiella", c("africana", "pneumoniae", "quasipneumoniae", "quasivariicola", "variicola")) %>% as.mo(keep_synonyms = TRUE))) %>%
|
||||
# Yersinia pseudotuberculosis complex in the NCBI Taxonomy Browser:
|
||||
# https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=1649845
|
||||
filter(mo_group != "B_YERSN_PSDT-C") %>%
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("B_YERSN_PSDT-C"),
|
||||
mo = paste("Yersinia", c("pseudotuberculosis", "pestis", "similis", "wautersii")) %>% as.mo(keep_synonyms = TRUE)
|
||||
)) %>%
|
||||
# RGM are Rapidly-growing Mycobacteria, see https://pubmed.ncbi.nlm.nih.gov/28084211/
|
||||
filter(mo_group != "B_MYCBC_RGM") %>%
|
||||
bind_rows(tibble(
|
||||
mo_group = as.mo("B_MYCBC_RGM"),
|
||||
mo = paste("Mycobacterium", c("abscessus abscessus", "abscessus bolletii", "abscessus massiliense", "agri", "aichiense", "algericum", "alvei", "anyangense", "arabiense", "aromaticivorans", "aubagnense", "aubagnense", "aurum", "austroafricanum", "bacteremicum", "boenickei", "bourgelatii", "brisbanense", "brumae", "canariasense", "celeriflavum", "chelonae", "chitae", "chlorophenolicum", "chubuense", "confluentis", "cosmeticum", "crocinum", "diernhoferi", "duvalii", "elephantis", "fallax", "flavescens", "fluoranthenivorans", "fortuitum", "franklinii", "frederiksbergense", "gadium", "gilvum", "goodii", "hassiacum", "hippocampi", "hodleri", "holsaticum", "houstonense", "immunogenum", "insubricum", "iranicum", "komossense", "litorale", "llatzerense", "madagascariense", "mageritense", "monacense", "moriokaense", "mucogenicum", "mucogenicum", "murale", "neoaurum", "neworleansense", "novocastrense", "obuense", "pallens", "parafortuitum", "peregrinum", "phlei", "phocaicum", "phocaicum", "porcinum", "poriferae", "psychrotolerans", "pyrenivorans", "rhodesiae", "rufum", "rutilum", "salmoniphilum", "sediminis", "senegalense", "septicum", "setense", "smegmatis", "sphagni", "thermoresistibile", "tokaiense", "vaccae", "vanbaalenii", "wolinskyi")) %>% as.mo(keep_synonyms = TRUE)
|
||||
))
|
||||
filter(mo_group != "B_YERSN_PSDT-C") %>%
|
||||
bind_rows(tibble(mo_group = as.mo("B_YERSN_PSDT-C"),
|
||||
mo = paste("Yersinia", c("pseudotuberculosis", "pestis", "similis", "wautersii")) %>% as.mo(keep_synonyms = TRUE))) %>%
|
||||
# RGM are Rapidly-grwoing Mycobacteria, see https://pubmed.ncbi.nlm.nih.gov/28084211/
|
||||
filter(mo_group != "B_MYCBC_RGM") %>%
|
||||
bind_rows(tibble(mo_group = as.mo("B_MYCBC_RGM"),
|
||||
mo = paste("Mycobacterium", c( "abscessus abscessus", "abscessus bolletii", "abscessus massiliense", "agri", "aichiense", "algericum", "alvei", "anyangense", "arabiense", "aromaticivorans", "aubagnense", "aubagnense", "aurum", "austroafricanum", "bacteremicum", "boenickei", "bourgelatii", "brisbanense", "brumae", "canariasense", "celeriflavum", "chelonae", "chitae", "chlorophenolicum", "chubuense", "confluentis", "cosmeticum", "crocinum", "diernhoferi", "duvalii", "elephantis", "fallax", "flavescens", "fluoranthenivorans", "fortuitum", "franklinii", "frederiksbergense", "gadium", "gilvum", "goodii", "hassiacum", "hippocampi", "hodleri", "holsaticum", "houstonense", "immunogenum", "insubricum", "iranicum", "komossense", "litorale", "llatzerense", "madagascariense", "mageritense", "monacense", "moriokaense", "mucogenicum", "mucogenicum", "murale", "neoaurum", "neworleansense", "novocastrense", "obuense", "pallens", "parafortuitum", "peregrinum", "phlei", "phocaicum", "phocaicum", "porcinum", "poriferae", "psychrotolerans", "pyrenivorans", "rhodesiae", "rufum", "rutilum", "salmoniphilum", "sediminis", "senegalense", "septicum", "setense", "smegmatis", "sphagni", "thermoresistibile", "tokaiense", "vaccae", "vanbaalenii", "wolinskyi")) %>% as.mo(keep_synonyms = TRUE)))
|
||||
|
||||
# add subspecies to all species
|
||||
for (group in unique(microorganisms.groups$mo_group)) {
|
||||
spp <- microorganisms.groups %>%
|
||||
filter(mo_group == group & mo_rank(mo, keep_synonyms = TRUE) == "species") %>%
|
||||
pull(mo) %>%
|
||||
paste0(collapse = "|") %>%
|
||||
filter(mo_group == group & mo_rank(mo, keep_synonyms = TRUE) == "species") %>%
|
||||
pull(mo) %>%
|
||||
paste0(collapse = "|") %>%
|
||||
paste0("^(", ., ")")
|
||||
mos <- microorganisms %>%
|
||||
filter(mo %like% spp & rank == "subspecies") %>%
|
||||
@@ -212,11 +174,9 @@ for (group in unique(microorganisms.groups$mo_group)) {
|
||||
|
||||
# add full names, arrange and clean
|
||||
microorganisms.groups <- microorganisms.groups %>%
|
||||
mutate(
|
||||
mo_group_name = mo_name(mo_group, keep_synonyms = TRUE, language = NULL),
|
||||
mo_name = mo_name(mo, keep_synonyms = TRUE, language = NULL)
|
||||
) %>%
|
||||
arrange(mo_group_name, mo_name) %>%
|
||||
mutate(mo_group_name = mo_name(mo_group, keep_synonyms = TRUE, language = NULL),
|
||||
mo_name = mo_name(mo, keep_synonyms = TRUE, language = NULL)) %>%
|
||||
arrange(mo_group_name, mo_name) %>%
|
||||
filter(mo_group != mo) %>%
|
||||
distinct() %>%
|
||||
dataset_UTF8_to_ASCII()
|
||||
|
||||
@@ -1 +1 @@
|
||||
11aade8a39bfdff02d01fb52b04eacdc
|
||||
228840b3941753c4adee2b781d901590
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1 +1 @@
|
||||
634c5e23bed1e92783eeb4739c0d1486
|
||||
c7062e60fa4fbc2eee233044d15903ce
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,506 +1,498 @@
|
||||
"ab" "cid" "name" "group" "atc" "atc_group1" "atc_group2" "abbreviations" "synonyms" "oral_ddd" "oral_units" "iv_ddd" "iv_units" "loinc"
|
||||
"AMA" 4649 "4-aminosalicylic acid" "Antimycobacterials" "J04AA01" "Drugs for treatment of tuberculosis" "Aminosalicylic acid and derivatives" "NA" "aminacyl,aminopar,aminosalyl,aminox,apacil,deapasil,entepas,gabbropas,granupas,helipidyl,hellipidyl,nemasol,nippas,osacyl,pamacyl,pamisyl,paramisan,paramycin,parasal,parasalicil,parasalindon,pasade,pasalon,pasara,pascorbic,pasdium,pasem,paser,pasmed,pasnal,pasnodia,pasolac,passodico,pharmakon,propasa,rezipas,salvis,sanipirol,sanipriol,sodiopas,spectrum" 12 "g" "NA"
|
||||
"ACM" 6450012 "Acetylmidecamycin" "Macrolides" "NA" "NA" "NA" "NA"
|
||||
"ASP" 49787020 "Acetylspiramycin" "Macrolides" "NA" "NA" "espiramicin,espiramicina,foromacidin,provamycin,rovamicina,rovamycin,rovamycine,selectomycin,sequamycin,spiramycine,spiramycinum" "NA"
|
||||
"ALS" 8954 "Aldesulfone sodium" "Other" "J04BA03" "Drugs for treatment of lepra" "Drugs for treatment of lepra" "NA" "adesulfone,aldapsone,aldesulfone,aldesulphone,diamidin,diason,diasone,diasoneenterab,diazon,didimethanesulfinate,novotrone,sulfoxone" 0.33 "g" "NA"
|
||||
"ACM" 6450012 "Acetylmidecamycin" "Macrolides/lincosamides" "NA" "NA" "NA" "NA"
|
||||
"ASP" 49787020 "Acetylspiramycin" "Macrolides/lincosamides" "NA" "NA" "antibiotic,espiramicin,espiramicina,foromacidin,provamycin,rovamicina,rovamycin,rovamycine,selectomycin,sequamycin,spiramycine,spiramycinum" "NA"
|
||||
"ALS" 8954 "Aldesulfone sodium" "Other antibacterials" "J04BA03" "Drugs for treatment of lepra" "Drugs for treatment of lepra" "NA" "adesulfone,aldapsone,aldesulfone,aldesulphone,diamidin,diason,diasone,diasoneenterab,diazon,didimethanesulfinate,novotrone,sulfoxone" 0.33 "g" "NA"
|
||||
"AMK" 37768 "Amikacin" "Aminoglycosides" "D06AX12,J01GB06,QD06AX12,QJ01GB06,QS01AA21,S01AA21" "Aminoglycoside antibacterials" "Other aminoglycosides" "ak,ami,amik,amikac,amk,an" "amikacillin,amikacina,amikacine,amikacinum,amikavet,amikin,amikozit,amukin,arikace,briclin,butirosins,kaminax,lukadin,mikavir,potentox,prestwick" 1 "g" "101493-5,11-7,12-5,13-3,13546-7,14-1,15098-7,17798-0,18860-7,20373-7,23624-0,25174-4,25175-1,25176-9,25177-7,25178-5,25179-3,31097-9,31098-7,31099-5,3319-1,3320-9,3321-7,35669-1,42642-9,48169-7,50802-8,50803-6,56628-1,59378-0,60564-2,60565-9,6975-7,80972-3,89484-0"
|
||||
"AKF" "Amikacin/fosfomycin" "Aminoglycosides,Phosphonics" "NA" "NA" "NA" "NA"
|
||||
"AMO" 54260 "Amorolfine" "Antifungals" "D01AE16,QD01AE16" "Antifungals for topical use" "Other antifungals for topical use" "amor" "amorolfina,amorolfinum,bekiron,corbel,curanail,fenpropemorph,fenpropimorph,fenpropimorphe,forbel,funbas,loceryl,locetar,mildofix,mistral,morpholine,odenil,omicur,pekiron" "NA"
|
||||
"AMX" 33613 "Amoxicillin" "Aminopenicillins,Penicillins,Beta-lactams" "J01CA04,QG51AA03,QJ01CA04" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "ac,amox,amoxic,amx" "acuotricina,alfamox,alfida,amitron,amoclen,amodex,amoksicillin,amolin,amopen,amopenixin,amophar,amoran,amoxi,amoxicaps,amoxicilina,amoxicilline,amoxicillinum,amoxidal,amoxiden,amoxil,amoxillat,amoxina,amoxine,amoxipen,amoxivet,amoxycillin,amoxycillinsalt,amoxyke,anemolin,aspenil,atoksilin,bristamox,cemoxin,ciblor,clamoxyl,damoxy,danoxillin,delacillin,demoksil,dispermox,efpenix,eupen,flemoxin,flemoxine,galenamox,gramidil,hiconcil,himinomax,histocillin,ibiamox,imacillin,izoltil,kentrocyllin,lamoxy,largopen,larotid,matasedrin,metifarma,moksilin,moxacin,moxal,moxaline,moxatag,neotetranase,novabritine,ospamox,pacetocin,pamocil,paradroxil,pasetocin,penamox,piramox,promoxil,quimiopen,remoxil,riotapen,robamox,sawacillin,siganopen,simplamox,sintopen,sumox,topramoxin,trifamox,trimox,unicillin,utimox,velamox,vetramox,wymox,zamocillin,zamocilline,zimox" 1.5 "g" 3 "g" "101498-4,15-8,16-6,16365-9,17-4,18-2,18861-5,18862-3,19-0,20-8,21-6,22-4,25274-2,25310-4,3344-9,55614-2,55615-9,55616-7,6976-5,6977-3,80133-2"
|
||||
"AMC" 23665637 "Amoxicillin/clavulanic acid" "Aminopenicillins,Penicillins,Beta-lactams,Beta-lactamase inhibitors" "J01CR02,QJ01CR02" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "a/c,amcl,aml,amocla,aug,xl" "amocla,amoclan,amoclav,amoksiclav,amoxsiklav,amoxyclav,ancla,augmentan,augmentin,augmentine,auspilic,clamentin,clamobit,clavam,clavamox,clavinex,clavumox,coamoxiclav,curam,eumetinex,kesium,kmoxilin,spectramox,synulox,viaclav,xiclav" 1.5 "g" 3 "g" "NA"
|
||||
"AXS" 465441 "Amoxicillin/sulbactam" "Penicillins,Beta-lactams,Beta-lactamase inhibitors" "J01CR02,QJ01CR02" "NA" "NA" 1.5 "g" 3 "g" "55614-2,55615-9,55616-7"
|
||||
"AMB" 5280965 "Amphotericin B" "Antifungals" "A01AB04,A07AA07,G01AA03,J02AA01,QA01AB04,QA07AA07,QG01AA03,QJ02AA01" "Antimycotics for systemic use" "Antibiotics" "amf,amfb,amph,amphot" "abelcet,abelecet,ambil,ambisome,amphocin,amphomoronal,amphotec,amphotericin,amphotocerin,amphozone,funganiline,fungilin,fungisome,fungisone,fungizone,halizon,nystatine,nystatinum,terrastatin" 40 "mg" 210 "mg" "16370-9,18863-1,23-2,24-0,25-7,26-5,3353-0,3354-8,40707-2,40757-7,49859-2,6978-1"
|
||||
"AMH" "Amphotericin B-high" "Antifungals" "NA" "amfo b high,amhl,ampho b high,amphotericin high" "NA" "NA"
|
||||
"AMP" 6249 "Ampicillin" "Aminopenicillins,Penicillins,Beta-lactams" "J01CA01,QJ01CA01,QJ51CA01,QS01AA19,S01AA19" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "am,amp,amp100,amp200,ampi,ampici" "adobacillin,alpen,amblosin,amcap,amcill,amfipen,ampen,amperil,ampichel,ampicilina,ampicillina,ampicilline,ampicillinesalt,ampicillinsalt,ampicillinum,ampifarm,ampikel,ampimed,ampinova,ampipenin,ampiscel,ampisyn,ampivax,ampivet,amplacilina,amplin,amplipenyl,amplisom,amplital,austrapen,bayer,binotal,bonapicillin,britacil,cimex,citteral,copharcilin,cymbi,delcillin,deripen,divercillin,doktacillin,domicillin,duphacillin,grampenil,guicitrina,guicitrine,lifeampil,marcillin,morepen,norobrittin,nuvapen,omnipen,orbicilina,penbristol,penbritin,penbrock,penialmen,penicline,penimic,penizillin,pensyn,pentrex,pentrexl,pentrexyl,pentritin,ponecil,princillin,principen,racenacillin,redicilin,rosampline,roscillin,semicillin,servicillin,sumipanto,supen,synpenin,texcillin,tokiocillin,tolomol,totacillin,totalciclina,totapen,trafarbiot,trifacilina,ukapen,ultrabion,ultrabron,vampen,viccillin,vidocillin,wypicil" 2 "g" 6 "g" "101477-8,101478-6,18864-9,18865-6,20374-5,21066-6,23618-2,27-3,28-1,29-9,30-7,31-5,32-3,33-1,3355-5,33562-0,33919-2,34-9,43883-8,43884-6,6979-9,6980-7,87604-5"
|
||||
"SAM" 119561 "Ampicillin/sulbactam" "Penicillins,Beta-lactams,Beta-lactamase inhibitors" "J01CR01,QJ01CR01" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "a/s,ab,ampsul,ams,amsu,apsu,sam" "sulacillin" 6 "g" "101478-6,18865-6,20374-5,23618-2,31-5,32-3,33-1,34-9,6980-7"
|
||||
"AMR" 73341 "Amprolium" "Other" "QP51BX02" "NA" "amprol,amprolio,amprovine,anticoccid,cocciprol,corid,mepyrium,picolinium,pyridinium,thiacoccid" "NA"
|
||||
"ANI" 166548 "Anidulafungin" "Antifungals" "J02AX06,QJ02AX06" "Antimycotics for systemic use" "Other antimycotics for systemic use" "anid,anidul" "anidulafungina,anidulafungine,anidulafunginum,biafungin,ecalta,eraxis" 0.1 "g" "55343-8,57095-2,58420-1,77162-6"
|
||||
"APL" 6602341 "Apalcillin" "Penicillins,Beta-lactams" "NA" "apalci" "apalcilina,apalcilline,apalcillinsalt,apalcillinum,lumota" "NA"
|
||||
"AKF" "Amikacin/fosfomycin" "Aminoglycosides" "NA" "NA" "NA" "NA"
|
||||
"AMO" 54260 "Amorolfine" "Antifungals/antimycotics" "D01AE16,QD01AE16" "Antifungals for topical use" "Other antifungals for topical use" "amor" "amorolfina,amorolfinum,bekiron,corbel,curanail,fenpropemorph,fenpropimorph,fenpropimorphe,forbel,funbas,loceryl,locetar,mildofix,mistral,morpholine,odenil,omicur,pekiron" "NA"
|
||||
"AMX" 33613 "Amoxicillin" "Beta-lactams/penicillins" "J01CA04,QG51AA03,QJ01CA04" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "ac,amox,amoxic,amx" "acuotricina,alfamox,alfida,amitron,amoclen,amodex,amoksicillin,amolin,amopen,amopenixin,amophar,amoran,amoxi,amoxicaps,amoxicilina,amoxicilline,amoxicillinum,amoxidal,amoxiden,amoxil,amoxillat,amoxina,amoxine,amoxipen,amoxivet,amoxycillin,amoxycillinsalt,amoxyke,anemolin,aspenil,atoksilin,bristamox,cemoxin,ciblor,clamoxyl,damoxy,danoxillin,delacillin,demoksil,dispermox,efpenix,eupen,flemoxin,flemoxine,galenamox,gramidil,hiconcil,himinomax,histocillin,ibiamox,imacillin,izoltil,kentrocyllin,lamoxy,largopen,larotid,matasedrin,metifarma,moksilin,moxacin,moxal,moxaline,moxatag,neotetranase,novabritine,ospamox,pacetocin,pamocil,paradroxil,pasetocin,penamox,piramox,promoxil,quimiopen,remoxil,riotapen,robamox,sawacillin,siganopen,simplamox,sintopen,sumox,topramoxin,trifamox,trimox,unicillin,utimox,velamox,vetramox,wymox,zamocillin,zamocilline,zimox" 1.5 "g" 3 "g" "101498-4,15-8,16-6,16365-9,17-4,18-2,18861-5,18862-3,19-0,20-8,21-6,22-4,25274-2,25310-4,3344-9,55614-2,55615-9,55616-7,6976-5,6977-3,80133-2"
|
||||
"AMC" 23665637 "Amoxicillin/clavulanic acid" "Beta-lactams/penicillins" "J01CR02,QJ01CR02" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "a/c,amcl,aml,amocla,aug,xl" "amocla,amoclan,amoclav,amoksiclav,amoxsiklav,amoxyclav,ancla,augmentan,augmentin,augmentine,auspilic,clamentin,clamobit,clavam,clavamox,clavinex,clavumox,coamoxiclav,curam,eumetinex,kesium,kmoxilin,spectramox,synulox,viaclav,xiclav" 1.5 "g" 3 "g" "NA"
|
||||
"AXS" 465441 "Amoxicillin/sulbactam" "Beta-lactams/penicillins" "J01CR02,QJ01CR02" "NA" "NA" 1.5 "g" 3 "g" "55614-2,55615-9,55616-7"
|
||||
"AMB" 5280965 "Amphotericin B" "Antifungals/antimycotics" "A01AB04,A07AA07,G01AA03,J02AA01,QA01AB04,QA07AA07,QG01AA03,QJ02AA01" "Antimycotics for systemic use" "Antibiotics" "amf,amfb,amph,amphot" "abelcet,abelecet,ambil,ambisome,amphocin,amphomoronal,amphotec,amphotericin,amphotocerin,amphozone,funganiline,fungilin,fungisome,fungisone,fungizone,halizon,nystatine,nystatinum,terrastatin" 40 "mg" 210 "mg" "16370-9,18863-1,23-2,24-0,25-7,26-5,3353-0,3354-8,40707-2,40757-7,49859-2,6978-1"
|
||||
"AMH" "Amphotericin B-high" "Antifungals/antimycotics" "NA" "amfo b high,amhl,ampho b high,amphotericin high" "NA" "NA"
|
||||
"AMP" 6249 "Ampicillin" "Beta-lactams/penicillins" "J01CA01,QJ01CA01,QJ51CA01,QS01AA19,S01AA19" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "am,amp,amp100,amp200,ampi,ampici" "adobacillin,alpen,amblosin,amcap,amcill,amfipen,ampen,amperil,ampichel,ampicilina,ampicillina,ampicilline,ampicillinesalt,ampicillinsalt,ampicillinum,ampifarm,ampikel,ampimed,ampinova,ampipenin,ampiscel,ampisyn,ampivax,ampivet,amplacilina,amplin,amplipenyl,amplisom,amplital,austrapen,bayer,binotal,bonapicillin,britacil,cimex,citteral,copharcilin,cymbi,delcillin,deripen,divercillin,doktacillin,domicillin,duphacillin,grampenil,guicitrina,guicitrine,lifeampil,marcillin,morepen,norobrittin,nuvapen,omnipen,orbicilina,penbristol,penbritin,penbrock,penialmen,penicline,penimic,penizillin,pensyn,pentrex,pentrexl,pentrexyl,pentritin,ponecil,princillin,principen,racenacillin,redicilin,rosampline,roscillin,semicillin,servicillin,sumipanto,supen,synpenin,texcillin,tokiocillin,tolomol,totacillin,totalciclina,totapen,trafarbiot,trifacilina,ukapen,ultrabion,ultrabron,vampen,viccillin,vidocillin,wypicil" 2 "g" 6 "g" "101477-8,101478-6,18864-9,18865-6,20374-5,21066-6,23618-2,27-3,28-1,29-9,30-7,31-5,32-3,33-1,3355-5,33562-0,33919-2,34-9,43883-8,43884-6,6979-9,6980-7,87604-5"
|
||||
"SAM" 119561 "Ampicillin/sulbactam" "Beta-lactams/penicillins" "J01CR01,QJ01CR01" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "a/s,ab,ampsul,ams,amsu,apsu,sam" "sulacillin" 6 "g" "101478-6,18865-6,20374-5,23618-2,31-5,32-3,33-1,34-9,6980-7"
|
||||
"AMR" 73341 "Amprolium" "Other antibacterials" "QP51BX02" "NA" "amprol,amprolio,amprovine,anticoccid,cocciprol,corid,mepyrium,picolinium,pyridinium,thiacoccid" "NA"
|
||||
"ANI" 166548 "Anidulafungin" "Antifungals/antimycotics" "J02AX06,QJ02AX06" "Antimycotics for systemic use" "Other antimycotics for systemic use" "anid,anidul" "anidulafungina,anidulafungine,anidulafunginum,biafungin,ecalta,eraxis" 0.1 "g" "55343-8,57095-2,58420-1,77162-6"
|
||||
"APL" 6602341 "Apalcillin" "Beta-lactams/penicillins" "NA" "apalci" "apalcilina,apalcilline,apalcillinsalt,apalcillinum,lumota" "NA"
|
||||
"APR" 3081545 "Apramycin" "Aminoglycosides" "QA07AA92,QJ01GB90,QJ51GB90" "apramy" "ambylan,apralan,apramicina,apramycine,apramycinum" "23659-6,73652-0,73653-8"
|
||||
"ARB" 68682 "Arbekacin" "Aminoglycosides" "J01GB12,QJ01GB12" "arbeka" "arbekacina,arbekacine,arbekacinum,haberacin" 0.2 "g" "32373-3,53818-1,54173-0"
|
||||
"APX" 71961 "Aspoxicillin" "Penicillins,Beta-lactams" "J01CA19,QJ01CA19" "apoxic,aspoxi" "aspoxicilina,aspoxicillan,aspoxicilline,aspoxicillinum,doyle" 4 "g" "NA"
|
||||
"APX" 71961 "Aspoxicillin" "Beta-lactams/penicillins" "J01CA19,QJ01CA19" "apoxic,aspoxi" "aspoxicilina,aspoxicillan,aspoxicilline,aspoxicillinum,doyle" 4 "g" "NA"
|
||||
"AST" 5284517 "Astromicin" "Aminoglycosides" "NA" "astrom" "abbott,astromicina,astromicine,astromicinum,fortimicin,istamycin,istamycins" "NA"
|
||||
"AVB" 9835049 "Avibactam" "Beta-lactamase inhibitors" "NA" "NA" "avibactamfreeacid" "NA"
|
||||
"AVI" 71674 "Avilamycin" "Other" "QA07AA95" "avilam" "avilamycina,avilamycine,avilamycinum,inteprity,kavault,surmax" "35754-1,35755-8,35756-6,55619-1"
|
||||
"AVO" 16131159 "Avoparcin" "Glycopeptides,Peptides" "NA" "NA" "firvanq,tagocid,targocid,targosid,tecoplanina,tecoplanine,tecoplaninum,teichomycin,teicoplanina,teicoplanine,teicoplaninum,teikoplanin,ticocin" "NA"
|
||||
"AZD" 15574941 "Azidocillin" "Penicillins,Beta-lactams" "J01CE04,QJ01CE04" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "azidocilina,azidocillina,azidocilline,azidocillinum" 1.5 "g" "NA"
|
||||
"AZM" 447043 "Azithromycin" "Macrolides" "J01FA10,QJ01FA10,QS01AA26,S01AA26" "Macrolides, lincosamides and streptogramins" "Macrolides" "az,azi,azit,azithr,azm" "aritromicina,aruzilina,azasite,azenil,azifast,azigram,azimakrol,azithramycine,azithrocin,azithromycine,azithromycinum,azitrocin,azitromax,azitromicina,azitromicine,azitromin,aziwin,aziwok,aztrin,azyter,hemomycin,macrozit,misultina,mixoterin,setron,sumamed,tobil,toraseptol,tromix,trozocina,trulimax,xithrone,zentavion,zifin,zithrax,zithromac,zithromax,zitrim,zitromax,zitrotek,zythromax" 0.3 "g" 0.5 "g" "100043-9,16420-2,16421-0,18866-4,23612-5,25233-8,35-6,36-4,37-2,38-0,6981-5,89480-8"
|
||||
"AFC" "Azithromycin/fluconazole/secnidazole" "Other" "J01RA07,QJ01RA07" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"AZL" 6479523 "Azlocillin" "Ureidopenicillins,Penicillins,Beta-lactams" "J01CA09,QJ01CA09" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "az,azl,azlo,azloci" "azlin,azlocilina,azlocilline,azlocillinsalt,azlocillinum,securopen" 12 "g" "16422-8,18867-2,3368-8,39-8,40-6,41-4,41661-0,42-2"
|
||||
"ATM" 5742832 "Aztreonam" "Monobactams,Beta-lactams" "J01DF01,QJ01DF01" "Other beta-lactam antibacterials" "Monobactams" "at,atm,azm,azt,azt1,aztr,aztreo" "azactam,azetreonam,azonam,azthreonam,aztreon,aztreonamum,cayston,dynabiotic,nebactam,primbactam,squibb" 4 "g" "101497-6,16423-6,18868-0,25234-6,3369-6,41662-8,41663-6,41664-4,41727-9,43-0,44-8,45-5,46-3,6982-3"
|
||||
"AZA" "Aztreonam/avibactam" "Monobactams,Beta-lactams,Beta-lactamase inhibitors" "J01DF51,QJ01DF51" "NA" "NA" "NA"
|
||||
"ANC" "Aztreonam/nacubactam" "Monobactams,Beta-lactams,Beta-lactamase inhibitors" "J01DF51,QJ01DF51" "NA" "NA" "NA"
|
||||
"BAM" 441397 "Bacampicillin" "Penicillins,Beta-lactams" "J01CA06,QJ01CA06" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "bacamp" "alphacilina,alphacillin,ambacamp,ambaxin,bacacil,bacampicilina,bacampicilline,bacampicillinum,bacampicine,berocillin,centurina,devonium,diancina,inacilin,maxifen,penglobe,pivatil,pondocil,pondocillin,pondocillina,sanguicillin,spectrobid,velbacil" 1.2 "g" "18869-8,47-1,48-9,49-7,50-5,55620-9"
|
||||
"BAC" 78358334 "Bacitracin" "Peptides" "D06AX05,J01XX10,QA07AA93,QD06AX05,QJ01XX10,QR02AB04,QS01AA32,R02AB04,S01AA32" "baci,bacitr" "albac,altracin,ayfivin,baciferm,baciguent,baciim,baciliquin,bacilliquin,baciquent,bacitracina,bacitracine,bacitracinum,fortracin,mycitracin,parentracin,penitracin,septa,topitracin,topitrasin,tropitracin,zutracin" "10868-8,16428-5,18870-6,6827-0,6983-1,87603-7"
|
||||
"BDQ" 5388906 "Bedaquiline" "Other" "J04AK05,QJ04AK05" "NA" "NA" 86 "mg" "80637-2,88703-4,88704-2,94274-8,96107-8"
|
||||
"AVB" 9835049 "Avibactam" "Beta-lactams/penicillins" "NA" "NA" "avibactamfreeacid" "NA"
|
||||
"AVI" 71674 "Avilamycin" "Other antibacterials" "QA07AA95" "avilam" "avilamycina,avilamycine,avilamycinum,inteprity,kavault,surmax" "35754-1,35755-8,35756-6,55619-1"
|
||||
"AVO" 16131159 "Avoparcin" "Glycopeptides" "NA" "NA" "firvanq,tagocid,targocid,targosid,tecoplanina,tecoplanine,tecoplaninum,teichomycin,teicoplanina,teicoplanine,teicoplaninum,teikoplanin,ticocin" "NA"
|
||||
"AZD" 15574941 "Azidocillin" "Beta-lactams/penicillins" "J01CE04,QJ01CE04" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "azidocilina,azidocillina,azidocilline,azidocillinum" 1.5 "g" "NA"
|
||||
"AZM" 447043 "Azithromycin" "Macrolides/lincosamides" "J01FA10,QJ01FA10,QS01AA26,S01AA26" "Macrolides, lincosamides and streptogramins" "Macrolides" "az,azi,azit,azithr,azm" "aritromicina,aruzilina,azasite,azenil,azifast,azigram,azimakrol,azithramycine,azithrocin,azithromycine,azithromycinum,azitrocin,azitromax,azitromicina,azitromicine,azitromin,aziwin,aziwok,aztrin,azyter,hemomycin,macrozit,misultina,mixoterin,setron,sumamed,tobil,toraseptol,tromix,trozocina,trulimax,xithrone,zentavion,zifin,zithrax,zithromac,zithromax,zitrim,zitromax,zitrotek,zythromax" 0.3 "g" 0.5 "g" "100043-9,16420-2,16421-0,18866-4,23612-5,25233-8,35-6,36-4,37-2,38-0,6981-5,89480-8"
|
||||
"AFC" "Azithromycin/fluconazole/secnidazole" "Other antibacterials" "J01RA07,QJ01RA07" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"AZL" 6479523 "Azlocillin" "Beta-lactams/penicillins" "J01CA09,QJ01CA09" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "az,azl,azlo,azloci" "azlin,azlocilina,azlocilline,azlocillinsalt,azlocillinum,securopen" 12 "g" "16422-8,18867-2,3368-8,39-8,40-6,41-4,41661-0,42-2"
|
||||
"ATM" 5742832 "Aztreonam" "Monobactams" "J01DF01,QJ01DF01" "Other beta-lactam antibacterials" "Monobactams" "at,atm,azm,azt,azt1,aztr,aztreo" "azactam,azetreonam,azonam,azthreonam,aztreon,aztreonamum,cayston,dynabiotic,nebactam,primbactam,squibb" 4 "g" "101497-6,16423-6,18868-0,25234-6,3369-6,41662-8,41663-6,41664-4,41727-9,43-0,44-8,45-5,46-3,6982-3"
|
||||
"AZA" "Aztreonam/avibactam" "Monobactams" "J01DF51,QJ01DF51" "NA" "NA" "NA"
|
||||
"ANC" "Aztreonam/nacubactam" "Monobactams" "J01DF51,QJ01DF51" "NA" "NA" "NA"
|
||||
"BAM" 441397 "Bacampicillin" "Beta-lactams/penicillins" "J01CA06,QJ01CA06" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "bacamp" "alphacilina,alphacillin,ambacamp,ambaxin,bacacil,bacampicilina,bacampicilline,bacampicillinum,bacampicine,berocillin,centurina,devonium,diancina,inacilin,maxifen,penglobe,pivatil,pondocil,pondocillin,pondocillina,sanguicillin,spectrobid,velbacil" 1.2 "g" "18869-8,47-1,48-9,49-7,50-5,55620-9"
|
||||
"BAC" 78358334 "Bacitracin" "Other antibacterials" "D06AX05,J01XX10,QA07AA93,QD06AX05,QJ01XX10,QR02AB04,QS01AA32,R02AB04,S01AA32" "baci,bacitr" "albac,altracin,ayfivin,baciferm,baciguent,baciim,baciliquin,bacilliquin,baciquent,bacitracina,bacitracine,bacitracinum,fortracin,mycitracin,parentracin,penitracin,septa,topitracin,topitrasin,tropitracin,zutracin" "10868-8,16428-5,18870-6,6827-0,6983-1,87603-7"
|
||||
"BDQ" 5388906 "Bedaquiline" "Other antibacterials" "J04AK05,QJ04AK05" "NA" "NA" 86 "mg" "80637-2,88703-4,88704-2,94274-8,96107-8"
|
||||
"BEK" 439318 "Bekanamycin" "Aminoglycosides" "J01GB13,QJ01GB13" "NA" "aminodeoxykanamycin,becanamicina,bekanamicina,bekanamycine,bekanamycinum" 0.6 "g" "NA"
|
||||
"BNB" "Benzathine benzylpenicillin" "Penicillins,Beta-lactams" "J01CE08,QJ01CE08" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "NA" 3.6 "g" "NA"
|
||||
"BNP" 64725 "Benzathine phenoxymethylpenicillin" "Penicillins,Beta-lactams" "J01CE10,QJ01CE10" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "bicillin,biphecillin" 2 "g" "NA"
|
||||
"PEN" 5904 "Benzylpenicillin" "Penicillins,Beta-lactams" "J01CE01,QJ01CE01,QJ51CE01,QS01AA14,S01AA14" "Combinations of antibacterials" "Combinations of antibacterials" "bepe,pen,peni,peni g,penic8,penica,penici,penicillin,penicillin g,penora,pg" "bencilpenicilina,benzopenicillin,benzylpenicilline,benzylpenicillinum,capicillin,cillora,cilloral,cilopen,cintrisul,cosmopen,cristapen,crystapen,dropcillin,eskacillin,falapen,forpen,galofak,gelacillin,hipercilina,hyasorb,hylenta,lemopen,liquacillin,liquapen,monocillin,monopen,mycofarm,novocillin,penalev,penicillinum,penilaryn,penisem,pentid,pentids,pfizerpen,pharmacillin,pradupen,scotcil,sugracillin,sugracillinsalt,tabilin,ursopen,veticillin" 3.6 "g" "NA"
|
||||
"PEN-S" "Benzylpenicillin screening test" "Penicillins,Beta-lactams" "NA" "pen screen" "NA" "NA"
|
||||
"BES" 10178705 "Besifloxacin" "Fluoroquinolones,Quinolones" "QS01AE08,S01AE08" "besifl" "besivance" "73606-6,73628-0,73651-2"
|
||||
"BNB" "Benzathine benzylpenicillin" "Beta-lactams/penicillins" "J01CE08,QJ01CE08" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "NA" 3.6 "g" "NA"
|
||||
"BNP" 64725 "Benzathine phenoxymethylpenicillin" "Beta-lactams/penicillins" "J01CE10,QJ01CE10" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "bicillin,biphecillin" 2 "g" "NA"
|
||||
"PEN" 5904 "Benzylpenicillin" "Beta-lactams/penicillins" "J01CE01,QJ01CE01,QJ51CE01,QS01AA14,S01AA14" "Combinations of antibacterials" "Combinations of antibacterials" "bepe,pen,peni,peni g,penic8,penica,penici,penicillin,penicillin g,penora,pg" "bencilpenicilina,benzopenicillin,benzylpenicilline,benzylpenicillinum,capicillin,cillora,cilloral,cilopen,cintrisul,cosmopen,cristapen,crystapen,dropcillin,eskacillin,falapen,forpen,galofak,gelacillin,hipercilina,hyasorb,hylenta,lemopen,liquacillin,liquapen,monocillin,monopen,mycofarm,novocillin,penalev,penicillinum,penilaryn,penisem,pentid,pentids,pfizerpen,pharmacillin,pradupen,scotcil,sugracillin,sugracillinsalt,tabilin,ursopen,veticillin" 3.6 "g" "NA"
|
||||
"PEN-S" "Benzylpenicillin screening test" "Beta-lactams/penicillins" "NA" "pen screen" "NA" "NA"
|
||||
"BES" 10178705 "Besifloxacin" "Fluoroquinolones" "QS01AE08,S01AE08" "besifl" "besivance" "73606-6,73628-0,73651-2"
|
||||
"BLA-S" "Beta-lactamase screening test" "Other" "NA" "beta-lactamase,betalactamase,bl screen,blt screen" "NA" "NA"
|
||||
"BIA" 71339 "Biapenem" "Carbapenems,Beta-lactams" "J01DH05,QJ01DH05" "biapen" "biapenern,omegacin" 1.2 "g" "41665-1,41666-9,41667-7,41728-7"
|
||||
"BCZ" 65807 "Bicyclomycin" "Other" "NA" "bicozamycin" "aizumycin,bacfeed,bacteron,bicozamicina,bicozamycin,bicozamycine,bicozamycinum" "NA"
|
||||
"BLM" 5360373 "Bleomycin" "Glycopeptides,Peptides" "L01DC01,QL01DC01" "NA" "blenamax,blenoxane,bleocin,bleomicin,bleomicina,bleomycine,bleomycins,bleomycinum,blexane,nbleomycinamide" "NA"
|
||||
"BIA" 71339 "Biapenem" "Carbapenems" "J01DH05,QJ01DH05" "biapen" "biapenern,omegacin" 1.2 "g" "41665-1,41666-9,41667-7,41728-7"
|
||||
"BCZ" 65807 "Bicyclomycin" "Other antibacterials" "NA" "bicozamycin" "aizumycin,bacfeed,bacteron,bicozamicina,bicozamycin,bicozamycine,bicozamycinum" "NA"
|
||||
"BLM" 5360373 "Bleomycin" "Glycopeptides" "L01DC01,QL01DC01" "NA" "blenamax,blenoxane,bleocin,bleomicin,bleomicina,bleomycine,bleomycins,bleomycinum,blexane,nbleomycinamide" "NA"
|
||||
"BDP" 68760 "Brodimoprim" "Trimethoprims" "J01EA02,QJ01EA02" "Sulfonamides and trimethoprim" "Trimethoprim and derivatives" "NA" "brodimoprima,brodimoprime,brodimoprimum,bromdimoprim,hyprim,unitrim" 0.2 "g" "NA"
|
||||
"BUT" 47472 "Butoconazole" "Antifungals" "G01AF15,QG01AF15" "NA" "butaconazole,butoconazol,butoconazolum,gynofort" "NA"
|
||||
"BUT" 47472 "Butoconazole" "Antifungals/antimycotics" "G01AF15,QG01AF15" "NA" "butaconazole,butoconazol,butoconazolum,gynofort" "NA"
|
||||
"CDZ" 44242317 "Cadazolid" "Oxazolidinones" "NA" "NA" "NA" "NA"
|
||||
"CLA" "Calcium aminosalicylate" "Antimycobacterials" "J04AA03,QJ04AA03" "Drugs for treatment of tuberculosis" "Aminosalicylic acid and derivatives" "NA" "NA" 15 "g" "NA"
|
||||
"CAP" 135565060 "Capreomycin" "Antimycobacterials" "J04AB30,QJ04AB30" "Drugs for treatment of tuberculosis" "Antibiotics" "capr,capreo" "NA" 1 "g" "16545-6,18872-2,23607-5,25210-6,25211-4,25212-2,42643-7,48170-5,55-4,55623-3,56-2,57-0,58-8,61355-4,89483-2"
|
||||
"CRB" 20824 "Carbenicillin" "Penicillins,Beta-lactams" "J01CA03,QJ01CA03" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "bar,carb,carben,cb" "anabactyl,carbecin,carbenicilina,carbenicillina,carbenicilline,carbenicillinum,dicarbenicillin,dipenicillin,fugacillin,geopen,gripenin,hyoper,microcillin,piopen,pyocianil,pyoclox,pyopan,pyopen,pyopene" 12 "g" "18873-0,3434-8,41668-5,59-6,60-4,61-2,62-0"
|
||||
"CRN" 93184 "Carindacillin" "Penicillins,Beta-lactams" "J01CA05,QJ01CA05" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "NA" "carindacilina,carindacilline,carindacillinsalt,carindacillinum,geocillin,indanylcarbinicillin,urobac" 4 "g" "NA"
|
||||
"CAR" 6540466 "Carumonam" "Monobactams,Beta-lactams" "J01DF02,QJ01DF02" "NA" "carumonamum" 2 "g" "51694-8"
|
||||
"CAS" 2826718 "Caspofungin" "Antifungals" "J02AX04,QJ02AX04" "Antimycotics for systemic use" "Other antimycotics for systemic use" "casp,caspof" "cancidas,caspofungina" 50 "mg" "32378-2,54175-5,54176-3,54185-4,58419-3"
|
||||
"CAC" 91562 "Cefacetrile" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB10,QJ01DB10,QJ51DB10" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cephac" "cefacetril,cefacetrilo,cefacetrilum,celospor,cephacetrile,vetrimast" "55624-1,55625-8,55626-6,55627-4"
|
||||
"CEC" 51039 "Cefaclor" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC04,QJ01DC04" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "ccl,cec,cefacl,cf,cfac,cfc,cfcl,cfr,fac" "alenfral,alfacet,alfatil,ceclor,cefachlor,cefaclorum,cefeaclor,cephaclor,compound,distaclor,keflor,kefolor,kefral,keftab,keftid,lilly,lopac,panacef,panoral,raniclor" 1 "g" "16564-7,18874-8,21149-0,6986-4,83-6,84-4,85-1,86-9"
|
||||
"CFR" 47965 "Cefadroxil" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB05,QJ01DB05" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefadr,cfdx,cfr,fad" "bidocel,cefadrops,cefadroxilo,cefadroxilum,cefradroxil,cefzil,cephadroxil,duracef,duricef,kefroxil,sumacef,ultracef" 2 "g" "16565-4,18875-5,55628-2,63-8,64-6,65-3,66-1"
|
||||
"LEX" 27447 "Cefalexin" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB01,QJ01DB01,QJ51DB01" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cepale,cflx" "adcadina,alcephin,alsporin,ambal,amplex,aristosporin,azabort,bactopenor,beliam,biocef,carnosporin,cefablan,cefacet,cefadal,cefadin,cefadina,cefalekey,cefaleksin,cefalessina,cefalexgobens,cefalexina,cefalexine,cefalexinum,cefalin,cefalival,cefaloto,cefanex,cefaseptin,cefax,ceffanex,cefibacter,ceflax,ceforal,cefovit,celexin,cepastar,cepexin,cephacillin,cephalexine,cephalexinum,cephalobene,cephanasten,cephaxin,cephin,cepol,ceporex,ceporexin,ceporexine,cerexin,cerexins,check,cophalexin,domucef,doriman,durantel,efemida,erocetin,factagard,felexin,fexin,ibilex,ibrexin,inphalex,karilexina,kefalospes,keflet,keflex,kefolan,keforal,kekrinal,kidolex,lafarine,larixin,lenocef,lexibiotico,loisine,lonflex,lopilexin,losporal,madlexin,maksipor,mamalexin,mamlexin,medolexin,medoxine,neokef,neolexina,noveol,novolexin,nufex,optocef,oracef,oriphex,oroxin,ortisporina,ospexin,palitrex,panixine,pectril,prindex,pyassan,rilexine,roceph,rogevil,sanaxin,sartosona,sencephalin,sepexin,servicef,servispor,sialexin,sinthecillin,sintolexyn,sporicef,sporidex,syncl,syncle,synecl,taicelexin,tepaxin,theratrex,tokiolexin,uphalexin,viosporine,voxxim,winlex,zabytrex,zozarine" 2 "g" "NA"
|
||||
"RID" 5773 "Cefaloridine" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB02,QJ01DB02" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefa,ceplor" "aliporina,ampligram,cefaloridin,cefaloridina,cefaloridinum,cefalorizin,ceflorin,cepaloridin,cepalorin,cephalomycine,cephaloridin,cephaloridine,cephaloridinum,ceporan,ceporin,ceporine,cilifor,deflorin,faredina,floridin,glaxoridin,intrasporin,keflodin,keflordin,kefloridin,kefspor,lloncefal,sasperin,sefacin,verolgin,vioviantine" 3 "g" "NA"
|
||||
"CEP" 6024 "Cefalotin" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB03,QJ01DB03" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cephal,cfal,cflt" "averon,cefalothin,cefalothine,cefalothinsalt,cefalotina,cefalotine,cefalotinsalt,cefalotinum,cemastin,cephalothin,cephalothinsalt,cephalothinum,cephalotin,cephalotinsalt,ceporacin,cepovenin,coaxin,keflin,lospoven,microtin,seffin,synclotin,toricelocin" 4 "g" "NA"
|
||||
"MAN" 456255 "Cefamandole" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC03,QJ01DC03" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefama,cfam,cfmn" "cefadole,cefamandol,cefamandolum,cephadole,kefamandol,kefdole,mancef" 6 "g" "18876-3,3441-3,41669-3,55634-0,55635-7,55636-5,55637-3,67-9,68-7,69-5,70-3"
|
||||
"HAP" 30699 "Cefapirin" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB08,QG51AA05,QJ01DB08,QJ51DB08" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cephap" "ambrocef,brisfirina,brisporin,bristocef,cefadyl,cefalak,cefaloject,cefapirina,cefapirine,cefapirinsalt,cefapirinum,cefaprin,cefatrex,cefatrexyl,cephapirin,cephapirine,cephapirinsalt,cephatrexil,cephatrexyl,metricure" 4 "g" "NA"
|
||||
"CTZ" 6410758 "Cefatrizine" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB07,QJ01DB07" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefatr" "bricef,cefathiamidine,cefatrix,cefatrizino,cefatrizinum,cephatriazine,cepticol,cetrazil,latocef,orosporina,orotric,seapuron,trizina" 1 "g" "18877-1,55639-9,71-1,72-9,73-7,74-5"
|
||||
"CZD" 71736 "Cefazedone" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB06,QJ01DB06" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefaze" "cefazedon,cefazedona,cefazedonesalt,cefazedonum,refosporen,refosporene,refosporin,refosporinsalt" 3 "g" "NA"
|
||||
"CZO" 33255 "Cefazolin" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB04,QJ01DB04,QJ51DB04" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefazo,cfz,cfzl,cz,czol,faz,kz" "ancef,atirin,biazolina,cefabiozim,cefacidal,cefalomicina,cefamedin,cefamezin,cefazil,cefazina,cefazolina,cefazoline,cefazolinsalt,cefazolinum,cephamezine,cephazolidin,cephazolin,cephazoline,elzogram,firmacef,gramaxin,kefzol,lampocef,liviclina,neofazol,oprea,recef,totacef,zolicef,zolisint" 3 "g" "16566-2,18878-9,25235-3,3442-1,3443-9,41670-1,75-2,76-0,77-8,78-6,80962-4,85422-4"
|
||||
"CFB" 127527 "Cefbuperazone" "Other" "J01DC13,QJ01DC13" "cefbup" "cefbuperazona,cefbuperazonesalt,cefbuperazonum,cefbuperzaone,cerbuperazone,keiperazon,tomiporan" 2 "g" "NA"
|
||||
"CCP" 6436055 "Cefcapene" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD17,QJ01DD17" "cefcap" "flomox" 0.45 "g" "100044-7,76143-7"
|
||||
"CCX" 5282438 "Cefcapene pivoxil" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "NA" "NA" "cefcamate,flumax" "NA"
|
||||
"CDR" 6915944 "Cefdinir" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD15,QJ01DD15" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cd,cdn,cdr,cefdin,cfd,din" "cefdinirum,cefdinyl,cefdirnir,ceftinex,cefzon,omnicef" 0.6 "g" "23636-4,23637-2,35757-4,35758-2"
|
||||
"DIT" 9870843 "Cefditoren" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD16,QJ01DD16" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cdn,cefdit" "cefditoreno,spectracef" 0.4 "g" "35759-0,35760-8,35761-6,35762-4"
|
||||
"DIX" 6437877 "Cefditoren pivoxil" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "NA" "NA" "cefditorin,meiact,pivaloyloxymethyl" "NA"
|
||||
"FEP" 5479537 "Cefepime" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams" "J01DE01,QJ01DE01" "Other beta-lactam antibacterials" "Fourth-generation cephalosporins" "cefep4,cefepi,cfep,cfpi,cpe,cpm,fep,pm,xpm" "anticefepime,axepim,cefepima,cefepimum,maxipime,pyrrolidinium,renapime" 4 "g" "101502-3,18879-7,31142-3,31143-1,35763-2,38363-8,42350-9,42351-7,42353-3,50631-1,58412-8,6643-1,6644-9,6645-7,6646-5,6987-2,8272-7,8273-5"
|
||||
"CFA" "Cefepime/amikacin" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams" "J01DE51,QJ01DE51" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"CPC" 9567559 "Cefepime/clavulanic acid" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams" "J01DE51,QJ01DE51" "cefcla,cicl,xpml" "NA" "NA"
|
||||
"FPE" 23653540 "Cefepime/enmetazobactam" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "J01DE51,QJ01DE51" "NA" "NA" "NA"
|
||||
"FNC" "Cefepime/nacubactam" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "J01DE51,QJ01DE51" "NA" "NA" "NA"
|
||||
"FTA" "Cefepime/taniborbactam" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "J01DE51,QJ01DE51" "NA" "NA" "NA"
|
||||
"FPT" 9567558 "Cefepime/tazobactam" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "J01DE51,QJ01DE51" "NA" "NA" "NA"
|
||||
"FPZ" "Cefepime/zidebactam" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "J01DE51,QJ01DE51" "NA" "NA" "NA"
|
||||
"CAT" 5487888 "Cefetamet" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD10,QJ01DD10" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefeta,cefmtm" "cefetametum,deacetoxycefotaxime,epocelin" 1 "g" "32377-4,35764-0,35765-7,55640-7"
|
||||
"CPI" 5486182 "Cefetamet pivoxil" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "NA" "NA" "cefetametpivoxil,cefyl,globocef" "NA"
|
||||
"CCL" 71719688 "Cefetecol" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams" "NA" "cefcatacol" "NA" "NA"
|
||||
"CZL" 193956 "Cefetrizole" "Cephalosporins,Beta-lactams" "NA" "NA" "cefetrizolum" "NA"
|
||||
"FDC" 77843966 "Cefiderocol" "Cephalosporins,Beta-lactams" "J01DI04,QJ01DI04" "NA" "fetcroja" 6 "g" "95767-0,99280-0,99503-5"
|
||||
"CFM" 5362065 "Cefixime" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD08,QJ01DD08" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefixi,cfe,cfix,cfxm,dcfm,fix,ix" "cefixim,cefixima,cefiximum,cefixoral,cefspan,cephoral,citropen,denvar,necopen,oraken,oroken,suprax,tricef,unixime" 0.4 "g" "16567-0,18880-5,25236-1,35766-5,79-4,80-2,81-0,82-8"
|
||||
"CEO" "Cefixime/ornidazole" "Other" "J01DD58,QJ01DD58" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"CMX" 9570757 "Cefmenoxime" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD05,QJ01DD05,QS01AA31,QS02AA18,S01AA31,S02AA18" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefmen" "bestron,cefmenoxima,cefmenoximum,tacef" 2 "g" "32375-8,54174-8,54203-5,55641-5"
|
||||
"CMZ" 42008 "Cefmetazole" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC09,QJ01DC09" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefmet" "cefmetazol,cefmetazolo,cefmetazolum,cefmetazon,metafar,zefazone" 4 "g" "11575-8,18881-3,25222-1,87-7,88-5,89-3,90-1"
|
||||
"CNX" 71141 "Cefminox" "Other" "J01DC12,QJ01DC12" "cefmin" "alteporina,cefminoxhydrate,cefminoxum,meicelin,tencef" 4 "g" "54908-9"
|
||||
"DIZ" 5361871 "Cefodizime" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD09,QJ01DD09" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "NA" "cefodizima,cefodizimum,cefodizme,diezime,kenicef,modivid,neucef,timecef" 2 "g" "18882-1,6988-0,91-9,92-7,93-5,94-3"
|
||||
"CID" 43594 "Cefonicid" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC06,QJ01DC06" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefoni" "cefonicide,cefonicido,cefonicidsalt,cefonicidum,monocef,monocid" 1 "g" "18883-9,25237-9,3444-7,55642-3,95-0,96-8,97-6,98-4"
|
||||
"CFP" 44187 "Cefoperazone" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD12,QJ01DD12,QJ51DD12" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefope,cfp,cfpz,cp,cpz,fop,per" "bioperazone,cefob,cefobid,cefobis,cefoneg,cefoper,cefoperazin,cefoperazine,cefoperazon,cefoperazona,cefoperazonesalt,cefoperazono,cefoperazonum,cefozon,medocef,myticef,pathozone,peracef,tomabef" 4 "g" "100-8,101-6,102-4,18884-7,3445-4,35767-3,35768-1,54166-4,54167-2,54168-0,99-2"
|
||||
"CSL" "Cefoperazone/sulbactam" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "J01DD62,QJ01DD62" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "fopsul" "NA" 4 "g" "35768-1,54166-4,54167-2,54168-0"
|
||||
"CND" 43507 "Ceforanide" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC11,QJ01DC11" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefora" "ceforanido,ceforanidum,precef" 4 "g" "103-2,104-0,105-7,106-5,18885-4,55643-1"
|
||||
"CSE" 9830519 "Cefoselis" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams" "NA" "cefose" "winsef" "NA"
|
||||
"CTX" 5742673 "Cefotaxime" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD01,QJ01DD01" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefo32,cefota,cfot,cft,cftx,ct,ctx,fot,fot1,tax,taxmen,taxnme,xct" "anticefotaxime,cefotax,cefotaxim,cefotaxima,cefotaximesalt,cefotaximsalt,cefotaximum,cephotaxim,cephotaxime,claforan,kefotex,omnatax,pretor,ralopar,tolycar,tolycor,zariviz" 4 "g" "101479-4,101480-2,107-3,108-1,109-9,110-7,18886-2,25238-7,31138-1,31139-9,3446-2,35769-9,35770-7,35771-5,41671-9,50632-9,52128-6,54191-2,54192-0,54193-8,55189-5,55644-9,6989-8,80961-6"
|
||||
"CTX-S" "Cefotaxime screening test" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "NA" "ctx screen" "NA" "NA"
|
||||
"CTC" 9575353 "Cefotaxime/clavulanic acid" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD51,QJ01DD51" "cxcl,taxcla,xctl" "NA" "NA"
|
||||
"CTS" 9574753 "Cefotaxime/sulbactam" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "J01DD51,QJ01DD51" "NA" "NA" "54191-2,54192-0,54193-8,55644-9"
|
||||
"CTT" 53025 "Cefotetan" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC05,QJ01DC05" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefote,cftt,cn,cte,ctn,ctt,tans" "apacef,apatef,cefotetanum" 4 "g" "111-5,112-3,113-1,114-9,18887-0,25239-5,3447-0,41672-7,41673-5,41674-3,41729-5,6990-6"
|
||||
"CTF" 43708 "Cefotiam" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC07,QJ01DC07" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefoti" "aspil,cefotiamum,ceradon,halospor,pansporin,pansporine,spizef" 1.2 "g" 4 "g" "32374-1,35772-3,35773-1,55645-6,55737-1,55738-9,55739-7,55740-5"
|
||||
"CHE" 125846 "Cefotiam hexetil" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "NA" "NA" "taketiam,texodil" "55737-1,55738-9,55739-7,55740-5"
|
||||
"FOV" 9578573 "Cefovecin" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "QJ01DD91" "cefove" "cefovecinsalt,convenia" "76147-8,87792-8"
|
||||
"FOX" 441199 "Cefoxitin" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC01,QJ01DC01" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefoxi,cfox,cfx,cfxt,cx,fox,fx" "betacef,cefoxil,cefoxitina,cefoxitine,cefoxitinsalt,cefoxitinum,cefoxotin,cenomycin,farmoxin,mefoxin,mefoxithin,mefoxitin,merxin,rephoxitin" 6 "g" "101492-7,115-6,116-4,117-2,118-0,18888-8,25220-5,25240-3,25366-6,3448-8,41675-0,41676-8,41677-6,41730-3,6991-4"
|
||||
"FOX-S" "Cefoxitin screening test" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "NA" "cfsc,fox1" "NA" "NA"
|
||||
"ZOP" 9571080 "Cefozopran" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams" "J01DE03,QJ01DE03" "cefozo" "firstcin,imidazo" 4 "g" "100045-4,53820-7"
|
||||
"CFZ" 68597 "Cefpimizole" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "NA" "cefpim" "ajicef,cefpimizol,cefpimizolesalt,cefpimizolum,renilan" "NA"
|
||||
"CPM" 636405 "Cefpiramide" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD11,QJ01DD11" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefpam" "cefpiramida,cefpiramidesalt,cefpiramido,cefpiramidum,sepatren,suncefal" 2 "g" "NA"
|
||||
"CPO" 5479539 "Cefpirome" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams" "J01DE02,QJ01DE02" "Other beta-lactam antibacterials" "Fourth-generation cephalosporins" "cefpom,cfpr" "broact,cefir,cefpiroma,cefpiromum,cefrom,keiten,romecef" 4 "g" "18889-6,6647-3,6648-1,6649-9,6650-6,6992-2,8274-3,8275-0,8276-8"
|
||||
"CPD" 6335986 "Cefpodoxime" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD13,QJ01DD13" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefpod,cfpd,cfpo,cpd,pod,pod4,px" "cefpodoxima,cefpodoximum,epoxim" 0.4 "g" "119-8,120-6,121-4,122-2,18890-4,25241-1,41678-4,41679-2,41680-0,41731-1,6993-0,90849-1"
|
||||
"CPX" 6526396 "Cefpodoxime proxetil" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "NA" "NA" "banan,cefodox,cefoprox,cefpoderm,cefpodoximproxetil,cepodem,doxef,orelox,otreon,podomexef,simplicef,vantin" "NA"
|
||||
"CDC" "Cefpodoxime/clavulanic acid" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD64,QJ01DD64" "cecl,podcla" "NA" 0.4 "g" "NA"
|
||||
"CPR" 5281006 "Cefprozil" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC10,QJ01DC10" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefpro,cpr,cpz,fp" "arzimol,brisoral,cefprozilo,cefprozilum,cronocef,procef,serozil" 1 "g" "123-0,124-8,125-5,126-3,18891-2,6994-8"
|
||||
"CEQ" 5464355 "Cefquinome" "Cephalosporins (4th gen.),Cephalosporins,Beta-lactams" "QG51AA07,QJ01DE90,QJ51DE90" "cefqui" "cefquinoma,cefquinomum,cobactan,quinolinium" "100046-2,76150-2"
|
||||
"CRD" 5284529 "Cefroxadine" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB11,QJ01DB11" "Other beta-lactam antibacterials" "First-generation cephalosporins" "ceftix" "cefroxadin,cefroxadino,cefroxadinum,oraspor" 2.1 "g" "NA"
|
||||
"CFS" 656575 "Cefsulodin" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD03,QJ01DD03" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefsul,cfsl,cfsu" "cefomonil,cefonomil,cefsulodine,cefsulodinhydrate,cefsulodino,cefsulodinum,pseudocef,pseudomonil,pyocefal,sulcephalosporin,takesulin,tilmapor,ulfaret" 4 "g" "127-1,128-9,129-7,130-5,131-3,18892-0,25242-9,55647-2"
|
||||
"CSU" 68718 "Cefsumide" "Cephalosporins,Beta-lactams" "NA" "NA" "cefsulmid,cefsumido,cefsumidum" "NA"
|
||||
"CPT" 56841980 "Ceftaroline" "Cephalosporins (5th gen.),Cephalosporins,Beta-lactams" "J01DI02,QJ01DI02" "ceftar,cfro" "ceftaroine,teflaro,zinforo" "73604-1,73605-8,73626-4,73627-2,73649-6,73650-4,74170-2"
|
||||
"CPA" "Ceftaroline/avibactam" "Cephalosporins (5th gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "NA" "NA" "NA" "73604-1,73626-4,73649-6"
|
||||
"CAZ" 5481173 "Ceftazidime" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD02,QJ01DD02" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "caz,cef,cefta,ceftaz,cfta,cftz,taz,tz,xtz" "ceftazimide,ceptaz,fortam,fortaz,fortum,glazidim,kefazim,modacin,pentacef,tazicef,tizime" 4 "g" "101481-0,101482-8,101483-6,132-1,133-9,134-7,135-4,18893-8,21151-6,3449-6,35774-9,35775-6,35776-4,42352-5,55648-0,55649-8,55650-6,55651-4,58705-5,6995-5,73603-3,73625-6,73648-8,80960-8,87734-0,90850-9"
|
||||
"CZA" 90643431 "Ceftazidime/avibactam" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "J01DD52,QJ01DD52" "cfav" "avycaz,zavicefta" 6 "g" "101483-6,73603-3,73625-6,73648-8,87734-0"
|
||||
"CCV" 9575352 "Ceftazidime/clavulanic acid" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD52,QJ01DD52" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "czcl,tazcla,xtzl" "NA" 6 "g" "NA"
|
||||
"CEM" 6537431 "Cefteram" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD18,QJ01DD18" "cefter" "cefterame,cefteramum,ceftetrame" 0.4 "g" "100047-0,76144-5"
|
||||
"CPL" 5362114 "Cefteram pivoxil" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "NA" "NA" "cefterampivoxil,tomiron" "NA"
|
||||
"CTL" 65755 "Ceftezole" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "J01DB12,QJ01DB12" "Other beta-lactam antibacterials" "First-generation cephalosporins" "ceftez" "alomen,ceftezol,ceftezolesalt,ceftezolo,ceftezolum,celoslin,demethylcefazolin,falomesin" 3 "g" "NA"
|
||||
"CTB" 5282242 "Ceftibuten" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD14,QJ01DD14" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cb,ceftib,cfbu,ctb,tib" "cedax,ceftem,ceftibutene,ceftibuteno,ceftibutenum,ceftibutin,ceprifran,isocef,keimax,seftem" 0.4 "g" "35777-2,35778-0,35779-8,6996-3"
|
||||
"CTA" "Ceftibuten/avibactam" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "NA" "NA" "NA" "NA"
|
||||
"TIO" 6328657 "Ceftiofur" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "QJ01DD90,QJ51DD90" "ceftif" "ceftiofurum,excenel,naxcel" "23709-9,35780-6,35781-4,55652-2"
|
||||
"CZX" 6533629 "Ceftizoxime" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD07,QJ01DD07" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "ceftiz,cfzx,ctz,cz,czx,tiz,zox" "cefizox,ceftix,ceftizoxima,ceftizoximesalt,ceftizoximum,eposerin" 4 "g" "136-2,137-0,138-8,139-6,18894-6,20378-6,23622-4,25243-7,3450-4,6997-1"
|
||||
"CZP" 9578661 "Ceftizoxime alapivoxil" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "NA" "NA" "NA" "NA"
|
||||
"BPR" 135413542 "Ceftobiprole" "Cephalosporins (5th gen.),Cephalosporins,Beta-lactams" "NA" "ceftob" "NA" "43269-0,43270-8,43271-6,43272-4,85052-9"
|
||||
"CFM1" 135413544 "Ceftobiprole medocaril" "Cephalosporins (5th gen.),Cephalosporins,Beta-lactams" "J01DI01,QJ01DI01" "Other beta-lactam antibacterials" "Other cephalosporins and penems" "NA" "zevtera" 1.5 "g" "NA"
|
||||
"CZT" 86291594 "Ceftolozane/tazobactam" "Cephalosporins (5th gen.),Cephalosporins,Beta-lactams,Beta-lactamase inhibitors" "J01DI54,QJ01DI54" "Other beta-lactam antibacterials" "Other cephalosporins and penems" "cei" "zerbaxa" 3 "g" "101484-4,73602-5,73624-9,73647-0,87735-7"
|
||||
"CRO" 5479530 "Ceftriaxone" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD04,QJ01DD04" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "axo,cax,ceftri,cftr,cro,ctr,frx,trimen,trinme,tx" "biotrakson,ceftriaxon,ceftriaxona,ceftriaxonum,ceftriazone,rocefin,rocephalin,rocephin,rocephine,rophex" 2 "g" "101485-1,140-4,141-2,142-0,143-8,18895-3,25244-5,25367-4,31140-7,31141-5,3451-2,41681-8,41682-6,41683-4,41732-9,50633-7,55190-3,6998-9,80957-4"
|
||||
"CEB" "Ceftriaxone/beta-lactamase inhibitor" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD63,QJ01DD63" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "NA" "NA" 2 "g" "NA"
|
||||
"CXM" 5479529 "Cefuroxime" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC02,QJ01DC02,QJ51DC02,QS01AA27,S01AA27" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefaxe,cefrox,cefuro,cfrx,cfur,cfx,crm,cxm,fur,rox,xm" "anaptivan,biociclin,biofuroksym,bioxima,cefofix,cefumax,cefurex,cefuril,cefurox,cefuroxim,cefuroxima,cefuroximesalt,cefuroximine,cefuroximo,cefuroximum,cephuroxime,cetroxil,colifossim,curoxim,curoxima,curoxime,froxal,furoxil,kefurox,kesint,ketocef,lifurox,medoxim,sharox,spectrazolr,ultroxim,zinacef,zinnat" 0.5 "g" 3 "g" "101503-1,144-6,145-3,146-1,147-9,18896-1,20460-2,25245-2,3452-0,35782-2,35783-0,51724-3,51774-8,55653-0,55654-8,6999-7,74699-0,80608-3,80617-4"
|
||||
"CXA" 6321416 "Cefuroxime axetil" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "NA" "cfax" "bioracef,ceftin,cefurax,cefuroximaxetil,celocid,cepazine,cethixim,cetoxil,coliofossim,curocef,elobact,kalcef,maxitil,medoxm,nivador,novador,novocef,oraxim,zinat,zoref" "NA"
|
||||
"CFM2" "Cefuroxime/metronidazole" "Other" "J01DC52,QJ01DC52" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" 0.5 "g" "NA"
|
||||
"ZON" 6336505 "Cefuzonam" "Other" "NA" "cefuzo" "cefuzoname,cefuzonamum,cefzoname,cosmosin" "NA"
|
||||
"CED" 38103 "Cephradine" "Cephalosporins (1st gen.),Cephalosporins,Beta-lactams" "NA" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cephra,cfra,cfrd" "anspor,cefradin,cefradina,cefradine,cefradinum,cekodin,cephradin,ecosporina,eskacef,infexin,megacef,sefril,velocef,velosef" "168-5,169-3,170-1,171-9,18902-7,55646-4"
|
||||
"CRB" 20824 "Carbenicillin" "Beta-lactams/penicillins" "J01CA03,QJ01CA03" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "bar,carb,carben,cb" "anabactyl,carbecin,carbenicilina,carbenicillina,carbenicilline,carbenicillinum,dicarbenicillin,dipenicillin,fugacillin,geopen,gripenin,hyoper,microcillin,piopen,pyocianil,pyoclox,pyopan,pyopen,pyopene" 12 "g" "18873-0,3434-8,41668-5,59-6,60-4,61-2,62-0"
|
||||
"CRN" 93184 "Carindacillin" "Beta-lactams/penicillins" "J01CA05,QJ01CA05" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "NA" "carindacilina,carindacilline,carindacillinsalt,carindacillinum,geocillin,indanylcarbinicillin,urobac" 4 "g" "NA"
|
||||
"CAR" 6540466 "Carumonam" "Monobactams" "J01DF02,QJ01DF02" "NA" "carumonamum" 2 "g" "51694-8"
|
||||
"CAS" 2826718 "Caspofungin" "Antifungals/antimycotics" "J02AX04,QJ02AX04" "Antimycotics for systemic use" "Other antimycotics for systemic use" "casp,caspof" "cancidas,caspofungina" 50 "mg" "32378-2,54175-5,54176-3,54185-4,58419-3"
|
||||
"CAC" 91562 "Cefacetrile" "Cephalosporins (1st gen.)" "J01DB10,QJ01DB10,QJ51DB10" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cephac" "cefacetril,cefacetrilo,cefacetrilum,celospor,cephacetrile,vetrimast" "55624-1,55625-8,55626-6,55627-4"
|
||||
"CEC" 51039 "Cefaclor" "Cephalosporins (2nd gen.)" "J01DC04,QJ01DC04" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "ccl,cec,cefacl,cf,cfac,cfc,cfcl,cfr,fac" "alenfral,alfacet,alfatil,ceclor,cefachlor,cefaclorum,cefeaclor,cephaclor,compound,distaclor,keflor,kefolor,kefral,keftab,keftid,lilly,lopac,panacef,panoral,raniclor" 1 "g" "16564-7,18874-8,21149-0,6986-4,83-6,84-4,85-1,86-9"
|
||||
"CFR" 47965 "Cefadroxil" "Cephalosporins (1st gen.)" "J01DB05,QJ01DB05" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefadr,cfdx,cfr,fad" "bidocel,cefadrops,cefadroxilo,cefadroxilum,cefradroxil,cefzil,cephadroxil,duracef,duricef,kefroxil,sumacef,ultracef" 2 "g" "16565-4,18875-5,55628-2,63-8,64-6,65-3,66-1"
|
||||
"LEX" 27447 "Cefalexin" "Cephalosporins (1st gen.)" "J01DB01,QJ01DB01,QJ51DB01" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cepale,cflx" "adcadina,alcephin,alsporin,ambal,amplex,aristosporin,azabort,bactopenor,beliam,biocef,carnosporin,cefablan,cefacet,cefadal,cefadin,cefadina,cefalekey,cefaleksin,cefalessina,cefalexgobens,cefalexina,cefalexine,cefalexinum,cefalin,cefalival,cefaloto,cefanex,cefaseptin,cefax,ceffanex,cefibacter,ceflax,ceforal,cefovit,celexin,cepastar,cepexin,cephacillin,cephalexine,cephalexinum,cephalobene,cephanasten,cephaxin,cephin,cepol,ceporex,ceporexin,ceporexine,cerexin,cerexins,check,cophalexin,domucef,doriman,durantel,efemida,erocetin,factagard,felexin,fexin,ibilex,ibrexin,inphalex,karilexina,kefalospes,keflet,keflex,kefolan,keforal,kekrinal,kidolex,lafarine,larixin,lenocef,lexibiotico,loisine,lonflex,lopilexin,losporal,madlexin,maksipor,mamalexin,mamlexin,medolexin,medoxine,neokef,neolexina,noveol,novolexin,nufex,optocef,oracef,oriphex,oroxin,ortisporina,ospexin,palitrex,panixine,pectril,prindex,pyassan,rilexine,roceph,rogevil,sanaxin,sartosona,sencephalin,sepexin,servicef,servispor,sialexin,sinthecillin,sintolexyn,sporicef,sporidex,syncl,syncle,synecl,taicelexin,tepaxin,theratrex,tokiolexin,uphalexin,viosporine,voxxim,winlex,zabytrex,zozarine" 2 "g" "NA"
|
||||
"RID" 5773 "Cefaloridine" "Cephalosporins (1st gen.)" "J01DB02,QJ01DB02" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefa,ceplor" "aliporina,ampligram,cefaloridin,cefaloridina,cefaloridinum,cefalorizin,ceflorin,cepaloridin,cepalorin,cephalomycine,cephaloridin,cephaloridine,cephaloridinum,ceporan,ceporin,ceporine,cilifor,deflorin,faredina,floridin,glaxoridin,intrasporin,keflodin,keflordin,kefloridin,kefspor,lloncefal,sasperin,sefacin,verolgin,vioviantine" 3 "g" "NA"
|
||||
"CEP" 6024 "Cefalotin" "Cephalosporins (1st gen.)" "J01DB03,QJ01DB03" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cephal,cfal,cflt" "averon,cefalothin,cefalothine,cefalothinsalt,cefalotina,cefalotine,cefalotinsalt,cefalotinum,cemastin,cephalothin,cephalothinsalt,cephalothinum,cephalotin,cephalotinsalt,ceporacin,cepovenin,coaxin,keflin,lospoven,microtin,seffin,synclotin,toricelocin" 4 "g" "NA"
|
||||
"MAN" 456255 "Cefamandole" "Cephalosporins (2nd gen.)" "J01DC03,QJ01DC03" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefama,cfam,cfmn" "cefadole,cefamandol,cefamandolum,cephadole,kefamandol,kefdole,mancef" 6 "g" "18876-3,3441-3,41669-3,55634-0,55635-7,55636-5,55637-3,67-9,68-7,69-5,70-3"
|
||||
"HAP" 30699 "Cefapirin" "Cephalosporins (1st gen.)" "J01DB08,QG51AA05,QJ01DB08,QJ51DB08" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cephap" "ambrocef,brisfirina,brisporin,bristocef,cefadyl,cefalak,cefaloject,cefapirina,cefapirine,cefapirinsalt,cefapirinum,cefaprin,cefatrex,cefatrexyl,cephapirin,cephapirine,cephapirinsalt,cephatrexil,cephatrexyl,metricure" 4 "g" "NA"
|
||||
"CTZ" 6410758 "Cefatrizine" "Cephalosporins (1st gen.)" "J01DB07,QJ01DB07" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefatr" "bricef,cefathiamidine,cefatrix,cefatrizino,cefatrizinum,cephatriazine,cepticol,cetrazil,latocef,orosporina,orotric,seapuron,trizina" 1 "g" "18877-1,55639-9,71-1,72-9,73-7,74-5"
|
||||
"CZD" 71736 "Cefazedone" "Cephalosporins (1st gen.)" "J01DB06,QJ01DB06" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefaze" "cefazedon,cefazedona,cefazedonesalt,cefazedonum,refosporen,refosporene,refosporin,refosporinsalt" 3 "g" "NA"
|
||||
"CZO" 33255 "Cefazolin" "Cephalosporins (1st gen.)" "J01DB04,QJ01DB04,QJ51DB04" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cefazo,cfz,cfzl,cz,czol,faz,kz" "ancef,atirin,biazolina,cefabiozim,cefacidal,cefalomicina,cefamedin,cefamezin,cefazil,cefazina,cefazolina,cefazoline,cefazolinsalt,cefazolinum,cephamezine,cephazolidin,cephazolin,cephazoline,elzogram,firmacef,gramaxin,kefzol,lampocef,liviclina,neofazol,oprea,recef,totacef,zolicef,zolisint" 3 "g" "16566-2,18878-9,25235-3,3442-1,3443-9,41670-1,75-2,76-0,77-8,78-6,80962-4,85422-4"
|
||||
"CFB" 127527 "Cefbuperazone" "Other antibacterials" "J01DC13,QJ01DC13" "cefbup" "cefbuperazona,cefbuperazonesalt,cefbuperazonum,cefbuperzaone,cerbuperazone,keiperazon,tomiporan" 2 "g" "NA"
|
||||
"CCP" 6436055 "Cefcapene" "Cephalosporins (3rd gen.)" "J01DD17,QJ01DD17" "cefcap" "flomox" 0.45 "g" "100044-7,76143-7"
|
||||
"CCX" 5282438 "Cefcapene pivoxil" "Cephalosporins (3rd gen.)" "NA" "NA" "cefcamate,flumax" "NA"
|
||||
"CDR" 6915944 "Cefdinir" "Cephalosporins (3rd gen.)" "J01DD15,QJ01DD15" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cd,cdn,cdr,cefdin,cfd,din" "cefdinirum,cefdinyl,cefdirnir,ceftinex,cefzon,omnicef" 0.6 "g" "23636-4,23637-2,35757-4,35758-2"
|
||||
"DIT" 9870843 "Cefditoren" "Cephalosporins (3rd gen.)" "J01DD16,QJ01DD16" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cdn,cefdit" "cefditoreno,spectracef" 0.4 "g" "35759-0,35760-8,35761-6,35762-4"
|
||||
"DIX" 6437877 "Cefditoren pivoxil" "Cephalosporins (3rd gen.)" "NA" "NA" "cefditorin,meiact,pivaloyloxymethyl" "NA"
|
||||
"FEP" 5479537 "Cefepime" "Cephalosporins (4th gen.)" "J01DE01,QJ01DE01" "Other beta-lactam antibacterials" "Fourth-generation cephalosporins" "cefep4,cefepi,cfep,cfpi,cpe,cpm,fep,pm,xpm" "anticefepime,axepim,cefepima,cefepimum,maxipime,pyrrolidinium,renapime" 4 "g" "101502-3,18879-7,31142-3,31143-1,35763-2,38363-8,42350-9,42351-7,42353-3,50631-1,58412-8,6643-1,6644-9,6645-7,6646-5,6987-2,8272-7,8273-5"
|
||||
"CFA" "Cefepime/amikacin" "Cephalosporins (4th gen.)" "J01DE51,QJ01DE51" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"CPC" 9567559 "Cefepime/clavulanic acid" "Cephalosporins (4th gen.)" "J01DE51,QJ01DE51" "cefcla,cicl,xpml" "NA" "NA"
|
||||
"FPE" 23653540 "Cefepime/enmetazobactam" "Cephalosporins (4th gen.)" "J01DE51,QJ01DE51" "NA" "NA" "NA"
|
||||
"FNC" "Cefepime/nacubactam" "Cephalosporins (4th gen.)" "J01DE51,QJ01DE51" "NA" "NA" "NA"
|
||||
"FPT" 9567558 "Cefepime/tazobactam" "Cephalosporins (4th gen.)" "J01DE51,QJ01DE51" "NA" "NA" "NA"
|
||||
"FPZ" "Cefepime/zidebactam" "Cephalosporins (4th gen.)" "J01DE51,QJ01DE51" "NA" "NA" "NA"
|
||||
"CAT" 5487888 "Cefetamet" "Cephalosporins (3rd gen.)" "J01DD10,QJ01DD10" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefeta,cefmtm" "cefetametum,deacetoxycefotaxime,epocelin" 1 "g" "32377-4,35764-0,35765-7,55640-7"
|
||||
"CPI" 5486182 "Cefetamet pivoxil" "Cephalosporins (3rd gen.)" "NA" "NA" "cefetametpivoxil,cefyl,globocef" "NA"
|
||||
"CCL" 71719688 "Cefetecol" "Cephalosporins (4th gen.)" "NA" "cefcatacol" "NA" "NA"
|
||||
"CZL" 193956 "Cefetrizole" "Cephalosporins (unclassified gen.)" "NA" "NA" "cefetrizolum" "NA"
|
||||
"FDC" 77843966 "Cefiderocol" "Cephalosporins (unclassified gen.)" "J01DI04,QJ01DI04" "NA" "fetcroja" 6 "g" "95767-0,99280-0,99503-5"
|
||||
"CFM" 5362065 "Cefixime" "Cephalosporins (3rd gen.)" "J01DD08,QJ01DD08" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefixi,cfe,cfix,cfxm,dcfm,fix,ix" "cefixim,cefixima,cefiximum,cefixoral,cefspan,cephoral,citropen,denvar,necopen,oraken,oroken,suprax,tricef,unixime" 0.4 "g" "16567-0,18880-5,25236-1,35766-5,79-4,80-2,81-0,82-8"
|
||||
"CEO" "Cefixime/ornidazole" "Other antibacterials" "J01DD58,QJ01DD58" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"CMX" 9570757 "Cefmenoxime" "Cephalosporins (3rd gen.)" "J01DD05,QJ01DD05,QS01AA31,QS02AA18,S01AA31,S02AA18" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefmen" "bestron,cefmenoxima,cefmenoximum,tacef" 2 "g" "32375-8,54174-8,54203-5,55641-5"
|
||||
"CMZ" 42008 "Cefmetazole" "Cephalosporins (2nd gen.)" "J01DC09,QJ01DC09" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefmet" "cefmetazol,cefmetazolo,cefmetazolum,cefmetazon,metafar,zefazone" 4 "g" "11575-8,18881-3,25222-1,87-7,88-5,89-3,90-1"
|
||||
"CNX" 71141 "Cefminox" "Other antibacterials" "J01DC12,QJ01DC12" "cefmin" "alteporina,cefminoxhydrate,cefminoxum,meicelin,tencef" 4 "g" "54908-9"
|
||||
"DIZ" 5361871 "Cefodizime" "Cephalosporins (3rd gen.)" "J01DD09,QJ01DD09" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "NA" "cefodizima,cefodizimum,cefodizme,diezime,kenicef,modivid,neucef,timecef" 2 "g" "18882-1,6988-0,91-9,92-7,93-5,94-3"
|
||||
"CID" 43594 "Cefonicid" "Cephalosporins (2nd gen.)" "J01DC06,QJ01DC06" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefoni" "cefonicide,cefonicido,cefonicidsalt,cefonicidum,monocef,monocid" 1 "g" "18883-9,25237-9,3444-7,55642-3,95-0,96-8,97-6,98-4"
|
||||
"CFP" 44187 "Cefoperazone" "Cephalosporins (3rd gen.)" "J01DD12,QJ01DD12,QJ51DD12" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefope,cfp,cfpz,cp,cpz,fop,per" "bioperazone,cefob,cefobid,cefobis,cefoneg,cefoper,cefoperazin,cefoperazine,cefoperazon,cefoperazona,cefoperazonesalt,cefoperazono,cefoperazonum,cefozon,medocef,myticef,pathozone,peracef,tomabef" 4 "g" "100-8,101-6,102-4,18884-7,3445-4,35767-3,35768-1,54166-4,54167-2,54168-0,99-2"
|
||||
"CSL" "Cefoperazone/sulbactam" "Cephalosporins (3rd gen.)" "J01DD62,QJ01DD62" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "fopsul" "NA" 4 "g" "35768-1,54166-4,54167-2,54168-0"
|
||||
"CND" 43507 "Ceforanide" "Cephalosporins (2nd gen.)" "J01DC11,QJ01DC11" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefora" "ceforanido,ceforanidum,precef" 4 "g" "103-2,104-0,105-7,106-5,18885-4,55643-1"
|
||||
"CSE" 9830519 "Cefoselis" "Cephalosporins (4th gen.)" "NA" "cefose" "winsef" "NA"
|
||||
"CTX" 5742673 "Cefotaxime" "Cephalosporins (3rd gen.)" "J01DD01,QJ01DD01" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefo32,cefota,cfot,cft,cftx,ct,ctx,fot,fot1,tax,taxmen,taxnme,xct" "anticefotaxime,cefotax,cefotaxim,cefotaxima,cefotaximesalt,cefotaximsalt,cefotaximum,cephotaxim,cephotaxime,claforan,kefotex,omnatax,pretor,ralopar,tolycar,tolycor,zariviz" 4 "g" "101479-4,101480-2,107-3,108-1,109-9,110-7,18886-2,25238-7,31138-1,31139-9,3446-2,35769-9,35770-7,35771-5,41671-9,50632-9,52128-6,54191-2,54192-0,54193-8,55189-5,55644-9,6989-8,80961-6"
|
||||
"CTX-S" "Cefotaxime screening test" "Cephalosporins (3rd gen.)" "NA" "ctx screen" "NA" "NA"
|
||||
"CTC" 9575353 "Cefotaxime/clavulanic acid" "Cephalosporins (3rd gen.)" "J01DD51,QJ01DD51" "cxcl,taxcla,xctl" "NA" "NA"
|
||||
"CTS" 9574753 "Cefotaxime/sulbactam" "Cephalosporins (3rd gen.)" "J01DD51,QJ01DD51" "NA" "NA" "54191-2,54192-0,54193-8,55644-9"
|
||||
"CTT" 53025 "Cefotetan" "Cephalosporins (2nd gen.)" "J01DC05,QJ01DC05" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefote,cftt,cn,cte,ctn,ctt,tans" "apacef,apatef,cefotetanum" 4 "g" "111-5,112-3,113-1,114-9,18887-0,25239-5,3447-0,41672-7,41673-5,41674-3,41729-5,6990-6"
|
||||
"CTF" 43708 "Cefotiam" "Cephalosporins (2nd gen.)" "J01DC07,QJ01DC07" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefoti" "aspil,cefotiamum,ceradon,halospor,pansporin,pansporine,spizef" 1.2 "g" 4 "g" "32374-1,35772-3,35773-1,55645-6,55737-1,55738-9,55739-7,55740-5"
|
||||
"CHE" 125846 "Cefotiam hexetil" "Cephalosporins (3rd gen.)" "NA" "NA" "taketiam,texodil" "55737-1,55738-9,55739-7,55740-5"
|
||||
"FOV" 9578573 "Cefovecin" "Cephalosporins (3rd gen.)" "QJ01DD91" "cefove" "cefovecinsalt,convenia" "76147-8,87792-8"
|
||||
"FOX" 441199 "Cefoxitin" "Cephalosporins (2nd gen.)" "J01DC01,QJ01DC01" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefoxi,cfox,cfx,cfxt,cx,fox,fx" "betacef,cefoxil,cefoxitina,cefoxitine,cefoxitinsalt,cefoxitinum,cefoxotin,cenomycin,farmoxin,mefoxin,mefoxithin,mefoxitin,merxin,rephoxitin" 6 "g" "101492-7,115-6,116-4,117-2,118-0,18888-8,25220-5,25240-3,25366-6,3448-8,41675-0,41676-8,41677-6,41730-3,6991-4"
|
||||
"FOX-S" "Cefoxitin screening test" "Cephalosporins (2nd gen.)" "NA" "cfsc,fox1" "NA" "NA"
|
||||
"ZOP" 9571080 "Cefozopran" "Cephalosporins (4th gen.)" "J01DE03,QJ01DE03" "cefozo" "firstcin,imidazo" 4 "g" "100045-4,53820-7"
|
||||
"CFZ" 68597 "Cefpimizole" "Cephalosporins (3rd gen.)" "NA" "cefpim" "ajicef,cefpimizol,cefpimizolesalt,cefpimizolum,renilan" "NA"
|
||||
"CPM" 636405 "Cefpiramide" "Cephalosporins (3rd gen.)" "J01DD11,QJ01DD11" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefpam" "cefpiramida,cefpiramidesalt,cefpiramido,cefpiramidum,sepatren,suncefal" 2 "g" "NA"
|
||||
"CPO" 5479539 "Cefpirome" "Cephalosporins (4th gen.)" "J01DE02,QJ01DE02" "Other beta-lactam antibacterials" "Fourth-generation cephalosporins" "cefpom,cfpr" "broact,cefir,cefpiroma,cefpiromum,cefrom,keiten,romecef" 4 "g" "18889-6,6647-3,6648-1,6649-9,6650-6,6992-2,8274-3,8275-0,8276-8"
|
||||
"CPD" 6335986 "Cefpodoxime" "Cephalosporins (3rd gen.)" "J01DD13,QJ01DD13" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefpod,cfpd,cfpo,cpd,pod,pod4,px" "cefpodoxima,cefpodoximum,epoxim" 0.4 "g" "119-8,120-6,121-4,122-2,18890-4,25241-1,41678-4,41679-2,41680-0,41731-1,6993-0,90849-1"
|
||||
"CPX" 6526396 "Cefpodoxime proxetil" "Cephalosporins (3rd gen.)" "NA" "NA" "banan,cefodox,cefoprox,cefpoderm,cefpodoximproxetil,cepodem,doxef,orelox,otreon,podomexef,simplicef,vantin" "NA"
|
||||
"CDC" "Cefpodoxime/clavulanic acid" "Cephalosporins (3rd gen.)" "J01DD64,QJ01DD64" "cecl,podcla" "NA" 0.4 "g" "NA"
|
||||
"CPR" 5281006 "Cefprozil" "Cephalosporins (2nd gen.)" "J01DC10,QJ01DC10" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefpro,cpr,cpz,fp" "arzimol,brisoral,cefprozilo,cefprozilum,cronocef,procef,serozil" 1 "g" "123-0,124-8,125-5,126-3,18891-2,6994-8"
|
||||
"CEQ" 5464355 "Cefquinome" "Cephalosporins (4th gen.)" "QG51AA07,QJ01DE90,QJ51DE90" "cefqui" "cefquinoma,cefquinomum,cobactan,quinolinium" "100046-2,76150-2"
|
||||
"CRD" 5284529 "Cefroxadine" "Cephalosporins (1st gen.)" "J01DB11,QJ01DB11" "Other beta-lactam antibacterials" "First-generation cephalosporins" "ceftix" "cefroxadin,cefroxadino,cefroxadinum,oraspor" 2.1 "g" "NA"
|
||||
"CFS" 656575 "Cefsulodin" "Cephalosporins (3rd gen.)" "J01DD03,QJ01DD03" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cefsul,cfsl,cfsu" "cefomonil,cefonomil,cefsulodine,cefsulodinhydrate,cefsulodino,cefsulodinum,pseudocef,pseudomonil,pyocefal,sulcephalosporin,takesulin,tilmapor,ulfaret" 4 "g" "127-1,128-9,129-7,130-5,131-3,18892-0,25242-9,55647-2"
|
||||
"CSU" 68718 "Cefsumide" "Cephalosporins (unclassified gen.)" "NA" "NA" "cefsulmid,cefsumido,cefsumidum" "NA"
|
||||
"CPT" 56841980 "Ceftaroline" "Cephalosporins (5th gen.)" "J01DI02,QJ01DI02" "ceftar,cfro" "ceftaroine,teflaro,zinforo" "73604-1,73605-8,73626-4,73627-2,73649-6,73650-4,74170-2"
|
||||
"CPA" "Ceftaroline/avibactam" "Cephalosporins (5th gen.)" "NA" "NA" "NA" "73604-1,73626-4,73649-6"
|
||||
"CAZ" 5481173 "Ceftazidime" "Cephalosporins (3rd gen.)" "J01DD02,QJ01DD02" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "caz,cefta,ceftaz,cfta,cftz,taz,tz,xtz" "ceftazimide,ceptaz,fortam,fortaz,fortum,glazidim,kefazim,modacin,pentacef,tazicef,tizime" 4 "g" "101481-0,101482-8,101483-6,132-1,133-9,134-7,135-4,18893-8,21151-6,3449-6,35774-9,35775-6,35776-4,42352-5,55648-0,55649-8,55650-6,55651-4,58705-5,6995-5,73603-3,73625-6,73648-8,80960-8,87734-0,90850-9"
|
||||
"CZA" 90643431 "Ceftazidime/avibactam" "Cephalosporins (3rd gen.)" "J01DD52,QJ01DD52" "cfav" "avycaz,zavicefta" 6 "g" "101483-6,73603-3,73625-6,73648-8,87734-0"
|
||||
"CCV" 9575352 "Ceftazidime/clavulanic acid" "Cephalosporins (3rd gen.)" "J01DD52,QJ01DD52" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "czcl,tazcla,xtzl" "NA" 6 "g" "NA"
|
||||
"CEM" 6537431 "Cefteram" "Cephalosporins (3rd gen.)" "J01DD18,QJ01DD18" "cefter" "cefterame,cefteramum,ceftetrame" 0.4 "g" "100047-0,76144-5"
|
||||
"CPL" 5362114 "Cefteram pivoxil" "Cephalosporins (3rd gen.)" "NA" "NA" "cefterampivoxil,tomiron" "NA"
|
||||
"CTL" 65755 "Ceftezole" "Cephalosporins (1st gen.)" "J01DB12,QJ01DB12" "Other beta-lactam antibacterials" "First-generation cephalosporins" "ceftez" "alomen,ceftezol,ceftezolesalt,ceftezolo,ceftezolum,celoslin,demethylcefazolin,falomesin" 3 "g" "NA"
|
||||
"CTB" 5282242 "Ceftibuten" "Cephalosporins (3rd gen.)" "J01DD14,QJ01DD14" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "cb,ceftib,cfbu,ctb,tib" "cedax,ceftem,ceftibutene,ceftibuteno,ceftibutenum,ceftibutin,ceprifran,isocef,keimax,seftem" 0.4 "g" "35777-2,35778-0,35779-8,6996-3"
|
||||
"TIO" 6328657 "Ceftiofur" "Cephalosporins (3rd gen.)" "QJ01DD90,QJ51DD90" "ceftif" "ceftiofurum,excenel,naxcel" "23709-9,35780-6,35781-4,55652-2"
|
||||
"CZX" 6533629 "Ceftizoxime" "Cephalosporins (3rd gen.)" "J01DD07,QJ01DD07" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "ceftiz,cfzx,ctz,cz,czx,tiz,zox" "cefizox,ceftix,ceftizoxima,ceftizoximesalt,ceftizoximum,eposerin" 4 "g" "136-2,137-0,138-8,139-6,18894-6,20378-6,23622-4,25243-7,3450-4,6997-1"
|
||||
"CZP" 9578661 "Ceftizoxime alapivoxil" "Cephalosporins (3rd gen.)" "NA" "NA" "NA" "NA"
|
||||
"BPR" 135413542 "Ceftobiprole" "Cephalosporins (5th gen.)" "NA" "ceftob" "NA" "43269-0,43270-8,43271-6,43272-4,85052-9"
|
||||
"CFM1" 135413544 "Ceftobiprole medocaril" "Cephalosporins (5th gen.)" "J01DI01,QJ01DI01" "Other beta-lactam antibacterials" "Other cephalosporins and penems" "NA" "zevtera" 1.5 "g" "NA"
|
||||
"CZT" 86291594 "Ceftolozane/tazobactam" "Cephalosporins (5th gen.)" "J01DI54,QJ01DI54" "Other beta-lactam antibacterials" "Other cephalosporins and penems" "cei" "zerbaxa" 3 "g" "101484-4,73602-5,73624-9,73647-0,87735-7"
|
||||
"CRO" 5479530 "Ceftriaxone" "Cephalosporins (3rd gen.)" "J01DD04,QJ01DD04" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "axo,cax,ceftri,cftr,cro,ctr,frx,trimen,trinme,tx" "biotrakson,ceftriaxon,ceftriaxona,ceftriaxonum,ceftriazone,rocefin,rocephalin,rocephin,rocephine,rophex" 2 "g" "101485-1,140-4,141-2,142-0,143-8,18895-3,25244-5,25367-4,31140-7,31141-5,3451-2,41681-8,41682-6,41683-4,41732-9,50633-7,55190-3,6998-9,80957-4"
|
||||
"CEB" "Ceftriaxone/beta-lactamase inhibitor" "Cephalosporins (3rd gen.)" "J01DD63,QJ01DD63" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "NA" "NA" 2 "g" "NA"
|
||||
"CXM" 5479529 "Cefuroxime" "Cephalosporins (2nd gen.)" "J01DC02,QJ01DC02,QJ51DC02,QS01AA27,S01AA27" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "cefaxe,cefrox,cefuro,cfrx,cfur,cfx,crm,cxm,fur,rox,xm" "anaptivan,biociclin,biofuroksym,bioxima,cefofix,cefumax,cefurex,cefuril,cefurox,cefuroxim,cefuroxima,cefuroximesalt,cefuroximine,cefuroximo,cefuroximum,cephuroxime,cetroxil,colifossim,curoxim,curoxima,curoxime,froxal,furoxil,kefurox,kesint,ketocef,lifurox,medoxim,sharox,spectrazolr,ultroxim,zinacef,zinnat" 0.5 "g" 3 "g" "101503-1,144-6,145-3,146-1,147-9,18896-1,20460-2,25245-2,3452-0,35782-2,35783-0,51724-3,51774-8,55653-0,55654-8,6999-7,74699-0,80608-3,80617-4"
|
||||
"CXA" 6321416 "Cefuroxime axetil" "Cephalosporins (2nd gen.)" "NA" "cfax" "bioracef,ceftin,cefurax,cefuroximaxetil,celocid,cepazine,cethixim,cetoxil,coliofossim,curocef,elobact,kalcef,maxitil,medoxm,nivador,novador,novocef,oraxim,zinat,zoref" "NA"
|
||||
"CFM2" "Cefuroxime/metronidazole" "Other antibacterials" "J01DC52,QJ01DC52" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" 0.5 "g" "NA"
|
||||
"ZON" 6336505 "Cefuzonam" "Other antibacterials" "NA" "cefuzo" "cefuzoname,cefuzonamum,cefzoname,cosmosin" "NA"
|
||||
"CED" 38103 "Cephradine" "Cephalosporins (1st gen.)" "NA" "Other beta-lactam antibacterials" "First-generation cephalosporins" "cephra,cfra,cfrd" "anspor,cefradin,cefradina,cefradine,cefradinum,cekodin,cephradin,ecosporina,eskacef,infexin,megacef,sefril,velocef,velosef" "168-5,169-3,170-1,171-9,18902-7,55646-4"
|
||||
"CTO" 71402 "Cetocycline" "Tetracyclines" "NA" "NA" "cetocyline,cetotetrine,chelocardin" "NA"
|
||||
"CHL" 5959 "Chloramphenicol" "Phenicols" "D06AX02,D10AF03,G01AA05,J01BA01,QD06AX02,QD10AF03,QG01AA05,QJ01BA01,QJ51BA01,QS01AA01,QS02AA01,QS03AA08,S01AA01,S02AA01,S03AA08" "Amphenicols" "Amphenicols" "c,chl,chlo,chlora,cl" "alficetyn,ambofen,amphicol,amseclor,anacetin,aquamycetin,austracil,austracol,biocetin,biophenicol,catilan,chemicetin,chemicetina,chlomin,chlomycol,chloramex,chloramfenikol,chloramficin,chloramfilin,chloramphenicole,chloramphenicolum,chloramsaar,chlorasol,chlorbiotic,chloricol,chlornitromycin,chloroamphenicol,chlorocaps,chlorocid,chlorocide,chlorocin,chlorocol,chlorofair,chloromax,chloromycetin,chloromycetny,chloromyxin,chloronitrin,chloroptic,chlorovules,cidocetine,ciplamycetin,cloramfen,cloramfenicol,cloramfenicolo,cloramficin,cloramicol,cloramidina,cloranfenicol,cloroamfenicolo,clorocyn,cloromisan,clorosintex,comycetin,cylphenicol,desphen,detreomycin,detreomycine,dextramycin,dextromycetin,doctamicina,econochlor,embacetin,emetren,enteromycetin,erbaplast,ertilen,farmicetina,globenicol,glorous,gloveticol,halcetin,halomycetin,hortfenicol,intramycetin,isicetin,ismicetina,isophenicol,juvamycetin,kamaver,kemicetina,kemicetine,kloramfenikol,klorita,laevomycetinum,leukamycin,leukomyan,leukomycin,levocin,levomicetina,levomitsetin,levomycetin,levoplast,levosin,levovetin,loromisan,loromisin,mastiphen,maybridge,mediamycetine,medichol,micloretin,micochlorine,micoclorina,microcetina,mychel,mycinol,myclocin,mycochlorin,novochlorocap,novomycetin,novophenicol,ocuphenicol,oftalent,oleomycetin,opclor,opelor,ophthochlor,ophthocort,ophtochlor,optomycin,otachron,otophen,pantovernil,paraxin,pentamycetin,petnamycetin,quemicetina,rivomycin,romphenil,ronphenil,septicol,sificetina,sintomicetin,sintomicetina,soluthor,stanomycetin,synthomycetin,synthomycetine,synthomycine,syntomycin,tevcocin,tevcosin,tifomycin,tifomycine,tiromycetin,treomicetina,tyfomycine,unimycetin,veticol,viceton" 3 "g" 3 "g" "15101-9,16603-3,16604-1,172-7,173-5,174-3,175-0,18903-5,25247-8,29214-4,29346-4,29347-2,3455-3,7001-1"
|
||||
"CTE" 54675777 "Chlortetracycline" "Tetracyclines" "A01AB21,D06AA02,J01AA03,QA01AB21,QD06AA02,QG51AA08,QJ01AA03,QJ51AA03,QS01AA02,S01AA02" "Tetracyclines" "Tetracyclines" "chltet" "acronize,alexomycin,aueromycin,aureocarmyl,aureociclina,aureocina,aureocycline,aureomycin,aureomykoin,aurofac,auxeomycin,biomitsin,biomycin,chlormax,chlorotetracycline,chlortetracyclinum,chrysomykine,clorocipan,clortetraciclina,clortetrin,declomycin,declostatin,deganol,demeclor,demeplus,demetraciclina,demetraclin,detracin,detravis,diuciclin,duomycin,elkamicina,flamycin,isphamycin,ledermicina,ledermycin,ledermycine,mexocine,novotriclina,pennchlor,perciclina,periciclina,sumaclina,uromycin,veraciclina" 1 "g" "176-8,177-6,178-4,179-2,18904-3,55655-5,87600-3"
|
||||
"CIC" 19003 "Ciclacillin" "Penicillins,Beta-lactams" "NA" "cyclac" "bastcillin,calthor,ciclacilina,ciclacilline,ciclacillinum,ciclacillum,citosarin,cyclacillin,cyclapen,noblicil,orfilina,peamezin,syngacillin,ultracillin,vastcillin,vipicil,wyvital" "NA"
|
||||
"CIX" "Ciclopirox" "Antifungals" "D01AE14,G01AX12,QD01AE14,QG01AX12" "Antifungals for topical use" "Other antifungals for topical use" "cipx" "NA" "NA"
|
||||
"CIC" 19003 "Ciclacillin" "Beta-lactams/penicillins" "NA" "cyclac" "bastcillin,calthor,ciclacilina,ciclacilline,ciclacillinum,ciclacillum,citosarin,cyclacillin,cyclapen,noblicil,orfilina,peamezin,syngacillin,ultracillin,vastcillin,vipicil,wyvital" "NA"
|
||||
"CIX" 47472 "Ciclopirox" "Antifungals/antimycotics" "D01AE14,G01AX12,QD01AE14,QG01AX12" "Antifungals for topical use" "Other antifungals for topical use" "cipx" "NA" "NA"
|
||||
"CIN" 2762 "Cinoxacin" "Quinolones" "J01MB06,QJ01MB06" "Quinolone antibacterials" "Other quinolones" "cino,cinoxa,cnox" "cinobac,cinobactin,cinoxacine,cinoxacino,cinoxacinum,clinoxacin,noxigram,uronorm" 1 "g" "180-0,181-8,182-6,183-4,18905-0,55656-3"
|
||||
"CIP" 2764 "Ciprofloxacin" "Fluoroquinolones,Quinolones" "J01MA02,QJ01MA02,QS01AE03,QS02AA15,QS03AA07,S01AE03,S02AA15,S03AA07" "Quinolone antibacterials" "Fluoroquinolones" "ci,cip,cipr,ciprof,cp" "alcipro,bacquinor,baflox,belmacina,bernoflox,catex,cenin,ceprimax,cetraxal,ciflan,ciflosin,cifloxin,cilab,cilox,ciloxan,cipad,ciplus,ciprecu,ciprenit,ciprine,ciprinol,cipro,ciprobay,ciprocinal,ciprocinol,ciprodar,ciproflox,ciprofloxacina,ciprofloxacine,ciprofloxacino,ciprofloxacinum,ciprofur,ciprogis,ciproktan,ciprolin,ciprolon,cipromycin,cipronex,ciprooxacin,cipropol,ciproquinol,ciprowin,ciproxan,ciproxin,ciproxina,ciproxine,ciriax,citeral,citopcin,cixan,corsacin,cunesin,cycin,cyprobay,cyproxan,disfabac,felixene,fimoflox,flociprin,floxacipron,flunas,globuce,inkamil,ipiflox,italnik,keefloxin,linhaliq,loxacid,loxan,lypro,megaflox,microgan,nixin,novidat,novoquin,ofitin,oftacilox,ophaflox,otiprio,phaproxin,piprol,plenolyt,probiox,proflaxin,proksi,proquin,proxacin,quinoflox,quinolid,quintor,quipro,rancif,renator,roflazin,roxytal,sepcen,septicide,septocipro,siprogut,sophixin,spitacin,strox,suiflox,superocin,supraflox,uritent,utiminx,velmonit,zumaflox" 1 "g" 0.8 "g" "101500-7,14031-9,14032-7,14058-2,14059-0,184-2,185-9,186-7,187-5,18906-8,20377-8,23621-6,25180-1,25181-9,25188-4,25189-2,25248-6,34636-1,3484-3,42644-5,55194-5,7002-9"
|
||||
"CIM" "Ciprofloxacin/metronidazole" "Fluoroquinolones,Quinolones" "J01RA10,QJ01RA10" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"CIO" "Ciprofloxacin/ornidazole" "Fluoroquinolones,Quinolones" "J01RA12,QJ01RA12" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"CIT" "Ciprofloxacin/tinidazole" "Fluoroquinolones,Quinolones" "J01RA11,QJ01RA11" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"CLR" 84029 "Clarithromycin" "Macrolides" "J01FA09,QJ01FA09" "Macrolides, lincosamides and streptogramins" "Macrolides" "ch,cla,clar,claryt,clm,clr" "abbotic,abboticine,astromen,biaxin,bicrolid,bristamycin,clacee,clacid,clacine,clambiotic,clarem,claribid,claricide,claridar,claripen,clarith,clarithromycine,clarithromycinum,claritromicina,clarosip,clathromycin,crixan,cyllid,cyllind,eratrex,esinol,fromilid,gallimycin,helas,heliclar,klabax,klacid,klaciped,klaricid,klarid,klarin,kofron,mabicrol,macladin,maclar,mavid,meberyt,pediamycin,qidmycin,veclam,wyamycin,zeclar" 0.5 "g" 1 "g" "100048-8,16619-9,16620-7,188-3,189-1,18907-6,190-9,191-7,20375-2,23619-0,25190-0,25191-8,25192-6,25253-6,34638-7,43987-7,43990-1,43991-9,7003-7,80559-8,89485-7"
|
||||
"CLA1" 5280980 "Clavulanic acid" "Other" "NA" "NA" "amonate,clavulanate,clavulanateacid,clavulansaeure,clavulansaure,clavulox,serdaxin" "NA"
|
||||
"CLX" 60063 "Clinafloxacin" "Fluoroquinolones,Quinolones" "NA" "clinaf" "NA" "32376-6,33284-1,35785-5,35786-3,7004-5"
|
||||
"CLI" 446598 "Clindamycin" "Lincosamides" "D10AF01,G01AA10,J01FF01,QD10AF01,QG01AA10,QJ01FF01" "Macrolides, lincosamides and streptogramins" "Lincosamides" "cc,cd,cli,clin,clin32,clinda,cm,da" "antirobe,chlolincocin,chlorlincocin,cleocin,clindamicina,clindamycine,clindamycinum,clinimycin,clinsol,clintabs,dalacine,klimicin,klindan,sobelin" 1.2 "g" 1.8 "g" "16621-5,16622-3,18908-4,192-5,193-3,194-1,195-8,25249-4,3486-8,42720-3,55657-1,55658-9,55659-7,55660-5,61188-9,7005-2"
|
||||
"CLI-S" "Clindamycin inducible screening test" "Lincosamides,Macrolides" "NA" "clin inducible,clinda inducible,clindamycin inducible" "NA" "NA"
|
||||
"CIP" 2764 "Ciprofloxacin" "Fluoroquinolones" "J01MA02,QJ01MA02,QS01AE03,QS02AA15,QS03AA07,S01AE03,S02AA15,S03AA07" "Quinolone antibacterials" "Fluoroquinolones" "ci,cip,cipr,ciprof,cp" "alcipro,bacquinor,baflox,belmacina,bernoflox,catex,cenin,ceprimax,cetraxal,ciflan,ciflosin,cifloxin,cilab,cilox,ciloxan,cipad,ciplus,ciprecu,ciprenit,ciprine,ciprinol,cipro,ciprobay,ciprocinal,ciprocinol,ciprodar,ciproflox,ciprofloxacina,ciprofloxacine,ciprofloxacino,ciprofloxacinum,ciprofur,ciprogis,ciproktan,ciprolin,ciprolon,cipromycin,cipronex,ciprooxacin,cipropol,ciproquinol,ciprowin,ciproxan,ciproxin,ciproxina,ciproxine,ciriax,citeral,citopcin,cixan,corsacin,cunesin,cycin,cyprobay,cyproxan,disfabac,felixene,fimoflox,flociprin,floxacipron,flunas,globuce,inkamil,ipiflox,italnik,keefloxin,linhaliq,loxacid,loxan,lypro,megaflox,microgan,nixin,novidat,novoquin,ofitin,oftacilox,ophaflox,otiprio,phaproxin,piprol,plenolyt,probiox,proflaxin,proksi,proquin,proxacin,quinoflox,quinolid,quintor,quipro,rancif,renator,roflazin,roxytal,sepcen,septicide,septocipro,siprogut,sophixin,spitacin,strox,suiflox,superocin,supraflox,uritent,utiminx,velmonit,zumaflox" 1 "g" 0.8 "g" "101500-7,14031-9,14032-7,14058-2,14059-0,184-2,185-9,186-7,187-5,18906-8,20377-8,23621-6,25180-1,25181-9,25188-4,25189-2,25248-6,34636-1,3484-3,42644-5,55194-5,7002-9"
|
||||
"CIM" "Ciprofloxacin/metronidazole" "Fluoroquinolones" "J01RA10,QJ01RA10" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"CIO" "Ciprofloxacin/ornidazole" "Fluoroquinolones" "J01RA12,QJ01RA12" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"CIT" "Ciprofloxacin/tinidazole" "Fluoroquinolones" "J01RA11,QJ01RA11" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"CLR" 84029 "Clarithromycin" "Macrolides/lincosamides" "J01FA09,QJ01FA09" "Macrolides, lincosamides and streptogramins" "Macrolides" "ch,cla,clar,claryt,clm,clr" "abbotic,abboticine,astromen,biaxin,bicrolid,bristamycin,clacee,clacid,clacine,clambiotic,clarem,claribid,claricide,claridar,claripen,clarith,clarithromycine,clarithromycinum,claritromicina,clarosip,clathromycin,crixan,cyllid,cyllind,eratrex,esinol,fromilid,gallimycin,helas,heliclar,klabax,klacid,klaciped,klaricid,klarid,klarin,kofron,mabicrol,macladin,maclar,mavid,meberyt,pediamycin,qidmycin,veclam,wyamycin,zeclar" 0.5 "g" 1 "g" "100048-8,16619-9,16620-7,188-3,189-1,18907-6,190-9,191-7,20375-2,23619-0,25190-0,25191-8,25192-6,25253-6,34638-7,43987-7,43990-1,43991-9,7003-7,80559-8,89485-7"
|
||||
"CLA1" 5280980 "Clavulanic acid" "Other antibacterials" "NA" "NA" "amonate,clavulanate,clavulanateacid,clavulansaeure,clavulansaure,clavulox,serdaxin" "NA"
|
||||
"CLX" 60063 "Clinafloxacin" "Fluoroquinolones" "NA" "clinaf" "NA" "32376-6,33284-1,35785-5,35786-3,7004-5"
|
||||
"CLI" 446598 "Clindamycin" "Macrolides/lincosamides" "D10AF01,G01AA10,J01FF01,QD10AF01,QG01AA10,QJ01FF01" "Macrolides, lincosamides and streptogramins" "Lincosamides" "cc,cd,cli,clin,clin32,clinda,cm,da" "antirobe,chlolincocin,chlorlincocin,cleocin,clindamicina,clindamycine,clindamycinum,clinimycin,clinsol,clintabs,dalacine,klimicin,klindan,sobelin" 1.2 "g" 1.8 "g" "16621-5,16622-3,18908-4,192-5,193-3,194-1,195-8,25249-4,3486-8,42720-3,55657-1,55658-9,55659-7,55660-5,61188-9,7005-2"
|
||||
"CLI-S" "Clindamycin inducible screening test" "Macrolides/lincosamides" "NA" "clin inducible,clinda inducible,clindamycin inducible" "NA" "NA"
|
||||
"CLF" 2794 "Clofazimine" "Antimycobacterials" "J04BA01,QJ04BA01" "Drugs for treatment of lepra" "Drugs for treatment of lepra" "clof,clofam" "chlofazimine,clofazimina,clofaziminum,colfazimine,lampren,lamprene,phenazine,riminophenazine" 0.1 "g" "16623-1,20376-0,23620-8,23627-3,43986-9,43988-5,43989-3,55661-3,55662-1,96108-6"
|
||||
"CLF1" 2799 "Clofoctol" "Other" "J01XX03,QJ01XX03" "Other antibacterials" "Other antibacterials" "NA" "clofoctolo,clofoctolum,gramplus,octofene,phenol" "NA"
|
||||
"CLM" 71807 "Clometocillin" "Penicillins,Beta-lactams" "J01CE07,QJ01CE07" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "chlomethocillin,clometacillin,clomethacillin,clomethocillin,clometocilina,clometocilline,clometocillinsalt,clometocillinum,penicilline,rixapen" 1 "g" "NA"
|
||||
"CLF1" 2799 "Clofoctol" "Other antibacterials" "J01XX03,QJ01XX03" "Other antibacterials" "Other antibacterials" "NA" "clofoctolo,clofoctolum,gramplus,octofene,phenol" "NA"
|
||||
"CLM" 71807 "Clometocillin" "Beta-lactams/penicillins" "J01CE07,QJ01CE07" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "chlomethocillin,clometacillin,clomethacillin,clomethocillin,clometocilina,clometocilline,clometocillinsalt,clometocillinum,penicilline,rixapen" 1 "g" "NA"
|
||||
"CLM1" 54680675 "Clomocycline" "Tetracyclines" "J01AA11,QJ01AA11" "Tetracyclines" "Tetracyclines" "NA" "clomociclina,clomocyclinum,megaclor" 1 "g" "NA"
|
||||
"CLB" 54706138 "Clorobiocin" "Aminocoumarins" "NA" "NA" "chlorobiocin" "NA"
|
||||
"CTR" 2812 "Clotrimazole" "Antifungals" "A01AB18,D01AC01,G01AF02,QA01AB18,QD01AC01,QG01AF02,QJ02AB90" "clot" "alevazol,bisphenyl,canesten,canestene,canestine,canifug,chlotrimazole,clomatin,clotrimaderm,clotrimazol,clotrimazolum,coltrimazole,cutistad,diphenylmethane,empecid,esparol,femmesil,footlogix,fortinia,gynix,imidazole,jidesheng,klotrimazole,lakesia,lombazol,lombazole,lombazolum,lotrimax,lotrimin,monobaycuten,mycelax,mycelex,mycofug,mycosporin,mykosporin,nalbix,otomax,pedesil,pedisafe,ringworm,stiemazol,tibatin,trimysten,trivagizole" "10653-4,10654-2,18909-2,54177-1,55663-9"
|
||||
"CLO" 6098 "Cloxacillin" "Isoxazolylpenicillins,Penicillins,Beta-lactams" "J01CF02,QJ01CF02,QJ51CF02,QS01AA90" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "clox,cloxac" "ankerbin,austrastaph,biocloxin,brispen,chloroxacillin,ciclex,clocil,clossacillina,cloxacilina,cloxacillinanhydrous,cloxacilline,cloxacillinsalt,cloxacillinum,cloxapen,constaphyl,dariclox,dichlorstapenor,diclocil,dicloxacillinhydrate,diflor,digloxilline,dynapen,ekvacillin,gelstaph,novapen,noxaben,orbenin,pathocil,stampen,staphybiotic,syntarpen,syntarpensalt,tegopen" 2 "g" 2 "g" "16628-0,18910-0,196-6,197-4,198-2,199-0,25250-2,55664-7"
|
||||
"CTR" 2812 "Clotrimazole" "Antifungals/antimycotics" "A01AB18,D01AC01,G01AF02,QA01AB18,QD01AC01,QG01AF02,QJ02AB90" "clot" "alevazol,bisphenyl,canesten,canestene,canestine,canifug,chlotrimazole,clomatin,clotrimaderm,clotrimazol,clotrimazolum,coltrimazole,cutistad,diphenylmethane,empecid,esparol,femmesil,footlogix,fortinia,gynix,imidazole,jidesheng,klotrimazole,lakesia,lombazol,lombazole,lombazolum,lotrimax,lotrimin,monobaycuten,mycelax,mycelex,mycofug,mycosporin,mykosporin,nalbix,otomax,pedesil,pedisafe,ringworm,stiemazol,tibatin,trimysten,trivagizole" "10653-4,10654-2,18909-2,54177-1,55663-9"
|
||||
"CLO" 6098 "Cloxacillin" "Beta-lactams/penicillins" "J01CF02,QJ01CF02,QJ51CF02,QS01AA90" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "clox,cloxac" "ankerbin,austrastaph,biocloxin,brispen,chloroxacillin,ciclex,clocil,clossacillina,cloxacilina,cloxacillinanhydrous,cloxacilline,cloxacillinsalt,cloxacillinum,cloxapen,constaphyl,dariclox,dichlorstapenor,diclocil,dicloxacillinhydrate,diflor,digloxilline,dynapen,ekvacillin,gelstaph,novapen,noxaben,orbenin,pathocil,stampen,staphybiotic,syntarpen,syntarpensalt,tegopen" 2 "g" 2 "g" "16628-0,18910-0,196-6,197-4,198-2,199-0,25250-2,55664-7"
|
||||
"COL" 5311054 "Colistin" "Polymyxins" "A07AA10,J01XB01,QA07AA10,QJ01XB01,QJ51XB01" "Other antibacterials" "Polymyxins" "cl,coli,colist,cs,cst,ct" "colimycin,colisticin,colisticina,colistina,colistine,colistinum,colobreathe,colomycin,kangdisu,kolimitsin,kolimycin,promixin,sogecoli,totazina" 9 "MU" 9 "MU" "16645-4,18912-6,204-8,205-5,206-3,207-1,29493-4,33333-6"
|
||||
"COP" "Colistin/polysorbate" "Other" "NA" "NA" "NA" "NA"
|
||||
"COP" "Colistin/polysorbate" "Other antibacterials" "NA" "NA" "NA" "NA"
|
||||
"CYC" 6234 "Cycloserine" "Oxazolidinones" "J04AB01,QJ04AB01" "Drugs for treatment of tuberculosis" "Antibiotics" "cycl,cyclos" "cicloserina,closina,cyclorin,cycloserin,cycloserinum,farmiserina,levcicloserina,levcycloserine,levcycloserinum,micoserina,miroserina,miroseryn,novoserin,oxamicina,oxamycin,seromycin,tebemicina,wasserina" 0.75 "g" "16702-3,18914-2,212-1,213-9,214-7,215-4,23608-3,25207-2,25208-0,25209-8,25251-0,3519-6,55667-0"
|
||||
"DAL" 23724878 "Dalbavancin" "Lipoglycopeptides,Glycopeptides,Peptides" "J01XA04,QJ01XA04" "Other antibacterials" "Glycopeptide antibacterials" "dalb,dalbav" "dalbavancina,dalvance,xydalba,zeven" 1.5 "g" "41688-3,41689-1,41690-9,41734-5"
|
||||
"DAN" 71335 "Danofloxacin" "Fluoroquinolones,Quinolones" "QJ01MA92" "danofl" "advocin,danofloxacine,danofloxacino,danofloxacinum" "73601-7,73623-1,73646-2"
|
||||
"DPS" 2955 "Dapsone" "Other" "D10AX05,J04BA02,QD10AX05,QJ04BA02" "Drugs for treatment of lepra" "Drugs for treatment of lepra" "dao" "aczone,atrisone,avlosulfon,avlosulfone,avlosulphone,benzenamide,benzenamine,bissulfone,bissulphone,croysulfone,croysulphone,dapson,dapsona,dapsonum,daspone,diaphenylsulfon,diaphenylsulfone,diaphenylsulphon,diaphenylsulphone,diphenasone,diphone,disulfone,disulone,disulphone,dubronax,dumitone,eporal,medapsol,novophone,servidapson,sulfadione,sulfona,sulfonyldianiline,sulphadione,sulphonyldianiline,tarimyl,udolac,undolac" 50 "mg" "51698-9,9747-7"
|
||||
"DAP" 16134395 "Daptomycin" "Peptides" "J01XX09,QJ01XX09" "Other antibacterials" "Other antibacterials" "dap,dapt,dapt25,dapt50,daptom" "cidecin,cubicin,dapcin,daptomicina,daptomycine,daptomycinum,deptomycin" 0.28 "g" "35787-1,35788-9,35789-7,41691-7"
|
||||
"DFX" 487101 "Delafloxacin" "Fluoroquinolones,Quinolones" "J01MA23,QJ01MA23" "NA" "baxdela,delafloxacinum,quofenix" 0.9 "g" 0.6 "g" "88885-9,90447-4,93790-4"
|
||||
"DAL" 23724878 "Dalbavancin" "Glycopeptides" "J01XA04,QJ01XA04" "Other antibacterials" "Glycopeptide antibacterials" "dalb,dalbav" "dalbavancina,dalvance,xydalba,zeven" 1.5 "g" "41688-3,41689-1,41690-9,41734-5"
|
||||
"DAN" 71335 "Danofloxacin" "Fluoroquinolones" "QJ01MA92" "danofl" "advocin,danofloxacine,danofloxacino,danofloxacinum" "73601-7,73623-1,73646-2"
|
||||
"DPS" 2955 "Dapsone" "Other antibacterials" "D10AX05,J04BA02,QD10AX05,QJ04BA02" "Drugs for treatment of lepra" "Drugs for treatment of lepra" "NA" "aczone,atrisone,avlosulfon,avlosulfone,avlosulphone,benzenamide,benzenamine,bissulfone,bissulphone,croysulfone,croysulphone,dapson,dapsona,dapsonum,daspone,diaphenylsulfon,diaphenylsulfone,diaphenylsulphon,diaphenylsulphone,diphenasone,diphone,disulfone,disulone,disulphone,dubronax,dumitone,eporal,medapsol,novophone,servidapson,sulfadione,sulfona,sulfonyldianiline,sulphadione,sulphonyldianiline,tarimyl,udolac,undolac" 50 "mg" "51698-9,9747-7"
|
||||
"DAP" 16134395 "Daptomycin" "Other antibacterials" "J01XX09,QJ01XX09" "Other antibacterials" "Other antibacterials" "dap,dapt,dapt25,dapt50,daptom" "cidecin,cubicin,dapcin,daptomicina,daptomycine,daptomycinum,deptomycin" 0.28 "g" "35787-1,35788-9,35789-7,41691-7"
|
||||
"DFX" 487101 "Delafloxacin" "Fluoroquinolones" "J01MA23,QJ01MA23" "NA" "baxdela,delafloxacinum,quofenix" 0.9 "g" 0.6 "g" "88885-9,90447-4,93790-4"
|
||||
"DLM" 6480466 "Delamanid" "Antimycobacterials" "J04AK06,QJ04AK06" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "dela" "deltyba" 0.2 "g" "93851-4,96109-4"
|
||||
"DEM" 54680690 "Demeclocycline" "Tetracyclines" "D06AA01,J01AA01,QD06AA01,QJ01AA01" "Tetracyclines" "Tetracyclines" "demecy" "demeclociclina,demeclocyclinum" 0.6 "g" "10982-7,18915-9,216-2,217-0,218-8,219-6,29494-2,7006-0"
|
||||
"DKB" 470999 "Dibekacin" "Aminoglycosides" "J01GB09,QJ01GB09,QS01AA29,S01AA29" "Aminoglycoside antibacterials" "Other aminoglycosides" "dibeka" "debecacin,dibekacina,dibekacine,dibekacinum,kappati,panamicin" 0.14 "g" "55669-6,55670-4,55671-2,55672-0"
|
||||
"DIC" 18381 "Dicloxacillin" "Isoxazolylpenicillins,Penicillins,Beta-lactams" "J01CF01,QJ01CF01,QJ51CF01" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "dicl,diclox" "dichloroxacillin,diclossacillina,dicloxaciclin,dicloxacilin,dicloxacilina,dicloxacillina,dicloxacilline,dicloxacillinum,dicloxacycline,maclicine" 2 "g" 2 "g" "10984-3,16769-2,18916-7,220-4,221-2,222-0,223-8,25252-8,32380-8,55668-8"
|
||||
"DIF" 56206 "Difloxacin" "Fluoroquinolones,Quinolones" "QJ01MA94" "diflox" "dicural,difloxacine,pulsaflox" "35790-5,35791-3,35792-1"
|
||||
"DIR" 6473883 "Dirithromycin" "Macrolides" "J01FA13,QJ01FA13" "Macrolides, lincosamides and streptogramins" "Macrolides" "dirith" "dirithromycine,dirithromycinum,diritromicina,divitross,dynabac,noriclan,valodin" 0.5 "g" "35793-9,35794-7,35795-4,7007-8"
|
||||
"DOR" 73303 "Doripenem" "Carbapenems,Beta-lactams" "J01DH04,QJ01DH04" "Other beta-lactam antibacterials" "Carbapenems" "dori,doripe" "doribax,dripenem,finibax" 1.5 "g" "56031-8,58711-3,60535-2,72893-1"
|
||||
"DIC" 18381 "Dicloxacillin" "Beta-lactams/penicillins" "J01CF01,QJ01CF01,QJ51CF01" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "dicl,diclox" "dichloroxacillin,diclossacillina,dicloxaciclin,dicloxacilin,dicloxacilina,dicloxacillina,dicloxacilline,dicloxacillinum,dicloxacycline,maclicine" 2 "g" 2 "g" "10984-3,16769-2,18916-7,220-4,221-2,222-0,223-8,25252-8,32380-8,55668-8"
|
||||
"DIF" 56206 "Difloxacin" "Fluoroquinolones" "QJ01MA94" "diflox" "dicural,difloxacine,pulsaflox" "35790-5,35791-3,35792-1"
|
||||
"DIR" 6473883 "Dirithromycin" "Macrolides/lincosamides" "J01FA13,QJ01FA13" "Macrolides, lincosamides and streptogramins" "Macrolides" "dirith" "dirithromycine,dirithromycinum,diritromicina,divitross,dynabac,noriclan,valodin" 0.5 "g" "35793-9,35794-7,35795-4,7007-8"
|
||||
"DOR" 73303 "Doripenem" "Carbapenems" "J01DH04,QJ01DH04" "Other beta-lactam antibacterials" "Carbapenems" "dori,doripe" "doribax,dripenem,finibax" 1.5 "g" "56031-8,58711-3,60535-2,72893-1"
|
||||
"DOX" 54671203 "Doxycycline" "Tetracyclines" "A01AB22,J01AA02,QA01AB22,QJ01AA02" "Tetracyclines" "Tetracyclines" "dox,doxy,doxycy" "abbocin,alamycin,aquacycline,biosolvomycin,biotet,bisolvomycin,chrysocin,dalimycin,dalinmycin,deoxymykoin,dossiciclina,doxiciclina,doxirobe,doxitard,doxivetin,doxycen,doxychel,doxycin,doxycyclin,doxycyclinum,doxylin,doxysol,doxytetracycline,elinton,engemycin,hydrocyclin,imperacin,intaloxin,investin,jenacyclin,liquachel,liviatin,macodyn,mepatar,microdox,mondoxyne,monodox,morgidox,ocudox,okebo,oracea,otetryn,oxacycline,oxamycen,oxatet,oxlopar,oxybiocycline,oxydon,oxyject,oxymykoin,oxysteclin,oxytet,oxytetral,oxytetrin,oxytracyl,oxyvet,stecsolin,supracyclin,terraject,terramycin,toxinal,unimycin,vendarcin,vibramycin,vibramycine,vivox,zenavod" 0.1 "g" 0.1 "g" "10986-8,18917-5,20379-4,21250-6,224-6,225-3,226-1,227-9,23623-2,25223-9,26902-7,7008-6"
|
||||
"ECO" 3198 "Econazole" "Antifungals" "D01AC03,G01AF05,QD01AC03,QG01AF05" "Antifungals for topical use" "Imidazole and triazole derivatives" "econ" "bromazil,chloramizol,clinafarm,deccosil,deccozil,econazolum,ecostatin,ekonazole,enilconazol,enilconazole,eniloconazol,fecundal,florasan,freshgard,freshguard,fungaflor,fungazil,imaverol,imaversol,imazalil,magnate,spectazole" "25595-0,25637-0,54178-9,55673-8"
|
||||
"ECO" 3198 "Econazole" "Antifungals/antimycotics" "D01AC03,G01AF05,QD01AC03,QG01AF05" "Antifungals for topical use" "Imidazole and triazole derivatives" "econ" "bromazil,chloramizol,clinafarm,deccosil,deccozil,econazolum,ecostatin,ekonazole,enilconazol,enilconazole,eniloconazol,fecundal,florasan,freshgard,freshguard,fungaflor,fungazil,imaverol,imaversol,imazalil,magnate,spectazole" "25595-0,25637-0,54178-9,55673-8"
|
||||
"EFF" "Efflux" "Other" "NA" "effflux pump" "NA" "NA"
|
||||
"ENX" 3229 "Enoxacin" "Fluoroquinolones,Quinolones" "J01MA04,QJ01MA04" "Quinolone antibacterials" "Fluoroquinolones" "enox,enoxa" "abenox,almitil,bactidan,bactidron,comprecin,enofloxacine,enoksetin,enoram,enoxacina,enoxacine,enoxacino,enoxacinum,enoxen,enoxin,enoxor,flumark,penetrex" 0.8 "g" "16816-1,18918-3,228-7,229-5,230-3,231-1,3590-7,41692-5"
|
||||
"ENR" 71188 "Enrofloxacin" "Fluoroquinolones,Quinolones" "QJ01MA90" "enrofl" "baytril,enroflox,enrofloxacine,enrofloxacino,enrofloxacinum,enroquin,enrosite,enroxil,quellaxcin,tenotryl,zobuxa" "23712-3,35796-2,35797-0,35798-8"
|
||||
"ENX" 3229 "Enoxacin" "Fluoroquinolones" "J01MA04,QJ01MA04" "Quinolone antibacterials" "Fluoroquinolones" "enox,enoxa" "abenox,almitil,bactidan,bactidron,comprecin,enofloxacine,enoksetin,enoram,enoxacina,enoxacine,enoxacino,enoxacinum,enoxen,enoxin,enoxor,flumark,penetrex" 0.8 "g" "16816-1,18918-3,228-7,229-5,230-3,231-1,3590-7,41692-5"
|
||||
"ENR" 71188 "Enrofloxacin" "Fluoroquinolones" "QJ01MA90" "enrofl" "baytril,enroflox,enrofloxacine,enrofloxacino,enrofloxacinum,enroquin,enrosite,enroxil,quellaxcin,tenotryl,zobuxa" "23712-3,35796-2,35797-0,35798-8"
|
||||
"ENV" 135565326 "Enviomycin" "Antimycobacterials" "J04AB06,QJ04AB06" "tuberactinomycin" "enviomicina,enviomycina,enviomycine,enviomycinum,tuberactin" 1 "g" "NA"
|
||||
"EPE" "Eperozolid" "Other" "NA" "NA" "NA" "NA"
|
||||
"EPC" 71392 "Epicillin" "Penicillins,Beta-lactams" "J01CA07,QJ01CA07" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "NA" "dexacillin,dihydroampicillin,epicilina,epicilline,epicillinum,spectacillin" 2 "g" 2 "g" "NA"
|
||||
"EPP" 68916 "Epiroprim" "Other" "NA" "NA" "epiroprima,epiroprime,epiroprimum" "NA"
|
||||
"EPE" "Eperozolid" "Other antibacterials" "NA" "NA" "NA" "NA"
|
||||
"EPC" 71392 "Epicillin" "Beta-lactams/penicillins" "J01CA07,QJ01CA07" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "NA" "dexacillin,dihydroampicillin,epicilina,epicilline,epicillinum,spectacillin" 2 "g" 2 "g" "NA"
|
||||
"EPP" 68916 "Epiroprim" "Other antibacterials" "NA" "NA" "epiroprima,epiroprime,epiroprimum" "NA"
|
||||
"ERV" 54726192 "Eravacycline" "Tetracyclines" "J01AA13,QJ01AA13" "Tetracyclines" "Tetracyclines" "erav" "xerava" 0.14 "g" "100049-6,85423-2,93767-2"
|
||||
"ETP" 150610 "Ertapenem" "Carbapenems,Beta-lactams" "J01DH03,QJ01DH03" "Other beta-lactam antibacterials" "Carbapenems" "erta,ertape,etp" "ertapenemsalt,invanz" 1 "g" "101486-9,35799-6,35800-2,35801-0,35802-8"
|
||||
"ERY" 12560 "Erythromycin" "Macrolides" "D10AF02,J01FA01,QD10AF02,QJ01FA01,QJ51FA01,QS01AA17,S01AA17" "Macrolides, lincosamides and streptogramins" "Macrolides" "e,em,ery,ery32,eryt,eryth" "abboticin,abomacetin,acneryne,acnesol,aknemycin,aknin,benzamycin,derimer,deripil,dotycin,dumotrycin,emgel,emuvin,emycin,endoeritrin,erecin,erisone,eritomicina,eritrocina,eritromicina,ermycin,eryacne,eryacnen,erycen,erycette,erycinum,eryderm,erydermer,erygel,eryhexal,erymax,erymed,erysafe,erytab,erythro,erythroderm,erythrogran,erythroguent,erythromast,erythromid,erythromycine,erythromycinum,erytop,erytrociclin,ilocaps,ilosone,iloticina,ilotycin,inderm,latotryd,lederpax,mephamycin,mercina,oftamolets,pantoderm,pantodrin,pantomicina,pharyngocin,primacine,propiocine,proterytrin,retcin,robimycin,sansac,spotex,staticin,stiemicyn,stiemycin,tiprocin,torlamicina,wemid" 2 "g" 1 "g" "100050-4,11576-6,12298-6,16829-4,16830-2,18919-1,18920-9,20380-2,232-9,233-7,234-5,235-2,236-0,23633-1,237-8,238-6,239-4,25224-7,25275-9,3597-2,7009-4"
|
||||
"ETH" 14052 "Ethambutol" "Antimycobacterials" "J04AK02,QJ04AK02" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "emb,etha,ethamb" "aethambutolum,dadibutol,diambutol,etambutol,etambutolo,ethambutolum,myambutol,purderal,servambutol,tibutol" 1.2 "g" 1.2 "g" "100051-2,16841-9,18921-7,20381-0,23625-7,240-2,241-0,242-8,243-6,25187-6,25194-2,25195-9,25230-4,25404-5,3607-9,42645-2,42646-0,55154-9,55674-6,56025-0,7010-2,89491-5"
|
||||
"ETP" 150610 "Ertapenem" "Carbapenems" "J01DH03,QJ01DH03" "Other beta-lactam antibacterials" "Carbapenems" "erta,ertape,etp" "ertapenemsalt,invanz" 1 "g" "101486-9,35799-6,35800-2,35801-0,35802-8"
|
||||
"ERY" 12560 "Erythromycin" "Macrolides/lincosamides" "D10AF02,J01FA01,QD10AF02,QJ01FA01,QJ51FA01,QS01AA17,S01AA17" "Macrolides, lincosamides and streptogramins" "Macrolides" "e,em,ery,ery32,eryt,eryth" "abboticin,abomacetin,acneryne,acnesol,aknemycin,aknin,benzamycin,derimer,deripil,dotycin,dumotrycin,emgel,emuvin,emycin,endoeritrin,erecin,erisone,eritomicina,eritrocina,eritromicina,ermycin,eryacne,eryacnen,erycen,erycette,erycinum,eryderm,erydermer,erygel,eryhexal,erymax,erymed,erysafe,erytab,erythro,erythroderm,erythrogran,erythroguent,erythromast,erythromid,erythromycine,erythromycinum,erytop,erytrociclin,ilocaps,ilosone,iloticina,ilotycin,inderm,latotryd,lederpax,mephamycin,mercina,oftamolets,pantoderm,pantodrin,pantomicina,pharyngocin,primacine,propiocine,proterytrin,retcin,robimycin,sansac,spotex,staticin,stiemicyn,stiemycin,tiprocin,torlamicina,wemid" 2 "g" 1 "g" "100050-4,11576-6,12298-6,16829-4,16830-2,18919-1,18920-9,20380-2,232-9,233-7,234-5,235-2,236-0,23633-1,237-8,238-6,239-4,25224-7,25275-9,3597-2,7009-4"
|
||||
"ETH" 14052 "Ethambutol" "Antimycobacterials" "J04AK02,QJ04AK02" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "etha,ethamb" "aethambutolum,dadibutol,diambutol,etambutol,etambutolo,ethambutolum,myambutol,purderal,servambutol,tibutol" 1.2 "g" 1.2 "g" "100051-2,16841-9,18921-7,20381-0,23625-7,240-2,241-0,242-8,243-6,25187-6,25194-2,25195-9,25230-4,25404-5,3607-9,42645-2,42646-0,55154-9,55674-6,56025-0,7010-2,89491-5"
|
||||
"ETI" 456476 "Ethambutol/isoniazid" "Antimycobacterials" "J04AM03,QJ04AM03" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"ETI1" 2761171 "Ethionamide" "Antimycobacterials" "J04AD03,QJ04AD03" "Drugs for treatment of tuberculosis" "Thiocarbamide derivatives" "ethi,ethion" "aethionamidum,aetina,aetiva,amidazin,amidazine,atina,ethimide,ethina,ethinamide,ethionamidum,ethioniamide,ethylisothiamide,ethyonomide,etimid,etiocidan,etionamid,etionamida,etionamide,etioniamid,etionid,etionizin,etionizina,etionizine,fatoliamid,iridocin,iridozin,isothin,isotiamida,itiocide,nicotion,nisotin,nizotin,rigenicid,sertinon,teberus,thianid,thianide,thioamide,thiodine,thiomid,thioniden,tianid,tiomid,trecator,trekator,trescatyl,trescazide,tubenamide,tubermin,tuberoid,tuberoson" 0.75 "g" "16099-4,16845-0,18922-5,20382-8,23617-4,25183-5,25196-7,25198-3,25231-2,41693-3,42647-8,42648-6,7011-0,96110-2"
|
||||
"ETO" 6034 "Ethopabate" "Other" "QP51AX17" "NA" "ethopabat" "NA"
|
||||
"EXE" "Exebacase" "Other" "NA" "NA" "NA" "NA"
|
||||
"FAR" 65894 "Faropenem" "Other" "J01DI03,QJ01DI03" "Other beta-lactam antibacterials" "Other cephalosporins and penems" "farope" "farom,faropenemhydrate,faropenemsalt,fropenem,fropenum,furopenem" 0.75 "g" "73600-9,73622-3,73645-4"
|
||||
"FDX" 10034073 "Fidaxomicin" "Other" "A07AA12,QA07AA12" "NA" "dificid,dificlir,difimicin,fidaxomicina,lipiarmicin,lipiarmycin,lipiarrmycin" 0.4 "g" "73599-3,73621-5,73644-7"
|
||||
"FIN" 11567473 "Finafloxacin" "Fluoroquinolones,Quinolones" "NA" "NA" "xtoro" "73598-5,73620-7,73643-9"
|
||||
"FLA" 46783781 "Flavomycin" "Other" "NA" "flavom" "bambermicina,bambermycine,bambermycinum,flavofosfolipol,flavophospholipol,gainpro,menomycin" "NA"
|
||||
"FLE" 3357 "Fleroxacin" "Fluoroquinolones,Quinolones" "J01MA08,QJ01MA08" "Quinolone antibacterials" "Fluoroquinolones" "fler,flerox" "fleroxacine,fleroxacino,fleroxacinum,fleroxicin,megalocin,megalone,megalosin,quinodis" 0.4 "g" 0.4 "g" "25411-0,32372-5,35806-9,7012-8"
|
||||
"FLO" 65864 "Flomoxef" "Other" "J01DC14,QJ01DC14" "flomox" "flomoxefo,flomoxefsalt,flomoxefum,flumarin" 2 "g" "100052-0,53822-3"
|
||||
"ETO" 6034 "Ethopabate" "Other antibacterials" "QP51AX17" "NA" "ethopabat" "NA"
|
||||
"EXE" "Exebacase" "NA" "NA" "NA" "NA"
|
||||
"FAR" 65894 "Faropenem" "Other antibacterials" "J01DI03,QJ01DI03" "Other beta-lactam antibacterials" "Other cephalosporins and penems" "farope" "farom,faropenemhydrate,faropenemsalt,fropenem,fropenum,furopenem" 0.75 "g" "73600-9,73622-3,73645-4"
|
||||
"FDX" 10034073 "Fidaxomicin" "Other antibacterials" "A07AA12,QA07AA12" "NA" "dificid,dificlir,difimicin,fidaxomicina,lipiarmicin,lipiarmycin,lipiarrmycin" 0.4 "g" "73599-3,73621-5,73644-7"
|
||||
"FIN" 11567473 "Finafloxacin" "Fluoroquinolones" "NA" "NA" "xtoro" "73598-5,73620-7,73643-9"
|
||||
"FLA" 46783781 "Flavomycin" "Other antibacterials" "NA" "flavom" "bambermicina,bambermycine,bambermycinum,flavofosfolipol,flavophospholipol,gainpro,menomycin" "NA"
|
||||
"FLE" 3357 "Fleroxacin" "Fluoroquinolones" "J01MA08,QJ01MA08" "Quinolone antibacterials" "Fluoroquinolones" "fler,flerox" "fleroxacine,fleroxacino,fleroxacinum,fleroxicin,megalocin,megalone,megalosin,quinodis" 0.4 "g" 0.4 "g" "25411-0,32372-5,35806-9,7012-8"
|
||||
"FLO" 65864 "Flomoxef" "Other antibacterials" "J01DC14,QJ01DC14" "flomox" "flomoxefo,flomoxefsalt,flomoxefum,flumarin" 2 "g" "100052-0,53822-3"
|
||||
"FLR" 114811 "Florfenicol" "Phenicols" "QJ01BA90,QJ51BA90" "florfe" "aquafen,descocin,dexawin,efnicol,fricol,hyrazin,loncor,macphenicol,masatirin,neomyson,norfenicol,nuflor,racephenicol,rincrol,thiamcol,urfamicina,urophenyl" "23740-4,35807-7,35808-5,87599-7"
|
||||
"FLC" 21319 "Flucloxacillin" "Isoxazolylpenicillins,Penicillins,Beta-lactams" "J01CF05,QJ01CF05,QJ51CF05" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "clox,fluclo,flux" "bactopen,cloxacap,cloxacillinhydrate,cloxypen,floxacillin,floxacillinanhydrous,floxapen,floxapensalt,fluclomix,flucloxacilina,flucloxacilline,flucloxacillinum,flucloxin,fluorochloroxacillin,galfloxin,latocillin,orbeninhydrate,rimaflox,staphobristol,zoxin" 2 "g" 2 "g" "NA"
|
||||
"FLU" 3365 "Fluconazole" "Antifungals" "D01AC15,J02AC01,QD01AC15,QJ02AC01" "Antimycotics for systemic use" "Triazole derivatives" "fluc,flucon,fluz,flz" "alflucoz,alkanazole,baten,biocanol,biozole,biozolene,canzol,cryptal,diflazon,diflucan,dimycon,elazor,flucazol,fluconazoli,fluconazolum,flucoral,flucostat,flukezol,flunazol,flunizol,fluzon,forcan,fuconal,fungata,loitin,mutum,oxifugol,pritenzol,syscan,trican,triconal,triflucan,zemyc,zoltec,zonal" 0.2 "g" 0.2 "g" "10987-6,16870-8,18924-1,248-5,249-3,250-1,251-9,25255-1,7013-6,80530-9"
|
||||
"FCT" 3366 "Flucytosine" "Antifungals" "D01AE21,J02AX01,QD01AE21,QJ02AX01" "Antifungals for topical use" "Other antifungals for topical use" "5flc,fcu,flucyt,fluo,fluy" "alcobon,ancoban,ancobon,ancotil,ancotyl,flourocytosine,flucitosina,flucytosin,flucytosinum,flucytosone,fluocytosine,fluorcytosine,fluorocytosine" 10 "g" 10 "g" "NA"
|
||||
"FLC" 21319 "Flucloxacillin" "Beta-lactams/penicillins" "J01CF05,QJ01CF05,QJ51CF05" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "clox,fluclo,flux" "bactopen,cloxacap,cloxacillinhydrate,cloxypen,floxacillin,floxacillinanhydrous,floxapen,floxapensalt,fluclomix,flucloxacilina,flucloxacilline,flucloxacillinum,flucloxin,fluorochloroxacillin,galfloxin,latocillin,orbeninhydrate,rimaflox,staphobristol,zoxin" 2 "g" 2 "g" "NA"
|
||||
"FLU" 3365 "Fluconazole" "Antifungals/antimycotics" "D01AC15,J02AC01,QD01AC15,QJ02AC01" "Antimycotics for systemic use" "Triazole derivatives" "fluc,flucon,fluz,flz" "alflucoz,alkanazole,baten,biocanol,biozole,biozolene,canzol,cryptal,diflazon,diflucan,dimycon,elazor,flucazol,fluconazoli,fluconazolum,flucoral,flucostat,flukezol,flunazol,flunizol,fluzon,forcan,fuconal,fungata,loitin,mutum,oxifugol,pritenzol,syscan,trican,triconal,triflucan,zemyc,zoltec,zonal" 0.2 "g" 0.2 "g" "10987-6,16870-8,18924-1,248-5,249-3,250-1,251-9,25255-1,7013-6,80530-9"
|
||||
"FCT" 3366 "Flucytosine" "Antifungals/antimycotics" "D01AE21,J02AX01,QD01AE21,QJ02AX01" "Antifungals for topical use" "Other antifungals for topical use" "5flc,fcu,flucyt,fluo,fluy" "alcobon,ancoban,ancobon,ancotil,ancotyl,flourocytosine,flucitosina,flucytosin,flucytosinum,flucytosone,fluocytosine,fluorcytosine,fluorocytosine" 10 "g" 10 "g" "NA"
|
||||
"FLM" 3374 "Flumequine" "Quinolones" "J01MB07,QJ01MB07" "Quinolone antibacterials" "Other quinolones" "flumeq" "apurone,fantacin,flumequina,flumequino,flumequinum,flumigal,flumiquil,flumisol,flumix,imequyl" 1.2 "g" "55675-3,55676-1,55677-9,55678-7"
|
||||
"FLR1" 71260 "Flurithromycin" "Macrolides" "J01FA14,QJ01FA14" "Macrolides, lincosamides and streptogramins" "Macrolides" "NA" "abbot,beritromicina,berythromycin,berythromycine,berythromycinum,flurithromycine,flurithromycinum,fluritromicina,fluritromycinum,flurizic,mizar" 0.75 "g" "NA"
|
||||
"FFL" 214356 "Fosfluconazole" "Antifungals" "NA" "NA" "fosfluconazol,procif,prodif" "NA"
|
||||
"FOS" 446987 "Fosfomycin" "Phosphonics" "J01XX01,QJ01XX01,QS02AA17,S02AA17" "Other antibacterials" "Other antibacterials" "ff,fm,fo,fof,fos,fosf,fosfom,fosmyc" "fosfocina,fosfomicin,fosfomicina,fosfomycine,fosfomycinum,fosfonomycin,infectophos,phosphonemycin,phosphonomycin,veramina" 3 "g" 8 "g" "25596-8,25653-7,35809-3,35810-1"
|
||||
"FMD" 572 "Fosmidomycin" "Other" "NA" "NA" "fosmidomicina,fosmidomycina,fosmidomycine,fosmidomycinsalt,fosmidomycinum" "NA"
|
||||
"FLR1" 71260 "Flurithromycin" "Macrolides/lincosamides" "J01FA14,QJ01FA14" "Macrolides, lincosamides and streptogramins" "Macrolides" "NA" "abbot,beritromicina,berythromycin,berythromycine,berythromycinum,flurithromycine,flurithromycinum,fluritromicina,fluritromycinum,flurizic,mizar" 0.75 "g" "NA"
|
||||
"FFL" 214356 "Fosfluconazole" "Antifungals/antimycotics" "NA" "NA" "fosfluconazol,procif,prodif" "NA"
|
||||
"FOS" 446987 "Fosfomycin" "Other antibacterials" "J01XX01,QJ01XX01,QS02AA17,S02AA17" "Other antibacterials" "Other antibacterials" "ff,fm,fo,fof,fos,fosf,fosfom,fosmyc" "fosfocina,fosfomicin,fosfomicina,fosfomycine,fosfomycinum,fosfonomycin,infectophos,phosphonemycin,phosphonomycin,veramina" 3 "g" 8 "g" "25596-8,25653-7,35809-3,35810-1"
|
||||
"FMD" 572 "Fosmidomycin" "Other antibacterials" "NA" "NA" "fosmidomicina,fosmidomycina,fosmidomycine,fosmidomycinsalt,fosmidomycinum" "NA"
|
||||
"FRM" 8378 "Framycetin" "Aminoglycosides" "D09AA01,QD09AA01,QJ01GB91,QR01AX08,QS01AA07,R01AX08,S01AA07" "fram,framyc" "actilin,actiline,antibiotique,bycomycin,enterfram,fradiomycin,fradiomycinum,framicetina,framidal,framycetine,framycetinum,framycin,framygen,francetin,jernadex,myacyne,mycerin,mycifradin,neobrettin,neolate,neomas,neomcin,neomicina,neomin,neomycine,neomycinum,nivemycin,soframycin,soframycine" "18926-6,257-6,258-4,259-2,260-0,55679-5"
|
||||
"FUR" 6870646 "Furazidin" "Nitrofurans" "J01XE03,QJ01XE03" "Other antibacterials" "Nitrofuran derivatives" "NA" "akritoin,furagin,furaginum,furamag,furazidine,hydantoin" 0.3 "g" "NA"
|
||||
"FRZ" 5323714 "Furazolidone" "Nitrofurans" "G01AX06,QG01AX06,QJ01XE90" "furazo" "bifuron,corizium,coryzium,diafuron,enterotoxon,furall,furanzolidone,furaxon,furaxone,furazolidine,furazolidon,furazolidona,furazolidonum,furazolum,furidon,furmethoxadone,furovag,furoxal,furoxane,furoxon,furoxone,furozolidine,giardil,giarlam,medaron,neftin,nicolen,nifulidone,nifuran,nifurazolidone,nifurazolidonum,nitrofuradoxon,nitrofurazolidone,nitrofurazolidonum,nitrofuroxon,optazol,ortazol,puradin,roptazol,sclaventerol,tikofuran,topazone,trichofuron,tricofuron,tricoron,trifurox,viofuragyn" "69574-2,87794-4"
|
||||
"FUS" 3000226 "Fusidic acid" "Fusidanes" "D06AX01,D09AA02,J01XC01,QD06AX01,QD09AA02,QJ01XC01,QS01AA13,S01AA13" "Other antibacterials" "Steroid antibacterials" "fa,fusaci,fusi" "flucidin,fucidate,fucidina,fucidine,fucithalmic,fusidate,fusidicacid,fusidin,fusidine,taksta" 1.5 "g" 1.5 "g" "NA"
|
||||
"GAM" 59364992 "Gamithromycin" "Macrolides" "QJ01FA95" "NA" "zactran" "100054-6,88376-9,88378-5"
|
||||
"GRN" 124093 "Garenoxacin" "Fluoroquinolones,Quinolones" "J01MA19,QJ01MA19" "gareno" "ganefloxacin,garenfloxacin" 0.4 "g" "35811-9,35812-7,35813-5"
|
||||
"GAT" 5379 "Gatifloxacin" "Fluoroquinolones,Quinolones" "J01MA16,QJ01MA16,QS01AE06,S01AE06" "Quinolone antibacterials" "Fluoroquinolones" "gati,gatifl" "acorafloxacin,avarofloxacin,balofloxacin,balofox,bazucin,bilimin,bonoq,gaity,gatiflo,gatifloxacine,gatifloxcin,gatilox,gatiquin,gatispan,kinome,tequin,tymer,zymar,zymaxid,zymer" 0.4 "g" 0.4 "g" "31036-7,31038-3,31040-9,31042-5,41494-6"
|
||||
"GEM" 9571107 "Gemifloxacin" "Fluoroquinolones,Quinolones" "J01MA15,QJ01MA15" "Quinolone antibacterials" "Fluoroquinolones" "gemifl" "factiv,gemifioxacin,gemifloxacine,gemifloxacino,gemifloxacinum" 0.32 "g" 0.2 "g" "35814-3,35815-0,35816-8,41697-4"
|
||||
"FUR" 6870646 "Furazidin" "Other antibacterials" "J01XE03,QJ01XE03" "Other antibacterials" "Nitrofuran derivatives" "NA" "akritoin,furagin,furaginum,furamag,furazidine,hydantoin" 0.3 "g" "NA"
|
||||
"FRZ" 5323714 "Furazolidone" "Other antibacterials" "G01AX06,QG01AX06,QJ01XE90" "furazo" "bifuron,corizium,coryzium,diafuron,enterotoxon,furall,furanzolidone,furaxon,furaxone,furazolidine,furazolidon,furazolidona,furazolidonum,furazolum,furidon,furmethoxadone,furovag,furoxal,furoxane,furoxon,furoxone,furozolidine,giardil,giarlam,medaron,neftin,nicolen,nifulidone,nifuran,nifurazolidone,nifurazolidonum,nitrofuradoxon,nitrofurazolidone,nitrofurazolidonum,nitrofuroxon,optazol,ortazol,puradin,roptazol,sclaventerol,tikofuran,topazone,trichofuron,tricofuron,tricoron,trifurox,viofuragyn" "69574-2,87794-4"
|
||||
"FUS" 3000226 "Fusidic acid" "Other antibacterials" "D06AX01,D09AA02,J01XC01,QD06AX01,QD09AA02,QJ01XC01,QS01AA13,S01AA13" "Other antibacterials" "Steroid antibacterials" "fa,fusaci,fusi" "flucidin,fucidate,fucidina,fucidine,fucithalmic,fusidate,fusidicacid,fusidin,fusidine,taksta" 1.5 "g" 1.5 "g" "NA"
|
||||
"GAM" 59364992 "Gamithromycin" "Macrolides/lincosamides" "QJ01FA95" "NA" "zactran" "100054-6,88376-9,88378-5"
|
||||
"GRN" 124093 "Garenoxacin" "Fluoroquinolones" "J01MA19,QJ01MA19" "gareno" "ganefloxacin,garenfloxacin" 0.4 "g" "35811-9,35812-7,35813-5"
|
||||
"GAT" 5379 "Gatifloxacin" "Fluoroquinolones" "J01MA16,QJ01MA16,QS01AE06,S01AE06" "Quinolone antibacterials" "Fluoroquinolones" "gati,gatifl" "acorafloxacin,avarofloxacin,balofloxacin,balofox,bazucin,bilimin,bonoq,gaity,gatiflo,gatifloxacine,gatifloxcin,gatilox,gatiquin,gatispan,kinome,tequin,tymer,zymar,zymaxid,zymer" 0.4 "g" 0.4 "g" "31036-7,31038-3,31040-9,31042-5,41494-6"
|
||||
"GEM" 9571107 "Gemifloxacin" "Fluoroquinolones" "J01MA15,QJ01MA15" "Quinolone antibacterials" "Fluoroquinolones" "gemifl" "factiv,gemifioxacin,gemifloxacine,gemifloxacino,gemifloxacinum" 0.32 "g" 0.2 "g" "35814-3,35815-0,35816-8,41697-4"
|
||||
"GEN" 3467 "Gentamicin" "Aminoglycosides" "D06AX07,J01GB03,QA07AA91,QD06AX07,QG01AA91,QG51AA04,QJ01GB03,QJ51GB03,QS01AA11,QS02AA14,QS03AA06,S01AA11,S02AA14,S03AA06" "Aminoglycoside antibacterials" "Other aminoglycosides" "cn,ge1000,ge2000,gen,gen128,gen500,gent,genta1,gentam,gm" "centicin,cidomycin,garamicin,garamycin,gentacycol,gentamicina,gentamicine,gentamicins,gentamicinum,gentamycins,gentamycinum,gentocin,lyramycin,oksitselanim,septigen,septocin" 0.24 "g" "101494-3,13561-6,13562-4,15106-8,18928-2,18929-0,22746-2,22747-0,266-7,267-5,268-3,269-1,31091-2,31092-0,31093-8,35668-3,35817-6,3663-2,3664-0,3665-7,39082-3,47109-4,50630-3,59379-8,7016-9,7017-7,7018-5,80971-5,88111-0,89481-6"
|
||||
"GEH" "Gentamicin-high" "Aminoglycosides" "NA" "gehi,gehl,genta high,gentamicin high" "NA" "18929-0,35817-6,7017-7,7018-5"
|
||||
"GEP" 25101874 "Gepotidacin" "Other" "J01XX13,QJ01XX13" "NA" "gepotidacina,gepotidacine" "NA"
|
||||
"GRX" 72474 "Grepafloxacin" "Fluoroquinolones,Quinolones" "J01MA11,QJ01MA11" "Quinolone antibacterials" "Fluoroquinolones" "grep,grepaf" "grepafloxacine,grepafloxacino,lungaskin,raxar,vaxar" 0.4 "g" "21316-5,23638-0,23639-8,35818-4"
|
||||
"GRI" 441140 "Griseofulvin" "Antifungals" "D01AA08,D01BA01,QD01AA08,QD01BA01" "NA" "amudane,delmofulvina,epigriseofulvin,fulcin,fulcine,fulvicin,fulvidex,fulvina,fulvinil,fulvistatin,fungivin,greosin,gresfeed,gricin,grifulin,grifulvin,grisactin,griscofulvin,grisefuline,griseo,griseofulviin,griseofulvina,griseofulvine,griseofulvinum,griseomix,griseostatin,grisetin,grisofulvin,grisovin,grisowen,grizeofulvin,grysio,guservin,lamoryl,likuden,likunden,murfulvin,poncyl,spiro,spirofulvin,xuanjing" 0.5 "g" "12402-4,54200-1,54201-9,54202-7"
|
||||
"GEP" 25101874 "Gepotidacin" "Other antibacterials" "J01XX13,QJ01XX13" "NA" "gepotidacina,gepotidacine" "NA"
|
||||
"GRX" 72474 "Grepafloxacin" "Fluoroquinolones" "J01MA11,QJ01MA11" "Quinolone antibacterials" "Fluoroquinolones" "grep,grepaf" "grepafloxacine,grepafloxacino,lungaskin,raxar,vaxar" 0.4 "g" "21316-5,23638-0,23639-8,35818-4"
|
||||
"GRI" 441140 "Griseofulvin" "Antifungals/antimycotics" "D01AA08,D01BA01,QD01AA08,QD01BA01" "NA" "amudane,delmofulvina,epigriseofulvin,fulcin,fulcine,fulvicin,fulvidex,fulvina,fulvinil,fulvistatin,fungivin,greosin,gresfeed,gricin,grifulin,grifulvin,grisactin,griscofulvin,grisefuline,griseo,griseofulviin,griseofulvina,griseofulvine,griseofulvinum,griseomix,griseostatin,grisetin,grisofulvin,grisovin,grisowen,grizeofulvin,grysio,guservin,lamoryl,likuden,likunden,murfulvin,poncyl,spiro,spirofulvin,xuanjing" 0.5 "g" "12402-4,54200-1,54201-9,54202-7"
|
||||
"HAB" 175989 "Habekacin" "Aminoglycosides" "NA" "NA" "amikafur,amikan,amitrex,arikayce,biklin,biodacyn,chemacin,fabianol,habekacinxsulfate,likacin,pierami" "NA"
|
||||
"HCH" 11979956 "Hachimycin" "Antifungals" "D01AA03,G01AA06,J02AA02,QD01AA03,QG01AA06,QJ02AA02" "Antimycotics for systemic use" "Antibiotics" "NA" "cabimicina,hachimicina,hachimycine,hachimycinum,trichomycinum,trichonat" "NA"
|
||||
"HET" 443387 "Hetacillin" "Penicillins,Beta-lactams" "J01CA18,QJ01CA18" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "hetaci" "etacillina,hetacilina,hetacilline,hetacillinum,natacillin,phenazacillin,versapen,versatrex" 2 "g" "18931-6,274-1,275-8,276-6,277-4"
|
||||
"HCH" 11979956 "Hachimycin" "Antifungals/antimycotics" "D01AA03,G01AA06,J02AA02,QD01AA03,QG01AA06,QJ02AA02" "Antimycotics for systemic use" "Antibiotics" "NA" "cabimicina,hachimicina,hachimycine,hachimycinum,trichomycinum,trichonat" "NA"
|
||||
"HET" 443387 "Hetacillin" "Beta-lactams/penicillins" "J01CA18,QJ01CA18" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "hetaci" "etacillina,hetacilina,hetacilline,hetacillinum,natacillin,phenazacillin,versapen,versatrex" 2 "g" "18931-6,274-1,275-8,276-6,277-4"
|
||||
"HYG" 56928061 "Hygromycin" "Aminoglycosides" "NA" "NA" "antihelmycin,destomysin,hyanthelmix,hygromix,hygrovectine,hygrovetine" "NA"
|
||||
"IBX" "Ibrexafungerp" "Antifungals" "J02AX07,QJ02AX07" "NA" "NA" "NA"
|
||||
"ICL" 213043 "Iclaprim" "Trimethoprims" "J01EA03,QJ01EA03" "iclapr" "iclaprime,mersarex" "73597-7,73619-9,73642-1"
|
||||
"IPM" 104838 "Imipenem" "Carbapenems,Beta-lactams" "J01DH51,QJ01DH51" "Other beta-lactam antibacterials" "Carbapenems" "imci,imi,imip,imip32,imipen,imp" "imipemide,imipenemum,imipenen,primaxin,recarbrio,tienam,tienamycin" 2 "g" "101487-7,17010-0,18932-4,18933-2,23613-3,25221-3,25257-7,27331-8,278-2,279-0,280-8,281-6,282-4,283-2,284-0,285-7,35819-2,3688-9,54170-6,54171-4,54172-2,7019-3,85424-0,93232-7,96372-8"
|
||||
"IPE" "Imipenem/EDTA" "Carbapenems,Beta-lactams" "NA" "NA" "NA" "35819-2,54170-6,54171-4,54172-2"
|
||||
"IMR" "Imipenem/relebactam" "Carbapenems,Beta-lactams,Beta-lactamase inhibitors" "J01DH56,QJ01DH56" "NA" "NA" 2 "g" "85424-0,93232-7,96372-8"
|
||||
"ISV" 6918485 "Isavuconazole" "Antifungals" "J02AC05,QJ02AC05" "isav" "benzonitrile,ravuconazole" 0.2 "g" 0.2 "g" "85381-2,88887-5"
|
||||
"ICL" 213043 "Iclaprim" "Other antibacterials" "J01EA03,QJ01EA03" "iclapr" "iclaprime,mersarex" "73597-7,73619-9,73642-1"
|
||||
"IPM" 104838 "Imipenem" "Carbapenems" "J01DH51,QJ01DH51" "Other beta-lactam antibacterials" "Carbapenems" "imci,imi,imip,imip32,imipen,imp" "imipemide,imipenemum,imipenen,primaxin,recarbrio,tienam,tienamycin" 2 "g" "101487-7,17010-0,18932-4,18933-2,23613-3,25221-3,25257-7,27331-8,278-2,279-0,280-8,281-6,282-4,283-2,284-0,285-7,35819-2,3688-9,54170-6,54171-4,54172-2,7019-3,85424-0,93232-7,96372-8"
|
||||
"IPE" "Imipenem/EDTA" "Carbapenems" "NA" "NA" "NA" "35819-2,54170-6,54171-4,54172-2"
|
||||
"IMR" "Imipenem/relebactam" "Carbapenems" "J01DH56,QJ01DH56" "NA" "NA" 2 "g" "85424-0,93232-7,96372-8"
|
||||
"ISV" 6918485 "Isavuconazole" "Antifungals/antimycotics" "J02AC05,QJ02AC05" "isav" "benzonitrile,ravuconazole" 0.2 "g" 0.2 "g" "85381-2,88887-5"
|
||||
"ISE" 3037209 "Isepamicin" "Aminoglycosides" "J01GB11,QJ01GB11" "Aminoglycoside antibacterials" "Other aminoglycosides" "isepam" "isepacin,isepalline,isepamicina,isepamicine,isepamicinsulphate,isepamicinum" 0.4 "g" "32381-6,35820-0,35821-8,55680-3"
|
||||
"ISO" 3760 "Isoconazole" "Antifungals" "D01AC05,G01AF07,QD01AC05,QG01AF07" "Antimycotics for topic use" "Triazole derivatives" "NA" "isoconazol,isoconazolum,travogen" "55681-1,55682-9,55683-7,55684-5"
|
||||
"ISO" 3760 "Isoconazole" "Antifungals/antimycotics" "D01AC05,G01AF07,QD01AC05,QG01AF07" "Antimycotics for topic use" "Triazole derivatives" "NA" "isoconazol,isoconazolum,travogen" "55681-1,55682-9,55683-7,55684-5"
|
||||
"INH" 3767 "Isoniazid" "Antimycobacterials" "J04AC01,QJ04AC01" "Drugs for treatment of tuberculosis" "Hydrazides" "inh,isonia" "abdizide,acetylisoniazide,andrazide,anidrasona,antimicina,antituberkulosum,armacide,armazid,armazide,atcotibine,azuren,cedin,cemidon,chemiazid,chemidon,continazine,cortinazine,cotinazin,cotinizin,defonin,dianicotyl,dibutin,diforin,dinacrin,dinocrin,ditubin,ebidene,eralon,ertuban,eutizon,evalon,fetefu,fimalene,hidranizil,hidrasonil,hidrulta,hidrun,hycozid,hydra,hydrazid,hyozid,hyzyd,idrazil,inizid,ipcazide,iscotin,isidrina,ismazide,isobicina,isocid,isocidene,isocotin,isohydrazide,isokin,isolyn,isonerit,isonex,isoniacid,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,mayambutol,mybasan,neoteben,neoxin,neumandin,nevin,niadrin,nicazide,nicetal,nicizina,niconyl,nicotibina,nicotibine,nicotisan,nicozide,nidaton,nidrazid,nikozid,niplen,nitadon,niteban,nitebannsc,nydrazid,nyscozid,pelazid,percin,phthisen,preparation,pycazide,pyreazid,pyricidin,pyridicin,pyrizidin,raumanon,razide,retozide,rifater,rimicid,rimifon,rimiphone,rimitsid,robiselin,robisellin,roxifen,sanohidrazina,sauterazid,sauterzid,stanozide,tebecid,tebenic,tebexin,tebilon,tebos,teebaconin,tekazin,tibazide,tibemid,tibiazide,tibinide,tibison,tibivis,tibizide,tibusan,tisin,tisiodrazida,tizide,tubazid,tubazide,tubeco,tubecotubercid,tuberian,tubicon,tubilysin,tubizid,tubomel,tyvid,unicocyde,unicozyde,vazadrine,vederon,zidafimia,zinadon,zonazide" 0.3 "g" 0.3 "g" "18934-0,20383-6,23947-5,25217-1,25218-9,25219-7,25451-6,26756-7,286-5,287-3,288-1,289-9,29315-9,3697-0,40371-7,42649-4,42650-2,42651-0,45215-1,48171-3,48172-1,55685-2,7020-1,89488-1"
|
||||
"IST" "Isoniazid/sulfamethoxazole/trimethoprim/pyridoxine" "Trimethoprims,Sulfonamides,Antimycobacterials" "NA" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"ITR" 3793 "Itraconazole" "Antifungals" "J02AC02,QJ02AC02" "Antimycotics for systemic use" "Triazole derivatives" "itra,itraco" "candistat,canditral,cladosal,fungitraxx,intraconazole,itraconazol,itraconazolo,itraconazolum,itraconzaole,itrafungol,itralek,itrizole,lozanoc,onmel,sempera,sporamelt,sporanox,sporonox,traconal,triasporin" 0.2 "g" 0.2 "g" "10989-2,12392-7,25258-5,25452-4,27081-9,32184-4,32185-1,32603-3,54179-7,7021-9,80531-7"
|
||||
"JOS" 5282165 "Josamycin" "Macrolides" "J01FA07,QJ01FA07" "Macrolides, lincosamides and streptogramins" "Macrolides" "josamy" "jomybel,josamicina,josamycine,josamycinum" 2 "g" "25597-6,25702-2,41698-2,41699-0"
|
||||
"IST" "Isoniazid/sulfamethoxazole/trimethoprim/pyridoxine" "Antimycobacterials" "NA" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"ITR" 3793 "Itraconazole" "Antifungals/antimycotics" "J02AC02,QJ02AC02" "Antimycotics for systemic use" "Triazole derivatives" "itra,itraco" "candistat,canditral,cladosal,fungitraxx,intraconazole,itraconazol,itraconazolo,itraconazolum,itraconzaole,itrafungol,itralek,itrizole,lozanoc,onmel,sempera,sporamelt,sporanox,sporonox,traconal,triasporin" 0.2 "g" 0.2 "g" "10989-2,12392-7,25258-5,25452-4,27081-9,32184-4,32185-1,32603-3,54179-7,7021-9,80531-7"
|
||||
"JOS" 5282165 "Josamycin" "Macrolides/lincosamides" "J01FA07,QJ01FA07" "Macrolides, lincosamides and streptogramins" "Macrolides" "josamy" "jomybel,josamicina,josamycine,josamycinum" 2 "g" "25597-6,25702-2,41698-2,41699-0"
|
||||
"KAN" 6032 "Kanamycin" "Aminoglycosides" "A07AA08,J01GB04,QA07AA08,QJ01GB04,QS01AA24,S01AA24" "Aminoglycoside antibacterials" "Other aminoglycosides" "hlk,k,kan,kana,kanamy,km" "kanamicina,kanamycine,kanamycins,kanamycinum,kantrex,klebcil" 3 "g" 1 "g" "18935-7,18936-5,23609-1,23889-9,25182-7,25213-0,25214-8,290-7,291-5,292-3,293-1,3698-8,3699-6,3700-2,42652-8,47395-9,49080-5,7022-7,7023-5,7024-3,88002-1,88705-9,89482-4"
|
||||
"KAH" "Kanamycin-high" "Aminoglycosides" "NA" "k_h,kahl" "NA" "18936-5,7023-5,7024-3"
|
||||
"KAC" "Kanamycin/cephalexin" "Aminoglycosides" "NA" "NA" "NA" "NA"
|
||||
"KAS" 65174 "Kasugamycin" "Aminoglycosides" "NA" "NA" "kasumin,kasuminl" "NA"
|
||||
"KET" 456201 "Ketoconazole" "Antifungals" "D01AC08,G01AF11,H02CA03,J02AB02,QD01AC08,QG01AF11,QH02CA03,QJ02AB02" "Antimycotics for systemic use" "Imidazole derivatives" "keto,ketoco,ktc" "brizoral,ethanone,extina,fungarest,fungoral,ketaconazole,ketocanazole,ketoconazol,ketoconazolum,ketodan,ketoderm,ketoisdin,ketozole,kuric,levoketoconazole,nizoral,normocort,panfungol,piperazine,recorlev,sebazole,teryzolin,terzolin,tocris,xolegel" 0.6 "g" "10990-0,12393-5,18937-3,25259-3,294-9,295-6,296-4,297-2,60091-6,60092-4,7025-0"
|
||||
"KIT" "Kitasamycin" "Macrolides" "QJ01FA93" "leucomycin" "NA" "NA"
|
||||
"LAS" 5360807 "Lasalocid" "Ionophores" "QP51BB02" "NA" "avatec,bovate,bovatec,lasalocide,lasalocido,lasalocidsalt,lasalocidum" "87598-9"
|
||||
"LSC" 71528768 "Lascufloxacin" "Fluoroquinolones,Quinolones" "J01MA25,QJ01MA25" "Quinolone antibacterials" "Fluoroquinolones" "NA" "lasvic" 75 "mg" "NA"
|
||||
"LTM" 47499 "Latamoxef" "Cephalosporins (3rd gen.),Cephalosporins,Beta-lactams" "J01DD06,QJ01DD06" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "mox,moxa,moxalactam" "dilatamoxef,festamoxin,lamoxactam,latamoxefum,morrhuate,moxalactamsalt,moxam,shiomarin" 4 "g" "NA"
|
||||
"LMU" 25185057 "Lefamulin" "Other" "J01XX12,QJ01XX12" "NA" "lefamulinacetate,xenleta" "85425-7,99281-8"
|
||||
"LEN" 65646 "Lenampicillin" "Penicillins,Beta-lactams" "NA" "NA" "lenampicilina,lenampicilline,lenampicillinum,takacillin,valacillin,varacillin" "NA"
|
||||
"LVX" 149096 "Levofloxacin" "Fluoroquinolones,Quinolones" "J01MA12,QJ01MA12,QS01AE05,S01AE05" "Quinolone antibacterials" "Fluoroquinolones" "le,lev,levo,levofl,lvx" "aeroquin,cravit,dextrofloxacin,dynaquin,elequine,iquix,levaquin,levofiexacin,levofloxacine,levofloxacino,levofloxacinum,loxof,ofloxcacin,oftaquix,quinsair,quixin,tavanic,unibiotic,venaxan" 0.5 "g" 0.5 "g" "101501-5,20396-8,20629-2,21367-8,21368-6,30532-6,30533-4,48173-9,53716-7,7026-8,76040-5,76041-3,76042-1"
|
||||
"LEO" "Levofloxacin/ornidazole" "Fluoroquinolones,Quinolones" "J01RA05,QJ01RA05" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"LND" 9850038 "Levonadifloxacin" "Fluoroquinolones,Quinolones" "J01MA24,QJ01MA24" "NA" "NA" "NA"
|
||||
"LSP" "Linco-spectin" "Other" "NA" "lincomycin/spectinomycin" "NA" "NA"
|
||||
"LIN" 3000540 "Lincomycin" "Lincosamides" "J01FF02,QJ01FF02,QJ51FF02" "Macrolides, lincosamides and streptogramins" "Lincosamides" "linc,lincom" "albiotic,bactramycin,cillimycin,frademicina,jiemycin,lincocin,lincogap,lincolcina,lincolnensin,lincomicina,lincomix,lincomycine,lincomycinum,lincomyocin,lincorex,linocin,mycivin" 1.8 "g" 1.8 "g" "18938-1,298-0,299-8,300-4,301-2,41700-6,87597-1"
|
||||
"KET" 456201 "Ketoconazole" "Antifungals/antimycotics" "D01AC08,G01AF11,H02CA03,J02AB02,QD01AC08,QG01AF11,QH02CA03,QJ02AB02" "Antimycotics for systemic use" "Imidazole derivatives" "keto,ketoco,ktc" "brizoral,ethanone,extina,fungarest,fungoral,ketaconazole,ketocanazole,ketoconazol,ketoconazolum,ketodan,ketoderm,ketoisdin,ketozole,kuric,levoketoconazole,nizoral,normocort,panfungol,piperazine,recorlev,sebazole,teryzolin,terzolin,tocris,xolegel" 0.6 "g" "10990-0,12393-5,18937-3,25259-3,294-9,295-6,296-4,297-2,60091-6,60092-4,7025-0"
|
||||
"KIT" "Kitasamycin" "Macrolides/lincosamides" "QJ01FA93" "leucomycin" "NA" "NA"
|
||||
"LAS" 5360807 "Lasalocid" "Other antibacterials" "QP51BB02" "NA" "avatec,bovate,bovatec,lasalocide,lasalocido,lasalocidsalt,lasalocidum" "87598-9"
|
||||
"LSC" 71528768 "Lascufloxacin" "Fluoroquinolones" "J01MA25,QJ01MA25" "Quinolone antibacterials" "Fluoroquinolones" "NA" "lasvic" 75 "mg" "NA"
|
||||
"LTM" 47499 "Latamoxef" "Cephalosporins (3rd gen.)" "J01DD06,QJ01DD06" "Other beta-lactam antibacterials" "Third-generation cephalosporins" "mox,moxa,moxalactam" "dilatamoxef,festamoxin,lamoxactam,latamoxefum,morrhuate,moxalactamsalt,moxam,shiomarin" 4 "g" "NA"
|
||||
"LMU" 25185057 "Lefamulin" "Other antibacterials" "J01XX12,QJ01XX12" "NA" "lefamulinacetate,xenleta" "85425-7,99281-8"
|
||||
"LEN" 65646 "Lenampicillin" "Beta-lactams/penicillins" "NA" "NA" "lenampicilina,lenampicilline,lenampicillinum,takacillin,valacillin,varacillin" "NA"
|
||||
"LVX" 149096 "Levofloxacin" "Fluoroquinolones" "J01MA12,QJ01MA12,QS01AE05,S01AE05" "Quinolone antibacterials" "Fluoroquinolones" "le,lev,levo,levofl,lvx" "aeroquin,cravit,dextrofloxacin,dynaquin,elequine,iquix,levaquin,levofiexacin,levofloxacine,levofloxacino,levofloxacinum,loxof,ofloxcacin,oftaquix,quinsair,quixin,tavanic,unibiotic,venaxan" 0.5 "g" 0.5 "g" "101501-5,20396-8,20629-2,21367-8,21368-6,30532-6,30533-4,48173-9,53716-7,7026-8,76040-5,76041-3,76042-1"
|
||||
"LEO" "Levofloxacin/ornidazole" "Fluoroquinolones" "J01RA05,QJ01RA05" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"LND" 9850038 "Levonadifloxacin" "Fluoroquinolones" "J01MA24,QJ01MA24" "NA" "NA" "NA"
|
||||
"LSP" "Linco-spectin" "Other antibacterials" "NA" "lincomycin/spectinomycin" "NA" "NA"
|
||||
"LIN" 3000540 "Lincomycin" "Macrolides/lincosamides" "J01FF02,QJ01FF02,QJ51FF02" "Macrolides, lincosamides and streptogramins" "Lincosamides" "linc,lincom" "albiotic,bactramycin,cillimycin,frademicina,jiemycin,lincocin,lincogap,lincolcina,lincolnensin,lincomicina,lincomix,lincomycine,lincomycinum,lincomyocin,lincorex,linocin,mycivin" 1.8 "g" 1.8 "g" "18938-1,298-0,299-8,300-4,301-2,41700-6,87597-1"
|
||||
"LNZ" 441401 "Linezolid" "Oxazolidinones" "J01XX08,QJ01XX08" "Other antibacterials" "Other antibacterials" "line,linezo,lnz,lz,lzd" "desfluorolinezolid,linezoid,linezolidum,zivoxid,zyvox,zyvoxa,zyvoxam,zyvoxid" 1.2 "g" 1.2 "g" "29254-0,29255-7,29258-1,33332-8,34202-2,41500-0,80609-1,88706-7,96111-0"
|
||||
"LFE" "Linoprist-flopristin" "Other" "NA" "linflo" "NA" "NA"
|
||||
"LOM" 3948 "Lomefloxacin" "Fluoroquinolones,Quinolones" "J01MA07,QJ01MA07,QS01AE04,S01AE04" "Quinolone antibacterials" "Fluoroquinolones" "lmf,lom,lome,lomefl" "bareon,logiflox,lomebact,lomefloxacine,lomefloxacino,lomefloxacinum,maxaquin,maxaquine,mazaquin,okacin,okacyn,uniquin" 0.4 "g" "18939-9,302-0,303-8,304-6,305-3,41701-4"
|
||||
"LOR" 5284585 "Loracarbef" "Cephalosporins (2nd gen.),Cephalosporins,Beta-lactams" "J01DC08,QJ01DC08" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "lora,loraca" "carbac,lorabid,loracarbefum,lorafem,lorbef,loribid" 0.6 "g" "18940-7,306-1,307-9,308-7,309-5,7027-6"
|
||||
"LFE" "Linoprist-flopristin" "Other antibacterials" "NA" "linflo" "NA" "NA"
|
||||
"LOM" 3948 "Lomefloxacin" "Fluoroquinolones" "J01MA07,QJ01MA07,QS01AE04,S01AE04" "Quinolone antibacterials" "Fluoroquinolones" "lmf,lom,lome,lomefl" "bareon,logiflox,lomebact,lomefloxacine,lomefloxacino,lomefloxacinum,maxaquin,maxaquine,mazaquin,okacin,okacyn,uniquin" 0.4 "g" "18939-9,302-0,303-8,304-6,305-3,41701-4"
|
||||
"LOR" 5284585 "Loracarbef" "Cephalosporins (2nd gen.)" "J01DC08,QJ01DC08" "Other beta-lactam antibacterials" "Second-generation cephalosporins" "lora,loraca" "carbac,lorabid,loracarbefum,lorafem,lorbef,loribid" 0.6 "g" "18940-7,306-1,307-9,308-7,309-5,7027-6"
|
||||
"LYM" 54707177 "Lymecycline" "Tetracyclines" "J01AA04,QJ01AA04" "Tetracyclines" "Tetracyclines" "NA" "armyl,chlortetracyclin,ciclisin,ciclolysal,ciclolysine,eficiclina,infaciclina,limeciclina,lisinbiotic,lymecyclinum,mucomycin,ntetracycline,tetralisal,tetralysal,vebicyclysal" 0.6 "g" 0.6 "g" "18941-5,310-3,311-1,312-9,313-7"
|
||||
"MNA" 1292 "Mandelic acid" "Other" "B05CA06,J01XX06,QB05CA06,QJ01XX06" "Other antibacterials" "Other antibacterials" "NA" "amygdalate,mandelsaeure,paramandelate,phenylglycolate,phenylhydroxyacetate,uromaline" 12 "g" "NA"
|
||||
"MNA" 1292 "Mandelic acid" "Other antibacterials" "B05CA06,J01XX06,QB05CA06,QJ01XX06" "Other antibacterials" "Other antibacterials" "NA" "amygdalate,mandelsaeure,paramandelate,phenylglycolate,phenylhydroxyacetate,uromaline" 12 "g" "NA"
|
||||
"MGX" "Manogepix" "Antifungals" "NA" "NA" "NA" "NA"
|
||||
"MAR" 60651 "Marbofloxacin" "Fluoroquinolones,Quinolones" "QJ01MA93" "marbof" "marbocyl,marbofloxacine,marbofloxacino,marbofloxacinum,marboquin,zeniquin" "73596-9,73618-1,73641-3"
|
||||
"MEC" 36273 "Mecillinam" "Penicillins,Beta-lactams" "J01CA11,QJ01CA11" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "amdinocillin,mecill" "amdinocillin,coactin,hexacillin,mecilinamo,mecillinamum,selexidin" 1.2 "g" "NA"
|
||||
"MEL" 71306732 "Meleumycin" "Macrolides" "NA" "NA" "NA" "NA"
|
||||
"MEM" 441130 "Meropenem" "Carbapenems,Beta-lactams" "J01DH02,QJ01DH02" "Other beta-lactam antibacterials" "Carbapenems" "mem,mer,mero,merope,mp,mrp" "meronem,meropen,meropenemum,merrem" 3 "g" "101222-8,101488-5,101489-3,18943-1,41406-0,6651-4,6652-2,6653-0,6654-8,7029-2,85426-5,85427-3,88892-5,90980-4"
|
||||
"MNC" "Meropenem/nacubactam" "Carbapenems,Beta-lactams,Beta-lactamase inhibitors" "NA" "NA" "NA" "NA"
|
||||
"MEV" "Meropenem/vaborbactam" "Carbapenems,Beta-lactams,Beta-lactamase inhibitors" "J01DH52,QJ01DH52" "Other beta-lactam antibacterials" "Carbapenems" "NA" "NA" 3 "g" "101222-8,101489-3,85427-3,88892-5,90980-4"
|
||||
"MES" 176886 "Mesulfamide" "Other" "NA" "NA" "mesulfamida,mesulfamido,mesulfamidum" "NA"
|
||||
"MAR" 60651 "Marbofloxacin" "Fluoroquinolones" "QJ01MA93" "marbof" "marbocyl,marbofloxacine,marbofloxacino,marbofloxacinum,marboquin,zeniquin" "73596-9,73618-1,73641-3"
|
||||
"MEC" 36273 "Mecillinam" "Beta-lactams/penicillins" "J01CA11,QJ01CA11" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "amdinocillin,mecill" "amdinocillin,coactin,hexacillin,mecilinamo,mecillinamum,selexidin" 1.2 "g" "NA"
|
||||
"MEL" 71306732 "Meleumycin" "Macrolides/lincosamides" "NA" "NA" "NA" "NA"
|
||||
"MEM" 441130 "Meropenem" "Carbapenems" "J01DH02,QJ01DH02" "Other beta-lactam antibacterials" "Carbapenems" "mem,mer,mero,merope,mp,mrp" "meronem,meropen,meropenemum,merrem" 3 "g" "101222-8,101488-5,101489-3,18943-1,41406-0,6651-4,6652-2,6653-0,6654-8,7029-2,85426-5,85427-3,88892-5,90980-4"
|
||||
"MNC" "Meropenem/nacubactam" "Carbapenems" "NA" "NA" "NA" "NA"
|
||||
"MEV" "Meropenem/vaborbactam" "Carbapenems" "J01DH52,QJ01DH52" "Other beta-lactam antibacterials" "Carbapenems" "NA" "NA" 3 "g" "101222-8,101489-3,85427-3,88892-5,90980-4"
|
||||
"MES" 176886 "Mesulfamide" "Other antibacterials" "NA" "NA" "mesulfamida,mesulfamido,mesulfamidum" "NA"
|
||||
"MTC" 54675785 "Metacycline" "Tetracyclines" "J01AA05,QJ01AA05" "Tetracyclines" "Tetracyclines" "methcy" "bialatan,metaciclina,metacyclinum,methacyclin,methacycline,methacyclinum,methylenecycline,physiomycine,rondomycin" 0.6 "g" "NA"
|
||||
"MTM" 6713928 "Metampicillin" "Penicillins,Beta-lactams" "J01CA14,QJ01CA14" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "NA" "blomopen,bonopen,celinmicina,elatocilline,filorex,magnipen,metambac,metampen,metampicilina,metampicillina,metampicilline,metampicillinsalt,metampicillinum,micinovo,ocelina,pangocilin,probiotic,relyothenate,ruticina,rutizina,sedomycin,serfabiotic,suvipen,viderpen,viderpin,vioplex" 1.5 "g" 1.5 "g" "NA"
|
||||
"MTH" 4101 "Methenamine" "Other" "J01XX05,QJ01XX05" "Other antibacterials" "Other antibacterials" "NA" "aminoform,aminoformaldehyde,ammoform,ammonioformaldehyde,antihydral,carin,cystamin,cystex,cystogen,duirexol,esametilentetramina,formamine,formin,grasselerator,heterin,hexaform,hexaloids,hexamethylamine,hexamethylenamine,hexamethyleneamine,hexamethylentetramin,hexamine,hexaminum,hexasan,hexilmethylenamine,metenamina,metenamine,methamin,methamine,methenamin,methenaminum,metramine,naphthamine,pellurin,resotropin,uramin,urasal,uratrine,urisol,uritone,urodeine,urotropin,urotropine,vesaloin,xametrin" 3 "g" "NA"
|
||||
"MET" 6087 "Meticillin" "Isoxazolylpenicillins,Penicillins,Beta-lactams" "J01CF03,QJ01CF03,QJ51CF03" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "methic,meti" "belfacillin,celbenin,celpilline,cinopenil,dimocillin,estafcilina,flabelline,lucopenin,metacillin,methcillin,methicillin,methicillinanhydrous,methicillinhydrate,methicillinsalt,methicillinum,methycillin,meticilina,meticillina,meticilline,meticillinsalt,meticillinum,penaureus,penysol,staficyn,staphcillin,synticillin" 4 "g" "NA"
|
||||
"MTP" 68590 "Metioprim" "Other" "NA" "NA" "methioprim,metioprima,metioprime,metioprimum" "NA"
|
||||
"MXT" 3047729 "Metioxate" "Fluoroquinolones,Quinolones" "NA" "NA" "metioxato,metioxatum" "NA"
|
||||
"MTR" 4173 "Metronidazole" "Other" "A01AB17,D06BX01,G01AF01,J01XD01,P01AB01,QA01AB17,QD06BX01,QG01AF01,QJ01XD01,QP51CA01" "Other antibacterials" "Imidazole derivatives" "metr,metron,mnz,mtz" "acromona,anagiardil,arilin,atrivyl,bexon,clont,danizol,deflamon,donnan,efloran,elyzol,entizol,eumin,flagemona,flagesol,flagil,flagyl,flazol,flegyl,florazole,fossyol,giatricol,gineflavir,givagil,hydroxydimetridazole,hydroxymetronidazole,izoklion,klion,klont,mepagyl,meronidal,metric,metrolag,metrolyl,metromidol,metronidazolo,metronidazolum,metroplex,metrotop,mexibol,monagyl,monasin,nalox,nidagyl,noritate,novonidazol,nuvessa,orvagil,polibiotic,protostat,rathimed,rosaced,rosased,sanatrichom,satric,takimetol,trichazol,trichex,trichobrol,trichocide,trichomol,trichopal,trichopol,tricocet,tricom,trikacide,trikamon,trikhopol,trikojol,trikozol,trimeks,trivazol,vagilen,vagimid,vandazole,vertisal,wagitran,zadstat,zidoval" 2 "g" 1.5 "g" "10991-8,18946-4,326-9,327-7,328-5,329-3,7031-8"
|
||||
"MEZ" 656511 "Mezlocillin" "Ureidopenicillins,Penicillins,Beta-lactams" "J01CA10,QJ01CA10" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "mez,mezl,mezlo,mz" "baycipen,baypen,mezlin,mezlocilina,mezlocilline,mezlocillinsalt,mezlocillinum,multocillin" 6 "g" "18947-2,330-1,331-9,332-7,333-5,3820-8,41702-2,54194-6,54195-3,54196-1"
|
||||
"MSU" "Mezlocillin/sulbactam" "Penicillins,Beta-lactams,Beta-lactamase inhibitors" "NA" "mezsul" "NA" "54194-6,54195-3,54196-1"
|
||||
"MIF" 477468 "Micafungin" "Antifungals" "J02AX05,QJ02AX05" "Antimycotics for systemic use" "Other antimycotics for systemic use" "mica,micafu" "fungard,funguard,micafungina,micafunginsalt,mycamine" 0.1 "g" "53812-4,58418-5,65340-2,85048-7"
|
||||
"MCZ" 4189 "Miconazole" "Antifungals" "A01AB09,A07AC01,D01AC02,G01AF04,J02AB01,QA01AB09,QA07AC01,QD01AC02,QG01AF04,QJ02AB01,QS02AA13,S02AA13" "Antimycotics for systemic use" "Imidazole derivatives" "mico" "aflorix,albistat,andergin,brentan,conofite,dactarin,florid,micantin,miconazol,miconazolo,miconazolum,micozole,minostate,monazole,monista,monistat,oravig,vusion,zimybase,zimycan" 0.2 "g" 1 "g" "17278-3,25607-3,25722-0,54180-5,55686-0"
|
||||
"MTM" 6713928 "Metampicillin" "Beta-lactams/penicillins" "J01CA14,QJ01CA14" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "NA" "blomopen,bonopen,celinmicina,elatocilline,filorex,magnipen,metambac,metampen,metampicilina,metampicillina,metampicilline,metampicillinsalt,metampicillinum,micinovo,ocelina,pangocilin,probiotic,relyothenate,ruticina,rutizina,sedomycin,serfabiotic,suvipen,viderpen,viderpin,vioplex" 1.5 "g" 1.5 "g" "NA"
|
||||
"MTH" 4101 "Methenamine" "Other antibacterials" "J01XX05,QJ01XX05" "Other antibacterials" "Other antibacterials" "NA" "aminoform,aminoformaldehyde,ammoform,ammonioformaldehyde,antihydral,carin,cystamin,cystex,cystogen,duirexol,esametilentetramina,formamine,formin,grasselerator,heterin,hexaform,hexaloids,hexamethylamine,hexamethylenamine,hexamethyleneamine,hexamethylentetramin,hexamine,hexaminum,hexasan,hexilmethylenamine,metenamina,metenamine,methamin,methamine,methenamin,methenaminum,metramine,naphthamine,pellurin,resotropin,uramin,urasal,uratrine,urisol,uritone,urodeine,urotropin,urotropine,vesaloin,xametrin" 3 "g" "NA"
|
||||
"MET" 6087 "Meticillin" "Beta-lactams/penicillins" "J01CF03,QJ01CF03,QJ51CF03" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "methic,meti" "belfacillin,celbenin,celpilline,cinopenil,dimocillin,estafcilina,flabelline,lucopenin,metacillin,methcillin,methicillin,methicillinanhydrous,methicillinhydrate,methicillinsalt,methicillinum,methycillin,meticilina,meticillina,meticilline,meticillinsalt,meticillinum,penaureus,penysol,staficyn,staphcillin,synticillin" 4 "g" "NA"
|
||||
"MTP" 68590 "Metioprim" "Other antibacterials" "NA" "NA" "methioprim,metioprima,metioprime,metioprimum" "NA"
|
||||
"MXT" 3047729 "Metioxate" "Fluoroquinolones" "NA" "NA" "metioxato,metioxatum" "NA"
|
||||
"MTR" 4173 "Metronidazole" "Other antibacterials" "A01AB17,D06BX01,G01AF01,J01XD01,P01AB01,QA01AB17,QD06BX01,QG01AF01,QJ01XD01,QP51CA01" "Other antibacterials" "Imidazole derivatives" "metr,metron,mnz" "acromona,anagiardil,arilin,atrivyl,bexon,clont,danizol,deflamon,donnan,efloran,elyzol,entizol,eumin,flagemona,flagesol,flagil,flagyl,flazol,flegyl,florazole,fossyol,giatricol,gineflavir,givagil,hydroxydimetridazole,hydroxymetronidazole,izoklion,klion,klont,mepagyl,meronidal,metric,metrolag,metrolyl,metromidol,metronidazolo,metronidazolum,metroplex,metrotop,mexibol,monagyl,monasin,nalox,nidagyl,noritate,novonidazol,nuvessa,orvagil,polibiotic,protostat,rathimed,rosaced,rosased,sanatrichom,satric,takimetol,trichazol,trichex,trichobrol,trichocide,trichomol,trichopal,trichopol,tricocet,tricom,trikacide,trikamon,trikhopol,trikojol,trikozol,trimeks,trivazol,vagilen,vagimid,vandazole,vertisal,wagitran,zadstat,zidoval" 2 "g" 1.5 "g" "10991-8,18946-4,326-9,327-7,328-5,329-3,7031-8"
|
||||
"MEZ" 656511 "Mezlocillin" "Beta-lactams/penicillins" "J01CA10,QJ01CA10" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "mez,mezl,mezlo,mz" "baycipen,baypen,mezlin,mezlocilina,mezlocilline,mezlocillinsalt,mezlocillinum,multocillin" 6 "g" "18947-2,330-1,331-9,332-7,333-5,3820-8,41702-2,54194-6,54195-3,54196-1"
|
||||
"MSU" "Mezlocillin/sulbactam" "Beta-lactams/penicillins" "NA" "mezsul" "NA" "54194-6,54195-3,54196-1"
|
||||
"MIF" 477468 "Micafungin" "Antifungals/antimycotics" "J02AX05,QJ02AX05" "Antimycotics for systemic use" "Other antimycotics for systemic use" "mica,micafu" "fungard,funguard,micafungina,micafunginsalt,mycamine" 0.1 "g" "53812-4,58418-5,65340-2,85048-7"
|
||||
"MCZ" 4189 "Miconazole" "Antifungals/antimycotics" "A01AB09,A07AC01,D01AC02,G01AF04,J02AB01,QA01AB09,QA07AC01,QD01AC02,QG01AF04,QJ02AB01,QS02AA13,S02AA13" "Antimycotics for systemic use" "Imidazole derivatives" "mico" "aflorix,albistat,andergin,brentan,conofite,dactarin,florid,micantin,miconazol,miconazolo,miconazolum,micozole,minostate,monazole,monista,monistat,oravig,vusion,zimybase,zimycan" 0.2 "g" 1 "g" "17278-3,25607-3,25722-0,54180-5,55686-0"
|
||||
"MCR" 3037206 "Micronomicin" "Aminoglycosides" "QS01AA22,S01AA22" "micron" "micromicin,micromycin,micronomicina,micronomicine,micronomicinum,sagamicin,santemycin" "NA"
|
||||
"MID" 5282169 "Midecamycin" "Macrolides" "J01FA03,QJ01FA03" "Macrolides, lincosamides and streptogramins" "Macrolides" "mideka" "macropen,madecacine,medemycin,midecamicina,midecamycine,midecamycinum,midecin,momicine,myoxam,normicina,rubimycin" 1.2 "g" 1 "g" "NA"
|
||||
"MIL" 37614 "Miloxacin" "Fluoroquinolones,Quinolones" "NA" "amiflo" "miloxacine,miloxacino,miloxacinum" "NA"
|
||||
"MID" 5282169 "Midecamycin" "Macrolides/lincosamides" "J01FA03,QJ01FA03" "Macrolides, lincosamides and streptogramins" "Macrolides" "mideka" "macropen,madecacine,medemycin,midecamicina,midecamycine,midecamycinum,midecin,momicine,myoxam,normicina,rubimycin" 1.2 "g" 1 "g" "NA"
|
||||
"MIL" 37614 "Miloxacin" "Fluoroquinolones" "NA" "amiflo" "miloxacine,miloxacino,miloxacinum" "NA"
|
||||
"MNO" 54675783 "Minocycline" "Tetracyclines" "A01AB23,D10AF07,J01AA08,QA01AB23,QD10AF07,QJ01AA08" "Tetracyclines" "Tetracyclines" "mc,mh,mi,min,mino,minocy,mn,mno" "acnez,arestin,borymycin,dynacin,lederderm,minociclina,minocin,minocline,minocyclin,minocyclinum,minocyn,minomax,minomycin,mynocine,periocline,solodyn,vectrin,ximino" 1 "mg" 0.2 "g" "18948-0,25225-4,334-3,335-0,336-8,337-6,34606-4,3822-4,49757-8,55156-4,7032-6"
|
||||
"MCM" 5282188 "Miocamycin" "Macrolides" "J01FA11,QJ01FA11" "Macrolides, lincosamides and streptogramins" "Macrolides" "NA" "acecamycin,macroral,miocamen,miocamycine,miokamycin,mosil,myocamicin,ponsinomycin" 1.2 "g" "18949-8,338-4,339-2,340-0,341-8,55687-8"
|
||||
"MON" 23667299 "Monensin sodium" "Ionophores" "NA" "NA" "coban,elancoban,monelan,monensin,monensina,monensine,monensinum,monovet,romensin,rumensin" "NA"
|
||||
"MCM" 5282188 "Miocamycin" "Macrolides/lincosamides" "J01FA11,QJ01FA11" "Macrolides, lincosamides and streptogramins" "Macrolides" "NA" "acecamycin,macroral,miocamen,miocamycine,miokamycin,mosil,myocamicin,ponsinomycin" 1.2 "g" "18949-8,338-4,339-2,340-0,341-8,55687-8"
|
||||
"MON" 23667299 "Monensin sodium" "Other antibacterials" "NA" "NA" "coban,elancoban,monelan,monensin,monensina,monensine,monensinum,monovet,romensin,rumensin" "NA"
|
||||
"MRN" 70374 "Morinamide" "Antimycobacterials" "J04AK04,QJ04AK04" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "NA" "morfazinamide,morfazinammide,morfgazinamide,morinamida,morinamidum,morphazinamid,morphazinamide,piazofolina,piazolin,piazolina" "NA"
|
||||
"MFX" 152946 "Moxifloxacin" "Fluoroquinolones,Quinolones" "J01MA14,QJ01MA14,QS01AE07,S01AE07" "Quinolone antibacterials" "Fluoroquinolones" "mox,moxi,moxifl,mxf" "actira,actura,avalox,avelox,avolex,izilox,moxeza,moxifloxacine,moxifloxacino,octegra,vegamox,vigamox,zimoxin" 0.4 "g" 0.4 "g" "31037-5,31039-1,31041-7,31043-3,41502-6,43751-7,45223-5,76043-9,76044-7,76045-4,80540-8,88707-5,93497-6,96112-8"
|
||||
"MUP" 446596 "Mupirocin" "Other" "D06AX09,QD06AX09,QR01AX06,R01AX06" "mup,mupi,mupiro" "bactoderm,bactroban,centany,mupirocina,mupirocine,mupirocinum,plasimine,turixin" "20389-3,35822-6,35823-4,60542-8,60543-6,7033-4"
|
||||
"NAC" 73386748 "Nacubactam" "Beta-lactamase inhibitors" "NA" "NA" "NA" "NA"
|
||||
"NAD" 4410 "Nadifloxacin" "Fluoroquinolones,Quinolones" "D10AF05,QD10AF05" "NA" "acuatim,nadifloxacine,nadifloxacino,nadifloxacinum,nadixa,nadoxin" "NA"
|
||||
"NAF" 8982 "Nafcillin" "Penicillins,Beta-lactams" "J01CF06,QJ01CF06" "nafcil" "nafcil,nafcilin,nafcilina,nafcillinanhydrous,nafcilline,nafcillinhydrate,nafcillinmonohydrate,nafcillinsalt,nafcillinum,naftopen,nallpen,naphcillin,naphthicillin,unipen" 3 "g" "10993-4,18951-4,25232-0,346-7,347-5,348-3,349-1,41704-8"
|
||||
"ZWK" 117587595 "Nafithromycin" "Macrolides" "NA" "NA" "NA" "NA"
|
||||
"MFX" 152946 "Moxifloxacin" "Fluoroquinolones" "J01MA14,QJ01MA14,QS01AE07,S01AE07" "Quinolone antibacterials" "Fluoroquinolones" "mox,moxi,moxifl,mxf" "actira,actura,avalox,avelox,avolex,izilox,moxeza,moxifloxacine,moxifloxacino,octegra,vegamox,vigamox,zimoxin" 0.4 "g" 0.4 "g" "31037-5,31039-1,31041-7,31043-3,41502-6,43751-7,45223-5,76043-9,76044-7,76045-4,80540-8,88707-5,93497-6,96112-8"
|
||||
"MUP" 446596 "Mupirocin" "Other antibacterials" "D06AX09,QD06AX09,QR01AX06,R01AX06" "mup,mupi,mupiro" "bactoderm,bactroban,centany,mupirocina,mupirocine,mupirocinum,plasimine,turixin" "20389-3,35822-6,35823-4,60542-8,60543-6,7033-4"
|
||||
"NAC" 73386748 "Nacubactam" "Beta-lactams/penicillins" "NA" "NA" "NA" "NA"
|
||||
"NAD" 4410 "Nadifloxacin" "Fluoroquinolones" "D10AF05,QD10AF05" "NA" "acuatim,nadifloxacine,nadifloxacino,nadifloxacinum,nadixa,nadoxin" "NA"
|
||||
"NAF" 8982 "Nafcillin" "Beta-lactams/penicillins" "J01CF06,QJ01CF06" "nafcil" "nafcil,nafcilin,nafcilina,nafcillinanhydrous,nafcilline,nafcillinhydrate,nafcillinmonohydrate,nafcillinsalt,nafcillinum,naftopen,nallpen,naphcillin,naphthicillin,unipen" 3 "g" "10993-4,18951-4,25232-0,346-7,347-5,348-3,349-1,41704-8"
|
||||
"ZWK" 117587595 "Nafithromycin" "Macrolides/lincosamides" "NA" "NA" "NA" "NA"
|
||||
"NAL" 4421 "Nalidixic acid" "Quinolones" "J01MB02,QJ01MB02" "Quinolone antibacterials" "Other quinolones" "na,nal,nalac,nali" "amfonelinsaeure,baktogram,betaxina,chemiurin,cybis,dixiben,dixilina,dixinal,eucisten,eucistin,innoxalomn,innoxalon,jicsron,kusnarin,nalidicron,nalidixan,nalidixane,nalidixate,nalidixateanhydrous,nalidixic,nalidixin,nalidixinsaure,nalitucsan,nalix,nalurin,narigix,naxuril,negram,nevigramon,nicelate,nogram,poleon,sicmylon,specifen,specifin,unaserus,uralgin,uriben,uriclar,urisal,urodixin,uroman,uroneg,uronidix,uropan,wintomylon,wintron" 4 "g" "NA"
|
||||
"NAL-S" "Nalidixic acid screening test" "Quinolones" "NA" "nal screen" "NA" "NA"
|
||||
"NAR" 65452 "Narasin" "Ionophores" "QP51BB04" "narasi" "monteban,narasine,narasino,narasinum,skycis" "87570-8"
|
||||
"NEM" 11993740 "Nemonoxacin" "Fluoroquinolones,Quinolones" "J01MB08,QJ01MB08" "Quinolone antibacterials" "Other quinolones" "NA" "NA" "NA"
|
||||
"NEO" "Neomycin" "Aminoglycosides" "A01AB08,A07AA01,B05CA09,D06AX04,J01GB05,QA01AB08,QA07AA01,QB05CA09,QD06AX04,QJ01GB05,QR02AB01,QS01AA03,QS02AA07,QS03AA01,R02AB01,S01AA03,S02AA07,S03AA01" "Aminoglycoside antibacterials" "Other aminoglycosides" "neom,neomyc" "NA" 5 "g" 1 "g" "10995-9,18953-0,25262-7,354-1,355-8,356-6,357-4,41705-5"
|
||||
"NAR" 65452 "Narasin" "Other antibacterials" "QP51BB04" "narasi" "monteban,narasine,narasino,narasinum,skycis" "87570-8"
|
||||
"NEM" 11993740 "Nemonoxacin" "Fluoroquinolones" "J01MB08,QJ01MB08" "Quinolone antibacterials" "Other quinolones" "NA" "NA" "NA"
|
||||
"NEO" 8378 "Neomycin" "Aminoglycosides" "A01AB08,A07AA01,B05CA09,D06AX04,J01GB05,QA01AB08,QA07AA01,QB05CA09,QD06AX04,QJ01GB05,QR02AB01,QS01AA03,QS02AA07,QS03AA01,R02AB01,S01AA03,S02AA07,S03AA01" "Aminoglycoside antibacterials" "Other aminoglycosides" "neom,neomyc" "NA" 5 "g" 1 "g" "10995-9,18953-0,25262-7,354-1,355-8,356-6,357-4,41705-5"
|
||||
"NET" 441306 "Netilmicin" "Aminoglycosides" "J01GB07,QJ01GB07,QS01AA23,S01AA23" "Aminoglycoside antibacterials" "Other aminoglycosides" "neti,netilm" "netillin,netilmicina,netilmicine,netilmicinum,netilyn,netira,netromicine,netromycin,nettacin,ntromicine,ntromycin,vectacin,zetamicin" 0.35 "g" 0.35 "g" "18954-8,25263-5,358-2,359-0,360-8,361-6,3848-9,3849-7,3850-5,47385-0,59565-2,59566-0,59567-8,7035-9"
|
||||
"NIC" 9507 "Nicarbazin" "Other" "NA" "NA" "nicarb,nicarbasin,nicarbazine,nicarmix,nicoxin,nicrazin,nicrazine,nirazin" "NA"
|
||||
"NIF" 71946 "Nifuroquine" "Fluoroquinolones,Quinolones" "NA" "NA" "abimasten,nifuroquina,nifuroquinum,quinaldofur" "NA"
|
||||
"NFR" 9571062 "Nifurtoinol" "Nitrofurans" "J01XE02,QJ01XE02" "Other antibacterials" "Nitrofuran derivatives" "NA" "levantin,nifurmazol,nifurmazole,nifurmazolo,nifurmazolum,nifurtoinolo,nifurtoinolum,urfadin,urfadine,urfadyn" 0.16 "g" "NA"
|
||||
"NTZ" 41684 "Nitazoxanide" "Other" "P01AX11" "NA" "alinia,benzamide,colufase,cryptaz,daxon,dexidex,heliton,kidonax,nitax,nitaxozanid,nitaxozanide,nitazox,nitazoxamide,nitazoxanid,nitazoxanida,nitazoxanidum,nitrazoxanide,pacovanton,paramix,phavic" 1 "g" "73595-1,73617-3,73640-5"
|
||||
"NIT" 6604200 "Nitrofurantoin" "Nitrofurans" "J01XE01,QJ01XE01" "Other antibacterials" "Nitrofuran derivatives" "f,f/m,fd,ft,ni,nit,nit16,nitr,nitro" "alfuran,benkfuran,berkfuran,berkfurin,ceduran,chemiofuran,cistofuran,cyantin,cystit,dantafur,fuamed,furabid,furachel,furadantin,furadantine,furadantoin,furadoin,furadoine,furadonin,furadonine,furadoninum,furadontin,furalan,furaloid,furantoina,furatoin,furedan,furina,furobactina,furodantin,gerofuran,ituran,macpac,macrobid,macrodantin,macrodantina,macrofuran,macrofurin,nierofu,nifuraden,nifuradene,nifuradeno,nifuradenum,nifuradine,nifurantin,nifuretten,nitoin,nitrex,nitrofuradantin,nitrofurantoina,nitrofurantoine,nitrofurantoinum,novofuran,orafuran,oxafuradene,oxafurandene,oxifuradene,oxyfuradene,parfuran,phenurin,renafur,siraliden,trantoin,uerineks,urizept,urodin,urofuran,urofurin,urolisa,urolong,uvamin,welfurin,zoofurin" 0.2 "g" "18955-5,362-4,363-2,364-0,365-7,3860-4,7036-7"
|
||||
"NIZ" 5447130 "Nitrofurazone" "Nitrofurans" "NA" "nitfur" "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,furazyme,furesol,furosem,fuvacillin,hemofuran,hydrazinecarboxamide,ibiofural,mammex,mastofuran,monafuracin,monafuracis,monofuracin,nefco,nifucin,nifurid,nifuzon,nitrofural,nitrofuralum,nitrofuran,nitrofurane,nitrofurazan,nitrofurazonum,nitrofurol,nitrozone,otofural,otofuran,rivafurazon,rivopon,sanfuran,semioxamazide,vabrocid,vadrocid,yatrocin" "20388-5,87793-6"
|
||||
"NTR" 19910 "Nitroxoline" "Fluoroquinolones,Quinolones" "J01XX07,QJ01XX07" "Other antibacterials" "Other antibacterials" "NA" "galinok,isinok,nibiol,nicene,nitroxlina,nitroxolin,nitroxolina,nitroxolinum,noxibiol,noxin" 1 "g" "25608-1,25723-8,32382-4,54181-3,55688-6"
|
||||
"NOR" 4539 "Norfloxacin" "Fluoroquinolones,Quinolones" "J01MA06,QJ01MA06,QS01AE02,S01AE02" "Quinolone antibacterials" "Fluoroquinolones" "nor,norf,norflo,nx,nxn" "baccidal,barazan,chibroxin,chibroxine,chibroxol,fulgram,gonorcin,lexinor,nolicin,noracin,noraxin,norflo,norfloxacine,norfloxacino,norfloxacinum,norocin,noroxin,noroxine,norxacin,sebercim,uroxacin,utinor,zoroxin" 0.8 "g" "18956-3,366-5,367-3,368-1,369-9,3867-9,41504-2,7037-5"
|
||||
"NOR-S" "Norfloxacin screening test" "Fluoroquinolones,Quinolones" "NA" "nor screen" "NA" "NA"
|
||||
"NME" "Norfloxacin/metronidazole" "Fluoroquinolones,Quinolones" "J01RA14,QJ01RA14" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"NTI" "Norfloxacin/tinidazole" "Fluoroquinolones,Quinolones" "J01RA13,QJ01RA13" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"NVA" 10419027 "Norvancomycin" "Glycopeptides,Peptides" "NA" "NA" "NA" "NA"
|
||||
"NOV" 54675769 "Novobiocin" "Aminocoumarins" "QJ01XX95" "novo,novobi" "albadry,albamix,albamycin,biotexin,cardelmycin,cardelmycinsalt,cathocin,cathomycin,inabiocin,novobiocina,novobiocine,novobiocinsalt,novobiocinum,robiocina,sirbiocina,spheromycin,stilbiocina,streptonivicin,streptonivicinsalt,vulcamicina,vulcamycin,vulkamycin" "17378-1,18957-1,370-7,371-5,372-3,373-1,41706-3"
|
||||
"NYS" 6433272 "Nystatin" "Ionophores,Antifungals" "A07AA02,D01AA01,G01AA01,QA07AA02,QD01AA01,QG01AA01" "nyst,nystan" "biofanal,diastatin,herniocid,moronal,myconystatin,mycostatin,mykostatyna,nilstat,nistatin,nistatina,nyotran,nystan,nystatyna,nystavescent,nystex" 1.5 "MU" "10697-1,10698-9,18958-9,35824-2,55689-4"
|
||||
"OFX" 4583 "Ofloxacin" "Fluoroquinolones,Quinolones" "J01MA01,QJ01MA01,QS01AE01,QS02AA16,S01AE01,S02AA16" "Quinolone antibacterials" "Fluoroquinolones" "of,ofl,oflo,ofloxa,ofx" "exocin,exocine,flobacin,floxil,floxin,monoflocet,oflocet,ofloxacina,ofloxacine,ofloxacino,ofloxacinum,ofloxaxin,oxaldin,tarivid,visiren,zanocin" 0.4 "g" 0.4 "g" "18959-7,20384-4,23948-3,25264-3,374-9,375-6,376-4,377-2,3877-8,41408-6,41409-4,41410-2,42653-6,7038-3,72168-8"
|
||||
"OOR" "Ofloxacin/ornidazole" "Fluoroquinolones,Quinolones" "J01RA09,QJ01RA09" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"OLE" 72493 "Oleandomycin" "Macrolides" "J01FA05,QJ01FA05" "Macrolides, lincosamides and streptogramins" "Macrolides" "oleand" "amimycin,landomycin,matromycin,oleandomicina,oleandomycine,oleandomycinum,romicil" 1 "g" "18960-5,378-0,379-8,380-6,381-4,55690-2"
|
||||
"NIC" 9507 "Nicarbazin" "Other antibacterials" "NA" "NA" "nicarb,nicarbasin,nicarbazine,nicarmix,nicoxin,nicrazin,nicrazine,nirazin" "NA"
|
||||
"NIF" 71946 "Nifuroquine" "Fluoroquinolones" "NA" "NA" "abimasten,nifuroquina,nifuroquinum,quinaldofur" "NA"
|
||||
"NFR" 9571062 "Nifurtoinol" "Other antibacterials" "J01XE02,QJ01XE02" "Other antibacterials" "Nitrofuran derivatives" "NA" "levantin,nifurmazol,nifurmazole,nifurmazolo,nifurmazolum,nifurtoinolo,nifurtoinolum,urfadin,urfadine,urfadyn" 0.16 "g" "NA"
|
||||
"NTZ" 41684 "Nitazoxanide" "Other antibacterials" "P01AX11" "NA" "alinia,benzamide,colufase,cryptaz,daxon,dexidex,heliton,kidonax,nitax,nitaxozanid,nitaxozanide,nitazox,nitazoxamide,nitazoxanid,nitazoxanida,nitazoxanidum,nitrazoxanide,pacovanton,paramix,phavic" 1 "g" "73595-1,73617-3,73640-5"
|
||||
"NIT" 6604200 "Nitrofurantoin" "Other antibacterials" "J01XE01,QJ01XE01" "Other antibacterials" "Nitrofuran derivatives" "f,f/m,fd,ft,ni,nit,nit16,nitr,nitro" "alfuran,benkfuran,berkfuran,berkfurin,ceduran,chemiofuran,cistofuran,cyantin,cystit,dantafur,fuamed,furabid,furachel,furadantin,furadantine,furadantoin,furadoin,furadoine,furadonin,furadonine,furadoninum,furadontin,furalan,furaloid,furantoina,furatoin,furedan,furina,furobactina,furodantin,gerofuran,ituran,macpac,macrobid,macrodantin,macrodantina,macrofuran,macrofurin,nierofu,nifuraden,nifuradene,nifuradeno,nifuradenum,nifuradine,nifurantin,nifuretten,nitoin,nitrex,nitrofuradantin,nitrofurantoina,nitrofurantoine,nitrofurantoinum,novofuran,orafuran,oxafuradene,oxafurandene,oxifuradene,oxyfuradene,parfuran,phenurin,renafur,siraliden,trantoin,uerineks,urizept,urodin,urofuran,urofurin,urolisa,urolong,uvamin,welfurin,zoofurin" 0.2 "g" "18955-5,362-4,363-2,364-0,365-7,3860-4,7036-7"
|
||||
"NIZ" 5447130 "Nitrofurazone" "Other antibacterials" "NA" "nitfur" "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,furazyme,furesol,furosem,fuvacillin,hemofuran,hydrazinecarboxamide,ibiofural,mammex,mastofuran,monafuracin,monafuracis,monofuracin,nefco,nifucin,nifurid,nifuzon,nitrofural,nitrofuralum,nitrofuran,nitrofurane,nitrofurazan,nitrofurazonum,nitrofurol,nitrozone,otofural,otofuran,rivafurazon,rivopon,sanfuran,semioxamazide,vabrocid,vadrocid,yatrocin" "20388-5,87793-6"
|
||||
"NTR" 19910 "Nitroxoline" "Fluoroquinolones" "J01XX07,QJ01XX07" "Other antibacterials" "Other antibacterials" "NA" "galinok,isinok,nibiol,nicene,nitroxlina,nitroxolin,nitroxolina,nitroxolinum,noxibiol,noxin" 1 "g" "25608-1,25723-8,32382-4,54181-3,55688-6"
|
||||
"NOR" 4539 "Norfloxacin" "Fluoroquinolones" "J01MA06,QJ01MA06,QS01AE02,S01AE02" "Quinolone antibacterials" "Fluoroquinolones" "nor,norf,norflo,nx,nxn" "baccidal,barazan,chibroxin,chibroxine,chibroxol,fulgram,gonorcin,lexinor,nolicin,noracin,noraxin,norflo,norfloxacine,norfloxacino,norfloxacinum,norocin,noroxin,noroxine,norxacin,sebercim,uroxacin,utinor,zoroxin" 0.8 "g" "18956-3,366-5,367-3,368-1,369-9,3867-9,41504-2,7037-5"
|
||||
"NOR-S" "Norfloxacin screening test" "Fluoroquinolones" "NA" "nor screen" "NA" "NA"
|
||||
"NME" "Norfloxacin/metronidazole" "Fluoroquinolones" "J01RA14,QJ01RA14" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"NTI" "Norfloxacin/tinidazole" "Fluoroquinolones" "J01RA13,QJ01RA13" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"NVA" 10419027 "Norvancomycin" "Glycopeptides" "NA" "NA" "NA" "NA"
|
||||
"NOV" 54675769 "Novobiocin" "Other antibacterials" "QJ01XX95" "novo,novobi" "albadry,albamix,albamycin,biotexin,cardelmycin,cardelmycinsalt,cathocin,cathomycin,inabiocin,novobiocina,novobiocine,novobiocinsalt,novobiocinum,robiocina,sirbiocina,spheromycin,stilbiocina,streptonivicin,streptonivicinsalt,vulcamicina,vulcamycin,vulkamycin" "17378-1,18957-1,370-7,371-5,372-3,373-1,41706-3"
|
||||
"NYS" 6433272 "Nystatin" "Antifungals/antimycotics" "A07AA02,D01AA01,G01AA01,QA07AA02,QD01AA01,QG01AA01" "nyst,nystan" "biofanal,diastatin,herniocid,moronal,myconystatin,mycostatin,mykostatyna,nilstat,nistatin,nistatina,nyotran,nystan,nystatyna,nystavescent,nystex" 1.5 "MU" "10697-1,10698-9,18958-9,35824-2,55689-4"
|
||||
"OFX" 4583 "Ofloxacin" "Fluoroquinolones" "J01MA01,QJ01MA01,QS01AE01,QS02AA16,S01AE01,S02AA16" "Quinolone antibacterials" "Fluoroquinolones" "of,ofl,oflo,ofloxa,ofx" "exocin,exocine,flobacin,floxil,floxin,monoflocet,oflocet,ofloxacina,ofloxacine,ofloxacino,ofloxacinum,ofloxaxin,oxaldin,tarivid,visiren,zanocin" 0.4 "g" 0.4 "g" "18959-7,20384-4,23948-3,25264-3,374-9,375-6,376-4,377-2,3877-8,41408-6,41409-4,41410-2,42653-6,7038-3,72168-8"
|
||||
"OOR" "Ofloxacin/ornidazole" "Fluoroquinolones" "J01RA09,QJ01RA09" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"OLE" 72493 "Oleandomycin" "Macrolides/lincosamides" "J01FA05,QJ01FA05" "Macrolides, lincosamides and streptogramins" "Macrolides" "oleand" "amimycin,landomycin,matromycin,oleandomicina,oleandomycine,oleandomycinum,romicil" 1 "g" "18960-5,378-0,379-8,380-6,381-4,55690-2"
|
||||
"OMC" 54697325 "Omadacycline" "Tetracyclines" "J01AA15,QJ01AA15" "NA" "amadacycline" 0.3 "g" 0.1 "g" "73594-4,73616-5,73639-7"
|
||||
"OPT" 87880 "Optochin" "Other" "NA" "NA" "aflukin,auriquin,biquinate,chinidin,chinidine,chinimetten,chinin,chinine,conchinin,conchinine,conquinine,dentojel,dihydrochinidin,dihydroquinidine,dihydroquinine,hydroconchinine,hydroconquinine,hydroquinidine,kinidin,numoquin,optochine,optoquine,pitayine,qualaquin,quinaglute,quinicardine,quinidex,quinidine,quiniduran,quinindine,quinine,quinineanhydrous,quinora,quinsan,rezquin" "100055-3,73665-2"
|
||||
"ORB" 60605 "Orbifloxacin" "Fluoroquinolones,Quinolones" "QJ01MA95" "orbifl" "orbax" "35825-9,35826-7,35827-5"
|
||||
"ORI" 16136912 "Oritavancin" "Lipoglycopeptides,Glycopeptides,Peptides" "J01XA05,QJ01XA05" "Other antibacterials" "Glycopeptide antibacterials" "orit,oritav" "NA" "41707-1,41708-9,41709-7,41736-0"
|
||||
"ORS" "Ormetroprim/sulfamethoxazole" "Trimethoprims,Sulfonamides" "NA" "NA" "NA" "73593-6,73615-7,73638-9"
|
||||
"ORN" 28061 "Ornidazole" "Other" "G01AF06,J01XD03,P01AB03,QG01AF06,QJ01XD03,QP51AA03" "Other antibacterials" "Imidazole derivatives" "NA" "levornidazole,madelen,ornidal,ornidazolum,tiberal" 1.5 "g" 1 "g" "55691-0,55692-8,55693-6,55694-4"
|
||||
"OST" 11136668 "Ostreogrycin" "Streptogramins" "NA" "NA" "eskamicin,linopristin,stephylomycin" "NA"
|
||||
"OTE" 77050711 "Oteseconazole" "Antifungals" "J02AC06,QJ02AC06" "Antimycotics for systemic use" "Triazole derivatives" "NA" "quilseconazole,vivijoa" 21 "mg" "NA"
|
||||
"OXA" 6196 "Oxacillin" "Isoxazolylpenicillins,Penicillins,Beta-lactams" "J01CF04,QJ01CF04,QJ51CF04" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "ox,oxa,oxac,oxacil,oxal,oxs" "bactocill,bristopen,cryptocillin,micropenin,ossacillina,oxabel,oxabelsalt,oxacilina,oxacillinanhydrous,oxacilline,oxacillinhydrate,oxacillinsalt,oxacillinum,oxazocillin,oxazocilline,penstapho,prostaphlin,prostaphlyn,resistopen,stapenor" 2 "g" 2 "g" "18961-3,25265-0,382-2,383-0,384-8,385-5,3882-8,7039-1"
|
||||
"OXA-S" "Oxacillin screening test" "Isoxazolylpenicillins,Penicillins,Beta-lactams" "NA" "oxa screen" "NA" "NA"
|
||||
"OPT" 87880 "Optochin" "Other antibacterials" "NA" "NA" "aflukin,auriquin,biquinate,chinidin,chinidine,chinimetten,chinin,chinine,conchinin,conchinine,conquinine,dentojel,dihydrochinidin,dihydroquinidine,dihydroquinine,hydroconchinine,hydroconquinine,hydroquinidine,kinidin,numoquin,optochine,optoquine,pitayine,qualaquin,quinaglute,quinicardine,quinidex,quinidine,quiniduran,quinindine,quinine,quinineanhydrous,quinora,quinsan,rezquin" "100055-3,73665-2"
|
||||
"ORB" 60605 "Orbifloxacin" "Fluoroquinolones" "QJ01MA95" "orbifl" "orbax" "35825-9,35826-7,35827-5"
|
||||
"ORI" 16136912 "Oritavancin" "Glycopeptides" "J01XA05,QJ01XA05" "Other antibacterials" "Glycopeptide antibacterials" "orit,oritav" "NA" "41707-1,41708-9,41709-7,41736-0"
|
||||
"ORS" "Ormetroprim/sulfamethoxazole" "Other antibacterials" "NA" "NA" "NA" "73593-6,73615-7,73638-9"
|
||||
"ORN" 28061 "Ornidazole" "Other antibacterials" "G01AF06,J01XD03,P01AB03,QG01AF06,QJ01XD03,QP51AA03" "Other antibacterials" "Imidazole derivatives" "NA" "levornidazole,madelen,ornidal,ornidazolum,tiberal" 1.5 "g" 1 "g" "55691-0,55692-8,55693-6,55694-4"
|
||||
"OTE" 77050711 "Oteseconazole" "Antifungals/antimycotics" "J02AC06,QJ02AC06" "Antimycotics for systemic use" "Triazole derivatives" "NA" "quilseconazole,vivijoa" 21 "mg" "NA"
|
||||
"OXA" 6196 "Oxacillin" "Beta-lactams/penicillins" "J01CF04,QJ01CF04,QJ51CF04" "Beta-lactam antibacterials, penicillins" "Beta-lactamase resistant penicillins" "ox,oxa,oxac,oxacil,oxal,oxs" "bactocill,bristopen,cryptocillin,micropenin,ossacillina,oxabel,oxabelsalt,oxacilina,oxacillinanhydrous,oxacilline,oxacillinhydrate,oxacillinsalt,oxacillinum,oxazocillin,oxazocilline,penstapho,prostaphlin,prostaphlyn,resistopen,stapenor" 2 "g" 2 "g" "18961-3,25265-0,382-2,383-0,384-8,385-5,3882-8,7039-1"
|
||||
"OXA-S" "Oxacillin screening test" "Beta-lactams/penicillins" "NA" "oxa screen" "NA" "NA"
|
||||
"OXO" 4628 "Oxolinic acid" "Quinolones" "J01MB05,QJ01MB05" "Quinolone antibacterials" "Other quinolones" "oxoaci" "aqualinic,cistopax,dioxacin,emyrenil,gramurin,inoxyl,nidantin,oksaren,orthurine,ossian,oxoboi,oxolinic,pietil,prodoxal,prodoxol,starner,tiurasin,ultibid,urinox,uritrate,urotrate,uroxol,utibid" 1 "g" "NA"
|
||||
"OXY" 54675779 "Oxytetracycline" "Tetracyclines" "A01AB25,D06AA03,G01AA07,J01AA06,QA01AB25,QD06AA03,QG01AA07,QG51AA01,QJ01AA06,QJ51AA06,QS01AA04,S01AA04" "Tetracyclines" "Tetracyclines" "oxytet" "achromycin,actisite,adamycin,artomycin,berkmycen,biostat,bristacycline,cancycline,cyclopar,dabicycline,diacycine,dumocyclin,embryostat,fanterrin,galsenomycin,geomycin,geotilin,hostacycline,hydroxytetracyclinum,lenocycline,macocyn,medamycin,mephacyclin,nitox,oksisyklin,ossitetraciclina,oxitetraciclina,oxitetracyclin,oxitetracycline,oxitetracyclinum,oxymycin,oxypam,oxyterracin,oxyterracine,oxyterracyne,oxytetracid,oxytetracyclin,oxytetracyclinum,paltet,partrex,pennox,piracaps,proteroxyna,qidtet,quadracycline,quatrex,remicyclin,retet,ricycline,riomitsin,ryomycin,solkaciclina,stevacin,stilciclina,subamycin,sumycin,supramycin,sustamycin,tarocyn,tarosin,tefilin,teline,telotrex,teravit,terrafungine,terramitsin,terramycine,tetrabakat,tetrabid,tetrablet,tetracaps,tetracompren,tetrakap,tetralution,tetramavan,tetramed,tetran,tetrosol,topicycline,triphacyclin,unicin,ursocyclin,ursocycline,vetquamycin" 1 "g" 1 "g" "17396-3,18962-1,25266-8,386-3,387-1,388-9,389-7,55699-3,87595-5"
|
||||
"OZN" "Ozenoxacin" "Quinolones" "D06AX14,QD06AX14" "NA" "NA" "NA"
|
||||
"PAS" "P-aminosalicylic acid" "Antimycobacterials" "NA" "pasraa" "NA" "NA"
|
||||
"PAN" 72015 "Panipenem" "Carbapenems,Beta-lactams" "NA" "NA" "carbenin,panipenemum,penipanem" "100056-1,53823-1"
|
||||
"PAR" 165580 "Paromomycin" "Other" "A07AA06,QA07AA06,QJ01GB92" "NA" "aminosidin,amminosidin,crestomycin,estomycin,gabbromycin,gabromycin,humatin,humycin,hydroxymycin,monomycin,paramomycin,paromomicina,paromomycine,paromomycinum,paucimycin,paucimycinum" 3 "g" "51719-3,53824-9,55700-9,55701-7,55702-5"
|
||||
"PAZ" 65957 "Pazufloxacin" "Fluoroquinolones,Quinolones" "J01MA18,QJ01MA18" "Quinolone antibacterials" "Fluoroquinolones" "NA" "pazufloxacine,pazufloxacino,pazufloxacinum" 1 "g" "NA"
|
||||
"PEF" 51081 "Pefloxacin" "Fluoroquinolones,Quinolones" "J01MA03,QJ01MA03" "Quinolone antibacterials" "Fluoroquinolones" "pefl,perflo" "labocton,pefbid,pefloxacine,pefloxacinium,pefloxacino,pefloxacinum,pefocin,pefran,pelox" 0.8 "g" 0.8 "g" "18963-9,35828-3,390-5,3906-5,7040-9"
|
||||
"PEF-S" "Pefloxacin screening test" "Fluoroquinolones,Quinolones" "NA" "pef screen" "NA" "NA"
|
||||
"PNM" 10250769 "Penamecillin" "Penicillins,Beta-lactams" "J01CE06,QJ01CE06" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "havapen,hydroxymethyl,penamecilina,penamecillina,penamecilline,penamecillinum" 1.05 "g" "NA"
|
||||
"PNO" "Penicillin/novobiocin" "Penicillins,Beta-lactams,Aminocoumarins" "NA" "pennov" "NA" "35872-1,35873-9,35874-7"
|
||||
"PSU" "Penicillin/sulbactam" "Penicillins,Beta-lactams,Beta-lactamase inhibitors" "NA" "NA" "NA" "NA"
|
||||
"OZN" "Ozenoxacin" "D06AX14,QD06AX14" "NA" "NA" "NA"
|
||||
"PAS" 4649 "P-aminosalicylic acid" "Antimycobacterials" "NA" "pasraa" "NA" "NA"
|
||||
"PAN" 72015 "Panipenem" "Carbapenems" "NA" "NA" "carbenin,panipenemum,penipanem" "100056-1,53823-1"
|
||||
"PAR" 165580 "Paromomycin" "Other antibacterials" "A07AA06,QA07AA06,QJ01GB92" "NA" "aminosidin,amminosidin,crestomycin,estomycin,gabbromycin,gabromycin,humatin,humycin,hydroxymycin,monomycin,paramomycin,paromomicina,paromomycine,paromomycinum,paucimycin,paucimycinum" 3 "g" "51719-3,53824-9,55700-9,55701-7,55702-5"
|
||||
"PAZ" 65957 "Pazufloxacin" "Fluoroquinolones" "J01MA18,QJ01MA18" "Quinolone antibacterials" "Fluoroquinolones" "NA" "pazufloxacine,pazufloxacino,pazufloxacinum" 1 "g" "NA"
|
||||
"PEF" 51081 "Pefloxacin" "Fluoroquinolones" "J01MA03,QJ01MA03" "Quinolone antibacterials" "Fluoroquinolones" "pefl,perflo" "labocton,pefbid,pefloxacine,pefloxacinium,pefloxacino,pefloxacinum,pefocin,pefran,pelox" 0.8 "g" 0.8 "g" "18963-9,35828-3,390-5,3906-5,7040-9"
|
||||
"PEF-S" "Pefloxacin screening test" "Fluoroquinolones" "NA" "pef screen" "NA" "NA"
|
||||
"PNM" 10250769 "Penamecillin" "Beta-lactams/penicillins" "J01CE06,QJ01CE06" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "havapen,hydroxymethyl,penamecilina,penamecillina,penamecilline,penamecillinum" 1.05 "g" "NA"
|
||||
"PNO" "Penicillin/novobiocin" "Beta-lactams/penicillins" "NA" "pennov" "NA" "35872-1,35873-9,35874-7"
|
||||
"PSU" "Penicillin/sulbactam" "Beta-lactams/penicillins" "NA" "NA" "NA" "NA"
|
||||
"PNM1" 54686187 "Penimepicycline" "Tetracyclines" "J01AA10,QJ01AA10" "Tetracyclines" "Tetracyclines" "NA" "criseocil,duamine,geotricyn,hydrocycline,penetracyne,penimepiciclina,penimepicyclinum" "NA"
|
||||
"PIM" 65453 "Pentisomicin" "Aminoglycosides" "NA" "NA" "mutamicin,mutamycin,pentisomicina,pentisomicine,pentisomicinum" "NA"
|
||||
"PTZ" 55250256 "Pentizidone" "Other" "NA" "NA" "pentizidona,pentizidonum" "NA"
|
||||
"PEX" 16132253 "Pexiganan" "Other" "NA" "NA" "cytolex,mangainin" "NA"
|
||||
"PHE" 272833 "Pheneticillin" "Penicillins,Beta-lactams" "J01CE05,QJ01CE05" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "fene" "alfacillin,alticina,antibiocin,arcacil,arcasin,astracillin,bendralan,beromycin,brocsil,broxil,chemipen,cliacil,darcil,feneticilina,feneticillin,feneticillina,feneticilline,fenocin,icipen,isocillin,ispenoral,kavepenin,maxipen,optipen,oralopen,orapen,ospeneff,pedipen,penagen,pencompren,penemve,peniplus,penova,pensig,penvikal,phenethicilin,phenethicillin,phenethicillinum,pheneticilline,pheneticillinum,primcillin,priospen,roscopenin,semopen,suspen,synapen,syncillin,synerpenin,synthecillin,synthecilline,synthepen,triospen,vamosyn,veetids,vepen" 1 "g" "NA"
|
||||
"PHN" 6869 "Phenoxymethylpenicillin" "Penicillins,Beta-lactams" "J01CE02,QJ01CE02" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "fepe,peni v,penicillin v,phepen,pnv,pv" "apopen,calcipen,fenacilin,fenospen,meropenin,oracillin,oracilline,oratren,orocillin,ospen,phenocillin,phenomycilline,phenopenicillin,rocilin,stabicillin,vebecillin" 2 "g" "NA"
|
||||
"PMR" 5284447 "Pimaricin" "Antifungals" "NA" "natamycin" "delvocid,delvolan,delvopos,mycophyt,myprozine,natacyn,natafucin,natajen,natamatrix,natamax,natamicina,natamycin,natamycine,natamycinum,pimafucin,pimaracin,pimaricine,pimarizin,synogil,tennecetin" "NA"
|
||||
"PTZ" 55250256 "Pentizidone" "Other antibacterials" "NA" "NA" "pentizidona,pentizidonum" "NA"
|
||||
"PEX" 16132253 "Pexiganan" "Other antibacterials" "NA" "NA" "cytolex,mangainin" "NA"
|
||||
"PHE" 272833 "Pheneticillin" "Beta-lactams/penicillins" "J01CE05,QJ01CE05" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "fene" "alfacillin,alticina,antibiocin,arcacil,arcasin,astracillin,bendralan,beromycin,brocsil,broxil,chemipen,cliacil,darcil,feneticilina,feneticillin,feneticillina,feneticilline,fenocin,icipen,isocillin,ispenoral,kavepenin,maxipen,optipen,oralopen,orapen,ospeneff,pedipen,penagen,pencompren,penemve,peniplus,penova,pensig,penvikal,phenethicilin,phenethicillin,phenethicillinum,pheneticilline,pheneticillinum,primcillin,priospen,roscopenin,semopen,suspen,synapen,syncillin,synerpenin,synthecillin,synthecilline,synthepen,triospen,vamosyn,veetids,vepen" 1 "g" "NA"
|
||||
"PHN" 6869 "Phenoxymethylpenicillin" "Beta-lactams/penicillins" "J01CE02,QJ01CE02" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "fepe,peni v,penicillin v,phepen,pnv,pv" "apopen,calcipen,fenacilin,fenospen,meropenin,oracillin,oracilline,oratren,orocillin,ospen,phenocillin,phenomycilline,phenopenicillin,rocilin,stabicillin,vebecillin" 2 "g" "NA"
|
||||
"PMR" 5284447 "Pimaricin" "Antifungals/antimycotics" "NA" "natamycin" "delvocid,delvolan,delvopos,mycophyt,myprozine,natacyn,natafucin,natajen,natamatrix,natamax,natamicina,natamycin,natamycine,natamycinum,pimafucin,pimaracin,pimaricine,pimarizin,synogil,tennecetin" "NA"
|
||||
"PPA" 4831 "Pipemidic acid" "Quinolones" "J01MB04,QJ01MB04" "Quinolone antibacterials" "Other quinolones" "pipaci,pipz,pizu" "deblaston,dolcol,filtrax,karunomazin,memento,nuril,palin,pipedac,pipemid,pipemidate,pipemidic,pipemidicacid,pipram,pipurin,tractur,uromidin,urosten,uroval" 0.8 "g" "NA"
|
||||
"PIP" 43672 "Piperacillin" "Ureidopenicillins,Penicillins,Beta-lactams" "J01CA12,QJ01CA12" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "pi,pip,pipc,pipe,pipera,pp" "penmalin,pentcillin,peperacillin,peracin,piperacilina,piperacillina,piperacilline,piperacillinhydrate,piperacillinum,pipercillin,pipracil,tazocin" 14 "g" "101490-1,101491-9,18969-6,18970-4,25268-4,3972-7,407-7,408-5,409-3,410-1,411-9,412-7,413-5,414-3,54197-9,54198-7,54199-5,55704-1,7043-3,7044-1"
|
||||
"PIS" "Piperacillin/sulbactam" "Penicillins,Beta-lactams,Beta-lactamase inhibitors" "NA" "NA" "NA" 14 "g" "54197-9,54198-7,54199-5,55704-1"
|
||||
"TZP" 461573 "Piperacillin/tazobactam" "Ureidopenicillins,Penicillins,Beta-lactams,Beta-lactamase inhibitors" "J01CR05,QJ01CR05" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "p/t,piptaz,piptazo,pit,pita,pt,ptc,ptz,tzp" "piptazobactam,tazonam,zobactin,zosyn" 14 "g" "101491-9,18970-4,411-9,412-7,413-5,414-3,7044-1"
|
||||
"PRC" 71978 "Piridicillin" "Penicillins,Beta-lactams" "NA" "NA" "NA" "NA"
|
||||
"PRL" 157385 "Pirlimycin" "Lincosamides,Macrolides" "QJ51FF90" "pirlim" "pirlimycina,pirlimycine,pirlimycinum,pirsue" "35829-1,35830-9,35831-7"
|
||||
"PIP" 43672 "Piperacillin" "Beta-lactams/penicillins" "J01CA12,QJ01CA12" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "pi,pip,pipc,pipe,pipera,pp" "penmalin,pentcillin,peperacillin,peracin,piperacilina,piperacillina,piperacilline,piperacillinhydrate,piperacillinum,pipercillin,pipracil,tazocin" 14 "g" "101490-1,101491-9,18969-6,18970-4,25268-4,3972-7,407-7,408-5,409-3,410-1,411-9,412-7,413-5,414-3,54197-9,54198-7,54199-5,55704-1,7043-3,7044-1"
|
||||
"PIS" "Piperacillin/sulbactam" "Beta-lactams/penicillins" "J01CR05,QJ01CR05" "NA" "NA" 14 "g" "54197-9,54198-7,54199-5,55704-1"
|
||||
"TZP" 461573 "Piperacillin/tazobactam" "Beta-lactams/penicillins" "J01CR05,QJ01CR05" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "p/t,piptaz,piptazo,pit,pita,pt,ptc,ptz,tzp" "piptazobactam,tazonam,zobactin,zosyn" 14 "g" "101491-9,18970-4,411-9,412-7,413-5,414-3,7044-1"
|
||||
"PRC" 71978 "Piridicillin" "Beta-lactams/penicillins" "NA" "NA" "NA" "NA"
|
||||
"PRL" 157385 "Pirlimycin" "Macrolides/lincosamides" "QJ51FF90" "pirlim" "pirlimycina,pirlimycine,pirlimycinum,pirsue" "35829-1,35830-9,35831-7"
|
||||
"PIR" 4855 "Piromidic acid" "Quinolones" "J01MB03,QJ01MB03" "Quinolone antibacterials" "Other quinolones" "NA" "bactramyl,enterol,gastrurol,panacid,pirodal,piromidate,reelon,septural,urisept,uropir,zaomeal" 2 "g" "NA"
|
||||
"PVM" 33478 "Pivampicillin" "Penicillins,Beta-lactams" "J01CA02,QJ01CA02" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "NA" "pivaloylampicillin,pivampicilina,pivampicilline,pivampicillinum" 1.05 "g" "18971-2,415-0,416-8,417-6,418-4"
|
||||
"PME" 115163 "Pivmecillinam" "Penicillins,Beta-lactams" "J01CA08,QJ01CA08" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "pivmec" "coactabs,melysin,pivamdinocillin,pivmecilinamo,pivmecillinamum,selexid" 0.6 "g" "NA"
|
||||
"PVM" 33478 "Pivampicillin" "Beta-lactams/penicillins" "J01CA02,QJ01CA02" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "NA" "pivaloylampicillin,pivampicilina,pivampicilline,pivampicillinum" 1.05 "g" "18971-2,415-0,416-8,417-6,418-4"
|
||||
"PME" 115163 "Pivmecillinam" "Beta-lactams/penicillins" "J01CA08,QJ01CA08" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "pivmec" "coactabs,melysin,pivamdinocillin,pivmecilinamo,pivmecillinamum,selexid" 0.6 "g" "NA"
|
||||
"PLZ" 42613186 "Plazomicin" "Aminoglycosides" "J01GB14,QJ01GB14" "NA" "zemdri" "73592-8,73614-0,73637-1,92024-9,94719-2"
|
||||
"PLB" 49800004 "Polymyxin B" "Polymyxins" "A07AA05,J01XB02,QA07AA05,QJ01XB02,QJ51XB02,QS01AA18,QS02AA11,QS03AA03,S01AA18,S02AA11,S03AA03" "Other antibacterials" "Polymyxins" "pb,pol,polb,poly,poly b,polyb,polymixin,polymixin b" "aerosporin" 3 "MU" 0.15 "g" "17473-0,18972-0,25269-2,35832-5,419-2,420-0,421-8,422-6"
|
||||
"POP" "Polymyxin B/polysorbate 80" "Polymyxins" "NA" "NA" "NA" "NA"
|
||||
"POS" 468595 "Posaconazole" "Antifungals" "J02AC04,QJ02AC04" "Antimycotics for systemic use" "Triazole derivatives" "posa,posaco" "noxafil,schering,spriafil" 0.3 "g" 0.3 "g" "53731-6,54186-2,54187-0,54188-8,54189-6,80545-7"
|
||||
"PRA" 9802884 "Pradofloxacin" "Fluoroquinolones,Quinolones" "QJ01MA97" "NA" "pudofloxacin,veraflox" "76148-6,87800-9"
|
||||
"PRX" 71455 "Premafloxacin" "Fluoroquinolones,Quinolones" "NA" "premaf" "premafloxacine,premafloxacino" "73591-0,73613-2,73636-3"
|
||||
"POS" 468595 "Posaconazole" "Antifungals/antimycotics" "J02AC04,QJ02AC04" "Antimycotics for systemic use" "Triazole derivatives" "posa,posaco" "noxafil,schering,spriafil" 0.3 "g" 0.3 "g" "53731-6,54186-2,54187-0,54188-8,54189-6,80545-7"
|
||||
"PRA" 9802884 "Pradofloxacin" "Fluoroquinolones" "QJ01MA97" "NA" "pudofloxacin,veraflox" "76148-6,87800-9"
|
||||
"PRX" 71455 "Premafloxacin" "Fluoroquinolones" "NA" "premaf" "premafloxacine,premafloxacino" "73591-0,73613-2,73636-3"
|
||||
"PMD" 456199 "Pretomanid" "Antimycobacterials" "J04AK08,QJ04AK08" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "NA" "NA" 0.2 "g" "93850-6"
|
||||
"PRM" 6446787 "Primycin" "Macrolides" "NA" "NA" "chinopricin,debrycin,primicina,primycine" "NA"
|
||||
"PRI" 11979535 "Pristinamycin" "Streptogramins" "J01FG01,QJ01FG01" "Macrolides, lincosamides and streptogramins" "Streptogramins" "pris,pristi" "eskalin,micamicina,mikamycin,mikamycine,mikamycinum,ostreogricina,ostreogrycine,ostreogrycinum,pristinamicina,pristinamycine,pristinamycinum,pyostacine,stafac,stafytracine,stajac,staphylomycin,stapyocine,starfac,virgimycin,virgimycine,virginiamicina,virginiamycin,virginiamycina,virginiamycinum" 2 "g" "32383-2,35833-3,35834-1,55709-0"
|
||||
"PRB" 5903 "Procaine benzylpenicillin" "Penicillins,Beta-lactams" "J01CE09,QJ01CE09,QJ51CE09" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "afsillin,aquacilina,aquacillin,aquasuspen,avloprocil,cilicaine,crysticillin,depocillin,despacilina,distaquaine,duphapen,duracillin,hostacillin,hydracillin,kabipenin,ledercillin,millicillin,mylipen,neoproc,nopcaine,parencillin,premocillin,procanodia,prostabillin,retardillin,sharcillin,vetspen,vitablend,wycillin" 0.6 "g" "NA"
|
||||
"PRP" 92879 "Propicillin" "Penicillins,Beta-lactams" "J01CE03,QJ01CE03" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "baycillin,propicilina,propicilline,propicillinum" 0.9 "g" "NA"
|
||||
"PRM" 6446787 "Primycin" "Macrolides/lincosamides" "NA" "NA" "chinopricin,debrycin,primicina,primycine" "NA"
|
||||
"PRI" 11979535 "Pristinamycin" "Macrolides/lincosamides" "J01FG01,QJ01FG01" "Macrolides, lincosamides and streptogramins" "Streptogramins" "pris,pristi" "eskalin,micamicina,mikamycin,mikamycine,mikamycinum,ostreogricina,ostreogrycin,ostreogrycine,ostreogrycinum,pristinamicina,pristinamycine,pristinamycinum,pyostacine,stafac,stafytracine,stajac,staphylomycin,stapyocine,starfac,virgimycin,virgimycine,virginiamicina,virginiamycin,virginiamycina,virginiamycinum" 2 "g" "32383-2,35833-3,35834-1,55709-0"
|
||||
"PRB" 5903 "Procaine benzylpenicillin" "Beta-lactams/penicillins" "J01CE09,QJ01CE09,QJ51CE09" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "afsillin,aquacilina,aquacillin,aquasuspen,avloprocil,cilicaine,crysticillin,depocillin,despacilina,distaquaine,duphapen,duracillin,hostacillin,hydracillin,kabipenin,ledercillin,millicillin,mylipen,neoproc,nopcaine,parencillin,premocillin,procanodia,prostabillin,retardillin,sharcillin,vetspen,vitablend,wycillin" 0.6 "g" "NA"
|
||||
"PRP" 92879 "Propicillin" "Beta-lactams/penicillins" "J01CE03,QJ01CE03" "Beta-lactam antibacterials, penicillins" "Beta-lactamase sensitive penicillins" "NA" "baycillin,propicilina,propicilline,propicillinum" 0.9 "g" "NA"
|
||||
"PKA" 9872451 "Propikacin" "Aminoglycosides" "NA" "NA" "propikacina,propikacine,propikacinum" "NA"
|
||||
"PTH" 666418 "Protionamide" "Antimycobacterials" "J04AD01,QJ04AD01" "Drugs for treatment of tuberculosis" "Thiocarbamide derivatives" "prot" "ektebin,peteha,prothionamide,prothionamidum,protion,protionamid,protionamida,protionamidum,protionizina,tebeform,trevintix,tuberex" 0.75 "g" "NA"
|
||||
"PRU" 65947 "Prulifloxacin" "Fluoroquinolones,Quinolones" "J01MA17,QJ01MA17" "Quinolone antibacterials" "Fluoroquinolones" "NA" "pruvel,quisnon,sword" 0.6 "g" "100058-7,76145-2"
|
||||
"PRU" 65947 "Prulifloxacin" "Fluoroquinolones" "J01MA17,QJ01MA17" "Quinolone antibacterials" "Fluoroquinolones" "NA" "pruvel,quisnon,sword" 0.6 "g" "100058-7,76145-2"
|
||||
"PZA" 1046 "Pyrazinamide" "Antimycobacterials" "J04AK01,QJ04AK01" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "pyra" "aldinamid,aldinamide,eprazin,farmizina,isopas,novamid,pezetamid,piraldina,pirazimida,pirazinamid,pirazinamida,pirazinamide,pirazinecarboxamide,pyrafat,pyrazide,pyrazinamdie,pyrazinamidum,pyrazineamide,pyrizinamide,rifafour,rozide,tebrazid,tisamid,unipyranamide" 1.5 "g" "11001-5,18973-8,20461-0,23632-3,25186-8,25229-6,25270-0,423-4,424-2,425-9,426-7,42935-7,55710-8,55711-6,56026-8,92242-7"
|
||||
"QDA" 11979418 "Quinupristin/dalfopristin" "Streptogramins" "QJ01FG02" "Macrolides, lincosamides and streptogramins" "Streptogramins" "q/d,qda,qida,quda,rp,syn,synerc" "synercid" "23640-6,23641-4,33334-4,35835-8,58712-1"
|
||||
"RAC" 56052 "Ractopamine" "Other" "NA" "NA" "bufenina,bufenine,buphenin,buphenine,bupheninum,luteonin,nilidrine,nylidrinum,optaflexx,paylean,prepar,ractopamina,ractopaminum,ritodrina,ritodrine,ritodrinium,tomax,utopar,yutopar" "NA"
|
||||
"RAM" 16132338 "Ramoplanin" "Glycopeptides,Peptides" "NA" "ramopl" "NA" "41710-5,41711-3,41712-1,41737-8"
|
||||
"RZM" 10993211 "Razupenem" "Carbapenems,Beta-lactams" "NA" "razupe" "NA" "73590-2,73612-4,73635-5"
|
||||
"RTP" 6918462 "Retapamulin" "Pleuromutilins" "D06AX13,QD06AX13" "Antibiotics for topical use" "Other antibiotics for topical use" "ret" "altabax,altargo,rebapamulin,retapamulina" "NA"
|
||||
"QDA" 11979418 "Quinupristin/dalfopristin" "Macrolides/lincosamides" "QJ01FG02" "Macrolides, lincosamides and streptogramins" "Streptogramins" "q/d,qda,qida,quda,rp,syn,synerc" "synercid" "23640-6,23641-4,33334-4,35835-8,58712-1"
|
||||
"RAC" 56052 "Ractopamine" "Other antibacterials" "NA" "NA" "bufenina,bufenine,buphenin,buphenine,bupheninum,luteonin,nilidrine,nylidrinum,optaflexx,paylean,prepar,ractopamina,ractopaminum,ritodrina,ritodrine,ritodrinium,tomax,utopar,yutopar" "NA"
|
||||
"RAM" 16132338 "Ramoplanin" "Glycopeptides" "NA" "ramopl" "NA" "41710-5,41711-3,41712-1,41737-8"
|
||||
"RZM" 10993211 "Razupenem" "Carbapenems" "NA" "razupe" "NA" "73590-2,73612-4,73635-5"
|
||||
"RTP" 6918462 "Retapamulin" "Other antibacterials" "D06AX13,QD06AX13" "Antibiotics for topical use" "Other antibiotics for topical use" "ret" "altabax,altargo,rebapamulin,retapamulina" "NA"
|
||||
"RZF" "Rezafungin" "Antifungals" "NA" "NA" "NA" "NA"
|
||||
"RBC" 44631912 "Ribociclib" "Antifungals" "L01EF02,QL01EF02" "Antimycotics for systemic use" "Triazole derivatives" "ribo" "kisqali" 0.45 "g" "NA"
|
||||
"RBC" 44631912 "Ribociclib" "Antifungals/antimycotics" "L01EF02,QL01EF02" "Antimycotics for systemic use" "Triazole derivatives" "ribo" "kisqali" 0.45 "g" "NA"
|
||||
"RST" 33042 "Ribostamycin" "Aminoglycosides" "J01GB10,QJ01GB10" "Aminoglycoside antibacterials" "Other aminoglycosides" "NA" "exaluren,hetangmycin,ribastamin,ribostamicina,ribostamycine,ribostamycinum,vistamycin,xylostatin" 1 "g" "NA"
|
||||
"RID1" 16659285 "Ridinilazole" "Other" "NA" "NA" "ridinilazol" "NA"
|
||||
"RIB" 135398743 "Rifabutin" "Rifamycins,Antimycobacterials" "J04AB04,QJ04AB04" "Drugs for treatment of tuberculosis" "Antibiotics" "ansamy,rfb,rifb" "alfacid,ansamicin,ansamycins,ansatipin,ansatipine,assatipin,mycobutin,rifabutinum" 0.15 "g" "100699-8,16100-0,16386-5,16387-3,19149-4,20386-9,23630-7,24032-5,25199-1,25200-7,25201-5,42655-1,42656-9,54183-9,96113-6"
|
||||
"RIF" 135398735 "Rifampicin" "Rifamycins,Antimycobacterials" "J04AB02,QJ04AB02,QJ54AB02" "Drugs for treatment of tuberculosis" "Antibiotics" "rifa,rifamp" "abrifam,archidyn,arficin,arzide,benemicin,doloresum,eremfat,famcin,fenampicin,rifadin,rifadine,rifagen,rifaldazin,rifaldazine,rifaldin,rifam,rifamor,rifampicina,rifampicine,rifampicinum,rifampin,rifamsolin,rifapiam,rifaprodin,rifcin,rifinah,rifobac,rifoldin,rifoldine,riforal,rimactan,rimactane,rimactazid,rimactizid,rimazid,sinerdol,tubocin" 0.6 "g" 0.6 "g" "NA"
|
||||
"REI" 135483893 "Rifampicin/ethambutol/isoniazid" "Rifamycins,Antimycobacterials" "J04AM07,QJ04AM07" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "isonarif,rifamate,rifamazid" "NA"
|
||||
"RFI" "Rifampicin/isoniazid" "Rifamycins,Antimycobacterials" "J04AM02,QJ04AM02" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"RPEI" "Rifampicin/pyrazinamide/ethambutol/isoniazid" "Rifamycins,Antimycobacterials" "J04AM06,QJ04AM06" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"RPI" "Rifampicin/pyrazinamide/isoniazid" "Rifamycins,Antimycobacterials" "J04AM05,QJ04AM05" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"RFM" 6324616 "Rifamycin" "Rifamycins,Antimycobacterials" "A07AA13,D06AX15,J04AB03,QA07AA13,QD06AX15,QJ04AB03,QJ54AB03,QS01AA16,QS02AA12,S01AA16,S02AA12" "Drugs for treatment of tuberculosis" "Antibiotics" "rifmyc" "aemcolo,nacimycin,nancimycin,otofa,rifamastene,rifamicina,rifamycine,rifamycinum,rifocin,rifocyn,tuborin" 0.8 "g" 0.6 "g" "NA"
|
||||
"RFP" 135403821 "Rifapentine" "Rifamycins,Antimycobacterials" "J04AB05,QJ04AB05" "Drugs for treatment of tuberculosis" "Antibiotics" "rifp,rpt" "prifitin,priftin,rifapentin,rifapentina,rifapentinum" 0.11 "g" "100059-5,76627-9"
|
||||
"RFX" 6436173 "Rifaximin" "Other" "A07AA11,D06AX11,QA07AA11,QD06AX11,QG51AA06,QJ51XX01" "Intestinal antiinfectives" "Antibiotics" "NA" "fatroximin,flonorm,lormyx,lumenax,normix,rifacol,rifamixin,rifaxidin,rifaximina,rifaximine,rifaximinum,rifaxin,ritacol,spiraxin,xifaxan,xifaxsan" 0.6 "g" "73589-4,73611-6,73634-8"
|
||||
"RIT" 65633 "Ritipenem" "Carbapenems,Beta-lactams" "NA" "NA" "ritipenemsalt" "NA"
|
||||
"RIA" 163692 "Ritipenem acoxil" "Carbapenems,Beta-lactams" "NA" "NA" "penemac" "NA"
|
||||
"ROK" 5282211 "Rokitamycin" "Macrolides" "J01FA12,QJ01FA12" "Macrolides, lincosamides and streptogramins" "Macrolides" "rokita" "propionylleucomycin,ricamycin,rokicid,rokital,rokitamicina,rokitamycine,rokitamycinum" 0.8 "g" "NA"
|
||||
"RID1" 16659285 "Ridinilazole" "Other antibacterials" "NA" "NA" "ridinilazol" "NA"
|
||||
"RIB" 135398743 "Rifabutin" "Antimycobacterials" "J04AB04,QJ04AB04" "Drugs for treatment of tuberculosis" "Antibiotics" "ansamy,rifb" "alfacid,ansamicin,ansamycins,ansatipin,ansatipine,assatipin,mycobutin,rifabutinum" 0.15 "g" "100699-8,16100-0,16386-5,16387-3,19149-4,20386-9,23630-7,24032-5,25199-1,25200-7,25201-5,42655-1,42656-9,54183-9,96113-6"
|
||||
"RIF" 135398735 "Rifampicin" "Antimycobacterials" "J04AB02,QJ04AB02,QJ54AB02" "Drugs for treatment of tuberculosis" "Antibiotics" "rifa,rifamp" "abrifam,archidyn,arficin,arzide,benemicin,doloresum,eremfat,famcin,fenampicin,rifadin,rifadine,rifagen,rifaldazin,rifaldazine,rifaldin,rifam,rifamor,rifampicina,rifampicine,rifampicinum,rifampin,rifamsolin,rifapiam,rifaprodin,rifcin,rifinah,rifobac,rifoldin,rifoldine,riforal,rimactan,rimactane,rimactazid,rimactizid,rimazid,sinerdol,tubocin" 0.6 "g" 0.6 "g" "NA"
|
||||
"REI" 135483893 "Rifampicin/ethambutol/isoniazid" "Antimycobacterials" "J04AM07,QJ04AM07" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "isonarif,rifamate,rifamazid" "NA"
|
||||
"RFI" "Rifampicin/isoniazid" "Antimycobacterials" "J04AM02,QJ04AM02" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"RPEI" "Rifampicin/pyrazinamide/ethambutol/isoniazid" "Antimycobacterials" "J04AM06,QJ04AM06" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"RPI" "Rifampicin/pyrazinamide/isoniazid" "Antimycobacterials" "J04AM05,QJ04AM05" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"RFM" 6324616 "Rifamycin" "Antimycobacterials" "A07AA13,D06AX15,J04AB03,QA07AA13,QD06AX15,QJ04AB03,QJ54AB03,QS01AA16,QS02AA12,S01AA16,S02AA12" "Drugs for treatment of tuberculosis" "Antibiotics" "rifmyc" "aemcolo,nacimycin,nancimycin,otofa,rifamastene,rifamicina,rifamycine,rifamycinum,rifocin,rifocyn,tuborin" 0.8 "g" 0.6 "g" "NA"
|
||||
"RFP" 135403821 "Rifapentine" "Antimycobacterials" "J04AB05,QJ04AB05" "Drugs for treatment of tuberculosis" "Antibiotics" "rifp,rpt" "prifitin,priftin,rifapentin,rifapentina,rifapentinum" 0.11 "g" "100059-5,76627-9"
|
||||
"RFX" 6436173 "Rifaximin" "Other antibacterials" "A07AA11,D06AX11,QA07AA11,QD06AX11,QG51AA06,QJ51XX01" "Intestinal antiinfectives" "Antibiotics" "NA" "fatroximin,flonorm,lormyx,lumenax,normix,rifacol,rifamixin,rifaxidin,rifaximina,rifaximine,rifaximinum,rifaxin,ritacol,spiraxin,xifaxan,xifaxsan" 0.6 "g" "73589-4,73611-6,73634-8"
|
||||
"RIT" 65633 "Ritipenem" "Carbapenems" "NA" "NA" "ritipenemsalt" "NA"
|
||||
"RIA" 163692 "Ritipenem acoxil" "Carbapenems" "NA" "NA" "penemac" "NA"
|
||||
"ROK" 5282211 "Rokitamycin" "Macrolides/lincosamides" "J01FA12,QJ01FA12" "Macrolides, lincosamides and streptogramins" "Macrolides" "rokita" "propionylleucomycin,ricamycin,rokicid,rokital,rokitamicina,rokitamycine,rokitamycinum" 0.8 "g" "NA"
|
||||
"RLT" 54682938 "Rolitetracycline" "Tetracyclines" "J01AA09,QJ01AA09" "Tetracyclines" "Tetracyclines" "NA" "bristacin,colbiocin,kinteto,reverin,revrin,rolitetraciclina,rolitetracyclinum,solvocillin,superciclin,synotodecin,synterin,syntetrex,syntetrin,tetraverin,transcycline,velacicline,velacycline" 0.35 "g" "18976-1,435-8,436-6,437-4,438-2"
|
||||
"ROS" 287180 "Rosoxacin" "Quinolones" "J01MB01,QJ01MB01" "Quinolone antibacterials" "Other quinolones" "NA" "acrosoxacin,eracine,eradacil,eradacin,eradicin,rosoxacine,rosoxacino,rosoxacinum,roxadyl,winoxacin,winuron" 0.3 "g" "18977-9,439-0,440-8,441-6,442-4,55713-2"
|
||||
"RXT" "Roxithromycin" "Macrolides" "J01FA06,QJ01FA06" "Macrolides, lincosamides and streptogramins" "Macrolides" "roxi,roxith" "NA" 0.3 "g" "18978-7,443-2,444-0,445-7,446-5,7046-6"
|
||||
"RFL" 58258 "Rufloxacin" "Fluoroquinolones,Quinolones" "J01MA10,QJ01MA10" "Quinolone antibacterials" "Fluoroquinolones" "NA" "monos,rufloxacine,rufloxacino,rufloxacinum,tebraxin,uroflox" 0.2 "g" "NA"
|
||||
"SAL" 3085092 "Salinomycin" "Ionophores" "QP51BB01" "salino" "coxistac,procoxacin,salinomicina,salinomycine,salinomycinum" "35836-6,35837-4,35838-2,87593-0"
|
||||
"SAR" 56208 "Sarafloxacin" "Fluoroquinolones,Quinolones" "QJ01MA98" "sarafl" "difloxacino,difloxacinum,difloxcine,sarafin,saraflox,sarafloxacine,sarafloxacino,sarafloxacinum" "73588-6,73610-8,73633-0"
|
||||
"RXT" "Roxithromycin" "Macrolides/lincosamides" "J01FA06,QJ01FA06" "Macrolides, lincosamides and streptogramins" "Macrolides" "roxi,roxith" "NA" 0.3 "g" "18978-7,443-2,444-0,445-7,446-5,7046-6"
|
||||
"RFL" 58258 "Rufloxacin" "Fluoroquinolones" "J01MA10,QJ01MA10" "Quinolone antibacterials" "Fluoroquinolones" "NA" "monos,rufloxacine,rufloxacino,rufloxacinum,tebraxin,uroflox" 0.2 "g" "NA"
|
||||
"SAL" 3085092 "Salinomycin" "Other antibacterials" "QP51BB01" "salino" "coxistac,procoxacin,salinomicina,salinomycine,salinomycinum" "35836-6,35837-4,35838-2,87593-0"
|
||||
"SAR" 56208 "Sarafloxacin" "Fluoroquinolones" "QJ01MA98" "sarafl" "difloxacino,difloxacinum,difloxcine,sarafin,saraflox,sarafloxacine,sarafloxacino,sarafloxacinum" "73588-6,73610-8,73633-0"
|
||||
"SRC" 54681908 "Sarecycline" "Tetracyclines" "J01AA14,QJ01AA14" "Tetracyclines" "Tetracyclines" "NA" "sareciclina,seysara" 0.1 "g" "NA"
|
||||
"SRX" 9933415 "Sarmoxicillin" "Penicillins,Beta-lactams" "NA" "NA" "sarmoxillina,sarmoxilline,sarmoxillinum" "NA"
|
||||
"SEC" 71815 "Secnidazole" "Other" "P01AB07" "NA" "flagentyl,secnidal,secnidazolum,secnil,sindose,solosec" 2 "g" "NA"
|
||||
"SRX" 9933415 "Sarmoxicillin" "Beta-lactams/penicillins" "NA" "NA" "sarmoxillina,sarmoxilline,sarmoxillinum" "NA"
|
||||
"SEC" 71815 "Secnidazole" "Other antibacterials" "P01AB07" "NA" "flagentyl,secnidal,secnidazolum,secnil,sindose,solosec" 2 "g" "NA"
|
||||
"SMF" "Simvastatin/fenofibrate" "Antimycobacterials" "C10BA04,QC10BA04" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "simv" "NA" "NA"
|
||||
"SIS" 36119 "Sisomicin" "Aminoglycosides" "J01GB08,QJ01GB08" "Aminoglycoside antibacterials" "Other aminoglycosides" "siso,sisomy" "rickamicin,salvamina,sisomicina,sisomicine,sisomicinum,sisomin,sisomycin,sissomicin,sizomycin" 0.24 "g" "18979-5,447-3,448-1,449-9,450-7,55714-0"
|
||||
"SIT" 461399 "Sitafloxacin" "Fluoroquinolones,Quinolones" "J01MA21,QJ01MA21" "sitafl" "gracevit" 0.1 "g" "NA"
|
||||
"SIT" 461399 "Sitafloxacin" "Fluoroquinolones" "J01MA21,QJ01MA21" "sitafl" "gracevit" 0.1 "g" "NA"
|
||||
"SDA" 2724368 "Sodium aminosalicylate" "Antimycobacterials" "J04AA02,QJ04AA02" "Drugs for treatment of tuberculosis" "Aminosalicylic acid and derivatives" "NA" "bactylan,lepasen,monopas,tubersan" 14 "g" 14 "g" "NA"
|
||||
"SOL" 25242512 "Solithromycin" "Macrolides" "J01FA16,QJ01FA16" "NA" "solithera" "73587-8,73609-0,73632-2"
|
||||
"SPX" 60464 "Sparfloxacin" "Fluoroquinolones,Quinolones" "J01MA09,QJ01MA09" "Quinolone antibacterials" "Fluoroquinolones" "spa,spar,sparfl" "esparfloxacino,parox,spara,sparfloxacine,sparfloxacinum,zagam" 0.2 "g" "20397-6,23610-9,23628-1,35839-0,7047-4"
|
||||
"SPT" 15541 "Spectinomycin" "Other" "J01XX04,QJ01XX04" "Other antibacterials" "Other antibacterials" "sc,spe,spec,spect,spt" "actinospectacina,adspec,espectinomicina,prospec,spectam,spectinomicina,spectinomycine,spectinomycinhydrate,spectinomycinum,spectogard,stanilo,togamycin,trobicin" 3 "g" "18980-3,35840-8,451-5,452-3,453-1,454-9"
|
||||
"SPI" 6419898 "Spiramycin" "Macrolides" "J01FA02,QJ01FA02,QJ51FA02" "Macrolides, lincosamides and streptogramins" "Macrolides" "sipram,spir,spiram" "formacidine" 3 "g" "18981-1,455-6,456-4,457-2,458-0,55715-7"
|
||||
"SPM" "Spiramycin/metronidazole" "Other" "J01RA04,QJ01RA04" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"SOL" 25242512 "Solithromycin" "Macrolides/lincosamides" "J01FA16,QJ01FA16" "NA" "solithera" "73587-8,73609-0,73632-2"
|
||||
"SPX" 60464 "Sparfloxacin" "Fluoroquinolones" "J01MA09,QJ01MA09" "Quinolone antibacterials" "Fluoroquinolones" "spa,spar,sparfl" "esparfloxacino,parox,spara,sparfloxacine,sparfloxacinum,zagam" 0.2 "g" "20397-6,23610-9,23628-1,35839-0,7047-4"
|
||||
"SPT" 15541 "Spectinomycin" "Other antibacterials" "J01XX04,QJ01XX04" "Other antibacterials" "Other antibacterials" "sc,spe,spec,spect,spt" "actinospectacina,adspec,espectinomicina,prospec,spectam,spectinomicina,spectinomycine,spectinomycinhydrate,spectinomycinum,spectogard,stanilo,togamycin,trobicin" 3 "g" "18980-3,35840-8,451-5,452-3,453-1,454-9"
|
||||
"SPI" 6419898 "Spiramycin" "Macrolides/lincosamides" "J01FA02,QJ01FA02,QJ51FA02" "Macrolides, lincosamides and streptogramins" "Macrolides" "sipram,spir,spiram" "formacidine" 3 "g" "18981-1,455-6,456-4,457-2,458-0,55715-7"
|
||||
"SPM" "Spiramycin/metronidazole" "Other antibacterials" "J01RA04,QJ01RA04" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"STR" "Streptoduocin" "Aminoglycosides" "J01GA02,QJ01GA02" "Aminoglycoside antibacterials" "Streptomycins" "NA" "NA" 1 "g" "NA"
|
||||
"STR1" 19649 "Streptomycin" "Aminoglycosides" "A07AA04,J01GA01,QA07AA04,QJ01GA01" "Aminoglycoside antibacterials" "Streptomycins" "s,st1000,st2000,stm,str,stre,strept" "agrept,agrimycin,chemform,estreptomicina,gerox,neodiestreptopab,strepcen,streptomicina,streptomycine,streptomycinum,streptomyzin" 1 "g" "18982-9,18983-7,20462-8,23626-5,25185-0,25205-6,25206-4,35841-6,4039-4,42658-5,42659-3,459-8,460-6,461-4,462-2,46719-1,48177-0,6933-6,7048-2,7049-0,96114-4"
|
||||
"STH" "Streptomycin-high" "Aminoglycosides" "NA" "sthi,sthl,strepto high,streptomycin high" "NA" "18983-7,35841-6,6933-6,7049-0"
|
||||
"STI" "Streptomycin/isoniazid" "Antimycobacterials" "J04AM01,QJ04AM01" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"SUL" 130313 "Sulbactam" "Beta-lactamase inhibitors" "J01CG01,QJ01CG01" "Beta-lactam antibacterials, penicillins" "Beta-lactamase inhibitors" "sulbac" "betamaze,sulbactamum" 1 "g" "41716-2,41717-0,41718-8,41739-4"
|
||||
"SBC" 20055036 "Sulbenicillin" "Penicillins,Beta-lactams" "J01CA16,QJ01CA16" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "sulben" "kedacillin,kedacillina,sulbenicilina,sulbenicilline,sulbenicillinum,sulpelin" 15 "g" "NA"
|
||||
"SUC" 5318 "Sulconazole" "Antifungals" "D01AC09,QD01AC09" "NA" "sulconazol,sulconazolum" "NA"
|
||||
"SUP" 6634 "Sulfachlorpyridazine" "Sulfonamides" "QJ01EQ12" "sulchl" "cluricol,cosulid,cosumix,durasulf,nefrosul,nsulfanilamide,prinzone,solfaclorpiridazina,sonilyn,sulfacloropiridazina,sulfaclorpiridazina,vetisulid" "NA"
|
||||
"SDI" 5215 "Sulfadiazine" "Trimethoprims,Sulfonamides" "J01EC02,QJ01EQ10" "Sulfonamides and trimethoprim" "Intermediate-acting sulfonamides" "suldia" "codiazine,cremodiazine,cremotres,debenal,deltazina,dermazin,dermazine,diazolone,diazovit,eskadiazine,flamazine,geben,liquadiazine,microsulfon,neazine,neotrizine,palatrize,piridisir,pirimal,pyrimal,quadetts,quadramoid,sanodiazine,silbertone,sildaflo,silvadene,silvazine,silver,silveramide,sliverex,solfadiazina,spofadrizine,sterazine,sulfacombin,sulfadiazene,sulfadiazin,sulfadiazina,sulfadiazinum,sulfapirimidin,sulfapyrimidin,sulfapyrimidine,sulfatryl,sulfazine,sulfolex,sulfonsol,sulfose,sulphadiazine,terfonyl,theradiazine,thermazene,trifonamide,trisem,truozine" 0.6 "g" "18984-5,27216-1,463-0,464-8,465-5,466-3,59742-7,6907-0,7050-8"
|
||||
"SLT" 122284 "Sulfadiazine/tetroxoprim" "Trimethoprims,Sulfonamides" "J01EE06" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "NA" "berlocombin,cotetroxazine,potesept,trimerazine" "NA"
|
||||
"SLT1" 64932 "Sulfadiazine/trimethoprim" "Trimethoprims,Sulfonamides" "J01EE02,QJ01EW10,QJ51RE01" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "NA" "antastmon,astra,ditrim,ditrivet,sultrisan,triglobe,trimin,tucoprim,uniprim" "NA"
|
||||
"SUD" 5323 "Sulfadimethoxine" "Trimethoprims,Sulfonamides" "J01ED01,QJ01EQ09,QP51BA01" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "sdimet" "abcid,agribon,albon,arnosulfan,bactotril,bactrovet,deposul,diasulfa,diasulfyl,dimetazina,dinosol,dorisul,fuxal,lasibon,madribon,madrigid,madriqid,madroxin,madroxine,maxulvet,mecozine,memcozine,metoxidon,neostrepal,neostreptal,nsulfanilamidesalt,omnibon,persulfen,radonin,redifal,rofenaid,roscosulf,scandisil,solfadimetossina,sudine,suldixine,sulfabon,sulfadimethoxin,sulfadimethoxinesalt,sulfadimethoxinum,sulfadimetossina,sulfadimetoxin,sulfadimetoxina,sulfadimetoxine,sulfadimoxine,sulfastop,sulfoplan,sulforal,sulphadimethoxine,sulxin,sumbio,symbio,theracanzan,ultrasulfon" 0.5 "g" "87799-3,87803-3"
|
||||
"SDM" 5327 "Sulfadimidine" "Trimethoprims,Sulfonamides" "J01EB03,QJ01EQ03,QP51AG01" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "suldim" "azolmetazin,bovibol,calfspan,cremomethazine,diazil,diazilsulfadine,diazyl,dimezathine,intradine,kelametazine,mermeth,neasina,neazina,panazin,pirmazin,primazin,solfadimidina,spanbolet,sulfadimerazine,sulfadimesin,sulfadimesine,sulfadimethyldiazine,sulfadimezin,sulfadimezine,sulfadimezinum,sulfadimidin,sulfadimidina,sulfadimidinum,sulfadimidinun,sulfadine,sulfametazina,sulfametazyny,sulfamethiazine,sulfamezathine,sulfamidine,sulfodimesin,sulfodimezine,sulmet,sulphadimidine,sulphamethasine,sulphamethazine,sulphamezathine,sulphamidine,sulphodimezine,superseptil,superseptyl,vertolan,vesadin" 4 "g" "NA"
|
||||
"SLT2" "Sulfadimidine/trimethoprim" "Trimethoprims,Sulfonamides" "J01EE05,QJ01EW03" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "NA" "NA" "NA"
|
||||
"SLF" 5344 "Sulfafurazole" "Trimethoprims,Sulfonamides" "J01EB05,QJ01EQ05,QS01AB02,S01AB02" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "sfsz" "accuzole,alphazole,amidoxal,astrazolo,azosulfizin,bactesulf,barazae,chemouag,cosoxazole,dorsulfan,entusil,entusul,ganda,gantrisin,gantrisine,gantrisona,gantrizin,gantrosan,isoxamin,neazolin,neoxazol,novazolo,novosaxazole,nsulphanilamide,pancid,pediazole,renosulfan,resoxol,roxosul,roxoxol,saxosozine,sodizole,solfafurazolo,sosol,soxamide,soxisol,soxitabs,soxomide,stansin,sulbio,sulfafurazol,sulfafurazolum,sulfagan,sulfagen,sulfaisoxazole,sulfalar,sulfapolar,sulfasol,sulfasoxazole,sulfasoxizole,sulfazin,sulfisin,sulfisonazole,sulfisoxasole,sulfisoxazol,sulfisoxazolum,sulfizin,sulfizol,sulfizole,sulfofurazole,sulfoxol,suloxsol,sulphafuraz,sulphafurazol,sulphafurazole,sulphafurazolum,sulphaisoxazole,sulphisoxazol,sulphisoxazole,sulphofurazole,sulsoxin,thiasin,unisulf,urisoxin,uritrisin,urogan" 4 "g" 4 "g" "NA"
|
||||
"SLF1" 5343 "Sulfaisodimidine" "Trimethoprims,Sulfonamides" "J01EB01" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "NA" "aristamid,aristamide,aristogyn,domain,domian,elcosin,elcosine,elkosil,elkosin,elkosine,erycon,isosulf,mefenal,solfisomidina,sulfadimetine,sulfaisodimerazine,sulfaisodimidinum,sulfaisomidine,sulfasomidine,sulfisomidin,sulfisomidina,sulfisomidine,sulfisomidinum,sulphasomidine" 4 "g" 4 "g" "NA"
|
||||
"SLF2" 9047 "Sulfalene" "Trimethoprims,Sulfonamides" "J01ED02,QJ01EQ19" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "dalysep,farmitalia,kelfizin,kelfizina,kelfizine,policydal,solfametopirazina,sulfalen,sulfaleno,sulfalenum,sulfamethopyrazine,sulfamethoxypyrazine,sulfametopyrazine,sulfametoxypyridazin,sulphalene,sulphametopyrazine,vetkelfizina" 0.1 "g" "NA"
|
||||
"SZO" 187764 "Sulfamazone" "Trimethoprims,Sulfonamides" "J01ED09" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "sulfamazona,sulfamazonum,sulfenazone" 1.5 "g" "NA"
|
||||
"SLF3" 5325 "Sulfamerazine" "Trimethoprims,Sulfonamides" "D06BA06,J01ED07,QD06BA06,QJ01EQ17" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "sulmet" "cremomerazine,kelamerazine,mebacid,mesulfa,methylpyrimal,methylsulfazin,methylsulfazine,metilsulfadiazin,metilsulfazin,percoccide,pyralcid,romezin,septacil,septosyl,solfamerazina,solumedin,solumedine,sulfameradine,sulfamerazin,sulfamerazina,sulfamerazinum,sulfamethyldiazine,sulphamerazine,sumedine" 3 "g" "NA"
|
||||
"SLT3" "Sulfamerazine/trimethoprim" "Trimethoprims,Sulfonamides" "J01EE07,QJ01EW18" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "NA" "NA" "NA"
|
||||
"SUM" "Sulfamethazine" "Sulfonamides" "NA" "NA" "NA" "87592-2"
|
||||
"SLF4" 5328 "Sulfamethizole" "Trimethoprims,Sulfonamides" "B05CA04,D06BA04,J01EB02,QB05CA04,QD06BA04,QJ01EQ02,QS01AB01,S01AB01" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "sfmz" "aethazolum,ayerlucil,berlophen,gliprotiazol,globucid,globucin,globuzid,glyprothiazol,glyprothiazole,glyprothiazolum,glyprothizolum,lucosil,microsul,proklar,renasul,rufol,salimol,sethadil,solfametizolo,solfetidolo,sulfaethidiole,sulfaethidol,sulfaethidole,sulfaethidolum,sulfaetidol,sulfamethizol,sulfamethizolum,sulfametizol,sulfapyelon,sulfstat,sulfurine,sulphaethidole,sulphamethizole,tardipyrine,tetracid,thidicur,thiosulfil,ultrasul,urocydal,urodiaton,urolucosil,urosulfin" 4 "g" "60175-7,60176-5,60177-3"
|
||||
"SMX" 5329 "Sulfamethoxazole" "Trimethoprims,Sulfonamides" "J01EC01,QJ01EQ11" "Sulfonamides and trimethoprim" "Intermediate-acting sulfonamides" "sfmx,sulf,sulfam" "septran,septrin,simsinomin,sinomin,solfametossazolo,sulfamethalazole,sulfamethoxazolum,sulfamethoxizole,sulfamethylisoxazole,sulfametoxazol,sulfiodizole,sulfisomezole,sulphisomezole,urobak" 2 "g" "10342-4,11577-4,18985-2,25271-8,39772-9,467-1,468-9,469-7,470-5,59971-2,59972-0,60333-2,72674-5,80549-9,80974-9"
|
||||
"SLF5" 5330 "Sulfamethoxypyridazine" "Trimethoprims,Sulfonamides" "J01ED05,QJ01EQ15" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "altezol,cysul,davosin,depovernil,durox,kineks,kinex,kynex,lederkyn,lentac,lisulfen,longin,medicel,midicel,midikel,myasul,opinsul,paramid,petrisul,piridolo,quinoseptyl,retamid,retasulfin,retasulphine,slosul,spofadazine,succinylsulfathi,sulfalex,sulfapiridazin,sulfapyridazine,sulfdurazin,sulfozona,sultirene,vinces" 0.5 "g" "NA"
|
||||
"SLF6" 19596 "Sulfametomidine" "Trimethoprims,Sulfonamides" "J01ED03" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "duroprocin,methofadin,methofazine,solfametomidina,sulfametomidin,sulfametomidina,sulfametomidinum,telemid" "NA"
|
||||
"SLF7" 5326 "Sulfametoxydiazine" "Trimethoprims,Sulfonamides" "J01ED04" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "bayrena,berlicid,dairena,durenat,juvoxin,kinecid,kirocid,kiron,longasulf,methoxypyrimal,solfametossidiazina,sulfameter,sulfametersalt,sulfamethorine,sulfamethoxine,sulfamethoxydiazin,sulfamethoxydiazine,sulfamethoxydin,sulfamethoxydine,sulfametin,sulfametinum,sulfametorine,sulfametorinum,sulfametoxidiazina,sulfametoxidine,sulfametoxydiazinum,sulla,sulphameter,sulphamethoxydiazine,supramid,ultrax" 0.5 "g" "NA"
|
||||
"SLT4" "Sulfametrole/trimethoprim" "Trimethoprims,Sulfonamides" "J01EE03" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "trsm" "NA" "NA"
|
||||
"SLF8" 12894 "Sulfamoxole" "Trimethoprims,Sulfonamides" "J01EC03" "Sulfonamides and trimethoprim" "Intermediate-acting sulfonamides" "NA" "enterocura,justamil,oxasulfa,solfaguanolo,solfamossolo,sulfadimethyloxazole,sulfaguanol,sulfaguanole,sulfaguanolum,sulfamoxol,sulfamoxolum,sulfano,sulfavigor,sulfmidil,sulfono,sulfune,sulfuno,sulphamoxole,tardamid,tardamide" 1 "g" 1 "g" "NA"
|
||||
"SLT5" "Sulfamoxole/trimethoprim" "Trimethoprims,Sulfonamides" "J01EE04" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "NA" "NA" "NA"
|
||||
"SLF9" 5333 "Sulfanilamide" "Trimethoprims,Sulfonamides" "D06BA05,J01EB06,QD06BA05,QJ01EQ06" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "NA" "albexan,albosal,ambeside,antistrept,astreptine,astrocid,bacteramid,bactesid,collomide,colsulanyde,copticide,deseptyl,dipron,ergaseptine,erysipan,estreptocida,exoseptoplix,fourneau,gerison,gombardol,hydroxysulfonamide,infepan,lusil,lysococcine,neococcyl,orgaseptine,prontalbin,prontylin,proseptal,proseptine,proseptol,pysococcine,sanamid,septanilam,septinal,septolix,septoplex,septoplix,solfanilamide,stramid,strepamide,strepsan,streptagol,streptamid,streptamin,streptasol,streptocid,streptocide,streptocidum,streptoclase,streptocom,streptopan,streptosil,streptozol,streptozone,streptrocide,sulfamidyl,sulfamine,sulfana,sulfanalone,sulfanidyl,sulfanil,sulfanilamida,sulfanilamidomethan,sulfanilamidum,sulfanimide,sulfocidin,sulfocidine,sulfonylamide,sulphanilamide,sulphanilamidum,sulphonamide,therapol,tolder" "NA"
|
||||
"SLF10" 68933 "Sulfaperin" "Trimethoprims,Sulfonamides" "J01ED06" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "anastaf,archisulfa,archisulpha,avissul,chemiopen,demosulfan,demosulphan,durisan,isosulfamerazine,isosulphamerazine,methylsulfadiazin,methylsulfadiazine,methylsulphadiazine,novosul,orosulfan,pallidin,retardon,risulfasens,sulfaperina,sulfaperine,sulfaperinum,sulfatreis,sulfopirimidine,sulpenta,sulphaperin,sulphaperina,sulphaperinum" 0.5 "g" "NA"
|
||||
"SLF11" 5335 "Sulfaphenazole" "Trimethoprims,Sulfonamides" "J01ED08,QJ01EQ08" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "depocid,depotsulfonamide,eftolon,firmazolo,inamil,isarol,merian,orisul,orisulf,paidazolo,phenylsulfapyrazole,plisulfan,raziosulfa,solfafenazolo,sulfabid,sulfafenazol,sulfafenazolo,sulfaphenazol,sulfaphenazolum,sulfaphenazon,sulfaphenylpipazol,sulfaphenylpyrazol,sulfaphenylpyrazole,sulfonylpyrazol,sulphaphenazole,sulphenazole" 1 "g" "NA"
|
||||
"SLF12" 5336 "Sulfapyridine" "Trimethoprims,Sulfonamides" "J01EB04,QJ01EQ04" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "NA" "adiplon,coccoclase,dagenan,eubasin,eubasinum,haptocil,piridazol,plurazol,pyriamid,pyridazol,relbapiridina,ronin,septipulmon,solfapiridina,soludagenan,streptosilpyridine,sulfapiridina,sulfapyridin,sulfapyridinum,sulfidin,sulfidine,sulphapyridin,sulphapyridine,thioseptal,trianon" 1 "g" "14075-6,55580-5"
|
||||
"SNA" 60582 "Sulfasuccinamide" "Sulfonamides" "NA" "NA" "sulfasuccinamid,sulfasuccinamida,sulfasuccinamidum" "NA"
|
||||
"SUT" 5340 "Sulfathiazole" "Trimethoprims,Sulfonamides" "D06BA02,J01EB07,QD06BA02,QJ01EQ07" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "sulthi" "azoquimiol,azoseptale,cerazol,cerazole,chemosept,cibazol,duatok,dulana,eleudron,enterobiocine,estafilol,formosulfathiazole,neostrepsan,norsulfasol,norsulfazol,norsulfazole,norsulfazolum,planomide,poliseptil,sanotiazol,septozol,solfatiazolo,soluthiazomide,streptosilthiazole,sulfamul,sulfaplex,sulfathiazol,sulfathiazolesalt,sulfathiazolum,sulfatiazol,sulfavitina,sulfocerol,sulphathiazole,sulzol,thiacoccine,thiasulfol,thiazamide,thiozamide,wintrazole" "87591-4,87796-9,87797-7"
|
||||
"SLF13" 3000579 "Sulfathiourea" "Trimethoprims,Sulfonamides" "J01EB08" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "NA" "badional,baldinol,fontamide,salvoseptyl,solfatiourea,solufontamide,sulfanilthiourea,sulfathiocarbamid,sulfathiocarbamide,sulfathiocarbamidum,sulfathioureasalt,sulfathiouree,sulfatiourea,sulphathiourea" 6 "g" "NA"
|
||||
"SOX" "Sulfisoxazole" "Sulfonamides" "NA" "sulfiz" "NA" "11578-2,18986-0,25226-2,471-3,472-1,473-9,474-7,9701-4"
|
||||
"SSS" 86225 "Sulfonamide" "Sulfonamides" "NA" "sfna,sulami" "NA" "17674-3,17675-0,18987-8,35842-4,4040-2,4041-0,4042-8,475-4,476-2,477-0,478-8,75650-2"
|
||||
"SLP" 9950244 "Sulopenem" "Other" "NA" "sulope" "orlynvah" "55289-3,55290-1,55291-9"
|
||||
"SLT6" 444022 "Sultamicillin" "Penicillins,Beta-lactams,Beta-lactamase inhibitors" "J01CR04,QJ01CR04" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "sultos" "combisid,sultamicilina,sultamicilline,sultamicillinum,unacid" 1.5 "g" "NA"
|
||||
"SUR" 46700778 "Surotomycin" "Other" "NA" "NA" "surotomicina,surotomycine" "NA"
|
||||
"TAL" 71447 "Talampicillin" "Penicillins,Beta-lactams" "J01CA15,QJ01CA15" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "NA" "aseocillin,phthalidyl,talampicilina,talampicilline,talampicillinum,talpen,yamacillin" 2 "g" "18988-6,479-6,480-4,481-2,482-0"
|
||||
"TLP" 163307 "Talmetoprim" "Other" "NA" "NA" "NA" "NA"
|
||||
"TAN" 76902493 "Taniborbactam" "Carbapenems,Beta-lactams,Beta-lactamase inhibitors" "NA" "vnrx-5133" "NA" "NA"
|
||||
"TAZ" 123630 "Tazobactam" "Beta-lactamase inhibitors" "J01CG02,QJ01CG02" "Beta-lactam antibacterials, penicillins" "Beta-lactamase inhibitors" "tazo,tazoba" "exblifep,tazobactamsalt,tazobactamum,tazobactum" "41719-6,41720-4,41721-2,41740-2"
|
||||
"TBP" 9800194 "Tebipenem" "Carbapenems,Beta-lactams" "NA" "NA" "NA" "NA"
|
||||
"SUL" 130313 "Sulbactam" "Beta-lactams/penicillins" "J01CG01,QJ01CG01" "Beta-lactam antibacterials, penicillins" "Beta-lactamase inhibitors" "sulbac" "betamaze,sulbactamum" 1 "g" "41716-2,41717-0,41718-8,41739-4"
|
||||
"SBC" 20055036 "Sulbenicillin" "Beta-lactams/penicillins" "J01CA16,QJ01CA16" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "sulben" "kedacillin,kedacillina,sulbenicilina,sulbenicilline,sulbenicillinum,sulpelin" 15 "g" "NA"
|
||||
"SUC" 5318 "Sulconazole" "Antifungals/antimycotics" "D01AC09,QD01AC09" "NA" "sulconazol,sulconazolum" "NA"
|
||||
"SUP" 6634 "Sulfachlorpyridazine" "Other antibacterials" "QJ01EQ12" "sulchl" "cluricol,cosulid,cosumix,durasulf,nefrosul,nsulfanilamide,prinzone,solfaclorpiridazina,sonilyn,sulfacloropiridazina,sulfaclorpiridazina,vetisulid" "NA"
|
||||
"SDI" 5215 "Sulfadiazine" "Trimethoprims" "J01EC02,QJ01EQ10" "Sulfonamides and trimethoprim" "Intermediate-acting sulfonamides" "suldia" "codiazine,cremodiazine,cremotres,debenal,deltazina,dermazin,dermazine,diazolone,diazovit,eskadiazine,flamazine,geben,liquadiazine,microsulfon,neazine,neotrizine,palatrize,piridisir,pirimal,pyrimal,quadetts,quadramoid,sanodiazine,silbertone,sildaflo,silvadene,silvazine,silver,silveramide,sliverex,solfadiazina,spofadrizine,sterazine,sulfacombin,sulfadiazene,sulfadiazin,sulfadiazina,sulfadiazinum,sulfapirimidin,sulfapyrimidin,sulfapyrimidine,sulfatryl,sulfazine,sulfolex,sulfonsol,sulfose,sulphadiazine,terfonyl,theradiazine,thermazene,trifonamide,trisem,truozine" 0.6 "g" "18984-5,27216-1,463-0,464-8,465-5,466-3,59742-7,6907-0,7050-8"
|
||||
"SLT" 122284 "Sulfadiazine/tetroxoprim" "Trimethoprims" "J01EE06" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "NA" "berlocombin,cotetroxazine,potesept,trimerazine" "NA"
|
||||
"SLT1" 64932 "Sulfadiazine/trimethoprim" "Trimethoprims" "J01EE02,QJ01EW10,QJ51RE01" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "NA" "antastmon,astra,ditrim,ditrivet,sultrisan,triglobe,trimin,tucoprim,uniprim" "NA"
|
||||
"SUD" 5323 "Sulfadimethoxine" "Trimethoprims" "J01ED01,QJ01EQ09,QP51BA01" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "sdimet" "abcid,agribon,albon,arnosulfan,bactotril,bactrovet,deposul,diasulfa,diasulfyl,dimetazina,dinosol,dorisul,fuxal,lasibon,madribon,madrigid,madriqid,madroxin,madroxine,maxulvet,mecozine,memcozine,metoxidon,neostrepal,neostreptal,nsulfanilamidesalt,omnibon,persulfen,radonin,redifal,rofenaid,roscosulf,scandisil,solfadimetossina,sudine,suldixine,sulfabon,sulfadimethoxin,sulfadimethoxinesalt,sulfadimethoxinum,sulfadimetossina,sulfadimetoxin,sulfadimetoxina,sulfadimetoxine,sulfadimoxine,sulfastop,sulfoplan,sulforal,sulphadimethoxine,sulxin,sumbio,symbio,theracanzan,ultrasulfon" 0.5 "g" "87799-3,87803-3"
|
||||
"SDM" 5327 "Sulfadimidine" "Trimethoprims" "J01EB03,QJ01EQ03,QP51AG01" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "suldim" "azolmetazin,bovibol,calfspan,cremomethazine,diazil,diazilsulfadine,diazyl,dimezathine,intradine,kelametazine,mermeth,neasina,neazina,panazin,pirmazin,primazin,solfadimidina,spanbolet,sulfadimerazine,sulfadimesin,sulfadimesine,sulfadimethyldiazine,sulfadimezin,sulfadimezine,sulfadimezinum,sulfadimidin,sulfadimidina,sulfadimidinum,sulfadimidinun,sulfadine,sulfametazina,sulfametazyny,sulfamethiazine,sulfamezathine,sulfamidine,sulfodimesin,sulfodimezine,sulmet,sulphadimidine,sulphamethasine,sulphamethazine,sulphamezathine,sulphamidine,sulphodimezine,superseptil,superseptyl,vertolan,vesadin" 4 "g" "NA"
|
||||
"SLT2" "Sulfadimidine/trimethoprim" "Trimethoprims" "J01EE05,QJ01EW03" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "NA" "NA" "NA"
|
||||
"SLF" 5344 "Sulfafurazole" "Trimethoprims" "J01EB05,QJ01EQ05,QS01AB02,S01AB02" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "sfsz" "accuzole,alphazole,amidoxal,astrazolo,azosulfizin,bactesulf,barazae,chemouag,cosoxazole,dorsulfan,entusil,entusul,ganda,gantrisin,gantrisine,gantrisona,gantrizin,gantrosan,isoxamin,neazolin,neoxazol,novazolo,novosaxazole,nsulphanilamide,pancid,pediazole,renosulfan,resoxol,roxosul,roxoxol,saxosozine,sodizole,solfafurazolo,sosol,soxamide,soxisol,soxitabs,soxomide,stansin,sulbio,sulfafurazol,sulfafurazolum,sulfagan,sulfagen,sulfaisoxazole,sulfalar,sulfapolar,sulfasol,sulfasoxazole,sulfasoxizole,sulfazin,sulfisin,sulfisonazole,sulfisoxasole,sulfisoxazol,sulfisoxazolum,sulfizin,sulfizol,sulfizole,sulfofurazole,sulfoxol,suloxsol,sulphafuraz,sulphafurazol,sulphafurazole,sulphafurazolum,sulphaisoxazole,sulphisoxazol,sulphisoxazole,sulphofurazole,sulsoxin,thiasin,unisulf,urisoxin,uritrisin,urogan" 4 "g" 4 "g" "NA"
|
||||
"SLF1" 5343 "Sulfaisodimidine" "Trimethoprims" "J01EB01" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "NA" "aristamid,aristamide,aristogyn,domain,domian,elcosin,elcosine,elkosil,elkosin,elkosine,erycon,isosulf,mefenal,solfisomidina,sulfadimetine,sulfaisodimerazine,sulfaisodimidinum,sulfaisomidine,sulfasomidine,sulfisomidin,sulfisomidina,sulfisomidine,sulfisomidinum,sulphasomidine" 4 "g" 4 "g" "NA"
|
||||
"SLF2" 9047 "Sulfalene" "Trimethoprims" "J01ED02,QJ01EQ19" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "dalysep,farmitalia,kelfizin,kelfizina,kelfizine,policydal,solfametopirazina,sulfalen,sulfaleno,sulfalenum,sulfamethopyrazine,sulfamethoxypyrazine,sulfametopyrazine,sulfametoxypyridazin,sulphalene,sulphametopyrazine,vetkelfizina" 0.1 "g" "NA"
|
||||
"SZO" 187764 "Sulfamazone" "Trimethoprims" "J01ED09" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "sulfamazona,sulfamazonum,sulfenazone" 1.5 "g" "NA"
|
||||
"SLF3" 5325 "Sulfamerazine" "Trimethoprims" "D06BA06,J01ED07,QD06BA06,QJ01EQ17" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "sulmet" "cremomerazine,kelamerazine,mebacid,mesulfa,methylpyrimal,methylsulfazin,methylsulfazine,metilsulfadiazin,metilsulfazin,percoccide,pyralcid,romezin,septacil,septosyl,solfamerazina,solumedin,solumedine,sulfameradine,sulfamerazin,sulfamerazina,sulfamerazinum,sulfamethyldiazine,sulphamerazine,sumedine" 3 "g" "NA"
|
||||
"SLT3" "Sulfamerazine/trimethoprim" "Trimethoprims" "J01EE07,QJ01EW18" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "NA" "NA" "NA"
|
||||
"SUM" 5327 "Sulfamethazine" "Other antibacterials" "NA" "NA" "NA" "87592-2"
|
||||
"SLF4" 5328 "Sulfamethizole" "Trimethoprims" "B05CA04,D06BA04,J01EB02,QB05CA04,QD06BA04,QJ01EQ02,QS01AB01,S01AB01" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "sfmz" "aethazolum,ayerlucil,berlophen,gliprotiazol,globucid,globucin,globuzid,glyprothiazol,glyprothiazole,glyprothiazolum,glyprothizolum,lucosil,microsul,proklar,renasul,rufol,salimol,sethadil,solfametizolo,solfetidolo,sulfaethidiole,sulfaethidol,sulfaethidole,sulfaethidolum,sulfaetidol,sulfamethizol,sulfamethizolum,sulfametizol,sulfapyelon,sulfstat,sulfurine,sulphaethidole,sulphamethizole,tardipyrine,tetracid,thidicur,thiosulfil,ultrasul,urocydal,urodiaton,urolucosil,urosulfin" 4 "g" "60175-7,60176-5,60177-3"
|
||||
"SMX" 5329 "Sulfamethoxazole" "Trimethoprims" "J01EC01,QJ01EQ11" "Sulfonamides and trimethoprim" "Intermediate-acting sulfonamides" "sfmx,sulf,sulfam" "septran,septrin,simsinomin,sinomin,solfametossazolo,sulfamethalazole,sulfamethoxazolum,sulfamethoxizole,sulfamethylisoxazole,sulfametoxazol,sulfiodizole,sulfisomezole,sulphisomezole,urobak" 2 "g" "10342-4,11577-4,18985-2,25271-8,39772-9,467-1,468-9,469-7,470-5,59971-2,59972-0,60333-2,72674-5,80549-9,80974-9"
|
||||
"SLF5" 5330 "Sulfamethoxypyridazine" "Trimethoprims" "J01ED05,QJ01EQ15" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "altezol,cysul,davosin,depovernil,durox,kineks,kinex,kynex,lederkyn,lentac,lisulfen,longin,medicel,midicel,midikel,myasul,opinsul,paramid,petrisul,piridolo,quinoseptyl,retamid,retasulfin,retasulphine,slosul,spofadazine,succinylsulfathi,sulfalex,sulfapiridazin,sulfapyridazine,sulfdurazin,sulfozona,sultirene,vinces" 0.5 "g" "NA"
|
||||
"SLF6" 19596 "Sulfametomidine" "Trimethoprims" "J01ED03" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "duroprocin,methofadin,methofazine,solfametomidina,sulfametomidin,sulfametomidina,sulfametomidinum,telemid" "NA"
|
||||
"SLF7" 5326 "Sulfametoxydiazine" "Trimethoprims" "J01ED04" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "bayrena,berlicid,dairena,durenat,juvoxin,kinecid,kirocid,kiron,longasulf,methoxypyrimal,solfametossidiazina,sulfameter,sulfametersalt,sulfamethorine,sulfamethoxine,sulfamethoxydiazin,sulfamethoxydiazine,sulfamethoxydin,sulfamethoxydine,sulfametin,sulfametinum,sulfametorine,sulfametorinum,sulfametoxidiazina,sulfametoxidine,sulfametoxydiazinum,sulla,sulphameter,sulphamethoxydiazine,supramid,ultrax" 0.5 "g" "NA"
|
||||
"SLT4" "Sulfametrole/trimethoprim" "Trimethoprims" "J01EE03" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "trsm" "NA" "NA"
|
||||
"SLF8" 12894 "Sulfamoxole" "Trimethoprims" "J01EC03" "Sulfonamides and trimethoprim" "Intermediate-acting sulfonamides" "NA" "enterocura,justamil,oxasulfa,solfaguanolo,solfamossolo,sulfadimethyloxazole,sulfaguanol,sulfaguanole,sulfaguanolum,sulfamoxol,sulfamoxolum,sulfano,sulfavigor,sulfmidil,sulfono,sulfune,sulfuno,sulphamoxole,tardamid,tardamide" 1 "g" 1 "g" "NA"
|
||||
"SLT5" "Sulfamoxole/trimethoprim" "Trimethoprims" "J01EE04" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "NA" "NA" "NA"
|
||||
"SLF9" 5333 "Sulfanilamide" "Trimethoprims" "D06BA05,J01EB06,QD06BA05,QJ01EQ06" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "NA" "albexan,albosal,ambeside,antistrept,astreptine,astrocid,bacteramid,bactesid,collomide,colsulanyde,copticide,deseptyl,dipron,ergaseptine,erysipan,estreptocida,exoseptoplix,fourneau,gerison,gombardol,hydroxysulfonamide,infepan,lusil,lysococcine,neococcyl,orgaseptine,prontalbin,prontylin,proseptal,proseptine,proseptol,pysococcine,sanamid,septanilam,septinal,septolix,septoplex,septoplix,solfanilamide,stramid,strepamide,strepsan,streptagol,streptamid,streptamin,streptasol,streptocid,streptocide,streptocidum,streptoclase,streptocom,strepton,streptopan,streptosil,streptozol,streptozone,streptrocide,sulfamidyl,sulfamine,sulfana,sulfanalone,sulfanidyl,sulfanil,sulfanilamida,sulfanilamidomethan,sulfanilamidum,sulfanimide,sulfocidin,sulfocidine,sulfonylamide,sulphanilamide,sulphanilamidum,sulphonamide,therapol,tolder" "NA"
|
||||
"SLF10" 68933 "Sulfaperin" "Trimethoprims" "J01ED06" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "anastaf,archisulfa,archisulpha,avissul,chemiopen,demosulfan,demosulphan,durisan,isosulfamerazine,isosulphamerazine,methylsulfadiazin,methylsulfadiazine,methylsulphadiazine,novosul,orosulfan,pallidin,retardon,risulfasens,sulfaperina,sulfaperine,sulfaperinum,sulfatreis,sulfopirimidine,sulpenta,sulphaperin,sulphaperina,sulphaperinum" 0.5 "g" "NA"
|
||||
"SLF11" 5335 "Sulfaphenazole" "Trimethoprims" "J01ED08,QJ01EQ08" "Sulfonamides and trimethoprim" "Long-acting sulfonamides" "NA" "depocid,depotsulfonamide,eftolon,firmazolo,inamil,isarol,merian,orisul,orisulf,paidazolo,phenylsulfapyrazole,plisulfan,raziosulfa,solfafenazolo,sulfabid,sulfafenazol,sulfafenazolo,sulfaphenazol,sulfaphenazolum,sulfaphenazon,sulfaphenylpipazol,sulfaphenylpyrazol,sulfaphenylpyrazole,sulfonylpyrazol,sulphaphenazole,sulphenazole" 1 "g" "NA"
|
||||
"SLF12" 5336 "Sulfapyridine" "Trimethoprims" "J01EB04,QJ01EQ04" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "NA" "adiplon,coccoclase,dagenan,eubasin,eubasinum,haptocil,piridazol,plurazol,pyriamid,pyridazol,relbapiridina,ronin,septipulmon,solfapiridina,soludagenan,streptosilpyridine,sulfapiridina,sulfapyridin,sulfapyridinum,sulfidin,sulfidine,sulphapyridin,sulphapyridine,thioseptal,trianon" 1 "g" "14075-6,55580-5"
|
||||
"SNA" 60582 "Sulfasuccinamide" "Other antibacterials" "NA" "NA" "sulfasuccinamid,sulfasuccinamida,sulfasuccinamidum" "NA"
|
||||
"SUT" 5340 "Sulfathiazole" "Trimethoprims" "D06BA02,J01EB07,QD06BA02,QJ01EQ07" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "sulthi" "azoquimiol,azoseptale,cerazol,cerazole,chemosept,cibazol,duatok,dulana,eleudron,enterobiocine,estafilol,formosulfathiazole,neostrepsan,norsulfasol,norsulfazol,norsulfazole,norsulfazolum,planomide,poliseptil,sanotiazol,septozol,solfatiazolo,soluthiazomide,streptosilthiazole,sulfamul,sulfaplex,sulfathiazol,sulfathiazolesalt,sulfathiazolum,sulfatiazol,sulfavitina,sulfocerol,sulphathiazole,sulzol,thiacoccine,thiasulfol,thiazamide,thiozamide,wintrazole" "87591-4,87796-9,87797-7"
|
||||
"SLF13" 3000579 "Sulfathiourea" "Trimethoprims" "J01EB08" "Sulfonamides and trimethoprim" "Short-acting sulfonamides" "NA" "badional,baldinol,fontamide,salvoseptyl,solfatiourea,solufontamide,sulfanilthiourea,sulfathiocarbamid,sulfathiocarbamide,sulfathiocarbamidum,sulfathioureasalt,sulfathiouree,sulfatiourea,sulphathiourea" 6 "g" "NA"
|
||||
"SOX" 5344 "Sulfisoxazole" "Other antibacterials" "NA" "sulfiz" "NA" "11578-2,18986-0,25226-2,471-3,472-1,473-9,474-7,9701-4"
|
||||
"SSS" 86225 "Sulfonamide" "Other antibacterials" "NA" "sfna,sulami" "NA" "17674-3,17675-0,18987-8,35842-4,4040-2,4041-0,4042-8,475-4,476-2,477-0,478-8,75650-2"
|
||||
"SLP" 9950244 "Sulopenem" "Other antibacterials" "NA" "sulope" "orlynvah" "55289-3,55290-1,55291-9"
|
||||
"SLT6" 444022 "Sultamicillin" "Beta-lactams/penicillins" "J01CR04,QJ01CR04" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "sultos" "combisid,sultamicilina,sultamicilline,sultamicillinum,unacid" 1.5 "g" "NA"
|
||||
"SUR" 46700778 "Surotomycin" "Other antibacterials" "NA" "NA" "surotomicina,surotomycine" "NA"
|
||||
"TAL" 71447 "Talampicillin" "Beta-lactams/penicillins" "J01CA15,QJ01CA15" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "NA" "aseocillin,phthalidyl,talampicilina,talampicilline,talampicillinum,talpen,yamacillin" 2 "g" "18988-6,479-6,480-4,481-2,482-0"
|
||||
"TLP" 163307 "Talmetoprim" "Other antibacterials" "NA" "NA" "NA" "NA"
|
||||
"TAZ" 123630 "Tazobactam" "Beta-lactams/penicillins" "J01CG02,QJ01CG02" "Beta-lactam antibacterials, penicillins" "Beta-lactamase inhibitors" "tazo,tazoba" "exblifep,tazobactamsalt,tazobactamum,tazobactum" "41719-6,41720-4,41721-2,41740-2"
|
||||
"TBP" 9800194 "Tebipenem" "Carbapenems" "NA" "NA" "NA" "NA"
|
||||
"TZD" 11234049 "Tedizolid" "Oxazolidinones" "J01XX11,QJ01XX11" "Other antibacterials" "Other antibacterials" "tedi" "torezolid" 0.2 "g" 0.2 "g" "73586-0,73608-2,73631-4"
|
||||
"TEC" 16131923 "Teicoplanin" "Glycopeptides,Peptides" "J01XA02,QJ01XA02" "Other antibacterials" "Glycopeptide antibacterials" "tec,tei,teic,teicop,tp,tpl,tpn" "NA" 0.4 "g" "18989-4,25534-9,25535-6,34378-0,34379-8,4043-6,483-8,484-6,485-3,486-1,7051-6,80968-1"
|
||||
"TCM" "Teicoplanin-macromethod" "Glycopeptides,Peptides" "NA" "NA" "NA" "NA"
|
||||
"TLV" 3081362 "Telavancin" "Lipoglycopeptides,Glycopeptides,Peptides" "J01XA03,QJ01XA03" "Other antibacterials" "Glycopeptide antibacterials" "tela,telava" "arbelic,nvancomycin,televancin" "72894-9,73630-6,85051-1,88886-7"
|
||||
"TLT" 3002190 "Telithromycin" "Macrolides" "J01FA15,QJ01FA15" "Macrolides, lincosamides and streptogramins" "Macrolides" "teli,telith" "ketek,levviax" 0.8 "g" "35843-2,35844-0,35845-7,41722-0"
|
||||
"TMX" 60021 "Temafloxacin" "Fluoroquinolones,Quinolones" "J01MA05,QJ01MA05" "Quinolone antibacterials" "Fluoroquinolones" "tema,temafl" "omniflox,temafloxacina,temafloxacine,temafloxacino,temafloxacinum" 0.8 "g" "18990-2,487-9,488-7,489-5,490-3"
|
||||
"TEM" 171758 "Temocillin" "Penicillins,Beta-lactams" "J01CA17,QJ01CA17" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "temo,temoci" "negaban,temocilina,temocillina,temocilline,temocillinum" 4 "g" "18991-0,491-1,492-9,493-7,494-5,54190-4"
|
||||
"TRB" 1549008 "Terbinafine" "Antifungals" "D01AE15,D01BA02,QD01AE15,QD01BA02" "Antifungals for systemic use" "Antifungals for systemic use" "terb" "afogan,bramazil,bramizil,corbinal,lamasil,lamisil,muzonal,shoprite,terbina,terbinafina,terbinafinum,terbine,terbinex,terbisil,zabel" 0.25 "g" "10720-1,10721-9,18992-8"
|
||||
"TRC" 441383 "Terconazole" "Antifungals" "G01AG02,QG01AG02" "NA" "fungistat,panlomyc,terazol,terconazol,terconazolum,tercospor,tetrazol,triaconazole,zazole" "55196-0"
|
||||
"TEC" 16131923 "Teicoplanin" "Glycopeptides" "J01XA02,QJ01XA02" "Other antibacterials" "Glycopeptide antibacterials" "tec,tei,teic,teicop,tp,tpl,tpn" "NA" 0.4 "g" "18989-4,25534-9,25535-6,34378-0,34379-8,4043-6,483-8,484-6,485-3,486-1,7051-6,80968-1"
|
||||
"TCM" "Teicoplanin-macromethod" "Glycopeptides" "NA" "NA" "NA" "NA"
|
||||
"TLV" 3081362 "Telavancin" "Glycopeptides" "J01XA03,QJ01XA03" "Other antibacterials" "Glycopeptide antibacterials" "tela,telava" "arbelic,nvancomycin,televancin" "72894-9,73630-6,85051-1,88886-7"
|
||||
"TLT" 3002190 "Telithromycin" "Macrolides/lincosamides" "J01FA15,QJ01FA15" "Macrolides, lincosamides and streptogramins" "Macrolides" "teli,telith" "ketek,levviax" 0.8 "g" "35843-2,35844-0,35845-7,41722-0"
|
||||
"TMX" 60021 "Temafloxacin" "Fluoroquinolones" "J01MA05,QJ01MA05" "Quinolone antibacterials" "Fluoroquinolones" "tema,temafl" "omniflox,temafloxacina,temafloxacine,temafloxacino,temafloxacinum" 0.8 "g" "18990-2,487-9,488-7,489-5,490-3"
|
||||
"TEM" 171758 "Temocillin" "Beta-lactams/penicillins" "J01CA17,QJ01CA17" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "temo,temoci" "negaban,temocilina,temocillina,temocilline,temocillinum" 4 "g" "18991-0,491-1,492-9,493-7,494-5,54190-4"
|
||||
"TRB" 1549008 "Terbinafine" "Antifungals/antimycotics" "D01AE15,D01BA02,QD01AE15,QD01BA02" "Antifungals for systemic use" "Antifungals for systemic use" "terb" "afogan,bramazil,bramizil,corbinal,lamasil,lamisil,muzonal,shoprite,terbina,terbinafina,terbinafinum,terbine,terbinex,terbisil,zabel" 0.25 "g" "10720-1,10721-9,18992-8"
|
||||
"TRC" 441383 "Terconazole" "Antifungals/antimycotics" "G01AG02,QG01AG02" "NA" "fungistat,panlomyc,terazol,terconazol,terconazolum,tercospor,tetrazol,triaconazole,zazole" "55196-0"
|
||||
"TRZ" 65720 "Terizidone" "Antimycobacterials" "J04AK03,QJ04AK03" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "NA" "terivalidin,terizidona,terizidonum" "NA"
|
||||
"TCY" 54675776 "Tetracycline" "Tetracyclines" "A01AB13,D06AA04,J01AA07,QA01AB13,QD06AA04,QG01AA90,QG51AA02,QJ01AA07,QJ51AA07,QS01AA09,QS02AA08,QS03AA02,S01AA09,S02AA08,S03AA02" "Tetracyclines" "Tetracyclines" "tc,te,tet,tetcyc,tetr,tetra" "abramycin,abricycline,agromicina,ambramicina,ambramycin,biocycline,brodspec,cefracycline,centet,ciclibion,copharlan,criseociclina,democracin,deschlorobiomycin,economycin,hostacyclin,lexacycline,limecycline,liquamycin,mericycline,micycline,neocycline,omegamycin,orlycycline,panmycin,purocyclina,roviciclina,solvocin,tetrabon,tetraciclina,tetracyclinehydrate,tetracyclinum,tetracyn,tetradecin,tetrafil,tetraverine,tetrazyklin,tsiklomistsin,tsiklomitsin,veracin,vetacyclinum" 1 "g" 1 "g" "101504-9,18993-6,25272-6,4045-1,495-2,496-0,497-8,498-6,7052-4,87590-6"
|
||||
"TCY-S" "Tetracycline screening test" "Tetracyclines" "NA" "tcy screen" "NA" "NA"
|
||||
"TOL" 54691494 "Tetracycline/oleandomycin" "Tetracyclines" "J01RA08,QJ01RA08" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"TET" 65450 "Tetroxoprim" "Other" "NA" "NA" "primsol,tetroxoprima,tetroxoprime,tetroxoprimum,trimpex,trimplex" "NA"
|
||||
"TOL" 54691494 "Tetracycline/oleandomycin" "Other antibacterials" "J01RA08,QJ01RA08" "Combinations of antibacterials" "Combinations of antibacterials" "NA" "NA" "NA"
|
||||
"TET" 65450 "Tetroxoprim" "Other antibacterials" "NA" "NA" "primsol,tetroxoprima,tetroxoprime,tetroxoprimum,trimpex,trimplex" "NA"
|
||||
"THA" 9568512 "Thiacetazone" "Oxazolidinones" "NA" "NA" "acetanilide,aktivan,ambathizon,amitiozon,antib,benthiozone,benzothiozane,benzothiozon,berkazon,citazone,conteben,diasan,domakol,ilbion,livazone,mivizon,myvizone,neotibil,neustab,novakol,panrone,parazone,seroden,siocarbazone,tebalon,tebecure,tebemar,tebethion,tebethione,tebezon,thiacetone,thiacetozone,thibon,thibone,thioacetazon,thioacetazonum,thioazetazone,thiocarbazil,thiomicid,thionicid,thioparamizon,thioparamizone,thiosemicarbarzone,thiosemicarbazone,thiotebesin,thiotebezin,thiotebicina,thizone,tiacetazon,tibicur,tibion,tibione,tibizan,tibon,tibone,tioacetazon,tioacetazona,tioatsetazon,tiobicina,tiocarone,tiosecolo,tubercazon,tubigal,tubin" "32384-0,54184-7,54204-3"
|
||||
"THI" 27200 "Thiamphenicol" "Phenicols" "J01BA02,QJ01BA02,QJ51BA02" "Amphenicols" "Amphenicols" "thiaph" "armai,dextrosulfenidol,dextrosulphenidol,igralin,racefenicol,racefenicolo,racefenicolum,raceophenidol,thiamphenicolum,thiocymetin,thiophenicol,tiamfenicol,tiamfenicolo,urfamycine" 1.5 "g" 1.5 "g" "41723-8,41724-6,41725-3,54169-8"
|
||||
"TAT" "Thioacetazone" "Antimycobacterials" "J04AK07,QJ04AK07" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"TAT" 9568512 "Thioacetazone" "Antimycobacterials" "J04AK07,QJ04AK07" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"THI1" "Thioacetazone/isoniazid" "Antimycobacterials" "J04AM04,QJ04AM04" "Drugs for treatment of tuberculosis" "Combinations of drugs for treatment of tuberculosis" "NA" "NA" "NA"
|
||||
"THS" 16129666 "Thiostrepton" "Peptides" "NA" "NA" "alaninamide,bryamycin,gargon,pharmakon,prestwick,sporangiomycin,thiactin,tiostrepton" "NA"
|
||||
"TIA" 656958 "Tiamulin" "Pleuromutilins" "QJ01XQ01" "tiamul" "denagard,thiamutilin,tiamulina,tiamuline,tiamulinum" "35846-5,35847-3,35848-1,87589-8"
|
||||
"TIC" 36921 "Ticarcillin" "Penicillins,Beta-lactams" "J01CA13,QJ01CA13" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "tc,ti,tic,tica,ticarc" "ticar,ticarcilina,ticarcilline,ticarcillinum,timentin" 15 "g" "18994-4,18995-1,25254-4,4054-3,4055-0,499-4,500-9,501-7,502-5,503-3,504-1,505-8,506-6,55716-5,55717-3,55718-1,55719-9,7053-2,7054-0"
|
||||
"TCC" 6437075 "Ticarcillin/clavulanic acid" "Penicillins,Beta-lactams,Beta-lactamase inhibitors" "J01CR03,QJ01CR03" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "t/c,tcc,ticcla,ticl,tim,tlc" "augpenin" 15 "g" "NA"
|
||||
"TIA" 656958 "Tiamulin" "Other antibacterials" "QJ01XQ01" "tiamul" "denagard,thiamutilin,tiamulina,tiamuline,tiamulinum" "35846-5,35847-3,35848-1,87589-8"
|
||||
"TIC" 36921 "Ticarcillin" "Beta-lactams/penicillins" "J01CA13,QJ01CA13" "Beta-lactam antibacterials, penicillins" "Penicillins with extended spectrum" "tc,ti,tic,tica,ticarc" "ticar,ticarcilina,ticarcilline,ticarcillinum,timentin" 15 "g" "18994-4,18995-1,25254-4,4054-3,4055-0,499-4,500-9,501-7,502-5,503-3,504-1,505-8,506-6,55716-5,55717-3,55718-1,55719-9,7053-2,7054-0"
|
||||
"TCC" 6437075 "Ticarcillin/clavulanic acid" "Beta-lactams/penicillins" "J01CR03,QJ01CR03" "Beta-lactam antibacterials, penicillins" "Combinations of penicillins, incl. beta-lactamase inhibitors" "t/c,tcc,ticcla,ticl,tim,tlc" "augpenin" 15 "g" "NA"
|
||||
"TGC" 54686904 "Tigecycline" "Tetracyclines" "J01AA12,QJ01AA12" "Tetracyclines" "Tetracyclines" "tgc,tig,tige,tigecy" "tigeciclina,tigecyclin,tigecyclinehydrate,tigilcycline,tygacil" 0.1 "g" "101499-2,42354-1,42355-8,42356-6,42357-4,55158-0"
|
||||
"TMN" "Tigemonam" "Monobactams,Beta-lactams" "NA" "NA" "NA" "NA"
|
||||
"TBQ" 65592 "Tilbroquinol" "Fluoroquinolones,Quinolones" "P01AA05" "NA" "tilbroquinolum" "NA"
|
||||
"TIP" 24860548 "Tildipirosin" "Macrolides" "QJ01FA96" "NA" "zuprevo" "100060-3,88375-1,88377-7"
|
||||
"TIL" 5282521 "Tilmicosin" "Macrolides" "QJ01FA91" "tilmic" "micotil,pulmotil,tilmicosina,tilmicosine,tilmicosinum,tilmovet" "35849-9,35850-7,35851-5,87588-0"
|
||||
"TIN" 5479 "Tinidazole" "Other" "G01AF21,J01XD02,P01AB02,QG01AF21,QJ01XD02,QP51AA02" "Other antibacterials" "Imidazole derivatives" "tini" "amtiba,bioshik,fasigin,fasigyn,glongyn,haisigyn,isotinidazole,pletil,protozol,simplotan,sorquetan,symplotan,tindamax,tindazole,tinidazolum,tricolam,trimonase" 2 "g" 1.5 "g" "54928-7,55720-7,55721-5,55722-3"
|
||||
"TMN" "Tigemonam" "Monobactams" "NA" "NA" "NA" "NA"
|
||||
"TBQ" 65592 "Tilbroquinol" "Fluoroquinolones" "P01AA05" "NA" "tilbroquinolum" "NA"
|
||||
"TIP" 24860548 "Tildipirosin" "Macrolides/lincosamides" "QJ01FA96" "NA" "zuprevo" "100060-3,88375-1,88377-7"
|
||||
"TIL" 5282521 "Tilmicosin" "Macrolides/lincosamides" "QJ01FA91" "tilmic" "micotil,pulmotil,tilmicosina,tilmicosine,tilmicosinum,tilmovet" "35849-9,35850-7,35851-5,87588-0"
|
||||
"TIN" 5479 "Tinidazole" "Other antibacterials" "G01AF21,J01XD02,P01AB02,QG01AF21,QJ01XD02,QP51AA02" "Other antibacterials" "Imidazole derivatives" "tini" "amtiba,bioshik,fasigin,fasigyn,glongyn,haisigyn,isotinidazole,pletil,protozol,simplotan,sorquetan,symplotan,tindamax,tindazole,tinidazolum,tricolam,trimonase" 2 "g" 1.5 "g" "54928-7,55720-7,55721-5,55722-3"
|
||||
"TCR" 3001386 "Tiocarlide" "Antimycobacterials" "J04AD02,QJ04AD02" "Drugs for treatment of tuberculosis" "Thiocarbamide derivatives" "NA" "aethoksid,aethoxydum,amixyl,datanil,disocarban,disoxyl,ethoxide,etocarlid,etocarlida,etocarlide,etocarlidum,etoksid,thiocarlide,tiocarlid,tiocarlida,tiocarlidum" 7 "g" "NA"
|
||||
"TDC" 10247721 "Tiodonium chloride" "Other" "NA" "NA" "tiodonium" "NA"
|
||||
"TXC" 65788 "Tioxacin" "Fluoroquinolones,Quinolones" "NA" "NA" "tioxacine,tioxacino,tioxacinum" "NA"
|
||||
"TIZ" 394397 "Tizoxanide" "Other" "NA" "NA" "NA" "73585-2,73607-4,73629-8"
|
||||
"TDC" 10247721 "Tiodonium chloride" "Other antibacterials" "NA" "NA" "tiodonium" "NA"
|
||||
"TXC" 65788 "Tioxacin" "Fluoroquinolones" "NA" "NA" "tioxacine,tioxacino,tioxacinum" "NA"
|
||||
"TIZ" 394397 "Tizoxanide" "Other antibacterials" "NA" "NA" "NA" "73585-2,73607-4,73629-8"
|
||||
"TOB" 36294 "Tobramycin" "Aminoglycosides" "J01GB01,QJ01GB01,QS01AA12,S01AA12" "Aminoglycoside antibacterials" "Other aminoglycosides" "nn,tm,to,tob,tobr,tobram" "aktob,bethkis,distobram,gotabiotic,kitabis,nebcin,nebicin,nebramycin,tenebrimycin,tenemycin,tobacin,tobracin,tobradex,tobradistin,tobralex,tobramaxin,tobramicin,tobramicina,tobramitsetin,tobramycetin,tobramycine,tobramycinum,tobrased,tobrex" 0.24 "g" "101496-8,13584-8,17808-7,18996-9,22750-4,22751-2,22752-0,25227-0,25800-4,31094-6,31095-3,31096-1,35239-3,35670-9,4057-6,4058-4,4059-2,507-4,508-2,509-0,50927-3,510-8,52962-8,59380-6,7055-7,80966-5"
|
||||
"TOH" "Tobramycin-high" "Aminoglycosides" "NA" "tobra high,tobramycin high,tohl" "NA" "NA"
|
||||
"TFX" 5517 "Tosufloxacin" "Fluoroquinolones,Quinolones" "J01MA22,QJ01MA22,QS01AE09,S01AE09" "tosufl" "NA" 0.45 "g" "100061-1,76146-0"
|
||||
"TFX" 5517 "Tosufloxacin" "Fluoroquinolones" "J01MA22,QJ01MA22,QS01AE09,S01AE09" "tosufl" "NA" 0.45 "g" "100061-1,76146-0"
|
||||
"TMP" 5578 "Trimethoprim" "Trimethoprims" "J01EA01,QJ01EA01,QJ51EA01" "Sulfonamides and trimethoprim" "Trimethoprim and derivatives" "t,tmp,tr,tri,trim,w" "abaprim,anitrim,antrima,antrimox,bacdan,bacidal,bacide,bacin,bacterial,bacticel,bactifor,bactoprim,bactramin,bencole,bethaprim,biosulten,briscotrim,chemotrin,colizole,conprim,cotrimel,deprim,dosulfin,duocide,esbesul,espectrin,euctrim,exbesul,fermagex,fortrim,futin,ikaprim,infectotrimet,instalac,kombinax,lagatrim,lastrim,lescot,monoprim,monotrim,monotrimin,novotrimel,omstat,pancidim,proloprim,protrin,purbal,resprim,roubac,roubal,salvatrim,setprin,sinotrim,stopan,streptoplus,sugaprim,sulfamar,sulfoxaprim,sulthrim,sultrex,syraprim,tiempe,trimethioprim,trimethoprime,trimethoprimum,trimethopriom,trimetoprim,trimetoprima,trimexol,trimezol,trimogal,trimono,trimopan,triprim,trisul,trisulcom,trisulfam,trisural,uretrim,urobactrim,utetrin,velaten,wellcoprim,wellcoprin,xeroprim,zamboprim" 0.4 "g" 0.4 "g" "101495-0,11005-6,17747-7,18997-7,18998-5,20387-7,23614-1,23631-5,25273-4,32342-8,4079-0,4080-8,4081-6,511-6,512-4,513-2,514-0,515-7,516-5,517-3,518-1,55584-7,7056-5,7057-3,80552-3,80973-1"
|
||||
"SXT" 358641 "Trimethoprim/sulfamethoxazole" "Trimethoprims,Sulfonamides" "J01EE01" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "cot,cotrim,sxt,t/s,tms,trisul,trsu,trsx,ts" "abacin,abactrim,agoprim,alfatrim,aposulfatrim,bacteral,bactilen,bactiver,bacton,bactoreduct,bactrim,bactrizol,bactromin,bactropin,baktar,benzenesulfonamide,berlocid,bibacrim,biseptol,centran,centrin,chemitrim,chemotrim,ciplin,comox,cotribene,cotrim,cotrimhexal,cotrimoxazol,cotrimoxazole,cotrimstada,cotriver,dibaprim,drylin,duratrimet,eltrianyl,escoprim,eslectin,esteprim,eusaprim,fectrim,gamazole,gantanol,gantaprim,gantaprin,gantrim,groprim,helveprim,imexim,insozalin,jenamoxazol,kemoprim,kepinol,laratrim,linaris,maxtrim,metoxal,microtrim,mikrosid,momentol,nopil,oecotrim,omsat,oriprim,oxaprim,pantoprim,potrox,primazole,radonil,septra,septrim,servitrim,sigaprim,sigaprin,sulfatrim,sulfotrim,sulfotrimin,sulmeprim,sulprim,sumetrolim,supracombin,suprim,tacumil,teleprim,teleprin,thiocuran,tribakin,trifen,trigonyl,trimedin,trimesulf,trimethoprimsulfa,trimetoger,trimexazol,trimezole,trimforte,trimosulfa,uroplus" "101495-0,18998-5,20387-7,23631-5,25273-4,32342-8,4081-6,515-7,516-5,517-3,518-1,7057-3"
|
||||
"TRL" 202225 "Troleandomycin" "Macrolides" "J01FA08,QJ01FA08" "Macrolides, lincosamides and streptogramins" "Macrolides" "NA" "aovine,cyclamycin,evramicina,matromicina,oleandocetin,oleandocetine,tekmisin,treolmicina,tribiocillina,triocetin,triolan,troleandomicina,troleandomycine,troleandomycinum,viamicina,wytrion" 1 "g" "18999-3,519-9,520-7,521-5,522-3"
|
||||
"TRO" 55886 "Trospectomycin" "Other" "NA" "trospe" "trospectinomycin,trospectomicina,trospectomycine,trospectomycinum" "NA"
|
||||
"TVA" 62959 "Trovafloxacin" "Fluoroquinolones,Quinolones" "J01MA13,QJ01MA13" "Quinolone antibacterials" "Fluoroquinolones" "trov,trovaf" "trovan,turvel" 0.2 "g" 0.2 "g" "23642-2,23643-0,35855-6,7058-1"
|
||||
"TUL" 9832301 "Tulathromycin" "Macrolides" "QJ01FA94" "tulath" "arovyn,draxxin,increxxa,macrosyn,tulieve,tulissin" "76149-4,87798-5"
|
||||
"TYL" 5280440 "Tylosin" "Macrolides" "QJ01FA90,QJ51FA90" "tylo" "fradizine,tilosina,tylan,tylocine,tylosine,tylosinum,vubityl" "35856-4,35857-2,35858-0,87587-2"
|
||||
"TYL1" 6441094 "Tylvalosin" "Macrolides" "QJ01FA92" "tvn" "aivlosin" "101526-2,87586-4"
|
||||
"PRU1" 124225 "Ulifloxacin (Prulifloxacin)" "Other" "NA" "NA" "NA" "NA"
|
||||
"VAN" 14969 "Vancomycin" "Glycopeptides,Peptides" "A07AA09,J01XA01,QA07AA09,QJ01XA01,QS01AA28,S01AA28" "Other antibacterials" "Glycopeptide antibacterials" "va,van,vanc,vancom" "vancocin,vancoled,vancomicina,vancomycine,vancomycinum" 2 "g" 2 "g" "13586-3,13587-1,19000-9,20578-1,23615-8,25228-8,31012-8,39092-2,39796-8,39797-6,4089-9,4090-7,4091-5,4092-3,50938-0,523-1,524-9,525-6,526-4,59381-4,7059-9,92241-9,97657-1"
|
||||
"VAM" "Vancomycin-macromethod" "Glycopeptides,Peptides" "NA" "NA" "NA" "NA"
|
||||
"SXT" 358641 "Trimethoprim/sulfamethoxazole" "Trimethoprims" "J01EE01" "Sulfonamides and trimethoprim" "Combinations of sulfonamides and trimethoprim, incl. derivatives" "cot,cotrim,sxt,t/s,tms,trisul,trsu,trsx,ts" "abacin,abactrim,agoprim,alfatrim,aposulfatrim,bacteral,bactilen,bactiver,bacton,bactoreduct,bactrim,bactrizol,bactromin,bactropin,baktar,benzenesulfonamide,berlocid,bibacrim,biseptol,centran,centrin,chemitrim,chemotrim,ciplin,comox,cotribene,cotrim,cotrimhexal,cotrimoxazol,cotrimoxazole,cotrimstada,cotriver,dibaprim,drylin,duratrimet,eltrianyl,escoprim,eslectin,esteprim,eusaprim,fectrim,gamazole,gantanol,gantaprim,gantaprin,gantrim,groprim,helveprim,imexim,insozalin,jenamoxazol,kemoprim,kepinol,laratrim,linaris,maxtrim,metoxal,microtrim,mikrosid,momentol,nopil,oecotrim,omsat,oriprim,oxaprim,pantoprim,potrox,primazole,radonil,septra,septrim,servitrim,sigaprim,sigaprin,sulfatrim,sulfotrim,sulfotrimin,sulmeprim,sulprim,sumetrolim,supracombin,suprim,tacumil,teleprim,teleprin,thiocuran,tribakin,trifen,trigonyl,trimedin,trimesulf,trimethoprimsulfa,trimetoger,trimexazol,trimezole,trimforte,trimosulfa,uroplus" "101495-0,18998-5,20387-7,23631-5,25273-4,32342-8,4081-6,515-7,516-5,517-3,518-1,7057-3"
|
||||
"TRL" 202225 "Troleandomycin" "Macrolides/lincosamides" "J01FA08,QJ01FA08" "Macrolides, lincosamides and streptogramins" "Macrolides" "NA" "aovine,cyclamycin,evramicina,matromicina,oleandocetin,oleandocetine,tekmisin,treolmicina,tribiocillina,triocetin,triolan,troleandomicina,troleandomycine,troleandomycinum,viamicina,wytrion" 1 "g" "18999-3,519-9,520-7,521-5,522-3"
|
||||
"TRO" 55886 "Trospectomycin" "Other antibacterials" "NA" "trospe" "trospectinomycin,trospectomicina,trospectomycine,trospectomycinum" "NA"
|
||||
"TVA" 62959 "Trovafloxacin" "Fluoroquinolones" "J01MA13,QJ01MA13" "Quinolone antibacterials" "Fluoroquinolones" "trov,trovaf" "trovan,turvel" 0.2 "g" 0.2 "g" "23642-2,23643-0,35855-6,7058-1"
|
||||
"TUL" 9832301 "Tulathromycin" "Macrolides/lincosamides" "QJ01FA94" "tulath" "arovyn,draxxin,increxxa,macrosyn,tulieve,tulissin" "76149-4,87798-5"
|
||||
"TYL" 5280440 "Tylosin" "Macrolides/lincosamides" "QJ01FA90,QJ51FA90" "tylo" "fradizine,tilosina,tylan,tylocine,tylosine,tylosinum,vubityl" "35856-4,35857-2,35858-0,87587-2"
|
||||
"TYL1" 6441094 "Tylvalosin" "Macrolides/lincosamides" "QJ01FA92" "tvn" "aivlosin" "101526-2,87586-4"
|
||||
"PRU1" 124225 "Ulifloxacin (Prulifloxacin)" "Other antibacterials" "NA" "NA" "NA" "NA"
|
||||
"VAN" 14969 "Vancomycin" "Glycopeptides" "A07AA09,J01XA01,QA07AA09,QJ01XA01,QS01AA28,S01AA28" "Other antibacterials" "Glycopeptide antibacterials" "va,van,vanc,vancom" "vancocin,vancoled,vancomicina,vancomycine,vancomycinum" 2 "g" 2 "g" "13586-3,13587-1,19000-9,20578-1,23615-8,25228-8,31012-8,39092-2,39796-8,39797-6,4089-9,4090-7,4091-5,4092-3,50938-0,523-1,524-9,525-6,526-4,59381-4,7059-9,92241-9,97657-1"
|
||||
"VAM" "Vancomycin-macromethod" "Glycopeptides" "NA" "NA" "NA" "NA"
|
||||
"VIO" 135398671 "Viomycin" "Antimycobacterials" "NA" "NA" "florimycin,floromycin,vioactane,viocin,viomicin,viomicina,viomycine,viomycinum" "19001-7,23616-6,527-2,528-0,529-8,530-6"
|
||||
"VIR" "Virginiamycine" "Streptogramins" "NA" "NA" "NA" "NA"
|
||||
"VOR" 71616 "Voriconazole" "Antifungals" "J02AC03,QJ02AC03" "Antimycotics for systemic use" "Triazole derivatives" "vori,vorico,vrc" "vfend,voriconazol,voriconazolum,voriconzole,vorikonazole" 0.4 "g" 0.4 "g" "32379-0,35862-2,35863-0,38370-3,41199-1,41200-7,53902-3,73676-9,80553-1,80651-3"
|
||||
"XER" 140830474 "Xeruborbactam" "Beta-lactamase inhibitors" "NA" "NA" "benzo,borate" "NA"
|
||||
"XBR" 72144 "Xibornol" "Other" "J01XX02,QJ01XX02" "Other antibacterials" "Other antibacterials" "NA" "bactacine,bracen,nanbacine,xibornolo,xibornolum" "NA"
|
||||
"ZID" 77846445 "Zidebactam" "Beta-lactamase inhibitors" "NA" "NA" "zidebactamsalt" "NA"
|
||||
"ZFD" 76685216 "Zoliflodacin" "Spiropyrimidinetriones" "NA" "zol" "nuzolvence,spiro,zoliflodacina,zoliflodacine" "NA"
|
||||
"ZOR" 70697970 "Zorbamycin" "Glycopeptides,Peptides" "NA" "NA" "bleomycetin,boanmycin,nbleomycinamide,pingyangmycin" "NA"
|
||||
"VIR" 11979535 "Virginiamycine" "Other antibacterials" "NA" "NA" "NA" "NA"
|
||||
"VOR" 71616 "Voriconazole" "Antifungals/antimycotics" "J02AC03,QJ02AC03" "Antimycotics for systemic use" "Triazole derivatives" "vori,vorico,vrc" "vfend,voriconazol,voriconazolum,voriconzole,vorikonazole" 0.4 "g" 0.4 "g" "32379-0,35862-2,35863-0,38370-3,41199-1,41200-7,53902-3,73676-9,80553-1,80651-3"
|
||||
"XBR" 72144 "Xibornol" "Other antibacterials" "J01XX02,QJ01XX02" "Other antibacterials" "Other antibacterials" "NA" "bactacine,bracen,nanbacine,xibornolo,xibornolum" "NA"
|
||||
"ZID" 77846445 "Zidebactam" "Other antibacterials" "NA" "NA" "zidebactamsalt" "NA"
|
||||
"ZFD" "Zoliflodacin" "NA" "NA" "NA" "NA"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user