From 11b4f3ac31adf0b5812ecf31817365d7d5e69301 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 16:00:08 +0000 Subject: [PATCH] Built site for AMR@2.1.1.9279: 26447fe --- 404.html | 4 +- LICENSE-text.html | 4 +- articles/AMR.html | 12 +- articles/AMR_for_Python.html | 4 +- articles/AMR_with_tidymodels.html | 4 +- articles/EUCAST.html | 4 +- articles/MDR.html | 406 ----------------------- articles/PCA.html | 4 +- articles/WHONET.html | 4 +- articles/WISCA.html | 4 +- articles/datasets.html | 6 +- articles/index.html | 6 +- authors.html | 4 +- index.html | 84 ++--- news/index.html | 25 +- pkgdown.yml | 3 +- reference/AMR-deprecated.html | 4 +- reference/AMR-options.html | 4 +- reference/AMR.html | 4 +- reference/WHOCC.html | 4 +- reference/WHONET.html | 4 +- reference/ab_from_text.html | 4 +- reference/ab_property.html | 4 +- reference/add_custom_antimicrobials.html | 4 +- reference/add_custom_microorganisms.html | 4 +- reference/age.html | 24 +- reference/age_groups.html | 4 +- reference/antibiogram.html | 4 +- reference/antimicrobial_selectors.html | 4 +- reference/antimicrobials.html | 4 +- reference/as.ab.html | 4 +- reference/as.av.html | 4 +- reference/as.disk.html | 4 +- reference/as.mic.html | 4 +- reference/as.mo.html | 4 +- reference/as.sir.html | 12 +- reference/atc_online.html | 4 +- reference/av_from_text.html | 4 +- reference/av_property.html | 4 +- reference/availability.html | 4 +- reference/bug_drug_combinations.html | 4 +- reference/c.custom_mdro_guideline.html | 8 + reference/clinical_breakpoints.html | 4 +- reference/count.html | 4 +- reference/custom_eucast_rules.html | 37 ++- reference/custom_mdro_guideline.html | 279 +++++++++++++++- reference/dosage.html | 4 +- reference/eucast_rules.html | 13 +- reference/example_isolates.html | 4 +- reference/example_isolates_unclean.html | 4 +- reference/export_ncbi_biosample.html | 4 +- reference/first_isolate.html | 4 +- reference/g.test.html | 4 +- reference/get_episode.html | 78 ++--- reference/ggplot_pca.html | 4 +- reference/ggplot_sir.html | 4 +- reference/guess_ab_col.html | 4 +- reference/index.html | 12 +- reference/intrinsic_resistant.html | 4 +- reference/italicise_taxonomy.html | 4 +- reference/join.html | 4 +- reference/key_antimicrobials.html | 4 +- reference/kurtosis.html | 8 +- reference/like.html | 4 +- reference/mdro.html | 131 +++----- reference/mean_amr_distance.html | 91 ++--- reference/microorganisms.codes.html | 4 +- reference/microorganisms.groups.html | 4 +- reference/microorganisms.html | 4 +- reference/mo_matching_score.html | 4 +- reference/mo_property.html | 4 +- reference/mo_source.html | 4 +- reference/pca.html | 4 +- reference/plot-1.png | Bin 37398 -> 37881 bytes reference/plot-10.png | Bin 58859 -> 63270 bytes reference/plot-12.png | Bin 71759 -> 72274 bytes reference/plot-13.png | Bin 92543 -> 94311 bytes reference/plot-14.png | Bin 89119 -> 91082 bytes reference/plot-15.png | Bin 26047 -> 26067 bytes reference/plot-16.png | Bin 39905 -> 39935 bytes reference/plot-17.png | Bin 27608 -> 26970 bytes reference/plot-18.png | Bin 40988 -> 40748 bytes reference/plot-19.png | Bin 40166 -> 39902 bytes reference/plot-2.png | Bin 61047 -> 61574 bytes reference/plot-20.png | Bin 27810 -> 28159 bytes reference/plot-3.png | Bin 54708 -> 59160 bytes reference/plot-9.png | Bin 78431 -> 79037 bytes reference/plot.html | 4 +- reference/proportion.html | 4 +- reference/random.html | 38 +-- reference/resistance_predict.html | 4 +- reference/skewness.html | 6 +- reference/top_n_microorganisms.html | 4 +- reference/translate.html | 4 +- search.json | 2 +- sitemap.xml | 2 +- 96 files changed, 677 insertions(+), 846 deletions(-) delete mode 100644 articles/MDR.html create mode 100644 reference/c.custom_mdro_guideline.html diff --git a/404.html b/404.html index 336dfb9de..9dd55b646 100644 --- a/404.html +++ b/404.html @@ -31,7 +31,7 @@ AMR (for R) - 2.1.1.9277 + 2.1.1.9279 - - - - - -
- - - - -
-
- - - -

With the function mdro(), you can determine which -micro-organisms are multi-drug resistant organisms (MDRO).

-
-

Type of input -

-

The mdro() function takes a data set as input, such as a -regular data.frame. It tries to automatically determine the -right columns for info about your isolates, such as the name of the -species and all columns with results of antimicrobial agents. See the -help page for more info about how to set the right settings for your -data with the command ?mdro.

-

For WHONET data (and most other data), all settings are automatically -set correctly.

-
-
-

Guidelines -

-

The mdro() function support multiple guidelines. You can -select a guideline with the guideline parameter. Currently -supported guidelines are (case-insensitive):

