% Generated by roxygen2: do not edit by hand % Please edit documentation in R/key_antibiotics.R \name{key_antibiotics} \alias{key_antibiotics} \alias{key_antibiotics_equal} \title{Key antibiotics for first \emph{weighted} isolates} \usage{ 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{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{ 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{ \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{first_isolate}} }