mirror of
https://github.com/msberends/AMR.git
synced 2026-11-29 06:46:14 +01:00
Built release reference for AMR@3.1.0
This commit is contained in:
1 parent
cc52a82ac7
commit
3d4356d3f7
69 files changed
+16479
No files matched your search
@@ -0,0 +1,335 @@
|
||||
# Apply Interpretive Rules
|
||||
|
||||
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](https://rdrr.io/r/base/data.frame.html) with advised
|
||||
dosages of a certain bug-drug combination, which is based on the
|
||||
[dosage](https://amr-for-r.org/release/3.1.0/reference/dosage.md) data
|
||||
set.
|
||||
|
||||
To improve the interpretation of the antibiogram before CLSI/EUCAST
|
||||
interpretive rules are applied, some AMR-specific rules can be applied
|
||||
at default, see *Details*.
|
||||
|
||||
## Usage
|
||||
|
||||
``` r
|
||||
interpretive_rules(
|
||||
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,
|
||||
version_expected_phenotypes = 1.2,
|
||||
version_expertrules = 3.3,
|
||||
ampc_cephalosporin_resistance = NA,
|
||||
only_sir_columns = any(is.sir(x)),
|
||||
custom_rules = NULL,
|
||||
overwrite = FALSE,
|
||||
add_if_missing = TRUE,
|
||||
...
|
||||
)
|
||||
|
||||
eucast_rules(
|
||||
x,
|
||||
col_mo = NULL,
|
||||
info = interactive(),
|
||||
rules = getOption("AMR_interpretive_rules", default = c("breakpoints",
|
||||
"expected_phenotypes")),
|
||||
...
|
||||
)
|
||||
|
||||
clsi_rules(
|
||||
x,
|
||||
col_mo = NULL,
|
||||
info = interactive(),
|
||||
rules = getOption("AMR_interpretive_rules", default = c("breakpoints",
|
||||
"expected_phenotypes")),
|
||||
...
|
||||
)
|
||||
|
||||
eucast_dosage(ab, administration = "iv", version_breakpoints = 15)
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
- x:
|
||||
|
||||
A data set with antimicrobials columns, such as `amox`, `AMX` and
|
||||
`AMC`.
|
||||
|
||||
- col_mo:
|
||||
|
||||
Column name of the names or codes of the microorganisms (see
|
||||
[`as.mo()`](https://amr-for-r.org/release/3.1.0/reference/as.mo.md)) -
|
||||
the default is the first column of class
|
||||
[`mo`](https://amr-for-r.org/release/3.1.0/reference/as.mo.md). Values
|
||||
will be coerced using
|
||||
[`as.mo()`](https://amr-for-r.org/release/3.1.0/reference/as.mo.md).
|
||||
|
||||
- info:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
|
||||
progress should be printed to the console - the default is only print
|
||||
while in interactive sessions.
|
||||
|
||||
- rules:
|
||||
|
||||
A [character](https://rdrr.io/r/base/character.html) 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`](https://amr-for-r.org/release/3.1.0/reference/AMR-options.md):
|
||||
`options(AMR_interpretive_rules = "all")`. If using `"custom"`, be
|
||||
sure to fill in argument `custom_rules` too. Custom rules can be
|
||||
created with
|
||||
[`custom_interpretive_rules()`](https://amr-for-r.org/release/3.1.0/reference/custom_interpretive_rules.md).
|
||||
|
||||
- guideline:
|
||||
|
||||
A guideline name, either "EUCAST" (default) or "CLSI". This can be set
|
||||
with the package option
|
||||
[`AMR_guideline`](https://amr-for-r.org/release/3.1.0/reference/AMR-options.md).
|
||||
|
||||
- verbose:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) 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.
|
||||
|
||||
- version_breakpoints:
|
||||
|
||||
The version number to use for the EUCAST Clinical Breakpoints
|
||||
guideline. Can be `"16.0"`, `"15.0"`, `"14.0"`, `"13.1"`, `"12.0"`,
|
||||
`"11.0"`, or `"10.0"`.
|
||||
|
||||
- version_expected_phenotypes:
|
||||
|
||||
The version number to use for the EUCAST Expected Phenotypes. Can be
|
||||
`"1.2"`.
|
||||
|
||||
- version_expertrules:
|
||||
|
||||
The version number to use for the EUCAST Expert Rules and Intrinsic
|
||||
Resistance guideline. Can be `"3.3"`.
|
||||
|
||||
- ampc_cephalosporin_resistance:
|
||||
|
||||
(only applies when `rules` contains `"expert"` or `"all"`) a
|
||||
[character](https://rdrr.io/r/base/character.html) 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"`.
|
||||
For *EUCAST Expert Rules* v3.2, this rule applies to: *Citrobacter
|
||||
braakii*, *Citrobacter freundii*, *Citrobacter gillenii*, *Citrobacter
|
||||
murliniae*, *Citrobacter rodenticum*, *Citrobacter sedlakii*,
|
||||
*Citrobacter werkmanii*, *Citrobacter youngae*, *Enterobacter*,
|
||||
*Hafnia alvei*, and *Klebsiella aerogenes*.
|
||||
|
||||
- only_sir_columns:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) to indicate whether
|
||||
only antimicrobial columns must be included that were transformed to
|
||||
class [sir](https://amr-for-r.org/release/3.1.0/reference/as.sir.md)
|
||||
on beforehand. Defaults to `FALSE` if no columns of `x` have a class
|
||||
[sir](https://amr-for-r.org/release/3.1.0/reference/as.sir.md).
|
||||
|
||||
- custom_rules:
|
||||
|
||||
Custom rules to apply, created with
|
||||
[`custom_interpretive_rules()`](https://amr-for-r.org/release/3.1.0/reference/custom_interpretive_rules.md).
|
||||
|
||||
- overwrite:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) 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".
|
||||
|
||||
- add_if_missing:
|
||||
|
||||
A [logical](https://rdrr.io/r/base/logical.html) 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.
|
||||
|
||||
- ...:
|
||||
|
||||
Column names of antimicrobials. To automatically detect antimicrobial
|
||||
column names, do not provide any named arguments;
|
||||
[`guess_ab_col()`](https://amr-for-r.org/release/3.1.0/reference/guess_ab_col.md)
|
||||
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.
|
||||
|
||||
- ab:
|
||||
|
||||
Any (vector of) text that can be coerced to a valid antimicrobial drug
|
||||
code with
|
||||
[`as.ab()`](https://amr-for-r.org/release/3.1.0/reference/as.ab.md).
|
||||
|
||||
- administration:
|
||||
|
||||
Route of administration, either `""`, `"im"`, `"iv"`, `"oral"`, or NA.
|
||||
|
||||
## Value
|
||||
|
||||
The input of `x`, possibly with edited values of antimicrobials. Or, if
|
||||
`verbose = TRUE`, a [data.frame](https://rdrr.io/r/base/data.frame.html)
|
||||
with all original and new values of the affected bug-drug combinations.
|
||||
|
||||
## Details
|
||||
|
||||
**Note:** This function does not translate MIC or disk values to SIR
|
||||
values. Use
|
||||
[`as.sir()`](https://amr-for-r.org/release/3.1.0/reference/as.sir.md)
|
||||
for that.
|
||||
**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.
|
||||
|
||||
The file containing all interpretive rules is located here:
|
||||
<https://github.com/msberends/AMR/blob/main/data-raw/interpretive_rules.tsv>.
|
||||
**Note:** Old taxonomic names are replaced with the current taxonomy
|
||||
where applicable. For example, *Ochrobactrum anthropi* was renamed to
|
||||
*Brucella anthropi* in 2020; older interpretive rules may not yet
|
||||
contain this new taxonomic name. The `AMR` package contains the full
|
||||
microbial taxonomy updated until 5th of October, 2026, see
|
||||
[microorganisms](https://amr-for-r.org/release/3.1.0/reference/microorganisms.md).
|
||||
|
||||
### Custom Rules
|
||||
|
||||
Custom rules can be created using
|
||||
[`custom_interpretive_rules()`](https://amr-for-r.org/release/3.1.0/reference/custom_interpretive_rules.md),
|
||||
e.g.:
|
||||
|
||||
x <- custom_interpretive_rules(AMC == "R" & genus == "Klebsiella" ~ aminopenicillins == "R",
|
||||
AMC == "I" & genus == "Klebsiella" ~ aminopenicillins == "I")
|
||||
|
||||
interpretive_rules(example_isolates, rules = "custom", custom_rules = x)
|
||||
|
||||
### 'Other' Rules
|
||||
|
||||
Before further processing, two non-EUCAST rules about drug combinations
|
||||
can be applied to improve the efficacy of the EUCAST rules, and the
|
||||
reliability of your data (analysis). These rules are:
|
||||
|
||||
1. A drug **with** enzyme inhibitor will be set to S if the same drug
|
||||
**without** enzyme inhibitor is S
|
||||
|
||||
2. A drug **without** enzyme inhibitor will be set to R if the same
|
||||
drug **with** enzyme inhibitor is R
|
||||
|
||||
Important examples include amoxicillin and amoxicillin/clavulanic acid,
|
||||
and trimethoprim and trimethoprim/sulfamethoxazole. Needless to say, for
|
||||
these rules to work, both drugs must be available in the data set.
|
||||
|
||||
Since these rules are not officially approved by EUCAST, they are not
|
||||
applied at default. To use these rules, include `"other"` to the `rules`
|
||||
argument, or use `interpretive_rules(..., rules = "all")`. You can also
|
||||
set the package option
|
||||
[`AMR_interpretive_rules`](https://amr-for-r.org/release/3.1.0/reference/AMR-options.md),
|
||||
i.e. run `options(AMR_interpretive_rules = "all")`.
|
||||
|
||||
## Download Our Reference Data
|
||||
|
||||
All reference data sets in the AMR package - including information on
|
||||
microorganisms, antimicrobials, and clinical breakpoints - are freely
|
||||
available for download in multiple formats: R, MS Excel, Apache Feather,
|
||||
Apache Parquet, SPSS, and Stata.
|
||||
|
||||
For maximum compatibility, we also provide machine-readable,
|
||||
tab-separated plain text files suitable for use in any software,
|
||||
including laboratory information systems.
|
||||
|
||||
Visit [our website for direct download
|
||||
links](https://amr-for-r.org/articles/datasets.html), or explore the
|
||||
actual files in [our GitHub
|
||||
repository](https://github.com/msberends/AMR/tree/main/data-raw/datasets).
|
||||
|
||||
## References
|
||||
|
||||
- EUCAST Expert Rules. Version 2.0, 2012.
|
||||
Leclercq et al. **EUCAST expert rules in antimicrobial susceptibility
|
||||
testing.** *Clin Microbiol Infect.* 2013;19(2):141-60;
|
||||
[doi:10.1111/j.1469-0691.2011.03703.x](https://doi.org/10.1111/j.1469-0691.2011.03703.x)
|
||||
|
||||
- EUCAST Expected Phenotypes.
|
||||
[(link)](https://www.eucast.org/bacteria/important-additional-information/expected-phenotypes/)
|
||||
|
||||
- EUCAST Breakpoint tables for interpretation of MICs and zone
|
||||
diameters.
|
||||
[(link)](https://www.eucast.org/bacteria/clinical-breakpoints-and-interpretation/clinical-breakpoint-tables/)
|
||||
|
||||
## Examples
|
||||
|
||||
``` r
|
||||
# \donttest{
|
||||
a <- data.frame(
|
||||
mo = c(
|
||||
"Staphylococcus aureus",
|
||||
"Enterococcus faecalis",
|
||||
"Escherichia coli",
|
||||
"Klebsiella pneumoniae",
|
||||
"Pseudomonas aeruginosa"
|
||||
),
|
||||
VAN = "-", # Vancomycin
|
||||
AMX = "-", # Amoxicillin
|
||||
COL = "-", # Colistin
|
||||
CAZ = "-", # Ceftazidime
|
||||
CXM = "-", # Cefuroxime
|
||||
PEN = "S", # Benzylpenicillin
|
||||
FOX = "S", # Cefoxitin
|
||||
stringsAsFactors = FALSE
|
||||
)
|
||||
|
||||
head(a)
|
||||
|
||||
|
||||
# apply EUCAST rules: some results wil be changed
|
||||
b <- eucast_rules(a, overwrite = TRUE)
|
||||
|
||||
head(b)
|
||||
|
||||
|
||||
# do not apply EUCAST rules, but rather get a data.frame
|
||||
# containing all details about the transformations:
|
||||
c <- eucast_rules(a, overwrite = TRUE, verbose = TRUE)
|
||||
head(c)
|
||||
# }
|
||||
|
||||
# Dosage guidelines:
|
||||
|
||||
eucast_dosage(c("tobra", "genta", "cipro"), "iv")
|
||||
|
||||
eucast_dosage(c("tobra", "genta", "cipro"), "iv", version_breakpoints = 10)
|
||||
```
|
||||
Reference in new issue
Block a user