-
    -
  • -

    guideline = "CMI2012" (default)

    -

    Magiorakos AP, Srinivasan A et al. “Multidrug-resistant, -extensively drug-resistant and pandrug-resistant bacteria: an -international expert proposal for interim standard definitions for -acquired resistance.” Clinical Microbiology and Infection (2012) (link)

    -
  • -
  • -

    guideline = "EUCAST3.2" (or simply -guideline = "EUCAST")

    -

    The European international guideline - EUCAST Expert Rules Version -3.2 “Intrinsic Resistance and Unusual Phenotypes” (link)

    -
  • -
  • -

    guideline = "EUCAST3.1"

    -

    The European international guideline - EUCAST Expert Rules Version -3.1 “Intrinsic Resistance and Exceptional Phenotypes Tables” (link)

    -
  • -
  • -

    guideline = "TB"

    -

    The international guideline for multi-drug resistant tuberculosis - -World Health Organization “Companion handbook to the WHO guidelines for -the programmatic management of drug-resistant tuberculosis” (link)

    -
  • -
  • -

    guideline = "MRGN"

    -

    The German national guideline - Mueller et al. (2015) -Antimicrobial Resistance and Infection Control 4:7. DOI: -10.1186/s13756-015-0047-6

    -
  • -
  • -

    guideline = "BRMO"

    -

    The Dutch national guideline - Rijksinstituut voor Volksgezondheid en -Milieu “WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) -(ZKH)” (link)

    -
  • -
-

Please suggest your own (country-specific) guidelines by letting us -know: https://github.com/msberends/AMR/issues/new.

-
-

Custom Guidelines -

-

You can also use your own custom guideline. Custom guidelines can be -set with the custom_mdro_guideline() function. This is of -great importance if you have custom rules to determine MDROs in your -hospital, e.g., rules that are dependent on ward, state of contact -isolation or other variables in your data.

-

If you are familiar with case_when() of the -dplyr package, you will recognise the input method to set -your own rules. Rules must be set using what R considers to be the -‘formula notation’:

-
-custom <- custom_mdro_guideline(
-  CIP == "R" & age > 60 ~ "Elderly Type A",
-  ERY == "R" & age > 60 ~ "Elderly Type B"
-)
-

If a row/an isolate matches the first rule, the value after the first -~ (in this case ‘Elderly Type A’) will be set as -MDRO value. Otherwise, the second rule will be tried and so on. The -maximum number of rules is unlimited.

-

You can print the rules set in the console for an overview. Colours -will help reading it if your console supports colours.

-
-custom
-#> A set of custom MDRO rules:
-#>   1. If CIP is  R  and age is higher than 60 then: Elderly Type A
-#>   2. If ERY is  R  and age is higher than 60 then: Elderly Type B
-#>   3. Otherwise: Negative
-#> 
-#> Unmatched rows will return NA.
-#> Results will be of class 'factor', with ordered levels: Negative < Elderly Type A < Elderly Type B
-

The outcome of the function can be used for the -guideline argument in the mdro() function:

-
-x <- mdro(example_isolates, guideline = custom)
-table(x)
-#> x
-#>       Negative Elderly Type A Elderly Type B 
-#>           1070            198            732
-

The rules set (the custom object in this case) could be -exported to a shared file location using saveRDS() if you -collaborate with multiple users. The custom rules set could then be -imported using readRDS().

-
-
-
-

Examples -

-

The mdro() function always returns an ordered -factor for predefined guidelines. For example, the output -of the default guideline by Magiorakos et al. returns a -factor with levels ‘Negative’, ‘MDR’, ‘XDR’ or ‘PDR’ in -that order.

-

The next example uses the example_isolates data set. -This is a data set included with this package and contains full -antibiograms of 2,000 microbial isolates. It reflects reality and can be -used to practise AMR data analysis. If we test the MDR/XDR/PDR guideline -on this data set, we get:

-
-library(dplyr) # to support pipes: %>%
-library(cleaner) # to create frequency tables
-
-example_isolates %>%
-  mdro() %>%
-  freq() # show frequency table of the result
-#> Warning: in mdro(): NA introduced for isolates where the available percentage of
-#> antimicrobial classes was below 50% (set with pct_required_classes)
-

Frequency table

-

Class: factor > ordered (numeric)
-Length: 2,000
-Levels: 4: Negative < Multi-drug-resistant (MDR) < Extensively -drug-resistant …
-Available: 1,745 (87.25%, NA: 255 = 12.75%)
-Unique: 2

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - -
ItemCountPercentCum. CountCum. Percent
1Negative161792.66%161792.66%
2Multi-drug-resistant (MDR)1287.34%1745100.00%
-

For another example, I will create a data set to determine multi-drug -resistant TB:

-
-# random_sir() is a helper function to generate
-# a random vector with values S, I and R
-my_TB_data <- data.frame(
-  rifampicin = random_sir(5000),
-  isoniazid = random_sir(5000),
-  gatifloxacin = random_sir(5000),
-  ethambutol = random_sir(5000),
-  pyrazinamide = random_sir(5000),
-  moxifloxacin = random_sir(5000),
-  kanamycin = random_sir(5000)
-)
-

Because all column names are automatically verified for valid drug -names or codes, this would have worked exactly the same way:

-
-my_TB_data <- data.frame(
-  RIF = random_sir(5000),
-  INH = random_sir(5000),
-  GAT = random_sir(5000),
-  ETH = random_sir(5000),
-  PZA = random_sir(5000),
-  MFX = random_sir(5000),
-  KAN = random_sir(5000)
-)
-

