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

guess_ab_col, benchmarks

This commit is contained in:
2019-01-11 20:37:23 +01:00
parent 193a2d2863
commit 641d866db2
86 changed files with 2181 additions and 767 deletions

View File

@ -25,27 +25,38 @@
\usage{
eucast_rules(tbl, col_mo = NULL, info = TRUE,
rules = c("breakpoints", "expert", "other", "all"), verbose = FALSE,
amcl = guess_ab(), amik = guess_ab(), amox = guess_ab(),
ampi = guess_ab(), azit = guess_ab(), azlo = guess_ab(),
aztr = guess_ab(), cefa = guess_ab(), cfep = guess_ab(),
cfot = guess_ab(), cfox = guess_ab(), cfra = guess_ab(),
cfta = guess_ab(), cftr = guess_ab(), cfur = guess_ab(),
chlo = guess_ab(), cipr = guess_ab(), clar = guess_ab(),
clin = guess_ab(), clox = guess_ab(), coli = guess_ab(),
czol = guess_ab(), dapt = guess_ab(), doxy = guess_ab(),
erta = guess_ab(), eryt = guess_ab(), fosf = guess_ab(),
fusi = guess_ab(), gent = guess_ab(), imip = guess_ab(),
kana = guess_ab(), levo = guess_ab(), linc = guess_ab(),
line = guess_ab(), mero = guess_ab(), mezl = guess_ab(),
mino = guess_ab(), moxi = guess_ab(), nali = guess_ab(),
neom = guess_ab(), neti = guess_ab(), nitr = guess_ab(),
norf = guess_ab(), novo = guess_ab(), oflo = guess_ab(),
oxac = guess_ab(), peni = guess_ab(), pipe = guess_ab(),
pita = guess_ab(), poly = guess_ab(), pris = guess_ab(),
qida = guess_ab(), rifa = guess_ab(), roxi = guess_ab(),
siso = guess_ab(), teic = guess_ab(), tetr = guess_ab(),
tica = guess_ab(), tige = guess_ab(), tobr = guess_ab(),
trim = guess_ab(), trsu = guess_ab(), vanc = guess_ab())
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())
EUCAST_rules(...)
@ -74,7 +85,7 @@ Apply susceptibility rules as defined by the European Committee on Antimicrobial
}
\section{Antibiotics}{
To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab}} 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{tica = NULL}). Non-existing columns will anyway be skipped with a warning.
Abbrevations of the column containing antibiotics in the form: \strong{abbreviation}: generic name (\emph{ATC code})

View File

@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/guess_ab.R
\name{guess_ab}
\alias{guess_ab}
% Please edit documentation in R/guess_ab_col.R
\name{guess_ab_col}
\alias{guess_ab_col}
\title{Guess antibiotic column}
\usage{
guess_ab(tbl = NULL, col = NULL, verbose = FALSE)
guess_ab_col(tbl = NULL, col = NULL, verbose = FALSE)
}
\arguments{
\item{tbl}{a \code{data.frame}}
@ -14,7 +14,7 @@ guess_ab(tbl = NULL, col = NULL, verbose = FALSE)
\item{verbose}{a logical to indicate whether additional info should be printed}
}
\description{
This tries to find a column name in a data set based on information from the \code{\link{antibiotics}} data set.
This tries to find a column name in a data set based on information from the \code{\link{antibiotics}} data set. You can look for an antibiotic (trade) of abbreviation and it will search the data for any column containing a name or ATC code of that antibiotic.
}
\section{Read more on our website!}{
@ -22,3 +22,16 @@ This tries to find a column name in a data set based on information from the \co
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R.
}
\examples{
df <- data.frame(amox = "S",
tetr = "R")
guess_ab_col(df, "amoxicillin")
# [1] "amox"
guess_ab_col(df, "J01AA07") # ATC code of Tetracycline
# [1] "tetr"
guess_ab_col(df, "J01AA07", verbose = TRUE)
# using column `tetr` for col "J01AA07"
# [1] "tetr"
}

View File

