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 publicable/printable format, see Examples.

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_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 == ",", ".", ","),
  ...
)

Arguments

x

data with antibiotic columns, like e.g. AMX and AMC

col_mo

column name of the IDs of the microorganisms (see as.mo()), defaults to the first column of class mo. Values will be coerced using as.mo().

FUN

the function to call on the mo column to transform the microorganism IDs, defaults to mo_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_locale()) and can also be set with getOption("AMR_locale"). Use language = NULL or language = "" to prevent translation.

minimum

the minimum allowed number of available (tested) isolates. Any isolate count lower than minimum will return NA with a warning. The default number of 30 isolates 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 parameter combine_IR, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is TRUE.

combine_IR

logical to indicate whether values R and I should be summed

add_ab_group

logical to indicate where the group of the antimicrobials must be included as a first column

remove_intrinsic_resistant

logical to indicate that rows 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.interval decimals before (hence big) the decimal point.

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/.

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.

The language of the output can be overwritten with options(AMR_locale), please see translate.

Stable lifecycle


The lifecycle of this function is stable. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.

If the unlying code needs breaking changes, they will occur gradually. For example, a parameter will be deprecated and first continue to work, but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.

Read more on our website!

On our website https://msberends.github.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data. As we would like to better understand the backgrounds and needs of our users, please participate in our survey!

Examples

# \donttest{
x <- bug_drug_combinations(example_isolates)
x
format(x, translate_ab = "name (atc)")

# Use FUN to change to transformation of microorganism codes
x <- bug_drug_combinations(example_isolates, 
                           FUN = mo_gramstain)
                           
x <- bug_drug_combinations(example_isolates,
                           FUN = function(x) ifelse(x == as.mo("E. coli"),
                                                    "E. coli",
                                                    "Others"))
# }