1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 08:52:15 +02:00

ab_* functions, mo_* functions, 180 new microorganisms, speed improvement for bactid

This commit is contained in:
2018-08-28 13:51:13 +02:00
parent 2acdb1981c
commit 972fc4f6c7
24 changed files with 571 additions and 306 deletions

45
man/ab_property.Rd Normal file
View File

@ -0,0 +1,45 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ab_property.R
\name{ab_property}
\alias{ab_property}
\alias{ab_atc}
\alias{ab_official}
\alias{ab_official_nl}
\alias{ab_trivial_nl}
\alias{ab_certe}
\alias{ab_umcg}
\title{Property of an antibiotic}
\usage{
ab_property(x, property = "official")
ab_atc(x)
ab_official(x)
ab_official_nl(x)
ab_trivial_nl(x)
ab_certe(x)
ab_umcg(x)
}
\arguments{
\item{x}{a (vector of a) valid \code{\link{atc}} code or any text that can be coerced to a valid atc with \code{\link{as.atc}}}
\item{property}{one of the column names of one of the \code{\link{antibiotics}} data set, like \code{"atc"} and \code{"official"}}
}
\description{
Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set, based on their ATC code. Get such a code with \code{\link{as.atc}}.
}
\examples{
ab_atc("amcl") # J01CR02
ab_official("amcl") # Amoxicillin and beta-lactamase inhibitor
ab_official_nl("amcl") # Amoxicilline met enzymremmer
ab_trivial_nl("amcl") # Amoxicilline/clavulaanzuur
ab_certe("amcl") # amcl
ab_umcg("amcl") # AMCL
}
\seealso{
\code{\link{antibiotics}}
}

View File

@ -9,11 +9,11 @@
\item{\code{atc}}{ATC code, like \code{J01CR02}}
\item{\code{certe}}{Certe code, like \code{amcl}}
\item{\code{umcg}}{UMCG code, like \code{AMCL}}
\item{\code{abbr}}{Abbreviation as used by many countries, to be used for \code{\link{guess_atc}}}
\item{\code{official}}{Official name by the WHO, like \code{"Amoxicillin and enzyme inhibitor"}}
\item{\code{abbr}}{Abbreviation as used by many countries, used internally by \code{\link{as.atc}}}
\item{\code{official}}{Official name by the WHO, like \code{"Amoxicillin and beta-lactamase inhibitor"}}
\item{\code{official_nl}}{Official name in the Netherlands, like \code{"Amoxicilline met enzymremmer"}}
\item{\code{trivial_nl}}{Trivial name in Dutch, like \code{"Amoxicilline/clavulaanzuur"}}
\item{\code{trade_name}}{Trade name as used by many countries, to be used for \code{\link{guess_atc}}}
\item{\code{trade_name}}{Trade name as used by many countries, used internally by \code{\link{as.atc}}}
\item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment}
\item{\code{oral_units}}{Units of \code{ddd_units}}
\item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment}

View File

