Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use format() on the result to prettify it to a publishable/printable format, see Examples.
Usage
bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...)
# S3 method for bug_drug_combinations
format(
  x,
  translate_ab = "name (ab, atc)",
  language = get_AMR_locale(),
  minimum = 30,
  combine_SI = TRUE,
  combine_IR = FALSE,
  add_ab_group = TRUE,
  remove_intrinsic_resistant = FALSE,
  decimal.mark = getOption("OutDec"),
  big.mark = ifelse(decimal.mark == ",", ".", ","),
  ...
)Source
M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition, 2014, Clinical and Laboratory Standards Institute (CLSI). https://clsi.org/standards/products/microbiology/documents/m39/.
Arguments
- x
 data with antibiotic columns, such as
amox,AMXandAMC- col_mo
 column name of the IDs of the microorganisms (see
as.mo()), defaults to the first column of classmo. Values will be coerced usingas.mo().- FUN
 the function to call on the
mocolumn to transform the microorganism codes, defaults tomo_shortname()- ...
 arguments passed on to
FUN- translate_ab
 a character of length 1 containing column names of the antibiotics data set
- language
 language of the returned text, defaults to system language (see
get_AMR_locale()) and can also be set withgetOption("AMR_locale"). Uselanguage = NULLorlanguage = ""to prevent translation.- minimum
 the minimum allowed number of available (tested) isolates. Any isolate count lower than
minimumwill returnNAwith a warning. The default number of30isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.- combine_SI
 a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the argument
combine_IR, but this now follows the redefinition by EUCAST about the interpretation of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default isTRUE.- combine_IR
 a logical to indicate whether values R and I should be summed
- add_ab_group
 a logical to indicate where the group of the antimicrobials must be included as a first column
- remove_intrinsic_resistant
 logical to indicate that rows and columns with 100% resistance for all tested antimicrobials must be removed from the table
- decimal.mark
 the character to be used to indicate the numeric decimal point.
- big.mark
 character; if not empty used as mark between every