The data set now looks like this:

-
-head(my_TB_data)
-#>   rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-#> 1          I         R            S          S            S            S
-#> 2          S         S            I          R            R            S
-#> 3          R         I            I          I            R            I
-#> 4          I         S            S          S            S            S
-#> 5          I         I            I          S            I            S
-#> 6          R         S            R          S            I            I
-#>   kanamycin
-#> 1         R
-#> 2         I
-#> 3         S
-#> 4         I
-#> 5         I
-#> 6         I
-

We can now add the interpretation of MDR-TB to our data set. You can -use:

-
-mdro(my_TB_data, guideline = "TB")
-

or its shortcut mdr_tb():

-
-my_TB_data$mdr <- mdr_tb(my_TB_data)
-#> ℹ No column found as input for col_mo, assuming all rows contain
-#>   Mycobacterium tuberculosis.
-

Create a frequency table of the results:

-
-freq(my_TB_data$mdr)
-

Frequency table

-

Class: factor > ordered (numeric)
-Length: 5,000
-Levels: 5: Negative < Mono-resistant < Poly-resistant < -Multi-drug-resistant <…
-Available: 5,000 (100%, NA: 0 = 0%)
-Unique: 5

- -------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ItemCountPercentCum. CountCum. Percent
1Mono-resistant322364.46%322364.46%
2Negative96719.34%419083.80%
3Multi-drug-resistant4549.08%464492.88%
4Poly-resistant2454.90%488997.78%
5Extensively drug-resistant1112.22%5000100.00%
-
-
-
- - - - -
- - - - - - - diff --git a/articles/PCA.html b/articles/PCA.html index 2095c287e..cb7496a48 100644 --- a/articles/PCA.html +++ b/articles/PCA.html @@ -30,7 +30,7 @@ AMR (for R) - 2.1.1.9277 + 2.1.1.9279 + + + + + +
+
+
+ +
+

Define custom a MDRO guideline for your organisation or specific analysis and use the output of this function in mdro().

+
+ +
+

Usage

+
custom_mdro_guideline(..., as_factor = TRUE)
+
+# S3 method for class 'custom_mdro_guideline'
+c(x, ..., as_factor = NULL)
+
+ +
+

Arguments

+ + +
...
+

Guideline rules in formula notation, see below for instructions, and in Examples.

+ + +
as_factor
+

A logical to indicate whether the returned value should be an ordered factor (TRUE, default), or otherwise a character vector. For combining rules sets (using c()) this value will be inherited from the first set at default.

+ + +
x
+

Existing custom MDRO rules

+ +
+
+

Value

+

A list containing the custom rules

+
+
+

Details

+

Using a custom MDRO guideline is of importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data.

+

Basics

+ + +

If you are familiar with the case_when() function of the dplyr package, you will recognise the input method to set your own rules. Rules must be set using what R considers to be the 'formula notation'. The rule itself is written before the tilde (~) and the consequence of the rule is written after the tilde:

+

custom <- custom_mdro_guideline(CIP == "R" & age > 60 ~ "Elderly Type A",
+                                ERY == "R" & age > 60 ~ "Elderly Type B")

+

If a row/an isolate matches the first rule, the value after the first ~ (in this case 'Elderly Type A') will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited.

+

You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.

+

custom
+#> A set of custom MDRO rules:
+#>   1. If CIP is R and age is higher than 60 then: Elderly Type A
+#>   2. If ERY is R and age is higher than 60 then: Elderly Type B
+#>   3. Otherwise: Negative
+
+#> Unmatched rows will return NA.
+#> Results will be of class 'factor', with ordered levels: Negative < Elderly Type A < Elderly Type B

+

The outcome of the function can be used for the guideline argument in the mdro() function:

+

x <- mdro(example_isolates, guideline = custom)
+#> Determining MDROs based on custom rules, resulting in factor levels: Negative < Elderly Type A < Elderly Type B.
+#> - Custom MDRO rule 1: CIP == "R" & age > 60 (198 rows matched)
+#> - Custom MDRO rule 2: ERY == "R" & age > 60 (732 rows matched)
+#> => Found 930 custom defined MDROs out of 2000 isolates (46.5%)
+
+table(x)
+#> x
+#>       Negative  Elderly Type A  Elderly Type B
+#>           1070             198             732

+

Rules can also be combined with other custom rules by using c():

+

x <- mdro(example_isolates,
+          guideline = c(custom,
+                        custom_mdro_guideline(ERY == "R" & age > 50 ~ "Elderly Type C")))
+#> Determining MDROs based on custom rules, resulting in factor levels: Negative < Elderly Type A < Elderly Type B < Elderly Type C.
+#> - Custom MDRO rule 1: CIP == "R" & age > 60 (198 rows matched)
+#> - Custom MDRO rule 2: ERY == "R" & age > 60 (732 rows matched)
+#> - Custom MDRO rule 3: ERY == "R" & age > 50 (109 rows matched)
+#> => Found 1039 custom defined MDROs out of 2000 isolates (52.0%)
+
+table(x)
+#> x
+#>       Negative  Elderly Type A  Elderly Type B  Elderly Type C
+#>            961             198             732             109

+
+ +
+

Sharing rules among multiple users

+ + +

The rules set (the custom object in this case) could be exported to a shared file location using saveRDS() if you collaborate with multiple users. The custom rules set could then be imported using readRDS().

