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

add mo_pathogenicity

This commit is contained in:
dr. M.S. (Matthijs) Berends 2023-01-06 13:35:37 +01:00
parent 4801a6067e
commit 86e28bafce
8 changed files with 106 additions and 25 deletions

View File

@ -47,7 +47,7 @@ jobs:
matrix: matrix:
config: config:
# Test all old versions of R >= 3.0, we support them all! # Test all old versions of R >= 3.0, we support them all!
# For these old versions, dependencies will not be installed and checked. # For these old versions, dependencies and vignettes will not be checked.
# For recent R versions, see check-recent.yaml (r-lib and tidyverse support the latest 5 major R versions). # For recent R versions, see check-recent.yaml (r-lib and tidyverse support the latest 5 major R versions).
- {os: ubuntu-22.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"} - {os: ubuntu-22.04, r: '3.4', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"} - {os: ubuntu-22.04, r: '3.3', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
@ -82,8 +82,8 @@ jobs:
as.data.frame(utils::installed.packages())[, "Version", drop = FALSE] as.data.frame(utils::installed.packages())[, "Version", drop = FALSE]
shell: Rscript {0} shell: Rscript {0}
- name: Remove vignettes on R without knitr support - name: Remove vignettes
if: matrix.config.r == '3.0' || matrix.config.r == '3.1' || matrix.config.r == '3.2' || matrix.config.r == '3.3' if: always() # matrix.config.r == '3.0' || matrix.config.r == '3.1' || matrix.config.r == '3.2' || matrix.config.r == '3.3'
# writing to DESCRIPTION2 and then moving to DESCRIPTION is required for R <= 3.3 as writeLines() cannot overwrite # writing to DESCRIPTION2 and then moving to DESCRIPTION is required for R <= 3.3 as writeLines() cannot overwrite
run: | run: |
rm -rf vignettes rm -rf vignettes
@ -101,7 +101,7 @@ jobs:
_R_CHECK_LENGTH_1_CONDITION_: verbose _R_CHECK_LENGTH_1_CONDITION_: verbose
_R_CHECK_LENGTH_1_LOGIC2_: verbose _R_CHECK_LENGTH_1_LOGIC2_: verbose
# no check for old R versions - these packages require higher R versions # no check for old R versions - these packages require higher R versions
_R_CHECK_RD_XREFS_: ${{ matrix.config.r != '3.0' && matrix.config.r != '3.1' && matrix.config.r != '3.2' && matrix.config.r != '3.3' && matrix.config.r != '3.4' }} _R_CHECK_RD_XREFS_: false
_R_CHECK_FORCE_SUGGESTS_: false _R_CHECK_FORCE_SUGGESTS_: false
R_CHECK_CONSTANTS: 5 R_CHECK_CONSTANTS: 5
R_JIT_STRATEGY: 3 R_JIT_STRATEGY: 3

View File

@ -99,6 +99,5 @@ jobs:
- name: Show tinytest output - name: Show tinytest output
if: always() if: always()
run: | run: |
ls -lh
find . -name 'tinytest.Rout*' -exec cat '{}' \; || true find . -name 'tinytest.Rout*' -exec cat '{}' \; || true
shell: bash shell: bash

View File

@ -1,5 +1,5 @@
Package: AMR Package: AMR
Version: 1.8.2.9083 Version: 1.8.2.9084
Date: 2023-01-06 Date: 2023-01-06
Title: Antimicrobial Resistance Data Analysis Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR) Description: Functions to simplify and standardise antimicrobial resistance (AMR)

View File

@ -313,6 +313,7 @@ export(mo_lpsn)
export(mo_matching_score) export(mo_matching_score)
export(mo_name) export(mo_name)
export(mo_order) export(mo_order)
export(mo_pathogenicity)
export(mo_phylum) export(mo_phylum)
export(mo_property) export(mo_property)
export(mo_rank) export(mo_rank)

View File

