AMR/man/key_antibiotics.Rd

77 lines
3.6 KiB
Plaintext
Raw Normal View History

2018-02-21 11:52:31 +01:00
% Generated by roxygen2: do not edit by hand
2018-07-17 13:02:05 +02:00
% Please edit documentation in R/key_antibiotics.R
2018-02-21 11:52:31 +01:00
\name{key_antibiotics}
\alias{key_antibiotics}
2018-07-17 13:02:05 +02:00
\alias{key_antibiotics_equal}
\title{Key antibiotics for first \emph{weighted} isolates}
2018-02-21 11:52:31 +01:00
\usage{
2018-07-17 13:02:05 +02:00
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)
2018-02-21 11:52:31 +01:00
}
\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.}
2018-02-21 11:52:31 +01:00
2018-07-17 13:02:05 +02:00
\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}
2018-02-21 11:52:31 +01:00
2018-07-17 13:02:05 +02:00
\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}
2018-02-22 20:48:48 +01:00
}
2018-02-21 11:52:31 +01:00
\description{
2018-07-17 13:02:05 +02:00
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.
2018-02-21 11:52:31 +01:00
}
2018-07-17 13:02:05 +02:00
\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.
}
2018-02-22 20:48:48 +01:00
\examples{
2018-07-17 13:02:05 +02:00
\dontrun{
# set key antibiotics to a new variable
2018-02-22 20:48:48 +01:00
tbl$keyab <- key_antibiotics(tbl)
2018-07-17 13:02:05 +02:00
# 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')
2018-02-22 20:48:48 +01:00
}
}
2018-02-21 11:52:31 +01:00
\seealso{
2018-07-17 13:02:05 +02:00
\code{\link{first_isolate}}
2018-02-21 11:52:31 +01:00
}