1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-25 20:06:12 +01:00

(v0.7.0.9005) ab algorithm update

This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-06-11 14:18:25 +02:00
parent f6c47c8c88
commit 8f674e19bb
36 changed files with 274 additions and 248 deletions

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 0.7.0.9004
Date: 2019-06-09
Version: 0.7.0.9005
Date: 2019-06-11
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(

View File

@ -142,6 +142,7 @@ export(mo_family)
export(mo_fullname)
export(mo_genus)
export(mo_gramstain)
export(mo_info)
export(mo_kingdom)
export(mo_name)
export(mo_order)

View File

@ -1,4 +1,4 @@
# AMR 0.7.0.9004
# AMR 0.7.0.9005
#### New
* Support for all scientifically published pathotypes of *E. coli* to date. Supported are: AIEC (Adherent-Invasive *E. coli*), ATEC (Atypical Entero-pathogenic *E. coli*), DAEC (Diffusely Adhering *E. coli*), EAEC (Entero-Aggresive *E. coli*), EHEC (Entero-Haemorrhagic *E. coli*), EIEC (Entero-Invasive *E. coli*), EPEC (Entero-Pathogenic *E. coli*), ETEC (Entero-Toxigenic *E. coli*), NMEC (Neonatal Meningitiscausing *E. coli*), STEC (Shiga-toxin producing *E. coli*) and UPEC (Uropathogenic *E. coli*). All these lead to the microbial ID of *E. coli*:
@ -8,16 +8,20 @@
mo_fullname("UPEC")
# "Escherichia coli"
```
* Function `mo_info()` as an analogy to `ab_info()`. The `mo_info()` prints a list with the full taxonomy, authors, and the URL to the online database of a microorganism
#### Changed
* Fixed bug in translation of microorganism names
* Fixed bug in determining taxonomic kingdoms
* Algorithm improvements for `as.ab()` and `as.mo()` to understand even more severely misspelled input
* Function `as.ab()` now allows spaces for coercing antibiotics names
* Added `ggplot2` methods for automatically determining the scale type of classes `mo` and `ab`
* Added names of object in the header in frequency tables, even when using pipes
* Prevented `"bacteria"` from getting coerced by `as.ab()` because Bacterial is a brand name of trimethoprim (TMP)
* Fixed a bug where setting an antibiotic would not work for `eucast_rules()` and `mdro()`
* Fixed a EUCAST rule for Staphylococci, where amikacin resistance would not be inferred from tobramycin
* Removed `latest_annual_release` from the `catalogue_of_life_version()` function
* Removed antibiotic code `PVM1` from the `antibiotics` data set as this was a duplicate of `PME`
#### Other
* Fixed a note thrown by CRAN tests

32
R/ab.R
View File

@ -70,15 +70,15 @@ as.ab <- function(x) {
x_bak <- x
# remove suffices
x_bak_clean <- gsub("_(mic|rsi|disk|disc)$", "", x, ignore.case = TRUE)
x_bak_clean <- gsub("_(mic|rsi|dis[ck])$", "", x, ignore.case = TRUE)
# remove disk concentrations, like LVX_NM -> LVX
x_bak_clean <- gsub("_[A-Z]{2}[0-9_]{0,3}$", "", x_bak_clean, ignore.case = TRUE)
# clean rest of it
x_bak_clean <- gsub("[^A-Z0-9/-]", "", x_bak_clean, ignore.case = TRUE)
# keep only a-z when it's not an ATC code or only numbers
x_bak_clean[!x_bak_clean %like% "^([A-Z][0-9]{2}[A-Z]{2}[0-9]{2}|[0-9]+)$"] <- gsub("[^a-zA-Z]+",
"",
x_bak_clean[!x_bak_clean %like% "^([A-Z][0-9]{2}[A-Z]{2}[0-9]{2}|[0-9]+)$"])
# remove part between brackets if that's followed by another string
x_bak_clean <- gsub("(.*)+ [(].*[)]", "\\1", x_bak_clean)
# keep only a-Z, 0-9, space, slash and dash
x_bak_clean <- gsub("[^A-Z0-9 /-]", "", x_bak_clean, ignore.case = TRUE)
# keep only max 1 space
x_bak_clean <- trimws(gsub(" +", " ", x_bak_clean, ignore.case = TRUE))
x <- unique(x_bak_clean)
x_new <- rep(NA_character_, length(x))
x_unknown <- character(0)
@ -200,6 +200,24 @@ as.ab <- function(x) {
next
}
# try by removing all spaces
if (x[i] %like% " ") {
found <- suppressWarnings(as.ab(gsub(" +", "", x[i])))
if (length(found) > 0) {
x_new[i] <- found[1L]
next
}
}
# try by removing all spaces and numbers
if (x[i] %like% " " | x[i] %like% "[0-9]") {
found <- suppressWarnings(as.ab(gsub("[ 0-9]", "", x[i])))
if (length(found) > 0) {
x_new[i] <- found[1L]
next
}
}
# not found
x_unknown <- c(x_unknown, x_bak[x[i] == x_bak_clean][1])
}

View File

@ -73,14 +73,13 @@
#' ab_name(21319) # "Flucloxacillin" (using CID)
#' ab_name("J01CF05") # "Flucloxacillin" (using ATC)
ab_name <- function(x, language = get_locale(), tolower = FALSE, ...) {
x <- ab_validate(x = x, property = "name", ...)
res <- t(x, language = language)
x <- translate_AMR(ab_validate(x = x, property = "name", ...), language = language)
if (tolower == TRUE) {
# use perl to only transform the first character
# as we want "polymyxin B", not "polymyxin b"
res <- gsub("^([A-Z])", "\\L\\1", res, perl = TRUE)
x <- gsub("^([A-Z])", "\\L\\1", x, perl = TRUE)
}
res
x
}
#' @rdname ab_property
@ -116,19 +115,19 @@ ab_tradenames <- function(x, ...) {
#' @rdname ab_property
#' @export
ab_group <- function(x, language = get_locale(), ...) {
t(ab_validate(x = x, property = "group", ...), language = language)
translate_AMR(ab_validate(x = x, property = "group", ...), language = language)
}
#' @rdname ab_property
#' @export
ab_atc_group1 <- function(x, language = get_locale(), ...) {
t(ab_validate(x = x, property = "atc_group1", ...), language = language)
translate_AMR(ab_validate(x = x, property = "atc_group1", ...), language = language)
}
#' @rdname ab_property
#' @export
ab_atc_group2 <- function(x, language = get_locale(), ...) {
t(ab_validate(x = x, property = "atc_group2", ...), language = language)
translate_AMR(ab_validate(x = x, property = "atc_group2", ...), language = language)
}
#' @rdname ab_property
@ -150,8 +149,8 @@ ab_ddd <- function(x, administration = "oral", units = FALSE, ...) {
#' @export
ab_info <- function(x, language = get_locale(), ...) {
x <- AMR::as.ab(x, ...)
base::list(ab = x,
atc = ab_atc(x),
base::list(ab = as.character(x),
atc = as.character(ab_atc(x)),
cid = ab_cid(x),
name = ab_name(x, language = language),
group = ab_group(x, language = language),
@ -174,7 +173,7 @@ ab_property <- function(x, property = 'name', language = get_locale(), ...) {
stop("invalid property: '", property, "' - use a column name of the `antibiotics` data set")
}
t(ab_validate(x = x, property = property, ...), language = language)
translate_AMR(ab_validate(x = x, property = property, ...), language = language)
}
ab_validate <- function(x, property, ...) {

View File

@ -71,19 +71,17 @@
#' # [1] "Castellani et al., 1919"
#'
#' # Do not get mistaken - the package only includes microorganisms
#' mo_phylum("C. elegans")
#' # [1] "Cyanobacteria" # Bacteria?!
#' mo_fullname("C. elegans")
#' mo_kingdom("C. elegans")
#' # [1] "Bacteria" # Bacteria?!
#' mo_name("C. elegans")
#' # [1] "Chroococcus limneticus elegans" # Because a microorganism was found
NULL
#' Version info of included Catalogue of Life
#'
#' This function returns information about the included data from the Catalogue of Life. It also shows if the included version is their latest annual release. The Catalogue of Life releases their annual release in March each year.
#' This function returns information about the included data from the Catalogue of Life.
#' @seealso \code{\link{microorganisms}}
#' @details The list item \code{...$catalogue_of_life$is_latest_annual_release} is based on the system date.
#'
#' For DSMZ, see \code{?microorganisms}.
#' @details For DSMZ, see \code{?microorganisms}.
#' @return a \code{list}, which prints in pretty format
#' @inheritSection catalogue_of_life Catalogue of Life
#' @inheritSection AMR Read more on our website!
@ -99,8 +97,6 @@ catalogue_of_life_version <- function() {
lst <- list(catalogue_of_life =
list(version = gsub("{year}", catalogue_of_life$year, catalogue_of_life$version, fixed = TRUE),
url = gsub("{year}", catalogue_of_life$year, catalogue_of_life$url_CoL, fixed = TRUE),
# annual release always somewhere in May, so before June is TRUE, FALSE otherwise
is_latest_annual_release = Sys.Date() < as.Date(paste0(catalogue_of_life$year + 1, "-06-01")),
n = nrow(filter(AMR::microorganisms, source == "CoL"))),
deutsche_sammlung_von_mikroorganismen_und_zellkulturen =
list(version = "Prokaryotic Nomenclature Up-to-Date from DSMZ",
@ -125,7 +121,6 @@ print.catalogue_of_life_version <- function(x, ...) {
underline(lst$catalogue_of_life$version), "\n",
" Available at: ", lst$catalogue_of_life$url, "\n",
" Number of included species: ", format(lst$catalogue_of_life$n, big.mark = ","), "\n",
" (based on your system time, this is most likely ", ifelse(lst$catalogue_of_life$is_latest_annual_release, "", "not "), "the latest annual release)\n\n",
underline(paste0(lst$deutsche_sammlung_von_mikroorganismen_und_zellkulturen$version, " (",
lst$deutsche_sammlung_von_mikroorganismen_und_zellkulturen$yearmonth, ")")), "\n",
" Available at: ", lst$deutsche_sammlung_von_mikroorganismen_und_zellkulturen$url, "\n",

View File

@ -22,7 +22,7 @@
#' Data set with ~450 antibiotics
#'
#' A data set containing all antibiotics. Use \code{\link{as.ab}} or one of the \code{\link{ab_property}} functions to retrieve values from this data set. Three identifiers are included in this data set: an antibiotic ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes.
#' @format A \code{\link{data.frame}} with 454 observations and 13 variables:
#' @format A \code{\link{data.frame}} with 453 observations and 13 variables:
#' \describe{
#' \item{\code{ab}}{Antibiotic ID as used in this package (like \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available}
#' \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02}}

View File

@ -26,17 +26,17 @@
#' @param y,z characters to compare
#' @inheritParams first_isolate
#' @param 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}}.
#' @param 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}}.
#' @param 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}}.
#' @param 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}}.
#' @param 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}}.
#' @param warnings give warning about missing antibiotic columns, they will anyway be ignored
#' @param ... other parameters passed on to function
#' @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 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"}.
#' At default, the antibiotics that are used for \strong{Gram-positive bacteria} are: \cr
#' amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), vancomycin, teicoplanin, tetracycline, erythromycin, oxacillin, rifampin.
#'
#' At default, the antibiotics that are used for \strong{Gram negative bacteria} are (colum names): \cr
#' \code{"amox"}, \code{"amcl"}, \code{"cfur"}, \code{"pita"}, \code{"cipr"}, \code{"trsu"} (until here is universal), \code{"gent"}, \code{"tobr"}, \code{"coli"}, \code{"cfot"}, \code{"cfta"}, \code{"mero"}.
#' At default, the antibiotics that are used for \strong{Gram-negative bacteria} are: \cr
#' amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), gentamicin, tobramycin, colistin, cefotaxime, ceftazidime, meropenem.
#'
#'
#' The function \code{key_antibiotics_equal} checks the characters returned by \code{key_antibiotics} for equality, and returns a logical vector.
@ -50,7 +50,7 @@
#' @examples
#' # septic_patients is a dataset available in the AMR package
#' ?septic_patients
#'
#' library(dplyr)
#' # set key antibiotics to a new variable
#' my_patients <- septic_patients %>%
@ -78,24 +78,24 @@
#' # FALSE, because I is not ignored and so the 4th value differs
key_antibiotics <- function(x,
col_mo = NULL,
universal_1 = guess_ab_col(x, "AMX"),
universal_2 = guess_ab_col(x, "AMC"),
universal_3 = guess_ab_col(x, "CXM"),
universal_4 = guess_ab_col(x, "TZP"),
universal_5 = guess_ab_col(x, "CIP"),
universal_6 = guess_ab_col(x, "SXT"),
GramPos_1 = guess_ab_col(x, "VAN"),
GramPos_2 = guess_ab_col(x, "TEC"),
GramPos_3 = guess_ab_col(x, "TCY"),
GramPos_4 = guess_ab_col(x, "ERY"),
GramPos_5 = guess_ab_col(x, "OXA"),
GramPos_6 = guess_ab_col(x, "RIF"),
GramNeg_1 = guess_ab_col(x, "GEN"),
GramNeg_2 = guess_ab_col(x, "TOB"),
GramNeg_3 = guess_ab_col(x, "COL"),
GramNeg_4 = guess_ab_col(x, "CTX"),
GramNeg_5 = guess_ab_col(x, "CAZ"),
GramNeg_6 = guess_ab_col(x, "MEM"),
universal_1 = guess_ab_col(x, "amoxicillin"),
universal_2 = guess_ab_col(x, "amoxicillin/clavulanic acid"),
universal_3 = guess_ab_col(x, "cefuroxime"),
universal_4 = guess_ab_col(x, "piperacillin/tazobactam"),
universal_5 = guess_ab_col(x, "ciprofloxacin"),
universal_6 = guess_ab_col(x, "trimethoprim/sulfamethoxazole"),
GramPos_1 = guess_ab_col(x, "vancomycin"),
GramPos_2 = guess_ab_col(x, "teicoplanin"),
GramPos_3 = guess_ab_col(x, "tetracycline"),
GramPos_4 = guess_ab_col(x, "erythromycin"),
GramPos_5 = guess_ab_col(x, "oxacillin"),
GramPos_6 = guess_ab_col(x, "rifampin"),
GramNeg_1 = guess_ab_col(x, "gentamicin"),
GramNeg_2 = guess_ab_col(x, "tobramycin"),
GramNeg_3 = guess_ab_col(x, "colistin"),
GramNeg_4 = guess_ab_col(x, "cefotaxime"),
GramNeg_5 = guess_ab_col(x, "ceftazidime"),
GramNeg_6 = guess_ab_col(x, "meropenem"),
warnings = TRUE,
...) {
@ -170,7 +170,7 @@ key_antibiotics <- function(x,
gram_positive <- gram_positive[!is.null(gram_positive)]
gram_positive <- gram_positive[!is.na(gram_positive)]
if (length(gram_positive) < 12) {
warning("only using ", length(gram_positive), " different antibiotics as key antibiotics for Gram positives. See ?key_antibiotics.", call. = FALSE)
warning("only using ", length(gram_positive), " different antibiotics as key antibiotics for Gram-positives. See ?key_antibiotics.", call. = FALSE)
}
gram_negative = c(universal,
@ -179,7 +179,7 @@ key_antibiotics <- function(x,
gram_negative <- gram_negative[!is.null(gram_negative)]
gram_negative <- gram_negative[!is.na(gram_negative)]
if (length(gram_negative) < 12) {
warning("only using ", length(gram_negative), " different antibiotics as key antibiotics for Gram negatives. See ?key_antibiotics.", call. = FALSE)
warning("only using ", length(gram_negative), " different antibiotics as key antibiotics for Gram-negatives. See ?key_antibiotics.", call. = FALSE)
}
# join to microorganisms data set
@ -191,7 +191,7 @@ key_antibiotics <- function(x,
# Gram +
x <- x %>% mutate(key_ab =
if_else(gramstain == "Gram positive",
if_else(gramstain == "Gram-positive",
apply(X = x[, gram_positive],
MARGIN = 1,
FUN = function(x) paste(x, collapse = "")),
@ -199,7 +199,7 @@ key_antibiotics <- function(x,
# Gram -
x <- x %>% mutate(key_ab =
if_else(gramstain == "Gram negative",
if_else(gramstain == "Gram-negative",
apply(X = x[, gram_negative],
MARGIN = 1,
FUN = function(x) paste(x, collapse = "")),
@ -209,7 +209,8 @@ key_antibiotics <- function(x,
key_abs <- x %>%
pull(key_ab) %>%
gsub('(NA|NULL)', '.', .) %>%
gsub('[^SIR]', '.', ., ignore.case = TRUE)
gsub('[^SIR]', '.', ., ignore.case = TRUE) %>%
toupper()
key_abs
@ -295,7 +296,7 @@ key_antibiotics_equal <- function(y,
result[i] <- points >= points_threshold
} else {
stop('`', type, '` is not a valid value for type, must be "points" or "keyantibiotics". See ?first_isolate.')
stop('`', type, '` is not a valid value for type, must be "points" or "keyantibiotics". See ?key_antibiotics')
}
}
}

View File

@ -253,7 +253,7 @@ stopifnot_installed_package <- function(package) {
# translate strings based on inst/translations.tsv
#' @importFrom dplyr %>% filter
t <- function(from, language = get_locale()) {
translate_AMR <- function(from, language = get_locale(), only_unknown = FALSE) {
# if (getOption("AMR_locale", "en") != language) {
# language <- getOption("AMR_locale", "en")
# }
@ -274,6 +274,9 @@ t <- function(from, language = get_locale()) {
}
df_trans <- df_trans %>% filter(lang == language)
if (only_unknown == TRUE) {
df_trans <- df_trans %>% filter(pattern %like% "unknown")
}
# default case sensitive if value if 'ignore.case' is missing:
df_trans$ignore.case[is.na(df_trans$ignore.case)] <- FALSE

View File

@ -69,8 +69,8 @@
#' mo_shortname("E. coli") # "E. coli"
#'
#' ## other properties
#' mo_gramstain("E. coli") # "Gram negative"
#' mo_type("E. coli") # "Bacteria" (equal to kingdom)
#' mo_gramstain("E. coli") # "Gram-negative"
#' mo_type("E. coli") # "Bacteria" (equal to kingdom, but may be translated)
#' mo_rank("E. coli") # "species"
#' mo_url("E. coli") # get the direct url to the online database entry
#'
@ -84,7 +84,7 @@
#' mo_genus("MRSA") # "Staphylococcus"
#' mo_species("MRSA") # "aureus"
#' mo_shortname("MRSA") # "S. aureus"
#' mo_gramstain("MRSA") # "Gram positive"
#' mo_gramstain("MRSA") # "Gram-positive"
#'
#' mo_genus("VISA") # "Staphylococcus"
#' mo_species("VISA") # "aureus"
@ -133,15 +133,15 @@
#'
#' # get a list with the complete taxonomy (from kingdom to subspecies)
#' mo_taxonomy("E. coli")
#' # get a list with the taxonomy, the authors and the URL to the online database
#' mo_info("E. coli")
mo_name <- function(x, language = get_locale(), ...) {
mo_fullname(x = x, language = language, ... = ...)
translate_AMR(mo_validate(x = x, property = "fullname", ...), language = language, only_unknown = FALSE)
}
#' @rdname mo_property
#' @export
mo_fullname <- function(x, language = get_locale(), ...) {
t(mo_validate(x = x, property = "fullname", ...), language = language)
}
mo_fullname <- mo_name
#' @rdname mo_property
#' @importFrom dplyr %>% mutate pull
@ -184,70 +184,61 @@ mo_shortname <- function(x, language = get_locale(), ...) {
res1[res1 != res2] <- res2_fullname
result <- as.character(res1)
t(result, language = language)
translate_AMR(result, language = language, only_unknown = FALSE)
}
#' @rdname mo_property
#' @export
mo_subspecies <- function(x, language = get_locale(), ...) {
t(mo_validate(x = x, property = "subspecies", ...), language = language)
translate_AMR(mo_validate(x = x, property = "subspecies", ...), language = language, only_unknown = TRUE)
}
#' @rdname mo_property
#' @export
mo_species <- function(x, language = get_locale(), ...) {
t(mo_validate(x = x, property = "species", ...), language = language)
translate_AMR(mo_validate(x = x, property = "species", ...), language = language, only_unknown = TRUE)
}
#' @rdname mo_property
#' @export
mo_genus <- function(x, language = get_locale(), ...) {
t(mo_validate(x = x, property = "genus", ...), language = language)
translate_AMR(mo_validate(x = x, property = "genus", ...), language = language, only_unknown = TRUE)
}
#' @rdname mo_property
#' @export
mo_family <- function(x, language = get_locale(), ...) {
t(mo_validate(x = x, property = "family", ...), language = language)
translate_AMR(mo_validate(x = x, property = "family", ...), language = language, only_unknown = TRUE)
}
#' @rdname mo_property
#' @export
mo_order <- function(x, language = get_locale(), ...) {
t(mo_validate(x = x, property = "order", ...), language = language)
translate_AMR(mo_validate(x = x, property = "order", ...), language = language, only_unknown = TRUE)
}
#' @rdname mo_property
#' @export
mo_class <- function(x, language = get_locale(), ...) {
t(mo_validate(x = x, property = "class", ...), language = language)
translate_AMR(mo_validate(x = x, property = "class", ...), language = language, only_unknown = TRUE)
}
#' @rdname mo_property
#' @export
mo_phylum <- function(x, language = get_locale(), ...) {
t(mo_validate(x = x, property = "phylum", ...), language = language)
translate_AMR(mo_validate(x = x, property = "phylum", ...), language = language, only_unknown = TRUE)
}
#' @rdname mo_property
#' @export
mo_kingdom <- function(x, language = get_locale(), ...) {
if (all(x %in% AMR::microorganisms$kingdom)) {
return(x)
}
x <- as.mo(x, ...)
kngdm <- mo_validate(x = x, property = "kingdom", ...)
if (language != "en") {
# translate only unknown, so "Bacteria" (the official taxonomic name) would not change
kngdm[identical(x, "UNKNOWN")] <- t(kngdm[identical(x, "UNKNOWN")], language = language)
}
kngdm
translate_AMR(mo_validate(x = x, property = "kingdom", ...), language = language, only_unknown = TRUE)
}
#' @rdname mo_property
#' @export
mo_type <- function(x, language = get_locale(), ...) {
t(mo_validate(x = x, property = "kingdom", ...), language = language)
translate_AMR(mo_validate(x = x, property = "kingdom", ...), language = language, only_unknown = FALSE)
}
#' @rdname mo_property
@ -255,16 +246,26 @@ mo_type <- function(x, language = get_locale(), ...) {
mo_gramstain <- function(x, language = get_locale(), ...) {
x.mo <- as.mo(x, ...)
x.phylum <- mo_phylum(x.mo, language = "en")
# DETERMINE GRAM STAIN FOR BACTERIA
# Source: https://itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=956097
# It says this:
# Kingdom Bacteria (Cavalier-Smith, 2002)
# Subkingdom Posibacteria (Cavalier-Smith, 2002)
# Direct Children:
# Phylum Actinobacteria (Cavalier-Smith, 2002)
# Phylum Chloroflexi (Garrity and Holt, 2002)
# Phylum Firmicutes (corrig. Gibbons and Murray, 1978)
# Phylum Tenericutes (Murray, 1984)
x <- NA_character_
# make all bacteria Gram negative
x[mo_kingdom(x.mo, language = "en") == "Bacteria"] <- "Gram-negative"
# overwrite these phyla with Gram positive
x[x.phylum %in% c("Actinobacteria",
"Chloroflexi",
"Firmicutes",
"Tenericutes")] <- "Gram positive"
x[x != "Gram positive"] <- "Gram negative"
x[mo_kingdom(x.mo, language = "en") != "Bacteria"] <- NA_character_
x[x.mo == "B_GRAMP"] <- "Gram positive"
x[x.mo == "B_GRAMN"] <- "Gram negative"
t(x, language = language)
"Tenericutes")
| x.mo == "B_GRAMP"] <- "Gram-positive"
translate_AMR(x, language = language, only_unknown = FALSE)
}
#' @rdname mo_property
@ -311,6 +312,15 @@ mo_taxonomy <- function(x, language = get_locale(), ...) {
subspecies = mo_subspecies(x, language = language))
}
#' @rdname mo_property
#' @export
mo_info <- function(x, language = get_locale(), ...) {
x <- AMR::as.mo(x, ...)
c(mo_taxonomy(x, language = language),
list(url = unname(mo_url(x, open = FALSE)),
ref = mo_ref(x)))
}
#' @rdname mo_property
#' @importFrom utils browseURL
#' @importFrom dplyr %>% left_join select mutate case_when
@ -349,7 +359,7 @@ mo_property <- function(x, property = 'fullname', language = get_locale(), ...)
stop("invalid property: '", property, "' - use a column name of the `microorganisms` data set")
}
t(mo_validate(x = x, property = property, ...), language = language)
translate_AMR(mo_validate(x = x, property = property, ...), language = language, only_unknown = TRUE)
}
mo_validate <- function(x, property, ...) {

Binary file not shown.

View File

@ -59,12 +59,12 @@ genus_species is Moraxella catarrhalis ERY S AZM, CLR, RXT S Moraxella catarrhal
genus_species is Moraxella catarrhalis ERY I AZM, CLR, RXT I Moraxella catarrhalis Breakpoints
genus_species is Moraxella catarrhalis ERY R AZM, CLR, RXT R Moraxella catarrhalis Breakpoints
genus_species is Moraxella catarrhalis TCY S DOX, MNO S Moraxella catarrhalis Breakpoints
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN S AMP, AMX, PIP, TZP, TIC S Anaerobic Gram positives Breakpoints
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN I AMP, AMX, PIP, TZP, TIC I Anaerobic Gram positives Breakpoints
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN R AMP, AMX, PIP, TZP, TIC R Anaerobic Gram positives Breakpoints
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN S AMP, AMX, PIP, TZP, TIC S Anaerobic Gram negatives Breakpoints
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN I AMP, AMX, PIP, TZP, TIC I Anaerobic Gram negatives Breakpoints
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN R AMP, AMX, PIP, TZP, TIC R Anaerobic Gram negatives Breakpoints
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN S AMP, AMX, PIP, TZP, TIC S Anaerobic Gram-positives Breakpoints
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN I AMP, AMX, PIP, TZP, TIC I Anaerobic Gram-positives Breakpoints
genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN R AMP, AMX, PIP, TZP, TIC R Anaerobic Gram-positives Breakpoints
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN S AMP, AMX, PIP, TZP, TIC S Anaerobic Gram-negatives Breakpoints
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN I AMP, AMX, PIP, TZP, TIC I Anaerobic Gram-negatives Breakpoints
genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN R AMP, AMX, PIP, TZP, TIC R Anaerobic Gram-negatives Breakpoints
genus_species is Pasteurella multocida PEN S AMP, AMX S Pasteurella multocida Breakpoints
genus_species is Pasteurella multocida PEN I AMP, AMX I Pasteurella multocida Breakpoints
genus_species is Pasteurella multocida PEN R AMP, AMX R Pasteurella multocida Breakpoints
@ -135,7 +135,7 @@ genus is Neisseria TMP R Table 03: Intrinsic resistance in other Gram-negative
genus_species is Campylobacter fetus FUS, streptogramins, TMP, NAL R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
genus_species is Campylobacter jejuni FUS, streptogramins, TMP R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
genus_species is Campylobacter coli FUS, streptogramins, TMP R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
gramstain is Gram positive ATM, polymyxins, NAL R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
gramstain is Gram-positive ATM, polymyxins, NAL R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Staphylococcus saprophyticus FUS, CAZ, FOS, NOV R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Staphylococcus cohnii CAZ, NOV R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
genus_species is Staphylococcus xylosus CAZ, NOV R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules

1 if_mo_property like_is_one_of this_value and_these_antibiotics have_these_values then_change_these_antibiotics to_value reference.rule reference.rule_group
59 genus_species is Moraxella catarrhalis ERY I AZM, CLR, RXT I Moraxella catarrhalis Breakpoints
60 genus_species is Moraxella catarrhalis ERY R AZM, CLR, RXT R Moraxella catarrhalis Breakpoints
61 genus_species is Moraxella catarrhalis TCY S DOX, MNO S Moraxella catarrhalis Breakpoints
62 genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN S AMP, AMX, PIP, TZP, TIC S Anaerobic Gram positives Anaerobic Gram-positives Breakpoints
63 genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN I AMP, AMX, PIP, TZP, TIC I Anaerobic Gram positives Anaerobic Gram-positives Breakpoints
64 genus one_of Actinomyces, Bifidobacterium, Clostridium, Cutibacterium, Eggerthella, Eubacterium, Lactobacillus, Propionibacterium PEN R AMP, AMX, PIP, TZP, TIC R Anaerobic Gram positives Anaerobic Gram-positives Breakpoints
65 genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN S AMP, AMX, PIP, TZP, TIC S Anaerobic Gram negatives Anaerobic Gram-negatives Breakpoints
66 genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN I AMP, AMX, PIP, TZP, TIC I Anaerobic Gram negatives Anaerobic Gram-negatives Breakpoints
67 genus one_of Bacteroides, Bilophila , Fusobacterium, Mobiluncus, Porphyromonas, Prevotella PEN R AMP, AMX, PIP, TZP, TIC R Anaerobic Gram negatives Anaerobic Gram-negatives Breakpoints
68 genus_species is Pasteurella multocida PEN S AMP, AMX S Pasteurella multocida Breakpoints
69 genus_species is Pasteurella multocida PEN I AMP, AMX I Pasteurella multocida Breakpoints
70 genus_species is Pasteurella multocida PEN R AMP, AMX R Pasteurella multocida Breakpoints
135 genus_species is Campylobacter fetus FUS, streptogramins, TMP, NAL R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
136 genus_species is Campylobacter jejuni FUS, streptogramins, TMP R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
137 genus_species is Campylobacter coli FUS, streptogramins, TMP R Table 03: Intrinsic resistance in other Gram-negative bacteria Expert Rules
138 gramstain is Gram positive Gram-positive ATM, polymyxins, NAL R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
139 genus_species is Staphylococcus saprophyticus FUS, CAZ, FOS, NOV R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
140 genus_species is Staphylococcus cohnii CAZ, NOV R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules
141 genus_species is Staphylococcus xylosus CAZ, NOV R Table 04: Intrinsic resistance in Gram-positive bacteria Expert Rules

View File

@ -5,8 +5,8 @@
# "minopenicillins", "ureidopenicillins", "fluoroquinolones", "all_betalactams",
# and all separate EARS-Net letter codes like "AMC". They can be separated by comma: "AMC, fluoroquinolones".
# The mo_property can be any column name from the AMR::microorganisms data set, or "genus_species" or "gramstain".
# This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in:
# LiPuma JJ, 2015 (PMID 16217180).
# The EUCAST guideline contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in:
# LiPuma JJ, Curr Opin Pulm Med. 2005 Nov;11(6):528-33. (PMID 16217180).
eucast_rules_file <- dplyr::arrange(
.data = utils::read.delim(file = "data-raw/eucast_rules.tsv",
sep = "\t",

View File

@ -289,6 +289,9 @@ antibiotics <- filter(antibiotics, ab != "MOX")
antibiotics <- filter(antibiotics, ab != "RFP")
antibiotics[which(antibiotics$ab == "RFP1"), "ab"] <- "RFP"
antibiotics[which(antibiotics$ab == "RFP"), "abbreviations"][[1]] <- list(c("rifp"))
# PME and PVM1 (the J0 one) both mean 'Pivmecillinam', so:
antibiotics <- filter(antibiotics, ab != "PME")
antibiotics[which(antibiotics$ab == "PVM1"), "ab"] <- "PME"
# ESBL E-test codes:
antibiotics[which(antibiotics$ab == "CCV"), "abbreviations"][[1]] <- list(c("xtzl"))
antibiotics[which(antibiotics$ab == "CAZ"), "abbreviations"][[1]] <- list(c(antibiotics[which(antibiotics$ab == "CAZ"), "abbreviations"][[1]], "xtz", "cefta"))

View File

@ -318,13 +318,13 @@ MOs <- MOs %>%
stringsAsFactors = FALSE),
data.frame(mo = "B_GRAMN",
col_id = NA_integer_,
fullname = "(unknown Gram negatives)",
fullname = "(unknown Gram-negatives)",
kingdom = "Bacteria",
phylum = "(unknown phylum)",
class = "(unknown class)",
order = "(unknown order)",
family = "(unknown family)",
genus = "(unknown Gram negatives)",
genus = "(unknown Gram-negatives)",
species = "(unknown species)",
subspecies = "(unknown subspecies)",
rank = "species",
@ -334,13 +334,13 @@ MOs <- MOs %>%
stringsAsFactors = FALSE),
data.frame(mo = "B_GRAMP",
col_id = NA_integer_,
fullname = "(unknown Gram positives)",
fullname = "(unknown Gram-positives)",
kingdom = "Bacteria",
phylum = "(unknown phylum)",
class = "(unknown class)",
order = "(unknown order)",
family = "(unknown family)",
genus = "(unknown Gram positives)",
genus = "(unknown Gram-positives)",
species = "(unknown species)",
subspecies = "(unknown subspecies)",
rank = "species",
@ -457,7 +457,7 @@ MOs <- MOs %>%
mutate(prevalence = case_when(
class == "Gammaproteobacteria"
| genus %in% c("Enterococcus", "Staphylococcus", "Streptococcus")
| mo == "UNKNOWN"
| mo %in% c("UNKNOWN", "B_GRAMN", "B_GRAMP")
~ 1,
phylum %in% c("Proteobacteria",
"Firmicutes",
@ -494,8 +494,8 @@ saveRDS(MOs, "microorganisms.rds")
saveRDS(MOs.old, "microorganisms.old.rds")
# on the server:
usethis::use_data(microorganisms, overwrite = TRUE)
usethis::use_data(microorganisms.old, overwrite = TRUE)
usethis::use_data(microorganisms, overwrite = TRUE, version = 2)
usethis::use_data(microorganisms.old, overwrite = TRUE, version = 2)
rm(microorganisms)
rm(microorganisms.old)
# and update the year in R/data.R

View File

@ -2,8 +2,8 @@ lang pattern replacement fixed ignore.case
de Coagulase-negative Staphylococcus Koagulase-negative Staphylococcus FALSE FALSE
de Coagulase-positive Staphylococcus Koagulase-positive Staphylococcus FALSE FALSE
de Beta-haemolytic Streptococcus Beta-hämolytischer Streptococcus FALSE FALSE
de unknown Gram negatives unbekannte Gramnegativen FALSE FALSE
de unknown Gram positives unbekannte Grampositiven FALSE FALSE
de unknown Gram-negatives unbekannte Gramnegativen FALSE FALSE
de unknown Gram-positives unbekannte Grampositiven FALSE FALSE
de unknown name unbekannte Name FALSE FALSE
de unknown kingdom unbekanntes Reich FALSE FALSE
de unknown phylum unbekannter Stamm FALSE FALSE
@ -16,8 +16,8 @@ de unknown subspecies unbekannte Unterart FALSE FALSE
de unknown rank unbekannter Rang FALSE FALSE
de (CoNS) (KNS) TRUE FALSE
de (CoPS) (KPS) TRUE FALSE
de Gram negative Gramnegativ FALSE FALSE
de Gram positive Grampositiv FALSE FALSE
de Gram-negative Gramnegativ FALSE FALSE
de Gram-positive Grampositiv FALSE FALSE
de Bacteria Bakterien FALSE FALSE
de Fungi Hefen/Pilze FALSE FALSE
de Protozoa Protozoen FALSE FALSE
@ -29,8 +29,8 @@ de ([([ ]*?)Group \\1Gruppe FALSE FALSE
nl Coagulase-negative Staphylococcus Coagulase-negatieve Staphylococcus FALSE FALSE
nl Coagulase-positive Staphylococcus Coagulase-positieve Staphylococcus FALSE FALSE
nl Beta-haemolytic Streptococcus Beta-hemolytische Streptococcus FALSE FALSE
nl unknown Gram negatives onbekende Gram-negatieven FALSE FALSE
nl unknown Gram positives onbekende Gram-positieven FALSE FALSE
nl unknown Gram-negatives onbekende Gram-negatieven FALSE FALSE
nl unknown Gram-positives onbekende Gram-positieven FALSE FALSE
nl unknown name onbekende naam FALSE FALSE
nl unknown kingdom onbekend koninkrijk FALSE FALSE
nl unknown phylum onbekend fylum FALSE FALSE
@ -43,8 +43,8 @@ nl unknown subspecies onbekende ondersoort FALSE FALSE
nl unknown rank onbekende rang FALSE FALSE
nl (CoNS) (CNS) TRUE FALSE
nl (CoPS) (CPS) TRUE FALSE
nl Gram negative Gram-negatief FALSE FALSE
nl Gram positive Gram-positief FALSE FALSE
nl Gram-negative Gram-negatief FALSE FALSE
nl Gram-positive Gram-positief FALSE FALSE
nl Bacteria Bacteriën FALSE FALSE
nl Fungi Schimmels/gisten FALSE FALSE
nl Protozoa protozoën FALSE FALSE
@ -55,8 +55,8 @@ nl ([([ ]*?)Group \\1Groep FALSE FALSE
es Coagulase-negative Staphylococcus Staphylococcus coagulasa negativo FALSE FALSE
es Coagulase-positive Staphylococcus Staphylococcus coagulasa positivo FALSE FALSE
es Beta-haemolytic Streptococcus Streptococcus Beta-hemolítico FALSE FALSE
es unknown Gram negatives Gram negativos desconocidos FALSE FALSE
es unknown Gram positives Gram positivos desconocidos FALSE FALSE
es unknown Gram-negatives Gram negativos desconocidos FALSE FALSE
es unknown Gram-positives Gram positivos desconocidos FALSE FALSE
es unknown name nombre desconocido FALSE FALSE
es unknown kingdom reino desconocido FALSE FALSE
es unknown phylum filo desconocido FALSE FALSE
@ -69,8 +69,8 @@ es unknown subspecies subespecie desconocida FALSE FALSE
es unknown rank rango desconocido FALSE FALSE
es (CoNS) (SCN) TRUE FALSE
es (CoPS) (SCP) TRUE FALSE
es Gram negative Gram negativo FALSE FALSE
es Gram positive Gram positivo FALSE FALSE
es Gram-negative Gram negativo FALSE FALSE
es Gram-positive Gram positivo FALSE FALSE
es Bacteria Bacterias FALSE FALSE
es Fungi Hongos FALSE FALSE
es Protozoa Protozoarios FALSE FALSE
@ -82,8 +82,8 @@ es ([([ ]*?)Group \\1Grupo FALSE FALSE
it Coagulase-negative Staphylococcus Staphylococcus negativo coagulasi FALSE FALSE
it Coagulase-positive Staphylococcus Staphylococcus positivo coagulasi FALSE FALSE
it Beta-haemolytic Streptococcus Streptococcus Beta-emolitico FALSE FALSE
it unknown Gram negatives Gram negativi sconosciuti FALSE FALSE
it unknown Gram positives Gram positivi sconosciuti FALSE FALSE
it unknown Gram-negatives Gram negativi sconosciuti FALSE FALSE
it unknown Gram-positives Gram positivi sconosciuti FALSE FALSE
it unknown name nome sconosciuto FALSE FALSE
it unknown kingdom regno sconosciuto FALSE FALSE
it unknown phylum phylum sconosciuto FALSE FALSE
@ -94,8 +94,8 @@ it unknown genus genere sconosciuto FALSE FALSE
it unknown species specie sconosciute FALSE FALSE
it unknown subspecies sottospecie sconosciute FALSE FALSE
it unknown rank grado sconosciuto FALSE FALSE
it Gram negative Gram negativo FALSE FALSE
it Gram positive Gram positivo FALSE FALSE
it Gram-negative Gram negativo FALSE FALSE
it Gram-positive Gram positivo FALSE FALSE
it Bacteria Batteri FALSE FALSE
it Fungi Fungo FALSE FALSE
it Protozoa Protozoi FALSE FALSE
@ -107,8 +107,8 @@ it ([([ ]*?)Group \\1Gruppo FALSE FALSE
fr Coagulase-negative Staphylococcus Staphylococcus à coagulase négative FALSE FALSE
fr Coagulase-positive Staphylococcus Staphylococcus à coagulase positif FALSE FALSE
fr Beta-haemolytic Streptococcus Streptococcus Bêta-hémolytique FALSE FALSE
fr unknown Gram negatives Gram négatifs inconnus FALSE FALSE
fr unknown Gram positives Gram positifs inconnus FALSE FALSE
fr unknown Gram-negatives Gram négatifs inconnus FALSE FALSE
fr unknown Gram-positives Gram positifs inconnus FALSE FALSE
fr unknown name nom inconnu FALSE FALSE
fr unknown kingdom règme inconnu FALSE FALSE
fr unknown phylum embranchement inconnu FALSE FALSE
@ -119,8 +119,8 @@ fr unknown genus genre inconnu FALSE FALSE
fr unknown species espèce inconnue FALSE FALSE
fr unknown subspecies sous-espèce inconnue FALSE FALSE
fr unknown rank rang inconnu FALSE FALSE
fr Gram negative Gram négatif FALSE FALSE
fr Gram positive Gram positif FALSE FALSE
fr Gram-negative Gram négatif FALSE FALSE
fr Gram-positive Gram positif FALSE FALSE
fr Bacteria Bactéries FALSE FALSE
fr Fungi Champignons FALSE FALSE
fr Protozoa Protozoaires FALSE FALSE
@ -131,8 +131,8 @@ fr ([([ ]*?)Group \\1Groupe FALSE FALSE
pt Coagulase-negative Staphylococcus Staphylococcus coagulase negativo FALSE FALSE
pt Coagulase-positive Staphylococcus Staphylococcus coagulase positivo FALSE FALSE
pt Beta-haemolytic Streptococcus Streptococcus Beta-hemolítico FALSE FALSE
pt unknown Gram negatives Gram negativos desconhecidos FALSE FALSE
pt unknown Gram positives Gram positivos desconhecidos FALSE FALSE
pt unknown Gram-negatives Gram negativos desconhecidos FALSE FALSE
pt unknown Gram-positives Gram positivos desconhecidos FALSE FALSE
pt unknown name nome desconhecido FALSE FALSE
pt unknown kingdom reino desconhecido FALSE FALSE
pt unknown phylum filo desconhecido FALSE FALSE
@ -143,8 +143,8 @@ pt unknown genus gênero desconhecido FALSE FALSE
pt unknown species espécies desconhecida FALSE FALSE
pt unknown subspecies subespécies desconhecida FALSE FALSE
pt unknown rank classificação desconhecido FALSE FALSE
pt Gram negative Gram negativo FALSE FALSE
pt Gram positive Gram positivo FALSE FALSE
pt Gram-negative Gram negativo FALSE FALSE
pt Gram-positive Gram positivo FALSE FALSE
pt Bacteria Bactérias FALSE FALSE
pt Fungi Fungos FALSE FALSE
pt Protozoa Protozoários FALSE FALSE

1 lang pattern replacement fixed ignore.case
2 de Coagulase-negative Staphylococcus Koagulase-negative Staphylococcus FALSE FALSE
3 de Coagulase-positive Staphylococcus Koagulase-positive Staphylococcus FALSE FALSE
4 de Beta-haemolytic Streptococcus Beta-hämolytischer Streptococcus FALSE FALSE
5 de unknown Gram negatives unknown Gram-negatives unbekannte Gramnegativen FALSE FALSE
6 de unknown Gram positives unknown Gram-positives unbekannte Grampositiven FALSE FALSE
7 de unknown name unbekannte Name FALSE FALSE
8 de unknown kingdom unbekanntes Reich FALSE FALSE
9 de unknown phylum unbekannter Stamm FALSE FALSE
16 de unknown rank unbekannter Rang FALSE FALSE
17 de (CoNS) (KNS) TRUE FALSE
18 de (CoPS) (KPS) TRUE FALSE
19 de Gram negative Gram-negative Gramnegativ FALSE FALSE
20 de Gram positive Gram-positive Grampositiv FALSE FALSE
21 de Bacteria Bakterien FALSE FALSE
22 de Fungi Hefen/Pilze FALSE FALSE
23 de Protozoa Protozoen FALSE FALSE
29 nl Coagulase-negative Staphylococcus Coagulase-negatieve Staphylococcus FALSE FALSE
30 nl Coagulase-positive Staphylococcus Coagulase-positieve Staphylococcus FALSE FALSE
31 nl Beta-haemolytic Streptococcus Beta-hemolytische Streptococcus FALSE FALSE
32 nl unknown Gram negatives unknown Gram-negatives onbekende Gram-negatieven FALSE FALSE
33 nl unknown Gram positives unknown Gram-positives onbekende Gram-positieven FALSE FALSE
34 nl unknown name onbekende naam FALSE FALSE
35 nl unknown kingdom onbekend koninkrijk FALSE FALSE
36 nl unknown phylum onbekend fylum FALSE FALSE
43 nl unknown rank onbekende rang FALSE FALSE
44 nl (CoNS) (CNS) TRUE FALSE
45 nl (CoPS) (CPS) TRUE FALSE
46 nl Gram negative Gram-negative Gram-negatief FALSE FALSE
47 nl Gram positive Gram-positive Gram-positief FALSE FALSE
48 nl Bacteria Bacteriën FALSE FALSE
49 nl Fungi Schimmels/gisten FALSE FALSE
50 nl Protozoa protozoën FALSE FALSE
55 es Coagulase-negative Staphylococcus Staphylococcus coagulasa negativo FALSE FALSE
56 es Coagulase-positive Staphylococcus Staphylococcus coagulasa positivo FALSE FALSE
57 es Beta-haemolytic Streptococcus Streptococcus Beta-hemolítico FALSE FALSE
58 es unknown Gram negatives unknown Gram-negatives Gram negativos desconocidos FALSE FALSE
59 es unknown Gram positives unknown Gram-positives Gram positivos desconocidos FALSE FALSE
60 es unknown name nombre desconocido FALSE FALSE
61 es unknown kingdom reino desconocido FALSE FALSE
62 es unknown phylum filo desconocido FALSE FALSE
69 es unknown rank rango desconocido FALSE FALSE
70 es (CoNS) (SCN) TRUE FALSE
71 es (CoPS) (SCP) TRUE FALSE
72 es Gram negative Gram-negative Gram negativo FALSE FALSE
73 es Gram positive Gram-positive Gram positivo FALSE FALSE
74 es Bacteria Bacterias FALSE FALSE
75 es Fungi Hongos FALSE FALSE
76 es Protozoa Protozoarios FALSE FALSE
82 it Coagulase-negative Staphylococcus Staphylococcus negativo coagulasi FALSE FALSE
83 it Coagulase-positive Staphylococcus Staphylococcus positivo coagulasi FALSE FALSE
84 it Beta-haemolytic Streptococcus Streptococcus Beta-emolitico FALSE FALSE
85 it unknown Gram negatives unknown Gram-negatives Gram negativi sconosciuti FALSE FALSE
86 it unknown Gram positives unknown Gram-positives Gram positivi sconosciuti FALSE FALSE
87 it unknown name nome sconosciuto FALSE FALSE
88 it unknown kingdom regno sconosciuto FALSE FALSE
89 it unknown phylum phylum sconosciuto FALSE FALSE
94 it unknown species specie sconosciute FALSE FALSE
95 it unknown subspecies sottospecie sconosciute FALSE FALSE
96 it unknown rank grado sconosciuto FALSE FALSE
97 it Gram negative Gram-negative Gram negativo FALSE FALSE
98 it Gram positive Gram-positive Gram positivo FALSE FALSE
99 it Bacteria Batteri FALSE FALSE
100 it Fungi Fungo FALSE FALSE
101 it Protozoa Protozoi FALSE FALSE
107 fr Coagulase-negative Staphylococcus Staphylococcus à coagulase négative FALSE FALSE
108 fr Coagulase-positive Staphylococcus Staphylococcus à coagulase positif FALSE FALSE
109 fr Beta-haemolytic Streptococcus Streptococcus Bêta-hémolytique FALSE FALSE
110 fr unknown Gram negatives unknown Gram-negatives Gram négatifs inconnus FALSE FALSE
111 fr unknown Gram positives unknown Gram-positives Gram positifs inconnus FALSE FALSE
112 fr unknown name nom inconnu FALSE FALSE
113 fr unknown kingdom règme inconnu FALSE FALSE
114 fr unknown phylum embranchement inconnu FALSE FALSE
119 fr unknown species espèce inconnue FALSE FALSE
120 fr unknown subspecies sous-espèce inconnue FALSE FALSE
121 fr unknown rank rang inconnu FALSE FALSE
122 fr Gram negative Gram-negative Gram négatif FALSE FALSE
123 fr Gram positive Gram-positive Gram positif FALSE FALSE
124 fr Bacteria Bactéries FALSE FALSE
125 fr Fungi Champignons FALSE FALSE
126 fr Protozoa Protozoaires FALSE FALSE
131 pt Coagulase-negative Staphylococcus Staphylococcus coagulase negativo FALSE FALSE
132 pt Coagulase-positive Staphylococcus Staphylococcus coagulase positivo FALSE FALSE
133 pt Beta-haemolytic Streptococcus Streptococcus Beta-hemolítico FALSE FALSE
134 pt unknown Gram negatives unknown Gram-negatives Gram negativos desconhecidos FALSE FALSE
135 pt unknown Gram positives unknown Gram-positives Gram positivos desconhecidos FALSE FALSE
136 pt unknown name nome desconhecido FALSE FALSE
137 pt unknown kingdom reino desconhecido FALSE FALSE
138 pt unknown phylum filo desconhecido FALSE FALSE
143 pt unknown species espécies desconhecida FALSE FALSE
144 pt unknown subspecies subespécies desconhecida FALSE FALSE
145 pt unknown rank classificação desconhecido FALSE FALSE
146 pt Gram negative Gram-negative Gram negativo FALSE FALSE
147 pt Gram positive Gram-positive Gram positivo FALSE FALSE
148 pt Bacteria Bactérias FALSE FALSE
149 pt Fungi Fungos FALSE FALSE
150 pt Protozoa Protozoários FALSE FALSE

Binary file not shown.

Binary file not shown.

View File

@ -78,7 +78,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9004</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>

View File

@ -78,7 +78,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9004</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>

View File

@ -78,7 +78,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9004</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>

View File

@ -42,7 +42,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9004</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>

View File

@ -78,7 +78,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9004</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>
@ -232,9 +232,9 @@
</div>
<div id="amr-0709004" class="section level1">
<div id="amr-0709005" class="section level1">
<h1 class="page-header">
<a href="#amr-0709004" class="anchor"></a>AMR 0.7.0.9004<small> Unreleased </small>
<a href="#amr-0709005" class="anchor"></a>AMR 0.7.0.9005<small> Unreleased </small>
</h1>
<div id="new" class="section level4">
<h4 class="hasAnchor">
@ -247,6 +247,7 @@
<a class="sourceLine" id="cb1-3" title="3"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"UPEC"</span>)</a>
<a class="sourceLine" id="cb1-4" title="4"><span class="co"># "Escherichia coli"</span></a></code></pre></div>
</li>
<li><p>Function <code><a href="../reference/mo_property.html">mo_info()</a></code> as an analogy to <code><a href="../reference/ab_property.html">ab_info()</a></code>. The <code><a href="../reference/mo_property.html">mo_info()</a></code> prints a list with the full taxonomy, authors, and the URL to the online database of a microorganism</p></li>
</ul>
</div>
<div id="changed" class="section level4">
@ -256,6 +257,7 @@
<li>Fixed bug in translation of microorganism names</li>
<li>Fixed bug in determining taxonomic kingdoms</li>
<li>Algorithm improvements for <code><a href="../reference/as.ab.html">as.ab()</a></code> and <code><a href="../reference/as.mo.html">as.mo()</a></code> to understand even more severely misspelled input</li>
<li>Function <code><a href="../reference/as.ab.html">as.ab()</a></code> now allows spaces for coercing antibiotics names</li>
<li>Added <code>ggplot2</code> methods for automatically determining the scale type of classes <code>mo</code> and <code>ab</code>
</li>
<li>Added names of object in the header in frequency tables, even when using pipes</li>
@ -263,6 +265,9 @@
<li>Fixed a bug where setting an antibiotic would not work for <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> and <code><a href="../reference/mdro.html">mdro()</a></code>
</li>
<li>Fixed a EUCAST rule for Staphylococci, where amikacin resistance would not be inferred from tobramycin</li>
<li>Removed <code>latest_annual_release</code> from the <code><a href="../reference/catalogue_of_life_version.html">catalogue_of_life_version()</a></code> function</li>
<li>Removed antibiotic code <code>PVM1</code> from the <code>antibiotics</code> data set as this was a duplicate of <code>PME</code>
</li>
</ul>
</div>
<div id="other" class="section level4">
@ -1101,7 +1106,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<div id="tocnav">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#amr-0709004">0.7.0.9004</a></li>
<li><a href="#amr-0709005">0.7.0.9005</a></li>
<li><a href="#amr-070">0.7.0</a></li>
<li><a href="#amr-061">0.6.1</a></li>
<li><a href="#amr-060">0.6.0</a></li>

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.7.0.9000</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>
@ -165,13 +165,6 @@
Create frequency tables
</a>
</li>
<li>
<a href="../reference/g.test.html">
<span class="fa fa-clipboard-check"></span>
Use the G-test
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -252,7 +245,7 @@
<h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2>
<p>A <code><a href='https://www.rdocumentation.org/packages/base/topics/data.frame'>data.frame</a></code> with 454 observations and 13 variables:</p><dl class='dl-horizontal'>
<p>A <code><a href='https://www.rdocumentation.org/packages/base/topics/data.frame'>data.frame</a></code> with 453 observations and 13 variables:</p><dl class='dl-horizontal'>
<dt><code>ab</code></dt><dd><p>Antibiotic ID as used in this package (like <code>AMC</code>), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available</p></dd>
<dt><code>atc</code></dt><dd><p>ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like <code>J01CR02</code></p></dd>
<dt><code>cid</code></dt><dd><p>Compound ID as found in PubChem</p></dd>

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.7.0.9000</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>
@ -165,13 +165,6 @@
Create frequency tables
</a>
</li>
<li>
<a href="../reference/g.test.html">
<span class="fa fa-clipboard-check"></span>
Use the G-test
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -307,9 +300,9 @@ Function <code><a href='as.mo.html'>as.mo</a>()</code> to use the data for intel
<span class='co'># [1] "Castellani et al., 1919"</span>
<span class='co'># Do not get mistaken - the package only includes microorganisms</span>
<span class='fu'><a href='mo_property.html'>mo_phylum</a></span>(<span class='st'>"C. elegans"</span>)
<span class='co'># [1] "Cyanobacteria" # Bacteria?!</span>
<span class='fu'><a href='mo_property.html'>mo_fullname</a></span>(<span class='st'>"C. elegans"</span>)
<span class='fu'><a href='mo_property.html'>mo_kingdom</a></span>(<span class='st'>"C. elegans"</span>)
<span class='co'># [1] "Bacteria" # Bacteria?!</span>
<span class='fu'><a href='mo_property.html'>mo_name</a></span>(<span class='st'>"C. elegans"</span>)
<span class='co'># [1] "Chroococcus limneticus elegans" # Because a microorganism was found</span>
<span class='co'># }</span></pre>
</div>

View File

@ -47,7 +47,7 @@
<script src="../extra.js"></script>
<meta property="og:title" content="Version info of included Catalogue of Life — catalogue_of_life_version" />
<meta property="og:description" content="This function returns information about the included data from the Catalogue of Life. It also shows if the included version is their latest annual release. The Catalogue of Life releases their annual release in March each year." />
<meta property="og:description" content="This function returns information about the included data from the Catalogue of Life." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" />
@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.7.0.9000</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>
@ -165,13 +165,6 @@
Create frequency tables
</a>
</li>
<li>
<a href="../reference/g.test.html">
<span class="fa fa-clipboard-check"></span>
Use the G-test
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -244,7 +237,7 @@
<div class="ref-description">
<p>This function returns information about the included data from the Catalogue of Life. It also shows if the included version is their latest annual release. The Catalogue of Life releases their annual release in March each year.</p>
<p>This function returns information about the included data from the Catalogue of Life.</p>
</div>
@ -256,8 +249,7 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The list item <code>...$catalogue_of_life$is_latest_annual_release</code> is based on the system date.</p>
<p>For DSMZ, see <code><a href='microorganisms.html'>?microorganisms</a></code>.</p>
<p>For DSMZ, see <code><a href='microorganisms.html'>?microorganisms</a></code>.</p>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>

View File

@ -78,7 +78,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9004</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>
@ -373,7 +373,7 @@
</tr><tr>
<td>
<p><code><a href="mo_property.html">mo_name()</a></code> <code><a href="mo_property.html">mo_fullname()</a></code> <code><a href="mo_property.html">mo_shortname()</a></code> <code><a href="mo_property.html">mo_subspecies()</a></code> <code><a href="mo_property.html">mo_species()</a></code> <code><a href="mo_property.html">mo_genus()</a></code> <code><a href="mo_property.html">mo_family()</a></code> <code><a href="mo_property.html">mo_order()</a></code> <code><a href="mo_property.html">mo_class()</a></code> <code><a href="mo_property.html">mo_phylum()</a></code> <code><a href="mo_property.html">mo_kingdom()</a></code> <code><a href="mo_property.html">mo_type()</a></code> <code><a href="mo_property.html">mo_gramstain()</a></code> <code><a href="mo_property.html">mo_ref()</a></code> <code><a href="mo_property.html">mo_authors()</a></code> <code><a href="mo_property.html">mo_year()</a></code> <code><a href="mo_property.html">mo_rank()</a></code> <code><a href="mo_property.html">mo_taxonomy()</a></code> <code><a href="mo_property.html">mo_url()</a></code> <code><a href="mo_property.html">mo_property()</a></code> </p>
<p><code><a href="mo_property.html">mo_name()</a></code> <code><a href="mo_property.html">mo_fullname()</a></code> <code><a href="mo_property.html">mo_shortname()</a></code> <code><a href="mo_property.html">mo_subspecies()</a></code> <code><a href="mo_property.html">mo_species()</a></code> <code><a href="mo_property.html">mo_genus()</a></code> <code><a href="mo_property.html">mo_family()</a></code> <code><a href="mo_property.html">mo_order()</a></code> <code><a href="mo_property.html">mo_class()</a></code> <code><a href="mo_property.html">mo_phylum()</a></code> <code><a href="mo_property.html">mo_kingdom()</a></code> <code><a href="mo_property.html">mo_type()</a></code> <code><a href="mo_property.html">mo_gramstain()</a></code> <code><a href="mo_property.html">mo_ref()</a></code> <code><a href="mo_property.html">mo_authors()</a></code> <code><a href="mo_property.html">mo_year()</a></code> <code><a href="mo_property.html">mo_rank()</a></code> <code><a href="mo_property.html">mo_taxonomy()</a></code> <code><a href="mo_property.html">mo_info()</a></code> <code><a href="mo_property.html">mo_url()</a></code> <code><a href="mo_property.html">mo_property()</a></code> </p>
</td>
<td><p>Property of a microorganism</p></td>
</tr><tr>

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.7.0.9000</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>
@ -165,13 +165,6 @@
Create frequency tables
</a>
</li>
<li>
<a href="../reference/g.test.html">
<span class="fa fa-clipboard-check"></span>
Use the G-test
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -248,19 +241,22 @@
</div>
<pre class="usage"><span class='fu'>key_antibiotics</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>universal_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"AMX"</span>),
<span class='kw'>universal_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"AMC"</span>), <span class='kw'>universal_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"CXM"</span>), <span class='kw'>universal_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"TZP"</span>),
<span class='kw'>universal_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"CIP"</span>), <span class='kw'>universal_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"SXT"</span>), <span class='kw'>GramPos_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"VAN"</span>),
<span class='kw'>GramPos_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"TEC"</span>), <span class='kw'>GramPos_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"TCY"</span>), <span class='kw'>GramPos_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"ERY"</span>),
<span class='kw'>GramPos_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"OXA"</span>), <span class='kw'>GramPos_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"RIF"</span>), <span class='kw'>GramNeg_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"GEN"</span>),
<span class='kw'>GramNeg_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"TOB"</span>), <span class='kw'>GramNeg_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"COL"</span>), <span class='kw'>GramNeg_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"CTX"</span>),
<span class='kw'>GramNeg_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"CAZ"</span>), <span class='kw'>GramNeg_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"MEM"</span>), <span class='kw'>warnings</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>)
<pre class="usage"><span class='fu'>key_antibiotics</span>(<span class='no'>x</span>, <span class='kw'>col_mo</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>universal_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"amoxicillin"</span>), <span class='kw'>universal_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"amoxicillin/clavulanic acid"</span>), <span class='kw'>universal_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"cefuroxime"</span>), <span class='kw'>universal_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"piperacillin/tazobactam"</span>), <span class='kw'>universal_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"ciprofloxacin"</span>), <span class='kw'>universal_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"trimethoprim/sulfamethoxazole"</span>), <span class='kw'>GramPos_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"vancomycin"</span>), <span class='kw'>GramPos_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"teicoplanin"</span>),
<span class='kw'>GramPos_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"tetracycline"</span>),
<span class='kw'>GramPos_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"erythromycin"</span>),
<span class='kw'>GramPos_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"oxacillin"</span>), <span class='kw'>GramPos_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"rifampin"</span>), <span class='kw'>GramNeg_1</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"gentamicin"</span>),
<span class='kw'>GramNeg_2</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"tobramycin"</span>),
<span class='kw'>GramNeg_3</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"colistin"</span>), <span class='kw'>GramNeg_4</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>,
<span class='st'>"cefotaxime"</span>), <span class='kw'>GramNeg_5</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"ceftazidime"</span>),
<span class='kw'>GramNeg_6</span> <span class='kw'>=</span> <span class='fu'><a href='guess_ab_col.html'>guess_ab_col</a></span>(<span class='no'>x</span>, <span class='st'>"meropenem"</span>), <span class='kw'>warnings</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='no'>...</span>)
<span class='fu'>key_antibiotics_equal</span>(<span class='no'>y</span>, <span class='no'>z</span>, <span class='kw'>type</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"keyantibiotics"</span>, <span class='st'>"points"</span>),
<span class='kw'>ignore_I</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>points_threshold</span> <span class='kw'>=</span> <span class='fl'>2</span>, <span class='kw'>info</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
@ -282,11 +278,11 @@
</tr>
<tr>
<th>GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6</th>
<td><p>column names of antibiotics for <strong>Gram positives</strong>, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col</a></code>.</p></td>
<td><p>column names of antibiotics for <strong>Gram-positives</strong>, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col</a></code>.</p></td>
</tr>
<tr>
<th>GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6</th>
<td><p>column names of antibiotics for <strong>Gram negatives</strong>, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col</a></code>.</p></td>
<td><p>column names of antibiotics for <strong>Gram-negatives</strong>, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col</a></code>.</p></td>
</tr>
<tr>
<th>warnings</th>
@ -321,10 +317,10 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>The function <code>key_antibiotics</code> returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using <code>key_antibiotics_equal</code>, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (<code>"."</code>). The <code><a href='first_isolate.html'>first_isolate</a></code> function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible <em>S. aureus</em> (MSSA) found within the same episode (see <code>episode</code> parameter of <code><a href='first_isolate.html'>first_isolate</a></code>). Without key antibiotic comparison it would not.</p>
<p>At default, the antibiotics that are used for <strong>Gram positive bacteria</strong> are (colum names): <br />
<code>"amox"</code>, <code>"amcl"</code>, <code>"cfur"</code>, <code>"pita"</code>, <code>"cipr"</code>, <code>"trsu"</code> (until here is universal), <code>"vanc"</code>, <code>"teic"</code>, <code>"tetr"</code>, <code>"eryt"</code>, <code>"oxac"</code>, <code>"rifa"</code>.</p>
<p>At default, the antibiotics that are used for <strong>Gram negative bacteria</strong> are (colum names): <br />
<code>"amox"</code>, <code>"amcl"</code>, <code>"cfur"</code>, <code>"pita"</code>, <code>"cipr"</code>, <code>"trsu"</code> (until here is universal), <code>"gent"</code>, <code>"tobr"</code>, <code>"coli"</code>, <code>"cfot"</code>, <code>"cfta"</code>, <code>"mero"</code>.</p>
<p>At default, the antibiotics that are used for <strong>Gram-positive bacteria</strong> are: <br />
amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), vancomycin, teicoplanin, tetracycline, erythromycin, oxacillin, rifampin.</p>
<p>At default, the antibiotics that are used for <strong>Gram-negative bacteria</strong> are: <br />
amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), gentamicin, tobramycin, colistin, cefotaxime, ceftazidime, meropenem.</p>
<p>The function <code>key_antibiotics_equal</code> checks the characters returned by <code>key_antibiotics</code> for equality, and returns a logical vector.</p>
<h2 class="hasAnchor" id="key-antibiotics"><a class="anchor" href="#key-antibiotics"></a>Key antibiotics</h2>
@ -350,6 +346,7 @@
<pre class="examples"><span class='co'># NOT RUN {</span>
<span class='co'># septic_patients is a dataset available in the AMR package</span>
?<span class='no'>septic_patients</span>
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/library'>library</a></span>(<span class='no'>dplyr</span>)
<span class='co'># set key antibiotics to a new variable</span>
<span class='no'>my_patients</span> <span class='kw'>&lt;-</span> <span class='no'>septic_patients</span> <span class='kw'>%&gt;%</span>

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.7.0.9000</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.7.0.9005</span>
</span>
</div>
@ -165,13 +165,6 @@
Create frequency tables
</a>
</li>
<li>
<a href="../reference/g.test.html">
<span class="fa fa-clipboard-check"></span>
Use the G-test
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
@ -284,6 +277,8 @@
<span class='fu'>mo_taxonomy</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
<span class='fu'>mo_info</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)
<span class='fu'>mo_url</span>(<span class='no'>x</span>, <span class='kw'>open</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='no'>...</span>)
<span class='fu'>mo_property</span>(<span class='no'>x</span>, <span class='kw'>property</span> <span class='kw'>=</span> <span class='st'>"fullname"</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='no'>...</span>)</pre>
@ -378,8 +373,8 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<span class='fu'>mo_shortname</span>(<span class='st'>"E. coli"</span>) <span class='co'># "E. coli"</span>
<span class='co'>## other properties</span>
<span class='fu'>mo_gramstain</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Gram negative"</span>
<span class='fu'>mo_type</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Bacteria" (equal to kingdom)</span>
<span class='fu'>mo_gramstain</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Gram-negative"</span>
<span class='fu'>mo_type</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Bacteria" (equal to kingdom, but may be translated)</span>
<span class='fu'>mo_rank</span>(<span class='st'>"E. coli"</span>) <span class='co'># "species"</span>
<span class='fu'>mo_url</span>(<span class='st'>"E. coli"</span>) <span class='co'># get the direct url to the online database entry</span>
@ -393,7 +388,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<span class='fu'>mo_genus</span>(<span class='st'>"MRSA"</span>) <span class='co'># "Staphylococcus"</span>
<span class='fu'>mo_species</span>(<span class='st'>"MRSA"</span>) <span class='co'># "aureus"</span>
<span class='fu'>mo_shortname</span>(<span class='st'>"MRSA"</span>) <span class='co'># "S. aureus"</span>
<span class='fu'>mo_gramstain</span>(<span class='st'>"MRSA"</span>) <span class='co'># "Gram positive"</span>
<span class='fu'>mo_gramstain</span>(<span class='st'>"MRSA"</span>) <span class='co'># "Gram-positive"</span>
<span class='fu'>mo_genus</span>(<span class='st'>"VISA"</span>) <span class='co'># "Staphylococcus"</span>
<span class='fu'>mo_species</span>(<span class='st'>"VISA"</span>) <span class='co'># "aureus"</span>
@ -442,6 +437,8 @@ This package contains the complete taxonomic tree of almost all microorganisms (
<span class='co'># get a list with the complete taxonomy (from kingdom to subspecies)</span>
<span class='fu'>mo_taxonomy</span>(<span class='st'>"E. coli"</span>)
<span class='co'># get a list with the taxonomy, the authors and the URL to the online database</span>
<span class='fu'>mo_info</span>(<span class='st'>"E. coli"</span>)
<span class='co'># }</span></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">

View File

@ -4,7 +4,7 @@
\name{antibiotics}
\alias{antibiotics}
\title{Data set with ~450 antibiotics}
\format{A \code{\link{data.frame}} with 454 observations and 13 variables:
\format{A \code{\link{data.frame}} with 453 observations and 13 variables:
\describe{
\item{\code{ab}}{Antibiotic ID as used in this package (like \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available}
\item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02}}

View File

@ -61,9 +61,9 @@ mo_ref("E. coli")
# [1] "Castellani et al., 1919"
# Do not get mistaken - the package only includes microorganisms
mo_phylum("C. elegans")
# [1] "Cyanobacteria" # Bacteria?!
mo_fullname("C. elegans")
mo_kingdom("C. elegans")
# [1] "Bacteria" # Bacteria?!
mo_name("C. elegans")
# [1] "Chroococcus limneticus elegans" # Because a microorganism was found
}
\seealso{

View File

@ -10,11 +10,9 @@ catalogue_of_life_version()
a \code{list}, which prints in pretty format
}
\description{
This function returns information about the included data from the Catalogue of Life. It also shows if the included version is their latest annual release. The Catalogue of Life releases their annual release in March each year.
This function returns information about the included data from the Catalogue of Life.
}
\details{
The list item \code{...$catalogue_of_life$is_latest_annual_release} is based on the system date.
For DSMZ, see \code{?microorganisms}.
}
\section{Catalogue of Life}{

View File

@ -5,19 +5,22 @@
\alias{key_antibiotics_equal}
\title{Key antibiotics for first \emph{weighted} isolates}
\usage{
key_antibiotics(x, col_mo = NULL, universal_1 = guess_ab_col(x, "AMX"),
universal_2 = guess_ab_col(x, "AMC"), universal_3 = guess_ab_col(x,
"CXM"), universal_4 = guess_ab_col(x, "TZP"),
universal_5 = guess_ab_col(x, "CIP"), universal_6 = guess_ab_col(x,
"SXT"), GramPos_1 = guess_ab_col(x, "VAN"),
GramPos_2 = guess_ab_col(x, "TEC"), GramPos_3 = guess_ab_col(x,
"TCY"), GramPos_4 = guess_ab_col(x, "ERY"),
GramPos_5 = guess_ab_col(x, "OXA"), GramPos_6 = guess_ab_col(x,
"RIF"), GramNeg_1 = guess_ab_col(x, "GEN"),
GramNeg_2 = guess_ab_col(x, "TOB"), GramNeg_3 = guess_ab_col(x,
"COL"), GramNeg_4 = guess_ab_col(x, "CTX"),
GramNeg_5 = guess_ab_col(x, "CAZ"), GramNeg_6 = guess_ab_col(x,
"MEM"), warnings = TRUE, ...)
key_antibiotics(x, col_mo = NULL, universal_1 = guess_ab_col(x,
"amoxicillin"), universal_2 = guess_ab_col(x,
"amoxicillin/clavulanic acid"), universal_3 = guess_ab_col(x,
"cefuroxime"), universal_4 = guess_ab_col(x,
"piperacillin/tazobactam"), universal_5 = guess_ab_col(x,
"ciprofloxacin"), universal_6 = guess_ab_col(x,
"trimethoprim/sulfamethoxazole"), GramPos_1 = guess_ab_col(x,
"vancomycin"), GramPos_2 = guess_ab_col(x, "teicoplanin"),
GramPos_3 = guess_ab_col(x, "tetracycline"),
GramPos_4 = guess_ab_col(x, "erythromycin"),
GramPos_5 = guess_ab_col(x, "oxacillin"), GramPos_6 = guess_ab_col(x,
"rifampin"), GramNeg_1 = guess_ab_col(x, "gentamicin"),
GramNeg_2 = guess_ab_col(x, "tobramycin"),
GramNeg_3 = guess_ab_col(x, "colistin"), GramNeg_4 = guess_ab_col(x,
"cefotaxime"), GramNeg_5 = guess_ab_col(x, "ceftazidime"),
GramNeg_6 = guess_ab_col(x, "meropenem"), warnings = TRUE, ...)
key_antibiotics_equal(y, z, type = c("keyantibiotics", "points"),
ignore_I = TRUE, points_threshold = 2, info = FALSE)
@ -29,9 +32,9 @@ key_antibiotics_equal(y, z, type = c("keyantibiotics", "points"),
\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. 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. 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. 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. 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}
@ -53,11 +56,11 @@ These function can be used to determine first isolates (see \code{\link{first_is
\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 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"}.
At default, the antibiotics that are used for \strong{Gram-positive bacteria} are: \cr
amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), vancomycin, teicoplanin, tetracycline, erythromycin, oxacillin, rifampin.
At default, the antibiotics that are used for \strong{Gram negative bacteria} are (colum names): \cr
\code{"amox"}, \code{"amcl"}, \code{"cfur"}, \code{"pita"}, \code{"cipr"}, \code{"trsu"} (until here is universal), \code{"gent"}, \code{"tobr"}, \code{"coli"}, \code{"cfot"}, \code{"cfta"}, \code{"mero"}.
At default, the antibiotics that are used for \strong{Gram-negative bacteria} are: \cr
amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), gentamicin, tobramycin, colistin, cefotaxime, ceftazidime, meropenem.
The function \code{key_antibiotics_equal} checks the characters returned by \code{key_antibiotics} for equality, and returns a logical vector.
@ -81,6 +84,7 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
\examples{
# septic_patients is a dataset available in the AMR package
?septic_patients
library(dplyr)
# set key antibiotics to a new variable
my_patients <- septic_patients \%>\%

View File

@ -20,6 +20,7 @@
\alias{mo_year}
\alias{mo_rank}
\alias{mo_taxonomy}
\alias{mo_info}
\alias{mo_url}
\title{Property of a microorganism}
\usage{
@ -59,6 +60,8 @@ mo_rank(x, ...)
mo_taxonomy(x, language = get_locale(), ...)
mo_info(x, language = get_locale(), ...)
mo_url(x, open = FALSE, ...)
mo_property(x, property = "fullname", language = get_locale(), ...)
@ -140,8 +143,8 @@ mo_fullname("E. coli") # "Escherichia coli", same as mo_name()
mo_shortname("E. coli") # "E. coli"
## other properties
mo_gramstain("E. coli") # "Gram negative"
mo_type("E. coli") # "Bacteria" (equal to kingdom)
mo_gramstain("E. coli") # "Gram-negative"
mo_type("E. coli") # "Bacteria" (equal to kingdom, but may be translated)
mo_rank("E. coli") # "species"
mo_url("E. coli") # get the direct url to the online database entry
@ -155,7 +158,7 @@ mo_year("E. coli") # 1919
mo_genus("MRSA") # "Staphylococcus"
mo_species("MRSA") # "aureus"
mo_shortname("MRSA") # "S. aureus"
mo_gramstain("MRSA") # "Gram positive"
mo_gramstain("MRSA") # "Gram-positive"
mo_genus("VISA") # "Staphylococcus"
mo_species("VISA") # "aureus"
@ -204,6 +207,8 @@ mo_fullname("S. pyogenes",
# get a list with the complete taxonomy (from kingdom to subspecies)
mo_taxonomy("E. coli")
# get a list with the taxonomy, the authors and the URL to the online database
mo_info("E. coli")
}
\seealso{
\code{\link{microorganisms}}

View File

@ -24,12 +24,17 @@ context("data.R")
test_that("data sets are valid", {
# IDs should always be unique
expect_identical(nrow(antibiotics), length(unique(antibiotics$ab)))
expect_identical(class(antibiotics$ab), "ab")
expect_identical(nrow(microorganisms), length(unique(microorganisms$mo)))
expect_identical(class(microorganisms$mo), "mo")
# check cross table reference
expect_true(all(microorganisms.codes$mo %in% microorganisms$mo))
# there should be no diacritics (i.e. non ASCII) characters in the datasets
# antibiotic names must always be coercible to their original AB code
expect_identical(antibiotics$ab, as.ab(antibiotics$name))
# there should be no diacritics (i.e. non ASCII) characters in the datasets (CRAN policy)
datasets <- data(package = "AMR", envir = asNamespace("AMR"))$results[, "Item"]
for (i in 1:length(datasets)) {
dataset <- get(datasets[i], envir = asNamespace("AMR"))

View File

@ -33,10 +33,13 @@ test_that("mo_property works", {
expect_equal(mo_fullname("E. coli"), "Escherichia coli")
expect_equal(mo_name("E. coli"), "Escherichia coli")
expect_equal(mo_type("E. coli", language = "en"), "Bacteria")
expect_equal(mo_gramstain("E. coli", language = "en"), "Gram negative")
expect_equal(mo_gramstain("E. coli", language = "en"), "Gram-negative")
expect_equal(class(mo_taxonomy("E. coli")), "list")
expect_equal(names(mo_taxonomy("E. coli")), c("kingdom", "phylum", "class", "order",
"family", "genus", "species", "subspecies"))
expect_equal(names(mo_info("E. coli")), c("kingdom", "phylum", "class", "order",
"family", "genus", "species", "subspecies",
"url", "ref"))
expect_equal(mo_ref("E. coli"), "Castellani et al., 1919")
expect_equal(mo_authors("E. coli"), "Castellani et al.")