@ -5,17 +5,20 @@
\alias{key_antibiotics_equal}
\title{Key antibiotics for first \emph{weighted} isolates}
\usage{
key_antibiotics(tbl, col_mo = NULL, universal_1 = guess_ab(tbl,
"amox"), universal_2 = guess_ab(tbl, "amcl"),
universal_3 = guess_ab(tbl, "cfur"), universal_4 = guess_ab(tbl,
"pita"), universal_5 = guess_ab(tbl, "cipr"),
universal_6 = guess_ab(tbl, "trsu"), GramPos_1 = guess_ab(tbl,
"vanc"), GramPos_2 = guess_ab(tbl, "teic"), GramPos_3 = guess_ab(tbl,
"tetr"), GramPos_4 = guess_ab(tbl, "eryt"), GramPos_5 = guess_ab(tbl,
"oxac"), GramPos_6 = guess_ab(tbl, "rifa"), GramNeg_1 = guess_ab(tbl,
"gent"), GramNeg_2 = guess_ab(tbl, "tobr"), GramNeg_3 = guess_ab(tbl,
"coli"), GramNeg_4 = guess_ab(tbl, "cfot"), GramNeg_5 = guess_ab(tbl,
"cfta"), GramNeg_6 = guess_ab(tbl, "mero"), warnings = TRUE, ...)
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, ...)
key_antibiotics_equal(x, y, type = c("keyantibiotics", "points"),
ignore_I = TRUE, points_threshold = 2, info = FALSE)
@ -25,11 +28,11 @@ key_antibiotics_equal(x, y, type = c("keyantibiotics", "points"),
\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{universal_1, universal_2, universal_3, universal_4, universal_5, universal_6}{column names of \strong{broad-spectrum} antibiotics, case-insensitive}
\item{universal_1, universal_2, universal_3, universal_4, universal_5, universal_6}{column names of \strong{broad-spectrum} antibiotics, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link{guess_ab_col}}.}
\item{GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6}{column names of antibiotics for \strong{Gram positives}, case-insensitive}
\item{GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6}{column names of antibiotics for \strong{Gram positives}, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link{guess_ab_col}}.}
\item{GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6}{column names of antibiotics for \strong{Gram negatives}, case-insensitive}
\item{GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6}{column names of antibiotics for \strong{Gram negatives}, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link{guess_ab_col}}.}
\item{warnings}{give warning about missing antibiotic columns, they will anyway be ignored}
@ -49,7 +52,7 @@ key_antibiotics_equal(x, y, type = c("keyantibiotics", "points"),
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 12 antibiotic results for every isolate. These isolates can then be compared using \code{key_antibiotics_equal}, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (\code{"."}). The \code{\link{first_isolate}} function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible \emph{S. aureus} (MSSA) found within the same episode (see \code{episode} parameter of \code{\link{first_isolate}}). Without key antibiotic comparison it wouldn't.
The function \code{key_antibiotics} returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using \code{key_antibiotics_equal}, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (\code{"."}). The \code{\link{first_isolate}} function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible \emph{S. aureus} (MSSA) found within the same episode (see \code{episode} parameter of \code{\link{first_isolate}}). Without key antibiotic comparison it would not.
At default, the antibiotics that are used for \strong{Gram positive bacteria} are (colum names): \cr
\code{"amox"}, \code{"amcl"}, \code{"cfur"}, \code{"pita"}, \code{"cipr"}, \code{"trsu"} (until here is universal), \code{"vanc"}, \code{"teic"}, \code{"tetr"}, \code{"eryt"}, \code{"oxac"}, \code{"rifa"}.

View File

@ -8,26 +8,36 @@
\title{Determine multidrug-resistant organisms (MDRO)}
\usage{
mdro(tbl, country = NULL, col_mo = NULL, info = TRUE,
amcl = guess_ab(), amik = guess_ab(), amox = guess_ab(),
ampi = guess_ab(), azit = guess_ab(), aztr = guess_ab(),
cefa = guess_ab(), cfra = guess_ab(), cfep = guess_ab(),
cfot = guess_ab(), cfox = guess_ab(), cfta = guess_ab(),
cftr = guess_ab(), cfur = guess_ab(), chlo = guess_ab(),
cipr = guess_ab(), clar = guess_ab(), clin = guess_ab(),
clox = guess_ab(), coli = guess_ab(), czol = guess_ab(),
dapt = guess_ab(), doxy = guess_ab(), erta = guess_ab(),
eryt = guess_ab(), fosf = guess_ab(), fusi = guess_ab(),
gent = guess_ab(), imip = guess_ab(), kana = guess_ab(),
levo = guess_ab(), linc = guess_ab(), line = guess_ab(),
mero = guess_ab(), metr = guess_ab(), mino = guess_ab(),
moxi = guess_ab(), nali = guess_ab(), neom = guess_ab(),
neti = guess_ab(), nitr = guess_ab(), novo = guess_ab(),
norf = guess_ab(), oflo = guess_ab(), peni = guess_ab(),
pipe = guess_ab(), pita = guess_ab(), poly = guess_ab(),
qida = guess_ab(), rifa = guess_ab(), roxi = guess_ab(),
siso = guess_ab(), teic = guess_ab(), tetr = guess_ab(),
tica = guess_ab(), tige = guess_ab(), tobr = guess_ab(),
trim = guess_ab(), trsu = guess_ab(), vanc = guess_ab())
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())
brmo(..., country = "nl")
@ -177,7 +187,7 @@ 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}} 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{tica = NULL}). Non-existing columns will anyway be skipped with a warning.
Abbrevations of the column containing antibiotics in the form: \strong{abbreviation}: generic name (\emph{ATC code})