mo_matching_score {AMR}R Documentation

Calculate the Matching Score for Microorganisms

Description

This algorithm is used by as.mo() and all the mo_* functions to determine the most probable match of taxonomic records based on user input.

Usage

mo_matching_score(x, n)

Arguments

x

Any user input value(s).

n

A full taxonomic name, that exists in microorganisms$fullname.

Matching Score for Microorganisms

With ambiguous user input in as.mo() and all the mo_* functions, the returned results are chosen based on their matching score using mo_matching_score(). This matching score m, is calculated as:

m_{(x, n)} = \frac{l_{n} - 0.5 \cdot \min \begin{cases}l_{n} \\ \textrm{lev}(x, n)\end{cases}}{l_{n} \cdot p_{n} \cdot k_{n}}

where:

The grouping into human pathogenic prevalence p is based on recent work from Bartlett et al. (2022, doi:10.1099/mic.0.001269) who extensively studied medical-scientific literature to categorise all bacterial species into these groups:

Furthermore,

When calculating the matching score, all characters in x and n are ignored that are other than A-Z, a-z, 0-9, spaces and parentheses.

All matches are sorted descending on their matching score and for all user input values, the top match will be returned. This will lead to the effect that e.g., "E. coli" will return the microbial ID of Escherichia coli (m = 0.688, a highly prevalent microorganism found in humans) and not Entamoeba coli (m = 0.381, a less prevalent microorganism in humans), although the latter would alphabetically come first.

Download Our Reference Data

All reference data sets in the AMR package - including information on microorganisms, antimicrobials, and clinical breakpoints - are freely available for download in multiple formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, and Stata.

For maximum compatibility, we also provide machine-readable, tab-separated plain text files suitable for use in any software, including laboratory information systems.

Visit our website for direct download links, or explore the actual files in our GitHub repository.

Note

This algorithm was originally developed in 2018 and subsequently described in: Berends MS et al. (2022). AMR: An R Package for Working with Antimicrobial Resistance Data. Journal of Statistical Software, 104(3), 1-31; doi:10.18637/jss.v104.i03.

Later, the work of Bartlett A et al. about bacterial pathogens infecting humans (2022, doi:10.1099/mic.0.001269) was incorporated, and optimalisations to the algorithm were made.

Examples

mo_reset_session()

as.mo("E. coli")
mo_uncertainties()

mo_matching_score(
  x = "E. coli",
  n = c("Escherichia coli", "Entamoeba coli")
)

[Package AMR version 3.0.0 Index]