@ -1,4 +1,4 @@
# AMR 1.8.2.9083 # AMR 1.8.2.9084
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)* *(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*

View File

@ -45,17 +45,19 @@
#' #'
#' Since the top-level of the taxonomy is sometimes referred to as 'kingdom' and sometimes as 'domain', the functions [mo_kingdom()] and [mo_domain()] return the exact same results. #' Since the top-level of the taxonomy is sometimes referred to as 'kingdom' and sometimes as 'domain', the functions [mo_kingdom()] and [mo_domain()] return the exact same results.
#' #'
#' Determination of the Gram stain - [mo_gramstain()] - will be based on the taxonomic kingdom and phylum. Originally, Cavalier-Smith defined the so-called subkingdoms Negibacteria and Posibacteria (2002, [PMID 11837318](https://pubmed.ncbi.nlm.nih.gov/11837318/)), and only considered these phyla as Posibacteria: Actinobacteria, Chloroflexi, Firmicutes, and Tenericutes. These phyla were renamed to Actinomycetota, Chloroflexota, Bacillota, and Mycoplasmatota (2021, [PMID 34694987](https://pubmed.ncbi.nlm.nih.gov/34694987/)). Bacteria in these phyla are considered Gram-positive in this `AMR` package, except for members of the class Negativicutes (within phylum Bacillota) which are Gram-negative. All other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value `NA`. Functions [mo_is_gram_negative()] and [mo_is_gram_positive()] always return `TRUE` or `FALSE` (or `NA` when the input is `NA` or the MO code is `UNKNOWN`), thus always return `FALSE` for species outside the taxonomic kingdom of Bacteria. #' Determination of human pathogenicity ([mo_pathogenicity()]) is strongly based on Bartlett *et al.* (2022, \doi{10.1099/mic.0.001269}). This function returns a [factor] with the levels *Pathogenic*, *Potentially pathogenic*, *Non-pathogenic*, and *Unknown*.
#' #'
#' Determination of yeasts - [mo_is_yeast()] - will be based on the taxonomic kingdom and class. *Budding yeasts* are fungi of the phylum Ascomycota, class Saccharomycetes (also called Hemiascomycetes). *True yeasts* are aggregated into the underlying order Saccharomycetales. Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes, the function will return `TRUE`. It returns `FALSE` otherwise (or `NA` when the input is `NA` or the MO code is `UNKNOWN`). #' Determination of the Gram stain ([mo_gramstain()]) will be based on the taxonomic kingdom and phylum. Originally, Cavalier-Smith defined the so-called subkingdoms Negibacteria and Posibacteria (2002, [PMID 11837318](https://pubmed.ncbi.nlm.nih.gov/11837318/)), and only considered these phyla as Posibacteria: Actinobacteria, Chloroflexi, Firmicutes, and Tenericutes. These phyla were renamed to Actinomycetota, Chloroflexota, Bacillota, and Mycoplasmatota (2021, [PMID 34694987](https://pubmed.ncbi.nlm.nih.gov/34694987/)). Bacteria in these phyla are considered Gram-positive in this `AMR` package, except for members of the class Negativicutes (within phylum Bacillota) which are Gram-negative. All other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value `NA`. Functions [mo_is_gram_negative()] and [mo_is_gram_positive()] always return `TRUE` or `FALSE` (or `NA` when the input is `NA` or the MO code is `UNKNOWN`), thus always return `FALSE` for species outside the taxonomic kingdom of Bacteria.
#' #'
#' Determination of intrinsic resistance - [mo_is_intrinsic_resistant()] - will be based on the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(3.3)`. The [mo_is_intrinsic_resistant()] function can be vectorised over both argument `x` (input for microorganisms) and `ab` (input for antibiotics). #' Determination of yeasts ([mo_is_yeast()]) will be based on the taxonomic kingdom and class. *Budding yeasts* are fungi of the phylum Ascomycota, class Saccharomycetes (also called Hemiascomycetes). *True yeasts* are aggregated into the underlying order Saccharomycetales. Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes, the function will return `TRUE`. It returns `FALSE` otherwise (or `NA` when the input is `NA` or the MO code is `UNKNOWN`).
#'
#' Determination of intrinsic resistance ([mo_is_intrinsic_resistant()]) will be based on the [intrinsic_resistant] data set, which is based on `r format_eucast_version_nr(3.3)`. The [mo_is_intrinsic_resistant()] function can be vectorised over both argument `x` (input for microorganisms) and `ab` (input for antibiotics).
#' #'
#' All output [will be translated][translate] where possible. #' All output [will be translated][translate] where possible.
#' #'
#' The function [mo_url()] will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species. #' The function [mo_url()] will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
#' #'
#' SNOMED codes - [mo_snomed()] - are from the version of `r documentation_date(TAXONOMY_VERSION$SNOMED$accessed_date)`. See *Source* and the [microorganisms] data set for more info. #' SNOMED codes ([mo_snomed()]) are from the version of `r documentation_date(TAXONOMY_VERSION$SNOMED$accessed_date)`. See *Source* and the [microorganisms] data set for more info.
#' #'
#' Old taxonomic names (so-called 'synonyms') can be retrieved with [mo_synonyms()], the current taxonomic name can be retrieved with [mo_current()]. Both functions return full names. #' Old taxonomic names (so-called 'synonyms') can be retrieved with [mo_synonyms()], the current taxonomic name can be retrieved with [mo_current()]. Both functions return full names.
#' @inheritSection mo_matching_score Matching Score for Microorganisms #' @inheritSection mo_matching_score Matching Score for Microorganisms
@ -64,6 +66,7 @@
#' @name mo_property #' @name mo_property
#' @return #' @return
#' - An [integer] in case of [mo_year()] #' - An [integer] in case of [mo_year()]
#' - An [ordered factor][factor] in case of [mo_pathogenicity()]
#' - A [list] in case of [mo_taxonomy()], [mo_synonyms()] and [mo_info()] #' - A [list] in case of [mo_taxonomy()], [mo_synonyms()] and [mo_info()]
#' - A named [character] in case of [mo_url()] #' - A named [character] in case of [mo_url()]
#' - A [numeric] in case of [mo_snomed()] #' - A [numeric] in case of [mo_snomed()]
@ -73,6 +76,7 @@
#' @inheritSection AMR Reference Data Publicly Available #' @inheritSection AMR Reference Data Publicly Available
#' @examples #' @examples
#' # taxonomic tree ----------------------------------------------------------- #' # taxonomic tree -----------------------------------------------------------
#'
#' mo_kingdom("Klebsiella pneumoniae") #' mo_kingdom("Klebsiella pneumoniae")
#' mo_phylum("Klebsiella pneumoniae") #' mo_phylum("Klebsiella pneumoniae")
#' mo_class("Klebsiella pneumoniae") #' mo_class("Klebsiella pneumoniae")
@ -82,27 +86,37 @@
#' mo_species("Klebsiella pneumoniae") #' mo_species("Klebsiella pneumoniae")
#' mo_subspecies("Klebsiella pneumoniae") #' mo_subspecies("Klebsiella pneumoniae")
#' #'
#' # colloquial properties ---------------------------------------------------- #'
#' # full names and short names -----------------------------------------------
#'
#' mo_name("Klebsiella pneumoniae") #' mo_name("Klebsiella pneumoniae")
#' mo_fullname("Klebsiella pneumoniae") #' mo_fullname("Klebsiella pneumoniae")
#' mo_shortname("Klebsiella pneumoniae") #' mo_shortname("Klebsiella pneumoniae")
#' #'
#'
#' # other properties --------------------------------------------------------- #' # other properties ---------------------------------------------------------
#'
#' mo_pathogenicity("Klebsiella pneumoniae")
#' mo_gramstain("Klebsiella pneumoniae") #' mo_gramstain("Klebsiella pneumoniae")
#' mo_snomed("Klebsiella pneumoniae") #' mo_snomed("Klebsiella pneumoniae")
#' mo_type("Klebsiella pneumoniae") #' mo_type("Klebsiella pneumoniae")
#' mo_rank("Klebsiella pneumoniae") #' mo_rank("Klebsiella pneumoniae")
#' mo_url("Klebsiella pneumoniae") #' mo_url("Klebsiella pneumoniae")
#' mo_synonyms("Klebsiella pneumoniae") #' mo_is_yeast(c("Candida", "Trichophyton", "Klebsiella"))
#'
#' #'
#' # scientific reference ----------------------------------------------------- #' # scientific reference -----------------------------------------------------
#'
#' mo_ref("Klebsiella pneumoniae") #' mo_ref("Klebsiella pneumoniae")
#' mo_authors("Klebsiella pneumoniae") #' mo_authors("Klebsiella pneumoniae")
#' mo_year("Klebsiella pneumoniae") #' mo_year("Klebsiella pneumoniae")
#' mo_lpsn("Klebsiella pneumoniae") #' mo_lpsn("Klebsiella pneumoniae")
#' mo_gbif("Klebsiella pneumoniae") #' mo_gbif("Klebsiella pneumoniae")
#' mo_synonyms("Klebsiella pneumoniae")
#'
#' #'
#' # abbreviations known in the field ----------------------------------------- #' # abbreviations known in the field -----------------------------------------
#'
#' mo_genus("MRSA") #' mo_genus("MRSA")
#' mo_species("MRSA") #' mo_species("MRSA")
#' mo_shortname("VISA") #' mo_shortname("VISA")
@ -111,18 +125,24 @@
#' mo_genus("EHEC") #' mo_genus("EHEC")
#' mo_species("EHEC") #' mo_species("EHEC")
#' #'
#'
#' # known subspecies --------------------------------------------------------- #' # known subspecies ---------------------------------------------------------
#'
#' mo_fullname("K. pneu rh") #' mo_fullname("K. pneu rh")
#' mo_shortname("K. pneu rh") #' mo_shortname("K. pneu rh")
#' #'
#'
#' \donttest{ #' \donttest{
#' # Becker classification, see ?as.mo ---------------------------------------- #' # Becker classification, see ?as.mo ----------------------------------------
#'
#' mo_fullname("Staph. epidermidis") #' mo_fullname("Staph. epidermidis")
#' mo_fullname("Staph. epidermidis", Becker = TRUE) #' mo_fullname("Staph. epidermidis", Becker = TRUE)
#' mo_shortname("Staph. epidermidis") #' mo_shortname("Staph. epidermidis")
#' mo_shortname("Staph. epidermidis", Becker = TRUE) #' mo_shortname("Staph. epidermidis", Becker = TRUE)
#' #'
#'
#' # Lancefield classification, see ?as.mo ------------------------------------ #' # Lancefield classification, see ?as.mo ------------------------------------
#'
#' mo_fullname("S. pyo") #' mo_fullname("S. pyo")
#' mo_fullname("S. pyo", Lancefield = TRUE) #' mo_fullname("S. pyo", Lancefield = TRUE)
#' mo_shortname("S. pyo") #' mo_shortname("S. pyo")
@ -130,6 +150,7 @@
#' #'
#' #'
#' # language support -------------------------------------------------------- #' # language support --------------------------------------------------------
#'
#' mo_gramstain("Klebsiella pneumoniae", language = "de") # German #' mo_gramstain("Klebsiella pneumoniae", language = "de") # German
#' mo_gramstain("Klebsiella pneumoniae", language = "nl") # Dutch #' mo_gramstain("Klebsiella pneumoniae", language = "nl") # Dutch
#' mo_gramstain("Klebsiella pneumoniae", language = "es") # Spanish #' mo_gramstain("Klebsiella pneumoniae", language = "es") # Spanish
@ -148,8 +169,6 @@
#' #'
#' # other -------------------------------------------------------------------- #' # other --------------------------------------------------------------------
#' #'
#' mo_is_yeast(c("Candida", "Trichophyton", "Klebsiella"))
#'
#' # gram stains and intrinsic resistance can be used as a filter in dplyr verbs #' # gram stains and intrinsic resistance can be used as a filter in dplyr verbs
#' if (require("dplyr")) { #' if (require("dplyr")) {
#' example_isolates %>% #' example_isolates %>%
@ -162,7 +181,6 @@
#' count(mo_genus(), sort = TRUE) #' count(mo_genus(), sort = TRUE)
#' } #' }
#' #'
#'
#' # get a list with the complete taxonomy (from kingdom to subspecies) #' # get a list with the complete taxonomy (from kingdom to subspecies)
#' mo_taxonomy("Klebsiella pneumoniae") #' mo_taxonomy("Klebsiella pneumoniae")
#' #'
@ -386,6 +404,40 @@ mo_status <- function(x, language = get_AMR_locale(), keep_synonyms = getOption(
translate_into_language(mo_validate(x = x, property = "status", language = language, keep_synonyms = keep_synonyms, ...), language = language, only_unknown = TRUE) translate_into_language(mo_validate(x = x, property = "status", language = language, keep_synonyms = keep_synonyms, ...), language = language, only_unknown = TRUE)
} }
#' @rdname mo_property
#' @export
mo_pathogenicity <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) {
if (missing(x)) {
# this tries to find the data and an 'mo' column
x <- find_mo_col(fn = "mo_pathogenicity")
}
meet_criteria(x, allow_NA = TRUE)
language <- validate_language(language)
meet_criteria(keep_synonyms, allow_class = "logical", has_length = 1)
x.mo <- as.mo(x, language = language, keep_synonyms = keep_synonyms, ...)
metadata <- get_mo_uncertainties()
prev <- AMR_env$MO_lookup$prevalence[match(x.mo, AMR_env$MO_lookup$mo)]
kngd <- AMR_env$MO_lookup$kingdom[match(x.mo, AMR_env$MO_lookup$mo)]
rank <- AMR_env$MO_lookup$rank[match(x.mo, AMR_env$MO_lookup$mo)]
out <- factor(ifelse(prev == 1 & kngd == "Bacteria" & rank != "genus",
"Pathogenic",
ifelse(prev < 2 & kngd == "Fungi",
"Potentially pathogenic",
ifelse(prev == 2 & kngd == "Bacteria",
"Non-pathogenic",
ifelse(kngd == "Bacteria",
"Potentially pathogenic",
"Unknown")))),
levels = c("Pathogenic", "Potentially pathogenic", "Non-pathogenic", "Unknown"),
ordered = TRUE)
load_mo_uncertainties(metadata)
out
}
#' @rdname mo_property #' @rdname mo_property
#' @export #' @export
mo_gramstain <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) { mo_gramstain <- function(x, language = get_AMR_locale(), keep_synonyms = getOption("AMR_keep_synonyms", FALSE), ...) {

View File

@ -102,6 +102,9 @@ expect_equal(names(mo_info("Escherichia coli")), c(
)) ))
expect_inherits(mo_info(c("Escherichia coli", "Staphylococcus aureus")), "list") expect_inherits(mo_info(c("Escherichia coli", "Staphylococcus aureus")), "list")
expect_equal(as.character(table(mo_pathogenicity(example_isolates$mo)))
c("1561", "422", "1", "16"))
expect_equal(mo_ref("Escherichia coli"), "Castellani et al., 1919") expect_equal(mo_ref("Escherichia coli"), "Castellani et al., 1919")
expect_equal(mo_authors("Escherichia coli"), "Castellani et al.") expect_equal(mo_authors("Escherichia coli"), "Castellani et al.")
expect_equal(mo_year("Escherichia coli"), 1919) expect_equal(mo_year("Escherichia coli"), 1919)