+
+ +
+

Usage of multiple antimicrobials and antimicrobial group names

+ + +

You can define antimicrobial groups instead of single antimicrobials for the rule itself, which is the part before the tilde (~). Use any() or all() to specify the scope of the antimicrobial group:

+

custom_mdro_guideline(
+  AMX == "R"                       ~ "My MDRO #1",
+  any(cephalosporins_2nd() == "R") ~ "My MDRO #2",
+  all(glycopeptides() == "R")      ~ "My MDRO #3"
+)

+

All 35 antimicrobial selectors are supported for use in the rules:

  • aminoglycosides() can select:
    amikacin, amikacin/fosfomycin, apramycin, arbekacin, astromicin, bekanamycin, dibekacin, framycetin, gentamicin, gentamicin-high, habekacin, hygromycin, isepamicin, kanamycin, kanamycin-high, kanamycin/cephalexin, micronomicin, neomycin, netilmicin, pentisomicin, plazomicin, propikacin, ribostamycin, sisomicin, streptoduocin, streptomycin, streptomycin-high, tobramycin, and tobramycin-high

  • +
  • aminopenicillins() can select:
    amoxicillin and ampicillin

  • +
  • antifungals() can select:
    amorolfine, amphotericin B, amphotericin B-high, anidulafungin, butoconazole, caspofungin, ciclopirox, clotrimazole, econazole, fluconazole, flucytosine, fosfluconazole, griseofulvin, hachimycin, ibrexafungerp, isavuconazole, isoconazole, itraconazole, ketoconazole, manogepix, micafungin, miconazole, nystatin, oteseconazole, pimaricin, posaconazole, rezafungin, ribociclib, sulconazole, terbinafine, terconazole, and voriconazole

  • +
  • antimycobacterials() can select:
    4-aminosalicylic acid, calcium aminosalicylate, capreomycin, clofazimine, delamanid, enviomycin, ethambutol, ethambutol/isoniazid, ethionamide, isoniazid, isoniazid/sulfamethoxazole/trimethoprim/pyridoxine, morinamide, p-aminosalicylic acid, pretomanid, protionamide, pyrazinamide, rifabutin, rifampicin, rifampicin/ethambutol/isoniazid, rifampicin/isoniazid, rifampicin/pyrazinamide/ethambutol/isoniazid, rifampicin/pyrazinamide/isoniazid, rifamycin, rifapentine, simvastatin/fenofibrate, sodium aminosalicylate, streptomycin/isoniazid, terizidone, thioacetazone, thioacetazone/isoniazid, tiocarlide, and viomycin

  • +
  • betalactams() can select:
    amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, azidocillin, azlocillin, aztreonam, aztreonam/avibactam, aztreonam/nacubactam, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, benzylpenicillin screening test, biapenem, carbenicillin, carindacillin, carumonam, cefacetrile, cefaclor, cefadroxil, cefalexin, cefaloridine, cefalotin, cefamandole, cefapirin, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/tazobactam, cefepime/zidebactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefiderocol, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening test, cefozopran, cefpimizole, cefpiramide, cefpirome, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefprozil, cefquinome, cefroxadine, cefsulodin, cefsumide, ceftaroline, ceftaroline/avibactam, ceftazidime, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftezole, ceftibuten, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/tazobactam, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, cefuroxime, cefuroxime axetil, cephradine, ciclacillin, clometocillin, cloxacillin, dicloxacillin, doripenem, epicillin, ertapenem, flucloxacillin, hetacillin, imipenem, imipenem/EDTA, imipenem/relebactam, latamoxef, lenampicillin, loracarbef, mecillinam, meropenem, meropenem/nacubactam, meropenem/vaborbactam, metampicillin, meticillin, mezlocillin, mezlocillin/sulbactam, nafcillin, oxacillin, oxacillin screening test, panipenem, penamecillin, penicillin/novobiocin, penicillin/sulbactam, pheneticillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, razupenem, ritipenem, ritipenem acoxil, sarmoxicillin, sulbenicillin, sultamicillin, talampicillin, tebipenem, temocillin, ticarcillin, ticarcillin/clavulanic acid, and tigemonam

  • +
  • betalactams_with_inhibitor() can select:
    amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin/sulbactam, aztreonam/avibactam, aztreonam/nacubactam, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/tazobactam, cefepime/zidebactam, cefoperazone/sulbactam, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefpodoxime/clavulanic acid, ceftaroline/avibactam, ceftazidime/avibactam, ceftazidime/clavulanic acid, ceftolozane/tazobactam, ceftriaxone/beta-lactamase inhibitor, imipenem/relebactam, meropenem/nacubactam, meropenem/vaborbactam, mezlocillin/sulbactam, penicillin/novobiocin, penicillin/sulbactam, piperacillin/sulbactam, piperacillin/tazobactam, and ticarcillin/clavulanic acid

  • +
  • carbapenems() can select:
    biapenem, doripenem, ertapenem, imipenem, imipenem/EDTA, imipenem/relebactam, meropenem, meropenem/nacubactam, meropenem/vaborbactam, panipenem, razupenem, ritipenem, ritipenem acoxil, and tebipenem

  • +
  • cephalosporins() can select:
    cefacetrile, cefaclor, cefadroxil, cefalexin, cefaloridine, cefalotin, cefamandole, cefapirin, cefatrizine, cefazedone, cefazolin, cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/tazobactam, cefepime/zidebactam, cefetamet, cefetamet pivoxil, cefetecol, cefetrizole, cefiderocol, cefixime, cefmenoxime, cefmetazole, cefodizime, cefonicid, cefoperazone, cefoperazone/sulbactam, ceforanide, cefoselis, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotetan, cefotiam, cefotiam hexetil, cefovecin, cefoxitin, cefoxitin screening test, cefozopran, cefpimizole, cefpiramide, cefpirome, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefprozil, cefquinome, cefroxadine, cefsulodin, cefsumide, ceftaroline, ceftaroline/avibactam, ceftazidime, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftezole, ceftibuten, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftobiprole, ceftobiprole medocaril, ceftolozane/tazobactam, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, cefuroxime, cefuroxime axetil, cephradine, latamoxef, and loracarbef

  • +
  • cephalosporins_1st() can select:
    cefacetrile, cefadroxil, cefalexin, cefaloridine, cefalotin, cefapirin, cefatrizine, cefazedone, cefazolin, cefroxadine, ceftezole, and cephradine

  • +
  • cephalosporins_2nd() can select:
    cefaclor, cefamandole, cefmetazole, cefonicid, ceforanide, cefotetan, cefotiam, cefoxitin, cefoxitin screening test, cefprozil, cefuroxime, cefuroxime axetil, and loracarbef

  • +
  • cephalosporins_3rd() can select:
    cefcapene, cefcapene pivoxil, cefdinir, cefditoren, cefditoren pivoxil, cefetamet, cefetamet pivoxil, cefixime, cefmenoxime, cefodizime, cefoperazone, cefoperazone/sulbactam, cefotaxime, cefotaxime screening test, cefotaxime/clavulanic acid, cefotaxime/sulbactam, cefotiam hexetil, cefovecin, cefpimizole, cefpiramide, cefpodoxime, cefpodoxime proxetil, cefpodoxime/clavulanic acid, cefsulodin, ceftazidime, ceftazidime/avibactam, ceftazidime/clavulanic acid, cefteram, cefteram pivoxil, ceftibuten, ceftiofur, ceftizoxime, ceftizoxime alapivoxil, ceftriaxone, ceftriaxone/beta-lactamase inhibitor, and latamoxef

  • +
  • cephalosporins_4th() can select:
    cefepime, cefepime/amikacin, cefepime/clavulanic acid, cefepime/enmetazobactam, cefepime/nacubactam, cefepime/tazobactam, cefepime/zidebactam, cefetecol, cefoselis, cefozopran, cefpirome, and cefquinome

  • +
  • cephalosporins_5th() can select:
    ceftaroline, ceftaroline/avibactam, ceftobiprole, ceftobiprole medocaril, and ceftolozane/tazobactam

  • +
  • fluoroquinolones() can select:
    besifloxacin, ciprofloxacin, ciprofloxacin/metronidazole, ciprofloxacin/ornidazole, ciprofloxacin/tinidazole, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, lascufloxacin, levofloxacin, levofloxacin/ornidazole, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nemonoxacin, nifuroquine, nitroxoline, norfloxacin, norfloxacin screening test, norfloxacin/metronidazole, norfloxacin/tinidazole, ofloxacin, ofloxacin/ornidazole, orbifloxacin, pazufloxacin, pefloxacin, pefloxacin screening test, pradofloxacin, premafloxacin, prulifloxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin, and trovafloxacin

  • +
  • glycopeptides() can select:
    avoparcin, bleomycin, dalbavancin, norvancomycin, oritavancin, ramoplanin, teicoplanin, teicoplanin-macromethod, telavancin, vancomycin, and vancomycin-macromethod

  • +
  • isoxazolylpenicillins() can select:
    cloxacillin, dicloxacillin, flucloxacillin, meticillin, oxacillin, and oxacillin screening test

  • +
  • lincosamides() can select:
    clindamycin, lincomycin, and pirlimycin

  • +
  • lipoglycopeptides() can select:
    dalbavancin, oritavancin, and telavancin

  • +
  • macrolides() can select:
    acetylmidecamycin, acetylspiramycin, azithromycin, clarithromycin, dirithromycin, erythromycin, flurithromycin, gamithromycin, josamycin, kitasamycin, meleumycin, midecamycin, miocamycin, nafithromycin, oleandomycin, rokitamycin, roxithromycin, solithromycin, spiramycin, telithromycin, tildipirosin, tilmicosin, troleandomycin, tulathromycin, tylosin, and tylvalosin

  • +
  • monobactams() can select:
    aztreonam, aztreonam/avibactam, aztreonam/nacubactam, carumonam, and tigemonam

  • +
  • nitrofurans() can select:
    furazidin, furazolidone, nifurtoinol, nitrofurantoin, and nitrofurazone

  • +
  • oxazolidinones() can select:
    cadazolid, cycloserine, linezolid, tedizolid, and thiacetazone

  • +
  • penicillins() can select:
    amoxicillin, amoxicillin/clavulanic acid, amoxicillin/sulbactam, ampicillin, ampicillin/sulbactam, apalcillin, aspoxicillin, azidocillin, azlocillin, bacampicillin, benzathine benzylpenicillin, benzathine phenoxymethylpenicillin, benzylpenicillin, benzylpenicillin screening test, carbenicillin, carindacillin, ciclacillin, clometocillin, cloxacillin, dicloxacillin, epicillin, flucloxacillin, hetacillin, lenampicillin, mecillinam, metampicillin, meticillin, mezlocillin, mezlocillin/sulbactam, nafcillin, oxacillin, oxacillin screening test, penamecillin, penicillin/novobiocin, penicillin/sulbactam, pheneticillin, phenoxymethylpenicillin, piperacillin, piperacillin/sulbactam, piperacillin/tazobactam, piridicillin, pivampicillin, pivmecillinam, procaine benzylpenicillin, propicillin, sarmoxicillin, sulbenicillin, sultamicillin, talampicillin, temocillin, ticarcillin, and ticarcillin/clavulanic acid

  • +
  • phenicols() can select:
    chloramphenicol, florfenicol, and thiamphenicol

  • +
  • polymyxins() can select:
    colistin, polymyxin B, and polymyxin B/polysorbate 80

  • +
  • quinolones() can select:
    besifloxacin, cinoxacin, ciprofloxacin, ciprofloxacin/metronidazole, ciprofloxacin/ornidazole, ciprofloxacin/tinidazole, clinafloxacin, danofloxacin, delafloxacin, difloxacin, enoxacin, enrofloxacin, finafloxacin, fleroxacin, flumequine, garenoxacin, gatifloxacin, gemifloxacin, grepafloxacin, lascufloxacin, levofloxacin, levofloxacin/ornidazole, levonadifloxacin, lomefloxacin, marbofloxacin, metioxate, miloxacin, moxifloxacin, nadifloxacin, nalidixic acid, nalidixic acid screening test, nemonoxacin, nifuroquine, nitroxoline, norfloxacin, norfloxacin screening test, norfloxacin/metronidazole, norfloxacin/tinidazole, ofloxacin, ofloxacin/ornidazole, orbifloxacin, oxolinic acid, pazufloxacin, pefloxacin, pefloxacin screening test, pipemidic acid, piromidic acid, pradofloxacin, premafloxacin, prulifloxacin, rosoxacin, rufloxacin, sarafloxacin, sitafloxacin, sparfloxacin, temafloxacin, tilbroquinol, tioxacin, tosufloxacin, and trovafloxacin

  • +
  • rifamycins() can select:
    rifabutin, rifampicin, rifampicin/ethambutol/isoniazid, rifampicin/isoniazid, rifampicin/pyrazinamide/ethambutol/isoniazid, rifampicin/pyrazinamide/isoniazid, rifamycin, and rifapentine

  • +
  • streptogramins() can select:
    pristinamycin and quinupristin/dalfopristin

  • +
  • sulfonamides() can select:
    brodimoprim, sulfadiazine, sulfadiazine/tetroxoprim, sulfadimethoxine, sulfadimidine, sulfafurazole, sulfaisodimidine, sulfalene, sulfamazone, sulfamerazine, sulfamethizole, sulfamethoxazole, sulfamethoxypyridazine, sulfametomidine, sulfametoxydiazine, sulfamoxole, sulfanilamide, sulfaperin, sulfaphenazole, sulfapyridine, sulfathiazole, and sulfathiourea

  • +
  • tetracyclines() can select:
    cetocycline, chlortetracycline, clomocycline, demeclocycline, doxycycline, eravacycline, lymecycline, metacycline, minocycline, omadacycline, oxytetracycline, penimepicycline, rolitetracycline, sarecycline, tetracycline, tetracycline screening test, and tigecycline

  • +
  • trimethoprims() can select:
    brodimoprim, sulfadiazine, sulfadiazine/tetroxoprim, sulfadiazine/trimethoprim, sulfadimethoxine, sulfadimidine, sulfadimidine/trimethoprim, sulfafurazole, sulfaisodimidine, sulfalene, sulfamazone, sulfamerazine, sulfamerazine/trimethoprim, sulfamethizole, sulfamethoxazole, sulfamethoxypyridazine, sulfametomidine, sulfametoxydiazine, sulfametrole/trimethoprim, sulfamoxole, sulfamoxole/trimethoprim, sulfanilamide, sulfaperin, sulfaphenazole, sulfapyridine, sulfathiazole, sulfathiourea, trimethoprim, and trimethoprim/sulfamethoxazole

  • +
  • ureidopenicillins() can select:
    azlocillin, mezlocillin, piperacillin, and piperacillin/tazobactam

  • +
