
Import and process antimicrobial susceptibility data from SIRscan (Bio-Rad)
Source:R/import_pheno.R
import_sirscan_pheno.RdSIRscan (Bio-Rad) exports AST results as three separate semicolon-delimited CSV files: MIC values (CMI), disk diffusion diameters (DIAM), and SIR interpretations (INTERPR). Each file shares the same row structure (one row per isolate) and antibiotic columns. This function reads one or more of these files, pivots to long format, and returns a standardised AMRgen data frame.
Usage
import_sirscan_pheno(
mic_file = NULL,
disk_file = NULL,
interpr_file = NULL,
source = NULL,
species = NULL,
ab = NULL,
instrument_guideline = NULL,
sirscan_codes = sirscan_codes,
interpret_eucast = FALSE,
interpret_clsi = FALSE,
interpret_ecoff = FALSE
)Arguments
- mic_file
Path to the SIRscan CMI (MIC) export file. Optional.
- disk_file
Path to the SIRscan DIAM (disk diffusion) export file. Optional.
- interpr_file
Path to the SIRscan INTERPR (SIR interpretation) export file. Optional. At least one of
mic_file,disk_file, orinterpr_filemust be supplied.- source
Optional source label for the
sourceoutput column.- species
Optional fixed species string applied to all rows (parsed via
AMR::as.mo()). IfNULL, theGermecolumn from the file is used.- ab
Optional antibiotic filter/override passed to
interpret_pheno().- instrument_guideline
Optional guideline string for the
guidelinecolumn (e.g."EUCAST 2023").- sirscan_codes
A data frame mapping SIRscan antibiotic codes (
sirscan_code) to antibiotic names (ab_name) recognised byAMR::as.ab(). Defaults to the built-insirscan_codestable. Supply your own data frame to override mappings — for example if your SIRscan configuration usesS,K, orCfor different agents than the defaults. Set toNULLto skip the lookup and pass all codes directly toAMR::as.ab().- interpret_eucast
Interpret MIC/disk values against EUCAST human breakpoints (default
FALSE).- interpret_clsi
Interpret MIC/disk values against CLSI human breakpoints (default
FALSE).- interpret_ecoff
Interpret MIC/disk values against ECOFF values (default
FALSE).
Value
A standardised long-format data frame with columns:
id, drug, mic, disk,
pheno_provided, pheno_eucast, pheno_clsi, ecoff,
method, platform, guideline, source,
spp_pheno, collection_date, specimen_type.
Details
Files have a 4-row metadata header (institution, lab, export date, period) followed by a semicolon-delimited data block. Latin-1 (Windows-1252) encoding is assumed, as is standard for French-locale SIRscan exports.
Examples
if (FALSE) { # \dontrun{
# Import all three SIRscan export files
pheno <- import_sirscan_pheno(
mic_file = "CMI_SALMO.csv",
disk_file = "DIAM_SALMO.csv",
interpr_file = "INTERPR_SALMO.csv"
)
# MIC + interpretations only, with EUCAST re-interpretation
pheno <- import_sirscan_pheno(
mic_file = "CMI_SALMO.csv",
interpr_file = "INTERPR_SALMO.csv",
species = "Salmonella enterica",
interpret_eucast = TRUE
)
} # }