big.intervaldecimals before (hencebig) the decimal point.
Value
The function bug_drug_combinations() returns a data.frame with columns "mo", "ab", "S", "I", "R" and "total".
Details
The function format() calculates the resistance per bug-drug combination. Use combine_IR = FALSE (default) to test R vs. S+I and combine_IR = TRUE to test R+I vs. S.
Examples
# \donttest{
x <- bug_drug_combinations(example_isolates)
#> ℹ Using column 'mo' as input for `col_mo`.
head(x)
#>                  mo  ab  S I R total
#> 1 (unknown species) PEN 14 0 1    15
#> 2 (unknown species) OXA  0 0 1     1
#> 3 (unknown species) FLC  0 0 0     0
#> 4 (unknown species) AMX 15 0 1    16
#> 5 (unknown species) AMC 15 0 0    15
#> 6 (unknown species) AMP 15 0 1    16
#> Use 'format()' on this result to get a publishable/printable format.
format(x, translate_ab = "name (atc)")
#>                        Group                                    Drug
#> 1            Aminoglycosides                      Amikacin (J01GB06)
#> 2                                               Gentamicin (J01GB03)
#> 3                                                Kanamycin (J01GB04)
#> 4                                               Tobramycin (J01GB01)
#> 5                Amphenicols               Chloramphenicol (J01BA01)
#> 6         Antimycobacterials                    Rifampicin (J04AB02)
#> 7   Beta-lactams/penicillins                   Amoxicillin (J01CA04)
#> 8                              Amoxicillin/clavulanic acid (J01CR02)
#> 9                                               Ampicillin (J01CA01)
#> 10                                        Benzylpenicillin (J01CE01)
#> 11                                          Flucloxacillin (J01CF05)
#> 12                                               Oxacillin (J01CF04)
#> 13                                 Piperacillin/tazobactam (J01CR05)
#> 14               Carbapenems                      Imipenem (J01DH51)
#> 15                                               Meropenem (J01DH02)
#> 16 Cephalosporins (1st gen.)                     Cefazolin (J01DB04)
#> 17 Cephalosporins (2nd gen.)                     Cefoxitin (J01DC01)
#> 18                                              Cefuroxime (J01DC02)
#> 19 Cephalosporins (3rd gen.)                    Cefotaxime (J01DD01)
#> 20                                             Ceftazidime (J01DD02)
#> 21                                             Ceftriaxone (J01DD04)
#> 22 Cephalosporins (4th gen.)                      Cefepime (J01DE01)
#> 23             Glycopeptides                   Teicoplanin (J01XA02)
#> 24                                              Vancomycin (J01XA01)
#> 25   Macrolides/lincosamides                  Azithromycin (J01FA10)
#> 26                                             Clindamycin (J01FF01)
#> 27                                            Erythromycin (J01FA01)
#> 28      Other antibacterials                    Fosfomycin (J01XX01)
#> 29                                               Mupirocin (D06AX09)
#> 30                                          Nitrofurantoin (J01XE01)
#> 31            Oxazolidinones                     Linezolid (J01XX08)
#> 32                Polymyxins                      Colistin (J01XB01)
#> 33                Quinolones                 Ciprofloxacin (J01MA02)
#> 34                                            Moxifloxacin (J01MA14)
#> 35             Tetracyclines                   Doxycycline (J01AA02)
#> 36                                            Tetracycline (J01AA07)
#> 37                                             Tigecycline (J01AA12)
#> 38             Trimethoprims                  Trimethoprim (J01EA01)
#> 39                           Trimethoprim/sulfamethoxazole (J01EE01)
#>                CoNS          E. coli    E. faecalis  K. pneumoniae
#> 1    100.0% (43/43)     0.0% (0/171) 100.0% (39/39)               
#> 2    13.6% (42/309)     2.0% (9/460) 100.0% (39/39)   10.3% (6/58)
#> 3    100.0% (43/43)                  100.0% (39/39)               
#> 4     78.2% (43/55)    2.6% (12/462) 100.0% (39/39)   10.3% (6/58)
#> 5                                                                 
#> 6                   100.0% (467/467)                100.0% (58/58)
#> 7   93.0% (132/142)  50.0% (196/392)                100.0% (58/58)
#> 8   42.6% (132/310)   13.1% (61/467)                  10.3% (6/58)
#> 9   93.0% (132/142)  50.0% (196/392)                100.0% (58/58)
#> 10  77.6% (228/294) 100.0% (467/467)                100.0% (58/58)
#> 11  42.8% (134/313)                                               
#> 12    54.8% (34/62)                                               
#> 13    69.7% (23/33)    5.5% (23/416)                  11.3% (6/53)
#> 14    47.9% (23/48)     0.0% (0/422)    0.0% (0/38)    0.0% (0/51)
#> 15    47.9% (23/48)     0.0% (0/418)                   0.0% (0/53)
#> 16    47.9% (23/48)      2.4% (2/82) 100.0% (39/39)               
#> 17    47.9% (23/48)    6.9% (26/377) 100.0% (39/39)    2.2% (1/46)
#> 18  42.6% (133/312)    5.4% (25/465) 100.0% (39/39)   10.3% (6/58)
#> 19    47.9% (23/48)    2.4% (11/459) 100.0% (39/39)    5.2% (3/58)
#> 20 100.0% (313/313)    2.4% (11/460) 100.0% (39/39)    5.2% (3/58)
#> 21    47.9% (23/48)    2.4% (11/459) 100.0% (39/39)    5.2% (3/58)
#> 22    47.9% (23/48)     2.8% (9/317) 100.0% (39/39)    5.3% (2/38)
#> 23                  100.0% (467/467)                100.0% (58/58)
#> 24     0.3% (1/304) 100.0% (467/467)    0.0% (0/39) 100.0% (58/58)
#> 25  44.1% (138/313) 100.0% (467/467) 100.0% (39/39) 100.0% (58/58)
#> 26   33.5% (59/176) 100.0% (467/467) 100.0% (39/39) 100.0% (58/58)
#> 27  44.1% (138/313) 100.0% (467/467) 100.0% (39/39) 100.0% (58/58)
#> 28                       0.0% (0/61)                              
#> 29                                                                
#> 30                     2.8% (13/458)                 19.0% (11/58)
#> 31                  100.0% (467/467)                100.0% (58/58)
#> 32 100.0% (313/313)     0.0% (0/240) 100.0% (39/39)    5.9% (2/34)
#> 33   27.4% (69/252)   12.5% (57/456)                   3.6% (2/55)
#> 34                    100.0% (57/57)                              
#> 35   22.2% (67/302)                                               
#> 36   22.5% (59/262)                                               
#> 37     0.0% (0/195)      0.0% (0/68)                              
#> 38  41.4% (126/304)  39.1% (155/396) 100.0% (39/39)   18.4% (9/49)
#> 39   12.2% (30/246)  31.6% (147/465) 100.0% (39/39)   10.3% (6/58)
#>     P. aeruginosa   P. mirabilis        S. aureus   S. epidermidis
#> 1                                                   100.0% (44/44)
#> 2     0.0% (0/30)    5.9% (2/34)     0.9% (2/233)   21.5% (35/163)
#> 3  100.0% (30/30)                                   100.0% (44/44)
#> 4     0.0% (0/30)    5.9% (2/34)      2.3% (2/86)    49.4% (44/89)
#> 5  100.0% (30/30)                     0.0% (0/46)      3.1% (1/32)
#> 6  100.0% (30/30) 100.0% (36/36)     0.0% (0/108)      2.7% (2/73)
#> 7  100.0% (30/30)                 93.9% (123/131)    98.9% (90/91)
#> 8  100.0% (30/30)    2.8% (1/36)     0.4% (1/235)   54.5% (90/165)
#> 9  100.0% (30/30)                 93.9% (123/131)    98.9% (90/91)
#> 10 100.0% (30/30) 100.0% (36/36)  80.9% (123/152)   89.4% (93/104)
#> 11                                   0.4% (1/235)   55.7% (97/174)
#> 12                                    0.0% (0/99)    50.0% (37/74)
#> 13                                                                
#> 14                   6.3% (2/32)                                  
#> 15                                                                
#> 16 100.0% (30/30)                                                 
#> 17 100.0% (30/30)                                                 
#> 18 100.0% (30/30)    0.0% (0/36)     0.4% (1/235)   56.1% (97/173)
#> 19 100.0% (30/30)    0.0% (0/36)                                  
#> 20    3.3% (1/30)    0.0% (0/36) 100.0% (235/235) 100.0% (174/174)
#> 21 100.0% (30/30)    0.0% (0/36)                                  
#> 22                                                                
#> 23 100.0% (30/30) 100.0% (36/36)      0.0% (0/80)    64.1% (25/39)
#> 24 100.0% (30/30) 100.0% (36/36)     0.0% (0/232)     0.0% (0/171)
#> 25 100.0% (30/30) 100.0% (36/36)    8.9% (21/235)   53.8% (93/173)
#> 26 100.0% (30/30) 100.0% (36/36)     6.0% (9/151)   37.5% (42/112)
#> 27 100.0% (30/30) 100.0% (36/36)    8.9% (21/235)   53.8% (93/173)
#> 28                                    0.0% (0/80)    21.9% (14/64)
#> 29                                    0.0% (0/84)      8.7% (6/69)
#> 30                100.0% (36/36)                                  
#> 31 100.0% (30/30) 100.0% (36/36)      0.0% (0/82)      0.0% (0/68)
#> 32                100.0% (36/36) 100.0% (235/235) 100.0% (174/174)
#> 33    0.0% (0/30)    5.6% (2/36)   10.5% (20/191)   36.0% (49/136)
#> 34                                    2.2% (1/46)      0.0% (0/31)
#> 35 100.0% (30/30) 100.0% (36/36)     3.0% (7/231)   32.4% (55/170)
#> 36 100.0% (30/30) 100.0% (36/36)     3.2% (7/217)   32.9% (55/167)
#> 37 100.0% (30/30) 100.0% (36/36)     0.0% (0/209)     0.0% (0/109)
#> 38 100.0% (30/30)  36.4% (12/33)    8.4% (13/155)   58.5% (69/118)
#> 39 100.0% (30/30)   25.0% (9/36)     3.9% (9/231)   17.5% (24/137)
#>        S. hominis    S. pneumoniae
#> 1                 100.0% (117/117)
#> 2     7.5% (6/80) 100.0% (117/117)
#> 3                 100.0% (117/117)
#> 4    14.5% (9/62) 100.0% (117/117)
#> 5     6.5% (2/31)                 
#> 6     0.0% (0/61)                 
#> 7                     0.0% (0/112)
#> 8   35.0% (28/80)     0.0% (0/112)
#> 9                     0.0% (0/112)
#> 10                    0.0% (0/117)
#> 11  34.6% (28/81)                 
#> 12  39.7% (23/58)                 
#> 13                    0.0% (0/112)
#> 14                                
#> 15                                
#> 16                                
#> 17                                
#> 18  33.3% (27/81)      0.0% (0/61)
#> 19                                
#> 20 100.0% (81/81) 100.0% (117/117)
#> 21                                
#> 22                                
#> 23    6.8% (4/59)                 
#> 24    0.0% (0/81)      0.0% (0/94)
#> 25  40.7% (33/81)     7.8% (9/116)
#> 26  29.4% (20/68)      6.5% (4/62)
#> 27  40.7% (33/81)     7.8% (9/116)
#> 28 100.0% (59/59)                 
#> 29    1.6% (1/61)                 
#> 30                                
#> 31    0.0% (0/60)                 
#> 32 100.0% (81/81) 100.0% (117/117)
#> 33  20.0% (14/70)                 
#> 34    0.0% (0/32)                 
#> 35  55.0% (44/80)     4.5% (5/112)
#> 36  54.3% (44/81)     4.7% (5/106)
#> 37    0.0% (0/36)                 
#> 38  57.9% (22/38)    17.9% (17/95)
#> 39  24.7% (20/81)     7.3% (8/109)
# Use FUN to change to transformation of microorganism codes
bug_drug_combinations(example_isolates, 
                      FUN = mo_gramstain)
