77 Commits
Author SHA1 Message Date
Claude 8fb640256a Update auto-generated Rd files after documentation rebuild
https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF
2026-04-30 12:39:09 +00:00
Claude 8d959f54cb Fix non-ASCII characters in antibiogram.R
Replace en/em dashes and non-breaking spaces with ASCII equivalents
to satisfy R CMD check portability requirement.

https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF
2026-04-30 12:26:32 +00:00
Claude ee6fab9b50 Fix version to 3.0.1.9055 and update CLAUDE.md version formula
Uses origin/${defaultbranch} (with a fetch) instead of the local
branch ref so the commit count is never stale after a merge.

https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF
2026-04-30 10:21:08 +00:00
Claude 623f6230f9 Add parallel computing support to antibiogram() and wisca() (#281)
For WISCA: simulations are distributed across (group, chunk) job pairs
via future.apply::future_lapply(), keeping all workers active even when
the regimen count is smaller than nbrOfWorkers(). Sequential fallback
with progress ticker is preserved when parallel = FALSE or workers = 1.

For grouped antibiograms: each group is processed by a separate worker,
mirroring the row-batch approach in as.sir().

Same gate pattern as as.sir() (PR #280): requires a non-sequential
future::plan() to be active; auto-upgrades to parallel = TRUE when a
parallel plan is detected; throws an informative error otherwise.

https://claude.ai/code/session_01FC43syPbzhGmKgrrVNHjnF
2026-04-30 10:12:36 +00:00
Matthijs BerendsandClaude 23beebc6c3 Migrate parallel computing in as.sir() from parallel:: to future/future.apply (#280)
* Migrate parallel computing in as.sir() from parallel:: to future/future.apply

Replace parallel::mclapply() and parallel::parLapply() with
future.apply::future_lapply(), enabling transparent support for any
future backend (multisession, multicore, mirai_multisession, cluster)
on all platforms including Windows.

When parallel = TRUE the function now: (1) respects an active
future::plan() set by the user without overriding it on exit, or
(2) sets a temporary multisession plan with parallelly::availableCores()
and tears it down on exit. The max_cores argument controls worker count
only when no user plan is active.

future and future.apply are added to Suggests in DESCRIPTION.

https://claude.ai/code/session_01M1Jvf2Miu6JL4TQrEh1wS8

* Require user plan() for parallel=TRUE; fix as_wt_nwt false-positive warnings

- parallel = TRUE now errors with a cli-styled message if no non-sequential
  future::plan() is active; users must call e.g. future::plan(future::multisession)
  before using parallel = TRUE (breaking change)
- Removed auto-setup/teardown of multisession plan inside as.sir(), which was
  slow and caused version-mismatch issues with load_all() workflows
- Added as_wt_nwt to the exclusion list in as_sir_method() to suppress
  false-positive "no longer used" warnings during parallel runs
- Fixed pieces_per_col row-batch calculation to use n_workers (total available
  workers from the active plan) instead of n_cores (workers clipped to n_cols),
  so row-batch mode activates correctly when n_cols < n_workers
- Updated @param parallel and @param max_cores roxygen docs; regenerated man/as.sir.Rd
- Updated sequential-mode hint to instruct users to set plan() first

https://claude.ai/code/session_01M1Jvf2Miu6JL4TQrEh1wS8

* fix parallel

* fix parallel

* unit tests

* unit tedts

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-30 08:57:19 +01:00
dr. M.S. (Matthijs) Berends 3f1b20c304 (v3.0.1.9052) fix NEWS 2026-04-25 16:21:31 +02:00
dr. M.S. (Matthijs) Berends 905dea2cf1 (v3.0.1.9051) fix NEWS 2026-04-25 16:20:34 +02:00
Matthijs BerendsandClaude 8261b91b24 Fix custom reference_data support in as.sir() (#239) (PR #279)
* Fix custom reference_data support in as.sir() (#239)

- custom guideline names now correctly classify values as R: CLSI convention
  (>= breakpoint_R for MIC, <= for disk) applies only when guideline contains
  "CLSI"; all other guidelines including custom ones use the EUCAST convention
  (> breakpoint_R for MIC, < for disk)
- guideline argument is now optional when reference_data is manually set: if
  omitted or if its value does not match any row in the custom data, all rows
  in reference_data are used; if set to a value present in the data, only
  matching rows are filtered — useful for multi-guideline custom tables
- host = NA in custom reference_data now acts as a host-agnostic fallback
  when no host-specific breakpoint row exists for the current animal species
- updated reference_data argument documentation to explain these conventions

https://claude.ai/code/session_01Q8KtFFGG9qrjAgLJBbxG2U

* Refactor R-classification logic using custom_breakpoints_set flag

Introduce custom_breakpoints_set <- !identical(reference_data, AMR::clinical_breakpoints)
at the top of as_sir_method() and replace all identical() calls inside that
function with this variable.

In the case_when_AMR interpretation blocks (MIC and disk), the R-classification
now has three explicit arms:
- !custom_breakpoints_set & EUCAST guideline -> open interval (> / <)
- !custom_breakpoints_set & CLSI guideline  -> closed interval (>= / <=)
- custom_breakpoints_set                    -> open interval (> / <), always,
  regardless of the guideline name in the custom data (e.g. "CLSI_custom"
  must not accidentally trigger CLSI convention)

https://claude.ai/code/session_01Q8KtFFGG9qrjAgLJBbxG2U

* Fix unit tests for custom reference_data (#239)

- Do not override my_bp$mo / my_bp$ab in tests: assigning plain character
  strips the <mo>/<ab> class, which check_reference_data() rejects. Use the
  mo/ab values already present in the source row instead.
- Use NA_character_ instead of NA for my_bp$host so the host column keeps
  its character class.
- Pass breakpoint_type = "animal" explicitly in the host-fallback test since
  the custom reference_data only contains animal-type breakpoints.

https://claude.ai/code/session_01Q8KtFFGG9qrjAgLJBbxG2U

* Add coerce_reference_data_columns() for lenient reference_data validation

check_reference_data() now returns the (possibly coerced) reference_data and
the call site captures the result so downstream code sees the fixed columns.

A new coerce_reference_data_columns() helper is called before the strict class
check inside check_reference_data(). It coerces columns to the expected types:
- mo  -> as.mo() if not already <mo> class
- ab  -> as.ab() if not already <ab> class
- character columns -> as.character() (e.g. host = NA becomes NA_character_)
- numeric columns  -> as.double()
- logical columns  -> as.logical()

This allows users to build a custom reference_data from a plain data.frame
without having to pre-apply as.mo()/as.ab() or worry about NA column types.

Updated the reference_data roxygen argument to document the auto-coercion and
restored the tests to the simpler form that uses plain character assignments,
relying on the new coercion instead of workarounds.

https://claude.ai/code/session_01Q8KtFFGG9qrjAgLJBbxG2U

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-25 14:38:01 +02:00
Matthijs BerendsandClaude 19157ce718 Fix parallel computing in as.sir.data.frame (#276)
* Fix parallel computing in as.sir.data.frame

Six bugs in parallel = TRUE mode:

1. PSOCK workers (Windows / R < 4.0) never had AMR loaded, so every
   exported/AMR function call failed. Added clusterEvalQ(cl, library(AMR))
   with a graceful fallback to sequential when the package cannot be loaded
   (e.g. dev-only load_all() environments).

2. clusterExport'd AMR_env was a frozen serialised copy; as.sir() on the
   worker wrote to AMR:::AMR_env while run_as_sir_column read from the stale
   copy, so the captured log was always wrong. Fixed by resolving AMR_env
   dynamically via get("AMR_env", envir = asNamespace("AMR")) inside the
   worker function, and removing AMR_env from clusterExport.

3. In the fork-based (mclapply) path each worker inherited the parent's full
   sir_interpretation_history. Capturing the whole log then combining across
   workers duplicated every pre-existing entry. Fixed by recording the log
   row count before the as.sir() call and slicing only the new rows
   afterwards.

4. run_as_sir_column used non-exported internals (%pm>%, pm_pull,
   as.sir.default) that are inaccessible on PSOCK workers after library(AMR).
   Replaced pipe chains with direct as.mic(as.character(x[, col, drop=TRUE]))
   and as.disk(...) calls, and changed as.sir.default() to as.sir() which
   dispatches correctly via S3.

5. With info = TRUE, worker forks printed per-column progress messages
   simultaneously, producing garbled interleaved console output. Per-column
   messages are now suppressed inside workers (effective_info = FALSE) while
   the outer "Running in parallel" / "DONE" messages still appear.

6. Malformed Unicode escape \u00a (3 hex digits) in the "DONE" banner was
   parsed by R as U+00AD (soft hyphen) + "ONE"; corrected to  .

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR

* Add parallel computing tests to test-sir.R

Eight targeted tests verify correctness of the parallel as.sir() path:
identical SIR output vs sequential, matching log row counts, no
pre-existing history duplication, reproducibility across runs, results
consistency across max_cores values, single-column fallback, and no
per-column worker messages leaking when info = TRUE. All pass when only
1 core is available (parallel silently falls back to sequential).

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR

* Fix as.sir() data.frame: preserve already-<sir> columns, exclude metadata

Issue #278: two related bugs in the column-detection / type-assignment pipeline.

Bug 1 – already-<sir> columns deleted on re-run
  Line 886 excluded already-sir columns from the type assignment (they
  stayed type "") causing the result loop to do x[,col] <- NULL, deleting
  them.  Fix: drop the !is.sir() guard so all untyped columns fall through
  to type "sir" and are re-processed correctly.

Bug 2 – metadata columns treated as antibiotics
  as.ab("patient") -> OXY, as.ab("ward") -> PRU.  The column detector
  accepted any column whose name matched an antibiotic code, regardless of
  content.  Fix: for name-matched columns that do not already carry an AMR
  class, also verify content looks like AMR data (all_valid_mics, all-
  numeric, or any SIR-like string).  all_valid_disks() is intentionally
  avoided here because it strips letters from strings (as.disk("Pt_1")==1).

Also adds tools/benchmark_parallel.R: a standalone script that times
sequential vs parallel as.sir() across n=20/200/2000/20000 rows and
saves a ggplot2 PNG to tools/benchmark_parallel.png.

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR

* Update benchmark: two-panel script with warm-up and column-count sweep

Previous single-panel benchmark was misleading: the first sequential run
paid one-time cache-warm-up cost (skewing n=20), and only 6 columns were
used so only 6 cores were ever active on a 16-core machine.

New two-panel design:
  Left  – vary rows with 16 fixed AB columns (shows memory-bandwidth
          saturation for large n)
  Right – vary columns with fixed rows (shows the real speedup profile:
          parallel wins when n_cols >> 1)

Also adds a warm-up pass before measurements to eliminate first-call bias.

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR

* Optimise parallel as.sir(): row-batch mode when n_cols < n_cores

Previously parallel dispatch only parallelised by column, so a 6-column
dataset on a 16-core machine used at most 6 cores with the other 10 idle.
For large n this also caused memory-bandwidth saturation (each worker did
a full n-row scan of clinical_breakpoints simultaneously).

New row-batch mode (fork path, R >= 4.0, non-Windows):
  pieces_per_col = ceil(n_cores / n_cols)
  Jobs = n_cols × pieces_per_col  (≈ n_cores jobs total)
  Each job: one column × one row slice

Benefits:
  - All cores stay busy regardless of column count
  - Per-worker memory footprint shrinks by pieces_per_col ×
  - Breakpoints lookup cache pressure reduced per worker

PSOCK path (Windows / R < 4.0) is unchanged: per-job serialisation
overhead makes row batching unprofitable there.

run_as_sir_column() gains an optional `rows` parameter (NULL = all rows,
backward-compatible). Results are reassembled via as.sir(c(as.character(.)))
which is safe for already-clean SIR values.

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR

* Fix info=FALSE ignored when no breakpoints found in as_sir_method

Operator-precedence bug at line 1601:

  if (isTRUE(info) && nrow(df_unique) < 10 || nrow(breakpoints) == 0)

R evaluates && before ||, so this was equivalent to:

  (isTRUE(info) && nrow(df_unique) < 10) || (nrow(breakpoints) == 0)

When nrow(breakpoints) == 0 (e.g. cefoxitin / flucloxacillin / mupirocin
against E. coli in EUCAST) the intro message was always printed regardless
of info. Fix: add parentheses so info gates both conditions:

  isTRUE(info) && (nrow(df_unique) < 10 || nrow(breakpoints) == 0)

Also pass print = isTRUE(info) to progress_ticker so the progress bar
(which prints intro_txt as its title) is suppressed when info = FALSE.

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR

* Fix cli formatting in as.sir() messages

- stop_if for empty ab_cols: wrap as.mic() and as.disk() in
  {.help [{.fun ...}](...)} for clickable links in cli output
- Parallel mode message: use {.field col} formatting for column names
  and quotes = FALSE in vector_and(), consistent with the rest of the
  codebase (avoids double-quoting from both font_bold and quotes="'")

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR

* Use font_bold() inside {.field} for column names in parallel message

Convention: paste0("{.field ", font_bold(col), "}") gives bold green
column names without quotation marks, consistent with the rest of the
codebase (e.g. the 'Cleaning values' message in run_as_sir_column).

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR

* Add collapse = NULL to font_bold() for column name vectors

font_bold() without collapse = NULL joins a vector with "" into a single
string, breaking paste0() element-wise formatting for length > 1 vectors.

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR

* Add tools/ to .Rbuildignore

Keeps the benchmark script out of the built package tarball.

https://claude.ai/code/session_012DXCXbZUC54Zij1z9bFiHR

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-25 00:34:38 +02:00
dr. M.S. (Matthijs) Berends e7780b6d5f (v3.0.1.9048) fix #275 2026-04-22 08:16:44 +02:00
dr. M.S. (Matthijs) Berends e0f8cf0882 (v3.0.1.9047) fix #272 2026-04-21 22:11:40 +02:00
Matthijs Berends 8ff5d4472a Add add_if_missing parameter to control NA handling in interpretive rules (#264) 2026-04-21 21:53:43 +02:00
Matthijs Berends fb8758f36b fix: convert Python lists to R vectors in wrapper generator (#270)
* fix: convert Python lists to R vectors in wrapper to prevent R list coercion errors

Fixes #267. Python lists passed to R functions via rpy2 are received as
R lists, not R character/numeric vectors. This causes is.mic(), is.sir(),
is.disk() etc. to return length > 1 logicals, which break R's && operator.

Added convert_to_r() helper that maps Python list/tuple to the appropriate
typed R vector (StrVector, IntVector, FloatVector) based on element types.
The r_to_python decorator now applies this to all args and kwargs before
calling the R function.

* docs: instruct Claude to install git and gh before computing version
2026-04-05 17:26:21 +02:00
dr. M.S. (Matthijs) Berends 6c24718893 (v3.0.1.9044) fix old R version 2026-04-04 11:51:50 +02:00
dr. M.S. (Matthijs) Berends 225493192c (v3.0.1.9043) fix unit test 2026-04-02 12:24:12 +02:00
dr. M.S. (Matthijs) Berends 26613d774b (v3.0.1.9042) add EUCAST breakpoint table v16 to interpretive_rules() 2026-04-02 11:42:19 +02:00
dr. M.S. (Matthijs) Berends 3a736bc484 (v3.0.1.9041) add breakpoints 2026 2026-03-30 10:01:49 +02:00
dr. M.S. (Matthijs) Berends 9c95aa455c (v3.0.1.9040) fix MIC plotting 2026-03-24 12:44:47 +01:00
dr. M.S. (Matthijs) Berends 2a8a1eda97 (v3.0.1.9039) cli fixes 2026-03-23 10:38:28 +01:00
dr. M.S. (Matthijs) Berends 975a690c10 (v3.0.1.9038) fix format inline 2026-03-22 22:16:59 +01:00
dr. M.S. (Matthijs) Berends 3d1412e8c9 (v3.0.1.9037) improve cli messages 2026-03-22 20:44:37 +01:00
Matthijs BerendsandClaude 4171d5b778 (v3.0.0.9036) Modernise messaging infrastructure to use cli markup (#265)
* Modernise messaging infrastructure with cli support

Rewrites message_(), warning_(), stop_() to use cli::cli_inform(),
cli::cli_warn(), and cli::cli_abort() when the cli package is available,
with a fully functional plain-text fallback for environments without cli.

Key changes:
- New cli_to_plain() helper converts cli inline markup ({.fun}, {.arg},
  {.val}, {.field}, {.cls}, {.pkg}, {.href}, {.url}, etc.) to readable
  plain-text equivalents for the non-cli fallback path
- word_wrap() simplified: drops add_fn, ANSI re-index algorithm, RStudio
  link injection, and operator spacing hack; returns pasted input unchanged
  when cli is available
- stop_() no longer references AMR_env$cli_abort; uses pkg_is_available()
  directly; passes sys.call() objects to cli::cli_abort() call= argument
- Removed add_fn parameter from message_(), warning_(), and word_wrap()
- All call sites across R/ updated: add_fn arguments removed, some paste0-
  based string construction converted to cli glue syntax ({.fun as.mo},
  {.arg col_mo}, {n} results, etc.)
- cli already listed in Suggests; no DESCRIPTION dependency changes needed

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Replace {.fun} with {.help} for all exported functions in messaging

All function names referenced via {.fun …} in cli-style messages are
exported in NAMESPACE, so {.help …} is the appropriate markup — it
renders as a clickable help link rather than plain function styling.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Qualify all {.help} tags with AMR:: and convert backtick ?func references

- Add AMR:: namespace prefix and trailing () to all {.help} cli markup
  so they render as clickable help links (e.g. {.help AMR::as.sir}())
- Convert `?funcname` backtick-quoted help references to {.help AMR::funcname}()
  in aa_helper_functions.R, custom_eucast_rules.R, interpretive_rules.R,
  key_antimicrobials.R, mo.R, plotting.R, resistance_predict.R, and sir.R
- Skipped `?proportion` in sir_calc.R as 'proportion' is not exported

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Require cli >= 3.0.0 for cli_inform/cli_warn/cli_abort availability checks

cli_inform, cli_warn, and cli_abort were introduced in cli 3.0.0.
Add min_version = "3.0.0" (as character) to all four pkg_is_available("cli")
checks so older cli versions fall back to base R messaging.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Implement cli::code_highlight() for R code examples in messages (issue #191)

Add highlight_code() helper that wraps cli::code_highlight() when cli >= 3.0.0
is available, falling back to plain code otherwise. Apply it to all inline
R code examples embedded in message/warning/stop strings across the package.

Also convert remaining backtick-quoted function and argument references in
messaging calls to proper cli markup: {.help AMR::fn}(), {.arg arg},
{.code expr}, and {.pkg pkg} throughout ab.R, ab_from_text.R, av_from_text.R,
amr_selectors.R, count.R, custom_antimicrobials.R, custom_microorganisms.R,
interpretive_rules.R, mo.R, mo_property.R, sir.R, sir_calc.R.

Fixes #191

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Fix {.help} markup to use correct cli link format [{.fun fn}](AMR::fn)

Replace all instances of {.help AMR::fn}() (incorrect format with manual
parentheses outside the link) with {.help [{.fun fn}](AMR::fn)} which is
the correct cli hyperlink syntax: the display text [{.fun fn}] renders the
function name with parentheses automatically, and (AMR::fn) is the link target.

Also update the plain-text fallback handler in aa_helper_functions.R to
extract the display text from the [text](topic) markdown link format,
so that non-cli environments show just the function name (e.g. `fn()`),
not the raw link markup.

Dynamic cases in amr_selectors.R and mo_property.R also updated.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Add {.topic} markup for non-function help page references

Replace {.code ?AMR-options} and backtick-style ?AMR-options / ?AMR-deprecated
references with proper {.topic AMR-options} / {.topic AMR-deprecated} cli markup
in count.R, interpretive_rules.R, proportion.R, and zz_deprecated.R.

Add {.topic} fallback handler to format_message() in aa_helper_functions.R:
plain-text environments render {.topic foo} as ?foo, and the [text](topic)
link form extracts just the display text (same pattern as {.help}).

Also convert remaining backtick function/arg references in proportion.R to
{.help [{.fun ...}](AMR::...)}, {.arg}, and {.code} markup for consistency.

Note: zzz.R intentionally keeps the backtick form since its startup message
goes through packageStartupMessage() which bypasses our cli infrastructure.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Fix {.topic} to use required pkg::topic format with display text

{.topic} in cli requires a package-qualified topic reference to generate
a valid x-r-help:pkg::topic URI. Bare {.topic AMR-options} produced a
malformed x-r-help:AMR-options URI (no package prefix).

Use the [display_text](pkg::topic) form throughout:
  {.topic [AMR-options](AMR::AMR-options)}
  {.topic [AMR-deprecated](AMR::AMR-deprecated)}

The hyphen in the topic name is fine as a URI string even though
AMR::AMR-options is not a valid R symbol expression.

The fallback handler in format_message() already handles the [text](uri)
form by extracting the display text, so plain-text output is unchanged.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Fix regexec() calls: remove perl=TRUE unsupported in older R

regexec() only gained the perl argument in R 4.1.0. The CI matrix
covers oldrel-1 through oldrel-4 (R 3.x/4.0.x), so perl=TRUE caused
an 'unused argument' error on every message_() call in those
environments.

All four affected regexec() calls use POSIX-extended compatible
patterns, so dropping perl=TRUE is safe.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Slim CI matrix for PRs to ubuntu-latest / r-release only

For pull requests, check-recent now runs a single job (ubuntu-latest,
r-release) via a setup job that emits the matrix as JSON. On push and
schedule the full matrix is unchanged (devel + release on all OSes,
oldrel-1 through oldrel-4).

Also removed the pull_request trigger from check-recent-dev-pkgs; the
dev-packages check only needs to run on push/schedule.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Restrict dev-versions and old-tinytest CI to main branch only

Both workflows were triggering on every push to every branch.
Narrowed push trigger to [main] so they only run after merging,
not on every feature/PR branch push.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Update NEWS.md to continuous log + add concise style rules to CLAUDE.md

NEWS.md is now a single continuous log under one heading per dev series,
not a new section per version bump. CLAUDE.md documents: only replace
line 1 (heading), append new entries, keep them extremely concise with
no trailing full stop.

Merged 9035 and 9036 entries into one section; condensed verbose 9036
bullets; added CI workflow change entry.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Replace single-quoted literals in messaging calls with cli markup

Converted bare 'value' strings inside stop_(), warning_(), message_()
to appropriate cli markup:
- {.val}: option values ('drug', 'dose', 'administration', 'SDD', 'logbook')
- {.cls}: class names ('sir', 'mo')
- {.field}: column names ('mo' in mo_source)
- {.code}: object/dataset names ('clinical_breakpoints')

Files changed: ab_from_text.R, av_from_text.R, sir.R, sir_calc.R, mo_source.R

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Apply {.topic}, {.cls}, and {.field} markup in sir.R messaging

- 'clinical_breakpoints' (dataset): {.code} -> {.topic [clinical_breakpoints](AMR::clinical_breakpoints)}
- "is of class" context: extract bad_col/bad_cls/exp_cls vars and use {.cls} + {.field} in glue syntax
- Column references in as.sir() messages: font_bold(col) with surrounding quotes -> {.field {col}}

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Replace glue-style dynamic markup with paste0() construction

{.field {variable}} and {.cls {variable}} patterns rely on glue
evaluation which is not safe in a zero-dependency package. Replace
all four occurrences with paste0("{.field ", var, "}") so the value
is baked into the markup string before reaching message_()/stop_().

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Limit push trigger to main in check-recent workflow

push: branches: '**' caused both the push event (9-worker matrix) and
the pull_request event (1-worker matrix) to fire simultaneously on every
PR commit. Restricting push to [main] means PR pushes only trigger the
pull_request path (1 worker), while direct pushes to main still get the
full 9-worker matrix.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Limit push trigger to main in code-coverage workflow

Same fix as check-recent: push: branches: '**' caused the workflow to
run twice per PR commit (once for push, once for pull_request). Restricting
push to [main] ensures coverage runs only once per PR update.

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Replace bare backticks with cli inline markup across all messaging calls

- {.arg} for argument names in stop_/warning_/message_ calls
- {.cls} after "of class" text in format_class() and elsewhere
- {.fun} for function names (replaces `fn()` pattern)
- {.pkg} for tidyverse package names (dplyr, ggplot2)
- {.code} for code literals (TRUE, FALSE, expressions)
- Rewrite print.ab: use cli named-vector with * bullets and code
  highlighting when cli >= 3.0.0; keep plain-text fallback otherwise
- Fix typo in as.sir(): "of must be" -> "or must be"
- switch sir.R verbose notes from message() to message_()

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* Pre-evaluate inline expressions, add format_inline_(), fix print.ab

- All bare {variable}/{expression} in message_()/warning_()/stop_() calls
  are now pre-evaluated via paste0(), so users without cli/glue never see
  raw template syntax (mo_source.R, first_isolate.R, join_microorganisms.R,
  antibiogram.R, atc_online.R)
- Add format_inline_() helper: formats a cli-markup string and returns it
  (not emits it), using cli::format_inline() when available and cli_to_plain()
  otherwise
- Rewrite .onAttach to use format_inline_() for all packageStartupMessage
  calls; also adds {.topic} link and {.code} markup for option names
- print.ab: pre-evaluate function_name via paste0 (no .envir needed),
  apply highlight_code() to each example bullet for R syntax highlighting
- join_microorganisms: pre-evaluate {type} and {nrow(...)} expressions

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* fixes

* Replace all "in \`funcname()\`:" with {.help [{.fun funcname}](AMR::funcname)}

Converts all "in `funcname()`:" prefixes in warning_()/message_()/stop_()
calls to the full {.help} link format for clickable help in supported
terminals. Also fixes adjacent backtick argument names to {.arg}.

Files changed: ab.R, ab_property.R, av.R, av_property.R, antibiogram.R,
key_antimicrobials.R, mdro.R, mic.R, mo.R, plotting.R

https://claude.ai/code/session_01XHWLohiSTdZvCutwD7ag2b

* fixes

* definitive

* version fix

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-20 17:01:34 +01:00
dr. M.S. (Matthijs) Berends 8439e9c1d2 (v3.0.1.9035) fix loading in Positron 2026-03-18 10:32:11 +01:00
dr. M.S. (Matthijs) Berends 4dc3ec0008 (v3.0.1.9034) Add amr_course() 2026-03-11 16:07:31 +01:00
dr. M.S. (Matthijs) Berends 353eaa3f38 (v3.0.1.9033) add ionophores(), clorobiocin, aminocoumarins group 2026-03-09 11:57:36 +01:00
dr. M.S. (Matthijs) Berends cba315c2e7 (v3.0.1.9032) fix unit tests 2026-03-08 20:36:15 +01:00
dr. M.S. (Matthijs) Berends b6f8584994 (v3.0.1.9031) fix MDRO for non-RStudio terminal 2026-03-08 11:30:18 +01:00
dr. M.S. (Matthijs) Berends e2102c081a (v3.0.1.9030) fix R 3.6 2026-03-07 18:07:24 +01:00
Matthijs BerendsandClaude 9af726dcaa mdro(): infer base drug resistance from drug+inhibitor combination co… (#263)
* mdro(): infer base drug resistance from drug+inhibitor combination columns (#209)

When a base beta-lactam column (e.g., piperacillin/PIP) is absent but a
corresponding drug+inhibitor combination (e.g., piperacillin/tazobactam/TZP)
is present and resistant, resistance in the base drug is now correctly
inferred. This is clinically sound: resistance in a combination implies the
inhibitor provided no benefit, so the base drug is also resistant.

Susceptibility in a combination is NOT propagated to the base drug (the
inhibitor may be responsible for susceptibility), so only R values are
inferred; missing base drugs remain NA otherwise.

Implementation details:
- Uses AB_BETALACTAMS_WITH_INHIBITOR to identify all beta-lactam+inhibitor
  combinations present in the user's data
- Derives base drug AB codes by stripping the "/inhibitor" part from names
- Creates synthetic proxy columns (.sir_proxy_<AB>) in x, set to "R" when
  any matching combination is R, otherwise NA
- Proxy columns are added to cols_ab before drug variable assignment,
  so all existing guideline logic benefits without any changes
- Multiple combos for the same base drug are OR-ed (any R → R)
- Adds internal ab_without_inhibitor() helper for the name->base mapping
- Verbose mode reports which combinations are used for inference

Bumps version: 3.0.1.9028 -> 3.0.1.9029

https://claude.ai/code/session_01Cp154UtssHg84bw38xiiTG

* Add sir.R/mic.R fixes and mdro() unit tests; bump to 3.0.1.9030

R/sir.R (line 571):
  Guard purely numeric strings (e.g. "1", "8") from the Unicode letter
  filter. Values matching the broad SIR regex but consisting only of digits
  must not be stripped; add `x %unlike% "^[0-9+]$"` predicate.

R/mic.R (lines 220-222):
  Preserve the letter 'e' during Unicode-letter removal so that MIC values
  in scientific notation (e.g. "1e-3", "2.5e-2") survive the cleaning step.
  - Line 220: [\\p{L}] → [^e\\P{L}]  (remove all letters except 'e')
  - Line 222: [^0-9.><= -]+ → [^0-9e.><= -]+  (allow 'e' in whitelist)

tests/testthat/test-mdro.R:
  New tests for the drug+inhibitor inference added in the previous commit
  (issue #209):
  - TZP=R with no PIP column → PIP inferred R → MDRO class elevated
  - TZP=S with no PIP column → proxy col is NA (not S) → class lower
  - verbose mode emits "Inferring resistance" message
  - AMC=R with no AMX column runs without error (Enterococcus faecium)

https://claude.ai/code/session_01Cp154UtssHg84bw38xiiTG

* Fix version to single bump (9029) and update CLAUDE.md versioning rules

CLAUDE.md: Rewrite the "Version and date bump" subsection to document that:
- Exactly ONE version bump is allowed per PR (PRs are squash-merged into one
  commit on the default branch, so one commit = one version increment)
- The correct version is computed from git history:
    currentversion="${currenttag}.$((commits_since_tag + 9001 + 1))"
  with the +1 accounting for the PR's own squash commit not yet on the
  default branch
- Fall back to incrementing DESCRIPTION's version by 1 if git describe fails
- The Date: field tracks the date of the *last* PR commit (updated each time)

DESCRIPTION / NEWS.md: Correct the version from 3.0.1.9030 back to 3.0.1.9029.
Two version bumps were made across two commits in this PR; since it will be
squash-merged as one commit only one bump is correct. Also update Date to
today (2026-03-07).

https://claude.ai/code/session_01Cp154UtssHg84bw38xiiTG

* Fix stats::setNames, test accessor bug, and version script verification

R/mdro.R:
  Qualify setNames() as stats::setNames() in the drug+inhibitor inference
  block to satisfy R CMD CHECK's global-function checks.

tests/testthat/test-mdro.R:
  mdro() with verbose=FALSE returns an atomic ordered factor, not a
  data.frame. Fix three test errors introduced in the previous commit:
  - Line 320: result_no_pip$MDRO -> result_no_pip (factor, no $ accessor)
  - Line 328: result_tzp_s$MDRO / result_no_pip$MDRO -> direct factor refs
  - Line 347: expect_inherits(..., "data.frame") -> c("factor","ordered")
  Also fix the comment on line 347 to match the actual return type.

Version: confirmed at 3.0.1.9029 (no further bump; one bump already made
this PR). git describe failed (no tags in dev environment) — fallback
applies. The +1 in CLAUDE.md's formula is correct for tagged repos:
currentcommit + 9001 + 1 = 27 + 9001 + 1 = 9029 ✓

https://claude.ai/code/session_01Cp154UtssHg84bw38xiiTG

* Fix unit tests: use mrgn guideline and expect_message() for proxy tests

Three failures corrected:

1. Classification tests (lines 321, 329): The EUCAST guideline for
   P. aeruginosa already has OR logic (PIP OR TZP), so TZP=R alone
   satisfies it regardless of whether the PIP proxy exists. Switch to
   guideline="mrgn": the MRGN 4MRGN criterion for P. aeruginosa
   requires PIP=R explicitly (lines 1488-1496 of mdro.R), with no TZP
   fallback. Without the proxy: PIP missing -> not 4MRGN -> level 1.
   With the proxy (TZP=R infers PIP=R): 4MRGN reached -> level 3.
   The TZP=S case leaves proxy=NA, so PIP is still absent effectively
   -> level 1, which is < level 3 as expected.

2. Verbose/message test (line 335): message_() routes through message()
   to stderr, not cat() to stdout. expect_output() only captures stdout
   so it always saw nothing. Fix: use expect_message() instead, and
   remove the inner suppressMessages() that was swallowing the message
   before expect_message() could capture it.

Also trim two stale lines left over from the old expect_output block.

https://claude.ai/code/session_01Cp154UtssHg84bw38xiiTG

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-07 18:06:55 +01:00
dr. M.S. (Matthijs) Berends daab605ca4 (v3.0.1.9028) fix unique CIDs 2026-03-06 18:53:42 +01:00
dr. M.S. (Matthijs) Berends c0a394008e (v3.0.1.9027) Fixes #252 and add documentation update regarding #253 2026-03-06 13:10:33 +01:00
dr. M.S. (Matthijs) Berends 60e8f2bae6 (v3.0.1.9026) fix ab_group(NA) 2026-03-06 12:41:27 +01:00
Matthijs BerendsandClaude 4e3ea95fbd Claude/fix issue 245 (#262)
* fix: restore valid AB codes mangled by generalise_antibiotic_name() (#245)

When as.ab() received a vector containing both valid AB codes (like ETH,
PHN, PHE, STH, THA, MTH, THI1) and an untranslatable value, the fast
path at line 100 was skipped. The slow path then applied
generalise_antibiotic_name(), which rewrites "TH"->"T" and "PH"->"F",
mangling these short AB codes (e.g. ETH->"ET", PHN->"FN") so they could
no longer be found in the lookup table.

Fix: save the pre-generalised values before applying
generalise_antibiotic_name(), then restore any elements that were already
valid AB codes in their original form.

https://claude.ai/code/session_01Sujw89qa48NoUmMPDBJLz9

* fix: use toupper() in AB code restoration to handle lowercase input (#245)

Ensures that lowercase user input (e.g. 'eth', 'phn') is matched
case-insensitively against the uppercase AB codes in $ab, and that
the restored value is stored in uppercase to match the lookup table.

https://claude.ai/code/session_01Sujw89qa48NoUmMPDBJLz9

* revert: remove unnecessary toupper() since x is already uppercased

https://claude.ai/code/session_01Sujw89qa48NoUmMPDBJLz9

* Revise versioning and date bump requirements for PRs

Updated versioning instructions for pull requests to include date bump.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-04 08:59:44 +01:00
dr. M.S. (Matthijs) Berends 0311834035 Merge branch 'main' of https://github.com/msberends/AMR 2026-03-03 15:44:34 +01:00
dr. M.S. (Matthijs) Berends b6211931f8 (v3.0.1.9022) add ceftibuten/avibactam (CTA), kasugamycin (KAS), ostreogrycin (OST), thiostrepton (THS), xeruborbactam (XER), zorbamycin (ZOR) 2026-03-03 15:41:08 +01:00
Matthijs BerendsandClaude 2c21eba04c add CLAUDE.md with project context for Claude Code (#261)
* add CLAUDE.md with project context for Claude Code

Provides development commands, architecture overview, file conventions,
custom S3 classes, data files, testing setup, and versioning guidelines
to help Claude Code assist effectively in this repository.

https://claude.ai/code/session_01L3fTxqsg3Gc6J1znpWN1Mx

* add CLAUDE.md to .Rbuildignore

Excludes the Claude Code context file from the R package build tarball.

https://claude.ai/code/session_01L3fTxqsg3Gc6J1znpWN1Mx

* document version-bump requirement for every PR in CLAUDE.md

Each PR must increment the .9zzz dev counter by 1 in both
DESCRIPTION (Version: field) and NEWS.md (top-level heading).

https://claude.ai/code/session_01L3fTxqsg3Gc6J1znpWN1Mx

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-27 17:13:11 +01:00
dr. M.S. (Matthijs) Berends 12cf144b19 (v3.0.1.9021) add guideline to resistance() and susceptibility() 2026-02-12 20:34:06 +01:00
dr. M.S. (Matthijs) Berends 499c830ee7 (v3.0.1.9020) unit test fixes 2026-02-09 13:16:36 +01:00
dr. M.S. (Matthijs) Berends ba4c159154 (v3.0.1.9019) Wildtype/Non-wildtype support, and start with interpretive_rules()
Fixes #246
Fixes #254
Fixes #255
Fixes #256
2026-02-08 23:15:40 +01:00
dr. M.S. (Matthijs) Berends 2df2911cf4 (v3.0.1.9018) fixes #249
updates AB groups
2026-01-16 10:57:03 +01:00
dr. M.S. (Matthijs) Berends fd50c51543 (v3.0.1.9017) fix documentation 2026-01-08 14:03:02 +01:00
dr. M.S. (Matthijs) Berends cfd1922dd9 (v3.0.1.9016) fix unit test 2026-01-08 12:29:08 +01:00
dr. M.S. (Matthijs) Berends 7df28bce28 (v3.0.1.9015) fix translations 2026-01-08 10:21:48 +01:00
dr. M.S. (Matthijs) Berends 7b9c151241 (v3.0.1.9014) try-again fix 2026-01-07 15:10:21 +01:00
dr. M.S. (Matthijs) Berends 85e8e814e8 (v3.0.1.9013) fix translations 2026-01-07 13:30:54 +01:00
dr. M.S. (Matthijs) Berends fa827f27f4 (v3.0.1.9012) fix translations 2026-01-07 11:00:58 +01:00
dr. M.S. (Matthijs) Berends 9d1b4565f6 (v3.0.1.9008) fix #246
Merge branch 'main' of https://github.com/msberends/AMR

# Conflicts:
#	DESCRIPTION
#	NEWS.md
#	R/sysdata.rda
#	data/antibiotics.rda
2026-01-06 23:11:34 +01:00
dr. M.S. (Matthijs) Berends cfbbfb4fa5 (v3.0.1.9007) fix #246 2026-01-06 23:08:50 +01:00
dr. M.S. (Matthijs) Berends 35debe25ee (v3.0.1.9009) tidymodels vignette 2025-12-23 11:02:26 +01:00
RUG e9cf3d5572 (v3.0.1.9008) tidymodels vignette 2025-12-22 19:04:39 +01:00
RUG a5c6aa9fa8 (v3.0.1.9007) fix vignette 2025-12-22 09:34:58 +01:00
dr. M.S. (Matthijs) Berends f6e28ac95c (v3.0.1.9006) Fix website 2025-12-21 12:29:46 +01:00
dr. M.S. (Matthijs) Berends 151af21f38 (v3.0.1.9005) re-add tidymodels implementation 2025-12-21 12:19:43 +01:00
dr. M.S. (Matthijs) Berends 225c73f7e7 (v3.0.1.9004) Revamp as.sir() interpretation for capped MICs
Fixes #243
Fixes #244
2025-12-15 13:18:13 +01:00
dr. M.S. (Matthijs) Berends ba30b08f76 (v3.0.1.9003) Add taniborbactam and cefepime/taniborbactam 2025-11-24 11:24:02 +01:00
dr. M.S. (Matthijs) Berends d366949f1b (v3.0.1.9002) replace WHONET directives with their GitHub repo 2025-10-13 22:12:48 +02:00
dr. M.S. (Matthijs) Berends 0b24967b23 (v3.0.1.9001) fix antibiogram 2025-09-30 10:54:07 +02:00
dr. M.S. (Matthijs) Berends adee419f1c v3.0.1 2025-09-20 17:14:07 +01:00
dr. M.S. (Matthijs) Berends 33fb1849eb (v3.0.0.9036) Prepare for v3.0.1 2025-09-19 12:23:59 +01:00
dr. M.S. (Matthijs) Berends 13f2a864da (v3.0.0.9035) fix mo_pathogenicity unit test following MycoBank bugfix 2025-09-18 14:22:52 +01:00
dr. M.S. (Matthijs) Berends 10ba36821e (v3.0.0.9034) fix MycoBank synonyms 2025-09-18 13:58:34 +01:00
dr. M.S. (Matthijs) Berends 5796e8f3a4 (v3.0.0.9033) rename workflow 2025-09-15 09:10:54 +02:00
dr. M.S. (Matthijs) Berends b11866af57 (v3.0.0.9032) add GitHub Action for dev version of packages 2025-09-13 14:02:59 +02:00
dr. M.S. (Matthijs) Berends e8c99f2775 (v3.0.0.9031) fix for ggplot2 2025-09-12 16:52:59 +02:00
dr. M.S. (Matthijs) Berends 5b99888151 (v3.0.0.9030) fix NEWS 2025-09-11 14:41:28 +02:00
dr. M.S. (Matthijs) Berends c7b2acbeb6 (v3.0.0.9029) fix for vignette and envir data 2025-09-10 16:19:30 +02:00
dr. M.S. (Matthijs) Berends 1922fb5ff2 (v3.0.0.9028) fix as.ab() warning 2025-09-10 15:06:51 +02:00
dr. M.S. (Matthijs) Berends 4d7c4ca52c (v3.0.0.9027) skimr update and as.ab warning - fixes #234, fixes #232 2025-09-10 13:32:52 +02:00
dr. M.S. (Matthijs) Berends d5a568318b (v3.0.0.9026) fix tidymodels doc 2025-09-04 15:03:28 +02:00
dr. M.S. (Matthijs) Berends c1c49fa463 (v3.0.0.9025) fix todo tracker 2025-09-04 14:40:24 +02:00
dr. M.S. (Matthijs) Berends d2ced1db61 (v3.0.0.9024) fix todo tracker 2025-09-04 14:28:01 +02:00
dr. M.S. (Matthijs) Berends 3d40b20c10 (v3.0.0.9023) update todo tracker 2025-09-04 14:04:22 +02:00
dr. M.S. (Matthijs) Berends 3ba1b8a10a (v3.0.0.9022) postpone new features - we like a clearly focussed bugfix release first 2025-09-03 15:39:44 +02:00
dr. M.S. (Matthijs) Berends 0744c6feee (v3.0.0.9021) checkouts 2025-09-03 12:12:05 +02:00
dr. M.S. (Matthijs) Berends eca638529c new umcg logo and old CHECKOUT update 2025-09-03 11:49:10 +02:00
dr. M.S. (Matthijs) Berends 60bd631e1a (v3.0.0.9019) Fixes #229, #230, #227, #225 2025-09-01 16:56:55 +02:00
dr. M.S. (Matthijs) Berends 9b07a8573a (v3.0.0.9018) keep all reasons in mdro(), fixed #227 2025-08-07 16:23:47 +02:00
194 changed files with 35885 additions and 16450 deletions
+3
View File
@@ -9,6 +9,7 @@
^_pkgdown\.yml$
^appveyor\.yml$
^codecov\.yml$
^CLAUDE\.md$
^cran-comments\.md$
^CRAN-RELEASE$
^\.github$
@@ -40,3 +41,5 @@
^CRAN-SUBMISSION$
^PythonPackage$
^README\.Rmd$
^tools$
\.no_include$
+5 -5
View File
@@ -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.0)
- One of the latest GitHub versions (3.0.0.9xxx)
- Latest CRAN version (3.0.1)
- One of the latest GitHub versions (3.0.1.9xxx)
validations:
required: true
+2 -8
View File
@@ -48,7 +48,6 @@ 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/*
@@ -57,11 +56,9 @@ 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 ""
@@ -92,7 +89,7 @@ else
# Combine tag and commit number
currentversion="$currenttag.$((currentcommit + 9001))"
echo "- ${currentpkg} pkg version set to ${currentversion}"
echo "- AMR pkg version set to ${currentversion}"
# Update version number and date in DESCRIPTION
sed -i -- "s/^Version: .*/Version: ${currentversion}/" DESCRIPTION
@@ -103,10 +100,7 @@ else
# Update version number in NEWS.md
if [ -e "NEWS.md" ]; then
if [ "$currentpkg" = "your" ]; then
currentpkg=""
fi
sed -i -- "1s/.*/# ${currentpkg} ${currentversion}/" NEWS.md
sed -i -- "1s/.*/# AMR ${currentversion}/" NEWS.md
echo "- Updated version number in ./NEWS.md"
rm -f NEWS.md--
git add NEWS.md
@@ -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,17 +29,33 @@
on:
push:
branches: '**'
pull_request:
branches: '**'
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 * * *'
name: lintr
name: check-recent-dev-pkgs
jobs:
lintr:
runs-on: ubuntu-latest
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}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v4
@@ -47,39 +63,21 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
r-version: release
# use RStudio Package Manager to quickly install packages
use-public-rspm: true
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
- uses: r-lib/actions/setup-r-dependencies@v2
with:
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}
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")'
+19 -19
View File
@@ -29,10 +29,11 @@
on:
pull_request:
# run in each PR in this repo
# run in each PR in this repo (1 worker, see matrix logic below)
branches: '**'
push:
branches: '**'
# only on main; pushing to a PR branch is already covered by pull_request above
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)
@@ -41,7 +42,22 @@ 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 }}
@@ -50,23 +66,7 @@ jobs:
strategy:
fail-fast: false
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}
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
+14 -9
View File
@@ -29,8 +29,8 @@
on:
push:
# only run after a git push on any branch in this repo
branches: '**'
# only run after a git push on the main branch
branches: [main]
name: check-old
@@ -50,11 +50,11 @@ jobs:
# 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: 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: 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.0', allowfail: false}
env:
@@ -76,9 +76,14 @@ jobs:
- uses: r-lib/actions/setup-pandoc@v2
- name: Install tinytest from CRAN
- name: Install suggested pkgs (and tinytest) from CRAN
run: |
install.packages("tinytest", repos = "https://cran.r-project.org")
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)
shell: Rscript {0}
- name: Show session info
+4 -2
View File
@@ -28,10 +28,12 @@
# ==================================================================== #
on:
push:
branches: '**'
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]
name: code-coverage
+4 -3
View File
@@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
env:
PYPI_PAT: ${{ secrets.PYPI_PAT }}
GH_REPO_SCOPE: ${{ secrets.GH_REPO_SCOPE }}
steps:
- name: Checkout code
@@ -78,6 +78,7 @@ 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
@@ -117,7 +118,7 @@ jobs:
rm -rf PythonPackage
git init
git remote add origin https://$PYPI_PAT@github.com/msberends/AMR
git remote add origin https://$GH_REPO_SCOPE@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"
@@ -125,4 +126,4 @@ jobs:
git rm -rf . || true
git add .
git commit -m "Python wrapper update"
git push https://$PYPI_PAT@github.com/msberends/AMR.git python-wrapper --force
git push https://$GH_REPO_SCOPE@github.com/msberends/AMR.git python-wrapper --force
@@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
env:
PYPI_PAT: ${{ secrets.PYPI_PAT }}
GH_REPO_SCOPE: ${{ secrets.GH_REPO_SCOPE }}
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://$PYPI_PAT@github.com/msberends/amr-for-r-assistant.git main --force
git push https://$GH_REPO_SCOPE@github.com/msberends/amr-for-r-assistant.git main --force
+84
View File
@@ -0,0 +1,84 @@
# ==================================================================== #
# 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:
# only on main
branches: "main"
name: Update TODO Tracker
jobs:
update-todo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate TODO list from R/
run: |
export TZ=Europe/Amsterdam
last_updated=$(date +"%e %B %Y %H:%M:%S %Z" | sed 's/^ *//')
echo "## \`TODO\` Report" > todo.md
echo "" >> todo.md
echo "**Last Updated: ${last_updated}**" >> todo.md
echo "" >> todo.md
echo "_This overview is automatically updated on each push to \`main\`. It provides an automated overview of all mentions of the text \`TODO\`._" >> todo.md
echo "" >> todo.md
todos=$(grep -rn --include=\*.{R,Rmd,yaml,yml,md,css,js} --exclude={todo-tracker.yml,todo.md} "TODO" . || true)
if [ -z "$todos" ]; then
echo "✅ No TODOs found." >> todo.md
else
echo "$todos" | awk -F: -v repo="https://github.com/msberends/AMR/blob/main/" '
{
file = $1
gsub("^\\./", "", file) # remove leading ./ if present
line = $2
text = substr($0, index($0,$3))
if (file != last_file) {
if (last_file != "") print "```"
print ""
print "### [`" file "`](" repo file ")"
print "```r"
last_file = file
}
printf "L%s: %s\n", line, text
}
' >> todo.md
echo "\`\`\`" >> todo.md
fi
- 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
+4 -5
View File
@@ -42,16 +42,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: checkout
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: Preserve timestamps
run: |
sudo apt install git-restore-mtime
git restore-mtime
- name: restore timestamps
uses: chetan/git-restore-mtime-action@v2
- uses: r-lib/actions/setup-pandoc@v2
+1
View File
@@ -1,5 +1,6 @@
Meta
doc
docs
.Renviron
.Rproj.user
.Rhistory
+198
View File
@@ -0,0 +1,198 @@
# 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 20112025 and CLSI 20112025 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
## 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 (20112025) |
| `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.03.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.
+3 -3
View File
@@ -1,3 +1,3 @@
Version: 3.0.0
Date: 2025-06-01 16:52:53 UTC
SHA: 79038fed2169a25a7fc067c80bb25d9d78be21d9
Version: 3.0.1
Date: 2025-09-20 10:56:46 UTC
SHA: 33fb1849eb5aa6d33828e643c8f5047dd93447e3
+10 -8
View File
@@ -1,6 +1,6 @@
Package: AMR
Version: 3.0.0.9017
Date: 2025-07-28
Version: 3.0.1.9055
Date: 2026-04-30
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,27 +27,28 @@ 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"),
person(given = c("Matthew"), family = "Saab", role = "ctb", comment = c(ORCID = "0009-0008-6626-7919")),
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"),
person(given = c("Rogier", "P."), family = "Schade", role = "ctb", comment = c(ORCID = "0000-0002-9487-4467")),
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,
@@ -63,12 +64,13 @@ Suggests:
tidyselect,
tinytest,
vctrs,
xml2
xml2,
usethis
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.2
RoxygenNote: 7.3.3
Roxygen: list(markdown = TRUE, old_usage = TRUE)
+14
View File
@@ -133,8 +133,10 @@ 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)
@@ -161,6 +163,8 @@ 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)
@@ -168,6 +172,7 @@ 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)
@@ -212,6 +217,7 @@ 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)
@@ -242,6 +248,8 @@ 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)
@@ -318,7 +326,9 @@ export(not_intrinsic_resistant)
export(oxazolidinones)
export(pca)
export(penicillins)
export(peptides)
export(phenicols)
export(phosphonics)
export(polymyxins)
export(proportion_I)
export(proportion_IR)
@@ -358,6 +368,7 @@ export(sir_df)
export(sir_interpretation_history)
export(sir_predict)
export(skewness)
export(spiropyrimidinetriones)
export(step_mic_log2)
export(step_sir_numeric)
export(streptogramins)
@@ -381,6 +392,8 @@ 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)
@@ -402,6 +415,7 @@ 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)
+77 -6
View File
@@ -1,13 +1,75 @@
# AMR 3.0.0.9017
# AMR 3.0.1.9055
This is primarily a bugfix release, though we added one nice feature too.
This will become release v3.1.0, intended for launch end of May.
### New
* Integration with the **tidymodels** framework to allow seamless use of MIC and SIR data in modelling pipelines via `recipes`
* Support for clinical breakpoints of 2026 of both CLSI and EUCAST, by adding all of their over 5,700 new clinical breakpoints to the `clinical_breakpoints` data set for usage in `as.sir()`. EUCAST 2026 is now the new default guideline for all MIC and disk diffusion interpretations.
* Support for the [`future`](https://future.futureverse.org) package and its framework, as the previous implementation of parallel computing was slow
- **Breaking change**: `as.sir()` with `parallel = TRUE` now requires a non-sequential `future::plan()` to be active before the call — e.g., `future::plan(future::multisession)` — and throws an informative error if none is set.
- New all-core usage setup: when the number of AB columns is smaller than the number of available cores, rows are now split into batches so all cores stay active (row-batch mode). Previously, a 6-column dataset on a 16-core machine would only use 6 cores; now all 16 are used, with each worker processing a smaller row slice (lower per-worker memory pressure and processing time)
- `antibiogram()` and `wisca()` gained a `parallel` argument using the same `future`/`future.apply` pattern: for WISCA, Monte Carlo simulations are split into `(group, chunk)` job pairs distributed across workers; for grouped antibiograms, each group is processed by a separate worker (#281)
* Integration with the *tidymodels* framework to allow seamless use of SIR, MIC and disk 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()`
- New `tidyselect` helpers:
- `all_sir()`, `all_sir_predictors()`
- `all_mic()`, `all_mic_predictors()`
- `all_disk()`, `all_disk_predictors()`
* Data set `esbl_isolates` to practise with AMR modelling
* AMR selectors `ionophores()`, `peptides()`, `phosphonics()` and `spiropyrimidinetriones()`
* Support for Wildtype (WT) / Non-wildtype (NWT) in `as.sir()`, all plotting functions, and all susceptibility/resistance functions.
- `as.sir()` gained an argument `as_wt_nwt`, which defaults to `TRUE` only when `breakpoint_type = "ECOFF"` (#254)
- This transforms the output from S/R to WT/NWT
- Functions such as `susceptibility()` count WT as S and NWT as R
* Function `interpretive_rules()`, which allows future implementation of CLSI interpretive rules (#235)
- `eucast_rules()` has become a wrapper around that function
- Gained argument `add_if_missing` (default: `TRUE`). When set to `FALSE`, rules are only applied to cells that already contain an SIR value; `NA` cells are left untouched. This is useful with `overwrite = TRUE` to update reported results without imputing values for drugs that were not tested (#259)
* Function `amr_course()`, which allows for automated download and unpacking of a GitHub repository for e.g. webinar use
* Two new `NA` objects, `NA_ab_` and `NA_mo_`, analogous to base R's `NA_character_` and `NA_integer_`, for use in pipelines that require typed missing values
### Fixes
* Fixed a bug in `as.sir()` where values that were purely numeric (e.g., `"1"`) and matched the broad SIR-matching regex would be incorrectly stripped of all content by the Unicode letter filter
* Fixed a bug in `as.mic()` where MIC values in scientific notation (e.g., `"1e-3"`) were incorrectly handled because the letter `e` was removed along with other Unicode letters; scientific notation `e` is now preserved
* Fixed a bug in `as.ab()` where certain AB codes containing "PH" or "TH" (such as `ETH`, `MTH`, `PHE`, `PHN`, `STH`, `THA`, `THI1`) would incorrectly return `NA` when combined in a vector with any untranslatable value (#245)
* Fixed a bug in `antibiogram()` for when no antimicrobials are set
* Fixed a bug in `as.sir()` where for numeric input the arguments `S`, `I`, and `R` would not be considered (#244)
* Fixed a bug in plotting MIC values when `keep_operators = "all"`
* Fixed some foreign translations of antimicrobial drugs
* Fixed a bug for printing column names to the console when using `mutate_at(vars(...), as.mic)` (#249)
* Fixed a bug to disregard `NI` for susceptibility proportion functions
* Fixed Italian translation of CoNS to Stafilococco coagulasi-negativo and CoPS to Stafilococco coagulasi-positivo (#256)
* Fixed SIR and MIC coercion of combined values, e.g. `as.sir("<= 0.002; S") ` or `as.mic("S; 0.002")` (#252)
* Fixed translation of foreign languages in `sir_df()` (#272)
* Fixed BRMO classification by including bacterial complexes (#275)
* Fixed `as.sir()` for data frames silently deleting columns whose AB class was already `<sir>` when called a second time (re-running on already-converted data) (#278)
* Fixed `as.sir()` for data frames incorrectly treating metadata columns (e.g. `patient`, `ward`) as antibiotic columns when their names coincidentally matched an antibiotic code; column content is now validated against AMR data patterns before inclusion
* Fixed `as.sir()` ignoring `info = FALSE` for columns with no breakpoints (e.g. cefoxitin against *E. coli*)
### Updates
* `as.sir()` with `reference_data`: custom guideline names now correctly classify values as R using EUCAST convention (`> breakpoint_R` for MIC, `< breakpoint_R` for disk); custom breakpoints with `host = NA` now serve as a host-agnostic fallback when no host-specific row matches (#239)
* Extensive `cli` integration for better message handling and clickable links in messages and warnings (#191, #265)
* `mdro()` now infers resistance for a _missing_ base drug column from an _available_ corresponding drug+inhibitor combination showing resistance (e.g., piperacillin is absent but required, while piperacillin/tazobactam available and resistant). Can be set with the new argument `infer_from_combinations`, which defaults to `TRUE` (#209). Note that this can yield a higher MDRO detection (which is a good thing as it has become more reliable).
* `susceptibility()` and `resistance()` gained the argument `guideline`, which defaults to EUCAST, for interpreting the 'I' category correctly.
* Added to the `antimicrobials` data set: cefepime/taniborbactam (`FTA`), ceftibuten/avibactam (`CTA`), clorobiocin (`CLB`), kasugamycin (`KAS`), ostreogrycin (`OST`), taniborbactam (`TAN`), thiostrepton (`THS`), xeruborbactam (`XER`), and zorbamycin (`ZOR`)
* `as.mic()` and `rescale_mic()` gained the argument `round_to_next_log2`, which can be set to `TRUE` to round all values up to the nearest next log2 level (#255)
* `antimicrobials$group` is now a `list` instead of a `character`, to contain any group the drug is in (#246)
* `ab_group()` gained an argument `all_groups` to return all groups the antimicrobial drug is in (#246)
* Added explaining message to `as.sir()` when interpreting numeric values (e.g., 1 for S, 2 for I, 3 for R) (#244)
* Updated handling of capped MIC values (`<`, `<=`, `>`, `>=`) in `as.sir()` in the argument `capped_mic_handling`: (#243)
* Introduced four clearly defined options: `"none"`, `"conservative"` (default), `"standard"`, and `"lenient"`
* Interpretation of capped MIC values now consistently returns `"NI"` (non-interpretable) when the true MIC could be at either side of a breakpoint, depending on the selected handling mode
* This results in more reliable behaviour compared to previous versions for capped MIC values
* Removed the `"inverse"` option, which has now become redundant
* `ab_group()` now returns values consist with the AMR selectors (#246)
# AMR 3.0.1
This is a bugfix release following the release of v3.0.0 in June 2025.
### 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
@@ -15,10 +77,19 @@ This is primarily a bugfix release, though we added one nice feature too.
* 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
@@ -27,7 +98,7 @@ This is primarily a bugfix release, though we added one nice feature too.
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
* 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.
* 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.
* 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).
@@ -39,7 +110,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 datasets 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 data sets 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**
+17 -10
View File
@@ -30,41 +30,47 @@
# 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/clinical_breakpoints/"
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
),
"14.0" = list(
version_txt = "v14.0",
year = 2024,
title = "'EUCAST Clinical Breakpoint Tables'",
url = "https://www.eucast.org/clinical_breakpoints/"
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
),
"13.1" = list(
version_txt = "v13.1",
year = 2023,
title = "'EUCAST Clinical Breakpoint Tables'",
url = "https://www.eucast.org/clinical_breakpoints/"
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
),
"12.0" = list(
version_txt = "v12.0",
year = 2022,
title = "'EUCAST Clinical Breakpoint Tables'",
url = "https://www.eucast.org/clinical_breakpoints/"
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
),
"11.0" = list(
version_txt = "v11.0",
year = 2021,
title = "'EUCAST Clinical Breakpoint Tables'",
url = "https://www.eucast.org/clinical_breakpoints/"
url = "https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/"
),
"10.0" = list(
version_txt = "v10.0",
year = 2020,
title = "'EUCAST Clinical Breakpoint Tables'",
url = "https://www.eucast.org/ast_of_bacteria/previous_versions_of_documents/"
url = "https://www.eucast.org/bacteria/document-archive/"
)
)
EUCAST_VERSION_EXPERT_RULES <- list(
@@ -72,19 +78,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/expert_rules_and_expected_phenotypes"
url = "https://www.eucast.org/bacteria/important-additional-information/expert-rules/"
),
"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/expert_rules_and_expected_phenotypes"
url = "https://www.eucast.org/bacteria/important-additional-information/expert-rules/"
),
"3.1" = list(
version_txt = "v3.1",
year = 2016,
title = "'EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes'",
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes"
url = "https://www.eucast.org/bacteria/important-additional-information/expert-rules/"
)
)
EUCAST_VERSION_EXPECTED_PHENOTYPES <- list(
@@ -92,7 +98,7 @@ EUCAST_VERSION_EXPECTED_PHENOTYPES <- list(
version_txt = "v1.2",
year = 2023,
title = "'EUCAST Expected Resistant Phenotypes'",
url = "https://www.eucast.org/expert_rules_and_expected_phenotypes"
url = "https://www.eucast.org/bacteria/important-additional-information/expert-rules/"
)
)
@@ -233,6 +239,7 @@ globalVariables(c(
"uti_index",
"value",
"varname",
"where",
"x",
"xvar",
"y",
+304 -238
View File
@@ -253,12 +253,9 @@ 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(
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
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
)
}
} else if (any(vapply(FUN.VALUE = logical(1), x, function(x) inherits(x, c("Date", "POSIXct"))))) {
@@ -304,9 +301,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 '", 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
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."
)
found <- NULL
}
@@ -317,9 +314,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 '", font_bold(found), "' as input for `", ifelse(add_col_prefix, "col_", ""), type, "`.")
msg <- paste0("Using column {.field ", font_bold(found), "} as input for {.arg ", ifelse(add_col_prefix, "col_", ""), type, "}.")
if (type %in% c("keyantibiotics", "keyantimicrobials", "specimen")) {
msg <- paste(msg, "Use", font_bold(paste0(ifelse(add_col_prefix, "col_", ""), type), "= FALSE"), "to prevent this.")
msg <- paste(msg, "Use {.arg ", paste0(ifelse(add_col_prefix, "col_", ""), type), "= FALSE} to prevent this.")
}
message_(msg)
}
@@ -362,9 +359,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(package[!installed]), " package.",
"\nTry to install with install.packages().",
call. = FALSE
stop_(
"This requires the ", vector_and(paste0("{.pkg ", package[!installed], "}"), quotes = FALSE), " package.",
"\nTry to install with {.fun install.packages}."
)
} else {
return(invisible())
@@ -387,13 +384,18 @@ 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 `", name, "()` is not an exported object from package '", pkg,
"'. Please create an issue at ", font_url("https://github.com/msberends/AMR/issues"), ". Many thanks!",
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!",
call = FALSE
)
} else {
@@ -403,30 +405,136 @@ 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) strsplit(resolve(c), " ", fixed = TRUE)[[1L]][1L])
# 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
# - 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
# - 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.
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 (msg %like% "\n") {
# run word_wraps() over every line here, bind them and return again
if (grepl("\n", msg, fixed = TRUE)) {
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
@@ -434,155 +542,112 @@ word_wrap <- function(...,
collapse = "\n"
))
}
# 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_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
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 <- 0 + extra_indent
indentation <- 0L + 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)
}
if (indentation > 0L) {
wrapped <- gsub("\n", paste0("\n", strrep(" ", indentation)), wrapped, fixed = TRUE)
}
gsub("(\n| )+$", "", wrapped)
}
# 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)
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
)
msg <- gsub(
"\\{\\.help \\[([^]]+)\\]\\([^)]+\\)\\}",
"{.code \\1}",
msg,
perl = TRUE
)
# {.topic [display](topic)} -> {.code ?display}
msg <- gsub(
"\\{\\.topic \\[([^]]+)\\]\\([^)]+\\)\\}",
"{.code ?\\1}",
msg,
perl = TRUE
)
msg
}
message_ <- function(...,
appendLF = TRUE,
add_fn = list(font_blue),
as_note = TRUE) {
message(
word_wrap(...,
add_fn = add_fn,
as_note = as_note
),
appendLF = appendLF
)
if (has_cli_rlang()) {
msg <- paste0(c(...), collapse = "")
if (!cli::ansi_has_hyperlink_support()) {
msg <- simplify_help_markup(msg)
}
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(paste0(c(...), collapse = ""), envir = parent.frame())
message(word_wrap(plain_msg, as_note = as_note), appendLF = appendLF)
}
}
warning_ <- function(...,
add_fn = list(),
immediate = FALSE,
call = FALSE) {
warning(
trimws2(word_wrap(...,
add_fn = add_fn,
as_note = FALSE
)),
immediate. = immediate,
call. = call
)
if (has_cli_rlang()) {
msg <- paste0(c(...), collapse = "")
if (!cli::ansi_has_hyperlink_support()) {
msg <- simplify_help_markup(msg)
}
cli::cli_warn(msg, .envir = parent.frame())
} else {
plain_msg <- cli_to_plain(paste0(c(...), collapse = ""), envir = parent.frame())
warning(trimws2(word_wrap(plain_msg, as_note = FALSE)), immediate. = immediate, call. = call)
}
}
# this alternative to the stop() function:
# - adds the function name where the error was thrown
# - wraps text to never break lines within words
# - 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) {
msg <- paste0(c(...), collapse = "")
msg_call <- ""
if (!isFALSE(call)) {
if (isTRUE(call)) {
call <- as.character(sys.call(-1)[1])
} else {
# 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])
}
msg_call <- paste0("in ", call, "():")
if (!cli::ansi_has_hyperlink_support()) {
msg <- simplify_help_markup(msg)
}
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, "()")))
if (has_cli_rlang()) {
if (isTRUE(call)) {
call_obj <- sys.call(-1)
} else if (!isFALSE(call)) {
call_obj <- sys.call(call)
} else {
call <- NULL
call_obj <- NULL
}
AMR_env$cli_abort(msg, call = call)
cli::cli_abort(msg, call = call_obj, .envir = parent.frame())
} else {
stop(paste(msg_call, msg), call. = FALSE)
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)
}
}
@@ -625,7 +690,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_(paste0("invalid ", type, ", NA generated"))
warning_("invalid ", type, ", NA generated")
value[!value %in% check_vector] <- NA
}
value
@@ -686,51 +751,71 @@ 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 ") {
vector_or <- function(v, quotes = TRUE, reverse = FALSE, sort = TRUE, initial_captital = FALSE, last_sep = " or ", documentation = FALSE) {
# 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)) {
quotes <- '"'
if (isTRUE(documentation)) {
quotes <- c("`\"", "\"`")
} else {
# use cli to format as values
quotes <- c("{.val ", "}")
}
} 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, v, quotes))
return(paste0(quotes[1], v, quotes[2]))
}
if (identical(v, c("I", "R", "S"))) {
# class 'sir' should be sorted like this
v <- c("S", "I", "R")
}
if (identical(v, c("I", "NI", "R", "S", "SDD"))) {
if (identical(v, sort(VALID_SIR_LEVELS))) {
# class 'sir' should be sorted like this
v <- c("S", "SDD", "I", "R", "NI")
v <- VALID_SIR_LEVELS
}
# 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(
paste0(quotes, v[seq_len(length(v) - 1)], quotes, collapse = ", "),
last_sep, paste0(quotes, v[length(v)], quotes)
paste(quoted[seq_len(length(quoted) - 1)], collapse = ", "),
last_sep, quoted[length(quoted)]
)
}
vector_and <- function(v, quotes = TRUE, reverse = FALSE, sort = TRUE, initial_captital = FALSE) {
vector_and <- function(v, quotes = TRUE, reverse = FALSE, sort = TRUE, initial_captital = FALSE, documentation = FALSE) {
vector_or(
v = v, quotes = quotes, reverse = reverse, sort = sort,
initial_captital = initial_captital, last_sep = " and "
initial_captital = initial_captital, documentation = documentation,
last_sep = " and "
)
}
@@ -750,7 +835,7 @@ format_class <- function(class, plural = FALSE) {
ifelse(plural, "s", "")
)
# exceptions
class[class == "logical"] <- ifelse(plural, "a vector of `TRUE`/`FALSE`", "`TRUE` or `FALSE`")
class[class == "logical"] <- ifelse(plural, "a vector of {.code TRUE}/{.code FALSE}", "{.code TRUE} or {.code FALSE}")
class[class == "data.frame"] <- "a data set"
if ("list" %in% class) {
class <- "a list"
@@ -759,12 +844,12 @@ format_class <- function(class, plural = FALSE) {
class <- "a matrix"
}
if ("custom_eucast_rules" %in% class) {
class <- "input created with `custom_eucast_rules()`"
class <- "input created with {.fun custom_eucast_rules}"
}
if (any(c("mo", "ab", "sir") %in% class)) {
class <- paste0("of class '", class[1L], "'")
class <- paste0("of class {.cls ", class[1L], "}")
}
class[class == class.bak] <- paste0("of class '", class[class == class.bak], "'")
class[class == class.bak] <- paste0("of class {.cls ", class[class == class.bak], "}")
# output
vector_or(class, quotes = FALSE, sort = FALSE)
}
@@ -799,11 +884,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 `", obj_name, "` must not be NULL", call = call_depth)
stop_if(allow_NULL == FALSE, "argument {.arg ", 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 `", obj_name, "` must not be NA", call = call_depth)
stop_if(allow_NA == FALSE, "argument {.arg ", obj_name, "} must not be NA", call = call_depth)
return(invisible())
}
@@ -813,32 +898,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 `", obj_name,
"` must be ", format_class(allow_class, plural = isTRUE(has_length > 1)),
stop_ifnot(inherits(object, allow_class), "argument {.arg ", 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 `", obj_name,
"` must contain rows and columns (current dimensions: ",
"the data provided in argument {.arg ", 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 `", obj_name,
"` must ", # ifelse(allow_NULL, "be NULL or must ", ""),
stop_ifnot(length(object) %in% has_length, "argument {.arg ", 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 `", obj_name,
"` must ", # ifelse(allow_NULL, "be NULL or must ", ""),
stop_ifnot(object %like% looks_like, "argument {.arg ", obj_name,
"} must ", # ifelse(allow_NULL, "be NULL or must ", ""),
"resemble the regular expression \"", looks_like, "\"",
call = call_depth
)
@@ -856,7 +941,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 `", obj_name, "` ",
stop_ifnot(all(object %in% is_in.bak, na.rm = TRUE), "argument {.arg ", obj_name, "} ",
ifelse(!is.null(has_length) && length(has_length) == 1 && has_length == 1,
"must be either ",
"must only contain values "
@@ -867,8 +952,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 `", obj_name,
"` must ",
stop_if(is.numeric(object) && !all(object > 0, na.rm = TRUE), "argument {.arg ", 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"
@@ -877,8 +962,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 `", obj_name,
"` must ",
stop_if(is.numeric(object) && !all(object >= 0, na.rm = TRUE), "argument {.arg ", 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"
@@ -887,8 +972,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 `", obj_name,
"` must ",
stop_if(is.numeric(object) && !all(is.finite(object[!is.na(object)]), na.rm = TRUE), "argument {.arg ", obj_name,
"} must ",
ifelse(!is.null(has_length) && length(has_length) == 1 && has_length == 1,
"be a finite number",
"all be finite numbers"
@@ -922,9 +1007,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 `", obj_name,
"` should contain at least one column of class 'sir'. Eligible SIR column were now guessed. ",
"See `?as.sir`.",
"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)}.",
immediate = TRUE
)
sirs_eligible <- is_sir_eligible(x)
@@ -970,8 +1055,13 @@ 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)) {
# an element `training` will be in the environment when using some tidymodels functions such as `prep()`
return(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)
}
} 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)
@@ -1021,13 +1111,13 @@ get_current_data <- function(arg_name, call) {
} else {
examples <- ""
}
stop_("this function must be used inside a `dplyr` verb or `data.frame` call",
stop_("this function must be used inside a {.pkg dplyr} verb or {.cls data.frame} call",
examples,
call = call
)
} else {
# mimic a base R error that the argument is missing
stop_("argument `", arg_name, "` is missing with no default", call = call)
stop_("argument {.arg ", arg_name, "} is missing with no default", call = call)
}
}
@@ -1041,24 +1131,8 @@ 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 (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
}
}
if (all(c("dots", "i") %in% names(env))) {
names(env$dots)[env$i]
} else {
NULL
}
@@ -1112,11 +1186,14 @@ 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("[\"']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("[\"']SDD[\"']", font_orange_bg(" SDD "), query)
query <- gsub("[\"']I[\"']", font_orange_bg(" I "), query)
query <- gsub("[\"']R[\"']", font_rose_bg(" R "), 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)
}
# replace the black colour 'stops' with blue colour 'starts'
query <- gsub("\033[39m", "\033[34m", as.character(query), fixed = TRUE)
@@ -1188,6 +1265,13 @@ 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") != "") {
@@ -1219,10 +1303,14 @@ try_colour <- function(..., before, after, collapse = " ") {
}
}
is_dark <- function() {
AMR_env$current_theme <- tryCatch(getExportedValue("getThemeInfo", ns = asNamespace("rstudioapi"))()$editor, error = function(e) NULL)
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
}
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(getExportedValue("getThemeInfo", ns = asNamespace("rstudioapi"))()$dark), error = function(e) FALSE)
AMR_env$is_dark_theme <- !has_colour() || tryCatch(isTRUE(current_theme_fn()$dark), error = function(e) TRUE)
}
isTRUE(AMR_env$is_dark_theme)
}
@@ -1593,37 +1681,15 @@ 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, load the namespace to make `where()`s work across the package in default arguments
loadNamespace("tidyselect")
# tidyselect::where() exists, retrieve from their namespace to make `where()`s work across the package in default arguments
where <- tidyselect::where
} else {
where <- function(fn) {
# based on https://github.com/nathaneastwood/poorman/blob/52eb6947e0b4430cd588976ed8820013eddf955f/R/where.R#L17-L32
if (!is.function(fn)) {
stop_("`", deparse(substitute(fn)), "()` is not a valid predicate function.")
stop_("{.fun ", deparse(substitute(fn)), "} is not a valid predicate function.")
}
df <- pm_select_env$.data
cols <- pm_select_env$get_colnames()
@@ -1638,7 +1704,7 @@ if (!is.null(import_fn("where", "tidyselect", error_on_fail = FALSE))) {
},
fn
))
if (!is.logical(preds)) stop_("`where()` must be used with functions that return `TRUE` or `FALSE`.")
if (!is.logical(preds)) stop_("{.fun where} must be used with functions that return {.code TRUE} or {.code FALSE}.")
data_cols <- cols
cols <- data_cols[preds]
which(data_cols %in% cols)
+18 -6
View File
@@ -29,15 +29,27 @@
#' Options for the AMR package
#'
#' This is an overview of all the package-specific [options()] you can set in the `AMR` package.
#' @section Options:
#' @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):
#' * `AMR_antibiogram_formatting_type` \cr A [numeric] (1-22) to use in [antibiogram()], to indicate which formatting type to use.
#' * `AMR_breakpoint_type` \cr A [character] to use in [as.sir()], to indicate which breakpoint type to use. This must be either `r vector_or(clinical_breakpoints$type)`.
#' * `AMR_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_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_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`.
@@ -63,9 +75,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 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:
#' 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:
#'
#' 1. Save a plain text file to e.g. "X:/team_folder/R_options.R" and fill it with preferred settings.
#'
+67 -21
View File
@@ -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://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm}
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{https://health.ec.europa.eu/documents/community-register/html/reg_hum_atc.htm}
#' @aliases ab
#' @return A [character] [vector] with additional class [`ab`]
#' @seealso
@@ -119,7 +119,14 @@ 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)
@@ -184,12 +191,13 @@ 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 <- 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 <- !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
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 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."
"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."
)
}
@@ -202,6 +210,9 @@ 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)) {
@@ -434,7 +445,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(),
# take failed ATC codes apart from rest
if (length(x_unknown_ATCs) > 0 && fast_mode == FALSE) {
warning_(
"in `as.ab()`: these ATC codes are not (yet) in the antimicrobials data set: ",
"in {.help [{.fun as.ab}](AMR::as.ab)}: these ATC codes are not (yet) in the antimicrobials data set: ",
vector_and(x_unknown_ATCs), "."
)
}
@@ -448,12 +459,14 @@ 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 `as.ab()`: these values could not be coerced to a valid antimicrobial ID: ",
"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: ",
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)) {
@@ -471,7 +484,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(),
}
message_(
"Antimicrobial translation was uncertain for ", examples,
". If required, use `add_custom_antimicrobials()` to add custom entries."
". If required, use {.help [{.fun add_custom_antimicrobials}](AMR::add_custom_antimicrobials)} to add custom entries."
)
}
}
@@ -504,14 +517,22 @@ 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)] <- font_na(NA)
out[is.na(x)] <- pillar::style_na(NA)
# add the names to the drugs as mouse-over!
if (tryCatch(isTRUE(getExportedValue("ansi_has_hyperlink_support", ns = asNamespace("cli"))()), error = function(e) FALSE)) {
if (in_rstudio()) {
out[!is.na(x)] <- font_url(
url = paste0(x[!is.na(x)], ": ", ab_name(x[!is.na(x)])),
txt = out[!is.na(x)]
@@ -533,16 +554,27 @@ type_sum.ab <- function(x, ...) {
print.ab <- function(x, ...) {
if (!is.null(attributes(x)$amr_selector)) {
function_name <- attributes(x)$amr_selector
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, "())]"
)
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))
}
}
cat("Class 'ab'\n")
cat(format_inline_("Class {.cls ab}\n"))
print(as.character(x), quote = FALSE)
}
@@ -627,6 +659,20 @@ 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
@@ -672,8 +718,8 @@ get_translate_ab <- function(translate_ab) {
} else {
translate_ab <- tolower(translate_ab)
stop_ifnot(translate_ab %in% colnames(AMR::antimicrobials),
"invalid value for 'translate_ab', this must be a column name of the `antimicrobials` data set\n",
"or `TRUE` (equals 'name') or `FALSE` to not translate at all.",
"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.",
call = FALSE
)
translate_ab
+1 -1
View File
@@ -212,7 +212,7 @@ ab_from_text <- function(text,
}
})
} else {
stop_("`type` must be either 'drug', 'dose' or 'administration'")
stop_("{.arg type} must be either {.val drug}, {.val dose} or {.val administration}")
}
# collapse text if needed
+33 -11
View File
@@ -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: `vector_or(colnames(antimicrobials), sort = FALSE)`.
#' @param property One of the column names of one of the [antimicrobials] data set: `r vector_or(colnames(antimicrobials), documentation = TRUE, 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,6 +65,7 @@
#' 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")
@@ -163,11 +164,32 @@ 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(), ...) {
ab_group <- function(x, language = get_AMR_locale(), all_groups = FALSE, ...) {
meet_criteria(x, allow_NA = TRUE)
language <- validate_language(language)
translate_into_language(ab_validate(x = x, property = "group", ...), language = language, only_affect_ab_names = TRUE)
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
}
}
#' @rdname ab_property
@@ -243,7 +265,7 @@ ab_ddd <- function(x, administration = "oral", ...) {
if (any(ab_name(x, language = NULL) %like% "/" & is.na(out))) {
warning_(
"in `ab_ddd()`: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
"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.",
"Please refer to the WHOCC website:\n",
"atcddd.fhi.no/ddd/list_of_ddds_combined_products/"
)
@@ -263,7 +285,7 @@ ab_ddd_units <- function(x, administration = "oral", ...) {
if (any(ab_name(x, language = NULL) %like% "/" & is.na(out))) {
warning_(
"in `ab_ddd_units()`: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
"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.",
"Please refer to the WHOCC website:\n",
"atcddd.fhi.no/ddd/list_of_ddds_combined_products/"
)
@@ -282,7 +304,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),
group = ab_group(x, language = language, all_groups = TRUE),
atc = ab_atc(x),
atc_group1 = ab_atc_group1(x, language = language),
atc_group2 = ab_atc_group2(x, language = language),
@@ -319,12 +341,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 `ab_url()`: no ATC code available for ", vector_and(NAs, quotes = FALSE), ".")
warning_("in {.fun 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 `ab_url()`: only the first URL will be opened, as `browseURL()` only suports one string.")
warning_("in {.fun ab_url}: only the first URL will be opened, as {.fun browseURL} only suports one string.")
}
if (!is.na(u[1L])) {
utils::browseURL(u[1L])
@@ -339,7 +361,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)
translate_into_language(ab_validate(x = x, property = property, ...), language = language, only_affect_ab_names = TRUE)
}
#' @rdname ab_property
@@ -375,7 +397,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 `set_ab_names()`, leaving names unchanged.")
message_("No columns with antibiotic results found for {.fun set_ab_names}, leaving names unchanged.")
return(data)
}
} else {
@@ -402,7 +424,7 @@ set_ab_names <- function(data, ..., property = "name", language = get_AMR_locale
)
if (any(x %in% c("", NA))) {
warning_(
"in `set_ab_names()`: no ", property, " found for column(s): ",
"in {.help [{.fun set_ab_names}](AMR::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)]
+6 -6
View File
@@ -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_("`x` and `reference` must be of same length, or `reference` must be of length 1.")
stop_("{.arg x} and {.arg reference} must be of same length, or {.arg 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 `age()`: NAs introduced for ages below 0.")
warning_("in {.fun age}: NAs introduced for ages below 0.")
}
if (any(ages > 120, na.rm = TRUE)) {
warning_("in `age()`: some ages are above 120.")
warning_("in {.fun 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 `age_groups()`: NAs introduced for ages below 0.")
warning_("in {.fun 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 `split_at`.") # only 0 is available
stop_if(length(split_at) == 1, "invalid value for {.arg 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)), "`names` must have the same length as the number of age groups (", length(levels(agegroups)), ").")
stop_ifnot(length(names) == length(levels(agegroups)), "{.arg names} must have the same length as the number of age groups (", length(levels(agegroups)), ").")
levels(agegroups) <- names
}
+62
View File
@@ -0,0 +1,62 @@
# ==================================================================== #
# 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, ...)
}
+58 -22
View File
@@ -352,6 +352,14 @@ 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, ...) {
@@ -417,6 +425,14 @@ 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, ...) {
@@ -425,6 +441,14 @@ 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, ...) {
@@ -450,6 +474,14 @@ 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, ...) {
@@ -646,7 +678,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("'", font_bold(agents, collapse = NULL), "'")
agents_formatted <- paste0("{.field ", 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], ")")
@@ -685,12 +717,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)")]
untreatable <- AMR_env$AB_lookup$ab[which(AMR_env$AB_lookup$name %like% "(-high|EDTA|polysorbate|macromethod|screening|nacubactam|inducible)")]
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 `", function_name, "()`: some drugs were ignored since they cannot be used for treatment: ",
"in {.help [{.fun ", function_name, "}](AMR::", 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,
@@ -713,9 +745,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(AMR_env$AB_lookup$group == "Antifungals")]
abx <- AMR_env$AB_lookup$ab[which(vapply(FUN.VALUE = logical(1), AMR_env$AB_lookup$group, function(x) "Antifungals" %in% x))]
} else if (isTRUE(function_name == "antimycobacterials")) {
abx <- AMR_env$AB_lookup$ab[which(AMR_env$AB_lookup$group == "Antimycobacterials")]
abx <- AMR_env$AB_lookup$ab[which(vapply(FUN.VALUE = logical(1), AMR_env$AB_lookup$group, function(x) "Antimycobacterials" %in% x))]
} 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
@@ -723,7 +755,11 @@ 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(custom_ab$group, custom_ab$atc_group1, custom_ab$atc_group2)
check_string <- paste0(
vapply(FUN.VALUE = character(1), custom_ab$group, function(x) paste(x, collapse = " ")),
custom_ab$atc_group1,
custom_ab$atc_group2
)
if (function_name == "betalactams") {
find_group <- "beta[-]?lactams"
} else if (function_name %like% "cephalosporins_") {
@@ -761,14 +797,14 @@ amr_select_exec <- function(function_name,
if (only_treatable == TRUE) {
if (message_not_thrown_before(function_name, "amr_class", "untreatable")) {
message_(
"in `", function_name, "()`: ",
"in {.help [{.fun ", function_name, "}](AMR::", function_name, ")}: ",
vector_and(
paste0(
ab_name(abx[abx %in% untreatable],
language = NULL,
tolower = TRUE
),
" (`", abx[abx %in% untreatable], "`)"
" ({.field ", font_bold(abx[abx %in% untreatable], collapse = NULL), "})"
),
quotes = FALSE,
sort = TRUE,
@@ -801,10 +837,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 data.table? Then add the argument `with = FALSE`, see our examples at `?amr_selector`.",
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)}.",
immediate = TRUE
)
cat("Class 'amr_selector'\n")
cat(format_inline_("Class {.cls amr_selector}\n"))
print(as.character(x), quote = FALSE)
}
@@ -819,10 +855,10 @@ c.amr_selector <- function(...) {
all_any_amr_selector <- function(type, ..., na.rm = TRUE) {
cols_ab <- c(...)
result <- cols_ab[toupper(cols_ab) %in% c("S", "SDD", "I", "R", "NI")]
result <- cols_ab[toupper(cols_ab) %in% VALID_SIR_LEVELS]
if (length(result) == 0) {
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")
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
}
cols_ab <- cols_ab[!cols_ab %in% result]
df <- get_current_data(arg_name = NA, call = -3)
@@ -901,7 +937,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 `all()` or `any()` to prevent this note."
". Wrap around {.fun all} or {.fun any} to prevent this note."
)
}
}
@@ -926,12 +962,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 `all()` or `any()` to prevent this note."
". Wrap around {.fun all} or {.fun any} to prevent this note."
)
}
}
# this is `!=`, so turn around the values
sir <- c("S", "SDD", "I", "R", "NI")
sir <- VALID_SIR_LEVELS
e2 <- sir[sir != e2]
structure(all_any_amr_selector(type = type, e1, e2),
class = c("amr_selector_any_all", "logical")
@@ -1001,11 +1037,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% " " &
AMR_env$AB_lookup$group %like% ab_group &
vapply(FUN.VALUE = character(1), AMR_env$AB_lookup$group, function(x) paste(x, collapse = " ")) %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((AMR_env$AB_lookup$group %like% ab_group |
drugs <- AMR_env$AB_lookup[which((vapply(FUN.VALUE = character(1), AMR_env$AB_lookup$group, function(x) paste(x, collapse = " ")) %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
@@ -1026,7 +1062,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 `", function_name, "()` no antimicrobial drugs found", examples, ".")
message_("For {.help [{.fun ", function_name, "}](AMR::", 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") {
@@ -1035,12 +1071,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("'", font_bold(agents, collapse = NULL), "'")
agents_formatted <- paste0("{.field ", 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 `", function_name, "(",
"For {.help [", function_name, "(",
ifelse(function_name == "amr_class",
paste0("\"", amr_class_args, "\""),
ifelse(!is.null(call),
@@ -1048,7 +1084,7 @@ message_agent_names <- function(function_name, agents, ab_group = NULL, examples
""
)
),
")` using ",
")](AMR::", function_name, ")} using ",
ifelse(length(agents) == 1, "column ", "columns "),
vector_and(agents_formatted, quotes = FALSE, sort = FALSE)
)
+209 -94
View File
@@ -48,13 +48,13 @@
#' - `carbapenems() + "GEN"`
#' - `carbapenems() + c("", "GEN")`
#' - `carbapenems() + c("", aminoglycosides())`
#' @param mo_transform A character to transform microorganism input - must be `"name"`, `"shortname"` (default), `"gramstain"`, or one of the column names of the [microorganisms] data set: `r vector_or(colnames(microorganisms), sort = FALSE, quotes = TRUE)`. Can also be `NULL` to not transform the input or `NA` to consider all microorganisms 'unknown'.
#' @param ab_transform A character to transform antimicrobial input - must be one of the column names of the [antimicrobials] data set (defaults to `"name"`): `r vector_or(colnames(antimicrobials), sort = FALSE, quotes = TRUE)`. Can also be `NULL` to not transform the input.
#' @param mo_transform A character to transform microorganism input - must be `"name"`, `"shortname"` (default), `"gramstain"`, or one of the column names of the [microorganisms] data set: `r vector_or(colnames(microorganisms), sort = FALSE, documentation = TRUE)`. Can also be `NULL` to not transform the input or `NA` to consider all microorganisms 'unknown'.
#' @param ab_transform A character to transform antimicrobial input - must be one of the column names of the [antimicrobials] data set (defaults to `"name"`): `r vector_or(colnames(antimicrobials), sort = FALSE, documentation = TRUE)`. Can also be `NULL` to not transform the input.
#' @param syndromic_group A column name of `x`, or values calculated to split rows of `x`, e.g. by using [ifelse()] or [`case_when()`][dplyr::case_when()]. See *Examples*.
#' @param add_total_n *(deprecated in favour of `formatting_type`)* A [logical] to indicate whether `n_tested` available numbers per pathogen should be added to the table (default is `TRUE`). This will add the lowest and highest number of available isolates per antimicrobial (e.g, if for *E. coli* 200 isolates are available for ciprofloxacin and 150 for amoxicillin, the returned number will be "150-200"). This option is unavailable when `wisca = TRUE`; in that case, use [retrieve_wisca_parameters()] to get the parameters used for WISCA.
#' @param only_all_tested (for combination antibiograms): a [logical] to indicate that isolates must be tested for all antimicrobials, see *Details*.
#' @param digits Number of digits to use for rounding the antimicrobial coverage, defaults to 1 for WISCA and 0 otherwise.
#' @param formatting_type Numeric value (122 for WISCA, 1-12 for non-WISCA) indicating how the 'cells' of the antibiogram table should be formatted. See *Details* > *Formatting Type* for a list of options.
#' @param formatting_type Numeric value (1-22 for WISCA, 1-12 for non-WISCA) indicating how the 'cells' of the antibiogram table should be formatted. See *Details* > *Formatting Type* for a list of options.
#' @param col_mo Column name of the names or codes of the microorganisms (see [as.mo()]) - the default is the first column of class [`mo`]. Values will be coerced using [as.mo()].
#' @param language Language to translate text, which defaults to the system language (see [get_AMR_locale()]).
#' @param minimum The minimum allowed number of available (tested) isolates. Any isolate count lower than `minimum` will return `NA` with a warning. The default number of `30` isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see *Source*.
@@ -65,6 +65,7 @@
#' @param simulations (for WISCA) a numerical value to set the number of Monte Carlo simulations.
#' @param conf_interval A numerical value to set confidence interval (default is `0.95`).
#' @param interval_side The side of the confidence interval, either `"two-tailed"` (default), `"left"` or `"right"`.
#' @param parallel A [logical] to indicate if parallel computing must be used, defaults to `FALSE`. Requires the [`future.apply`][future.apply::future_lapply()] package. For WISCA, Monte Carlo simulations are distributed across workers; for grouped antibiograms, each group is processed by a separate worker. **A non-sequential [future::plan()] must already be active before setting `parallel = TRUE`** -- for example, `future::plan(future::multisession)`. An error is thrown if `parallel = TRUE` is used without a plan set by the user.
#' @param info A [logical] to indicate info should be printed - the default is `TRUE` only in interactive mode.
#' @param object An [antibiogram()] object.
#' @param ... When used in [R Markdown or Quarto][knitr::kable()]: arguments passed on to [knitr::kable()] (otherwise, has no use).
@@ -163,7 +164,7 @@
#' antimicrobials = c("TZP", "TZP+TOB", "TZP+GEN"))
#' ```
#'
#' WISCA uses a sophisticated Bayesian decision model to combine both local and pooled antimicrobial resistance data. This approach not only evaluates local patterns but can also draw on multi-centre datasets to improve regimen accuracy, even in low-incidence infections like paediatric bloodstream infections (BSIs).
#' WISCA uses a sophisticated Bayesian decision model to combine both local and pooled antimicrobial resistance data. This approach not only evaluates local patterns but can also draw on multi-centre data sets to improve regimen accuracy, even in low-incidence infections like paediatric bloodstream infections (BSIs).
#'
#' ### Grouped tibbles
#'
@@ -413,6 +414,7 @@ antibiogram <- function(x,
conf_interval = 0.95,
interval_side = "two-tailed",
info = interactive(),
parallel = FALSE,
...) {
UseMethod("antibiogram")
}
@@ -439,13 +441,14 @@ antibiogram.default <- function(x,
conf_interval = 0.95,
interval_side = "two-tailed",
info = interactive(),
parallel = FALSE,
...) {
meet_criteria(x, allow_class = "data.frame")
x <- ascertain_sir_classes(x, "x")
meet_criteria(wisca, allow_class = "logical", has_length = 1)
if (isTRUE(wisca)) {
if (!is.null(mo_transform) && !missing(mo_transform)) {
warning_("WISCA must be based on the species level as WISCA parameters are based on this. For that reason, `mo_transform` will be ignored.")
warning_("WISCA must be based on the species level as WISCA parameters are based on this. For that reason, {.arg mo_transform} will be ignored.")
}
mo_transform <- function(x) suppressMessages(suppressWarnings(paste(mo_genus(x, keep_synonyms = TRUE, language = NULL), mo_species(x, keep_synonyms = TRUE, language = NULL))))
}
@@ -453,7 +456,7 @@ antibiogram.default <- function(x,
deprecation_warning("antibiotics", "antimicrobials", fn = "antibiogram", is_argument = TRUE)
antimicrobials <- list(...)$antibiotics
}
meet_criteria(antimicrobials, allow_class = c("character", "numeric", "integer"), allow_NA = FALSE, allow_NULL = FALSE)
meet_criteria(antimicrobials, allow_class = c("character", "numeric", "integer", "function"), allow_NA = FALSE, allow_NULL = FALSE)
if (!is.function(mo_transform)) {
meet_criteria(mo_transform, allow_class = "character", has_length = 1, is_in = c("name", "shortname", "gramstain", colnames(AMR::microorganisms)), allow_NULL = TRUE, allow_NA = TRUE)
}
@@ -478,11 +481,12 @@ antibiogram.default <- function(x,
meet_criteria(conf_interval, allow_class = c("numeric", "integer"), has_length = 1, is_finite = TRUE, is_positive = TRUE)
meet_criteria(interval_side, allow_class = "character", has_length = 1, is_in = c("two-tailed", "left", "right"))
meet_criteria(info, allow_class = "logical", has_length = 1)
meet_criteria(parallel, allow_class = "logical", has_length = 1)
# try to find columns based on type
if (is.null(col_mo)) {
col_mo <- search_type_in_df(x = x, type = "mo", info = info)
stop_if(is.null(col_mo), "`col_mo` must be set")
stop_if(is.null(col_mo), "{.arg col_mo} must be set")
}
# transform MOs
x$`.mo` <- x[, col_mo, drop = TRUE]
@@ -519,7 +523,11 @@ antibiogram.default <- function(x,
# get antimicrobials
ab_trycatch <- tryCatch(colnames(suppressWarnings(x[, antimicrobials, drop = FALSE])), error = function(e) NULL)
if (is.null(ab_trycatch)) {
stop_ifnot(is.character(suppressMessages(antimicrobials)), "`antimicrobials` must be an antimicrobial selector, or a character vector.")
# try with tidyverse
ab_trycatch <- tryCatch(colnames(dplyr::select(x, {{ antimicrobials }})), error = function(e) NULL)
}
if (is.null(ab_trycatch)) {
stop_ifnot(is.character(suppressMessages(antimicrobials)), "{.arg antimicrobials} must be an antimicrobial selector, or a character vector.")
antimicrobials.bak <- antimicrobials
# split antimicrobials on separator and make it a list
antimicrobials <- strsplit(gsub(" ", "", antimicrobials), "+", fixed = TRUE)
@@ -556,12 +564,11 @@ antibiogram.default <- function(x,
next
} else {
# determine whether this new column should contain S, I, R, or NA
S_values <- c("S", "WT")
if (isTRUE(combine_SI)) {
S_values <- c("S", "SDD", "I")
} else {
S_values <- "S"
S_values <- c(S_values, "SDD", "I")
}
other_values <- setdiff(c("S", "SDD", "I", "R"), S_values)
other_values <- setdiff(c("S", "SDD", "I", "R", "WT", "NWT", "NS"), S_values)
x_transposed <- as.list(as.data.frame(t(x[, abx, drop = FALSE]), stringsAsFactors = FALSE))
if (isTRUE(only_all_tested)) {
x[new_colname] <- as.sir(vapply(FUN.VALUE = character(1), x_transposed, function(x) ifelse(anyNA(x), NA_character_, ifelse(any(x %in% S_values), "S", "R")), USE.NAMES = FALSE))
@@ -580,9 +587,9 @@ antibiogram.default <- function(x,
if (length(existing_ab_combined_cols) > 0 && !is.null(ab_transform)) {
ab_transform <- NULL
warning_(
"Detected column name(s) containing the '+' character, which conflicts with the expected syntax in `antibiogram()`: the '+' is used to combine separate antimicrobial agent columns (e.g., \"AMP+GEN\").\n\n",
"To avoid incorrectly guessing which antimicrobials this represents, `ab_transform` was automatically set to `NULL`.\n\n",
"If this is unintended, please rename the column(s) to avoid using '+' in the name, or set `ab_transform = NULL` explicitly to suppress this message."
"Detected column name(s) containing the '+' character, which conflicts with the expected syntax in {.help [{.fun antibiogram}](AMR::antibiogram)}: the '+' is used to combine separate antimicrobial drug columns (e.g., \"AMP+GEN\").\n\n",
"To avoid incorrectly guessing which antimicrobials this represents, {.arg ab_transform} was automatically set to {.code NULL}.\n\n",
"If this is unintended, please rename the column(s) to avoid using '+' in the name, or set {.code ab_transform = NULL} explicitly to suppress this message."
)
}
antimicrobials <- ab_trycatch
@@ -611,13 +618,12 @@ antibiogram.default <- function(x,
counts <- out
out$n_susceptible <- out$S + out$WT
if (isTRUE(combine_SI)) {
out$n_susceptible <- out$S + out$I + out$SDD
} else {
out$n_susceptible <- out$S
out$n_susceptible <- out$n_susceptible + out$I + out$SDD
}
if (all(out$n_tested < minimum, na.rm = TRUE) && wisca == FALSE) {
warning_("All combinations had less than `minimum = ", minimum, "` results, returning an empty antibiogram")
warning_("All combinations had less than {.arg minimum} = ", minimum, " results, returning an empty antibiogram")
return(as_original_data_class(data.frame(), class(x), extra_class = "antibiogram"))
} else if (any(out$n_tested < minimum, na.rm = TRUE)) {
mins <- sum(out$n_tested < minimum, na.rm = TRUE)
@@ -625,7 +631,7 @@ antibiogram.default <- function(x,
out <- out %pm>%
subset(n_tested >= minimum)
if (isTRUE(info) && mins > 0) {
message_("NOTE: ", mins, " combinations had less than `minimum = ", minimum, "` results and were ignored", add_fn = font_red)
message_("NOTE: ", mins, " combinations had less than {.arg minimum} = ", minimum, " results and were ignored")
}
}
}
@@ -703,52 +709,113 @@ antibiogram.default <- function(x,
wisca_parameters <- out
progress <- progress_ticker(
n = length(unique(wisca_parameters$group)) * simulations,
n_min = 25,
print = info,
title = paste("Calculating WISCA for", length(unique(wisca_parameters$group)), "regimens")
)
on.exit(close(progress))
# run WISCA per group
for (group in unique(wisca_parameters$group)) {
params_current <- wisca_parameters[wisca_parameters$group == group, , drop = FALSE]
if (sum(params_current$n_tested, na.rm = TRUE) == 0) {
next
}
# prepare priors
priors_current <- create_wisca_priors(params_current)
# Monte Carlo simulations
coverage_simulations <- vapply(
FUN.VALUE = double(1),
seq_len(simulations), function(i) {
progress$tick()
simulate_coverage(priors_current)
}
)
# summarise results
coverage_mean <- mean(coverage_simulations)
if (interval_side == "two-tailed") {
probs <- c((1 - conf_interval) / 2, 1 - (1 - conf_interval) / 2)
} else if (interval_side == "left") {
probs <- c(0, conf_interval)
} else if (interval_side == "right") {
probs <- c(1 - conf_interval, 1)
}
coverage_ci <- unname(stats::quantile(coverage_simulations, probs = probs))
out_wisca$coverage[out_wisca$group == group] <- coverage_mean
out_wisca$lower_ci[out_wisca$group == group] <- coverage_ci[1]
out_wisca$upper_ci[out_wisca$group == group] <- coverage_ci[2]
# quantile probabilities are constant across all groups
probs <- if (interval_side == "two-tailed") {
c((1 - conf_interval) / 2, 1 - (1 - conf_interval) / 2)
} else if (interval_side == "left") {
c(0, conf_interval)
} else {
c(1 - conf_interval, 1)
}
close(progress)
unique_groups <- unique(wisca_parameters$group)
# parallel gate for WISCA - identical pattern to as.sir()
if (requireNamespace("future.apply", quietly = TRUE) && !inherits(future::plan(), "sequential")) {
if (isFALSE(parallel)) {
message_("Assuming {.code parallel = TRUE} since parallel computing has been set up using the {.pkg future} package before. Set {.help [{.fun plan}](future::plan)} to sequential to prevent this.")
}
parallel <- TRUE
}
if (isTRUE(parallel)) {
stop_ifnot(
requireNamespace("future.apply", quietly = TRUE),
"Setting {.code parallel = TRUE} requires the {.pkg future.apply} package.\n",
"Install it with {.code install.packages(\"future.apply\")}."
)
stop_if(inherits(future::plan(), "sequential"),
"Setting {.code parallel = TRUE} requires a non-sequential {.help [{.fun future::plan}](future::plan)} to be active.\n",
"For your system, you could first run: {.code library(future); ",
ifelse(.Platform$OS.type == "windows" || in_rstudio(),
"plan(multisession)",
"plan(multicore)"
),
"}",
call = FALSE
)
n_workers <- future::nbrOfWorkers()
} else {
n_workers <- 1L
}
use_parallel_wisca <- isTRUE(parallel) && n_workers > 1L && length(unique_groups) > 0L
if (use_parallel_wisca) {
if (isTRUE(info)) {
message_("Running WISCA in parallel mode using ", n_workers, " workers...", as_note = FALSE, appendLF = FALSE)
}
# chunks_per_group gives ~n_workers total jobs so all workers stay busy
# even when the number of regimens is smaller than n_workers
chunks_per_group <- max(1L, ceiling(n_workers / length(unique_groups)))
chunk_sizes <- diff(c(0L, round(seq_len(chunks_per_group) * simulations / chunks_per_group)))
# precompute priors per group and build (group, chunk) job list
jobs <- unlist(lapply(unique_groups, function(g) {
params_g <- wisca_parameters[wisca_parameters$group == g, , drop = FALSE]
if (sum(params_g$n_tested, na.rm = TRUE) == 0L) return(NULL)
priors_g <- create_wisca_priors(params_g)
lapply(seq_along(chunk_sizes), function(ch) {
list(group = g, priors = priors_g, n_sims = chunk_sizes[ch])
})
}), recursive = FALSE)
jobs <- Filter(Negate(is.null), jobs)
flat <- future.apply::future_lapply(jobs, function(job) {
vapply(FUN.VALUE = double(1), seq_len(job$n_sims), function(i) {
simulate_coverage(job$priors)
})
}, future.seed = TRUE)
# reassemble per group: concatenate chunks, then summarise
for (g in unique_groups) {
g_idx <- vapply(jobs, function(j) identical(j$group, g), logical(1))
if (!any(g_idx)) next
sims <- unlist(flat[g_idx], use.names = FALSE)
out_wisca$coverage[out_wisca$group == g] <- mean(sims)
ci_vals <- unname(stats::quantile(sims, probs = probs))
out_wisca$lower_ci[out_wisca$group == g] <- ci_vals[1]
out_wisca$upper_ci[out_wisca$group == g] <- ci_vals[2]
}
if (isTRUE(info)) message_(font_green_bg(" DONE "), as_note = FALSE)
} else {
progress <- progress_ticker(
n = length(unique_groups) * simulations,
n_min = 25,
print = info,
title = paste("Calculating WISCA for", length(unique_groups), "regimens")
)
on.exit(close(progress), add = TRUE)
for (group in unique_groups) {
params_current <- wisca_parameters[wisca_parameters$group == group, , drop = FALSE]
if (sum(params_current$n_tested, na.rm = TRUE) == 0) next
priors_current <- create_wisca_priors(params_current)
coverage_simulations <- vapply(
FUN.VALUE = double(1),
seq_len(simulations), function(i) {
progress$tick()
simulate_coverage(priors_current)
}
)
out_wisca$coverage[out_wisca$group == group] <- mean(coverage_simulations)
ci_vals <- unname(stats::quantile(coverage_simulations, probs = probs))
out_wisca$lower_ci[out_wisca$group == group] <- ci_vals[1]
out_wisca$upper_ci[out_wisca$group == group] <- ci_vals[2]
}
close(progress)
}
# final output preparation
out <- out_wisca
@@ -810,7 +877,7 @@ antibiogram.default <- function(x,
# 21. 5 (4-6,N=15/300)
# 22. 5% (4-6%,N=15/300)
if (wisca == TRUE && !formatting_type %in% c(1, 2, 13, 14) && info == TRUE && message_not_thrown_before("antibiogram", wisca, formatting_type)) {
message_("Using WISCA with a `formatting_type` that includes the denominator is not useful")
message_("Using WISCA with a {.arg formatting_type} that includes the denominator is not useful")
}
out$digits <- digits # since pm_sumarise() cannot work with an object outside the current frame
if (formatting_type == 1) out <- out %pm>% pm_summarise(out_value = round(coverage * 100, digits = digits))
@@ -995,30 +1062,50 @@ antibiogram.grouped_df <- function(x,
conf_interval = 0.95,
interval_side = "two-tailed",
info = interactive(),
parallel = FALSE,
...) {
stop_ifnot(is.null(mo_transform), "`mo_transform` must not be set if creating an antibiogram using a grouped tibble. The groups will become the variables over which the antimicrobials are calculated, which could include the pathogen information (though not necessary). Nonetheless, this makes `mo_transform` redundant.", call = FALSE)
stop_ifnot(is.null(syndromic_group), "`syndromic_group` must not be set if creating an antibiogram using a grouped tibble. The groups will become the variables over which the antimicrobials are calculated, making `syndromic_groups` redundant.", call = FALSE)
stop_ifnot(is.null(mo_transform), "{.arg mo_transform} must not be set if creating an antibiogram using a grouped tibble. The groups will become the variables over which the antimicrobials are calculated, which could include the pathogen information (though not necessary). Nonetheless, this makes {.arg mo_transform} redundant.", call = FALSE)
stop_ifnot(is.null(syndromic_group), "{.arg syndromic_group} must not be set if creating an antibiogram using a grouped tibble. The groups will become the variables over which the antimicrobials are calculated, making {.arg syndromic_group} redundant.", call = FALSE)
meet_criteria(parallel, allow_class = "logical", has_length = 1)
groups <- attributes(x)$groups
n_groups <- NROW(groups)
progress <- progress_ticker(
n = n_groups,
n_min = 5,
print = info,
title = paste("Calculating AMR for", n_groups, "groups")
)
on.exit(close(progress))
out <- NULL
wisca_parameters <- NULL
long_numeric <- NULL
for (i in seq_len(n_groups)) {
progress$tick()
rows <- unlist(groups[i, ]$.rows)
if (length(rows) == 0) {
next
# parallel gate - identical pattern to as.sir()
if (requireNamespace("future.apply", quietly = TRUE) && !inherits(future::plan(), "sequential")) {
if (isFALSE(parallel)) {
message_("Assuming {.code parallel = TRUE} since parallel computing has been set up using the {.pkg future} package before. Set {.help [{.fun plan}](future::plan)} to sequential to prevent this.")
}
new_out <- antibiogram(as.data.frame(x)[rows, , drop = FALSE],
parallel <- TRUE
}
if (isTRUE(parallel)) {
stop_ifnot(
requireNamespace("future.apply", quietly = TRUE),
"Setting {.code parallel = TRUE} requires the {.pkg future.apply} package.\n",
"Install it with {.code install.packages(\"future.apply\")}."
)
stop_if(inherits(future::plan(), "sequential"),
"Setting {.code parallel = TRUE} requires a non-sequential {.help [{.fun future::plan}](future::plan)} to be active.\n",
"For your system, you could first run: {.code library(future); ",
ifelse(.Platform$OS.type == "windows" || in_rstudio(),
"plan(multisession)",
"plan(multicore)"
),
"}",
call = FALSE
)
n_workers <- future::nbrOfWorkers()
} else {
n_workers <- 1L
}
use_parallel <- isTRUE(parallel) && n_workers > 1L && n_groups > 1L
x_df <- as.data.frame(x)
run_group <- function(i) {
rows <- unlist(groups[i, ]$.rows)
if (length(rows) == 0L) return(NULL)
antibiogram(x_df[rows, , drop = FALSE],
antimicrobials = antimicrobials,
mo_transform = NULL,
ab_transform = ab_transform,
@@ -1038,12 +1125,42 @@ antibiogram.grouped_df <- function(x,
conf_interval = conf_interval,
interval_side = interval_side,
info = FALSE,
...
parallel = FALSE # never nest parallelism in workers
)
}
if (use_parallel) {
if (isTRUE(info)) {
message_("Running antibiogram for ", n_groups, " groups in parallel using ", n_workers, " workers...", as_note = FALSE, appendLF = FALSE)
}
results_raw <- future.apply::future_lapply(seq_len(n_groups), run_group, future.seed = TRUE)
if (isTRUE(info)) message_(font_green_bg(" DONE "), as_note = FALSE)
} else {
progress <- progress_ticker(
n = n_groups,
n_min = 5,
print = info,
title = paste("Calculating AMR for", n_groups, "groups")
)
on.exit(close(progress), add = TRUE)
results_raw <- vector("list", n_groups)
for (i in seq_len(n_groups)) {
progress$tick()
results_raw[[i]] <- run_group(i)
}
close(progress)
}
out <- NULL
wisca_parameters <- NULL
long_numeric <- NULL
for (i in seq_len(n_groups)) {
new_out <- results_raw[[i]]
new_wisca_parameters <- attributes(new_out)$wisca_parameters
new_long_numeric <- attributes(new_out)$long_numeric
if (NROW(new_out) == 0) {
if (is.null(new_out) || NROW(new_out) == 0) {
next
}
@@ -1069,8 +1186,7 @@ antibiogram.grouped_df <- function(x,
new_long_numeric <- new_long_numeric[, c(col_name, setdiff(names(new_long_numeric), col_name))] # set place to 1st col
}
if (i == 1) {
# the first go
if (is.null(out)) {
out <- new_out
wisca_parameters <- new_wisca_parameters
long_numeric <- new_long_numeric
@@ -1081,8 +1197,6 @@ antibiogram.grouped_df <- function(x,
}
}
close(progress)
out <- structure(as_original_data_class(out, class(x), extra_class = "antibiogram"),
has_syndromic_group = FALSE,
combine_SI = isTRUE(combine_SI),
@@ -1114,6 +1228,7 @@ wisca <- function(x,
conf_interval = 0.95,
interval_side = "two-tailed",
info = interactive(),
parallel = FALSE,
...) {
antibiogram(
x = x,
@@ -1135,6 +1250,7 @@ wisca <- function(x,
conf_interval = conf_interval,
interval_side = interval_side,
info = info,
parallel = parallel,
...
)
}
@@ -1196,7 +1312,7 @@ simulate_coverage <- function(params) {
#' @param wisca_model The outcome of [wisca()] or [`antibiogram(..., wisca = TRUE)`][antibiogram()].
#' @rdname antibiogram
retrieve_wisca_parameters <- function(wisca_model, ...) {
stop_ifnot(isTRUE(attributes(wisca_model)$wisca), "This function only applies to WISCA models. Use `wisca()` or `antibiogram(..., wisca = TRUE)` to create a WISCA model.")
stop_ifnot(isTRUE(attributes(wisca_model)$wisca), "This function only applies to WISCA models. Use {.help [{.fun wisca}](AMR::wisca)} or {.help [{.fun antibiogram}](AMR::antibiogram)} (with {.code wisca = TRUE}) to create a WISCA model.")
attributes(wisca_model)$wisca_parameters
}
@@ -1204,7 +1320,7 @@ retrieve_wisca_parameters <- function(wisca_model, ...) {
#' @rawNamespace if(getRversion() >= "3.0.0") S3method(pillar::tbl_sum, antibiogram)
tbl_sum.antibiogram <- function(x, ...) {
dims <- paste(format(NROW(x), big.mark = ","), AMR_env$cross_icon, format(NCOL(x), big.mark = ","))
names(dims) <- "An Antibiogram"
names(dims) <- "An antibiogram"
if (isTRUE(attributes(x)$wisca)) {
dims <- c(dims, Type = paste0("WISCA with ", attributes(x)$conf_interval * 100, "% CI"))
} else if (isTRUE(attributes(x)$formatting_type >= 13)) {
@@ -1224,8 +1340,7 @@ tbl_format_footer.antibiogram <- function(x, ...) {
}
c(footer, font_subtle(paste0(
"# Use `ggplot2::autoplot()` or base R `plot()` to create a plot of this antibiogram,\n",
"# or use it directly in R Markdown or ",
font_url("https://quarto.org", "Quarto"), ", see ", word_wrap("?antibiogram")
"# or use it directly in R Markdown or Quarto, see ", word_wrap("?antibiogram")
)))
}
+3 -3
View File
@@ -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))) {
atc_code <- as.character(ab_atc(atc_code, only_first = TRUE))
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))
}
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_("in `atc_online_property()`: no properties found for ATC ", atc_code[i], ". Please check ", font_url(atc_url, "this WHOCC webpage"), ".")
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}.")
returnvalue[i] <- NA
next
}
+6 -6
View File
@@ -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://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm}
#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{https://health.ec.europa.eu/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 `as.av()`: these ATC codes are not (yet) in the antivirals data set: ",
"in {.help [{.fun as.av}](AMR::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 `as.av()`: these values could not be coerced to a valid antiviral drug ID: ",
"in {.help [{.fun as.av}](AMR::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("+", font_subtle("+"), out[!is.na(x)], fixed = TRUE)
out[is.na(x)] <- font_na(NA)
out[!is.na(x)] <- gsub("+", pillar::style_subtle("+"), out[!is.na(x)], fixed = TRUE)
out[is.na(x)] <- pillar::style_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("Class 'av'\n")
cat(format_inline_("Class {.cls av}\n"))
print(as.character(x), quote = FALSE)
}
+1 -1
View File
@@ -168,7 +168,7 @@ av_from_text <- function(text,
}
})
} else {
stop_("`type` must be either 'drug', 'dose' or 'administration'")
stop_("{.arg type} must be either {.val drug}, {.val dose} or {.val administration}")
}
# collapse text if needed
+5 -5
View File
@@ -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: `vector_or(colnames(antivirals), sort = FALSE)`.
#' @param property One of the column names of one of the [antivirals] data set: `r vector_or(colnames(antivirals), documentation = TRUE, 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 `av_ddd()`: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
"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.",
"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 `av_ddd_units()`: DDDs of some combined products are available for different dose combinations and not (yet) part of the AMR package.",
"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.",
"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 `av_url()`: no ATC code available for ", vector_and(NAs, quotes = FALSE), ".")
warning_("in {.fun 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 `av_url()`: only the first URL will be opened, as `browseURL()` only suports one string.")
warning_("in {.fun av_url}: only the first URL will be opened, as {.fun browseURL} only suports one string.")
}
if (!is.na(u[1L])) {
utils::browseURL(u[1L])
+34 -16
View File
@@ -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", and "total".
#' @return The function [bug_drug_combinations()] returns a [data.frame] with columns "mo", "ab", "S", "SDD", "I", "R", "WT, "NWT", 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), "`col_mo` must be set")
stop_if(is.null(col_mo), "{.arg col_mo} must be set")
} else {
stop_ifnot(col_mo %in% colnames(x), "column '", col_mo, "' (`col_mo`) not found")
stop_ifnot(col_mo %in% colnames(x), "column {.field ", font_bold(col_mo), "} ({.arg col_mo}) not found")
}
x.bak <- x
@@ -111,6 +111,8 @@ 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
@@ -127,13 +129,21 @@ 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 = m["S", ],
SDD = m["SDD", ],
I = m["I", ],
R = m["R", ],
NI = m["NI", ],
na = m[which(is.na(rownames(m))), ],
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)),
stringsAsFactors = FALSE
)
})
@@ -146,8 +156,11 @@ bug_drug_combinations <- function(x,
I = merged$I,
R = merged$R,
NI = merged$NI,
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,
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,
stringsAsFactors = FALSE
)
if (data_has_groups) {
@@ -218,7 +231,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 `format()`: formatting the output of `bug_drug_combinations()` does not support grouped variables, they were ignored")
warning_("in {.fun format}: formatting the output of {.fun 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(
@@ -229,12 +242,17 @@ 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$NI[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)
}),
stringsAsFactors = FALSE
)
@@ -246,10 +264,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$R
} else {
x$isolates <- x$R + x$I + x$SDD
x$isolates <- x$isolates + x$I + x$SDD
}
give_ab_name <- function(ab, format, language) {
+36 -11
View File
@@ -33,13 +33,16 @@
#'
#' [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 [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 [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_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
@@ -119,10 +122,21 @@
#' count_df(translate = FALSE)
#' }
#' }
count_resistant <- function(..., only_all_tested = FALSE) {
count_resistant <- function(...,
only_all_tested = FALSE,
guideline = getOption("AMR_guideline", "EUCAST")) {
# other arguments for meet_criteria are handled by sir_calc()
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.")
}
tryCatch(
sir_calc(...,
ab_result = "R",
ab_result = c(
"R", "NWT", "NS",
if (identical(guideline, "CLSI")) "I"
),
only_all_tested = only_all_tested,
only_count = TRUE
),
@@ -132,10 +146,21 @@ count_resistant <- function(..., only_all_tested = FALSE) {
#' @rdname count
#' @export
count_susceptible <- function(..., only_all_tested = FALSE) {
count_susceptible <- function(...,
only_all_tested = FALSE,
guideline = getOption("AMR_guideline", "EUCAST")) {
# other arguments for meet_criteria are handled by sir_calc()
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.")
}
tryCatch(
sir_calc(...,
ab_result = c("S", "SDD", "I"),
ab_result = c(
"S", "SDD", "WT",
if (identical(guideline, "EUCAST")) "I"
),
only_all_tested = only_all_tested,
only_count = TRUE
),
@@ -161,7 +186,7 @@ count_S <- function(..., only_all_tested = FALSE) {
count_SI <- function(..., only_all_tested = FALSE) {
tryCatch(
sir_calc(...,
ab_result = c("S", "SDD", "I"),
ab_result = c("S", "SDD", "I", "WT"),
only_all_tested = only_all_tested,
only_count = TRUE
),
@@ -187,7 +212,7 @@ count_I <- function(..., only_all_tested = FALSE) {
count_IR <- function(..., only_all_tested = FALSE) {
tryCatch(
sir_calc(...,
ab_result = c("I", "SDD", "R"),
ab_result = c("I", "SDD", "R", "NWT"),
only_all_tested = only_all_tested,
only_count = TRUE
),
@@ -200,7 +225,7 @@ count_IR <- function(..., only_all_tested = FALSE) {
count_R <- function(..., only_all_tested = FALSE) {
tryCatch(
sir_calc(...,
ab_result = "R",
ab_result = c("R", "NWT", "NS"),
only_all_tested = only_all_tested,
only_count = TRUE
),
@@ -213,7 +238,7 @@ count_R <- function(..., only_all_tested = FALSE) {
count_all <- function(..., only_all_tested = FALSE) {
tryCatch(
sir_calc(...,
ab_result = c("S", "SDD", "I", "R", "NI"),
ab_result = VALID_SIR_LEVELS,
only_all_tested = only_all_tested,
only_count = TRUE
),
+2 -2
View File
@@ -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 `antimicrobials` data set.")
message_("Added ", nr2char(nrow(x)), " record", ifelse(nrow(x) > 1, "s", ""), " to the internal {.code 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 `antimicrobials` data set.")
message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal {.help [antimicrobials](AMR::antimicrobials)} data set.")
}
+7 -7
View File
@@ -80,7 +80,7 @@
#'
#' ### 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)`. 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, documentation = TRUE)`. 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_eucast_rules(
@@ -150,15 +150,15 @@ custom_eucast_rules <- function(...) {
)
stop_if(
identical(dots, "error"),
"rules must be a valid formula inputs (e.g., using '~'), see `?custom_eucast_rules`"
"rules must be a valid formula inputs (e.g., using '~'), see {.help [{.fun custom_eucast_rules}](AMR::custom_eucast_rules)}"
)
n_dots <- length(dots)
stop_if(n_dots == 0, "no custom rules were set. Please read the documentation using `?custom_eucast_rules`.")
stop_if(n_dots == 0, "no custom rules were set. Please read the documentation using {.help [{.fun custom_eucast_rules}](AMR::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 `?custom_eucast_rules`"
"rule ", i, " must be a valid formula input (e.g., using '~'), see {.help [{.fun custom_eucast_rules}](AMR::custom_eucast_rules)}"
)
# Query
@@ -180,7 +180,7 @@ custom_eucast_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 `?custom_eucast_rules`"
"the result of rule ", i, " (the part after the `~`) must contain `==`, such as in `... ~ ampicillin == \"R\"`, see {.help [{.fun custom_eucast_rules}](AMR::custom_eucast_rules)}"
)
result_group <- as.character(result)[[2]]
result_group <- as.character(str2lang(result_group))
@@ -220,8 +220,8 @@ custom_eucast_rules <- function(...) {
result_value <- as.character(result)[[3]]
result_value[result_value == "NA"] <- NA
stop_ifnot(
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 %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 <- as.sir(result_value)
+11 -12
View File
@@ -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 `?mdro`"
"rules must be a valid formula inputs (e.g., using '~'), see {.help [{.fun mdro}](AMR::mdro)}"
)
n_dots <- length(dots)
stop_if(n_dots == 0, "no custom rules were set. Please read the documentation using `?mdro`.")
stop_if(n_dots == 0, "no custom rules were set. Please read the documentation using {.help [{.fun mdro}](AMR::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 `?mdro`"
"rule ", i, " must be a valid formula input (e.g., using '~'), see {.help [{.fun mdro}](AMR::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 `custom_mdro_guideline()`",
"for combining custom MDRO guidelines, all rules must be created with {.help [{.fun custom_mdro_guideline}](AMR::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(" ", i, ". ", font_bold("If "), font_blue(rule$query), font_bold(" then: "), font_red(rule$value), "\n", sep = "")
cat("\u00a0\u00a0", i, ". ", font_bold("If "), font_blue(rule$query), font_bold(" then: "), font_red(rule$value), "\n", sep = "")
}
cat(" ", i + 1, ". ", font_bold("Otherwise: "), font_red(paste0("Negative")), "\n", sep = "")
cat("\u00a0\u00a0", 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,16 +259,15 @@ run_custom_mdro_guideline <- function(df, guideline, info) {
}
)
if (identical(qry, "error")) {
warning_("in `custom_mdro_guideline()`: rule ", i,
" (`", as.character(guideline[[i]]$query), "`) was ignored because of this error message: ",
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: ",
AMR_env$err_msg,
call = FALSE,
add_fn = font_red
call = FALSE
)
next
}
stop_ifnot(is.logical(qry), "in custom_mdro_guideline(): rule ", i, " (`", guideline[[i]]$query,
"`) must return `TRUE` or `FALSE`, not ",
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 ",
format_class(class(qry), plural = FALSE),
call = FALSE
)
+4 -4
View File
@@ -128,7 +128,7 @@
#' }
add_custom_microorganisms <- function(x) {
meet_criteria(x, allow_class = "data.frame")
stop_ifnot("genus" %in% tolower(colnames(x)), paste0("`x` must contain column 'genus'."))
stop_ifnot("genus" %in% tolower(colnames(x)), "{.arg x} must contain column {.code genus}.")
add_MO_lookup_to_AMR_env()
@@ -281,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 `microorganisms` data set.")
message_("Added ", vector_and(italicise(x$fullname), quotes = FALSE), " to the internal {.code microorganisms} data set.")
} else {
message_("Added ", nr2char(nrow(x)), " records to the internal `microorganisms` data set.")
message_("Added ", nr2char(nrow(x)), " records to the internal {.code microorganisms} data set.")
}
}
@@ -303,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 `microorganisms` data set.")
message_("Cleared ", nr2char(n - n2), " custom record", ifelse(n - n2 > 1, "s", ""), " from the internal {.code microorganisms} data set.")
}
abbreviate_mo <- function(x, minlength = 5, prefix = "", hyphen_as_space = FALSE, ...) {
+14 -14
View File
@@ -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 A short and concise group name, based on WHONET and WHOCC definitions
#' - `group`\cr One or more short and concise group names, 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"`
@@ -106,12 +106,12 @@
#' @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)`
#' - `status` \cr Status of the taxon, either `r vector_or(microorganisms$status, documentation = TRUE)`
#' - `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 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*)
#' - `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$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, documentation = TRUE)` (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
@@ -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)`
#' - `ward`\cr Ward type where the patient was admitted, either `r vector_or(example_isolates$ward)`
#' - `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)`
#' - `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 dataset contain 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 data set contains 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)`
#' - `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)`
#' - `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)`
#' - `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, 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.
#' 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.
#'
#' 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.
#'
@@ -350,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)`
#' - `type`\cr Type of the dosage, either `r vector_or(dosage$type, documentation = TRUE)`
#' - `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)`
#' - `administration`\cr Route of administration, either `r vector_or(dosage$administration, documentation = TRUE)`
#' - `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)`
@@ -368,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 agents, transformed to class [`mic`] (see [as.mic()])
#' - `AMC:COL`\cr MIC values for 17 antimicrobial drugs, transformed to class [`mic`] (see [as.mic()])
#' @details See our [tidymodels integration][amr-tidymodels] for an example using this data set.
#' @examples
#' esbl_isolates
+11 -9
View File
@@ -119,9 +119,9 @@ as.disk <- function(x, na.rm = FALSE) {
sort() %pm>%
vector_and(quotes = TRUE)
cur_col <- get_current_column()
warning_("in `as.disk()`: ", na_after - na_before, " result",
warning_("in {.help [{.fun as.disk}](AMR::as.disk)}: ", na_after - na_before, " result",
ifelse(na_after - na_before > 1, "s", ""),
ifelse(is.null(cur_col), "", paste0(" in index '", cur_col, "'")),
ifelse(is.null(cur_col), "", paste0(" in column {.field ", font_bold(cur_col, collapse = NULL), "}")),
" truncated (",
round(((na_after - na_before) / length(x)) * 100),
"%) that were invalid disk zones: ",
@@ -162,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)] <- font_na(NA)
out[is.na(x)] <- pillar::style_na(NA)
create_pillar_column(out, align = "right", width = 2)
}
@@ -170,7 +170,7 @@ pillar_shaft.disk <- function(x, ...) {
#' @export
#' @noRd
print.disk <- function(x, ...) {
cat("Class 'disk'\n")
cat(format_inline_("Class {.cls disk}\n"))
print(as.integer(x), quote = FALSE)
}
@@ -236,12 +236,14 @@ 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",
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(.)))
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)
)
}
+38 -43
View 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,21 +89,29 @@
#' | - Major difference in any antimicrobial result | - `first_isolate(x, type = "points")` |
#' | - Any difference in key antimicrobial results | - `first_isolate(x, type = "keyantimicrobials")` |
#'
#' ### Isolate-based
#' **Isolate-based**
#'
#' _Minimum variables required: Microorganism identifier_
#'
#' 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**
#'
#' 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.
#' _Minimum variables required: Microorganism identifier, Patient identifier_
#'
#' ### Episode-based
#' 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.
#'
#' 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.
#' **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.
#'
#' 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
#' **Phenotype-based**
#'
#' _Minimum variables required: Microorganism identifier, Patient identifier, Date, Antimicrobial test results_
#'
#' 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:
#'
@@ -238,7 +246,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% c("S", "SDD", "I", "R", "NI"), na.rm = TRUE),
FUN = function(x) any(as.character(x[1:10000]) %in% VALID_SIR_LEVELS, na.rm = TRUE),
USE.NAMES = FALSE
))
if (method == "phenotype-based" && !any_col_contains_sir) {
@@ -255,8 +263,7 @@ first_isolate <- function(x = NULL,
),
""
)
),
add_fn = font_red
)
)
}
@@ -264,7 +271,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), "`col_mo` must be set")
stop_if(is.null(col_mo), "{.arg col_mo} must be set")
}
# methods ----
@@ -301,7 +308,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), "`col_date` must be set")
stop_if(is.null(col_date), "{.arg col_date} must be set")
}
# -- patient id
@@ -310,11 +317,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 `col_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}")
} else {
col_patient_id <- search_type_in_df(x = x, type = "patient_id", info = info)
}
stop_if(is.null(col_patient_id), "`col_patient_id` must be set")
stop_if(is.null(col_patient_id), "{.arg col_patient_id} must be set")
}
# -- specimen
@@ -326,7 +333,7 @@ first_isolate <- function(x = NULL,
check_columns_existance <- function(column, tblname = x) {
if (!is.null(column)) {
stop_ifnot(column %in% colnames(tblname),
"Column '", column, "' not found.",
"Column {.code ", column, "} not found.",
call = FALSE
)
}
@@ -355,9 +362,7 @@ 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),
add_fn = font_red
)
message_("Excluding test codes: ", vector_and(testcodes_exclude, quotes = TRUE))
}
if (is.null(col_specimen)) {
@@ -368,9 +373,7 @@ 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, "'",
add_fn = font_red
)
message_("Excluding other than specimen group '", specimen_group, "'")
}
}
if (!is.null(col_keyantimicrobials)) {
@@ -412,7 +415,6 @@ 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
)
}
@@ -421,7 +423,6 @@ 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
)
}
@@ -429,9 +430,8 @@ 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)) {
message_("=> Found ", font_bold(paste(length(c(row.start:row.end)), "first isolates")),
", as all isolates were different microbial species",
add_fn = font_black,
n_rows <- length(c(row.start:row.end))
message_("=> Found {.strong ", n_rows, " first isolates}, as all isolates were different microbial species",
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",
add_fn = font_red
"ignoring I"
)
}
if (type == "points") {
message_("Basing inclusion on all antimicrobial results, using a points threshold of ",
points_threshold,
add_fn = font_red
message_(
"Basing inclusion on all antimicrobial results, using a points threshold of ",
points_threshold
)
}
}
@@ -516,9 +516,7 @@ 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.",
add_fn = font_red
)
message_("Excluding ", format(sum(x$newvar_is_icu, na.rm = TRUE), decimal.mark = decimal.mark, big.mark = big.mark), " isolates from ICU.")
}
x[which(x$newvar_is_icu), "newvar_first_isolate"] <- FALSE
} else if (isTRUE(info)) {
@@ -542,9 +540,8 @@ first_isolate <- function(x = NULL,
paste0('"', x, '"')
}
})
message_("\nGroup: ", paste0(names(group), " = ", group, collapse = ", "), "\n",
as_note = FALSE,
add_fn = font_red
message_("\nGroup: ", toString(paste0(names(group), " = ", group)), "\n",
as_note = FALSE
)
}
}
@@ -557,8 +554,7 @@ 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 '", font_bold(col_mo), "')",
add_fn = font_red
" isolates with a microbial ID 'UNKNOWN' (in column {.field ", font_bold(col_mo), "})"
)
}
x[which(x$newvar_mo == "UNKNOWN"), "newvar_first_isolate"] <- include_unknown
@@ -569,8 +565,7 @@ 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 '", font_bold(col_mo), "')",
add_fn = font_red
" isolates with a microbial ID `NA` (in column {.field ", font_bold(col_mo), "})"
)
}
x[which(is.na(x$newvar_mo)), "newvar_first_isolate"] <- FALSE
@@ -616,7 +611,7 @@ first_isolate <- function(x = NULL,
),
p_found_total, " of total where a microbial ID was available)"
),
add_fn = font_black, as_note = FALSE
as_note = FALSE
)
}
+1 -1
View 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 `episode_days` or argument `case_free_days` must be set.",
"either argument {.arg episode_days} or argument {.arg case_free_days} must be set.",
call = -2
)
+1 -1
View File
@@ -295,7 +295,7 @@ geom_sir <- function(position = NULL,
...) {
x <- x[1]
stop_ifnot_installed("ggplot2")
stop_if(is.data.frame(position), "`position` is invalid. Did you accidentally use '%>%' instead of '+'?")
stop_if(is.data.frame(position), "{.arg position} is invalid. Did you accidentally use {.code %>%} instead of {.code +}?")
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)
+10 -12
View File
@@ -79,7 +79,6 @@ 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
)
}
@@ -87,7 +86,7 @@ guess_ab_col <- function(x = NULL, search_string = NULL, verbose = FALSE, only_s
} else {
if (isTRUE(verbose)) {
message_(
"Using column '", font_bold(ab_result), "' as input for ", search_string,
"Using column {.field ", font_bold(ab_result), "} as input for ", search_string,
" (", ab_name(search_string, language = NULL, tolower = TRUE), ")."
)
}
@@ -147,7 +146,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)) {
if (isTRUE(info) && message_not_thrown_before("get_column_abx", colnames(x))) {
message_("Auto-guessing columns suitable for analysis", appendLF = FALSE, as_note = FALSE)
}
@@ -211,7 +210,7 @@ get_column_abx <- function(x,
newnames <- suppressWarnings(as.ab(names(dots), info = FALSE))
if (anyNA(newnames)) {
if (isTRUE(info)) {
message_(paste0(font_yellow(font_bold(" WARNING: ")), "some columns returned `NA` for `as.ab()`"), as_note = FALSE)
message_("WARNING: some columns returned NA for {.help [{.fun as.ab}](AMR::as.ab)}", as_note = FALSE)
}
warning_("Invalid antibiotic reference(s): ", vector_and(names(dots)[is.na(newnames)], quotes = FALSE),
call = FALSE,
@@ -222,7 +221,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", add_fn = list(font_red, font_bold), as_note = FALSE)
message_(" ERROR", as_note = FALSE)
}
stop_("Column(s) not found: ", vector_and(unlist(dots[[unexisting_cols]]), quotes = FALSE),
call = FALSE
@@ -266,17 +265,17 @@ get_column_abx <- function(x,
if (isTRUE(info)) {
if (all_okay == TRUE) {
message_(" OK.", add_fn = list(font_green, font_bold), as_note = FALSE)
message_(" OK.", as_note = FALSE)
} else if (!isFALSE(dups)) {
message_(paste0(font_yellow(font_bold(" WARNING: ")), "some results from `as.ab()` are duplicated: ", vector_and(dups, quotes = "`")), as_note = FALSE)
message_("WARNING: some results from {.help [{.fun as.ab}](AMR::as.ab)} are duplicated: ", vector_and(dups, quotes = FALSE), as_note = FALSE)
} else {
message_(" WARNING.", add_fn = list(font_yellow, font_bold), as_note = FALSE)
message_(" WARNING.", as_note = FALSE)
}
for (i in seq_len(length(out))) {
if (isTRUE(verbose) && !out[i] %in% duplicates) {
message_(
"Using column '", font_bold(out[i]), "' as input for ", names(out)[i],
"Using column {.field ", font_bold(out[i]), "} as input for ", names(out)[i],
" (", ab_name(names(out)[i], tolower = TRUE, language = NULL), ")."
)
}
@@ -285,11 +284,10 @@ get_column_abx <- function(x,
if (names(out)[i] != already_set_as) {
message_(
paste0(
"Column '", font_bold(out[i]), "' will not be used for ",
"Column {.field ", 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
)
)
}
}
+138 -85
View File
@@ -53,29 +53,31 @@ format_eucast_version_nr <- function(version, markdown = TRUE) {
vector_and(txt, quotes = FALSE)
}
#' Apply EUCAST Rules
#' Apply Interpretive Rules
#'
#' @description
#' 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.
#' 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.
#'
#' To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules can applied at default, see *Details*.
#' 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*.
#' @param x A data set with antimicrobials columns, such as `amox`, `AMX` and `AMC`.
#' @param info A [logical] to indicate whether progress should be printed to the console - the default is only print while in interactive sessions.
#' @param rules A [character] vector that specifies which rules should be applied. Must be one or more of `"breakpoints"`, `"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 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_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), 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 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(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)`.
#' @param administration Route of administration, either `r vector_or(dosage$administration, documentation = TRUE)`.
#' @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_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 values to SIR values. Use [as.sir()] for that. \cr
#' **Note:** This function does not translate MIC or disk 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 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].
@@ -100,9 +102,9 @@ format_eucast_version_nr <- function(version, markdown = TRUE) {
#'
#' Important examples include amoxicillin and amoxicillin/clavulanic acid, and trimethoprim and trimethoprim/sulfamethoxazole. Needless to say, for these rules to work, both drugs must be available in the data set.
#'
#' Since these rules are not officially approved by EUCAST, they are not applied at default. To use these rules, include `"other"` to the `rules` argument, or use `eucast_rules(..., rules = "all")`. You can also set the package option [`AMR_eucastrules`][AMR-options], i.e. run `options(AMR_eucastrules = "all")`.
#' 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_interpretive_rules`][AMR-options], i.e. run `options(AMR_interpretive_rules = "all")`.
#' @aliases EUCAST
#' @rdname eucast_rules
#' @rdname interpretive_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.
#' @source
@@ -156,21 +158,24 @@ 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)
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,
...) {
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,
...) {
meet_criteria(x, allow_class = "data.frame")
meet_criteria(col_mo, allow_class = "character", has_length = 1, is_in = colnames(x), allow_NULL = TRUE)
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)
@@ -181,22 +186,33 @@ eucast_rules <- function(x,
meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1)
meet_criteria(custom_rules, allow_class = "custom_eucast_rules", allow_NULL = TRUE)
meet_criteria(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(
guideline == "CLSI",
"CLSI guideline is not yet supported."
)
stop_if(
!is.na(ampc_cephalosporin_resistance) && !any(c("expert", "all") %in% rules),
"For the `ampc_cephalosporin_resistance` argument to work, the `rules` argument must contain `\"expert\"` or `\"all\"`."
"For the {.arg ampc_cephalosporin_resistance} argument to work, the {.arg rules} argument must contain {.code \"expert\"} or {.code \"all\"}."
)
add_MO_lookup_to_AMR_env()
if ("custom" %in% rules && is.null(custom_rules)) {
warning_("in `eucast_rules()`: no custom rules were set with the `custom_rules` argument",
warning_("in {.help [{.fun eucast_rules}](AMR::eucast_rules)}: no custom rules were set with the {.arg 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", add_fn = font_red, as_note = FALSE)
message_("No other rules were set, returning original data", as_note = FALSE)
}
return(x)
}
@@ -224,7 +240,7 @@ eucast_rules <- function(x,
q_continue <- utils::menu(choices = c("OK", "Cancel"), graphics = FALSE, title = txt)
}
if (q_continue %in% c(FALSE, 2)) {
message_("Cancelled, returning original data", add_fn = font_red, as_note = FALSE)
message_("Cancelled, returning original data", as_note = FALSE)
return(x)
}
}
@@ -233,7 +249,7 @@ eucast_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), "`col_mo` must be set")
stop_if(is.null(col_mo), "{.arg col_mo} must be set")
}
decimal.mark <- getOption("OutDec")
@@ -321,7 +337,7 @@ eucast_rules <- function(x,
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 '", cols_ab[names(cols_ab) == "AMX"], "' as input for ampicillin since many EUCAST rules depend on it.")
message_("Using column {.field ", font_bold(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"])))
}
@@ -451,7 +467,7 @@ eucast_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.", add_fn = list(font_green, font_bold), as_note = FALSE)
message_("OK.", as_note = FALSE)
}
n_added <- 0
@@ -473,7 +489,7 @@ eucast_rules <- function(x,
"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"
"), see {.help [{.fun eucast_rules}](AMR::eucast_rules)}\n"
)
))
cat("\n\n")
@@ -502,8 +518,8 @@ eucast_rules <- function(x,
## Set base to R where base + enzyme inhibitor is R ----
rule_current <- paste0(
ab_enzyme$base_name[i], " (`", col_base, "`) = R if ",
tolower(ab_enzyme$enzyme_name[i]), " (`", col_enzyme, "`) = R"
ab_enzyme$base_name[i], " ({.field ", font_bold(col_base), "}) = R if ",
tolower(ab_enzyme$enzyme_name[i]), " ({.field ", font_bold(col_enzyme), "}) = R"
)
if (isTRUE(info)) {
cat(word_wrap(rule_current,
@@ -525,7 +541,8 @@ eucast_rules <- function(x,
warned = warned,
info = info,
verbose = verbose,
overwrite = overwrite
overwrite = overwrite,
add_if_missing = add_if_missing
)
n_added <- n_added + run_changes$added
n_changed <- n_changed + run_changes$changed
@@ -543,8 +560,8 @@ eucast_rules <- function(x,
## Set base + enzyme inhibitor to S where base is S ----
rule_current <- paste0(
ab_enzyme$enzyme_name[i], " (`", col_enzyme, "`) = S if ",
tolower(ab_enzyme$base_name[i]), " (`", col_base, "`) = S"
ab_enzyme$enzyme_name[i], " ({.field ", font_bold(col_enzyme), "}) = S if ",
tolower(ab_enzyme$base_name[i]), " ({.field ", font_bold(col_base), "}) = S"
)
if (isTRUE(info)) {
@@ -567,7 +584,8 @@ eucast_rules <- function(x,
warned = warned,
info = info,
verbose = verbose,
overwrite = overwrite
overwrite = overwrite,
add_if_missing = add_if_missing
)
n_added <- n_added + run_changes$added
n_changed <- n_changed + run_changes$changed
@@ -587,23 +605,13 @@ eucast_rules <- function(x,
} else {
if (isTRUE(info)) {
cat("\n")
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.")
))
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.")
}
}
if (!any(c("all", "custom") %in% rules) && !is.null(custom_rules)) {
if (isTRUE(info)) {
message_("Skipping custom EUCAST rules, since the `rules` argument does not contain \"custom\".")
message_("Skipping custom EUCAST rules, since the {.arg rules} argument does not contain {.code \"custom\"}.")
}
custom_rules <- NULL
}
@@ -611,7 +619,7 @@ eucast_rules <- function(x,
# >>> Apply Official EUCAST rules <<< ---------------------------------------------------
eucast_notification_shown <- FALSE
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)))
# 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 {
# otherwise internal data file, created in data-raw/_pre_commit_checks.R
@@ -663,10 +671,10 @@ eucast_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 '", 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
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"
)
}
cols_ab <- c(cols_ab, stats::setNames(unname(cols_ab[names(cols_ab) == ab]), ab_s))
@@ -808,7 +816,7 @@ eucast_rules <- function(x,
")$"
)
} else if (like_is_one_of != "like") {
stop("invalid value for column 'like.is.one_of'", call. = FALSE)
stop("invalid value for column {.field like.is.one_of}", call. = FALSE)
}
if (is.na(source_antibiotics)) {
@@ -864,7 +872,8 @@ eucast_rules <- function(x,
warned = warned,
info = info,
verbose = verbose,
overwrite = overwrite
overwrite = overwrite,
add_if_missing = add_if_missing
)
n_added <- n_added + run_changes$added
n_changed <- n_changed + run_changes$changed
@@ -890,7 +899,7 @@ eucast_rules <- function(x,
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_(paste0(conditionMessage(e), font_red(" (check available data and compare with the custom rules set)")), call = FALSE)
error = function(e) stop_(conditionMessage(e), " (check available data and compare with the custom rules set)", call = FALSE)
)
cols <- as.character(rule$result_group)
cols <- c(
@@ -934,7 +943,8 @@ eucast_rules <- function(x,
warned = warned,
info = info,
verbose = verbose,
overwrite = overwrite
overwrite = overwrite,
add_if_missing = add_if_missing
)
n_added <- n_added + run_changes$added
n_changed <- n_changed + run_changes$changed
@@ -1053,9 +1063,9 @@ eucast_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 `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 ", highlight_code("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' (`verbose = TRUE`), which returns a data.frame with all specified edits.\nUse `verbose = FALSE` to apply the rules on your data."), "\n\n", sep = "")
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 = "")
}
}
@@ -1065,13 +1075,13 @@ eucast_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 `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,
"in {.help [{.fun eucast_rules}](AMR::eucast_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,
warn_lacking_sir_class,
paste0(warn_lacking_sir_class[1], ":", warn_lacking_sir_class[length(warn_lacking_sir_class)])
), ")\n",
" - ", x_deparsed, " %>% mutate_if(is_sir_eligible, as.sir)\n",
" - ", x_deparsed, " %>% mutate(across(where(is_sir_eligible), as.sir))"
), ")")), "\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))"))
)
}
@@ -1092,6 +1102,29 @@ eucast_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,
@@ -1103,8 +1136,10 @@ edit_sir <- function(x,
warned,
info,
verbose,
overwrite) {
overwrite,
add_if_missing) {
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(
@@ -1131,42 +1166,60 @@ 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")
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")
non_SIR <- !isSIR
if (isFALSE(overwrite) && any(isSIR) && message_not_thrown_before("edit_sir.warning_overwrite")) {
warning_("Some values had SIR values and were not overwritten, since `overwrite = FALSE`.")
warning_("in {.help [{.fun eucast_rules}](AMR::eucast_rules)}: some columns had SIR values which were not overwritten, since {.code overwrite = FALSE}.")
}
tryCatch(
# insert into original table
if (isTRUE(overwrite)) {
new_edits[rows, cols] <- to
# 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 {
new_edits[rows, cols][non_SIR] <- to
},
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(),
warning = function(w) {
if (w$message %like% "invalid factor level") {
xyz <- vapply(FUN.VALUE = logical(1), cols, function(col) {
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
})
if (isTRUE(overwrite)) {
suppressWarnings(new_edits[rows, cols] <<- to)
} else {
suppressWarnings(new_edits[rows, cols][non_SIR] <<- to)
}
suppressWarnings(do_assign())
warning_(
"in `eucast_rules()`: value \"", to, "\" added to the factor levels of column",
"in {.help [{.fun eucast_rules}](AMR::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 `eucast_rules()`: ", w$message)
warning_("in {.help [{.fun eucast_rules}](AMR::eucast_rules)}: ", w$message)
txt_warning()
}
},
@@ -1230,7 +1283,7 @@ edit_sir <- function(x,
return(track_changes)
}
#' @rdname eucast_rules
#' @rdname interpretive_rules
#' @export
eucast_dosage <- function(ab, administration = "iv", version_breakpoints = 15) {
meet_criteria(ab, allow_class = c("character", "numeric", "integer", "factor"))
+3 -3
View File
@@ -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 `by`", call = -2)
stop_if(is.null(by), "no column with microorganism names or codes found, set this column with {.arg by}", call = -2)
}
message_('Joining, by = "', by, '"', add_fn = font_black, as_note = FALSE) # message same as dplyr::join functions
message_("Joining, by = \"", by, "\"", 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 `", type, "_microorganisms()`: the newly joined data set contains ", nrow(joined) - nrow(x), " rows more than the number of rows of `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}.")
}
as_original_data_class(joined, class(x.bak)) # will remove tibble groups
+9 -8
View File
@@ -159,7 +159,7 @@ key_antimicrobials <- function(x = NULL,
col_mo <- search_type_in_df(x = x, type = "mo", info = FALSE)
}
if (is.null(col_mo)) {
warning_("in `key_antimicrobials()`: no column found for `col_mo`, ignoring antibiotics set in `gram_negative` and `gram_positive`, and antimycotics set in `antifungal`")
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}")
gramstain <- NA_character_
kingdom <- NA_character_
} else {
@@ -182,12 +182,12 @@ key_antimicrobials <- function(x = NULL,
any(filter, na.rm = TRUE) &&
message_not_thrown_before("key_antimicrobials", name)) {
warning_(
"in `key_antimicrobials()`: ",
"in {.help [{.fun key_antimicrobials}](AMR::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 `?key_antimicrobials`."
"as key antimicrobials for ", name, "s. See {.help [{.fun key_antimicrobials}](AMR::key_antimicrobials)}."
)
}
@@ -237,7 +237,7 @@ key_antimicrobials <- function(x = NULL,
)
if (length(unique(key_ab)) == 1) {
warning_("in `key_antimicrobials()`: no distinct key antibiotics determined.")
warning_("in {.fun key_antimicrobials}: no distinct key antibiotics determined.")
}
key_ab
@@ -282,6 +282,9 @@ 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)
@@ -307,14 +310,12 @@ 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 `y` and `z` must be equal")
stop_ifnot(length(y) == length(z), "length of {.arg y} and {.arg z} must be equal")
key2sir <- function(val) {
val <- strsplit(val, "", fixed = TRUE)[[1L]]
val.int <- rep(NA_real_, length(val))
val.int[val == "S"] <- 1
val.int[val %in% c("I", "SDD")] <- 2
val.int[val == "R"] <- 3
val.int[val %in% VALID_SIR_LEVELS] <- as.double(as.sir(val[val %in% VALID_SIR_LEVELS]))
val.int
}
# only run on uniques
+121 -76
View File
@@ -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,7 +41,8 @@
#' @inheritParams eucast_rules
#' @param pct_required_classes Minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for *S. aureus*. Setting this `pct_required_classes` argument to `0.5` (default) means that for every *S. aureus* isolate at least 8 different classes must be available. Any lower number of available classes will return `NA` for that isolate.
#' @param combine_SI A [logical] to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the [mdro()] function, it follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using `combine_SI = FALSE`, resistance is considered when isolates are R or I.
#' @param verbose A [logical] to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.
#' @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`.
#' @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*.
#'
@@ -83,7 +84,7 @@
#'
#' * `guideline = "BRMO 2024"` (or simply `guideline = "BRMO"`)
#'
#' The Dutch national guideline - Samenwerkingverband Richtlijnen Infectiepreventie (SRI) (2024) "Bijzonder Resistente Micro-Organismen (BRMO)" ([link](https://www.sri-richtlijnen.nl/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))
#'
#' Also:
#'
@@ -143,6 +144,7 @@ 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)
@@ -165,57 +167,32 @@ 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 `only_sir_columns` being `TRUE`. Transform columns with `as.sir()` for valid antimicrobial interpretations.")
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.")
} 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 `as.sir()` for valid antimicrobial interpretations.")
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.")
}
# get gene values as TRUE/FALSE
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))
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
}
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
@@ -236,7 +213,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", add_fn = font_red, as_note = FALSE)
message_("Cancelled, returning original data", as_note = FALSE)
return(x)
}
}
@@ -274,7 +251,7 @@ mdro <- function(x = NULL,
guideline.bak <- guideline
if (is.list(guideline)) {
# Custom MDRO guideline ---------------------------------------------------
stop_ifnot(inherits(guideline, "custom_mdro_guideline"), "use `custom_mdro_guideline()` to create custom guidelines")
stop_ifnot(inherits(guideline, "custom_mdro_guideline"), "use {.help [{.fun custom_mdro_guideline}](AMR::custom_mdro_guideline)} to create custom guidelines")
if (isTRUE(info)) {
txt <- paste0(
"Determining MDROs based on custom rules",
@@ -351,13 +328,13 @@ mdro <- function(x = NULL,
}
if (is.null(col_mo) && guideline$code == "tb") {
message_(
"No column found as input for `col_mo`, ",
"No column found as input for {.arg 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), "`col_mo` must be set")
stop_if(is.null(col_mo), "{.arg 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."
@@ -402,7 +379,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://www.sri-richtlijnen.nl/brmo", "Direct link")
guideline$source_url <- font_url("https://richtlijnendatabase.nl/richtlijn/bijzonder_resistente_micro-organismen_brmo", "Direct link")
guideline$type <- "BRMOs"
} else if (guideline$code == "brmo2017") {
guideline$name <- "WIP-Richtlijn Bijzonder Resistente Micro-organismen (BRMO)"
@@ -499,12 +476,58 @@ 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 '", cols_ab[names(cols_ab) == "AMX"], "' as input for ampicillin since many MDRO rules depend on it.", add_fn = font_red)
message_("Using column {.field ", font_bold(cols_ab[names(cols_ab) == "AMX"]), "} as input for ampicillin since many MDRO rules depend on it.")
}
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"]
@@ -699,6 +722,16 @@ 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)
@@ -772,7 +805,7 @@ mdro <- function(x = NULL,
)
}
x[rows_to_change, "MDRO"] <<- to
x[rows_to_change, "reason"] <<- reason
x[rows_to_change, "reason"] <<- paste0(x[rows_to_change, "reason", drop = TRUE], "; ", reason)
x[rows_not_to_change, "reason"] <<- "guideline criteria not met"
}
}
@@ -802,7 +835,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% c("S", "SDD", "I", "R"))
function(group) any(unlist(x[row, group[!is.na(group)], drop = TRUE]) %in% VALID_SIR_LEVELS[VALID_SIR_LEVELS != "NI"])
))
}
)
@@ -842,7 +875,7 @@ mdro <- function(x = NULL,
}
if (isTRUE(info)) {
message_(" OK.", add_fn = list(font_green, font_bold), as_note = FALSE)
message_(" OK.", as_note = FALSE)
}
}
@@ -854,7 +887,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 <- NA_character_
x$reason <- ""
x$all_nonsusceptible_columns <- ""
if (guideline$code == "cmi2012") {
@@ -1498,7 +1531,7 @@ mdro <- function(x = NULL,
}
trans_tbl(
3, # positive
rows = which(x$order == "Enterobacterales" & esbl == TRUE),
rows = which(x$order == "Enterobacterales" & x$esbl == TRUE),
cols = "any",
any_all = "any",
reason = "Enterobacterales: ESBL"
@@ -1519,17 +1552,19 @@ mdro <- function(x = NULL,
)
trans_tbl(
3,
rows = which(x$order == "Enterobacterales" & carbapenemase == TRUE),
rows = which(x$order == "Enterobacterales" & x$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$genus %in% c("Enterobacter", "Providencia") | paste(x$genus, x$species) %in% c("Citrobacter freundii", "Klebsiella aerogenes", "Hafnia alvei", "Morganella morganii"))),
(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"))),
cols = c(SXT, aminoglycosides, fluoroquinolones),
any_all = "any",
reason = "Enterobacterales group II: aminoglycoside + fluoroquinolone + cotrimoxazol"
@@ -1546,25 +1581,27 @@ 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[[col_mo]] %in% AMR::microorganisms.groups$mo[AMR::microorganisms.groups$mo_group_name == "Acinetobacter baumannii complex"]),
x$fullname %like_case% a.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[[col_mo]] %in% AMR::microorganisms.groups$mo[AMR::microorganisms.groups$mo_group_name == "Acinetobacter baumannii complex"] & is.na(carbapenemase)),
rows = which(x$fullname %like_case% a.baumannii_complex & is.na(x$carbapenemase)),
cols = carbapenems,
any_all = "any",
reason = "A. baumannii-calcoaceticus complex: potential carbapenemase"
)
trans_tbl(
3,
rows = which(x[[col_mo]] %in% AMR::microorganisms.groups$mo[AMR::microorganisms.groups$mo_group_name == "Acinetobacter baumannii complex"] & carbapenemase == TRUE),
rows = which(x$fullname %like_case% a.baumannii_complex & x$carbapenemase == TRUE),
cols = carbapenems,
any_all = "any",
reason = "A. baumannii-calcoaceticus complex: carbapenemase"
@@ -1574,6 +1611,7 @@ 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)
@@ -1602,7 +1640,7 @@ mdro <- function(x = NULL,
)
trans_tbl(
3,
rows = which(x$genus == "Enterococcus" & x$species == "faecium" & (vanA == TRUE | vanB == TRUE)),
rows = which(x$genus == "Enterococcus" & x$species == "faecium" & (x$vanA == TRUE | x$vanB == TRUE)),
cols = c(PEN, AMX, AMP, VAN),
any_all = "any",
reason = "E. faecium: vanA/vanB gene + penicillin group"
@@ -1611,14 +1649,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(mecA) | is.na(mecC))),
rows = which(x$genus == "Staphylococcus" & x$species %in% c("aureus", "argenteus", "schweitzeri") & (is.na(x$mecA) | is.na(x$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") & (mecA == TRUE | mecC == TRUE)),
rows = which(x$genus == "Staphylococcus" & x$species %in% c("aureus", "argenteus", "schweitzeri") & (x$mecA == TRUE | x$mecC == TRUE)),
cols = "any",
any_all = "any",
reason = "S. aureus complex: mecA/mecC gene"
@@ -1816,6 +1854,7 @@ 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 {
@@ -1838,14 +1877,15 @@ mdro <- function(x = NULL,
))
if (length(rows_empty) > 0) {
if (isTRUE(info.bak)) {
cat(font_italic(paste0(" (", length(rows_empty), " isolates had no test results)\n")))
cat(font_italic(paste0("\n (another ", length(rows_empty), " isolates had no test results)\n")))
}
} else if (isTRUE(info.bak)) {
cat("\n")
}
if (isTRUE(info.bak) && !isTRUE(verbose)) {
cat("\nRerun with 'verbose = TRUE' to retrieve detailed info and reasons for every MDRO classification.\n")
cat("\n")
cat(format_inline_("Rerun with {.code verbose = TRUE} to retrieve detailed info and reasons for every MDRO classification.\n"))
}
# Results ----
@@ -1853,8 +1893,8 @@ mdro <- function(x = NULL,
if (any(x$MDRO == -1, na.rm = TRUE)) {
if (message_not_thrown_before("mdro", "availability")) {
warning_(
"in `mdro()`: NA introduced for isolates where the available percentage of antimicrobial classes was below ",
percentage(pct_required_classes), " (set with `pct_required_classes`)"
"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})"
)
}
# set these -1s to NA
@@ -1899,10 +1939,15 @@ 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, ", ", guideline$version, ")")
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[, c(
"row_number",
"microorganism",
@@ -1925,7 +1970,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 `guideline` must not be set since this is a guideline-specific function"
"argument {.arg guideline} must not be set since this is a guideline-specific function"
)
mdro(x = x, only_sir_columns = only_sir_columns, guideline = "BRMO", ...)
}
@@ -1938,7 +1983,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 `guideline` must not be set since this is a guideline-specific function"
"argument {.arg 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", ...)
}
@@ -1950,7 +1995,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 `guideline` must not be set since this is a guideline-specific function"
"argument {.arg 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", ...)
}
@@ -1962,7 +2007,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 `guideline` must not be set since this is a guideline-specific function"
"argument {.arg 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", ...)
}
@@ -1974,7 +2019,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 `guideline` must not be set since this is a guideline-specific function"
"argument {.arg 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", ...)
}
+1 -1
View File
@@ -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"
x[x %in% c("I", "SDD")] <- "S" # do not acknowledge CLSI/EUCAST guideline here to keep the numeric mean_amr_distance consistent between systems
}
mean_amr_distance(as.double(x))
}
+60 -30
View File
@@ -63,6 +63,7 @@ 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)))`).
#'
@@ -71,7 +72,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)
@@ -88,7 +89,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")
@@ -125,7 +126,7 @@ COMMON_MIC_VALUES <- c(
#' # this can also coerce combined MIC/SIR values:
#' as.mic("<=0.002; S")
#'
#' # mathematical processing treats MICs as numeric values
#' # mathematical processing treats MICs as, and returns, numeric values
#' fivenum(mic_data)
#' quantile(mic_data)
#' all(mic_data < 512)
@@ -133,6 +134,10 @@ 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),
@@ -157,17 +162,22 @@ 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") {
as.mic <- function(x, na.rm = FALSE, keep_operators = "all", round_to_next_log2 = FALSE) {
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 (is.mic(x) && (keep_operators == "all" || !any(x %like% "[>=<]", na.rm = TRUE))) {
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 (!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),
@@ -207,8 +217,9 @@ as.mic <- function(x, na.rm = FALSE, keep_operators = "all") {
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("[^a-zA-Z0-9.><= -]+", "", x, perl = TRUE)
x <- gsub("[^0-9e.><= -]+", "", x, perl = TRUE)
# transform => to >= and =< to <=
x <- gsub("=<", "<=", x, fixed = TRUE)
x <- gsub("=>", ">=", x, fixed = TRUE)
@@ -258,9 +269,9 @@ as.mic <- function(x, na.rm = FALSE, keep_operators = "all") {
sort() %pm>%
vector_and(quotes = TRUE)
cur_col <- get_current_column()
warning_("in `as.mic()`: ", na_after - na_before, " result",
warning_("in {.help [{.fun as.mic}](AMR::as.mic)}: ", na_after - na_before, " result",
ifelse(na_after - na_before > 1, "s", ""),
ifelse(is.null(cur_col), "", paste0(" in index '", cur_col, "'")),
ifelse(is.null(cur_col), "", paste0(" in column {.field ", font_bold(cur_col, collapse = NULL), "}")),
" truncated (",
round(((na_after - na_before) / length(x)) * 100),
"%) that were invalid MICs: ",
@@ -279,6 +290,10 @@ as.mic <- function(x, na.rm = FALSE, keep_operators = "all") {
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")
)
@@ -305,18 +320,19 @@ 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) {
rescale_mic <- function(x, mic_range, keep_operators = "edges", as.mic = TRUE, round_to_next_log2 = FALSE) {
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 (is.mic(mic_range)) {
} else if (any(is.mic(mic_range))) {
mic_range <- as.character(mic_range)
}
stop_ifnot(
all(mic_range %in% c(VALID_MIC_LEVELS, NA)),
"Values in `mic_range` must be valid MIC values. ",
"Values in {.arg 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), "."
)
@@ -336,7 +352,7 @@ rescale_mic <- function(x, mic_range, keep_operators = "edges", as.mic = TRUE) {
x[x > max_mic] <- max_mic
}
x <- as.mic(x, keep_operators = ifelse(keep_operators == "edges", "none", keep_operators))
x <- as.mic(x, keep_operators = ifelse(keep_operators == "edges", "none", keep_operators), round_to_next_log2 = round_to_next_log2)
if (isTRUE(as.mic)) {
if (keep_operators == "edges" && length(unique(x)) > 1) {
@@ -426,23 +442,19 @@ 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 `as.mic()` to update",
warning_(AMR_env$sup_1_icon, " These columns contain an outdated or altered structure - convert with {.fun as.mic} to update",
call = FALSE
)
}
crude_numbers <- as.double(x)
operators <- gsub("[^<=>]+", "", as.character(x))
# colourise operators
operators[!is.na(operators) & operators != ""] <- font_silver(operators[!is.na(operators) & operators != ""], collapse = NULL)
operators[!is.na(operators) & operators != ""] <- pillar::style_subtle(operators[!is.na(operators) & operators != ""])
out <- trimws(paste0(operators, trimws(format(crude_numbers))))
out[is.na(x)] <- font_na(NA)
out[is.na(x)] <- pillar::style_na(NA)
# make trailing zeroes less visible
if (is_dark()) {
fn <- font_silver
} else {
fn <- font_white
}
out[out %like% "[.]"] <- gsub("([.]?0+)$", fn("\\1"), out[out %like% "[.]"], perl = TRUE)
out[out %like% "[.]"] <- gsub("([.]?0+)$", pillar::style_subtle("\\1"), out[out %like% "[.]"], perl = TRUE)
create_pillar_column(out, align = "right", width = max(nchar(font_stripstyle(out))))
}
@@ -460,7 +472,7 @@ type_sum.mic <- function(x, ...) {
#' @export
#' @noRd
print.mic <- function(x, ...) {
cat("Class 'mic'")
cat(format_inline_("Class {.cls mic}"))
if (!identical(levels(x), VALID_MIC_LEVELS)) {
cat(font_red(" with an outdated or altered structure - convert with `as.mic()` to update"))
}
@@ -493,7 +505,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 `rbind()` and `cbind()` cannot preserve the structure of MIC values. Use dplyr's `bind_rows()` or `bind_cols()` instead.", call = FALSE)
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)
}
y
}
@@ -586,7 +598,7 @@ sort.mic <- function(x, decreasing = FALSE, ...) {
#' @export
#' @noRd
hist.mic <- function(x, ...) {
warning_("in `hist()`: use `plot()` or ggplot2's `autoplot()` for optimal plotting of MIC values")
warning_("in {.fun hist}: use {.fun plot} or {.pkg ggplot2}'s {.fun autoplot} for optimal plotting of MIC values")
hist(log2(x))
}
@@ -596,15 +608,33 @@ 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(., 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)
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)
)
}
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
+113 -94
View File
@@ -38,13 +38,15 @@
#'
#' 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 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 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 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 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 old 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 outdated taxonomic names. The default is `TRUE` only in interactive mode.
#' @param ... Other arguments passed on to functions.
#' @rdname as.mo
#' @aliases mo
@@ -82,7 +84,7 @@
#' 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 old, previously accepted taxonomic names.
#' - Use [mo_renamed()] to get a [data.frame] with all values that could be coerced based on outdated, previously accepted taxonomic names.
#'
#' ### For Mycologists
#'
@@ -247,7 +249,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 `microorganisms.codes` data set for ", vector_and(toupper(x)[ind]), "."
" from the {.help [microorganisms.codes](AMR::microorganisms.codes)} data set for ", vector_and(toupper(x)[ind]), "."
)
}
# From SNOMED ----
@@ -265,7 +267,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 `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 {.help [{.fun mo_reset_session}](AMR::mo_reset_session)} to reset this. This note will be shown once per session for this input."
)
}
@@ -400,7 +402,14 @@ 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)]
@@ -446,8 +455,8 @@ as.mo <- function(x,
if (length(AMR_env$mo_uncertainties$original_input) <= 3) {
examples <- vector_and(
paste0(
'"', AMR_env$mo_uncertainties$original_input,
'" (assumed ', italicise(AMR_env$mo_uncertainties$fullname), ")"
"{.val ", AMR_env$mo_uncertainties$original_input,
"} (assumed ", italicise(AMR_env$mo_uncertainties$fullname), ")"
),
quotes = FALSE
)
@@ -456,7 +465,7 @@ as.mo <- function(x,
}
msg <- c(msg, paste0(
"Microorganism translation was uncertain for ", examples,
". Run `mo_uncertainties()` to review ", plural[2], ", or use `add_custom_microorganisms()` to add custom entries."
". 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."
))
for (m in msg) {
@@ -472,11 +481,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 `keep_synonyms = TRUE` to leave uncorrected)")
print(mo_renamed(), extra_txt = " (use {.arg 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_("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)
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)
}
# Apply Becker ----
@@ -493,7 +502,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 `as.mo()`: Becker ", font_italic("et al."), " (2014, 2019, 2020) does not contain these species named after their publication: ",
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: ",
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
@@ -538,7 +547,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 `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 {.fun mo_failures}.", call = FALSE)
}
# Return class ----
@@ -623,6 +632,14 @@ 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:
@@ -631,13 +648,13 @@ pillar_shaft.mo <- function(x, ...) {
add_MO_lookup_to_AMR_env()
out <- trimws(format(x))
# 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)
out[!is.na(x)] <- gsub("^([A-Z]+_)(.*)", paste0(pillar::style_subtle("\\1"), "\\2"), out[!is.na(x)], perl = TRUE)
# and grey out every _
out[!is.na(x)] <- gsub("_", font_subtle("_"), out[!is.na(x)])
out[!is.na(x)] <- gsub("_", pillar::style_subtle("_"), out[!is.na(x)])
# markup NA and UNKNOWN
out[is.na(x)] <- font_na(" NA")
out[x == "UNKNOWN"] <- font_na(" UNKNOWN")
out[is.na(x)] <- pillar::style_na(" NA")
out[x == "UNKNOWN"] <- pillar::style_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)
@@ -656,26 +673,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(
font_na(x[!x %in% all_mos],
pillar::style_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(colnames(df)[mo_cols], quotes = TRUE, sort = FALSE))
col <- paste0("Column ", vector_or(paste0("{.field ", font_bold(colnames(df)[mo_cols], collapse = NULL), "}"), quotes = TRUE, sort = FALSE))
} else {
col <- "The data"
}
warning_(
col, " contains old MO codes (from a previous AMR package version). ",
"Please update your MO codes with `as.mo()`.",
"Please update your MO codes with {.help [{.fun as.mo}](AMR::as.mo)}.",
call = FALSE
)
}
# add the names to the bugs as mouse-over!
if (tryCatch(isTRUE(getExportedValue("ansi_has_hyperlink_support", ns = asNamespace("cli"))()), error = function(e) FALSE)) {
if (in_rstudio()) {
out[!x %in% c("UNKNOWN", NA)] <- font_url(
url = paste0(
x[!x %in% c("UNKNOWN", NA)], ": ",
@@ -747,13 +764,17 @@ 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",
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]
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],
)
}
@@ -762,7 +783,7 @@ get_skimmers.mo <- function(column) {
#' @noRd
print.mo <- function(x, print.shortnames = FALSE, ...) {
add_MO_lookup_to_AMR_env()
cat("Class 'mo'\n")
cat(format_inline_("Class {.cls mo}\n"))
x_names <- names(x)
if (is.null(x_names) & print.shortnames == TRUE) {
x_names <- tryCatch(mo_shortname(x, ...), error = function(e) NULL)
@@ -771,8 +792,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 a previous AMR package version. ",
"Please update the MO codes with `as.mo()`.",
"Some MO codes are from another AMR package version. ",
"Please update the MO codes with {.help [{.fun as.mo}](AMR::as.mo)}.",
call = FALSE
)
}
@@ -805,8 +826,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 a previous AMR package version). ",
"Please update your MO codes with `as.mo()`."
"The data contains old MO codes (from another AMR package version). ",
"Please update your MO codes with {.help [{.fun as.mo}](AMR::as.mo)}."
)
}
nm <- deparse1(substitute(x))
@@ -888,14 +909,16 @@ rep.mo <- function(x, ...) {
print.mo_uncertainties <- function(x, n = 10, ...) {
more_than_50 <- FALSE
if (NROW(x) == 0) {
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))
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.")
return(invisible(NULL))
} else if (NROW(x) > 50) {
more_than_50 <- TRUE
x <- x[1:50, , drop = FALSE]
}
cat(word_wrap("Matching scores are based on the resemblance between the input and the full taxonomic name, and the pathogenicity in humans. See `?mo_matching_score`.\n\n", add_fn = font_blue))
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
)
add_MO_lookup_to_AMR_env()
@@ -905,12 +928,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"),
add_fn = font_blue
col_green(" 0.750-1.000")
), font_green_bg(" "), "\n", sep = "")
}
@@ -942,21 +965,6 @@ 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 <- ""
}
@@ -966,46 +974,54 @@ print.mo_uncertainties <- function(x, n = 10, ...) {
n = x[i, ]$fullname
)
score_formatted <- trimws(formatC(round(score, 3), format = "f", digits = 3))
txt <- paste(txt,
out <- paste0(
paste0(
"", strrep(font_grey("-"), times = getOption("width", 100) - 1), "\n",
"{.val ", x[i, ]$original_input, "}",
" -> ",
paste0(
"", strrep(font_grey("-"), times = getOption("width", 100)), "\n",
'"', x[i, ]$original_input, '"',
" -> ",
paste0(
font_bold(italicise(x[i, ]$fullname)),
" (", x[i, ]$mo, ", ", score_set_colour(score_formatted, score), ")"
)
),
collapse = "\n"
font_bold(italicise(x[i, ]$fullname)),
" (", x[i, ]$mo, ", ", score_set_colour(score_formatted, score), ")"
)
),
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"
collapse = "\n"
)
txt <- gsub("[\n]+", "\n", txt)
# remove first and last break
txt <- gsub("(^[\n]|[\n]$)", "", txt)
txt <- paste0("\n", txt, "\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)
}
other_matches <- paste0(
"Also matched: ",
vector_and(
paste0(
candidates_formatted,
font_blue(paste0(" (", scores_formatted, ")"), collapse = NULL)
),
quotes = FALSE, sort = FALSE
)
)
message_(other_matches, as_note = FALSE)
}
cat(txt)
if (isTRUE(any_maxed_out)) {
cat(font_blue(word_wrap("\nOnly the first ", n, " other matches of each record are shown. Run `print(mo_uncertainties(), n = ...)` to view more entries, or save `mo_uncertainties()` to an object.")))
cat("\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.")
}
if (isTRUE(more_than_50)) {
cat(font_blue(word_wrap("\nOnly the first 50 uncertainties are shown. Run `View(mo_uncertainties())` to view all entries, or save `mo_uncertainties()` to an object.")))
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.")
}
}
@@ -1014,7 +1030,7 @@ print.mo_uncertainties <- function(x, n = 10, ...) {
#' @noRd
print.mo_renamed <- function(x, extra_txt = "", n = 25, ...) {
if (NROW(x) == 0) {
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))
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.")
return(invisible(NULL))
}
@@ -1025,14 +1041,17 @@ 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, ":\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."), "")
)
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
)
}
}
# UNDOCUMENTED HELPER FUNCTIONS -------------------------------------------
@@ -1237,14 +1256,14 @@ replace_old_mo_codes <- function(x, property) {
}
if (property != "mo") {
warning_(
"in `mo_", property, "()`: the input contained ", n_matched,
"in {.help [{.fun mo_", property, "}](AMR::mo_", property, ")}: the input contained ", n_matched,
" old MO code", ifelse(n_matched == 1, "", "s"),
" (", n_unique, "from a previous AMR package version). ",
"Please update your MO codes with `as.mo()` to increase speed."
"Please update your MO codes with {.help [{.fun as.mo}](AMR::as.mo)} to increase speed."
)
} else {
warning_(
"in `as.mo()`: the input contained ", n_matched,
"in {.help [{.fun as.mo}](AMR::as.mo)}: the input contained ", n_matched,
" old MO code", ifelse(n_matched == 1, "", "s"),
" (", n_unique, "from a previous AMR package version). ",
n_solved, " old MO code", ifelse(n_solved == 1, "", "s"),
+5 -6
View File
@@ -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, quotes = TRUE)`, or must be `"shortname"`.
#' @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"`.
#' @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()].
@@ -270,7 +270,6 @@ 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), ...) {
@@ -584,7 +583,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 `x` and `ab` must be equal, or one of them must be of length 1.")
stop_("length of {.arg x} and {.arg 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)
@@ -943,7 +942,7 @@ mo_url <- function(x, open = FALSE, language = get_AMR_locale(), keep_synonyms =
if (isTRUE(open)) {
if (length(u) > 1) {
warning_("in `mo_url()`: only the first URL will be opened, as R's built-in function `browseURL()` only suports one string.")
warning_("in {.fun mo_url}: only the first URL will be opened, as R's built-in function {.fun browseURL} only suports one string.")
}
utils::browseURL(u[1L])
}
@@ -1043,10 +1042,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 '", font_bold(mo), "' as input for `", fn, "()`")
message_("Using column {.field ", font_bold(mo), "} as input for {.help [{.fun ", fn, "}](AMR::", fn, ")}")
}
return(df[, mo, drop = TRUE])
} else {
stop_("argument `x` is missing and no column with info about microorganisms could be found.", call = -2)
stop_("argument {.arg x} is missing and no column with info about microorganisms could be found.", call = -2)
}
}
+8 -9
View File
@@ -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 `destination` must be a file location with file extension .rds.")
stop_ifnot(destination %like% "[.]rds$", "the {.arg 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,7 +137,6 @@ 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
)
}
@@ -250,7 +249,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 `set_mo_source()` on this file. In any case, the option `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 {.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.")
}
if (is.null(AMR_env$mo_source)) {
AMR_env$mo_source <- readRDS_AMR(path.expand(destination))
@@ -290,7 +289,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 'mo'", call = FALSE)
stop_(refer_to_name, " must contain a column {.code mo}", call = FALSE)
} else {
return(FALSE)
}
@@ -314,14 +313,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 '", colnames(x)[1], "'", call = FALSE)
stop_(refer_to_name, " contains duplicate values in column {.field ", font_bold(colnames(x)[1]), "}", call = FALSE)
} else {
return(FALSE)
}
}
if (colnames(x)[2] != "mo" && nrow(x) > length(unique(x[, 2, drop = TRUE]))) {
if (stop_on_error == TRUE) {
stop_(refer_to_name, " contains duplicate values in column '", colnames(x)[2], "'", call = FALSE)
stop_(refer_to_name, " contains duplicate values in column {.field ", font_bold(colnames(x)[2]), "}", call = FALSE)
} else {
return(FALSE)
}
+5 -5
View File
@@ -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 `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)
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)
}
# set column names
+190 -77
View File
@@ -52,11 +52,19 @@
#' @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. 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 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 `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 = " < ")`). 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 = " < ")`).
#'
#' 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.
#'
#' ### Additional `ggplot2` Functions
#'
@@ -114,17 +122,12 @@
#' ) +
#' geom_col()
#' mic_plot +
#' labs(title = "without scale_x_mic()")
#' labs(title = "scale_x_mic() automatically applied")
#' }
#' if (require("ggplot2")) {
#' mic_plot +
#' 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")
#' scale_x_mic(keep_operators = "none") +
#' labs(title = "with scale_x_mic() keeping no operators")
#' }
#' if (require("ggplot2")) {
#' mic_plot +
@@ -151,7 +154,7 @@
#' ) +
#' geom_boxplot() +
#' geom_violin(linetype = 2, colour = "grey30", fill = NA) +
#' scale_y_mic()
#' labs(title = "scale_y_mic() automatically applied")
#' }
#' if (require("ggplot2")) {
#' ggplot(
@@ -183,7 +186,7 @@
#'
#' # Plotting using scale_y_mic() and scale_colour_sir() ------------------
#' if (require("ggplot2")) {
#' plain <- ggplot(
#' mic_sir_plot <- ggplot(
#' data.frame(
#' mic = some_mic_values,
#' group = some_groups,
@@ -197,21 +200,16 @@
#' theme_minimal() +
#' geom_boxplot(fill = NA, colour = "grey30") +
#' geom_jitter(width = 0.25)
#' labs(title = "scale_y_mic()/scale_colour_sir() automatically applied")
#'
#' plain
#' mic_sir_plot
#' }
#' if (require("ggplot2")) {
#' # and now with our MIC and SIR scale functions:
#' plain +
#' scale_y_mic() +
#' scale_colour_sir()
#' }
#' if (require("ggplot2")) {
#' plain +
#' mic_sir_plot +
#' scale_y_mic(mic_range = c(0.005, 32), name = "Our MICs!") +
#' scale_colour_sir(
#' language = "pt",
#' name = "Support in 27 languages"
#' language = "pt", # Portuguese
#' name = "Support in 28 languages"
#' )
#' }
#' }
@@ -229,6 +227,9 @@
#' 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")
@@ -247,6 +248,7 @@ 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")
@@ -256,15 +258,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 `scale_", aest, "_mic()` with columns ", vector_and(colnames(df), sort = FALSE))
stop_("No support for plotting df with {.fun scale_", aest, "_mic} with columns ", vector_and(colnames(df), sort = FALSE))
}
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()`.")
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}.")
}
df[[aest_val]] <- log2(as.double(out))
out[[aest_val]] <- log2(as.double(mics))
} else {
self$mic_values_rescaled <- rescale_mic(x = as.double(as.mic(df[[aest]])), keep_operators = keep_operators, mic_range = mic_range, as.mic = TRUE)
self$mic_values_rescaled <- rescale_mic(x = as.character(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)
@@ -278,19 +280,33 @@ 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)))
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)])
# 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)])
}
}
self$mic_values_log <- log2(as.double(self$mic_values_rescaled))
if (aest == "y" && "group" %in% colnames(df) && "x" %in% colnames(df)) {
df$group <- as.integer(factor(df$x))
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))
}
}
df[[aest]] <- self$mic_values_log
out[[aest]] <- self$mic_values_log
}
df
out
}
scale$breaks <- function(..., self) {
@@ -306,7 +322,26 @@ create_scale_mic <- function(aest, keep_operators, mic_range = NULL, ...) {
}
scale$labels <- function(..., self) {
if (is.null(self$mic_breaks_set)) {
self$mic_values_levels
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
}
} else {
breaks <- tryCatch(scale$breaks(), error = function(e) NULL)
if (!is.null(breaks)) {
@@ -317,7 +352,6 @@ 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)) {
@@ -329,7 +363,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.na(x[1]) && x[1] == 0) {
if (!is.null(x) && !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
}
@@ -377,6 +411,9 @@ 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
@@ -391,7 +428,12 @@ create_scale_sir <- function(aesthetics, colours_SIR, language, eucast_I, ...) {
args,
list(
aesthetics = aesthetics,
values = c(colours_SIR, NI = "grey30")
values = c(colours_SIR,
NI = "grey30",
WT = unname(colours_SIR[1]),
NWT = unname(colours_SIR[4]),
NS = unname(colours_SIR[4])
)
)
)
}
@@ -399,7 +441,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 'sir', see `?as.sir`.",
"Apply `scale_", aesthetics[1], "_sir()` to a variable of class {.cls sir}, see {.help [{.fun as.sir}](AMR::as.sir)}.",
call = FALSE
)
x <- as.character(x)
@@ -416,6 +458,9 @@ 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
@@ -529,11 +574,16 @@ 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,
@@ -564,10 +614,14 @@ plot.mic <- function(x,
if (any(colours_SIR %in% cols_sub$cols)) {
legend_txt <- character(0)
legend_col <- character(0)
if (any(cols_sub$cols == colours_SIR[1] & cols_sub$count > 0)) {
if (!is_wt_nwt & 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])
@@ -576,10 +630,14 @@ 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 (any(cols_sub$cols == colours_SIR[4] & cols_sub$count > 0)) {
if (!is_wt_nwt & 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,
@@ -672,6 +730,8 @@ 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
@@ -682,6 +742,9 @@ 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(
@@ -700,17 +763,21 @@ 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]] <- "(S) Susceptible"
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[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]] <- "(R) Resistant"
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 <- 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"
"(R) Resistant",
"(WT) Wildtype",
"(NWT) Non-wildtype"
),
language = language
),
@@ -725,7 +792,9 @@ 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"
"(NI) Non-interpretable" = "grey30",
"(WT) Wildtype" = colours_SIR[1],
"(NWT) Non-wildtype" = colours_SIR[4]
)
names(vals) <- translate_into_language(names(vals), language = language)
p <- p +
@@ -789,10 +858,15 @@ 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,
@@ -824,10 +898,14 @@ plot.disk <- function(x,
if (any(colours_SIR %in% cols_sub$cols)) {
legend_txt <- character(0)
legend_col <- character(0)
if (any(cols_sub$cols == colours_SIR[4] & cols_sub$count > 0)) {
if (!is_wt_nwt & 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])
@@ -836,10 +914,14 @@ plot.disk <- function(x,
legend_txt <- c(legend_txt, "(SDD) Susceptible dose-dependent")
legend_col <- c(legend_col, colours_SIR[2])
}
if (any(cols_sub$cols == colours_SIR[1] & cols_sub$count > 0)) {
if (!is_wt_nwt & 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),
@@ -871,6 +953,8 @@ 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)
@@ -881,6 +965,8 @@ 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 = " "))
@@ -893,6 +979,10 @@ barplot.disk <- function(height,
ab = ab,
guideline = guideline,
colours_SIR = colours_SIR,
language = language,
expand = expand,
include_PKPD = include_PKPD,
breakpoint_type = breakpoint_type,
...
)
}
@@ -939,6 +1029,9 @@ 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,
@@ -956,23 +1049,26 @@ 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]] <- "(S) Susceptible"
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[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]] <- "(R) Resistant"
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 <- 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"
"(R) Resistant",
"(WT) Wildtype",
"(NWT) Non-wildtype"
),
language = language
),
ordered = TRUE
)
p <- ggplot2::ggplot(df)
if (any(colours_SIR %in% cols_sub$cols)) {
vals <- c(
"(S) Susceptible" = colours_SIR[1],
@@ -980,7 +1076,9 @@ 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"
"(NI) Non-interpretable" = "grey30",
"(WT) Wildtype" = colours_SIR[1],
"(NWT) Non-wildtype" = colours_SIR[4]
)
names(vals) <- translate_into_language(names(vals), language = language)
p <- p +
@@ -1028,25 +1126,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 (!"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))
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")
}
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)
data$x <- factor(data$x, levels = lvls, ordered = TRUE)
ymax <- pm_if_else(max(data$s) > 95, 105, 100)
@@ -1061,7 +1159,7 @@ plot.sir <- function(x,
axes = FALSE
)
# x axis
axis(side = 1, at = 1:pm_n_distinct(data$x), labels = levels(data$x), lwd = 0)
axis(side = 1, at = seq_along(lvls), labels = lvls, lwd = 0)
# y axis, 0-100%
axis(side = 2, at = seq(0, 100, 5))
@@ -1104,9 +1202,14 @@ barplot.sir <- function(height,
main <- gsub(" +", " ", paste0(main, collapse = " "))
x <- table(height)
# 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)]
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)]
}
# plot it
barplot(x,
col = colours_SIR,
@@ -1152,6 +1255,11 @@ 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)
@@ -1161,7 +1269,9 @@ autoplot.sir <- function(object,
"SDD" = colours_SIR[2],
"I" = colours_SIR[3],
"R" = colours_SIR[4],
"NI" = "grey30"
"NI" = "grey30",
"WT" = colours_SIR[1],
"NWT" = colours_SIR[4]
),
limits = force
) +
@@ -1290,6 +1400,9 @@ 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"
@@ -1359,10 +1472,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 `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.")
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.")
}
if (any(c("colour", "color") %in% aesthetics) && message_not_thrown_before("scale_sir_colours", "colour", entire_session = TRUE)) {
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.")
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.")
}
if ("colours" %in% names(list(...))) {
@@ -1506,7 +1619,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 `colours_SIR`. Expected any of: ", vector_or(levels(NA_sir_), quotes = FALSE, sort = FALSE), "."
"Unknown names in {.arg 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)
+36 -11
View File
@@ -38,6 +38,11 @@
#' @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".
@@ -228,10 +233,20 @@
resistance <- function(...,
minimum = 30,
as_percent = FALSE,
only_all_tested = FALSE) {
only_all_tested = FALSE,
guideline = getOption("AMR_guideline", "EUCAST")) {
# other arguments for meet_criteria are handled by sir_calc()
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.")
}
tryCatch(
sir_calc(...,
ab_result = "R",
ab_result = c(
"R", "NWT", "NS",
if (identical(guideline, "CLSI")) "I"
),
minimum = minimum,
as_percent = as_percent,
only_all_tested = only_all_tested,
@@ -246,10 +261,20 @@ resistance <- function(...,
susceptibility <- function(...,
minimum = 30,
as_percent = FALSE,
only_all_tested = FALSE) {
only_all_tested = FALSE,
guideline = getOption("AMR_guideline", "EUCAST")) {
# other arguments for meet_criteria are handled by sir_calc()
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.")
}
tryCatch(
sir_calc(...,
ab_result = c("S", "SDD", "I"),
ab_result = c(
"S", "SDD", "WT",
if (identical(guideline, "EUCAST")) "I"
),
minimum = minimum,
as_percent = as_percent,
only_all_tested = only_all_tested,
@@ -269,7 +294,7 @@ sir_confidence_interval <- function(...,
confidence_level = 0.95,
side = "both",
collapse = FALSE) {
meet_criteria(ab_result, allow_class = c("character", "sir"), has_length = c(1:5), is_in = c("S", "SDD", "I", "R", "NI"))
meet_criteria(ab_result, allow_class = c("character", "sir"), has_length = seq_along(VALID_SIR_LEVELS), is_in = VALID_SIR_LEVELS)
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)
@@ -287,7 +312,7 @@ sir_confidence_interval <- function(...,
)
n <- tryCatch(
sir_calc(...,
ab_result = c("S", "SDD", "I", "R", "NI"),
ab_result = VALID_SIR_LEVELS,
only_all_tested = only_all_tested,
only_count = TRUE
),
@@ -321,7 +346,7 @@ sir_confidence_interval <- function(...,
if (n < minimum) {
warning_("Introducing NA: ",
ifelse(n == 0, "no", paste("only", n)),
" results available for `sir_confidence_interval()` (`minimum` = ", minimum, ").",
" results available for {.help [{.fun sir_confidence_interval}](AMR::sir_confidence_interval)} (whilst {.arg minimum = ", minimum, "}).",
call = FALSE
)
if (is.character(out)) {
@@ -341,7 +366,7 @@ proportion_R <- function(...,
only_all_tested = FALSE) {
tryCatch(
sir_calc(...,
ab_result = "R",
ab_result = c("R", "NWT", "NS"),
minimum = minimum,
as_percent = as_percent,
only_all_tested = only_all_tested,
@@ -359,7 +384,7 @@ proportion_IR <- function(...,
only_all_tested = FALSE) {
tryCatch(
sir_calc(...,
ab_result = c("I", "SDD", "R"),
ab_result = c("I", "SDD", "R", "NWT", "NS"),
minimum = minimum,
as_percent = as_percent,
only_all_tested = only_all_tested,
@@ -395,7 +420,7 @@ proportion_SI <- function(...,
only_all_tested = FALSE) {
tryCatch(
sir_calc(...,
ab_result = c("S", "I", "SDD"),
ab_result = c("S", "I", "SDD", "WT"),
minimum = minimum,
as_percent = as_percent,
only_all_tested = only_all_tested,
@@ -413,7 +438,7 @@ proportion_S <- function(...,
only_all_tested = FALSE) {
tryCatch(
sir_calc(...,
ab_result = "S",
ab_result = c("S", "WT"),
minimum = minimum,
as_percent = as_percent,
only_all_tested = only_all_tested,
+5 -5
View File
@@ -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 `model` argument, e.g. resistance_predict(..., model = "binomial")')
stop_if(is.null(model), 'choose a regression model with the {.arg model} argument, e.g. {.code 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), "`col_date` must be set")
stop_if(is.null(col_date), "{.arg col_date} must be set")
}
stop_ifnot(
col_date %in% colnames(x),
"column '", col_date, "' not found"
"column {.code ", 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 `?resistance_predict`.")
stop("no valid model selected. See {.help [{.fun resistance_predict}](AMR::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"), "`x` must be a resistance prediction model created with resistance_predict()")
stop_ifnot(inherits(x, "resistance_predict"), "{.arg x} must be a resistance prediction model created with {.fun resistance_predict}")
if (attributes(x)$I_as_S == TRUE) {
ylab <- "%R"
+522 -306
View File
File diff suppressed because it is too large Load Diff
+16 -19
View File
@@ -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", "numeric", "integer"), has_length = c(1:5))
meet_criteria(ab_result, allow_class = c("character", "sir"), has_length = seq_along(VALID_SIR_LEVELS), is_in = VALID_SIR_LEVELS)
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,11 +60,6 @@ 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)) {
@@ -117,6 +112,8 @@ 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)
@@ -142,15 +139,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 `", 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)
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)
}
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, levels(ab_result)), ab_result)
other_values <- setdiff(c(NA, denominator_vals), 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 `", 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)
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)
}
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))))
@@ -162,16 +159,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, '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, {.val 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% levels(ab_result), na.rm = TRUE)
denominator <- sum(x %in% denominator_vals, na.rm = TRUE)
}
if (print_warning == TRUE) {
if (message_not_thrown_before("sir_calc")) {
warning_("Increase speed by transforming to class 'sir' on beforehand:\n",
" your_data %>% mutate_if(is_sir_eligible, as.sir)",
warning_("Increase speed by transforming to class {.cls sir} on beforehand:\n",
highlight_code(" your_data %>% mutate_if(is_sir_eligible, as.sir)"),
call = FALSE
)
}
@@ -207,7 +204,7 @@ sir_calc <- function(...,
ifelse(denominator == 0, "no", paste("only", denominator)),
" results available",
data_vars,
" (`minimum` = ", minimum, ").",
" (whilst {.arg minimum = ", minimum, "}).",
call = FALSE
)
fraction <- NA_real_
@@ -259,13 +256,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(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"
if (isTRUE(combine_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("I", "S")), i] <- "SI"
}
data[which(!data[, i, drop = TRUE] %in% c("S", "SI", "I", "R")), i] <- NA_character_
}
}
BIN
View File
Binary file not shown.
+63 -44
View File
@@ -1,26 +1,26 @@
#' AMR Extensions for Tidymodels
#'
#' This family of functions allows using AMR-specific data types such as `<mic>` and `<sir>` inside `tidymodels` pipelines.
#' This family of functions allows using AMR-specific data types such as `<sir>` and `<mic>` 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_mic()] and [all_mic_predictors()] to select `<mic>` columns
#' - [all_sir()] and [all_sir_predictors()] to select `<sir>` columns
#' - [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
#'
#' Pre-processing pipeline steps include:
#' - [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.
#' - [step_mic_log2()] to convert MIC columns to numeric (via `as.numeric()`) and apply a log2 transform, to be used with [all_mic_predictors()]
#'
#' 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.mic()], [as.sir()]
#' @seealso [recipes::recipe()], [as.sir()], [as.mic()], [as.disk()]
#' @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,13 +39,10 @@
#'
#' # 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()
#'
@@ -66,48 +63,71 @@
#' bind_cols(out_testing)
#'
#' # Evaluate predictions using standard classification metrics
#' our_metrics <- metric_set(accuracy, kap, ppv, npv)
#' our_metrics <- metric_set(
#' accuracy,
#' recall,
#' precision,
#' sensitivity,
#' specificity,
#' ppv,
#' npv
#' )
#' metrics <- our_metrics(predictions, truth = esbl, estimate = .pred_class)
#'
#' # Show performance
#' metrics
#' }
all_mic <- function() {
x <- tidymodels_amr_select(levels(NA_mic_))
names(x)
}
#' @rdname amr-tidymodels
#' @export
all_mic_predictors <- function() {
x <- tidymodels_amr_select(levels(NA_mic_))
intersect(x, recipes::has_role("predictor"))
}
#' @rdname amr-tidymodels
#' @export
all_sir <- function() {
x <- tidymodels_amr_select(levels(NA_sir_))
x <- tidymodels_amr_select(class = "sir")
names(x)
}
#' @rdname amr-tidymodels
#' @export
all_sir_predictors <- function() {
x <- tidymodels_amr_select(levels(NA_sir_))
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")
names(x)
}
#' @rdname amr-tidymodels
#' @export
all_mic_predictors <- function() {
x <- tidymodels_amr_select(class = "mic")
intersect(x, recipes::has_role("predictor"))
}
#' @rdname amr-tidymodels
#' @export
all_disk <- function() {
x <- tidymodels_amr_select(class = "disk")
names(x)
}
#' @rdname amr-tidymodels
#' @export
all_disk_predictors <- function() {
x <- tidymodels_amr_select(class = "disk")
intersect(x, recipes::has_role("predictor"))
}
#' @rdname amr-tidymodels
#' @export
step_mic_log2 <- function(
recipe,
...,
role = NA,
trained = FALSE,
columns = NULL,
skip = FALSE,
id = recipes::rand_id("mic_log2")) {
recipe,
...,
role = NA,
trained = FALSE,
columns = NULL,
skip = FALSE,
id = recipes::rand_id("mic_log2")
) {
recipes::add_step(
recipe,
step_mic_log2_new(
@@ -160,7 +180,6 @@ 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)
@@ -177,13 +196,14 @@ tidy.step_mic_log2 <- function(x, ...) {
#' @rdname amr-tidymodels
#' @export
step_sir_numeric <- function(
recipe,
...,
role = NA,
trained = FALSE,
columns = NULL,
skip = FALSE,
id = recipes::rand_id("sir_numeric")) {
recipe,
...,
role = NA,
trained = FALSE,
columns = NULL,
skip = FALSE,
id = recipes::rand_id("sir_numeric")
) {
recipes::add_step(
recipe,
step_sir_numeric_new(
@@ -236,7 +256,6 @@ 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)
@@ -250,13 +269,13 @@ tidy.step_sir_numeric <- function(x, ...) {
res
}
tidymodels_amr_select <- function(check_vector) {
tidymodels_amr_select <- function(class) {
df <- get_current_data()
ind <- which(
vapply(
FUN.VALUE = logical(1),
df,
function(x) all(x %in% c(check_vector, NA), na.rm = TRUE) & any(x %in% check_vector),
function(x) inherits(x, class),
USE.NAMES = TRUE
),
useNames = TRUE
+2 -2
View File
@@ -32,7 +32,7 @@
#' 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 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 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 `"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`.
@@ -62,7 +62,7 @@ top_n_microorganisms <- function(x, n, property = "species", n_for_each = NULL,
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), "`col_mo` must be set")
stop_if(is.null(col_mo), "{.arg col_mo} must be set")
}
x.bak <- x
+23 -15
View File
@@ -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 ", font_url("https://github.com/msberends/AMR/issues"), ". Many thanks!")
warning_("Translation not possible. Please create an issue at {.url https://github.com/msberends/AMR/issues}. Many thanks!")
return(FALSE)
}
)
@@ -263,19 +263,27 @@ translate_into_language <- function(from,
df_trans$pattern[df_trans$regular_expr == TRUE] <- gsub("$$", "$", df_trans$pattern[df_trans$regular_expr == TRUE], fixed = TRUE)
}
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]
# 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],
)
}
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
@@ -285,11 +293,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(word_wrap(
message(font_blue(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.",
add_fn = list(font_blue), as_note = TRUE
))
as_note = TRUE
)))
}
out
+1 -1
View File
@@ -124,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 `?AMR-deprecated`."
" and will be removed in a future version, see {.topic [AMR-deprecated](AMR::AMR-deprecated)}."
)
),
ifelse(!is.null(extra_msg),
+12 -6
View File
@@ -115,35 +115,41 @@ 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("The file with custom antimicrobials must be an RDS file. Set the option `AMR_custom_ab` to another path.")
packageStartupMessage(format_inline_("The file with custom antimicrobials must be an RDS file. Set the option {.code AMR_custom_ab} to another path."))
} else {
packageStartupMessage("Adding custom antimicrobials from '", getOption("AMR_custom_ab"), "'...", appendLF = FALSE)
packageStartupMessage(format_inline_("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("Failed: ", conditionMessage(e))
error = function(e) packageStartupMessage(format_inline_("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("The file with custom microorganisms must be an RDS file. Set the option `AMR_custom_mo` to another path.")
packageStartupMessage(format_inline_("The file with custom microorganisms must be an RDS file. Set the option {.code AMR_custom_mo} to another path."))
} else {
packageStartupMessage("Adding custom microorganisms from '", getOption("AMR_custom_mo"), "'...", appendLF = FALSE)
packageStartupMessage(format_inline_("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("Failed: ", conditionMessage(e))
error = function(e) packageStartupMessage(format_inline_("Failed: ", conditionMessage(e)))
)
}
}
+4 -1
View File
@@ -49,8 +49,11 @@ 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:
If this does not work, try to install directly from GitHub using the `remotes` package:
```{r, eval = FALSE}
remotes::install_github("msberends/AMR")
```
+6 -2
View File
@@ -15,7 +15,7 @@ Overview:
even WISCA
- Provides the **full microbiological taxonomy** of ~79 000 distinct
species and extensive info of ~620 antimicrobial drugs
- Applies **CLSI 2011-2025** and **EUCAST 2011-2025** clinical and
- Applies **CLSI 2011-2026** and **EUCAST 2011-2026** clinical and
veterinary breakpoints, and ECOFFs, for MIC and disk zone
interpretation
- Corrects for duplicate isolates, **calculates** and **predicts** AMR
@@ -58,8 +58,12 @@ 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:
If this does not work, try to install directly from GitHub using the
`remotes` package:
``` r
remotes::install_github("msberends/AMR")
```
+5 -3
View File
@@ -245,12 +245,14 @@ reference:
- title: "Other: miscellaneous functions"
desc: >
These functions are mostly for internal use, but some of
them may also be suitable for your analysis. Especially the
'like' function can be useful: `if (x %like% y) {...}`.
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) {...}`.
contents:
- "`age_groups`"
- "`age`"
- "`amr_course`"
- "`export_ncbi_biosample`"
- "`availability`"
- "`get_AMR_locale`"
+2
View File
@@ -1,3 +1,5 @@
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 -11
View File
@@ -15,8 +15,10 @@ 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)
@@ -48,9 +50,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()
```
@@ -58,12 +60,14 @@ 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()
```
+31 -3
View File
@@ -141,6 +141,32 @@ import numpy as np
# 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):
@@ -166,10 +192,13 @@ def convert_to_python(r_output):
return r_output
def r_to_python(r_func):
"""Decorator that runs an rpy2 function under a localconverter
and then applies convert_to_python to its output."""
"""Decorator that converts Python list/tuple inputs to typed R vectors,
runs the rpy2 function under a localconverter, and converts the output
to a Python type."""
@functools.wraps(r_func)
def wrapper(*args, **kwargs):
args = tuple(convert_to_r(a) for a in args)
kwargs = {k: convert_to_r(v) for k, v in kwargs.items()}
with localconverter(default_converter + numpy2ri.converter + pandas2ri.converter):
return convert_to_python(r_func(*args, **kwargs))
return wrapper
@@ -312,4 +341,3 @@ cd ../PythonPackage/AMR
pip3 install build
python3 -m build
# python3 setup.py sdist bdist_wheel
+201 -40
View File
@@ -366,9 +366,12 @@ pre_commit_lst$MO_RELEVANT_GENERA <- c(
# antibiotic groups
# (these will also be used for eucast_rules() and understanding data-raw/eucast_rules.tsv)
pre_commit_lst$AB_AMINOGLYCOSIDES <- antimicrobials %>%
filter(group %like% "aminoglycoside") %>%
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") %>%
pull(ab)
pre_commit_lst$AB_AMINOPENICILLINS <- as.ab(c("AMP", "AMX"))
pre_commit_lst$AB_ANTIFUNGALS <- antimicrobials %>%
filter(group %like% "antifungal") %>%
pull(ab)
@@ -397,26 +400,28 @@ 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)" & name %unlike% "screening|inducible")) %>%
filter(atc_group2 %like% "lincosamide" | (group %like% "lincosamide" & is.na(atc_group2) & name %like% "^(pirlimycin|clinda)")) %>%
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|solith?romycin|tildipirosin|tilmicosin|tulath?romycin|tylosin|tylvalosin)" & name %unlike% "screening|inducible")) %>%
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)") %>%
pull(ab)
pre_commit_lst$AB_MONOBACTAMS <- antimicrobials %>%
filter(group %like% "monobactam") %>%
filter(group %like% "monobactam" | name %like% "aztreonam|carumonam|tigemonam") %>%
pull(ab)
pre_commit_lst$AB_NITROFURANS <- antimicrobials %>%
filter(name %like% "^furaz|nitrofura" | atc_group2 %like% "nitrofuran") %>%
@@ -427,56 +432,178 @@ 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") %>%
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") %>%
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") %>%
filter(atc_group2 %like% "streptogramin" | name %like% "streptogramin|virginiamycin|ostreogrycin") %>%
pull(ab)
pre_commit_lst$AB_TETRACYCLINES <- antimicrobials %>%
filter(group %like% "tetracycline") %>%
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") %>%
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(group %like% "trimethoprim") %>%
filter(atc_group1 %like% "trimethoprim" | atc_group2 %like% "trimethoprim" | name %like% "trimethoprim|ormetroprim|iclaprim") %>%
pull(ab)
pre_commit_lst$AB_SULFONAMIDES <- antimicrobials %>%
filter(group %like% "trimethoprim" & name %unlike% "trimethoprim") %>%
filter(name %like% "(^|/)sulf[oai]") %>%
pull(ab)
pre_commit_lst$AB_UREIDOPENICILLINS <- as.ab(c("PIP", "TZP", "AZL", "MEZ"))
pre_commit_lst$AB_BETALACTAMS <- sort(c(pre_commit_lst$AB_PENICILLINS, pre_commit_lst$AB_CEPHALOSPORINS, pre_commit_lst$AB_CARBAPENEMS, pre_commit_lst$AB_MONOBACTAMS))
pre_commit_lst$AB_BETALACTAMS <- 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_WITH_INHIBITOR <- antimicrobials %>%
filter(name %like% "/" & name %unlike% "EDTA" & ab %in% pre_commit_lst$AB_BETALACTAMS) %>%
filter(ab %in% pre_commit_lst$AB_BETALACTAMS & name %like% "/" & name %unlike% "EDTA") %>%
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")) {
@@ -498,7 +625,9 @@ 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)
@@ -636,24 +765,55 @@ 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")
invisible(urlchecker::url_update("."))
# 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))
}
# 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 ------------------------------------------------------------
@@ -664,13 +824,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))
@@ -679,5 +839,6 @@ 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,10 +763,12 @@ 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)
@@ -777,9 +779,11 @@ 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)
@@ -791,109 +795,123 @@ 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))
)
)
@@ -912,7 +930,94 @@ 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 -------------------------------------
@@ -921,7 +1026,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")
}
@@ -986,8 +1091,10 @@ 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)
@@ -1089,13 +1196,14 @@ 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 <- "(pa?ediatric|injection|oral|inhale|otic|sulfate|sulphate|sodium|base|anhydrous|anhydrate|stearate|syrup|natrium|hydrate|x?hcl|gsalt|vet[.]?)"
pharm_terms <- "(antibiotic|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)
@@ -1112,6 +1220,11 @@ 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,42 +35,49 @@ 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
# (for ASIARS-Net update, also copy C:\WHONET\Codes to the data-raw/WHONET/ folder)
# BE SURE TO RUN data-raw/_reproduction_scripts/reproduction_of_microorganisms.groups.R FIRST TO GET THE GROUPS!
# For non-interactive use
if (!interactive()) {
View <- glimpse
}
# READ DATA ----
whonet_organisms <- read_tsv("data-raw/WHONET/Resources/Organisms.txt", na = c("", "NA", "-"), show_col_types = FALSE) |>
# 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) |>
# remove old taxonomic names
filter(TAXONOMIC_STATUS == "C") |>
mutate(ORGANISM_CODE = toupper(WHONET_ORG_CODE))
whonet_breakpoints <- read_tsv("data-raw/WHONET/Resources/Breakpoints.txt", na = c("", "NA", "-"),
show_col_types = FALSE, guess_max = Inf) |>
whonet_breakpoints_raw <- read_tsv(file_breakpoints, na = c("", "NA", "-"), show_col_types = FALSE, guess_max = Inf) |>
filter(GUIDELINES %in% c("CLSI", "EUCAST"))
whonet_antibiotics <- read_tsv("data-raw/WHONET/Resources/Antibiotics.txt", na = c("", "NA", "-"), show_col_types = FALSE) |>
whonet_antibiotics_raw <- read_tsv(file_antibiotics, na = c("", "NA", "-"), show_col_types = FALSE, guess_max = Inf) |>
arrange(WHONET_ABX_CODE) |>
distinct(WHONET_ABX_CODE, .keep_all = TRUE)
# MICROORGANISMS WHONET CODES ----
whonet_organisms <- whonet_organisms |>
whonet_organisms <- whonet_organisms_raw |>
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)
@@ -81,55 +88,78 @@ 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")
@@ -137,9 +167,10 @@ 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()]
@@ -150,17 +181,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
microorganisms.codes <- microorganisms.codes2 |> distinct()
# Run this part to update ASIARS-Net:
# 2024-06-14: file not available anymore
@@ -199,42 +230,53 @@ devtools::load_all()
# now that we have the correct MO codes, get the breakpoints and convert them
whonet_breakpoints |>
count(GUIDELINES, BREAKPOINT_TYPE) |>
pivot_wider(names_from = BREAKPOINT_TYPE, values_from = n) |>
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) |>
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 |>
breakpoints <- whonet_breakpoints_raw |>
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$WHONET_ABX_CODE) |>
breakpoints |>
filter(!WHONET_ABX_CODE %in% whonet_antibiotics_raw$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 |>
@@ -244,7 +286,7 @@ 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)),
@@ -281,31 +323,39 @@ 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)
breakpoints_new <- breakpoints_new |>
filter(host %unlike% "foal") |>
count(guideline, host, ab)
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, etc, so as.mic() cannot be used to clean.
# WHONET has no >1024 but instead uses 1025, 513, and 129, 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]
@@ -316,6 +366,7 @@ 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)
@@ -323,16 +374,21 @@ 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:
breakpoints_new$mo[breakpoints_new$mo == "B_STRPT" & breakpoints_new$ref_tbl %like% "^strep.* a.* b.*c.*g"] <- as.mo("B_STRPT_ABCG")
# 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")
# Haemophilus same error (must only be H. influenzae)
breakpoints_new$mo[breakpoints_new$mo == "B_HMPHL" & breakpoints_new$ref_tbl %like% "^h.* influenzae"] <- as.mo("B_HMPHL_INFL")
# 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")
# EUCAST says that for H. parainfluenzae the H. influenza rules can be used, so add them
breakpoints_new <- breakpoints_new |>
breakpoints_new |>
filter(method == "MIC" & guideline %like% "EUCAST" & mo %like% as.mo("B_HMPHL")) |>
count(guideline, mo)
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
@@ -343,24 +399,60 @@ 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
# 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 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 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
@@ -381,24 +473,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 file, we have to remove duplicates
# 2024-06-19/ mostly ECOFFs, but there's no explanation in the whonet_breakpoints_raw df, 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 AND SAVE TO PACKAGE ----
# CHECKS ----
# check again
breakpoints_new |> filter(guideline == "EUCAST 2025", ab == "AMC", mo == "B_[ORD]_ENTRBCTR", method == "MIC")
breakpoints_new |> filter(guideline == "EUCAST 2026", ab == "AMC", mo == "B_[ORD]_ENTRBCTR", method == "MIC")
# compare with current version
clinical_breakpoints |> filter(guideline == "EUCAST 2024", ab == "AMC", mo == "B_[ORD]_ENTRBCTR", method == "MIC")
clinical_breakpoints |> filter(guideline == "EUCAST 2025", 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")
@@ -407,6 +499,24 @@ breakpoints_new |> filter(mo == "B_STRPT_PNMN", ab == "AMP", guideline == "EUCAS
dim(breakpoints_new)
dim(clinical_breakpoints)
# 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)
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 used in the clinical_breakpoints data set, and thus by as.sir().
# This data set is being referenced from in the clinical_breakpoints data set, and also 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,10 +36,6 @@ 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
@@ -48,9 +44,14 @@ devtools::load_all()
# READ DATA ----
whonet_organisms <- read_tsv("data-raw/WHONET/Resources/Organisms.txt", na = c("", "NA", "-"), show_col_types = FALSE) %>%
# 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) |>
# remove old taxonomic names
filter(TAXONOMIC_STATUS == "C") %>%
filter(TAXONOMIC_STATUS == "C") |>
mutate(ORGANISM_CODE = toupper(WHONET_ORG_CODE))
whonet_organisms <- whonet_organisms %>%
@@ -58,72 +59,101 @@ 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
@@ -132,38 +162,46 @@ 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-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)))
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)
))
# 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") %>%
@@ -174,9 +212,11 @@ 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
View File
@@ -1 +1 @@
228840b3941753c4adee2b781d901590
11aade8a39bfdff02d01fb52b04eacdc
+1 -1
View File
@@ -1 +1 @@
c7062e60fa4fbc2eee233044d15903ce
45068afc4cd9770dea329782c1aed045
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+416 -408
View File
@@ -1,498 +1,506 @@
"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/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"
"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"
"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" "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"
"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"
"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" "Beta-lactams/penicillins" "J01CA19,QJ01CA19" "apoxic,aspoxi" "aspoxicilina,aspoxicillan,aspoxicilline,aspoxicillinum,doyle" 4 "g" "NA"
"APX" 71961 "Aspoxicillin" "Penicillins,Beta-lactams" "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-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"
"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"
"BEK" 439318 "Bekanamycin" "Aminoglycosides" "J01GB13,QJ01GB13" "NA" "aminodeoxykanamycin,becanamicina,bekanamicina,bekanamycine,bekanamycinum" 0.6 "g" "NA"
"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"
"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"
"BLA-S" "Beta-lactamase screening test" "Other" "NA" "beta-lactamase,betalactamase,bl screen,blt screen" "NA" "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"
"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"
"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/antimycotics" "G01AF15,QG01AF15" "NA" "butaconazole,butoconazol,butoconazolum,gynofort" "NA"
"BUT" 47472 "Butoconazole" "Antifungals" "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" "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"
"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"
"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" "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"
"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"
"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" "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"
"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"
"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 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"
"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"
"CLM1" 54680675 "Clomocycline" "Tetracyclines" "J01AA11,QJ01AA11" "Tetracyclines" "Tetracyclines" "NA" "clomociclina,clomocyclinum,megaclor" 1 "g" "NA"
"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"
"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"
"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 antibacterials" "NA" "NA" "NA" "NA"
"COP" "Colistin/polysorbate" "Other" "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" "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"
"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"
"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" "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"
"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"
"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/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"
"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"
"EFF" "Efflux" "Other" "NA" "effflux pump" "NA" "NA"
"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"
"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"
"ENV" 135565326 "Enviomycin" "Antimycobacterials" "J04AB06,QJ04AB06" "tuberactinomycin" "enviomicina,enviomycina,enviomycine,enviomycinum,tuberactin" 1 "g" "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"
"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"
"ERV" 54726192 "Eravacycline" "Tetracyclines" "J01AA13,QJ01AA13" "Tetracyclines" "Tetracyclines" "erav" "xerava" 0.14 "g" "100049-6,85423-2,93767-2"
"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"
"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"
"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 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"
"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"
"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" "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"
"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"
"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/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"
"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"
"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" "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"
"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"
"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 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"
"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"
"HAB" 175989 "Habekacin" "Aminoglycosides" "NA" "NA" "amikafur,amikan,amitrex,arikayce,biklin,biodacyn,chemacin,fabianol,habekacinxsulfate,likacin,pierami" "NA"
"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"
"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"
"HYG" 56928061 "Hygromycin" "Aminoglycosides" "NA" "NA" "antihelmycin,destomysin,hyanthelmix,hygromix,hygrovectine,hygrovetine" "NA"
"IBX" "Ibrexafungerp" "Antifungals" "J02AX07,QJ02AX07" "NA" "NA" "NA"
"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"
"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"
"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/antimycotics" "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" "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" "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"
"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"
"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"
"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"
"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"
"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 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"
"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"
"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 antibacterials" "B05CA06,J01XX06,QB05CA06,QJ01XX06" "Other antibacterials" "Other antibacterials" "NA" "amygdalate,mandelsaeure,paramandelate,phenylglycolate,phenylhydroxyacetate,uromaline" 12 "g" "NA"
"MNA" 1292 "Mandelic acid" "Other" "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" "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"
"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"
"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" "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"
"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"
"MCR" 3037206 "Micronomicin" "Aminoglycosides" "QS01AA22,S01AA22" "micron" "micromicin,micromycin,micronomicina,micronomicine,micronomicinum,sagamicin,santemycin" "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"
"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"
"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/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"
"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"
"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" "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"
"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"
"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" "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"
"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"
"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 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"
"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"
"OMC" 54697325 "Omadacycline" "Tetracyclines" "J01AA15,QJ01AA15" "NA" "amadacycline" 0.3 "g" 0.1 "g" "73594-4,73616-5,73639-7"
"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"
"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"
"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" "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"
"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"
"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 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"
"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"
"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" "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"
"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"
"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" "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"
"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"
"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/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"
"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"
"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/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"
"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"
"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" "J01MA17,QJ01MA17" "Quinolone antibacterials" "Fluoroquinolones" "NA" "pruvel,quisnon,sword" 0.6 "g" "100058-7,76145-2"
"PRU" 65947 "Prulifloxacin" "Fluoroquinolones,Quinolones" "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" "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"
"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"
"RZF" "Rezafungin" "Antifungals" "NA" "NA" "NA" "NA"
"RBC" 44631912 "Ribociclib" "Antifungals/antimycotics" "L01EF02,QL01EF02" "Antimycotics for systemic use" "Triazole derivatives" "ribo" "kisqali" 0.45 "g" "NA"
"RBC" 44631912 "Ribociclib" "Antifungals" "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 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"
"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"
"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/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"
"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"
"SRC" 54681908 "Sarecycline" "Tetracyclines" "J01AA14,QJ01AA14" "Tetracyclines" "Tetracyclines" "NA" "sareciclina,seysara" 0.1 "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"
"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"
"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" "J01MA21,QJ01MA21" "sitafl" "gracevit" 0.1 "g" "NA"
"SIT" 461399 "Sitafloxacin" "Fluoroquinolones,Quinolones" "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/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"
"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"
"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-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"
"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"
"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" "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"
"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"
"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" "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"
"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"
"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" 9568512 "Thioacetazone" "Antimycobacterials" "J04AK07,QJ04AK07" "Drugs for treatment of tuberculosis" "Other drugs for treatment of tuberculosis" "NA" "NA" "NA"
"TAT" "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"
"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"
"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"
"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" "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"
"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"
"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 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"
"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"
"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" "J01MA22,QJ01MA22,QS01AE09,S01AE09" "tosufl" "NA" 0.45 "g" "100061-1,76146-0"
"TFX" 5517 "Tosufloxacin" "Fluoroquinolones,Quinolones" "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" "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"
"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"
"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" 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"
"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"
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.
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.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More