1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-12 08:21:51 +02:00

(v1.7.1.9063) not_intrinsic_resistant

This commit is contained in:
2021-12-09 10:48:25 +01:00
parent e63defe324
commit e18c49ed93
32 changed files with 275 additions and 185 deletions

View File

@ -1,11 +1,9 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ab_class_selectors.R
% Please edit documentation in R/ab_selectors.R
\name{antibiotic_class_selectors}
\alias{antibiotic_class_selectors}
\alias{ab_class}
\alias{ab_selector}
\alias{administrable_per_os}
\alias{administrable_iv}
\alias{aminoglycosides}
\alias{aminopenicillins}
\alias{antifungals}
@ -31,16 +29,15 @@
\alias{tetracyclines}
\alias{trimethoprims}
\alias{ureidopenicillins}
\alias{administrable_per_os}
\alias{administrable_iv}
\alias{not_intrinsic_resistant}
\title{Antibiotic Selectors}
\usage{
ab_class(ab_class, only_rsi_columns = FALSE, only_treatable = TRUE, ...)
ab_selector(filter, only_rsi_columns = FALSE, only_treatable = TRUE, ...)
administrable_per_os(only_rsi_columns = FALSE, ...)
administrable_iv(only_rsi_columns = FALSE, ...)
aminoglycosides(only_rsi_columns = FALSE, only_treatable = TRUE, ...)
aminopenicillins(only_rsi_columns = FALSE, ...)
@ -90,6 +87,17 @@ tetracyclines(only_rsi_columns = FALSE, ...)
trimethoprims(only_rsi_columns = FALSE, ...)
ureidopenicillins(only_rsi_columns = FALSE, ...)
administrable_per_os(only_rsi_columns = FALSE, ...)
administrable_iv(only_rsi_columns = FALSE, ...)
not_intrinsic_resistant(
only_rsi_columns = FALSE,
col_mo = NULL,
version_expertrules = 3.3,
...
)
}
\arguments{
\item{ab_class}{an antimicrobial class or a part of it, such as \code{"carba"} and \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.}
@ -101,6 +109,10 @@ ureidopenicillins(only_rsi_columns = FALSE, ...)
\item{...}{ignored, only in place to allow future extensions}
\item{filter}{an \link{expression} to be evaluated in the \link{antibiotics} data set, such as \code{name \%like\% "trim"}}
\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.}
\item{version_expertrules}{the version number to use for the EUCAST Expert Rules and Intrinsic Resistance guideline. Can be either "3.3", "3.2" or "3.1".}
}
\value{
(internally) a \link{character} vector of column names, with additional class \code{"ab_selector"}
@ -118,6 +130,8 @@ The \code{\link[=ab_class]{ab_class()}} function can be used to filter/select on
The \code{\link[=ab_selector]{ab_selector()}} function can be used to internally filter the \link{antibiotics} data set on any results, see \emph{Examples}. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set.
The \code{\link[=administrable_per_os]{administrable_per_os()}} and \code{\link[=administrable_iv]{administrable_iv()}} functions also rely on the \link{antibiotics} data set - antibiotic columns will be matched where a DDD (defined daily dose) for resp. oral and IV treatment is available in the \link{antibiotics} data set.
The \code{\link[=not_intrinsic_resistant]{not_intrinsic_resistant()}} function can be used to only select antibiotic columns that pose no intrinsic resistance for the microorganisms in the data set. For example, if a data set contains only microorganism codes or names of \emph{E. coli} and \emph{K. pneumoniae} and contains a column "vancomycin", this column will be removed (or rather, unselected) using this function. It currently applies \href{https://www.eucast.org/expert_rules_and_intrinsic_resistance/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021) to determine intrinsic resistance, using the \code{\link[=eucast_rules]{eucast_rules()}} function internally. Because of this determination, this function is quite slow in terms of performance.
}
\section{Full list of supported (antibiotic) classes}{
@ -221,6 +235,12 @@ if (require("dplyr")) {
# You can combine selectors with '&' to be more specific:
example_isolates \%>\%
select(penicillins() & administrable_per_os())
# get AMR for only drugs that matter - no intrinsic resistance:
example_isolates \%>\%
filter(mo_genus() \%in\% c("Escherichia", "Klebsiella")) \%>\%
group_by(hospital_id) \%>\%
summarise(across(not_intrinsic_resistant(), resistance))
# get susceptibility for antibiotics whose name contains "trim":
example_isolates \%>\%