1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 11:41:58 +02:00

replaced bactid by mo

This commit is contained in:
2018-08-31 13:36:19 +02:00
parent 98ff131680
commit 5965d3c794
41 changed files with 786 additions and 411 deletions

22
man/AMR-deprecated.Rd Normal file
View File

@ -0,0 +1,22 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deprecated.R
\name{AMR-deprecated}
\alias{AMR-deprecated}
\alias{as.bactid}
\alias{is.bactid}
\alias{guess_bactid}
\alias{ratio}
\title{Deprecated functions}
\usage{
as.bactid(...)
is.bactid(...)
guess_bactid(...)
ratio(x, ratio)
}
\description{
These functions are \link{Deprecated}. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by.
}
\keyword{internal}

View File

@ -13,7 +13,7 @@ EUCAST Expert Rules Version 2.0: \cr
\url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}
}
\usage{
EUCAST_rules(tbl, col_bactid = "bactid", info = TRUE, amcl = "amcl",
EUCAST_rules(tbl, col_mo = "mo", info = TRUE, amcl = "amcl",
amik = "amik", amox = "amox", ampi = "ampi", azit = "azit",
azlo = "azlo", aztr = "aztr", cefa = "cefa", cfep = "cfep",
cfot = "cfot", cfox = "cfox", cfra = "cfra", cfta = "cfta",
@ -28,18 +28,21 @@ EUCAST_rules(tbl, col_bactid = "bactid", info = TRUE, amcl = "amcl",
peni = "peni", pita = "pita", poly = "poly", pris = "pris",
qida = "qida", rifa = "rifa", roxi = "roxi", siso = "siso",
teic = "teic", tetr = "tetr", tica = "tica", tige = "tige",
tobr = "tobr", trim = "trim", trsu = "trsu", vanc = "vanc")
tobr = "tobr", trim = "trim", trsu = "trsu", vanc = "vanc",
col_bactid = "bactid")
interpretive_reading(...)
}
\arguments{
\item{tbl}{table with antibiotic columns, like e.g. \code{amox} and \code{amcl}}
\item{col_bactid}{column name of the bacteria ID in \code{tbl} - values of this column should be present in \code{microorganisms$bactid}, see \code{\link{microorganisms}}}
\item{col_mo}{column name of the bacteria ID in \code{tbl} - values of this column should be present in \code{microorganisms$mo}, see \code{\link{microorganisms}}}
\item{info}{print progress}
\item{amcl, amik, amox, ampi, azit, azlo, aztr, cefa, cfep, cfot, cfox, cfra, cfta, cftr, cfur, chlo, cipr, clar, clin, clox, coli, czol, dapt, doxy, erta, eryt, fosf, fusi, gent, imip, kana, levo, linc, line, mero, mezl, mino, moxi, nali, neom, neti, nitr, norf, novo, oflo, peni, pita, poly, pris, qida, rifa, roxi, siso, teic, tetr, tica, tige, tobr, trim, trsu, vanc}{column names of antibiotics. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{amcl, amik, amox, ampi, azit, azlo, aztr, cefa, cfep, cfot, cfox, cfra, cfta, cftr, cfur, chlo, cipr, clar, clin, clox, coli, czol, dapt, doxy, erta, eryt, fosf, fusi, gent, imip, kana, levo, linc, line, mero, mezl, mino, moxi, nali, neom, neti, nitr, norf, novo, oflo, peni, pita, poly, pris, qida, rifa, roxi, siso, teic, tetr, tica, tige, tobr, trim, trsu, vanc}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{col_bactid}{Deprecated. Use \code{col_mo} instead.}
\item{...}{parameters that are passed on to \code{EUCAST_rules}}
}
@ -49,7 +52,7 @@ table with edited variables of antibiotics.
\description{
Apply expert rules (like intrinsic resistance), as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{http://eucast.org}), see \emph{Source}.
}
\section{Abbrevations of antibiotics}{
\section{Antibiotics}{
Abbrevations of the column containing antibiotics:
@ -118,16 +121,16 @@ Abbrevations of the column containing antibiotics:
\examples{
a <- EUCAST_rules(septic_patients)
a <- data.frame(bactid = c("STAAUR", # Staphylococcus aureus
"ENCFAE", # Enterococcus faecalis
"ESCCOL", # Escherichia coli
"KLEPNE", # Klebsiella pneumoniae
"PSEAER"), # Pseudomonas aeruginosa
vanc = "-", # Vancomycin
amox = "-", # Amoxicillin
coli = "-", # Colistin
cfta = "-", # Ceftazidime
cfur = "-", # Cefuroxime
a <- data.frame(mo = c("STAAUR", # Staphylococcus aureus
"ENCFAE", # Enterococcus faecalis
"ESCCOL", # Escherichia coli
"KLEPNE", # Klebsiella pneumoniae
"PSEAER"), # Pseudomonas aeruginosa
vanc = "-", # Vancomycin
amox = "-", # Amoxicillin
coli = "-", # Colistin
cfta = "-", # Ceftazidime
cfur = "-", # Cefuroxime
stringsAsFactors = FALSE)
a

View File

@ -7,7 +7,7 @@
\alias{EUCAST_exceptional_phenotypes}
\title{Determine multidrug-resistant organisms (MDRO)}
\usage{
MDRO(tbl, country = NULL, col_bactid = "bactid", info = TRUE,
MDRO(tbl, country = NULL, col_mo = "mo", info = TRUE,
amcl = "amcl", amik = "amik", amox = "amox", ampi = "ampi",
azit = "azit", aztr = "aztr", cefa = "cefa", cfra = "cfra",
cfep = "cfep", cfot = "cfot", cfox = "cfox", cfta = "cfta",
@ -22,7 +22,8 @@ MDRO(tbl, country = NULL, col_bactid = "bactid", info = TRUE,
peni = "peni", pita = "pita", poly = "poly", qida = "qida",
rifa = "rifa", roxi = "roxi", siso = "siso", teic = "teic",
tetr = "tetr", tica = "tica", tige = "tige", tobr = "tobr",
trim = "trim", trsu = "trsu", vanc = "vanc")
trim = "trim", trsu = "trsu", vanc = "vanc",
col_bactid = "bactid")
BRMO(tbl, country = "nl", ...)
@ -35,11 +36,129 @@ EUCAST_exceptional_phenotypes(tbl, country = "EUCAST", ...)
\item{country}{country code to determine guidelines. EUCAST rules will be used when left empty, see Details. Should be or a code from the \href{https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements}{list of ISO 3166-1 alpha-2 country codes}. Case-insensitive. Currently supported are \code{de} (Germany) and \code{nl} (the Netherlands).}
\item{col_bactid}{column name of the bacteria ID in \code{tbl} - values of this column should be present in \code{microorganisms$bactid}, see \code{\link{microorganisms}}}
\item{col_mo}{column name of the bacteria ID in \code{tbl} - values of this column should be present in \code{microorganisms$mo}, see \code{\link{microorganisms}}}
\item{info}{print progress}
\item{amcl, amik, amox, ampi, azit, aztr, cefa, cfra, cfep, cfot, cfox, cfta, cftr, cfur, chlo, cipr, clar, clin, clox, coli, czol, dapt, doxy, erta, eryt, fosf, fusi, gent, imip, kana, levo, linc, line, mero, metr, mino, moxi, nali, neom, neti, nitr, novo, norf, oflo, peni, pita, poly, qida, rifa, roxi, siso, teic, tetr, tica, tige, tobr, trim, trsu, vanc}{column names of antibiotics. column names of antibiotics}
\item{amcl}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{amik}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{amox}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{ampi}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{azit}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{aztr}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{cefa}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{cfra}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{cfep}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{cfot}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{cfox}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{cfta}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{cftr}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{cfur}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{chlo}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{cipr}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{clar}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{clin}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{clox}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{coli}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{czol}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{dapt}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{doxy}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{erta}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{eryt}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{fosf}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{fusi}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{gent}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{imip}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{kana}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{levo}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{linc}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{line}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{mero}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{metr}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{mino}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{moxi}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{nali}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{neom}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{neti}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{nitr}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{novo}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{norf}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{oflo}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{peni}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{pita}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{poly}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{qida}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{rifa}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{roxi}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{siso}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{teic}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{tetr}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{tica}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{tige}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{tobr}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{trim}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{trsu}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{vanc}{column name of an antibiotic. Use \code{NA} to skip a column, like \code{tica = NA}. Non-existing columns will anyway be skipped. See the Antibiotics section for an explanation of the abbreviations.}
\item{col_bactid}{Deprecated. Use \code{col_mo} instead.}
\item{...}{parameters that are passed on to methods}
}
@ -52,10 +171,77 @@ Determine which isolates are multidrug-resistant organisms (MDRO) according to c
\details{
When \code{country} will be left blank, guidelines will be taken from EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}).
}
\section{Antibiotics}{
Abbrevations of the column containing antibiotics:
\strong{amcl}: amoxicillin and beta-lactamase inhibitor (\emph{J01CR02}),
\strong{amik}: amikacin (\emph{J01GB06}),
\strong{amox}: amoxicillin (\emph{J01CA04}),
\strong{ampi}: ampicillin (\emph{J01CA01}),
\strong{azit}: azithromycin (\emph{J01FA10}),
\strong{azlo}: azlocillin (\emph{J01CA09}),
\strong{aztr}: aztreonam (\emph{J01DF01}),
\strong{cefa}: cefaloridine (\emph{J01DB02}),
\strong{cfep}: cefepime (\emph{J01DE01}),
\strong{cfot}: cefotaxime (\emph{J01DD01}),
\strong{cfox}: cefoxitin (\emph{J01DC01}),
\strong{cfra}: cefradine (\emph{J01DB09}),
\strong{cfta}: ceftazidime (\emph{J01DD02}),
\strong{cftr}: ceftriaxone (\emph{J01DD04}),
\strong{cfur}: cefuroxime (\emph{J01DC02}),
\strong{chlo}: chloramphenicol (\emph{J01BA01}),
\strong{cipr}: ciprofloxacin (\emph{J01MA02}),
\strong{clar}: clarithromycin (\emph{J01FA09}),
\strong{clin}: clindamycin (\emph{J01FF01}),
\strong{clox}: flucloxacillin (\emph{J01CF05}),
\strong{coli}: colistin (\emph{J01XB01}),
\strong{czol}: cefazolin (\emph{J01DB04}),
\strong{dapt}: daptomycin (\emph{J01XX09}),
\strong{doxy}: doxycycline (\emph{J01AA02}),
\strong{erta}: ertapenem (\emph{J01DH03}),
\strong{eryt}: erythromycin (\emph{J01FA01}),
\strong{fosf}: fosfomycin (\emph{J01XX01}),
\strong{fusi}: fusidic acid (\emph{J01XC01}),
\strong{gent}: gentamicin (\emph{J01GB03}),
\strong{imip}: imipenem and cilastatin (\emph{J01DH51}),
\strong{kana}: kanamycin (\emph{J01GB04}),
\strong{levo}: levofloxacin (\emph{J01MA12}),
\strong{linc}: lincomycin (\emph{J01FF02}),
\strong{line}: linezolid (\emph{J01XX08}),
\strong{mero}: meropenem (\emph{J01DH02}),
\strong{mezl}: mezlocillin (\emph{J01CA10}),
\strong{mino}: minocycline (\emph{J01AA08}),
\strong{moxi}: moxifloxacin (\emph{J01MA14}),
\strong{nali}: nalidixic acid (\emph{J01MB02}),
\strong{neom}: neomycin (\emph{J01GB05}),
\strong{neti}: netilmicin (\emph{J01GB07}),
\strong{nitr}: nitrofurantoin (\emph{J01XE01}),
\strong{norf}: norfloxacin (\emph{J01MA06}),
\strong{novo}: novobiocin (an ATCvet code: \emph{QJ01XX95}),
\strong{oflo}: ofloxacin (\emph{J01MA01}),
\strong{peni}: penicillins, combinations with other antibacterials (\emph{J01RA01}),
\strong{pita}: piperacillin and beta-lactamase inhibitor (\emph{J01CR05}),
\strong{poly}: polymyxin B (\emph{J01XB02}),
\strong{pris}: pristinamycin (\emph{J01FG01}),
\strong{qida}: quinupristin/dalfopristin (\emph{J01FG02}),
\strong{rifa}: rifampicin (\emph{J04AB02}),
\strong{roxi}: roxithromycin (\emph{J01FA06}),
\strong{siso}: sisomicin (\emph{J01GB08}),
\strong{teic}: teicoplanin (\emph{J01XA02}),
\strong{tetr}: tetracycline (\emph{J01AA07}),
\strong{tica}: ticarcillin (\emph{J01CA13}),
\strong{tige}: tigecycline (\emph{J01AA12}),
\strong{tobr}: tobramycin (\emph{J01GB01}),
\strong{trim}: trimethoprim (\emph{J01EA01}),
\strong{trsu}: sulfamethoxazole and trimethoprim (\emph{J01EE01}),
\strong{vanc}: vancomycin (\emph{J01XA01}).
}
\examples{
library(dplyr)
septic_patients \%>\%
mutate(EUCAST = MDRO(.),
BRMO = MDRO(., "nl"))
BRMO = BRMO(.))
}

View File

@ -1,11 +1,11 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bactid.R
\name{as.bactid}
\alias{as.bactid}
\alias{bactid}
\alias{guess_bactid}
\alias{is.bactid}
\title{Transform to bacteria ID}
% Please edit documentation in R/mo.R
\name{as.mo}
\alias{as.mo}
\alias{mo}
\alias{is.mo}
\alias{guess_mo}
\title{Transform to microorganism ID}
\source{
[1] Becker K \emph{et al.} \strong{Coagulase-Negative Staphylococci}. 2014. Clin Microbiol Rev. 27(4): 870926. \cr
\url{https://dx.doi.org/10.1128/CMR.00109-13} \cr
@ -13,11 +13,11 @@
\url{https://dx.doi.org/10.1084/jem.57.4.571}
}
\usage{
as.bactid(x, Becker = FALSE, Lancefield = FALSE)
as.mo(x, Becker = FALSE, Lancefield = FALSE)
guess_bactid(x, Becker = FALSE, Lancefield = FALSE)
is.mo(x)
is.bactid(x)
guess_mo(x, Becker = FALSE, Lancefield = FALSE)
}
\arguments{
\item{x}{a character vector or a dataframe with one or two columns}
@ -27,15 +27,15 @@ is.bactid(x)
\item{Lancefield}{a logical to indicate whether beta-haemolytic \emph{Streptococci} should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield [2]. These \emph{Streptococci} will be categorised in their first group, i.e. \emph{Streptococcus dysgalactiae} will be group C, although officially it was also categorised into groups G and L. Groups D and E will be ignored, since they are \emph{Enterococci}.}
}
\value{
Character (vector) with class \code{"bactid"}. Unknown values will return \code{NA}.
Character (vector) with class \code{"mo"}. Unknown values will return \code{NA}.
}
\description{
Use this function to determine a valid ID based on a genus (and species). This input can be a full name (like \code{"Staphylococcus aureus"}), an abbreviated name (like \code{"S. aureus"}), or just a genus. You could also \code{\link{select}} a genus and species column, zie Examples.
}
\details{
\code{guess_bactid} is an alias of \code{as.bactid}.
\code{guess_mo} is an alias of \code{as.mo}.
Use the \code{\link{mo_property}} functions to get properties based on the returned bactid, see Examples.
Use the \code{\link{mo_property}} functions to get properties based on the returned mo, see Examples.
Some exceptions have been built in to get more logical results, based on prevalence of human pathogens. These are:
\itemize{
@ -49,45 +49,45 @@ For example, \code{"Gram negative rods"} and \code{"GNR"} will both return the I
}
\examples{
# These examples all return "STAAUR", the ID of S. aureus:
as.bactid("stau")
as.bactid("STAU")
as.bactid("staaur")
as.bactid("S. aureus")
as.bactid("S aureus")
as.bactid("Staphylococcus aureus")
as.bactid("MRSA") # Methicillin Resistant S. aureus
as.bactid("VISA") # Vancomycin Intermediate S. aureus
as.bactid("VRSA") # Vancomycin Resistant S. aureus
as.mo("stau")
as.mo("STAU")
as.mo("staaur")
as.mo("S. aureus")
as.mo("S aureus")
as.mo("Staphylococcus aureus")
as.mo("MRSA") # Methicillin Resistant S. aureus
as.mo("VISA") # Vancomycin Intermediate S. aureus
as.mo("VRSA") # Vancomycin Resistant S. aureus
# guess_bactid is an alias of as.bactid and works the same
guess_bactid("S. epidermidis") # will remain species: STAEPI
guess_bactid("S. epidermidis", Becker = TRUE) # will not remain species: STACNS
# guess_mo is an alias of as.mo and works the same
guess_mo("S. epidermidis") # will remain species: STAEPI
guess_mo("S. epidermidis", Becker = TRUE) # will not remain species: STACNS
guess_bactid("S. pyogenes") # will remain species: STCAGA
guess_bactid("S. pyogenes", Lancefield = TRUE) # will not remain species: STCGRA
guess_mo("S. pyogenes") # will remain species: STCAGA
guess_mo("S. pyogenes", Lancefield = TRUE) # will not remain species: STCGRA
# Use mo_* functions to get a specific property based on a bactid
Ecoli <- as.bactid("E. coli") # returns `ESCCOL`
# Use mo_* functions to get a specific property based on `mo`
Ecoli <- as.mo("E. coli") # returns `ESCCOL`
mo_genus(Ecoli) # returns "Escherichia"
mo_gramstain(Ecoli) # returns "Negative rods"
\dontrun{
df$bactid <- as.bactid(df$microorganism_name)
df$mo <- as.mo(df$microorganism_name)
# the select function of tidyverse is also supported:
library(dplyr)
df$bactid <- df \%>\%
df$mo <- df \%>\%
select(microorganism_name) \%>\%
guess_bactid()
guess_mo()
# and can even contain 2 columns, which is convenient for genus/species combinations:
df$bactid <- df \%>\%
df$mo <- df \%>\%
select(genus, species) \%>\%
guess_bactid()
guess_mo()
# same result:
df <- df \%>\%
mutate(bactid = guess_bactid(paste(genus, species)))
mutate(mo = guess_mo(paste(genus, species)))
}
}
\seealso{
@ -95,7 +95,7 @@ df <- df \%>\%
}
\keyword{Becker}
\keyword{Lancefield}
\keyword{bactid}
\keyword{becker}
\keyword{guess}
\keyword{lancefield}
\keyword{mo}

View File

@ -7,13 +7,13 @@
Methodology of this function is based on: \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}.
}
\usage{
first_isolate(tbl, col_date, col_patient_id, col_bactid = NA,
first_isolate(tbl, col_date, col_patient_id, col_mo = NA,
col_testcode = NA, col_specimen = NA, col_icu = NA,
col_keyantibiotics = NA, episode_days = 365,
testcodes_exclude = "", icu_exclude = FALSE, filter_specimen = NA,
output_logical = TRUE, type = "keyantibiotics", ignore_I = TRUE,
points_threshold = 2, info = TRUE, col_genus = NA,
col_species = NA)
points_threshold = 2, info = TRUE, col_bactid = NA,
col_genus = NA, col_species = NA)
}
\arguments{
\item{tbl}{a \code{data.frame} containing isolates.}
@ -22,7 +22,7 @@ first_isolate(tbl, col_date, col_patient_id, col_bactid = NA,
\item{col_patient_id}{column name of the unique IDs of the patients}
\item{col_bactid}{column name of the unique IDs of the microorganisms: \code{bactid}'s. If this column has another class than \code{"bactid"}, values will be coerced using \code{\link{as.bactid}}.}
\item{col_mo}{column name of the unique IDs of the microorganisms, see \code{\link{mo}}. If this column has another class than \code{"mo"}, values will be coerced using \code{\link{as.mo}}.}
\item{col_testcode}{column name of the test codes. Use \code{col_testcode = NA} to \strong{not} exclude certain test codes (like test codes for screening). In that case \code{testcodes_exclude} will be ignored. Supports tidyverse-like quotation.}
@ -50,9 +50,11 @@ first_isolate(tbl, col_date, col_patient_id, col_bactid = NA,
\item{info}{print progress}
\item{col_genus}{(deprecated, use \code{col_bactid} instead) column name of the genus of the microorganisms}
\item{col_bactid}{(deprecated, use \code{col_mo} instead)}
\item{col_species}{(deprecated, use \code{col_bactid} instead) column name of the species of the microorganisms}
\item{col_genus}{(deprecated, use \code{col_mo} instead) column name of the genus of the microorganisms}
\item{col_species}{(deprecated, use \code{col_mo} instead) column name of the species of the microorganisms}
}
\value{
A vector to add to table, see Examples.
@ -84,7 +86,7 @@ my_patients <- septic_patients \%>\%
mutate(first_isolate = first_isolate(.,
col_date = "date",
col_patient_id = "patient_id",
col_bactid = "bactid"))
col_mo = "mo"))
# Now let's see if first isolates matter:
A <- my_patients \%>\%

View File

@ -88,7 +88,7 @@ septic_patients \%>\% freq(hospital_id) #<- easiest to remember when you're use
# you could also use `select` or `pull` to get your variables
septic_patients \%>\%
filter(hospital_id == "A") \%>\%
select(bactid) \%>\%
select(mo) \%>\%
freq()
# multiple selected variables will be pasted together
@ -100,7 +100,7 @@ septic_patients \%>\%
# get top 10 bugs of hospital A as a vector
septic_patients \%>\%
filter(hospital_id == "A") \%>\%
freq(bactid) \%>\%
freq(mo) \%>\%
top_freq(10)
# save frequency table to an object

View File

@ -119,14 +119,14 @@ septic_patients \%>\%
# genuine analysis: check 2 most prevalent microorganisms
septic_patients \%>\%
# create new bacterial ID's, with all CoNS under the same group (Becker et al.)
mutate(bactid = as.bactid(bactid, Becker = TRUE)) \%>\%
mutate(mo = as.mo(mo, Becker = TRUE)) \%>\%
# filter on top 2 bacterial ID's
filter(bactid \%in\% top_freq(freq(.$bactid), 2)) \%>\%
filter(mo \%in\% top_freq(freq(.$mo), 2)) \%>\%
# determine first isolates
mutate(first_isolate = first_isolate(.,
col_date = "date",
col_patient_id = "patient_id",
col_bactid = "bactid")) \%>\%
col_mo = "mo")) \%>\%
# filter on first isolates
filter(first_isolate == TRUE) \%>\%
# join the `microorganisms` data set
@ -140,7 +140,7 @@ septic_patients \%>\%
ggplot_rsi(x = "Antibiotic",
facet = "mo") +
labs(title = "AMR of Top Two Microorganisms In Blood Culture Isolates",
subtitle = "Only First Isolates, CoNS grouped according to Becker et al.",
subtitle = "Only First Isolates, CoNS grouped according to Becker et al. (2014)",
x = "Microorganisms")
}
}

View File

@ -11,22 +11,22 @@
\alias{anti_join_microorganisms}
\title{Join a table with \code{microorganisms}}
\usage{
inner_join_microorganisms(x, by = "bactid", suffix = c("2", ""), ...)
inner_join_microorganisms(x, by = "mo", suffix = c("2", ""), ...)
left_join_microorganisms(x, by = "bactid", suffix = c("2", ""), ...)
left_join_microorganisms(x, by = "mo", suffix = c("2", ""), ...)
right_join_microorganisms(x, by = "bactid", suffix = c("2", ""), ...)
right_join_microorganisms(x, by = "mo", suffix = c("2", ""), ...)
full_join_microorganisms(x, by = "bactid", suffix = c("2", ""), ...)
full_join_microorganisms(x, by = "mo", suffix = c("2", ""), ...)
semi_join_microorganisms(x, by = "bactid", ...)
semi_join_microorganisms(x, by = "mo", ...)
anti_join_microorganisms(x, by = "bactid", ...)
anti_join_microorganisms(x, by = "mo", ...)
}
\arguments{
\item{x}{existing table to join, also supports character vectors}
\item{by}{a variable to join by - could be a column name of \code{x} with values that exist in \code{microorganisms$bactid} (like \code{by = "bacteria_id"}), or another column in \code{\link{microorganisms}} (but then it should be named, like \code{by = c("my_genus_species" = "fullname")})}
\item{by}{a variable to join by - could be a column name of \code{x} with values that exist in \code{microorganisms$mo} (like \code{by = "bacteria_id"}), or another column in \code{\link{microorganisms}} (but then it should be named, like \code{by = c("my_genus_species" = "fullname")})}
\item{suffix}{if there are non-joined duplicate variables in \code{x} and \code{y}, these suffixes will be added to the output to disambiguate them. Should be a character vector of length 2.}

View File

@ -5,13 +5,14 @@
\alias{key_antibiotics_equal}
\title{Key antibiotics for first \emph{weighted} isolates}
\usage{
key_antibiotics(tbl, col_bactid = "bactid", universal_1 = "amox",
key_antibiotics(tbl, col_mo = "mo", universal_1 = "amox",
universal_2 = "amcl", universal_3 = "cfur", universal_4 = "pita",
universal_5 = "cipr", universal_6 = "trsu", GramPos_1 = "vanc",
GramPos_2 = "teic", GramPos_3 = "tetr", GramPos_4 = "eryt",
GramPos_5 = "oxac", GramPos_6 = "rifa", GramNeg_1 = "gent",
GramNeg_2 = "tobr", GramNeg_3 = "coli", GramNeg_4 = "cfot",
GramNeg_5 = "cfta", GramNeg_6 = "mero", warnings = TRUE)
GramNeg_5 = "cfta", GramNeg_6 = "mero", warnings = TRUE,
col_bactid = "bactid")
key_antibiotics_equal(x, y, type = c("keyantibiotics", "points"),
ignore_I = TRUE, points_threshold = 2, info = FALSE)
@ -19,7 +20,7 @@ key_antibiotics_equal(x, y, type = c("keyantibiotics", "points"),
\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: \code{bactid}'s. If this column has another class than \code{"bactid"}, values will be coerced using \code{\link{as.bactid}}.}
\item{col_mo}{column name of the unique IDs of the microorganisms, see \code{\link{mo}}. If this column has another class than \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}
@ -29,6 +30,8 @@ key_antibiotics_equal(x, y, type = c("keyantibiotics", "points"),
\item{warnings}{give warning about missing antibiotic columns, they will anyway be ignored}
\item{col_bactid}{(deprecated, use \code{col_mo} instead)}
\item{x, y}{characters to compare}
\item{type}{type to determine weighed isolates; can be \code{"keyantibiotics"} or \code{"points"}, see Details}
@ -76,9 +79,9 @@ my_patients <- my_patients \%>\%
mutate(keyab = key_antibiotics(.)) \%>\%
mutate(
# now calculate first isolates
first_regular = first_isolate(., "date", "patient_id", "bactid"),
first_regular = first_isolate(., "date", "patient_id", "mo"),
# and first WEIGHTED isolates
first_weighted = first_isolate(., "date", "patient_id", "bactid",
first_weighted = first_isolate(., "date", "patient_id", "mo",
col_keyantibiotics = "keyab")
)

View File

@ -6,7 +6,7 @@
\title{Dataset with ~2650 microorganisms}
\format{A data.frame with 2,646 observations and 12 variables:
\describe{
\item{\code{bactid}}{ID of microorganism}
\item{\code{mo}}{ID of microorganism}
\item{\code{bactsys}}{Bactsyscode of microorganism}
\item{\code{family}}{Family name of microorganism}
\item{\code{genus}}{Genus name of microorganism, like \code{"Echerichia"}}
@ -26,6 +26,6 @@ microorganisms
A dataset containing 2,646 microorganisms. MO codes of the UMCG can be looked up using \code{\link{microorganisms.umcg}}.
}
\seealso{
\code{\link{guess_bactid}} \code{\link{antibiotics}} \code{\link{microorganisms.umcg}}
\code{\link{guess_mo}} \code{\link{antibiotics}} \code{\link{microorganisms.umcg}}
}
\keyword{datasets}

View File

@ -6,16 +6,16 @@
\title{Translation table for UMCG with ~1100 microorganisms}
\format{A data.frame with 1090 observations and 2 variables:
\describe{
\item{\code{mocode}}{Code of microorganism according to UMCG MMB}
\item{\code{bactid}}{Code of microorganism in \code{\link{microorganisms}}}
\item{\code{umcg}}{Code of microorganism according to UMCG MMB}
\item{\code{mo}}{Code of microorganism in \code{\link{microorganisms}}}
}}
\usage{
microorganisms.umcg
}
\description{
A dataset containing all bacteria codes of UMCG MMB. These codes can be joined to data with an ID from \code{\link{microorganisms}$bactid} (using \code{\link{left_join_microorganisms}}). GLIMS codes can also be translated to valid \code{bactid}'s with \code{\link{guess_bactid}}.
A dataset containing all bacteria codes of UMCG MMB. These codes can be joined to data with an ID from \code{\link{microorganisms}$mo} (using \code{\link{left_join_microorganisms}}). GLIMS codes can also be translated to valid \code{mo}'s with \code{\link{guess_mo}}.
}
\seealso{
\code{\link{guess_bactid}} \code{\link{microorganisms}}
\code{\link{guess_mo}} \code{\link{microorganisms}}
}
\keyword{datasets}

View File

@ -37,12 +37,12 @@ mo_type_nl(x)
mo_gramstain_nl(x)
}
\arguments{
\item{x}{a (vector of a) valid \code{\link{bactid}} or any text that can be coerced to a valid bactid with \code{\link{as.bactid}}}
\item{x}{a (vector of a) valid \code{\link{mo}} or any text that can be coerced to a valid microorganism code with \code{\link{as.mo}}}
\item{property}{one of the column names of one of the \code{\link{microorganisms}} data set, like \code{"bactid"}, \code{"bactsys"}, \code{"family"}, \code{"genus"}, \code{"species"}, \code{"fullname"}, \code{"gramstain"} and \code{"aerobic"}}
\item{property}{one of the column names of one of the \code{\link{microorganisms}} data set, like \code{"mo"}, \code{"bactsys"}, \code{"family"}, \code{"genus"}, \code{"species"}, \code{"fullname"}, \code{"gramstain"} and \code{"aerobic"}}
}
\description{
Use these functions to return a specific property of a microorganism from the \code{\link{microorganisms}} data set, based on their \code{bactid}. Get such an ID with \code{\link{as.bactid}}.
Use these functions to return a specific property of a microorganism from the \code{\link{microorganisms}} data set, based on their \code{mo}. Get such an ID with \code{\link{as.mo}}.
}
\examples{
# All properties

View File

@ -71,13 +71,13 @@ tbl \%>\%
library(dplyr)
septic_patients \%>\%
# get bacteria properties like genus and species
left_join_microorganisms("bactid") \%>\%
left_join_microorganisms("mo") \%>\%
# calculate first isolates
mutate(first_isolate =
first_isolate(.,
"date",
"patient_id",
"bactid",
"mo",
col_specimen = NA,
col_icu = NA)) \%>\%
# filter on first E. coli isolates
@ -95,7 +95,7 @@ septic_patients \%>\%
if (!require(ggplot2)) {
data <- septic_patients \%>\%
filter(bactid == "ESCCOL") \%>\%
filter(mo == "ESCCOL") \%>\%
resistance_predict(col_ab = "amox",
col_date = "date",
info = FALSE,

View File

@ -14,7 +14,7 @@
\item{\code{age}}{age of the patient}
\item{\code{sex}}{sex of the patient}
\item{\code{patient_id}}{ID of the patient, first 10 characters of an SHA hash containing irretrievable information}
\item{\code{bactid}}{ID of microorganism, see \code{\link{microorganisms}}}
\item{\code{mo}}{ID of microorganism, see \code{\link{microorganisms}}}
\item{\code{peni:rifa}}{40 different antibiotics with class \code{rsi} (see \code{\link{as.rsi}}); these column names occur in \code{\link{antibiotics}} data set and can be translated with \code{\link{abname}}}
}}
\usage{
@ -36,7 +36,7 @@ library(dplyr)
# Add first isolates to our dataset:
my_data <- my_data \%>\%
mutate(first_isolates = first_isolate(my_data, "date", "patient_id", "bactid"))
mutate(first_isolates = first_isolate(my_data, "date", "patient_id", "mo"))
# -------- #
# ANALYSIS #
@ -46,7 +46,7 @@ my_data <- my_data \%>\%
# and numbers (n) of E. coli, divided by hospital:
my_data \%>\%
filter(bactid == guess_bactid("E. coli"),
filter(mo == guess_mo("E. coli"),
first_isolates == TRUE) \%>\%
group_by(hospital_id) \%>\%
summarise(n = n_rsi(amox),
@ -57,7 +57,7 @@ my_data \%>\%
# percentages of E. coli, trend over the years:
my_data \%>\%
filter(bactid == guess_bactid("E. coli"),
filter(mo == guess_mo("E. coli"),
first_isolates == TRUE) \%>\%
group_by(year = format(date, "\%Y")) \%>\%
summarise(n = n_rsi(amcl),