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

new algorithm key abs

This commit is contained in:
2018-07-17 13:02:05 +02:00
parent 967ee86757
commit 5cb9c541f8
8 changed files with 315 additions and 230 deletions

View File

@ -62,13 +62,18 @@ Determine first (weighted) isolates of all microorganisms of every patient per e
\details{
\strong{WHY THIS IS SO IMPORTANT} \cr
To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode \href{https://www.ncbi.nlm.nih.gov/pubmed/17304462}{[1]}. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all \emph{S. aureus} isolates would be overestimated, because you included this MRSA more than once. It would be \href{https://en.wikipedia.org/wiki/Selection_bias}{selection bias}.
\strong{DETERMINING WEIGHTED ISOLATES} \cr
\strong{1. Using} \code{type = "keyantibiotics"} \strong{and parameter} \code{ignore_I} \cr
To determine weighted isolates, the difference between key antibiotics will be checked. Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With \code{ignore_I = FALSE}, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. \cr
\strong{2. Using} \code{type = "points"} \strong{and parameter} \code{points_threshold} \cr
To determine weighted isolates, difference between antimicrobial interpretations will be measured with points. A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, an isolate will be (re)selected as a first weighted isolate. This method is being used by the Infection Prevention department (Dr M. Lokate) of the University Medical Center Groningen (UMCG).
}
\section{Key antibiotics}{
There are two ways to determine whether isolates can be included as first \emph{weighted} isolates: \cr
\strong{1. Using} \code{type = "keyantibiotics"} \strong{and parameter} \code{ignore_I} \cr
Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With \code{ignore_I = FALSE}, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. \cr
\strong{2. Using} \code{type = "points"} \strong{and parameter} \code{points_threshold} \cr
A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, an isolate will be (re)selected as a first weighted isolate.
}
\examples{
# septic_patients is a dataset available in the AMR package
?septic_patients
@ -120,6 +125,9 @@ tbl$first_resp_isolate_weighed <-
col_keyantibiotics = 'keyab')
}
}
\seealso{
\code{\link{keyantibiotics}}
}
\keyword{first}
\keyword{isolate}
\keyword{isolates}

View File

@ -1,37 +1,76 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/first_isolates.R
% Please edit documentation in R/key_antibiotics.R
\name{key_antibiotics}
\alias{key_antibiotics}
\title{Key antibiotics based on bacteria ID}
\alias{key_antibiotics_equal}
\title{Key antibiotics for first \emph{weighted} isolates}
\usage{
key_antibiotics(tbl, col_bactid = "bactid", info = TRUE, amcl = "amcl",
amox = "amox", cfot = "cfot", cfta = "cfta", cftr = "cftr",
cfur = "cfur", cipr = "cipr", clar = "clar", clin = "clin",
clox = "clox", doxy = "doxy", gent = "gent", line = "line",
mero = "mero", peni = "peni", pita = "pita", rifa = "rifa",
teic = "teic", trsu = "trsu", vanc = "vanc")
key_antibiotics(tbl, col_bactid = "bactid", amcl = "amcl", amox = "amox",
cfot = "cfot", cfta = "cfta", cfur = "cfur", cipr = "cipr",
coli = "coli", eryt = "eryt", gent = "gent", mero = "mero",
oxac = "oxac", pita = "pita", rifa = "rifa", teic = "teic",
tetr = "tetr", tobr = "tobr", trsu = "trsu", vanc = "vanc",
info = TRUE)
key_antibiotics_equal(x, y, type = c("keyantibiotics", "points"),
ignore_I = TRUE, points_threshold = 2, info = FALSE)
}
\arguments{
\item{tbl}{table with antibiotics coloms, like \code{amox} and \code{amcl}.}
\item{col_bactid}{column name of the unique IDs of the microorganisms (should occur in the \code{\link{microorganisms}} dataset). Get your bactid's with the function \code{\link{guess_bactid}}, that takes microorganism names as input.}
\item{amcl, amox, cfot, cfta, cfur, cipr, coli, eryt, gent, mero, oxac, pita, rifa, teic, tetr, tobr, trsu, vanc}{column names of antibiotics, case-insensitive}
\item{info}{print progress}
\item{amcl, amox, cfot, cfta, cftr, cfur, cipr, clar, clin, clox, doxy, gent, line, mero, peni, pita, rifa, teic, trsu, vanc}{column names of antibiotics, case-insensitive}
}
\value{
Character of length 1.
\item{type}{type to determine weighed isolates; can be \code{"keyantibiotics"} or \code{"points"}, see Details}
\item{ignore_I}{logical to determine whether antibiotic interpretations with \code{"I"} will be ignored when \code{type = "keyantibiotics"}, see Details}
\item{points_threshold}{points until the comparison of key antibiotics will lead to inclusion of an isolate when \code{type = "points"}, see Details}
}
\description{
Key antibiotics based on bacteria ID
These function can be used to determine first isolates (see \code{\link{first_isolate}}). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first \emph{weighted} isolates.
}
\details{
The function \code{key_antibiotics} returns a character vector with antibiotic results.
The antibiotics that are used for \strong{Gram positive bacteria} are (colum names): \cr
amox, amcl, cfur, pita, cipr, trsu, vanc, teic, tetr, eryt, oxac, rifa.
The antibiotics that are used for \strong{Gram negative bacteria} are (colum names): \cr
amox, amcl, cfur, pita, cipr, trsu, gent, tobr, coli, cfot, cfta, mero.
The function \code{key_antibiotics_equal} checks the characters returned by \code{key_antibiotics} for equality, and returns a logical value.
}
\section{Key antibiotics}{
There are two ways to determine whether isolates can be included as first \emph{weighted} isolates: \cr
\strong{1. Using} \code{type = "keyantibiotics"} \strong{and parameter} \code{ignore_I} \cr
Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With \code{ignore_I = FALSE}, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. \cr
\strong{2. Using} \code{type = "points"} \strong{and parameter} \code{points_threshold} \cr
A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, an isolate will be (re)selected as a first weighted isolate.
}
\examples{
\donttest{
#' # set key antibiotics to a new variable
\dontrun{
# set key antibiotics to a new variable
tbl$keyab <- key_antibiotics(tbl)
# add regular first isolates
tbl$first_isolate <-
first_isolate(tbl)
# add first WEIGHTED isolates using key antibiotics
tbl$first_isolate_weighed <-
first_isolate(tbl,
col_keyantibiotics = 'keyab')
}
}
\seealso{
\code{\link{mo_property}} \code{\link{antibiotics}}
\code{\link{first_isolate}}
}