mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 02:03:04 +02:00
CI tests
This commit is contained in:
@ -9,7 +9,7 @@ All antimicrobial drugs and their official names, ATC codes, ATC groups and defi
|
||||
\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}).
|
||||
This package contains \strong{all ~450 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.
|
||||
|
||||
|
@ -41,7 +41,7 @@ Synonyms (i.e. trade names) are derived from the Compound ID (\code{cid}) and co
|
||||
\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}).
|
||||
This package contains \strong{all ~450 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.
|
||||
|
||||
|
@ -10,12 +10,14 @@ as.ab(x)
|
||||
\item{x}{character vector to determine to antibiotic ID}
|
||||
}
|
||||
\value{
|
||||
Character (vector) with class \code{"act"}. Unknown values will return \code{NA}.
|
||||
Character (vector) with class \code{"ab"}. 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{
|
||||
All entries in the \code{\{link{antibiotics}} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.
|
||||
|
||||
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.
|
||||
@ -33,7 +35,7 @@ European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{htt
|
||||
\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}).
|
||||
This package contains \strong{all ~450 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.
|
||||
|
||||
|
@ -31,7 +31,7 @@ In the ATC classification system, the active substances are classified in a hier
|
||||
\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}).
|
||||
This package contains \strong{all ~450 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.
|
||||
|
||||
|
@ -50,6 +50,23 @@ After using \code{as.rsi}, you can use \code{\link{eucast_rules}} to (1) apply i
|
||||
|
||||
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{Interpretation of S, I and R}{
|
||||
|
||||
In 2019, EUCAST has decided to change the definitions of susceptibility testing categories S, I and R as shown below. Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
|
||||
|
||||
\itemize{
|
||||
\item{\strong{S}}{Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.}
|
||||
\item{\strong{I}}{Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.}
|
||||
\item{\strong{R}}{Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.}
|
||||
}
|
||||
|
||||
Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
|
||||
|
||||
Source: \url{http://www.eucast.org/newsiandr/}.
|
||||
|
||||
\strong{This AMR package honours this new insight.}
|
||||
}
|
||||
|
||||
\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}.
|
||||
|
21
man/count.Rd
21
man/count.Rd
@ -30,7 +30,7 @@ count_all(...)
|
||||
n_rsi(...)
|
||||
|
||||
count_df(data, translate_ab = "name", language = get_locale(),
|
||||
combine_IR = FALSE)
|
||||
combine_SI = TRUE, 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.}
|
||||
@ -43,7 +43,7 @@ count_df(data, translate_ab = "name", language = get_locale(),
|
||||
|
||||
\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)}
|
||||
\item{combine_SI}{a logical to indicate whether all values of I and S must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see below. Default is now \code{TRUE}.}
|
||||
}
|
||||
\value{
|
||||
Integer
|
||||
@ -60,6 +60,23 @@ These functions are meant to count isolates. Use the \code{\link{portion}_*} fun
|
||||
|
||||
\code{count_df} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}}) and counts the amounts of 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"}.
|
||||
}
|
||||
\section{Interpretation of S, I and R}{
|
||||
|
||||
In 2019, EUCAST has decided to change the definitions of susceptibility testing categories S, I and R as shown below. Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
|
||||
|
||||
\itemize{
|
||||
\item{\strong{S}}{Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.}
|
||||
\item{\strong{I}}{Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.}
|
||||
\item{\strong{R}}{Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.}
|
||||
}
|
||||
|
||||
Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
|
||||
|
||||
Source: \url{http://www.eucast.org/newsiandr/}.
|
||||
|
||||
\strong{This AMR package honours this new insight.}
|
||||
}
|
||||
|
||||
\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}.
|
||||
|
@ -12,13 +12,15 @@
|
||||
\usage{
|
||||
ggplot_rsi(data, position = NULL, x = "Antibiotic",
|
||||
fill = "Interpretation", facet = NULL, breaks = seq(0, 1, 0.1),
|
||||
limits = NULL, translate_ab = "name", language = get_locale(),
|
||||
fun = count_df, nrow = NULL, datalabels = TRUE,
|
||||
datalabels.size = 3, datalabels.colour = "grey15", ...)
|
||||
limits = NULL, translate_ab = "name", combine_SI = TRUE,
|
||||
combine_IR = FALSE, 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 = "name",
|
||||
language = get_locale(), fun = count_df, ...)
|
||||
language = get_locale(), combine_SI = TRUE, combine_IR = FALSE,
|
||||
fun = count_df, ...)
|
||||
|
||||
facet_rsi(facet = c("Interpretation", "Antibiotic"), nrow = NULL)
|
||||
|
||||
@ -46,9 +48,11 @@ 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{ab_name}}. 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 to, using \code{\link{ab_property}}}
|
||||
|
||||
\item{language}{the language used for translation of antibiotic names}
|
||||
\item{combine_SI}{a logical to indicate whether all values of I and S must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see below. Default is now \code{TRUE}.}
|
||||
|
||||
\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{fun}{function to transform \code{data}, either \code{\link{count_df}} (default) or \code{\link{portion_df}}}
|
||||
|
||||
|
@ -4,15 +4,18 @@
|
||||
\alias{guess_ab_col}
|
||||
\title{Guess antibiotic column}
|
||||
\usage{
|
||||
guess_ab_col(tbl = NULL, col = NULL, verbose = FALSE)
|
||||
guess_ab_col(x = NULL, search_string = NULL, verbose = FALSE)
|
||||
}
|
||||
\arguments{
|
||||
\item{tbl}{a \code{data.frame}}
|
||||
\item{x}{a \code{data.frame}}
|
||||
|
||||
\item{col}{a character to look for}
|
||||
\item{search_string}{a text to search \code{x} for}
|
||||
|
||||
\item{verbose}{a logical to indicate whether additional info should be printed}
|
||||
}
|
||||
\value{
|
||||
A column name of \code{x}, or \code{NULL} when no result is found.
|
||||
}
|
||||
\description{
|
||||
This tries to find a column name in a data set based on information from the \code{\link{antibiotics}} data set. Also supports WHONET abbreviations. You can look for an antibiotic (trade) name or abbreviation and it will search the \code{data.frame} for any column containing a name or ATC code of that antibiotic.
|
||||
}
|
||||
@ -31,7 +34,7 @@ guess_ab_col(df, "J01AA07") # ATC code of tetracycline
|
||||
# [1] "tetr"
|
||||
|
||||
guess_ab_col(df, "J01AA07", verbose = TRUE)
|
||||
# using column `tetr` for col "J01AA07"
|
||||
# Note: Using column `tetr` as input for "J01AA07".
|
||||
# [1] "tetr"
|
||||
|
||||
# WHONET codes
|
||||
|
@ -31,7 +31,8 @@ portion_S(..., minimum = 30, as_percent = FALSE,
|
||||
also_single_tested = FALSE)
|
||||
|
||||
portion_df(data, translate_ab = "name", language = get_locale(),
|
||||
minimum = 30, as_percent = FALSE, combine_IR = FALSE)
|
||||
minimum = 30, as_percent = FALSE, combine_SI = TRUE,
|
||||
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.}
|
||||
@ -48,7 +49,7 @@ portion_df(data, translate_ab = "name", language = get_locale(),
|
||||
|
||||
\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)}
|
||||
\item{combine_SI}{a logical to indicate whether all values of I and S must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see below. Default is now \code{TRUE}.}
|
||||
}
|
||||
\value{
|
||||
Double or, when \code{as_percent = TRUE}, a character.
|
||||
@ -79,6 +80,23 @@ These functions are not meant to count isolates, but to calculate the portion of
|
||||
And so on.
|
||||
}
|
||||
}
|
||||
\section{Interpretation of S, I and R}{
|
||||
|
||||
In 2019, EUCAST has decided to change the definitions of susceptibility testing categories S, I and R as shown below. Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
|
||||
|
||||
\itemize{
|
||||
\item{\strong{S}}{Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.}
|
||||
\item{\strong{I}}{Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.}
|
||||
\item{\strong{R}}{Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.}
|
||||
}
|
||||
|
||||
Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
|
||||
|
||||
Source: \url{http://www.eucast.org/newsiandr/}.
|
||||
|
||||
\strong{This AMR package honours this new insight.}
|
||||
}
|
||||
|
||||
\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}.
|
||||
|
Reference in New Issue
Block a user