View File

@ -16,6 +16,7 @@
\alias{mo_domain} \alias{mo_domain}
\alias{mo_type} \alias{mo_type}
\alias{mo_status} \alias{mo_status}
\alias{mo_pathogenicity}
\alias{mo_gramstain} \alias{mo_gramstain}
\alias{mo_is_gram_negative} \alias{mo_is_gram_negative}
\alias{mo_is_gram_positive} \alias{mo_is_gram_positive}
@ -133,6 +134,13 @@ mo_status(
... ...
) )
mo_pathogenicity(
x,
language = get_AMR_locale(),
keep_synonyms = getOption("AMR_keep_synonyms", FALSE),
...
)
mo_gramstain( mo_gramstain(
x, x,
language = get_AMR_locale(), language = get_AMR_locale(),
@ -275,6 +283,7 @@ mo_property(
\value{ \value{
\itemize{ \itemize{
\item An \link{integer} in case of \code{\link[=mo_year]{mo_year()}} \item An \link{integer} in case of \code{\link[=mo_year]{mo_year()}}
\item An \link[=factor]{ordered factor} in case of \code{\link[=mo_pathogenicity]{mo_pathogenicity()}}
\item A \link{list} in case of \code{\link[=mo_taxonomy]{mo_taxonomy()}}, \code{\link[=mo_synonyms]{mo_synonyms()}} and \code{\link[=mo_info]{mo_info()}} \item A \link{list} in case of \code{\link[=mo_taxonomy]{mo_taxonomy()}}, \code{\link[=mo_synonyms]{mo_synonyms()}} and \code{\link[=mo_info]{mo_info()}}
\item A named \link{character} in case of \code{\link[=mo_url]{mo_url()}} \item A named \link{character} in case of \code{\link[=mo_url]{mo_url()}}
\item A \link{numeric} in case of \code{\link[=mo_snomed]{mo_snomed()}} \item A \link{numeric} in case of \code{\link[=mo_snomed]{mo_snomed()}}
@ -296,17 +305,19 @@ The short name - \code{\link[=mo_shortname]{mo_shortname()}} - almost always ret
Since the top-level of the taxonomy is sometimes referred to as 'kingdom' and sometimes as 'domain', the functions \code{\link[=mo_kingdom]{mo_kingdom()}} and \code{\link[=mo_domain]{mo_domain()}} return the exact same results. Since the top-level of the taxonomy is sometimes referred to as 'kingdom' and sometimes as 'domain', the functions \code{\link[=mo_kingdom]{mo_kingdom()}} and \code{\link[=mo_domain]{mo_domain()}} return the exact same results.
Determination of the Gram stain - \code{\link[=mo_gramstain]{mo_gramstain()}} - will be based on the taxonomic kingdom and phylum. Originally, Cavalier-Smith defined the so-called subkingdoms Negibacteria and Posibacteria (2002, \href{https://pubmed.ncbi.nlm.nih.gov/11837318/}{PMID 11837318}), and only considered these phyla as Posibacteria: Actinobacteria, Chloroflexi, Firmicutes, and Tenericutes. These phyla were renamed to Actinomycetota, Chloroflexota, Bacillota, and Mycoplasmatota (2021, \href{https://pubmed.ncbi.nlm.nih.gov/34694987/}{PMID 34694987}). Bacteria in these phyla are considered Gram-positive in this \code{AMR} package, except for members of the class Negativicutes (within phylum Bacillota) which are Gram-negative. All other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value \code{NA}. Functions \code{\link[=mo_is_gram_negative]{mo_is_gram_negative()}} and \code{\link[=mo_is_gram_positive]{mo_is_gram_positive()}} always return \code{TRUE} or \code{FALSE} (or \code{NA} when the input is \code{NA} or the MO code is \code{UNKNOWN}), thus always return \code{FALSE} for species outside the taxonomic kingdom of Bacteria. Determination of human pathogenicity (\code{\link[=mo_pathogenicity]{mo_pathogenicity()}}) is strongly based on Bartlett \emph{et al.} (2022, \doi{10.1099/mic.0.001269}). This function returns a \link{factor} with the levels \emph{Pathogenic}, \emph{Potentially pathogenic}, \emph{Non-pathogenic}, and \emph{Unknown}.
Determination of yeasts - \code{\link[=mo_is_yeast]{mo_is_yeast()}} - will be based on the taxonomic kingdom and class. \emph{Budding yeasts} are fungi of the phylum Ascomycota, class Saccharomycetes (also called Hemiascomycetes). \emph{True yeasts} are aggregated into the underlying order Saccharomycetales. Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes, the function will return \code{TRUE}. It returns \code{FALSE} otherwise (or \code{NA} when the input is \code{NA} or the MO code is \code{UNKNOWN}). Determination of the Gram stain (\code{\link[=mo_gramstain]{mo_gramstain()}}) will be based on the taxonomic kingdom and phylum. Originally, Cavalier-Smith defined the so-called subkingdoms Negibacteria and Posibacteria (2002, \href{https://pubmed.ncbi.nlm.nih.gov/11837318/}{PMID 11837318}), and only considered these phyla as Posibacteria: Actinobacteria, Chloroflexi, Firmicutes, and Tenericutes. These phyla were renamed to Actinomycetota, Chloroflexota, Bacillota, and Mycoplasmatota (2021, \href{https://pubmed.ncbi.nlm.nih.gov/34694987/}{PMID 34694987}). Bacteria in these phyla are considered Gram-positive in this \code{AMR} package, except for members of the class Negativicutes (within phylum Bacillota) which are Gram-negative. All other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value \code{NA}. Functions \code{\link[=mo_is_gram_negative]{mo_is_gram_negative()}} and \code{\link[=mo_is_gram_positive]{mo_is_gram_positive()}} always return \code{TRUE} or \code{FALSE} (or \code{NA} when the input is \code{NA} or the MO code is \code{UNKNOWN}), thus always return \code{FALSE} for species outside the taxonomic kingdom of Bacteria.
Determination of intrinsic resistance - \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} - will be based on the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021). The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} function can be vectorised over both argument \code{x} (input for microorganisms) and \code{ab} (input for antibiotics). Determination of yeasts (\code{\link[=mo_is_yeast]{mo_is_yeast()}}) will be based on the taxonomic kingdom and class. \emph{Budding yeasts} are fungi of the phylum Ascomycota, class Saccharomycetes (also called Hemiascomycetes). \emph{True yeasts} are aggregated into the underlying order Saccharomycetales. Thus, for all microorganisms that are member of the taxonomic class Saccharomycetes, the function will return \code{TRUE}. It returns \code{FALSE} otherwise (or \code{NA} when the input is \code{NA} or the MO code is \code{UNKNOWN}).
Determination of intrinsic resistance (\code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}}) will be based on the \link{intrinsic_resistant} data set, which is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021). The \code{\link[=mo_is_intrinsic_resistant]{mo_is_intrinsic_resistant()}} function can be vectorised over both argument \code{x} (input for microorganisms) and \code{ab} (input for antibiotics).
All output \link[=translate]{will be translated} where possible. All output \link[=translate]{will be translated} where possible.
The function \code{\link[=mo_url]{mo_url()}} will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species. The function \code{\link[=mo_url]{mo_url()}} will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.
SNOMED codes - \code{\link[=mo_snomed]{mo_snomed()}} - are from the version of 1 July, 2021. See \emph{Source} and the \link{microorganisms} data set for more info. SNOMED codes (\code{\link[=mo_snomed]{mo_snomed()}}) are from the version of 1 July, 2021. See \emph{Source} and the \link{microorganisms} data set for more info.
Old taxonomic names (so-called 'synonyms') can be retrieved with \code{\link[=mo_synonyms]{mo_synonyms()}}, the current taxonomic name can be retrieved with \code{\link[=mo_current]{mo_current()}}. Both functions return full names. Old taxonomic names (so-called 'synonyms') can be retrieved with \code{\link[=mo_synonyms]{mo_synonyms()}}, the current taxonomic name can be retrieved with \code{\link[=mo_current]{mo_current()}}. Both functions return full names.
} }
@ -369,6 +380,7 @@ All data sets in this \code{AMR} package (about microorganisms, antibiotics, R/S
\examples{ \examples{
# taxonomic tree ----------------------------------------------------------- # taxonomic tree -----------------------------------------------------------
mo_kingdom("Klebsiella pneumoniae") mo_kingdom("Klebsiella pneumoniae")
mo_phylum("Klebsiella pneumoniae") mo_phylum("Klebsiella pneumoniae")
mo_class("Klebsiella pneumoniae") mo_class("Klebsiella pneumoniae")
@ -378,27 +390,37 @@ mo_genus("Klebsiella pneumoniae")
mo_species("Klebsiella pneumoniae") mo_species("Klebsiella pneumoniae")
mo_subspecies("Klebsiella pneumoniae") mo_subspecies("Klebsiella pneumoniae")
# colloquial properties ----------------------------------------------------
# full names and short names -----------------------------------------------
mo_name("Klebsiella pneumoniae") mo_name("Klebsiella pneumoniae")
mo_fullname("Klebsiella pneumoniae") mo_fullname("Klebsiella pneumoniae")
mo_shortname("Klebsiella pneumoniae") mo_shortname("Klebsiella pneumoniae")
# other properties --------------------------------------------------------- # other properties ---------------------------------------------------------
mo_pathogenicity("Klebsiella pneumoniae")
mo_gramstain("Klebsiella pneumoniae") mo_gramstain("Klebsiella pneumoniae")
mo_snomed("Klebsiella pneumoniae") mo_snomed("Klebsiella pneumoniae")
mo_type("Klebsiella pneumoniae") mo_type("Klebsiella pneumoniae")
mo_rank("Klebsiella pneumoniae") mo_rank("Klebsiella pneumoniae")
mo_url("Klebsiella pneumoniae") mo_url("Klebsiella pneumoniae")
mo_synonyms("Klebsiella pneumoniae") mo_is_yeast(c("Candida", "Trichophyton", "Klebsiella"))
# scientific reference ----------------------------------------------------- # scientific reference -----------------------------------------------------
mo_ref("Klebsiella pneumoniae") mo_ref("Klebsiella pneumoniae")
mo_authors("Klebsiella pneumoniae") mo_authors("Klebsiella pneumoniae")
mo_year("Klebsiella pneumoniae") mo_year("Klebsiella pneumoniae")
mo_lpsn("Klebsiella pneumoniae") mo_lpsn("Klebsiella pneumoniae")
mo_gbif("Klebsiella pneumoniae") mo_gbif("Klebsiella pneumoniae")
mo_synonyms("Klebsiella pneumoniae")
# abbreviations known in the field ----------------------------------------- # abbreviations known in the field -----------------------------------------
mo_genus("MRSA") mo_genus("MRSA")
mo_species("MRSA") mo_species("MRSA")
mo_shortname("VISA") mo_shortname("VISA")
@ -407,18 +429,24 @@ mo_gramstain("VISA")
mo_genus("EHEC") mo_genus("EHEC")
mo_species("EHEC") mo_species("EHEC")
# known subspecies --------------------------------------------------------- # known subspecies ---------------------------------------------------------
mo_fullname("K. pneu rh") mo_fullname("K. pneu rh")
mo_shortname("K. pneu rh") mo_shortname("K. pneu rh")
\donttest{ \donttest{
# Becker classification, see ?as.mo ---------------------------------------- # Becker classification, see ?as.mo ----------------------------------------
mo_fullname("Staph. epidermidis") mo_fullname("Staph. epidermidis")
mo_fullname("Staph. epidermidis", Becker = TRUE) mo_fullname("Staph. epidermidis", Becker = TRUE)
mo_shortname("Staph. epidermidis") mo_shortname("Staph. epidermidis")
mo_shortname("Staph. epidermidis", Becker = TRUE) mo_shortname("Staph. epidermidis", Becker = TRUE)
# Lancefield classification, see ?as.mo ------------------------------------ # Lancefield classification, see ?as.mo ------------------------------------
mo_fullname("S. pyo") mo_fullname("S. pyo")
mo_fullname("S. pyo", Lancefield = TRUE) mo_fullname("S. pyo", Lancefield = TRUE)
mo_shortname("S. pyo") mo_shortname("S. pyo")
@ -426,6 +454,7 @@ mo_shortname("S. pyo", Lancefield = TRUE)
# language support -------------------------------------------------------- # language support --------------------------------------------------------
mo_gramstain("Klebsiella pneumoniae", language = "de") # German mo_gramstain("Klebsiella pneumoniae", language = "de") # German
mo_gramstain("Klebsiella pneumoniae", language = "nl") # Dutch mo_gramstain("Klebsiella pneumoniae", language = "nl") # Dutch
mo_gramstain("Klebsiella pneumoniae", language = "es") # Spanish mo_gramstain("Klebsiella pneumoniae", language = "es") # Spanish
@ -444,8 +473,6 @@ mo_fullname("S. pyogenes", Lancefield = TRUE, language = "uk")
# other -------------------------------------------------------------------- # other --------------------------------------------------------------------
mo_is_yeast(c("Candida", "Trichophyton", "Klebsiella"))
# gram stains and intrinsic resistance can be used as a filter in dplyr verbs # gram stains and intrinsic resistance can be used as a filter in dplyr verbs
if (require("dplyr")) { if (require("dplyr")) {
example_isolates \%>\% example_isolates \%>\%
@ -458,7 +485,6 @@ if (require("dplyr")) {
count(mo_genus(), sort = TRUE) count(mo_genus(), sort = TRUE)
} }
# get a list with the complete taxonomy (from kingdom to subspecies) # get a list with the complete taxonomy (from kingdom to subspecies)
mo_taxonomy("Klebsiella pneumoniae") mo_taxonomy("Klebsiella pneumoniae")