1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 06:51:48 +02:00

new antibiotics

This commit is contained in:
2019-05-10 16:44:59 +02:00
parent 73f1ee1159
commit 68cc7ef0d0
147 changed files with 6228 additions and 4187 deletions

View File

@ -3,39 +3,30 @@
\name{AMR-deprecated}
\alias{AMR-deprecated}
\alias{ratio}
\alias{ab_property}
\alias{ab_atc}
\alias{abname}
\alias{atc_property}
\alias{atc_official}
\alias{ab_official}
\alias{ab_name}
\alias{ab_trivial_nl}
\alias{ab_certe}
\alias{ab_umcg}
\alias{ab_tradenames}
\alias{atc_ddd}
\alias{atc_groups}
\alias{atc_name}
\alias{atc_trivial_nl}
\alias{atc_tradenames}
\title{Deprecated functions}
\usage{
ratio(x, ratio)
ab_property(...)
abname(...)
ab_atc(...)
atc_property(...)
atc_official(...)
ab_official(...)
ab_name(...)
atc_name(...)
ab_trivial_nl(...)
atc_trivial_nl(...)
ab_certe(...)
ab_umcg(...)
ab_tradenames(...)
atc_ddd(...)
atc_groups(...)
atc_tradenames(...)
}
\description{
These functions are so-called '\link{Deprecated}'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one).

110
man/ab_property.Rd Normal file
View File

@ -0,0 +1,110 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ab_property.R
\name{ab_property}
\alias{ab_property}
\alias{ab_name}
\alias{ab_atc}
\alias{ab_cid}
\alias{ab_synonyms}
\alias{ab_tradenames}
\alias{ab_group}
\alias{ab_atc_group1}
\alias{ab_atc_group2}
\alias{ab_ddd}
\title{Property of an antibiotic}
\usage{
ab_name(x, language = get_locale(), tolower = FALSE, ...)
ab_atc(x, ...)
ab_cid(x, ...)
ab_synonyms(x, ...)
ab_tradenames(x, ...)
ab_group(x, ...)
ab_atc_group1(x, ...)
ab_atc_group2(x, ...)
ab_ddd(x, administration = "oral", units = FALSE, ...)
ab_property(x, property = "name", language = get_locale(), ...)
}
\arguments{
\item{x}{any (vector of) text that can be coerced to a valid microorganism code with \code{\link{as.ab}}}
\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
\item{tolower}{logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".}
\item{...}{other parameters passed on to \code{\link{as.ab}}}
\item{administration}{way of administration, either \code{"oral"} or \code{"iv"}}
\item{units}{a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples}
\item{property}{one of the column names of one of the \code{\link{antibiotics}} data set}
}
\value{
\itemize{
\item{An \code{integer} in case of \code{ab_cid}}
\item{A named \code{list} in case of multiple \code{ab_synonyms}}
\item{A \code{double} in case of \code{ab_ddd}}
\item{A \code{character} in all other cases}
}
}
\description{
Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set. All input values will be evaluated internally with \code{\link{as.ab}}.
}
\details{
All output will be \link{translate}d where possible.
}
\section{Source}{
World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/}
WHONET 2019 software: \url{http://www.whonet.org/software.html}
European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}
}
\section{Read more on our website!}{
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
}
\examples{
# all properties:
ab_name("AMX") # "Amoxicillin"
ab_atc("AMX") # J01CA04 (ATC code from the WHO)
ab_cid("AMX") # 33613 (Compound ID from PubChem)
ab_synonyms("AMX") # a list with brand names of amoxicillin
ab_tradenames("AMX") # same
ab_group("AMX") # "Beta-lactams/penicillins"
ab_atc_group1("AMX") # "Beta-lactam antibacterials, penicillins"
ab_atc_group2("AMX") # "Penicillins with extended spectrum"
ab_name(x = c("AMC", "PLB")) # "Amoxicillin/clavulanic acid" "Polymyxin B"
ab_name(x = c("AMC", "PLB"),
tolower = TRUE) # "amoxicillin/clavulanic acid" "polymyxin B"
ab_ddd("AMX", "oral") # 1
ab_ddd("AMX", "oral", units = TRUE) # "g"
ab_ddd("AMX", "iv") # 1
ab_ddd("AMX", "iv", units = TRUE) # "g"
# all ab_* functions use as.ab() internally:
ab_name("Fluclox") # "Flucloxacillin"
ab_name("fluklox") # "Flucloxacillin"
ab_name("floxapen") # "Flucloxacillin"
ab_name(21319) # "Flucloxacillin" (using CID)
ab_name("J01CF05") # "Flucloxacillin" (using ATC)
}
\seealso{
\code{\link{antibiotics}}
}

View File

@ -1,74 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/abname.R
\name{abname}
\alias{abname}
\title{Name of an antibiotic}
\source{
\code{\link{antibiotics}}
}
\usage{
abname(abcode, from = c("guess", "atc", "certe", "umcg"),
to = "official", textbetween = " + ", tolower = FALSE)
}
\arguments{
\item{abcode}{a code or name, like \code{"AMOX"}, \code{"AMCL"} or \code{"J01CA04"}}
\item{from, to}{type to transform from and to. See \code{\link{antibiotics}} for its column names. WIth \code{from = "guess"} the from will be guessed from \code{"atc"}, \code{"certe"} and \code{"umcg"}. When using \code{to = "atc"}, the ATC code will be searched using \code{\link{as.atc}}.}
\item{textbetween}{text to put between multiple returned texts}
\item{tolower}{return output as lower case with function \code{\link{tolower}}.}
}
\description{
Convert antibiotic codes to a (trivial) antibiotic name or ATC code, or vice versa. This uses the data from \code{\link{antibiotics}}.
}
\details{
\strong{The \code{\link{ab_property}} functions are faster and more concise}, but do not support concatenated strings, like \code{abname("AMCL+GENT"}.
}
\section{WHOCC}{
\if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr}
This package contains \strong{all ~500 antimicrobial drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}).
These have become the gold standard for international drug utilisation monitoring and research.
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
}
\section{Read more on our website!}{
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
}
\examples{
abname("AMCL")
# "Amoxicillin and beta-lactamase inhibitor"
# It is quite flexible at default (having `from = "guess"`)
abname(c("amox", "J01CA04", "Trimox", "dispermox", "Amoxil"))
# "Amoxicillin" "Amoxicillin" "Amoxicillin" "Amoxicillin" "Amoxicillin"
# Multiple antibiotics can be combined with "+".
# The second antibiotic will be set to lower case when `tolower` was not set:
abname("AMCL+GENT", textbetween = "/")
# "amoxicillin and enzyme inhibitor/gentamicin"
abname(c("AMCL", "GENT"))
# "Amoxicillin and beta-lactamase inhibitor" "Gentamicin"
abname("AMCL", to = "trivial_nl")
# "Amoxicilline/clavulaanzuur"
abname("AMCL", to = "atc")
# "J01CR02"
# specific codes for University Medical Center Groningen (UMCG):
abname("J01CR02", from = "atc", to = "umcg")
# "AMCL"
# specific codes for Certe:
abname("J01CR02", from = "atc", to = "certe")
# "amcl"
}
\keyword{ab}
\keyword{antibiotics}

View File

