mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 04:42:22 +02:00
mo codes for WHONET
This commit is contained in:
30
man/as.mo.Rd
30
man/as.mo.Rd
@ -4,12 +4,21 @@
|
||||
\alias{as.mo}
|
||||
\alias{mo}
|
||||
\alias{is.mo}
|
||||
\alias{mo_failures}
|
||||
\alias{mo_uncertainties}
|
||||
\alias{mo_renamed}
|
||||
\title{Transform to microorganism ID}
|
||||
\usage{
|
||||
as.mo(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE,
|
||||
reference_df = get_mo_source())
|
||||
|
||||
is.mo(x)
|
||||
|
||||
mo_failures()
|
||||
|
||||
mo_uncertainties()
|
||||
|
||||
mo_renamed()
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{a character vector or a \code{data.frame} with one or two columns}
|
||||
@ -52,7 +61,7 @@ Use the \code{\link{mo_property}} functions to get properties based on the retur
|
||||
|
||||
This function uses Artificial Intelligence (AI) to help getting fast and logical results. It tries to find matches in this order:
|
||||
\itemize{
|
||||
\item{Taxonomic kingdom: it first searches in bacteria, then fungi, then protozoa}
|
||||
\item{Taxonomic kingdom: it first searches in Bacteria, then Fungi, then Protozoa}
|
||||
\item{Human pathogenic prevalence: it first searches in more prevalent microorganisms, then less prevalent ones}
|
||||
\item{Valid MO codes and full names: it first searches in already valid MO code and known genus/species combinations}
|
||||
\item{Breakdown of input values: from here it starts to breakdown input values to find possible matches}
|
||||
@ -67,12 +76,29 @@ A couple of effects because of these rules:
|
||||
}
|
||||
This means that looking up human pathogenic microorganisms takes less time than looking up human \strong{non}-pathogenic microorganisms.
|
||||
|
||||
When using \code{allow_uncertain = TRUE} (which is the default setting), it will use additional rules if all previous AI rules failed to get valid results. Examples:
|
||||
\strong{UNCERTAIN RESULTS} \cr
|
||||
When using \code{allow_uncertain = TRUE} (which is the default setting), it will use additional rules if all previous AI rules failed to get valid results. These are:
|
||||
\itemize{
|
||||
\item{It tries to look for previously accepted (but now invalid) taxonomic names}
|
||||
\item{It strips off values between brackets and the brackets itself, and re-evaluates the input with all previous rules}
|
||||
\item{It strips off words from the end one by one and re-evaluates the input with all previous rules}
|
||||
\item{It strips off words from the start one by one and re-evaluates the input with all previous rules}
|
||||
\item{It tries to look for some manual changes which are not yet published to the ITIS database (like \emph{Propionibacterium} not yet being \emph{Cutibacterium})}
|
||||
}
|
||||
|
||||
Examples:
|
||||
\itemize{
|
||||
\item{\code{"Streptococcus group B (known as S. agalactiae)"}. The text between brackets will be removed and a warning will be thrown that the result \emph{Streptococcus group B} (\code{B_STRPTC_GRB}) needs review.}
|
||||
\item{\code{"S. aureus - please mind: MRSA"}. The last word will be stripped, after which the function will try to find a match. If it does not, the second last word will be stripped, etc. Again, a warning will be thrown that the result \emph{Staphylococcus aureus} (\code{B_STPHY_AUR}) needs review.}
|
||||
\item{\code{"D. spartina"}. This is the abbreviation of an old taxonomic name: \emph{Didymosphaeria spartinae} (the last "e" was missing from the input). This fungus was renamed to \emph{Leptosphaeria obiones}, so a warning will be thrown that this result (\code{F_LPTSP_OBI}) needs review.}
|
||||
\item{\code{"Fluoroquinolone-resistant Neisseria gonorrhoeae"}. The first word will be stripped, after which the function will try to find a match. A warning will be thrown that the result \emph{Neisseria gonorrhoeae} (\code{B_NESSR_GON}) needs review.}
|
||||
}
|
||||
|
||||
Use \code{mo_failures()} to get a vector with all values that could not be coerced to a valid value.
|
||||
|
||||
Use \code{mo_uncertainties()} to get a vector with all values that were coerced to a valid value, but with uncertainty.
|
||||
|
||||
Use \code{mo_renamed()} to get a vector with all values that could be coerced based on an old, previously accepted taxonomic name.
|
||||
}
|
||||
\section{Source}{
|
||||
|
||||
|
@ -71,14 +71,14 @@ interpretive_reading(...)
|
||||
|
||||
\item{rules}{a character vector that specifies which rules should be applied - one or more of \code{c("breakpoints", "expert", "other", "all")}}
|
||||
|
||||
\item{verbose}{a logical to indicate whether extensive info should be returned as a \code{data.frame} with info about which rows and columns are effected}
|
||||
\item{verbose}{a logical to indicate whether extensive info should be returned as a \code{data.frame} with info about which rows and columns are effected. It runs all EUCAST rules, but will not be applied to an output - only an informative \code{data.frame} with changes will be returned as output.}
|
||||
|
||||
\item{amcl, amik, amox, ampi, azit, azlo, aztr, cefa, cfep, cfot, cfox, cfra, cfta, cftr, cfur, chlo, cipr, clar, clin, clox, coli, czol, dapt, doxy, erta, eryt, fosf, fusi, gent, imip, kana, levo, linc, line, mero, mezl, mino, moxi, nali, neom, neti, nitr, norf, novo, oflo, oxac, peni, pipe, pita, poly, pris, qida, rifa, roxi, siso, teic, tetr, tica, tige, tobr, trim, trsu, vanc}{column name of an antibiotic, see Antibiotics}
|
||||
|
||||
\item{...}{parameters that are passed on to \code{eucast_rules}}
|
||||
}
|
||||
\value{
|
||||
The input of \code{tbl}, possibly with edited values of antibiotics. Or, if \code{verbose = TRUE}, a \code{data.frame} with verbose info.
|
||||
The input of \code{tbl}, possibly with edited values of antibiotics. Or, if \code{verbose = TRUE}, a \code{data.frame} with all original and new values of the affected bug-drug combinations.
|
||||
}
|
||||
\description{
|
||||
Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{http://eucast.org}), see \emph{Source}. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables.
|
||||
@ -184,7 +184,9 @@ a
|
||||
# 4 Klebsiella pneumoniae - - - - - S S
|
||||
# 5 Pseudomonas aeruginosa - - - - - S S
|
||||
|
||||
b <- eucast_rules(a, "mo") # 18 results are forced as R or S
|
||||
|
||||
# apply EUCAST rules: 18 results are forced as R or S
|
||||
b <- eucast_rules(a)
|
||||
|
||||
b
|
||||
# mo vanc amox coli cfta cfur peni cfox
|
||||
@ -193,6 +195,11 @@ b
|
||||
# 3 Escherichia coli R - - - - R S
|
||||
# 4 Klebsiella pneumoniae R R - - - R S
|
||||
# 5 Pseudomonas aeruginosa R R - - R R R
|
||||
|
||||
|
||||
# do not apply EUCAST rules, but rather get a a data.frame
|
||||
# with 18 rows, containing all details about the transformations:
|
||||
c <- eucast_rules(a, verbose = TRUE)
|
||||
}
|
||||
\keyword{eucast}
|
||||
\keyword{interpretive}
|
||||
|
@ -4,7 +4,7 @@
|
||||
\name{microorganisms}
|
||||
\alias{microorganisms}
|
||||
\title{Data set with ~20,000 microorganisms}
|
||||
\format{A \code{\link{data.frame}} with 18,833 observations and 15 variables:
|
||||
\format{A \code{\link{data.frame}} with 19,456 observations and 15 variables:
|
||||
\describe{
|
||||
\item{\code{mo}}{ID of microorganism}
|
||||
\item{\code{tsn}}{Taxonomic Serial Number (TSN), as defined by ITIS}
|
||||
@ -31,6 +31,19 @@ microorganisms
|
||||
\description{
|
||||
A data set containing the complete microbial taxonomy of the kingdoms Bacteria, Fungi and Protozoa from ITIS. MO codes can be looked up using \code{\link{as.mo}}.
|
||||
}
|
||||
\details{
|
||||
Manually added were:
|
||||
\itemize{
|
||||
\item{605 species of Aspergillus (as Aspergillus misses from ITIS, list from https://en.wikipedia.org/wiki/List_of_Aspergillus_species on 2019-02-05)}
|
||||
\item{23 species of Trichophyton (as Trichophyton misses from ITIS, list from https://en.wikipedia.org/wiki/Trichophyton on 2019-02-05)}
|
||||
\item{9 species of Streptococcus (beta haemolytic groups A, B, C, D, F, G, H, K and unspecified)}
|
||||
\item{2 species of Straphylococcus (coagulase-negative [CoNS] and coagulase-positive [CoPS])}
|
||||
\item{1 species of Candida (C. glabrata)}
|
||||
\item{2 other undefined (unknown Gram negatives and unknown Gram positives)}
|
||||
}
|
||||
|
||||
These manual entries have no Taxonomic Serial Number (TSN), so can be looked up with \code{filter(microorganisms, is.na(tsn)}.
|
||||
}
|
||||
\section{ITIS}{
|
||||
|
||||
\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr}
|
||||
|
@ -4,17 +4,27 @@
|
||||
\name{microorganisms.codes}
|
||||
\alias{microorganisms.codes}
|
||||
\title{Translation table for microorganism codes}
|
||||
\format{A \code{\link{data.frame}} with 3,303 observations and 2 variables:
|
||||
\format{A \code{\link{data.frame}} with 4,731 observations and 2 variables:
|
||||
\describe{
|
||||
\item{\code{certe}}{Commonly used code of a microorganism}
|
||||
\item{\code{mo}}{Code of microorganism in \code{\link{microorganisms}}}
|
||||
\item{\code{mo}}{ID of the microorganism in the \code{\link{microorganisms}} data set}
|
||||
}}
|
||||
\usage{
|
||||
microorganisms.codes
|
||||
}
|
||||
\description{
|
||||
A data set containing commonly used codes for microorganisms. Define your own with \code{\link{set_mo_source}}.
|
||||
A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with \code{\link{set_mo_source}}.
|
||||
}
|
||||
\section{ITIS}{
|
||||
|
||||
\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr}
|
||||
This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}).
|
||||
|
||||
All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.
|
||||
|
||||
ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].
|
||||
}
|
||||
|
||||
\section{Read more on our website!}{
|
||||
|
||||
\if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr}
|
||||
|
@ -1,14 +0,0 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/mo.R
|
||||
\name{mo_failures}
|
||||
\alias{mo_failures}
|
||||
\title{Vector of failed coercion attempts}
|
||||
\usage{
|
||||
mo_failures()
|
||||
}
|
||||
\description{
|
||||
Returns a vector of all failed attempts to coerce values to a valid MO code with \code{\link{as.mo}}.
|
||||
}
|
||||
\seealso{
|
||||
\code{\link{as.mo}}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/mo.R
|
||||
\name{mo_renamed}
|
||||
\alias{mo_renamed}
|
||||
\title{Vector of taxonomic renamed items}
|
||||
\usage{
|
||||
mo_renamed()
|
||||
}
|
||||
\description{
|
||||
Returns a vector of all renamed items of the last coercion to valid MO codes with \code{\link{as.mo}}.
|
||||
}
|
||||
\seealso{
|
||||
\code{\link{as.mo}}
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
\alias{microorganisms.unprevDT}
|
||||
\alias{microorganisms.oldDT}
|
||||
\title{Supplementary Data}
|
||||
\format{An object of class \code{data.table} (inherits from \code{data.frame}) with 18833 rows and 15 columns.}
|
||||
\format{An object of class \code{data.table} (inherits from \code{data.frame}) with 19456 rows and 15 columns.}
|
||||
\usage{
|
||||
microorganismsDT
|
||||
|
||||
|
Reference in New Issue
Block a user