How to determine multi-drug resistance (MDR)

Matthijs S. Berends

29 November 2019

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):

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: %>%
example_isolates %>% 
  mdro() %>% 
  freq() # show frequency table of the result
# NOTE: Using column `mo` as input for `col_mo`.
# NOTE: Auto-guessing columns suitable for analysis...OK.
# NOTE: Reliability will be improved if these antimicrobial results would be available too: SAM (ampicillin/sulbactam), ATM (aztreonam), CTT (cefotetan), CPT (ceftaroline), DAP (daptomycin), DOR (doripenem), ETP (ertapenem), FUS (fusidic acid), GEH (gentamicin-high), LVX (levofloxacin), MNO (minocycline), NET (netilmicin), PLB (polymyxin B), QDA (quinupristin/dalfopristin), STH (streptomycin-high), TLV (telavancin), TCC (ticarcillin/clavulanic acid)
# Table 1 - Staphylococcus aureus ... OK
# Table 2 - Enterococcus spp. ... OK
# Table 3 - Enterobacteriaceae ... OK
# Table 4 - Pseudomonas aeruginosa ... OK
# Table 5 - Acinetobacter spp. ... OK
# 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 (of which NA: 289 = 14.45%)
Levels: 4: Negative < Multi-drug-resistant (MDR) < Extensively drug-resistant …
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          I         R            S          R            S            R
# 2          I         S            R          R            R            S
# 3          S         S            S          R            S            R
# 4          S         I            R          R            R            R
# 5          S         S            R          S            S            R
# 6          S         R            S          R            S            S
#   kanamycin
# 1         I
# 2         S
# 3         S
# 4         S
# 5         S
# 6         R

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)
# NOTE: No column found as input for `col_mo`, assuming all records contain Mycobacterium tuberculosis.
# NOTE: Auto-guessing columns suitable for analysis...OK.
# NOTE: Reliability will be improved if these antimicrobial results would be available too: CAP (capreomycin), RIB (rifabutin), RFP (rifapentine)
# 
# Only results with 'R' are considered as resistance. Use `combine_SI = FALSE` to also consider 'I' as resistance.
# 
# Determining multidrug-resistant organisms (MDRO), according to:
# Guideline: Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis
# Version:   WHO/HTM/TB/2014.11
# Author:    WHO (World Health Organization)
# Source:    https://www.who.int/tb/publications/pmdt_companionhandbook/en/
# 
# => Found 4348 MDROs out of 5000 tested isolates (87.0%)

Create a frequency table of the results:

freq(my_TB_data$mdr)

Frequency table

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

Item Count Percent Cum. Count Cum. Percent
1 Mono-resistant 3234 64.68% 3234 64.68%
2 Negative 652 13.04% 3886 77.72%
3 Multi-drug-resistant 639 12.78% 4525 90.50%
4 Poly-resistant 274 5.48% 4799 95.98%
5 Extensively drug-resistant 201 4.02% 5000 100.00%