@ -9,7 +9,7 @@ age_groups(x, split_at = c(12, 25, 55, 75))
\arguments{
\item{x}{age, e.g. calculated with \code{\link{age}}}
\item{split_at}{values to split \code{x} at, defaults to age groups 0-11, 12-24, 26-54, 55-74 and 75+. See Details.}
\item{split_at}{values to split \code{x} at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See Details.}
}
\value{
Ordered \code{\link{factor}}
@ -21,7 +21,7 @@ Split ages into age groups defined by the \code{split} parameter. This allows fo
To split ages, the input can be:
\itemize{
\item{A numeric vector. A vector of e.g. \code{c(10, 20)} will split on 0-9, 10-19 and 20+. A value of only \code{50} will split on 0-49 and 50+.
The default is to split on young children (0-11), youth (12-24), young adults (26-54), middle-aged adults (55-74) and elderly (75+).}
The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).}
\item{A character:}
\itemize{
\item{\code{"children"}, equivalent of: \code{c(0, 1, 2, 4, 6, 13, 18)}. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.}
@ -66,7 +66,7 @@ septic_patients \%>\%
mo == as.mo("E. coli")) \%>\%
group_by(age_group = age_groups(age)) \%>\%
select(age_group,
cipr) \%>\%
CIP) \%>\%
ggplot_rsi(x = "age_group")
}
\seealso{

View File

@ -3,33 +3,27 @@
\docType{data}
\name{antibiotics}
\alias{antibiotics}
\title{Data set with ~500 antibiotics}
\format{A \code{\link{data.frame}} with 488 observations and 17 variables:
\title{Data set with ~450 antibiotics}
\format{A \code{\link{data.frame}} with 455 observations and 13 variables:
\describe{
\item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical), like \code{J01CR02}}
\item{\code{ears_net}}{EARS-Net code (European Antimicrobial Resistance Surveillance Network), like \code{AMC}}
\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, 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 (a total of 294), used internally by \code{\link{as.atc}}}
\item{\code{ab}}{Antibiotic ID as used in this package (like \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available}
\item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02}}
\item{\code{cid}}{Compound ID as found in PubChem}
\item{\code{name}}{Official name as used by WHONET/EARS-Net or the WHO}
\item{\code{group}}{A short and concise group name, based on WHONET and WHOCC definitions}
\item{\code{atc_group1}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like \code{"Macrolides, lincosamides and streptogramins"}}
\item{\code{atc_group2}}{Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like \code{"Macrolides"}}
\item{\code{abbr}}{List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)}
\item{\code{synonyms}}{Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID}
\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}
\item{\code{iv_units}}{Units of \code{iv_ddd}}
\item{\code{atc_group1}}{ATC group, like \code{"Macrolides, lincosamides and streptogramins"}}
\item{\code{atc_group2}}{Subgroup of \code{atc_group1}, like \code{"Macrolides"}}
\item{\code{useful_gramnegative}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)}
\item{\code{useful_grampositive}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)}
}}
\source{
World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/}
World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/}
Table antibiotic coding EARSS (from WHONET 5.3): \url{http://www.madsonline.dk/Tutorials/landskoder_antibiotika_WM.pdf}
EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016: \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}
WHONET 2019 software: \url{http://www.whonet.org/software.html}
European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}
}
@ -37,7 +31,12 @@ European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{htt
antibiotics
}
\description{
A data set containing all antibiotics with a J0 code and some other antimicrobial agents, with their DDDs. Except for trade names and abbreviations, all properties were downloaded from the WHO, see Source.
A data set containing all antibiotics. Use \code{\link{as.ab}} or one of the \code{\link{ab_property}} functions to retrieve values from this data set. Three identifiers are included in this data set: an antibiotic ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes.
}
\details{
Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}
Synonyms (i.e. trade names) are derived from the Compound ID (\code{cid}) and consequently only available where a CID is available.
}
\section{WHOCC}{

69
man/as.ab.Rd Normal file
View File

@ -0,0 +1,69 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ab.R
\name{as.ab}
\alias{as.ab}
\title{Transform to antibiotic ID}
\usage{
as.ab(x)
}
\arguments{
\item{x}{character vector to determine to antibiotic ID}
}
\value{
Character (vector) with class \code{"act"}. Unknown values will return \code{NA}.
}
\description{
Use this function to determine the antibiotic code of one or more antibiotics. The data set \code{\link{antibiotics}} will be searched for abbreviations, official names and synonyms (brand 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/}
}
\section{Source}{
World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/}
WHONET 2019 software: \url{http://www.whonet.org/software.html}
European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}
}
\section{WHOCC}{
\if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr}
This package contains \strong{all ~500 antimicrobial drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}).
These have become the gold standard for international drug utilisation monitoring and research.
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
}
\section{Read more on our website!}{
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
}
\examples{
# These examples all return "ERY", the ID of Erythromycin:
as.ab("J01FA01")
as.ab("J 01 FA 01")
as.ab("Erythromycin")
as.ab("eryt")
as.ab(" eryt 123")
as.ab("ERYT")
as.ab("ERY")
as.ab("erytromicine") # spelled wrong
as.ab("Erythrocin") # trade name
as.ab("Romycin") # trade name
# Use ab_* functions to get a specific properties (see ?ab_property);
# they use as.ab() internally:
ab_name("J01FA01") # "Erythromycin"
ab_name("eryt") # "Erythromycin"
}
\seealso{
\code{\link{antibiotics}} for the dataframe that is being used to determine ATCs.
}
\keyword{atc}

View File