@ -23,6 +23,8 @@ Character (vector) with class \code{"act"}. Unknown values will return \code{NA}
Use this function to determine the ATC code of one or more antibiotics. The dataset \code{\link{antibiotics}} will be searched for abbreviations, official names and trade names.
}
\details{
Use the \code{\link{ab_property}} functions to get properties based on the returned ATC code, see Examples.
In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups.
Source: \url{https://www.whocc.no/atc/structure_and_principles/}
}
@ -36,6 +38,11 @@ as.atc("ERY")
as.atc("Erythrocin") # Trade name
as.atc("Eryzole") # Trade name
as.atc("Pediamycin") # Trade name
# Use ab_* functions to get a specific property based on an ATC code
Cipro <- as.atc("cipro") # returns `J01MA02`
ab_official(Cipro) # returns "Ciprofloxacin"
ab_umcg(Cipro) # returns "CIPR", the code used in the UMCG
}
\seealso{
\code{\link{antibiotics}} for the dataframe that is being used to determine ATC's.

View File

@ -2,6 +2,7 @@
% Please edit documentation in R/bactid.R
\name{as.bactid}
\alias{as.bactid}
\alias{bactid}
\alias{guess_bactid}
\alias{is.bactid}
\title{Transform to bacteria ID}
@ -34,6 +35,8 @@ Use this function to determine a valid ID based on a genus (and species). This i
\details{
\code{guess_bactid} is an alias of \code{as.bactid}.
Use the \code{\link{mo_property}} functions to get properties based on the returned bactid, see Examples.
Some exceptions have been built in to get more logical results, based on prevalence of human pathogens. These are:
\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}
@ -56,12 +59,18 @@ as.bactid("MRSA") # Methicillin Resistant S. aureus
as.bactid("VISA") # Vancomycin Intermediate S. aureus
as.bactid("VRSA") # Vancomycin Resistant S. aureus
# guess_bactid is an alias of as.bactid and works the same
guess_bactid("S. epidermidis") # will remain species: STAEPI
guess_bactid("S. epidermidis", Becker = TRUE) # will not remain species: STACNS
guess_bactid("S. pyogenes") # will remain species: STCAGA
guess_bactid("S. pyogenes", Lancefield = TRUE) # will not remain species: STCGRA
# Use mo_* functions to get a specific property based on a bactid
Ecoli <- as.bactid("E. coli") # returns `ESCCOL`
mo_genus(Ecoli) # returns "Escherichia"
mo_gramstain(Ecoli) # returns "Negative rods"
\dontrun{
df$bactid <- as.bactid(df$microorganism_name)

View File

@ -1,27 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/atc.R
\name{atc.property}
\alias{atc.property}
\alias{atc.official}
\alias{atc.official_nl}
\alias{atc.trivial_nl}
\alias{atc.certe}
\alias{atc.umcg}
\title{Get antibiotic property based on ATC}
\usage{
atc.official(atc)
atc.official_nl(atc)
atc.trivial_nl(atc)
atc.certe(atc)
atc.umcg(atc)
}
\arguments{
\item{atc}{a valid ATC code, created with \code{\link{as.atc}}}
}
\description{
Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set, based on their ATC code.
}

View File

@ -1,42 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bactid.R
\name{bactid.property}
\alias{bactid.property}
\alias{bactid.family}
\alias{bactid.genus}
\alias{bactid.species}
\alias{bactid.subspecies}
\alias{bactid.fullname}
\alias{bactid.type}
\alias{bactid.gramstain}
\alias{bactid.aerobic}
\alias{bactid.type_nl}
\alias{bactid.gramstain_nl}
\title{Get microbial property based on `bactid`}
\usage{
bactid.family(bactid)
bactid.genus(bactid)
bactid.species(bactid)
bactid.subspecies(bactid)
bactid.fullname(bactid)
bactid.type(bactid)
bactid.gramstain(bactid)
bactid.aerobic(bactid)
bactid.type_nl(bactid)
bactid.gramstain_nl(bactid)
}
\arguments{
\item{bactid}{a valid bactid code, created with \code{\link{as.bactid}}}
}
\description{
Use these functions to return a specific property of a microorganism from the \code{\link{microorganisms}} data set, based on their \code{bactid}. Get such an ID with \code{\link{as.bactid}}.
}

View File

@ -3,8 +3,8 @@
\docType{data}
\name{microorganisms}
\alias{microorganisms}
\title{Dataset with ~2500 microorganisms}
\format{A data.frame with 2464 observations and 12 variables:
\title{Dataset with ~2650 microorganisms}
\format{A data.frame with 2,646 observations and 12 variables:
\describe{
\item{\code{bactid}}{ID of microorganism}
\item{\code{bactsys}}{Bactsyscode of microorganism}
@ -23,7 +23,7 @@
microorganisms
}
\description{
A dataset containing 2464 microorganisms. MO codes of the UMCG can be looked up using \code{\link{microorganisms.umcg}}.
A dataset containing 2,646 microorganisms. MO codes of the UMCG can be looked up using \code{\link{microorganisms.umcg}}.
}
\seealso{
\code{\link{guess_bactid}} \code{\link{antibiotics}} \code{\link{microorganisms.umcg}}

88
man/mo_property.Rd Normal file
View File

@ -0,0 +1,88 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mo_property.R
\name{mo_property}
\alias{mo_property}
\alias{mo_family}
\alias{mo_genus}
\alias{mo_species}
\alias{mo_subspecies}
\alias{mo_fullname}
\alias{mo_type}
\alias{mo_gramstain}
\alias{mo_aerobic}
\alias{mo_type_nl}
\alias{mo_gramstain_nl}
\title{Property of a microorganism}
\usage{
mo_property(x, property = "fullname")
mo_family(x)
mo_genus(x)
mo_species(x)
mo_subspecies(x)
mo_fullname(x)
mo_type(x)
mo_gramstain(x)
mo_aerobic(x)
mo_type_nl(x)
mo_gramstain_nl(x)
}
\arguments{
\item{x}{a (vector of a) valid \code{\link{bactid}} or any text that can be coerced to a valid bactid with \code{\link{as.bactid}}}
\item{property}{one of the column names of one of the \code{\link{microorganisms}} data set, like \code{"bactid"}, \code{"bactsys"}, \code{"family"}, \code{"genus"}, \code{"species"}, \code{"fullname"}, \code{"gramstain"} and \code{"aerobic"}}
}
\description{
Use these functions to return a specific property of a microorganism from the \code{\link{microorganisms}} data set, based on their \code{bactid}. Get such an ID with \code{\link{as.bactid}}.
}
\examples{
# All properties
mo_family("E. coli") # Enterobacteriaceae
mo_genus("E. coli") # Escherichia
mo_species("E. coli") # coli
mo_subspecies("E. coli") # <NA>
mo_fullname("E. coli") # Escherichia coli
mo_type("E. coli") # Bacteria
mo_gramstain("E. coli") # Negative rods
mo_aerobic("E. coli") # TRUE
mo_type_nl("E. coli") # Bacterie
mo_gramstain_nl("E. coli") # Negatieve staven
# Abbreviations known in the field
mo_genus("EHEC") # Escherichia
mo_species("EHEC") # coli
mo_subspecies("EHEC") # EHEC
mo_fullname("EHEC") # Escherichia coli (EHEC)
mo_genus("MRSA") # Staphylococcus
mo_species("MRSA") # aureus
mo_gramstain("MRSA") # Positive cocci
mo_genus("VISA") # Staphylococcus
mo_species("VISA") # aureus
# Known subspecies
mo_genus("doylei") # Campylobacter
mo_species("doylei") # jejuni
mo_fullname("doylei") # Campylobacter jejuni (doylei)
# Anaerobic bacteria
mo_genus("B. fragilis") # Bacteroides
mo_species("B. fragilis") # fragilis
mo_aerobic("B. fragilis") # FALSE
}
\seealso{
\code{\link{microorganisms}}
}