+ +
+ +
+

Examples

+
x <- custom_mdro_guideline(
+  CIP == "R" & age > 60 ~ "Elderly Type A",
+  ERY == "R" & age > 60 ~ "Elderly Type B"
+)
+x
+#> A set of custom MDRO rules:
+#>   1. If CIP is  R  and age is higher than 60 then: Elderly Type A
+#>   2. If ERY is  R  and age is higher than 60 then: Elderly Type B
+#>   3. Otherwise: Negative
+#> 
+#> Unmatched rows will return NA.
+#> Results will be of class 'factor', with ordered levels: Negative < Elderly Type A < Elderly Type B
+
+# run the custom rule set (verbose = TRUE will return a logbook instead of the data set):
+out <- mdro(example_isolates, guideline = x)
+table(out)
+#> out
+#>       Negative Elderly Type A Elderly Type B 
+#>           1070            198            732 
+
+out <- mdro(example_isolates, guideline = x, verbose = TRUE)
+head(out)
+#>    row_number microorganism           MDRO
+#> V1          1          <NA> Elderly Type B
+#> V2          2          <NA> Elderly Type B
+#> V3          3          <NA>       Negative
+#> V4          4          <NA>       Negative
+#> V5          5          <NA>       Negative
+#> V6          6          <NA>       Negative
+#>                                   reason
+#> V1 matched rule 2: ERY == "R" & age > 60
+#> V2 matched rule 2: ERY == "R" & age > 60
+#> V3                      no rules matched
+#> V4                      no rules matched
+#> V5                      no rules matched
+#> V6                      no rules matched
+#>                               all_nonsusceptible_columns        guideline
+#> V1 PEN, TMP, SXT, LNZ, VAN, TEC, TCY, ERY, CLI, AZM, RIF Custom guideline
+#> V2 PEN, TMP, SXT, LNZ, VAN, TEC, TCY, ERY, CLI, AZM, RIF Custom guideline
+#> V3                     PEN, FLC, CXM, CAZ, ERY, AZM, COL Custom guideline
+#> V4                     PEN, FLC, CXM, CAZ, ERY, AZM, COL Custom guideline
+#> V5                PEN, FLC, CXM, CAZ, TMP, ERY, AZM, COL Custom guideline
+#> V6           PEN, FLC, CXM, CAZ, TMP, ERY, CLI, AZM, COL Custom guideline
+
+# you can create custom guidelines using selectors (see ?antimicrobial_selectors)
+my_guideline <- custom_mdro_guideline(
+  AMX == "R" ~ "Custom MDRO 1",
+  all(cephalosporins_2nd() == "R") ~ "Custom MDRO 2"
+)
+my_guideline
+#> A set of custom MDRO rules:
+#>   1. If AMX is  R  then: Custom MDRO 1
+#>   2. If all of cephalosporins_2nd() is  R  then: Custom MDRO 2
+#>   3. Otherwise: Negative
+#> 
+#> Unmatched rows will return NA.
+#> Results will be of class 'factor', with ordered levels: Negative < Custom MDRO 1 < Custom MDRO 2
+
+out <- mdro(example_isolates, guideline = my_guideline)
+#> ℹ For cephalosporins_2nd() using columns 'CXM' (cefuroxime) and 'FOX'
+#>   (cefoxitin)
+#> ℹ Assuming a filter on all 2 cephalosporins_2nd. Wrap around all() or
+#>   any() to prevent this note.
+table(out)
+#> out
+#>      Negative Custom MDRO 1 Custom MDRO 2 
+#>          1144           804            52 
+
+
+
+ + +
+ + + + + + diff --git a/reference/dosage.html b/reference/dosage.html index 7e90b6b21..7c1043138 100644 --- a/reference/dosage.html +++ b/reference/dosage.html @@ -7,7 +7,7 @@ AMR (for R) - 2.1.1.9277 + 2.1.1.9279
-
-

