
Interpret antimicrobial susceptibility phenotype data in a standard format tibble
Source:R/import_pheno.R
interpret_pheno.RdThis function applies human EUCAST or CLSI breakpoints, and/or ECOFF, to interpret antimicrobial susceptibility testing (AST) data.
Usage
interpret_pheno(
ast,
interpret_ecoff = TRUE,
interpret_eucast = TRUE,
interpret_clsi = TRUE,
species = NULL,
ab = NULL
)Arguments
- ast
A tibble containing the phenotype measures in standard AMRgen format, as output by
import_pheno(). It must contain assay measurements in columnsmic(classmic) and/ordisk(classdisk). Interpretation requires an organism (columnspp_phenoof classmo, or a single value passed via thespeciesparameter) and an antibiotic (columndrugof classab, or a single value passed via theabparameter).- interpret_ecoff
A logical value (default is
FALSE). IfTRUE, the function will interpret the wildtype vs nonwildtype status for each row based on the MIC or disk diffusion values, against epidemiological cut-off (ECOFF) values. These will be reported in a new columnecoff, of classsirand coded asNWT(nonwildtype) orWT(wildtype).- interpret_eucast
A logical value (default is
FALSE). IfTRUE, the function will interpret the susceptibility phenotype (SIR) for each row based on the MIC or disk diffusion values, against EUCAST human breakpoints. These will be reported in a new columnpheno_eucast, of classsir.- interpret_clsi
A logical value (default is
FALSE). IfTRUE, the function will interpret the susceptibility phenotype (SIR) for each row based on the MIC or disk diffusion values, against CLSI human breakpoints. These will be reported in a new columnpheno_clsi, of classsir.- species
(optional) Name of the species to use for phenotype interpretation. By default, the
spp_phenofield in the input file will be assumed to specify the species for each sample, but if this is missing or you want to override it in the interpretation step, you may provide a single species name via this parameter.- ab
(optional) Name of the antibiotic to use for phenotype interpretation. By default, the
drugfield in the input file will be assumed to specify the antibiotic for each sample, but if this is missing or you want to override it in the interpretation step, you may provide a single antibiotic name via this parameter.
Value
A copy of the input table, with additional columns:
pheno_eucast: The phenotype newly interpreted against EUCAST human breakpoint standards (as S/I/R), based on the MIC or disk diffusion data.pheno_clsi: The phenotype newly interpreted against CLSI human breakpoint standards (as S/I/R), based on the MIC or disk diffusion data.ecoff: The phenotype newly interpreted against the ECOFF (as WT/NWT), based on the MIC or disk diffusion data.spp_pheno: The species phenotype, formatted using theAMR::as.mo()function (either taken from fieldspp_phenoin the input table, or the single value specified byspeciesparameter).drug: The antibiotic used in the test, formatted using theAMR::as.ab()function (either taken from fielddrugin the input table, or the single value specified byabparameter).
Examples
# import without re-interpreting resistance
pheno <- import_ncbi_pheno(ecoli_pheno_raw)
#> Warning: Expected AST method column 'Laboratory typing method' not found in input
#> Warning: Expected column 'BioProject' not found in input
head(pheno)
#> # A tibble: 6 × 29
#> id drug mic disk guideline method platform pheno_provided spp_pheno
#> <chr> <ab> <mic> <dsk> <chr> <chr> <chr> <sir> <mo>
#> 1 SAMN… CIP 256.00 NA CLSI broth … NA R B_ESCHR_COLI
#> 2 SAMN… CIP 64.00 NA CLSI Etest Etest R B_ESCHR_COLI
#> 3 SAMN… CIP >=4.00 NA CLSI broth … NA R B_ESCHR_COLI
#> 4 SAMN… CIP >=4.00 NA CLSI broth … NA R B_ESCHR_COLI
#> 5 SAMN… CIP <=0.25 NA CLSI broth … NA S B_ESCHR_COLI
#> 6 SAMN… CIP >=4.00 NA CLSI broth … NA R B_ESCHR_COLI
#> # ℹ 20 more variables: `Organism group` <chr>, `Scientific name` <chr>,
#> # `Isolation type` <chr>, Location <chr>, `Isolation source` <chr>,
#> # Isolate <chr>, Antibiotic <chr>, `Resistance phenotype` <chr>,
#> # `Measurement sign` <chr>, `MIC (mg/L)` <dbl>, `Disk diffusion (mm)` <lgl>,
#> # `Laboratory typing platform` <chr>, Vendor <chr>,
#> # `Laboratory typing method version or reagent` <chr>,
#> # `Testing standard` <chr>, `Create date` <dttm>, pheno_clsi_mic <sir>, …
# interpret phenotypes
pheno <- interpret_pheno(pheno)
if (FALSE) { # \dontrun{
pheno <- read_csv("AST.csv") %>%
# convert antibiotic field to 'drug' of class 'ab'
mutate(drug = as.ab(antibiotic)) %>%
mutate(mic = paste0(sign, MIC)) %>%
mutate(mic = as.mic(mic)) # create a single 'mic' column of class 'mic'
pheno <- interpret_pheno(pheno, species = "Escherichia coli")
} # }