1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-27 10:46:12 +01:00
AMR/man/as.mo.Rd

102 lines
4.5 KiB
Plaintext
Raw Normal View History

2018-07-23 14:14:03 +02:00
% Generated by roxygen2: do not edit by hand
2018-08-31 13:36:19 +02:00
% Please edit documentation in R/mo.R
\name{as.mo}
\alias{as.mo}
\alias{mo}
\alias{is.mo}
\alias{guess_mo}
\title{Transform to microorganism ID}
\source{
[1] Becker K \emph{et al.} \strong{Coagulase-Negative Staphylococci}. 2014. Clin Microbiol Rev. 27(4): 870926. \cr
\url{https://dx.doi.org/10.1128/CMR.00109-13} \cr
[2] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 57195. \cr
\url{https://dx.doi.org/10.1084/jem.57.4.571}
}
2018-07-23 14:14:03 +02:00
\usage{
2018-08-31 13:36:19 +02:00
as.mo(x, Becker = FALSE, Lancefield = FALSE)
2018-07-23 14:14:03 +02:00
2018-08-31 13:36:19 +02:00
is.mo(x)
2018-07-23 14:14:03 +02:00
2018-08-31 13:36:19 +02:00
guess_mo(x, Becker = FALSE, Lancefield = FALSE)
2018-07-23 14:14:03 +02:00
}
\arguments{
\item{x}{a character vector or a dataframe with one or two columns}
\item{Becker}{a logical to indicate whether \emph{Staphylococci} should be categorised into Coagulase Negative \emph{Staphylococci} ("CoNS") and Coagulase Positive \emph{Staphylococci} ("CoPS") instead of their own species, according to Karsten Becker \emph{et al.} [1]. This excludes \emph{Staphylococcus aureus} at default, use \code{Becker = "all"} to also categorise \emph{S. aureus} as "CoPS".}
\item{Lancefield}{a logical to indicate whether beta-haemolytic \emph{Streptococci} should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield [2]. These \emph{Streptococci} will be categorised in their first group, i.e. \emph{Streptococcus dysgalactiae} will be group C, although officially it was also categorised into groups G and L. Groups D and E will be ignored, since they are \emph{Enterococci}.}
2018-07-23 14:14:03 +02:00
}
\value{
2018-08-31 13:36:19 +02:00
Character (vector) with class \code{"mo"}. Unknown values will return \code{NA}.
2018-07-23 14:14:03 +02:00
}
\description{
Use this function to determine a valid ID based on a genus (and species). This input can be a full name (like \code{"Staphylococcus aureus"}), an abbreviated name (like \code{"S. aureus"}), or just a genus. You could also \code{\link{select}} a genus and species column, zie Examples.
}
\details{
2018-08-31 13:36:19 +02:00
\code{guess_mo} is an alias of \code{as.mo}.
2018-08-01 08:03:31 +02:00
2018-08-31 13:36:19 +02:00
Use the \code{\link{mo_property}} functions to get properties based on the returned mo, see Examples.
Some exceptions have been built in to get more logical results, based on prevalence of human pathogens. These are:
2018-07-23 14:14:03 +02:00
\itemize{
\item{\code{"E. coli"} will return the ID of \emph{Escherichia coli} and not \emph{Entamoeba coli}, although the latter would alphabetically come first}
\item{\code{"H. influenzae"} will return the ID of \emph{Haemophilus influenzae} and not \emph{Haematobacter influenzae}}
\item{Something like \code{"p aer"} will return the ID of \emph{Pseudomonas aeruginosa} and not \emph{Pasteurella aerogenes}}
\item{Something like \code{"stau"} or \code{"staaur"} will return the ID of \emph{Staphylococcus aureus} and not \emph{Staphylococcus auricularis}}
}
Moreover, this function also supports ID's based on only Gram stain, when the species is not known. \cr
For example, \code{"Gram negative rods"} and \code{"GNR"} will both return the ID of a Gram negative rod: \code{GNR}.
}
\examples{
# These examples all return "STAAUR", the ID of S. aureus:
2018-08-31 13:36:19 +02:00
as.mo("stau")
as.mo("STAU")
as.mo("staaur")
as.mo("S. aureus")
as.mo("S aureus")
as.mo("Staphylococcus aureus")
as.mo("MRSA") # Methicillin Resistant S. aureus
as.mo("VISA") # Vancomycin Intermediate S. aureus
as.mo("VRSA") # Vancomycin Resistant S. aureus
2018-07-23 14:14:03 +02:00
2018-08-31 13:36:19 +02:00
# guess_mo is an alias of as.mo and works the same
guess_mo("S. epidermidis") # will remain species: STAEPI
guess_mo("S. epidermidis", Becker = TRUE) # will not remain species: STACNS
2018-08-31 13:36:19 +02:00
guess_mo("S. pyogenes") # will remain species: STCAGA
guess_mo("S. pyogenes", Lancefield = TRUE) # will not remain species: STCGRA
2018-08-31 13:36:19 +02:00
# Use mo_* functions to get a specific property based on `mo`
Ecoli <- as.mo("E. coli") # returns `ESCCOL`
mo_genus(Ecoli) # returns "Escherichia"
mo_gramstain(Ecoli) # returns "Negative rods"
2018-07-23 14:14:03 +02:00
\dontrun{
2018-08-31 13:36:19 +02:00
df$mo <- as.mo(df$microorganism_name)
2018-07-23 14:14:03 +02:00
# the select function of tidyverse is also supported:
library(dplyr)
2018-08-31 13:36:19 +02:00
df$mo <- df \%>\%
2018-07-23 14:14:03 +02:00
select(microorganism_name) \%>\%
2018-08-31 13:36:19 +02:00
guess_mo()
2018-07-23 14:14:03 +02:00
# and can even contain 2 columns, which is convenient for genus/species combinations:
2018-08-31 13:36:19 +02:00
df$mo <- df \%>\%
2018-07-23 14:14:03 +02:00
select(genus, species) \%>\%
2018-08-31 13:36:19 +02:00
guess_mo()
2018-07-23 14:14:03 +02:00
# same result:
df <- df \%>\%
2018-08-31 13:36:19 +02:00
mutate(mo = guess_mo(paste(genus, species)))
2018-07-23 14:14:03 +02:00
}
}
\seealso{
\code{\link{microorganisms}} for the dataframe that is being used to determine ID's.
}
2018-08-03 14:49:29 +02:00
\keyword{Becker}
\keyword{Lancefield}
\keyword{becker}
\keyword{guess}
\keyword{lancefield}
2018-08-31 13:36:19 +02:00
\keyword{mo}