Source

-

See the supported guidelines above for the list of publications used for this function.

-

Arguments

@@ -140,11 +134,7 @@
...
-

In case of custom_mdro_guideline(): a set of rules, see section Using Custom Guidelines below. Otherwise: column name of an antibiotic, see section Antimicrobials below.

- - -
as_factor
-

A logical to indicate whether the returned value should be an ordered factor (TRUE, default), or otherwise a character vector.

+

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.

@@ -165,22 +155,21 @@ Ordered facto

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.

For the pct_required_classes argument, values above 1 will be divided by 100. This is to support both fractions (0.75 or 3/4) and percentages (75).

-

Note: Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu et al. in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this mdro() function makes sure that results from before 2016 and after 2016 are identical.

-
-
-

Supported International / National Guidelines

- +

Note: Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu et al. in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this mdro() function makes sure that results from before 2016 and after 2016 are identical.

+

Supported International / National Guidelines

+

Please suggest to implement guidelines by letting us know.

Currently supported guidelines are (case-insensitive):

  • guideline = "CMI 2012" (default)

    Magiorakos AP, Srinivasan A et al. "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) (doi:10.1111/j.1469-0691.2011.03570.x )

  • guideline = "EUCAST 3.3" (or simply guideline = "EUCAST")

    -

    The European international guideline - EUCAST Expert Rules Version 3.3 "Intrinsic Resistance and Unusual Phenotypes" (link)

  • -
  • guideline = "EUCAST 3.2"

    -

    The European international guideline - EUCAST Expert Rules Version 3.2 "Intrinsic Resistance and Unusual Phenotypes" (link)

  • +

    The European international guideline - EUCAST Expert Rules Version 3.3 "Intrinsic Resistance and Unusual Phenotypes" (link)

    +

    Also:

    • guideline = "EUCAST 3.2"

      +

      The former European international guideline - EUCAST Expert Rules Version 3.2 "Intrinsic Resistance and Unusual Phenotypes" (link)

    • guideline = "EUCAST 3.1"

      -

      The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (link)

    • +

      The former European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (link)

      +
  • guideline = "TB"

    The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (link)

  • guideline = "MRGN"

    @@ -190,47 +179,16 @@ Ordered facto

    Also:

    • guideline = "BRMO 2017"

      The former Dutch national guideline - Werkgroep Infectiepreventie (WIP), RIVM, last revision as of 2017: "Bijzonder Resistente Micro-Organismen (BRMO)"

  • -