#> ℹ Using column 'mo' as input for `col_mo`.
#>               mo  ab    S  I    R total
#> 1  Gram-negative PEN    8  0  717   725
#> 2  Gram-negative OXA    6  0    0     6
#> 3  Gram-negative FLC    6  0    0     6
#> 4  Gram-negative AMX  226  0  405   631
#> 5  Gram-negative AMC  463 89  174   726
#> 6  Gram-negative AMP  226  0  405   631
#> 7  Gram-negative TZP  554 11   76   641
#> 8  Gram-negative CZO   94  2  110   206
#> 9  Gram-negative FEP  470  1   14   485
#> 10 Gram-negative CXM  539 22  142   703
#> 11 Gram-negative FOX  435  8  135   578
#> 12 Gram-negative CTX  578  1   57   636
#> 13 Gram-negative CAZ  607  0   27   634
#> 14 Gram-negative CRO  578  1   57   636
#> 15 Gram-negative GEN  651  8   25   684
#> 16 Gram-negative TOB  651  7   28   686
#> 17 Gram-negative AMK  251  0    5   256
#> 18 Gram-negative KAN    0  0   35    35
#> 19 Gram-negative TMP  364  1  223   588
#> 20 Gram-negative SXT  506  0  197   703
#> 21 Gram-negative NIT  491 51  122   664
#> 22 Gram-negative FOS   71  0    7    78
#> 23 Gram-negative LNZ    0  0  707   707
#> 24 Gram-negative CIP  610 11   63   684
#> 25 Gram-negative MFX    0  0   63    63
#> 26 Gram-negative VAN    0  0  707   707
#> 27 Gram-negative TEC    0  0  707   707
#> 28 Gram-negative TCY   15  1  110   126
#> 29 Gram-negative TGC   87  0  101   188
#> 30 Gram-negative DOX   10  0  108   118
#> 31 Gram-negative ERY    1  2  696   699
#> 32 Gram-negative CLI   18  1  709   728
#> 33 Gram-negative AZM    1  2  696   699
#> 34 Gram-negative IPM  616 10    5   631
#> 35 Gram-negative MEM  624  0    2   626
#> 36 Gram-negative MTR   21  0    2    23
#> 37 Gram-negative CHL    1  0   30    31
#> 38 Gram-negative COL  309  0   78   387
#> 39 Gram-negative MUP    0  0    0     0
#> 40 Gram-negative RIF    1  0  695   696
#> 41 Gram-positive PEN  395 11  483   889
#> 42 Gram-positive OXA  245  0  113   358
#> 43 Gram-positive FLC  659  0  278   937
#> 44 Gram-positive AMX  302  3  398   703
#> 45 Gram-positive AMC  864  2  272  1138
#> 46 Gram-positive AMP  302  3  398   703
#> 47 Gram-positive TZP  294  2   49   345
#> 48 Gram-positive CZO  151  0   89   240
#> 49 Gram-positive FEP  150  0   89   239
#> 50 Gram-positive CXM  756  0  328  1084
#> 51 Gram-positive FOX  151  0   89   240
#> 52 Gram-positive CTX  218  0   89   307
#> 53 Gram-positive CAZ    0  0 1177  1177
#> 54 Gram-positive CRO  218  0   89   307
#> 55 Gram-positive GEN  721 19  430  1170
#> 56 Gram-positive TOB  228  0  437   665
#> 57 Gram-positive AMK    0  0  436   436
#> 58 Gram-positive KAN    0  0  436   436
#> 59 Gram-positive TMP  553  9  343   905
#> 60 Gram-positive SXT  883  6  163  1052
#> 61 Gram-positive NIT   73  0    5    78
#> 62 Gram-positive FOS  132  0  141   273
#> 63 Gram-positive LNZ  312  0    2   314
#> 64 Gram-positive CIP  502 58  164   724
#> 65 Gram-positive MFX  136  4    8   148
#> 66 Gram-positive VAN 1141  0    5  1146
#> 67 Gram-positive TEC  237  0   32   269
#> 68 Gram-positive TCY  800 22  245  1067
#> 69 Gram-positive TGC  610  0    0   610
#> 70 Gram-positive DOX  802  7  206  1015
#> 71 Gram-positive ERY  797  7  385  1189
#> 72 Gram-positive CLI  556  3  220   779
#> 73 Gram-positive AZM  797  7  385  1189
#> 74 Gram-positive IPM  207  0   50   257
#> 75 Gram-positive MEM  156  0   47   203
#> 76 Gram-positive MTR    1  0    2     3
#> 77 Gram-positive CHL  120  0    3   123
#> 78 Gram-positive COL    0  0 1237  1237
#> 79 Gram-positive MUP  251  3   16   270
#> 80 Gram-positive RIF  301  2    3   306
#> Use 'format()' on this result to get a publishable/printable format.
                           
