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, like 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 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 = "EUCAST"

    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. (link)
  • guideline = "BRMO"

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

Examples

The mdro() function always returns an ordered factor. 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 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR 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
# [34mNOTE: Using column `[1mmo[22m` as input for `col_mo`.[39m
# [34mNOTE: Auto-guessing columns suitable for analysis...[39m[34mOK.[39m
# [34mNOTE: Reliability would be improved if these antimicrobial results would be available too: ceftaroline ([1mCPT[22m), fusidic acid ([1mFUS[22m), telavancin ([1mTLV[22m), daptomycin ([1mDAP[22m), quinupristin/dalfopristin ([1mQDA[22m), minocycline ([1mMNO[22m), gentamicin-high ([1mGEH[22m), streptomycin-high ([1mSTH[22m), doripenem ([1mDOR[22m), levofloxacin ([1mLVX[22m), netilmicin ([1mNET[22m), ticarcillin/clavulanic acid ([1mTCC[22m), ertapenem ([1mETP[22m), cefotetan ([1mCTT[22m), aztreonam ([1mATM[22m), ampicillin/sulbactam ([1mSAM[22m), polymyxin B ([1mPLB[22m)[39m
# 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,711 (85.55%, NA: 289 = 14.45%)
Unique: 2

Item Count Percent Cum. Count Cum. Percent
1 Negative 1596 93.28% 1596 93.28%
2 Multi-drug-resistant (MDR) 115 6.72% 1711 100.00%

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

# a helper function to get a random vector with values S, I and R
# with the probabilities 50% - 10% - 40%
sample_rsi <- function() {
  sample(c("S", "I", "R"),
         size = 5000,
         prob = c(0.5, 0.1, 0.4),
         replace = TRUE)
}

my_TB_data <- data.frame(rifampicin = sample_rsi(),
                         isoniazid = sample_rsi(),
                         gatifloxacin = sample_rsi(),
                         ethambutol = sample_rsi(),
                         pyrazinamide = sample_rsi(),
                         moxifloxacin = sample_rsi(),
                         kanamycin = sample_rsi())

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

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

The data set now looks like this:

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

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)
# [34mNOTE: No column found as input for `col_mo`, [1massuming all records contain [3mMycobacterium tuberculosis.[23m[22m[39m
# [34mNOTE: Auto-guessing columns suitable for analysis...[39m[34mOK.[39m
# [34mNOTE: Reliability would be improved if these antimicrobial results would be available too: capreomycin ([1mCAP[22m), rifabutin ([1mRIB[22m), rifapentine ([1mRFP[22m)[39m

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

Item Count Percent Cum. Count Cum. Percent
1 Mono-resistant 3288 65.76% 3288 65.76%
2 Negative 631 12.62% 3919 78.38%
3 Multi-drug-resistant 582 11.64% 4501 90.02%
4 Poly-resistant 298 5.96% 4799 95.98%
5 Extensively drug-resistant 201 4.02% 5000 100.00%