@ -1,11 +1,14 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/atc.R
\name{as.atc}
% Please edit documentation in R/ab.R, R/atc.R
\name{is.ab}
\alias{is.ab}
\alias{as.atc}
\alias{atc}
\alias{is.atc}
\title{Transform to ATC code}
\usage{
is.ab(x)
as.atc(x)
is.atc(x)
@ -48,14 +51,6 @@ as.atc("eryt")
as.atc(" eryt 123")
as.atc("ERYT")
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`
atc_official(Cipro) # returns "Ciprofloxacin"
atc_umcg(Cipro) # returns "CIPR", the code used in the UMCG
}
\seealso{
\code{\link{antibiotics}} for the dataframe that is being used to determine ATCs.

45
man/as.disk.Rd Normal file
View File

@ -0,0 +1,45 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/disk.R
\name{as.disk}
\alias{as.disk}
\alias{is.disk}
\title{Class 'disk'}
\usage{
as.disk(x, na.rm = FALSE)
is.disk(x)
}
\arguments{
\item{x}{vector}
\item{na.rm}{a logical indicating whether missing values should be removed}
}
\value{
Ordered integer factor with new class \code{disk}
}
\description{
This transforms a vector to a new class \code{disk}, which is a growth zone size (around an antibiotic disk) in millimeters between 6 and 99.
}
\details{
Interpret disk values as RSI values with \code{\link{as.rsi}}. It supports guidelines from EUCAST and CLSI.
}
\section{Read more on our website!}{
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
}
\examples{
# interpret disk values
as.rsi(x = 12,
mo = as.mo("S. pneumoniae"),
ab = "AMX",
guideline = "EUCAST")
as.rsi(x = 12,
mo = as.mo("S. pneumoniae"),
ab = "AMX",
guideline = "CLSI")
}
\seealso{
\code{\link{as.rsi}}
}
\keyword{disk}

View File

@ -20,6 +20,9 @@ Ordered factor with new class \code{mic}
\description{
This transforms a vector to a new class \code{mic}, which is an ordered factor with valid MIC values as levels. Invalid MIC values will be translated as \code{NA} with a warning.
}
\details{
Interpret MIC values as RSI values with \code{\link{as.rsi}}. It supports guidelines from EUCAST and CLSI.
}
\section{Read more on our website!}{
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
@ -32,6 +35,16 @@ is.mic(mic_data)
# this can also coerce combined MIC/RSI values:
as.mic("<=0.002; S") # will return <=0.002
# interpret MIC values
as.rsi(x = as.mic(2),
mo = as.mo("S. pneumoniae"),
ab = "AMX",
guideline = "EUCAST")
as.rsi(x = as.mic(4),
mo = as.mo("S. pneumoniae"),
ab = "AMX",
guideline = "EUCAST")
plot(mic_data)
barplot(mic_data)
freq(mic_data)

View File

@ -127,7 +127,7 @@ Group 2 probably contains all other microbial pathogens ever found in humans.
[1] Becker K \emph{et al.} \strong{Coagulase-Negative Staphylococci}. 2014. Clin Microbiol Rev. 27(4): 870926. \url{https://dx.doi.org/10.1128/CMR.00109-13}
[2] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the S. aureus complex, S. argenteus and S. schweitzeri: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).}. 2019. Clin Microbiol Infect. 2019 Mar 11. \url{https://doi.org/10.1016/j.cmi.2019.02.028}
[2] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the \emph{S. aureus} complex, \emph{S. argenteus} and \emph{S. schweitzeri}: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).} 2019. Clin Microbiol Infect. \url{https://doi.org/10.1016/j.cmi.2019.02.028}
[3] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 57195. \url{https://dx.doi.org/10.1084/jem.57.4.571}

View File

@ -2,18 +2,38 @@
% Please edit documentation in R/rsi.R
\name{as.rsi}
\alias{as.rsi}
\alias{as.rsi.mic}
\alias{as.rsi.disk}
\alias{as.rsi.data.frame}
\alias{is.rsi}
\alias{is.rsi.eligible}
\title{Class 'rsi'}
\usage{
as.rsi(x)
as.rsi(x, ...)
\method{as.rsi}{mic}(x, mo, ab, guideline = "EUCAST", ...)
\method{as.rsi}{disk}(x, mo, ab, guideline = "EUCAST", ...)
\method{as.rsi}{data.frame}(x, col_mo = NULL, guideline = "EUCAST",
...)
is.rsi(x)
is.rsi.eligible(x, threshold = 0.05)
}
\arguments{
\item{x}{vector}
\item{x}{vector of values (for class \code{mic}: an MIC value in mg/L, for class \code{disk}: a disk diffusion radius in millimeters)}
\item{...}{parameters passed on to methods}
\item{mo}{a microorganism code, generated with \code{\link{as.mo}}}
\item{ab}{an antibiotic code, generated with \code{\link{as.ab}}}
\item{guideline}{defaults to the latest included EUCAST guideline, run \code{unique(AMR::rsi_translation$guideline)} for all options}
\item{col_mo}{column name of the unique IDs of the microorganisms (see \code{\link{mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.}
\item{threshold}{maximum fraction of \code{x} that is allowed to fail transformation, see Examples}
}
@ -21,12 +41,14 @@ is.rsi.eligible(x, threshold = 0.05)
Ordered factor with new class \code{rsi}
}
\description{
This transforms a vector to a new class \code{rsi}, which is an ordered factor with levels \code{S < I < R}. Invalid antimicrobial interpretations will be translated as \code{NA} with a warning.
Interpret MIC values according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class \code{rsi}, which is an ordered factor with levels \code{S < I < R}. Invalid antimicrobial interpretations will be translated as \code{NA} with a warning.
}
\details{
\strong{NOTE:} This function does not translate MIC values to RSI values. If more than 50\% of the input resembles MIC values, it will warn about this.\cr You can use \code{\link{eucast_rules}} to (1) apply inferred susceptibility and resistance based on results of other antibiotics and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.
Run \code{unique(AMR::rsi_translation$guideline)} for a list of all supported guidelines.
The function \code{is.rsi.eligible} returns \code{TRUE} when a columns contains only valid antimicrobial interpretations (S and/or I and/or R), and \code{FALSE} otherwise.
After using \code{as.rsi}, you can use \code{\link{eucast_rules}} to (1) apply inferred susceptibility and resistance based on results of other antibiotics and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.
The function \code{is.rsi.eligible} returns \code{TRUE} when a columns contains at most 5\% invalid antimicrobial interpretations (not S and/or I and/or R), and \code{FALSE} otherwise. The threshold of 5\% can be set with the \code{threshold} parameter.
}
\section{Read more on our website!}{
@ -41,6 +63,16 @@ is.rsi(rsi_data)
# this can also coerce combined MIC/RSI values:
as.rsi("<= 0.002; S") # will return S
# interpret MIC values
as.rsi(x = as.mic(2),
mo = as.mo("S. pneumoniae"),
ab = "AMX",
guideline = "EUCAST")
as.rsi(x = as.mic(4),
mo = as.mo("S. pneumoniae"),
ab = "AMX",
guideline = "EUCAST")
plot(rsi_data) # for percentages
barplot(rsi_data) # for frequencies
freq(rsi_data) # frequency table with informative header
@ -48,7 +80,7 @@ freq(rsi_data) # frequency table with informative header
# using dplyr's mutate
library(dplyr)
septic_patients \%>\%
mutate_at(vars(peni:rifa), as.rsi)
mutate_at(vars(PEN:RIF), as.rsi)
# fastest way to transform all columns with already valid AB results to class `rsi`:
@ -58,7 +90,7 @@ septic_patients \%>\%
# default threshold of `is.rsi.eligible` is 5\%.
is.rsi.eligible(WHONET$`First name`) # fails, >80\% is invalid
is.rsi.eligible(WHONET$`First name`, threshold = 0.9) # succeeds
is.rsi.eligible(WHONET$`First name`, threshold = 0.99) # succeeds
}
\seealso{
\code{\link{as.mic}}

View File

@ -1,55 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/atc_property.R
\name{atc_property}
\alias{atc_property}
\alias{atc_official}
\alias{atc_name}
\alias{atc_trivial_nl}
\alias{atc_certe}
\alias{atc_umcg}
\alias{atc_tradenames}
\title{Property of an antibiotic}
\usage{
atc_property(x, property = "official")
atc_official(x, language = NULL)
atc_name(x, language = NULL)
atc_trivial_nl(x)
atc_certe(x)
atc_umcg(x)
atc_tradenames(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"}}
\item{language}{language of the returned text, defaults to English (\code{"en"}) and can be set with \code{\link{getOption}("AMR_locale")}. Either one of \code{"en"} (English) or \code{"nl"} (Dutch).}
}
\value{
A vector of values. In case of \code{atc_tradenames}, if \code{x} is of length one, a vector will be returned. Otherwise a \code{\link{list}}, with \code{x} as names.
}
\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}}.
}
\section{Read more on our website!}{
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
}
\examples{
as.atc("amcl") # J01CR02
atc_name("amcl") # Amoxicillin and beta-lactamase inhibitor
atc_name("amcl", "nl") # Amoxicilline met enzymremmer
atc_trivial_nl("amcl") # Amoxicilline/clavulaanzuur
atc_certe("amcl") # amcl
atc_umcg("amcl") # AMCL
}
\seealso{
\code{\link{antibiotics}}
}

View File

@ -29,8 +29,8 @@ count_all(...)
n_rsi(...)
count_df(data, translate_ab = getOption("get_antibiotic_names",
"official"), combine_IR = FALSE)
count_df(data, translate_ab = "name", language = get_locale(),
combine_IR = FALSE)
}
\arguments{
\item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed.}
@ -39,7 +39,9 @@ count_df(data, translate_ab = getOption("get_antibiotic_names",
\item{data}{a \code{data.frame} containing columns with class \code{rsi} (see \code{\link{as.rsi}})}
\item{translate_ab}{a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations to, using \code{\link{abname}}. This can be set with \code{\link{getOption}("get_antibiotic_names")}.}
\item{translate_ab}{a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations to, using \code{\link{ab_property}}}
\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
\item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)}
}
@ -68,55 +70,55 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
?septic_patients
# Count resistant isolates
count_R(septic_patients$amox)
count_IR(septic_patients$amox)
count_R(septic_patients$AMX)
count_IR(septic_patients$AMX)
# Or susceptible isolates
count_S(septic_patients$amox)
count_SI(septic_patients$amox)
count_S(septic_patients$AMX)
count_SI(septic_patients$AMX)
# Count all available isolates
count_all(septic_patients$amox)
n_rsi(septic_patients$amox)
count_all(septic_patients$AMX)
n_rsi(septic_patients$AMX)
# Since n_rsi counts available isolates, you can
# calculate back to count e.g. non-susceptible isolates.
# This results in the same:
count_IR(septic_patients$amox)
portion_IR(septic_patients$amox) * n_rsi(septic_patients$amox)
count_IR(septic_patients$AMX)
portion_IR(septic_patients$AMX) * n_rsi(septic_patients$AMX)
library(dplyr)
septic_patients \%>\%
group_by(hospital_id) \%>\%
summarise(R = count_R(cipr),
I = count_I(cipr),
S = count_S(cipr),
n1 = count_all(cipr), # the actual total; sum of all three
n2 = n_rsi(cipr), # same - analogous to n_distinct
summarise(R = count_R(CIP),
I = count_I(CIP),
S = count_S(CIP),
n1 = count_all(CIP), # the actual total; sum of all three
n2 = n_rsi(CIP), # same - analogous to n_distinct
total = n()) # NOT the number of tested isolates!
# Count co-resistance between amoxicillin/clav acid and gentamicin,
# so we can see that combination therapy does a lot more than mono therapy.
# Please mind that `portion_S` calculates percentages right away instead.
count_S(septic_patients$amcl) # S = 1342 (71.4\%)
count_all(septic_patients$amcl) # n = 1879
count_S(septic_patients$AMC) # S = 1342 (71.4\%)
count_all(septic_patients$AMC) # n = 1879
count_S(septic_patients$gent) # S = 1372 (74.0\%)
count_all(septic_patients$gent) # n = 1855
count_S(septic_patients$GEN) # S = 1372 (74.0\%)
count_all(septic_patients$GEN) # n = 1855
with(septic_patients,
count_S(amcl, gent)) # S = 1660 (92.3\%)
count_S(AMC, GEN)) # S = 1660 (92.3\%)
with(septic_patients, # n = 1798
n_rsi(amcl, gent))
n_rsi(AMC, GEN))
# Get portions S/I/R immediately of all rsi columns
septic_patients \%>\%
select(amox, cipr) \%>\%
select(AMX, CIP) \%>\%
count_df(translate = FALSE)
# It also supports grouping variables
septic_patients \%>\%
select(hospital_id, amox, cipr) \%>\%
select(hospital_id, AMX, CIP) \%>\%
group_by(hospital_id) \%>\%
count_df(translate = FALSE)

View File

@ -21,47 +21,16 @@
}
}
For editing the reference file (which is available with \code{\link{eucast_rules_file}}), these values can all be used for target antibiotics: aminoglycosides, tetracyclines, polymyxins, macrolides, glycopeptides, streptogramins, cephalosporins, cephalosporins_without_cfta, carbapenems, aminopenicillins, ureidopenicillins, fluoroquinolones, all_betalactams, and all separate four letter codes like amcl. They can be separated by comma: \code{"amcl, fluoroquinolones"}. The mo_property can be any column name from the \code{\link{microorganisms}} data set, or \code{genus_species} or \code{gramstain}. This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: LiPuma JJ, 2015 (PMID 16217180).
For editing the reference file (which is available with \code{\link{eucast_rules_file}}), these values can all be used for target antibiotics: aminoglycosides, tetracyclines, polymyxins, macrolides, glycopeptides, streptogramins, cephalosporins, cephalosporins_without_cfta, carbapenems, aminopenicillins, ureidopenicillins, fluoroquinolones, all_betalactams, and all separate four letter codes like AMC. They can be separated by comma: \code{"AMC, fluoroquinolones"}. The mo_property can be any column name from the \code{\link{microorganisms}} data set, or \code{genus_species} or \code{gramstain}. This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: LiPuma JJ, 2015 (PMID 16217180).
}
\usage{
eucast_rules(x, col_mo = NULL, info = TRUE, rules = c("breakpoints",
"expert", "other", "all"), verbose = FALSE, amcl = guess_ab_col(),
amik = guess_ab_col(), amox = guess_ab_col(),
ampi = guess_ab_col(), azit = guess_ab_col(),
azlo = guess_ab_col(), aztr = guess_ab_col(),
cefa = guess_ab_col(), cfep = guess_ab_col(),
cfot = guess_ab_col(), cfox = guess_ab_col(),
cfra = guess_ab_col(), cfta = guess_ab_col(),
cftr = guess_ab_col(), cfur = guess_ab_col(),
chlo = guess_ab_col(), cipr = guess_ab_col(),
clar = guess_ab_col(), clin = guess_ab_col(),
clox = guess_ab_col(), coli = guess_ab_col(),
czol = guess_ab_col(), dapt = guess_ab_col(),
doxy = guess_ab_col(), erta = guess_ab_col(),
eryt = guess_ab_col(), fosf = guess_ab_col(),
fusi = guess_ab_col(), gent = guess_ab_col(),
imip = guess_ab_col(), kana = guess_ab_col(),
levo = guess_ab_col(), linc = guess_ab_col(),
line = guess_ab_col(), mero = guess_ab_col(),
mezl = guess_ab_col(), mino = guess_ab_col(),
moxi = guess_ab_col(), nali = guess_ab_col(),
neom = guess_ab_col(), neti = guess_ab_col(),
nitr = guess_ab_col(), norf = guess_ab_col(),
novo = guess_ab_col(), oflo = guess_ab_col(),
oxac = guess_ab_col(), peni = guess_ab_col(),
pipe = guess_ab_col(), pita = guess_ab_col(),
poly = guess_ab_col(), pris = guess_ab_col(),
qida = guess_ab_col(), rifa = guess_ab_col(),
roxi = guess_ab_col(), siso = guess_ab_col(),
teic = guess_ab_col(), tetr = guess_ab_col(),
tica = guess_ab_col(), tige = guess_ab_col(),
tobr = guess_ab_col(), trim = guess_ab_col(),
trsu = guess_ab_col(), vanc = guess_ab_col(), ...)
"expert", "other", "all"), verbose = FALSE, ...)
eucast_rules_file()
}
\arguments{
\item{x}{data with antibiotic columns, like e.g. \code{amox} and \code{amcl}}
\item{x}{data with antibiotic columns, like e.g. \code{AMX} and \code{AMC}}
\item{col_mo}{column name of the unique IDs of the microorganisms (see \code{\link{mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.}
@ -71,9 +40,7 @@ eucast_rules_file()
\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}}
\item{...}{column name of an antibiotic, see section Antibiotics}
}
\value{
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.
@ -82,83 +49,84 @@ The input of \code{tbl_}, possibly with edited values of antibiotics. Or, if \co
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.
}
\details{
\strong{NOTE:} This function does not translate MIC values to RSI values. It only applies (1) inferred susceptibility and resistance based on results of other antibiotics and (2) intrinsic resistance based on taxonomic properties of a microorganism.
\strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link{as.rsi}} for that. \cr
\strong{Note:} When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.
The file used for applying all EUCAST rules can be retrieved with \code{\link{eucast_rules_file}()}. It returns an easily readable data set containing all rules. The original TSV file (tab separated file) that is being read by this function can be found when running this command: \cr
The file used for applying all EUCAST rules can be retrieved with \code{\link{eucast_rules_file}()}. It returns an easily readable data set containing all rules. The original TSV file (tab separated file) that is being read by \code{eucast_rules()} can be found by running this command: \cr
\code{AMR::EUCAST_RULES_FILE_LOCATION} (without brackets).
In the source code it is located under \href{https://gitlab.com/msberends/AMR/blob/master/inst/eucast/eucast_rules.tsv}{\code{./inst/eucast/eucast_rules.tsv}}.
\strong{Note:} When ampicillin (J01CA01) is not available but amoxicillin (J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.
In the source code the file containing all rules is located \href{https://gitlab.com/msberends/AMR/blob/master/inst/eucast/eucast_rules.tsv}{here}.
}
\section{Antibiotics}{
To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive) or use \code{NULL} to skip a column (e.g. \code{tica = NULL}). Non-existing columns will anyway be skipped with a warning.
To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.
Abbrevations of the column containing antibiotics in the form: \strong{abbreviation}: generic name (\emph{ATC code})
Available abbrevations of the column containing antibiotics in the form '\strong{antimicrobial ID}: name (\emph{ATC code})':
\strong{amcl}: amoxicillin+clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}),
\strong{amik}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}),
\strong{amox}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}),
\strong{ampi}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}),
\strong{azit}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}),
\strong{azlo}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}),
\strong{aztr}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}),
\strong{cefa}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}),
\strong{cfep}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}),
\strong{cfot}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}),
\strong{cfox}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}),
\strong{cfra}: cefradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}),
\strong{cfta}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}),
\strong{cftr}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}),
\strong{cfur}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}),
\strong{chlo}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}),
\strong{cipr}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}),
\strong{clar}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}),
\strong{clin}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}),
\strong{clox}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}),
\strong{coli}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}),
\strong{czol}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}),
\strong{dapt}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}),
\strong{doxy}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}),
\strong{erta}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}),
\strong{eryt}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}),
\strong{fosf}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}),
\strong{fusi}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}),
\strong{gent}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}),
\strong{imip}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}),
\strong{kana}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}),
\strong{levo}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}),
\strong{linc}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}),
\strong{line}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}),
\strong{mero}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}),
\strong{mezl}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}),
\strong{mino}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}),
\strong{moxi}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}),
\strong{nali}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}),
\strong{neom}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}),
\strong{neti}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}),
\strong{nitr}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}),
\strong{norf}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}),
\strong{novo}: novobiocin (an ATCvet code: \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}),
\strong{oflo}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}),
\strong{peni}: (benzyl)penicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}),
\strong{pipe}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}),
\strong{pita}: piperacillin+tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}),
\strong{poly}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}),
\strong{pris}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}),
\strong{qida}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}),
\strong{rifa}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}),
\strong{roxi}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}),
\strong{siso}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}),
\strong{teic}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}),
\strong{tetr}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}),
\strong{tica}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}),
\strong{tige}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}),
\strong{tobr}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}),
\strong{trim}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}),
\strong{trsu}: sulfamethoxazole and trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}),
\strong{vanc}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}).
\strong{AMC}: amoxicillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}),
\strong{AMK}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}),
\strong{AMX}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}),
\strong{AMP}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}),
\strong{AZM}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}),
\strong{AZL}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}),
\strong{ATM}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}),
\strong{RID}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}),
\strong{FEP}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}),
\strong{CTX}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}),
\strong{FOX}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}),
\strong{CED}: cefradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}),
\strong{CAZ}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}),
\strong{CRO}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}),
\strong{CXM}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}),
\strong{CHL}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}),
\strong{CIP}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}),
\strong{CLR}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}),
\strong{CLI}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}),
\strong{FLC}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}),
\strong{COL}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}),
\strong{CZO}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}),
\strong{DAP}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}),
\strong{DOX}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}),
\strong{ETP}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}),
\strong{ERY}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}),
\strong{FOS}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}),
\strong{FUS}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}),
\strong{GEN}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}),
\strong{IPM}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}),
\strong{KAN}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}),
\strong{LVX}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}),
\strong{LIN}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}),
\strong{LNZ}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}),
\strong{MEM}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}),
\strong{MEZ}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}),
\strong{MNO}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}),
\strong{MFX}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}),
\strong{MTR}: metronidazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01XD01}),
\strong{NAL}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}),
\strong{NEO}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}),
\strong{NET}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}),
\strong{NIT}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}),
\strong{NOR}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}),
\strong{NOV}: novobiocin (an ATCvet code: \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}),
\strong{OFX}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}),
\strong{OXA}: oxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01CF04}),
\strong{PEN}: penicillin G (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}),
\strong{PIP}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}),
\strong{TZP}: piperacillin/tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}),
\strong{PLB}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}),
\strong{PRI}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}),
\strong{QDA}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}),
\strong{RIF}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}),
\strong{RXT}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}),
\strong{SIS}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}),
\strong{TEC}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}),
\strong{TCY}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}),
\strong{TIC}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}),
\strong{TGC}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}),
\strong{TOB}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}),
\strong{TMP}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}),
\strong{SXT}: trimethoprim/sulfamethoxazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}),
\strong{VAN}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}).
}
\section{Read more on our website!}{
@ -174,17 +142,17 @@ a <- data.frame(mo = c("Staphylococcus aureus",
"Escherichia coli",
"Klebsiella pneumoniae",
"Pseudomonas aeruginosa"),
vanc = "-", # Vancomycin
amox = "-", # Amoxicillin
coli = "-", # Colistin
cfta = "-", # Ceftazidime
cfur = "-", # Cefuroxime
peni = "S", # Benzylpenicillin
cfox = "S", # Cefoxitin
VAN = "-", # Vancomycin
AMX = "-", # Amoxicillin
COL = "-", # Colistin
CAZ = "-", # Ceftazidime
CXM = "-", # Cefuroxime
PEN = "S", # Penicillin G
FOX = "S", # Cefoxitin
stringsAsFactors = FALSE)
a
# mo vanc amox coli cfta cfur peni cfox
# mo VAN AMX COL CAZ CXM PEN FOX
# 1 Staphylococcus aureus - - - - - S S
# 2 Enterococcus faecalis - - - - - S S
# 3 Escherichia coli - - - - - S S
@ -196,7 +164,7 @@ a
b <- eucast_rules(a)
b
# mo vanc amox coli cfta cfur peni cfox
# mo VAN AMX COL CAZ CXM PEN FOX
# 1 Staphylococcus aureus - S R R S S S
# 2 Enterococcus faecalis - - R R R S R
# 3 Escherichia coli R - - - - R S

View File

@ -62,9 +62,9 @@ library(dplyr)
# filter on isolates that have any result for any aminoglycoside
septic_patients \%>\% filter_aminoglycosides()
# this is essentially the same as:
# this is essentially the same as (but without determination of column names):
septic_patients \%>\%
filter_at(.vars = vars(c("gent", "tobr", "amik", "kana")),
filter_at(.vars = vars(c("GEN", "TOB", "AMK", "KAN")),
.vars_predicate = any_vars(. \%in\% c("S", "I", "R")))

View File

@ -124,14 +124,14 @@ septic_patients \%>\%
# Now let's see if first isolates matter:
A <- septic_patients \%>\%
group_by(hospital_id) \%>\%
summarise(count = n_rsi(gent), # gentamicin availability
resistance = portion_IR(gent)) # gentamicin resistance
summarise(count = n_rsi(GEN), # gentamicin availability
resistance = portion_IR(GEN)) # gentamicin resistance
B <- septic_patients \%>\%
filter_first_weighted_isolate() \%>\% # the 1st isolate filter
filter_first_weighted_isolate() \%>\% # the 1st isolate filter
group_by(hospital_id) \%>\%
summarise(count = n_rsi(gent), # gentamicin availability
resistance = portion_IR(gent)) # gentamicin resistance
summarise(count = n_rsi(GEN), # gentamicin availability
resistance = portion_IR(GEN)) # gentamicin resistance
# Have a look at A and B.
# B is more reliable because every isolate is only counted once.

View File

@ -215,8 +215,8 @@ septic_patients \%>\%
# check differences between frequency tables
diff(freq(septic_patients$trim),
freq(septic_patients$trsu))
diff(freq(septic_patients$TMP),
freq(septic_patients$SXT))
}
\keyword{freq}
\keyword{frequency}

View File

@ -1,24 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_locale.R
\name{get_locale}
\alias{get_locale}
\title{Get language for AMR}
\usage{
get_locale()
}
\description{
Determines the system language to be used for language-dependent output of AMR functions, like \code{\link{mo_gramstain}} and \code{\link{mo_type}}.
}
\details{
The system language can be overwritten with \code{\link{getOption}("AMR_locale")}.
}
\section{Supported languages}{
Supported languages are \code{"en"} (English), \code{"de"} (German), \code{"nl"} (Dutch), \code{"es"} (Spanish), \code{"it"} (Italian), \code{"fr"} (French), and \code{"pt"} (Portuguese).
}
\section{Read more on our website!}{
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
}

View File

@ -12,13 +12,13 @@
\usage{
ggplot_rsi(data, position = NULL, x = "Antibiotic",
fill = "Interpretation", facet = NULL, breaks = seq(0, 1, 0.1),
limits = NULL, translate_ab = "official", fun = count_df,
nrow = NULL, datalabels = TRUE, datalabels.size = 3,
datalabels.colour = "grey15", ...)
limits = NULL, translate_ab = "name", language = get_locale(),
fun = count_df, nrow = NULL, datalabels = TRUE,
datalabels.size = 3, datalabels.colour = "grey15", ...)
geom_rsi(position = NULL, x = c("Antibiotic", "Interpretation"),
fill = "Interpretation", translate_ab = "official", fun = count_df,
...)
fill = "Interpretation", translate_ab = "name",
language = get_locale(), fun = count_df, ...)
facet_rsi(facet = c("Interpretation", "Antibiotic"), nrow = NULL)
@ -46,7 +46,9 @@ labels_rsi_count(position = NULL, x = "Antibiotic",
\item{limits}{numeric vector of length two providing limits of the scale, use \code{NA} to refer to the existing minimum or maximum}
\item{translate_ab}{a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations into, using \code{\link{abname}}. Default behaviour is to translate to official names according to the WHO. Use \code{translate_ab = FALSE} to disable translation.}
\item{translate_ab}{a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations into, using \code{\link{ab_name}}. Default behaviour is to translate to official names according to the WHO. Use \code{translate_ab = FALSE} to disable translation.}
\item{language}{the language used for translation of antibiotic names}
\item{fun}{function to transform \code{data}, either \code{\link{count_df}} (default) or \code{\link{portion_df}}}
@ -64,7 +66,7 @@ labels_rsi_count(position = NULL, x = "Antibiotic",
Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal \code{\link[ggplot2]{ggplot}} functions.
}
\details{
At default, the names of antibiotics will be shown on the plots using \code{\link{abname}}. This can be set with the option \code{get_antibiotic_names} (a logical value), so change it e.g. to \code{FALSE} with \code{options(get_antibiotic_names = FALSE)}.
At default, the names of antibiotics will be shown on the plots using \code{\link{ab_name}}. This can be set with the option \code{get_antibiotic_names} (a logical value), so change it e.g. to \code{FALSE} with \code{options(get_antibiotic_names = FALSE)}.
\strong{The functions}\cr
\code{geom_rsi} will take any variable from the data that has an \code{rsi} class (created with \code{\link{as.rsi}}) using \code{fun} (\code{\link{count_df}} at default, can also be \code{\link{portion_df}}) and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.
@ -91,11 +93,11 @@ library(dplyr)
library(ggplot2)
# get antimicrobial results for drugs against a UTI:
ggplot(septic_patients \%>\% select(amox, nitr, fosf, trim, cipr)) +
ggplot(septic_patients \%>\% select(AMX, NIT, FOS, TMP, CIP)) +
geom_rsi()
# prettify the plot using some additional functions:
df <- septic_patients[, c("amox", "nitr", "fosf", "trim", "cipr")]
df <- septic_patients[, c("AMX", "NIT", "FOS", "TMP", "CIP")]
ggplot(df) +
geom_rsi() +
scale_y_percent() +
@ -105,17 +107,17 @@ ggplot(df) +
# or better yet, simplify this using the wrapper function - a single command:
septic_patients \%>\%
select(amox, nitr, fosf, trim, cipr) \%>\%
select(AMX, NIT, FOS, TMP, CIP) \%>\%
ggplot_rsi()
# get only portions and no counts:
septic_patients \%>\%
select(amox, nitr, fosf, trim, cipr) \%>\%
select(AMX, NIT, FOS, TMP, CIP) \%>\%
ggplot_rsi(fun = portion_df)
# add other ggplot2 parameters as you like:
septic_patients \%>\%
select(amox, nitr, fosf, trim, cipr) \%>\%
select(AMX, NIT, FOS, TMP, CIP) \%>\%
ggplot_rsi(width = 0.5,
colour = "black",
size = 1,
@ -130,19 +132,19 @@ septic_patients \%>\%
# `age_group` is also a function of this package:
group_by(age_group = age_groups(age)) \%>\%
select(age_group,
cipr) \%>\%
CIP) \%>\%
ggplot_rsi(x = "age_group")
\donttest{
# for colourblind mode, use divergent colours from the viridis package:
septic_patients \%>\%
select(amox, nitr, fosf, trim, cipr) \%>\%
select(AMX, NIT, FOS, TMP, CIP) \%>\%
ggplot_rsi() + scale_fill_viridis_d()
# it also supports groups (don't forget to use the group var on `x` or `facet`):
septic_patients \%>\%
select(hospital_id, amox, nitr, fosf, trim, cipr) \%>\%
select(hospital_id, AMX, NIT, FOS, TMP, CIP) \%>\%
group_by(hospital_id) \%>\%
ggplot_rsi(x = hospital_id,
facet = Antibiotic,
@ -166,7 +168,7 @@ septic_patients \%>\%
# get short MO names (like "E. coli")
mutate(mo = mo_shortname(mo, Becker = TRUE)) \%>\%
# select this short name and some antiseptic drugs
select(mo, cfur, gent, cipr) \%>\%
select(mo, CXM, GEN, CIP) \%>\%
# group by MO
group_by(mo) \%>\%
# plot the thing, putting MOs on the facet

View File

@ -27,7 +27,7 @@ df <- data.frame(amox = "S",
guess_ab_col(df, "amoxicillin")
# [1] "amox"
guess_ab_col(df, "J01AA07") # ATC code of Tetracycline
guess_ab_col(df, "J01AA07") # ATC code of tetracycline
# [1] "tetr"
guess_ab_col(df, "J01AA07", verbose = TRUE)
@ -41,6 +41,6 @@ guess_ab_col(df, "ampicillin")
# [1] "AMP_ND10"
guess_ab_col(df, "J01CR02")
# [1] "AMC_ED20"
guess_ab_col(df, as.atc("augmentin"))
guess_ab_col(df, as.ab("augmentin"))
# [1] "AMC_ED20"
}

View File

@ -6,19 +6,19 @@
\title{Key antibiotics for first \emph{weighted} isolates}
\usage{
key_antibiotics(tbl, col_mo = NULL, universal_1 = guess_ab_col(tbl,
"amox"), universal_2 = guess_ab_col(tbl, "amcl"),
universal_3 = guess_ab_col(tbl, "cfur"),
universal_4 = guess_ab_col(tbl, "pita"),
universal_5 = guess_ab_col(tbl, "cipr"),
universal_6 = guess_ab_col(tbl, "trsu"),
GramPos_1 = guess_ab_col(tbl, "vanc"), GramPos_2 = guess_ab_col(tbl,
"teic"), GramPos_3 = guess_ab_col(tbl, "tetr"),
GramPos_4 = guess_ab_col(tbl, "eryt"), GramPos_5 = guess_ab_col(tbl,
"oxac"), GramPos_6 = guess_ab_col(tbl, "rifa"),
GramNeg_1 = guess_ab_col(tbl, "gent"), GramNeg_2 = guess_ab_col(tbl,
"tobr"), GramNeg_3 = guess_ab_col(tbl, "coli"),
GramNeg_4 = guess_ab_col(tbl, "cfot"), GramNeg_5 = guess_ab_col(tbl,
"cfta"), GramNeg_6 = guess_ab_col(tbl, "mero"), warnings = TRUE, ...)
"AMX"), universal_2 = guess_ab_col(tbl, "AMC"),
universal_3 = guess_ab_col(tbl, "CXM"),
universal_4 = guess_ab_col(tbl, "TZP"),
universal_5 = guess_ab_col(tbl, "CIP"),
universal_6 = guess_ab_col(tbl, "SXT"), GramPos_1 = guess_ab_col(tbl,
"VAN"), GramPos_2 = guess_ab_col(tbl, "TEC"),
GramPos_3 = guess_ab_col(tbl, "TCY"), GramPos_4 = guess_ab_col(tbl,
"ERY"), GramPos_5 = guess_ab_col(tbl, "OXA"),
GramPos_6 = guess_ab_col(tbl, "RIF"), GramNeg_1 = guess_ab_col(tbl,
"GEN"), GramNeg_2 = guess_ab_col(tbl, "TOB"),
GramNeg_3 = guess_ab_col(tbl, "COL"), GramNeg_4 = guess_ab_col(tbl,
"CTX"), GramNeg_5 = guess_ab_col(tbl, "CAZ"),
GramNeg_6 = guess_ab_col(tbl, "MEM"), warnings = TRUE, ...)
key_antibiotics_equal(x, y, type = c("keyantibiotics", "points"),
ignore_I = TRUE, points_threshold = 2, info = FALSE)

View File

@ -7,46 +7,17 @@
\alias{eucast_exceptional_phenotypes}
\title{Determine multidrug-resistant organisms (MDRO)}
\usage{
mdro(tbl, country = NULL, col_mo = NULL, info = TRUE,
amcl = guess_ab_col(), amik = guess_ab_col(),
amox = guess_ab_col(), ampi = guess_ab_col(),
azit = guess_ab_col(), aztr = guess_ab_col(),
cefa = guess_ab_col(), cfra = guess_ab_col(),
cfep = guess_ab_col(), cfot = guess_ab_col(),
cfox = guess_ab_col(), cfta = guess_ab_col(),
cftr = guess_ab_col(), cfur = guess_ab_col(),
chlo = guess_ab_col(), cipr = guess_ab_col(),
clar = guess_ab_col(), clin = guess_ab_col(),
clox = guess_ab_col(), coli = guess_ab_col(),
czol = guess_ab_col(), dapt = guess_ab_col(),
doxy = guess_ab_col(), erta = guess_ab_col(),
eryt = guess_ab_col(), fosf = guess_ab_col(),
fusi = guess_ab_col(), gent = guess_ab_col(),
imip = guess_ab_col(), kana = guess_ab_col(),
levo = guess_ab_col(), linc = guess_ab_col(),
line = guess_ab_col(), mero = guess_ab_col(),
metr = guess_ab_col(), mino = guess_ab_col(),
moxi = guess_ab_col(), nali = guess_ab_col(),
neom = guess_ab_col(), neti = guess_ab_col(),
nitr = guess_ab_col(), novo = guess_ab_col(),
norf = guess_ab_col(), oflo = guess_ab_col(),
peni = guess_ab_col(), pipe = guess_ab_col(),
pita = guess_ab_col(), poly = guess_ab_col(),
qida = guess_ab_col(), rifa = guess_ab_col(),
roxi = guess_ab_col(), siso = guess_ab_col(),
teic = guess_ab_col(), tetr = guess_ab_col(),
tica = guess_ab_col(), tige = guess_ab_col(),
tobr = guess_ab_col(), trim = guess_ab_col(),
trsu = guess_ab_col(), vanc = guess_ab_col(), verbose = FALSE)
mdro(x, country = NULL, col_mo = NULL, info = TRUE,
verbose = FALSE, ...)
brmo(..., country = "nl")
mrgn(tbl, country = "de", ...)
mrgn(x, country = "de", ...)
eucast_exceptional_phenotypes(tbl, country = "EUCAST", ...)
eucast_exceptional_phenotypes(x, country = "EUCAST", ...)
}
\arguments{
\item{tbl}{table with antibiotic columns, like e.g. \code{amox} and \code{amcl}}
\item{x}{table with antibiotic columns, like e.g. \code{AMX} and \code{AMC}}
\item{country}{country code to determine guidelines. EUCAST rules will be used when left empty, see Details. Should be or a code from the \href{https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements}{list of ISO 3166-1 alpha-2 country codes}. Case-insensitive. Currently supported are \code{de} (Germany) and \code{nl} (the Netherlands).}
@ -54,129 +25,9 @@ eucast_exceptional_phenotypes(tbl, country = "EUCAST", ...)
\item{info}{print progress}
\item{amcl}{column name of an antibiotic, see Antibiotics}
\item{amik}{column name of an antibiotic, see Antibiotics}
\item{amox}{column name of an antibiotic, see Antibiotics}
\item{ampi}{column name of an antibiotic, see Antibiotics}
\item{azit}{column name of an antibiotic, see Antibiotics}
\item{aztr}{column name of an antibiotic, see Antibiotics}
\item{cefa}{column name of an antibiotic, see Antibiotics}
\item{cfra}{column name of an antibiotic, see Antibiotics}
\item{cfep}{column name of an antibiotic, see Antibiotics}
\item{cfot}{column name of an antibiotic, see Antibiotics}
\item{cfox}{column name of an antibiotic, see Antibiotics}
\item{cfta}{column name of an antibiotic, see Antibiotics}
\item{cftr}{column name of an antibiotic, see Antibiotics}
\item{cfur}{column name of an antibiotic, see Antibiotics}
\item{chlo}{column name of an antibiotic, see Antibiotics}
\item{cipr}{column name of an antibiotic, see Antibiotics}
\item{clar}{column name of an antibiotic, see Antibiotics}
\item{clin}{column name of an antibiotic, see Antibiotics}
\item{clox}{column name of an antibiotic, see Antibiotics}
\item{coli}{column name of an antibiotic, see Antibiotics}
\item{czol}{column name of an antibiotic, see Antibiotics}
\item{dapt}{column name of an antibiotic, see Antibiotics}
\item{doxy}{column name of an antibiotic, see Antibiotics}
\item{erta}{column name of an antibiotic, see Antibiotics}
\item{eryt}{column name of an antibiotic, see Antibiotics}
\item{fosf}{column name of an antibiotic, see Antibiotics}
\item{fusi}{column name of an antibiotic, see Antibiotics}
\item{gent}{column name of an antibiotic, see Antibiotics}
\item{imip}{column name of an antibiotic, see Antibiotics}
\item{kana}{column name of an antibiotic, see Antibiotics}
\item{levo}{column name of an antibiotic, see Antibiotics}
\item{linc}{column name of an antibiotic, see Antibiotics}
\item{line}{column name of an antibiotic, see Antibiotics}
\item{mero}{column name of an antibiotic, see Antibiotics}
\item{metr}{column name of an antibiotic, see Antibiotics}
\item{mino}{column name of an antibiotic, see Antibiotics}
\item{moxi}{column name of an antibiotic, see Antibiotics}
\item{nali}{column name of an antibiotic, see Antibiotics}
\item{neom}{column name of an antibiotic, see Antibiotics}
\item{neti}{column name of an antibiotic, see Antibiotics}
\item{nitr}{column name of an antibiotic, see Antibiotics}
\item{novo}{column name of an antibiotic, see Antibiotics}
\item{norf}{column name of an antibiotic, see Antibiotics}
\item{oflo}{column name of an antibiotic, see Antibiotics}
\item{peni}{column name of an antibiotic, see Antibiotics}
\item{pipe}{column name of an antibiotic, see Antibiotics}
\item{pita}{column name of an antibiotic, see Antibiotics}
\item{poly}{column name of an antibiotic, see Antibiotics}
\item{qida}{column name of an antibiotic, see Antibiotics}
\item{rifa}{column name of an antibiotic, see Antibiotics}
\item{roxi}{column name of an antibiotic, see Antibiotics}
\item{siso}{column name of an antibiotic, see Antibiotics}
\item{teic}{column name of an antibiotic, see Antibiotics}
\item{tetr}{column name of an antibiotic, see Antibiotics}
\item{tica}{column name of an antibiotic, see Antibiotics}
\item{tige}{column name of an antibiotic, see Antibiotics}
\item{tobr}{column name of an antibiotic, see Antibiotics}
\item{trim}{column name of an antibiotic, see Antibiotics}
\item{trsu}{column name of an antibiotic, see Antibiotics}
\item{vanc}{column name of an antibiotic, see Antibiotics}
\item{verbose}{print additional info: missing antibiotic columns per parameter}
\item{...}{parameters that are passed on to methods}
\item{...}{column name of an antibiotic, see section Antibiotics}
}
\value{
Ordered factor with levels \code{Negative < Positive, unconfirmed < Positive}.
@ -189,72 +40,74 @@ When \code{country} will be left blank, guidelines will be taken from EUCAST Exp
}
\section{Antibiotics}{
To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive) or use \code{NULL} to skip a column (e.g. \code{tica = NULL}). Non-existing columns will anyway be skipped with a warning.
To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.
Abbrevations of the column containing antibiotics in the form: \strong{abbreviation}: generic name (\emph{ATC code})
Available abbrevations of the column containing antibiotics in the form '\strong{antimicrobial ID}: name (\emph{ATC code})':
\strong{amcl}: amoxicillin+clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}),
\strong{amik}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}),
\strong{amox}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}),
\strong{ampi}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}),
\strong{azit}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}),
\strong{azlo}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}),
\strong{aztr}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}),
\strong{cefa}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}),
\strong{cfep}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}),
\strong{cfot}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}),
\strong{cfox}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}),
\strong{cfra}: cefradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}),
\strong{cfta}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}),
\strong{cftr}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}),
\strong{cfur}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}),
\strong{chlo}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}),
\strong{cipr}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}),
\strong{clar}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}),
\strong{clin}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}),
\strong{clox}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}),
\strong{coli}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}),
\strong{czol}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}),
\strong{dapt}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}),
\strong{doxy}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}),
\strong{erta}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}),
\strong{eryt}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}),
\strong{fosf}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}),
\strong{fusi}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}),
\strong{gent}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}),
\strong{imip}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}),
\strong{kana}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}),
\strong{levo}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}),
\strong{linc}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}),
\strong{line}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}),
\strong{mero}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}),
\strong{mezl}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}),
\strong{mino}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}),
\strong{moxi}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}),
\strong{nali}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}),
\strong{neom}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}),
\strong{neti}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}),
\strong{nitr}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}),
\strong{norf}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}),
\strong{novo}: novobiocin (an ATCvet code: \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}),
\strong{oflo}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}),
\strong{peni}: (benzyl)penicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}),
\strong{pipe}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}),
\strong{pita}: piperacillin+tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}),
\strong{poly}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}),
\strong{pris}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}),
\strong{qida}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}),
\strong{rifa}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}),
\strong{roxi}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}),
\strong{siso}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}),
\strong{teic}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}),
\strong{tetr}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}),
\strong{tica}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}),
\strong{tige}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}),
\strong{tobr}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}),
\strong{trim}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}),
\strong{trsu}: sulfamethoxazole and trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}),
\strong{vanc}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}).
\strong{AMC}: amoxicillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}),
\strong{AMK}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}),
\strong{AMX}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}),
\strong{AMP}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}),
\strong{AZM}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}),
\strong{AZL}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}),
\strong{ATM}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}),
\strong{RID}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}),
\strong{FEP}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}),
\strong{CTX}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}),
\strong{FOX}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}),
\strong{CED}: cefradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}),
\strong{CAZ}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}),
\strong{CRO}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}),
\strong{CXM}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}),
\strong{CHL}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}),
\strong{CIP}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}),
\strong{CLR}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}),
\strong{CLI}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}),
\strong{FLC}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}),
\strong{COL}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}),
\strong{CZO}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}),
\strong{DAP}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}),
\strong{DOX}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}),
\strong{ETP}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}),
\strong{ERY}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}),
\strong{FOS}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}),
\strong{FUS}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}),
\strong{GEN}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}),
\strong{IPM}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}),
\strong{KAN}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}),
\strong{LVX}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}),
\strong{LIN}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}),
\strong{LNZ}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}),
\strong{MEM}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}),
\strong{MEZ}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}),
\strong{MNO}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}),
\strong{MFX}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}),
\strong{MTR}: metronidazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01XD01}),
\strong{NAL}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}),
\strong{NEO}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}),
\strong{NET}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}),
\strong{NIT}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}),
\strong{NOR}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}),
\strong{NOV}: novobiocin (an ATCvet code: \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}),
\strong{OFX}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}),
\strong{OXA}: oxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01CF04}),
\strong{PEN}: penicillin G (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}),
\strong{PIP}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}),
\strong{TZP}: piperacillin/tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}),
\strong{PLB}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}),
\strong{PRI}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}),
\strong{QDA}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}),
\strong{RIF}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}),
\strong{RXT}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}),
\strong{SIS}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}),
\strong{TEC}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}),
\strong{TCY}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}),
\strong{TIC}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}),
\strong{TGC}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}),
\strong{TOB}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}),
\strong{TMP}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}),
\strong{SXT}: trimethoprim/sulfamethoxazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}),
\strong{VAN}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}).
}
\section{Read more on our website!}{

View File

@ -92,13 +92,10 @@ All functions will return the most recently known taxonomic property according t
The Gram stain - \code{mo_gramstain()} - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value \code{NA}.
All output will be \link{translate}d where possible.
The function \code{mo_url()} will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
}
\section{Supported languages}{
Supported languages are \code{"en"} (English), \code{"de"} (German), \code{"nl"} (Dutch), \code{"es"} (Spanish), \code{"it"} (Italian), \code{"fr"} (French), and \code{"pt"} (Portuguese).
}
\section{Catalogue of Life}{
\if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
@ -111,7 +108,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
[1] Becker K \emph{et al.} \strong{Coagulase-Negative Staphylococci}. 2014. Clin Microbiol Rev. 27(4): 870926. \url{https://dx.doi.org/10.1128/CMR.00109-13}
[2] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the S. aureus complex, S. argenteus and S. schweitzeri: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).}. 2019. Clin Microbiol Infect. 2019 Mar 11. \url{https://doi.org/10.1016/j.cmi.2019.02.028}
[2] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the \emph{S. aureus} complex, \emph{S. argenteus} and \emph{S. schweitzeri}: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).} 2019. Clin Microbiol Infect. \url{https://doi.org/10.1016/j.cmi.2019.02.028}
[3] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 57195. \url{https://dx.doi.org/10.1084/jem.57.4.571}
@ -142,7 +139,7 @@ mo_shortname("E. coli") # "E. coli"
mo_gramstain("E. coli") # "Gram negative"
mo_type("E. coli") # "Bacteria" (equal to kingdom)
mo_rank("E. coli") # "species"
mo_url("E. coli") # get the direct url to the Catalogue of Life
mo_url("E. coli") # get the direct url to the online database entry
## scientific reference
mo_ref("E. coli") # "Castellani et al., 1919"
@ -200,7 +197,7 @@ mo_fullname("S. pyogenes",
language = "nl") # "Streptococcus groep A"
# get a list with the complete taxonomy (kingdom to subspecies)
# get a list with the complete taxonomy (from kingdom to subspecies)
mo_taxonomy("E. coli")
}
\seealso{

View File

@ -30,8 +30,8 @@ portion_SI(..., minimum = 30, as_percent = FALSE,
portion_S(..., minimum = 30, as_percent = FALSE,
also_single_tested = FALSE)
portion_df(data, translate_ab = getOption("get_antibiotic_names",
"official"), minimum = 30, as_percent = FALSE, combine_IR = FALSE)
portion_df(data, translate_ab = "name", language = get_locale(),
minimum = 30, as_percent = FALSE, combine_IR = FALSE)
}
\arguments{
\item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See Examples.}
@ -44,7 +44,9 @@ portion_df(data, translate_ab = getOption("get_antibiotic_names",
\item{data}{a \code{data.frame} containing columns with class \code{rsi} (see \code{\link{as.rsi}})}
\item{translate_ab}{a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations to, using \code{\link{abname}}. This can be set with \code{\link{getOption}("get_antibiotic_names")}.}
\item{translate_ab}{a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations to, using \code{\link{ab_property}}}
\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.}
\item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)}
}
@ -62,8 +64,6 @@ These functions can be used to calculate the (co-)resistance of microbial isolat
These functions are not meant to count isolates, but to calculate the portion of resistance/susceptibility. Use the \code{\link[AMR]{count}} functions to count isolates. \emph{Low counts can infuence the outcome - these \code{portion} functions may camouflage this, since they only return the portion albeit being dependent on the \code{minimum} parameter.}
\code{portion_df} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}}) and calculates the portions R, I and S. The resulting \emph{tidy data} (see Source) \code{data.frame} will have three rows (S/I/R) and a column for each variable with class \code{"rsi"}.
The old \code{\link{rsi}} function is still available for backwards compatibility but is deprecated.
\if{html}{
\cr\cr
To calculate the probability (\emph{p}) of susceptibility of one antibiotic, we use this formula:
@ -89,63 +89,63 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
?septic_patients
# Calculate resistance
portion_R(septic_patients$amox)
portion_IR(septic_patients$amox)
portion_R(septic_patients$AMX)
portion_IR(septic_patients$AMX)
# Or susceptibility
portion_S(septic_patients$amox)
portion_SI(septic_patients$amox)
portion_S(septic_patients$AMX)
portion_SI(septic_patients$AMX)
# Do the above with pipes:
library(dplyr)
septic_patients \%>\% portion_R(amox)
septic_patients \%>\% portion_IR(amox)
septic_patients \%>\% portion_S(amox)
septic_patients \%>\% portion_SI(amox)
septic_patients \%>\% portion_R(AMX)
septic_patients \%>\% portion_IR(AMX)
septic_patients \%>\% portion_S(AMX)
septic_patients \%>\% portion_SI(AMX)
septic_patients \%>\%
group_by(hospital_id) \%>\%
summarise(p = portion_S(cipr),
n = n_rsi(cipr)) # n_rsi works like n_distinct in dplyr
summarise(p = portion_S(CIP),
n = n_rsi(CIP)) # n_rsi works like n_distinct in dplyr
septic_patients \%>\%
group_by(hospital_id) \%>\%
summarise(R = portion_R(cipr, as_percent = TRUE),
I = portion_I(cipr, as_percent = TRUE),
S = portion_S(cipr, as_percent = TRUE),
n1 = count_all(cipr), # the actual total; sum of all three
n2 = n_rsi(cipr), # same - analogous to n_distinct
summarise(R = portion_R(CIP, as_percent = TRUE),
I = portion_I(CIP, as_percent = TRUE),
S = portion_S(CIP, as_percent = TRUE),
n1 = count_all(CIP), # the actual total; sum of all three
n2 = n_rsi(CIP), # same - analogous to n_distinct
total = n()) # NOT the number of tested isolates!
# Calculate co-resistance between amoxicillin/clav acid and gentamicin,
# so we can see that combination therapy does a lot more than mono therapy:
septic_patients \%>\% portion_S(amcl) # S = 71.4\%
septic_patients \%>\% count_all(amcl) # n = 1879
septic_patients \%>\% portion_S(AMC) # S = 71.4\%
septic_patients \%>\% count_all(AMC) # n = 1879
septic_patients \%>\% portion_S(gent) # S = 74.0\%
septic_patients \%>\% count_all(gent) # n = 1855
septic_patients \%>\% portion_S(GEN) # S = 74.0\%
septic_patients \%>\% count_all(GEN) # n = 1855
septic_patients \%>\% portion_S(amcl, gent) # S = 92.3\%
septic_patients \%>\% count_all(amcl, gent) # n = 1798
septic_patients \%>\% portion_S(AMC, GEN) # S = 92.3\%
septic_patients \%>\% count_all(AMC, GEN) # n = 1798
septic_patients \%>\%
group_by(hospital_id) \%>\%
summarise(cipro_p = portion_S(cipr, as_percent = TRUE),
cipro_n = count_all(cipr),
genta_p = portion_S(gent, as_percent = TRUE),
genta_n = count_all(gent),
combination_p = portion_S(cipr, gent, as_percent = TRUE),
combination_n = count_all(cipr, gent))
summarise(cipro_p = portion_S(CIP, as_percent = TRUE),
cipro_n = count_all(CIP),
genta_p = portion_S(GEN, as_percent = TRUE),
genta_n = count_all(GEN),
combination_p = portion_S(CIP, GEN, as_percent = TRUE),
combination_n = count_all(CIP, GEN))
# Get portions S/I/R immediately of all rsi columns
septic_patients \%>\%
select(amox, cipr) \%>\%
select(AMX, CIP) \%>\%
portion_df(translate = FALSE)
# It also supports grouping variables
septic_patients \%>\%
select(hospital_id, amox, cipr) \%>\%
select(hospital_id, AMX, CIP) \%>\%
group_by(hospital_id) \%>\%
portion_df(translate = FALSE)
@ -156,8 +156,8 @@ septic_patients \%>\%
my_table \%>\%
filter(first_isolate == TRUE,
genus == "Helicobacter") \%>\%
summarise(p = portion_S(amox, metr), # amoxicillin with metronidazole
n = count_all(amox, metr))
summarise(p = portion_S(AMX, MTR), # amoxicillin with metronidazole
n = count_all(AMX, MTR))
}
}
\seealso{

View File

@ -86,7 +86,7 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
}
\examples{
x <- resistance_predict(septic_patients, col_ab = "amox", year_min = 2010)
x <- resistance_predict(septic_patients, col_ab = "AMX", year_min = 2010)
plot(x)
ggplot_rsi_predict(x)
@ -95,7 +95,7 @@ library(dplyr)
x <- septic_patients \%>\%
filter_first_isolate() \%>\%
filter(mo_genus(mo) == "Staphylococcus") \%>\%
resistance_predict("peni")
resistance_predict("PEN")
plot(x)
@ -109,7 +109,7 @@ if (!require(ggplot2)) {
data <- septic_patients \%>\%
filter(mo == as.mo("E. coli")) \%>\%
resistance_predict(col_ab = "amox",
resistance_predict(col_ab = "AMX",
col_date = "date",
info = FALSE,
minimum = 15)

View File

@ -1,23 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/portion.R
\name{rsi}
\alias{rsi}
\title{Calculate resistance of isolates}
\usage{
rsi(ab1, ab2 = NULL, interpretation = "IR", minimum = 30,
as_percent = FALSE, ...)
}
\arguments{
\item{ab1, ab2}{vector (or column) with antibiotic interpretations. It will be transformed internally with \code{\link{as.rsi}} if needed.}
\item{interpretation}{antimicrobial interpretation to check for}
\item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.}
\item{as_percent}{a logical to indicate whether the output must be returned as a hundred fold with \% sign (a character). A value of \code{0.123456} will then be returned as \code{"12.3\%"}.}
\item{...}{deprecated parameters to support usage on older versions}
}
\description{
This function is deprecated. Use the \code{\link{portion}} functions instead.
}

30
man/rsi_translation.Rd Normal file
View File

@ -0,0 +1,30 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\docType{data}
\name{rsi_translation}
\alias{rsi_translation}
\title{Data set for RSI interpretation}
\format{A \code{\link{data.frame}} with 11,559 observations and 9 variables:
\describe{
\item{\code{guideline}}{Name of the guideline}
\item{\code{mo}}{Microbial ID, see \code{\link{as.mo}}}
\item{\code{ab}}{Antibiotic ID, see \code{\link{as.ab}}}
\item{\code{ref_tbl}}{Info about where the guideline rule can be found}
\item{\code{S_mic}}{Lowest MIC value that leads to "S"}
\item{\code{R_mic}}{Highest MIC value that leads to "R"}
\item{\code{dose_disk}}{Dose of the used disk diffusion method}
\item{\code{S_disk}}{Lowest number of millimeters that leads to "S"}
\item{\code{R_disk}}{Highest number of millimeters that leads to "R"}
}}
\usage{
rsi_translation
}
\description{
Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use \code{\link{as.rsi}} to transform MICs or disks measurements to RSI values.
}
\section{Read more on our website!}{
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
}
\keyword{datasets}

55
man/translate.Rd Normal file
View File

@ -0,0 +1,55 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_locale.R
\name{translate}
\alias{translate}
\alias{get_locale}
\title{Translate strings from AMR package}
\usage{
get_locale()
}
\description{
For language-dependent output of AMR functions, like \code{\link{mo_fullname}} and \code{\link{mo_type}}.
}
\details{
Strings will be translated to foreign languages if they are defined in a local translation file. This file comes with this package and can be found when running:
\code{system.file("translations.tsv", package = "AMR")}
This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation suggestion}{by creating a new issue on our repository}.
The system language will be used at default, if supported, using \code{\link{get_locale}}. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}.
}
\section{Read more on our website!}{
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
}
\examples{
# The 'language' parameter of below functions
# will be set automatically to your system language
# with get_locale()
# English
mo_fullname("CoNS", language = "en")
#> "Coagulase-negative Staphylococcus (CoNS)"
# German
mo_fullname("CoNS", language = "de")
#> "Koagulase-negative Staphylococcus (KNS)"
# Dutch
mo_fullname("CoNS", language = "nl")
#> "Coagulase-negatieve Staphylococcus (CNS)"
# Spanish
mo_fullname("CoNS", language = "es")
#> "Staphylococcus coagulasa negativo (SCN)"
# Italian
mo_fullname("CoNS", language = "it")
#> "Staphylococcus negativo coagulasi (CoNS)"
# Portuguese
mo_fullname("CoNS", language = "pt")
#> "Staphylococcus coagulase negativo (CoNS)"
}