bug_drug_combinations(example_isolates,
                      FUN = function(x) ifelse(x == as.mo("E. coli"),
                                               "E. coli",
                                               "Others"))
#> ℹ Using column 'mo' as input for `col_mo`.
#> ℹ Function `as.mo()` is uncertain about "E. coli" (assuming Escherichia
#>   coli). Run `mo_uncertainties()` to review this.
#>         mo  ab    S  I    R total
#> 1  E. coli PEN    0  0  467   467
#> 2  E. coli OXA    0  0    0     0
#> 3  E. coli FLC    0  0    0     0
#> 4  E. coli AMX  196  0  196   392
#> 5  E. coli AMC  332 74   61   467
#> 6  E. coli AMP  196  0  196   392
#> 7  E. coli TZP  388  5   23   416
#> 8  E. coli CZO   79  1    2    82
#> 9  E. coli FEP  308  0    9   317
#> 10 E. coli CXM  425 15   25   465
#> 11 E. coli FOX  347  4   26   377
#> 12 E. coli CTX  448  0   11   459
#> 13 E. coli CAZ  449  0   11   460
#> 14 E. coli CRO  448  0   11   459
#> 15 E. coli GEN  451  0    9   460
#> 16 E. coli TOB  450  0   12   462
#> 17 E. coli AMK  171  0    0   171
#> 18 E. coli KAN    0  0    0     0
#> 19 E. coli TMP  241  0  155   396
#> 20 E. coli SXT  318  0  147   465
#> 21 E. coli NIT  429 16   13   458
#> 22 E. coli FOS   61  0    0    61
#> 23 E. coli LNZ    0  0  467   467
#> 24 E. coli CIP  398  1   57   456
#> 25 E. coli MFX    0  0   57    57
#> 26 E. coli VAN    0  0  467   467
#> 27 E. coli TEC    0  0  467   467
#> 28 E. coli TCY    1  0    2     3
#> 29 E. coli TGC   68  0    0    68
#> 30 E. coli DOX    0  0    0     0
#> 31 E. coli ERY    0  0  467   467
#> 32 E. coli CLI    0  0  467   467
#> 33 E. coli AZM    0  0  467   467
#> 34 E. coli IPM  422  0    0   422
#> 35 E. coli MEM  418  0    0   418
#> 36 E. coli MTR    2  0    0     2
#> 37 E. coli CHL    0  0    0     0
#> 38 E. coli COL  240  0    0   240
#> 39 E. coli MUP    0  0    0     0
#> 40 E. coli RIF    0  0  467   467
#> 41  Others PEN  417 11  734  1162
#> 42  Others OXA  251  0  114   365
#> 43  Others FLC  665  0  278   943
#> 44  Others AMX  347  3  608   958
#> 45  Others AMC 1010 17  385  1412
#> 46  Others AMP  347  3  608   958
#> 47  Others TZP  474  8  103   585
#> 48  Others CZO  166  1  197   364
#> 49  Others FEP  312  1   94   407
#> 50  Others CXM  872  7  445  1324
#> 51  Others FOX  239  4  198   441
#> 52  Others CTX  348  1  135   484
#> 53  Others CAZ  158  0 1193  1351
#> 54  Others CRO  348  1  135   484
#> 55  Others GEN  921 27  447  1395
#> 56  Others TOB  429  7  453   889
#> 57  Others AMK   80  0  441   521
#> 58  Others KAN    0  0  471   471
#> 59  Others TMP  677 10  416  1103
#> 60  Others SXT 1074  6  214  1294
#> 61  Others NIT  136 35  114   285
#> 62  Others FOS  142  0  148   290
#> 63  Others LNZ  314  0  242   556
#> 64  Others CIP  714 68  171   953
#> 65  Others MFX  136  4   14   154
#> 66  Others VAN 1149  0  245  1394
#> 67  Others TEC  237  0  272   509
#> 68  Others TCY  819 23  355  1197
#> 69  Others TGC  629  0  101   730
#> 70  Others DOX  814  7  315  1136
#> 71  Others ERY  801  9  617  1427
#> 72  Others CLI  586  4  463  1053
#> 73  Others AZM  801  9  617  1427
#> 74  Others IPM  402 10   55   467
#> 75  Others MEM  362  0   49   411
#> 76  Others MTR   27  0    5    32
#> 77  Others CHL  121  0   33   154
#> 78  Others COL   69  0 1331  1400
#> 79  Others MUP  251  3   16   270
#> 80  Others RIF  303  2  231   536
#> Use 'format()' on this result to get a publishable/printable format.
# }