Please suggest to implement guidelines by letting us know: https://github.com/msberends/AMR/issues/new.

-
-
-

Using Custom Guidelines

+
+ +
+

Using Custom Guidelines

+

Using a custom MDRO guideline is of importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data.

+

Custom guidelines can be set with the custom_mdro_guideline() function.

+
-

Custom guidelines can be set with the custom_mdro_guideline() function. This is of great importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data.

-

If you are familiar with the case_when() function of the dplyr package, you will recognise the input method to set your own rules. Rules must be set using what R considers to be the 'formula notation'. The rule is written before the tilde (~) and the consequence of the rule is written after the tilde:

-

custom <- custom_mdro_guideline(CIP == "R" & age > 60 ~ "Elderly Type A",
-                                ERY == "R" & age > 60 ~ "Elderly Type B")

-

If a row/an isolate matches the first rule, the value after the first ~ (in this case 'Elderly Type A') will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited.

-

You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.

-

custom
-#> A set of custom MDRO rules:
-#>   1. CIP is "R" and age is higher than 60 -> Elderly Type A
-#>   2. ERY is "R" and age is higher than 60 -> Elderly Type B
-#>   3. Otherwise -> Negative
-#>
-#> Unmatched rows will return NA.

-

The outcome of the function can be used for the guideline argument in the mdro() function:

-

x <- mdro(example_isolates,
-          guideline = custom)
-table(x)
-#>       Negative Elderly Type A Elderly Type B
-#>           1070            198            732

-

Rules can also be combined with other custom rules by using c():

-

x <- mdro(example_isolates,
-          guideline = c(custom,
-                        custom_mdro_guideline(ERY == "R" & age > 50 ~ "Elderly Type C")))
-table(x)
-#>       Negative Elderly Type A Elderly Type B Elderly Type C
-#>            961            198            732            109

-

The rules set (the custom object in this case) could be exported to a shared file location using saveRDS() if you collaborate with multiple users. The custom rules set could then be imported using readRDS().

-
-
-

Antimicrobials

- - -

To let the function automatically detect antimicrobial column names, do not provide any named arguments. It will then use guess_ab_col() to find them.

-

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.

Interpretation of SIR

@@ -239,52 +197,49 @@ Ordered facto

In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I, and R (https://www.eucast.org/newsiandr).

This AMR package follows insight; use susceptibility() (equal to proportion_SI()) to determine antimicrobial susceptibility and count_susceptible() (equal to count_SI()) to count susceptible isolates.

+
+

See also

+ +

Examples

-
out <- mdro(example_isolates, guideline = "EUCAST")
+    
out <- mdro(example_isolates)
+#> Warning: in mdro(): NA introduced for isolates where the available percentage of
+#> antimicrobial classes was below 50% (set with pct_required_classes)
 str(out)
-#>  Ord.factor w/ 3 levels "Negative"<"Positive, unconfirmed"<..: 1 1 1 1 1 1 1 1 1 1 ...
+#>  Ord.factor w/ 4 levels "Negative"<"Multi-drug-resistant (MDR)"<..: NA NA 1 1 1 1 NA NA 1 1 ...
+table(out)
+#> out
+#>                         Negative       Multi-drug-resistant (MDR) 
+#>                             1617                              128 
+#> Extensively drug-resistant (XDR)          Pandrug-resistant (PDR) 
+#>                                0                                0 
+
+out <- mdro(example_isolates, guideline = "EUCAST 3.3")
 table(out)
 #> out
 #>              Negative Positive, unconfirmed              Positive 
 #>                  1994                     0                     6 
 
-out <- mdro(example_isolates,
-  guideline = custom_mdro_guideline(
-    AMX == "R" ~ "Custom MDRO 1",
-    VAN == "R" ~ "Custom MDRO 2"
-  )
-)
-table(out)
-#> out
-#>      Negative Custom MDRO 1 Custom MDRO 2 
-#>           870           804           326 
-
 # \donttest{
 if (require("dplyr")) {
-  example_isolates %>%
-    mdro() %>%
-    table()
-
   # no need to define `x` when used inside dplyr verbs:
   example_isolates %>%
     mutate(MDRO = mdro()) %>%
-    pull(MDRO) %>%
-    table()
+    count(MDRO)
 }
-#> Warning: in mdro(): NA introduced for isolates where the available percentage of
-#> antimicrobial classes was below 50% (set with pct_required_classes)
 #> Warning: There was 1 warning in `mutate()`.
 #>  In argument: `MDRO = mdro()`.
 #> Caused by warning:
 #> ! in mdro(): NA introduced for isolates where the available percentage of
 #> antimicrobial classes was below 50% (set with pct_required_classes)
-#> .
-#>                         Negative       Multi-drug-resistant (MDR) 
-#>                             1617                              128 
-#> Extensively drug-resistant (XDR)          Pandrug-resistant (PDR) 
-#>                                0                                0 
+#> # A tibble: 3 × 2
+#>   MDRO                           n
+#>   <ord>                      <int>
+#> 1 Negative                    1617
+#> 2 Multi-drug-resistant (MDR)   128
+#> 3 NA                           255
 # }
 
diff --git a/reference/mean_amr_distance.html b/reference/mean_amr_distance.html index 8d98ce91e..c5807930d 100644 --- a/reference/mean_amr_distance.html +++ b/reference/mean_amr_distance.html @@ -7,7 +7,7 @@ AMR (for R) - 2.1.1.9277 + 2.1.1.9279
diff --git a/reference/resistance_predict.html b/reference/resistance_predict.html index 3882bc613..b7f8b5d69 100644 --- a/reference/resistance_predict.html +++ b/reference/resistance_predict.html @@ -9,7 +9,7 @@ NOTE: These functions are deprecated and will be removed in a future version. Us AMR (for R) - 2.1.1.9277 + 2.1.1.9279