Catalogue of life

This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-02-20 00:04:48 +01:00
parent 54f8258f8c
commit fb1fc3686c
55 changed files with 2070 additions and 816 deletions

View File

@ -21,3 +21,4 @@
^Meta$
^pkgdown$
^public$
^reproduction.*R$

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 0.5.0.9018
Date: 2019-02-18
Date: 2019-02-20
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(
@ -56,6 +56,7 @@ Suggests:
covr (>= 3.0.1),
curl,
ggplot2,
microbenchmark,
readxl,
rmarkdown,
rstudioapi,

View File

@ -68,6 +68,7 @@ export(atc_trivial_nl)
export(atc_umcg)
export(availability)
export(brmo)
export(catalogue_of_life_version)
export(count_I)
export(count_IR)
export(count_R)
@ -123,11 +124,11 @@ export(mo_ref)
export(mo_renamed)
export(mo_shortname)
export(mo_species)
export(mo_subkingdom)
export(mo_subspecies)
export(mo_taxonomy)
export(mo_type)
export(mo_uncertainties)
export(mo_url)
export(mo_year)
export(mrgn)
export(n_rsi)

12
NEWS.md
View File

@ -10,12 +10,12 @@ We've got a new website: [https://msberends.gitlab.io/AMR](https://msberends.git
#### New
* **BREAKING**: removed deprecated functions, parameters and references to 'bactid'. Use `as.mo()` to identify an MO code.
* Catalogue of Life (CoL) inclusion for data about microorganisms, which also contains all ITIS data we used previously. The `microorganisms` data set now contains:
* Almost 60,000 species from six different kingdoms
* Almost 15,000 previously accepted names which are now taxonomic 'synonyms'
* All (sub)species from the kingdoms Archaea, Bacteria, Chromista, Protozoa and Viruses
* All (sub)species from the orders Eurotiales, Saccharomycetales and Onygenales of the kingdom Fungi. The complete taxonomy of this kingdom has more than 130,000 species. The orders we included contains at least all memebers of the families *Candida*, *Aspergillus* and *Trichophyton*.
* Due to this change, the ID of *Streptococcus* was changed from `B_STRPTC` to `B_STRPT`.
* Catalogue of Life as a new taxonomic source for data about microorganisms, which also contains all ITIS data we used previously. The `microorganisms` data set now contains:
* All ~55,000 species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses
* All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera *Aspergillus*, *Candida*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*).
* All ~15,000 previously accepted names of species that have been taxonomically renamed
* The responsible author(s) and year of scientific publication
* Due to this change, some `mo` codes changed (e.g. *Streptococcus* changed from `B_STRPTC` to `B_STRPT`). A translation table is used internally to support older microorganism IDs, so users will not notice this difference.
* Support for data from [WHONET](https://whonet.org/) and [EARS-Net](https://ecdc.europa.eu/en/about-us/partnerships-and-networks/disease-and-laboratory-networks/ears-net) (European Antimicrobial Resistance Surveillance Network):
* Exported files from WHONET can be read and used in this package. For functions like `first_isolate()` and `eucast_rules()`, all parameters will be filled in automatically.
* This package now knows all antibiotic abbrevations by EARS-Net (which are also being used by WHONET) - the `antibiotics` data set now contains a column `ears_net`.

73
R/catalogue_of_life.R Executable file
View File

@ -0,0 +1,73 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# #
# LICENCE #
# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) #
# #
# This R package is free software; you can freely use and distribute #
# it for both personal and commercial purposes under the terms of the #
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
# the Free Software Foundation. #
# #
# This R package was created for academic research and was publicly #
# released in the hope that it will be useful, but it comes WITHOUT #
# ANY WARRANTY OR LIABILITY. #
# Visit our website for more info: https://msberends.gitab.io/AMR. #
# ==================================================================== #
#' The Catalogue of Life
#'
#' This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life.
#' @section Catalogue of Life:
#' \if{html}{\figure{logo_col.png}{options: height=60px style=margin-bottom:5px} \cr}
#' This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). This data is updated annually - check the included version with \code{\link{catalogue_of_life_version}}.
#'
#' Included are:
#' \itemize{
#' \item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
#' \item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
#' \item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
#' \item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
#' \item{The responsible author(s) and year of scientific publication}
#' }
#'
#' The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
#'
#' The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R}.
#' @inheritSection AMR Read more on our website!
#' @name catalogue_of_life
#' @rdname catalogue_of_life
#' @examples
#' # Get version info of included data set
#' catalogue_of_life_version()
#'
#'
#' # Get a note when a species was renamed
#' mo_shortname("Chlamydia psittaci")
#' # Note: 'Chlamydia psittaci' (Page, 1968) was renamed
#' # 'Chlamydophila psittaci' (Everett et al., 1999)
#' # [1] "C. psittaci"
#'
#' # Get any property from the entire taxonomic tree for all included species
#' mo_class("E. coli")
#' # [1] "Gammaproteobacteria"
#'
#' mo_family("E. coli")
#' # [1] "Enterobacteriaceae"
#'
#' mo_gramstain("E. coli") # based on kingdom and phylum, see ?mo_gramstain
#' # [1] "Gram negative"
#'
#' 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")
#' # [1] "Chroococcus limneticus elegans" # Because a microorganism was found
NULL

View File

@ -133,26 +133,25 @@
#' Data set with ~60,000 microorganisms
#'
#' A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using \code{\link{as.mo}}.
#' @inheritSection ITIS ITIS
#' @format A \code{\link{data.frame}} with 56,659 observations and 15 variables:
#' @inheritSection catalogue_of_life Catalogue of Life
#' @format A \code{\link{data.frame}} with 56,672 observations and 14 variables:
#' \describe{
#' \item{\code{mo}}{ID of microorganism}
#' \item{\code{mo}}{ID of microorganism as used by this package}
#' \item{\code{col_id}}{Catalogue of Life ID}
#' \item{\code{genus}}{Taxonomic genus of the microorganism as found in ITIS, see Source}
#' \item{\code{species}}{Taxonomic species of the microorganism as found in ITIS, see Source}
#' \item{\code{subspecies}}{Taxonomic subspecies of the microorganism as found in ITIS, see Source}
#' \item{\code{fullname}}{Full name, like \code{"Echerichia coli"}}
#' \item{\code{family}}{Taxonomic family of the microorganism as found in ITIS, see Source}
#' \item{\code{order}}{Taxonomic order of the microorganism as found in ITIS, see Source}
#' \item{\code{class}}{Taxonomic class of the microorganism as found in ITIS, see Source}
#' \item{\code{phylum}}{Taxonomic phylum of the microorganism as found in ITIS, see Source}
#' \item{\code{subkingdom}}{Taxonomic subkingdom of the microorganism as found in ITIS, see Source}
#' \item{\code{kingdom}}{Taxonomic kingdom of the microorganism as found in ITIS, see Source}
#' \item{\code{gramstain}}{Gram of microorganism, like \code{"Gram negative"}}
#' \item{\code{prevalence}}{An integer based on estimated prevalence of the microorganism in humans. Used internally by \code{\link{as.mo}}, otherwise quite meaningless. It has a value of 25 for manually added items and a value of 1000 for all unprevalent microorganisms whose genus was somewhere in the top 250 (with another species).}
#' \item{\code{ref}}{Author(s) and year of concerning publication as found in ITIS, see Source}
#' \item{\code{kingdom}}{Taxonomic kingdom of the microorganism}
#' \item{\code{phylum}}{Taxonomic phylum of the microorganism}
#' \item{\code{class}}{Taxonomic class of the microorganism}
#' \item{\code{order}}{Taxonomic order of the microorganism}
#' \item{\code{family}}{Taxonomic family of the microorganism}
#' \item{\code{genus}}{Taxonomic genus of the microorganism}
#' \item{\code{species}}{Taxonomic species of the microorganism}
#' \item{\code{subspecies}}{Taxonomic subspecies of the microorganism}
#' \item{\code{rank}}{Taxonomic rank of the microorganism, like \code{"species"} or \code{"genus"}}
#' \item{\code{ref}}{Author(s) and year of concerning scientific publication}
#' \item{\code{species_id}}{ID of the species as used by the Catalogue of Life}
#' }
#' @source Integrated Taxonomic Information System (ITIS) public online database, \url{https://www.itis.gov}.
#' @source Catalogue of Life: Annual Checklist (public online database), \url{www.catalogueoflife.org}.
#' @details Manually added were:
#' \itemize{
#' \item{9 species of \emph{Streptococcus} (beta haemolytic groups A, B, C, D, F, G, H, K and unspecified)}
@ -160,21 +159,37 @@
#' \item{2 other undefined (unknown Gram negatives and unknown Gram positives)}
#' }
#' @inheritSection AMR Read more on our website!
#' @seealso \code{\link{as.mo}} \code{\link{mo_property}} \code{\link{microorganisms.codes}}
#' @seealso \code{\link{as.mo}}, \code{\link{mo_property}}, \code{\link{microorganisms.codes}}
"microorganisms"
catalogue_of_life <- list(
version = "Catalogue of Life: 2018 Annual Checklist",
url = "http://www.catalogueoflife.org/annual-checklist/2018"
)
#' Version info of included Catalogue of Life
#' @seealso \code{\link{microorganisms}}
#' @inheritSection catalogue_of_life Catalogue of Life
#' @export
catalogue_of_life_version <- function() {
list(version = catalogue_of_life$version,
url = catalogue_of_life$url,
no_of_species = nrow(AMR::microorganisms),
no_of_synonyms = nrow(AMR::microorganisms.old))
}
#' Data set with previously accepted taxonomic names
#'
#' A data set containing old (previously valid or accepted) taxonomic names according to ITIS. This data set is used internally by \code{\link{as.mo}}.
#' @inheritSection as.mo ITIS
#' A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by \code{\link{as.mo}}.
#' @inheritSection catalogue_of_life Catalogue of Life
#' @format A \code{\link{data.frame}} with 14,506 observations and 4 variables:
#' \describe{
#' \item{\code{col_id}}{Catalogue of Life ID}
#' \item{\code{tsn_new}}{New Catalogue of Life ID}
#' \item{\code{fullname}}{Old taxonomic name of the microorganism as found in the CoL, see Source}
#' \item{\code{ref}}{Author(s) and year of concerning publication as found in the CoL, see Source}
#' \item{\code{fullname}}{Old taxonomic name of the microorganism}
#' \item{\code{ref}}{Author(s) and year of concerning scientific publication}
#' }
#' @source [3] Integrated Taxonomic Information System (ITIS) on-line database, \url{https://www.itis.gov}.
#' @source [3] Catalogue of Life: Annual Checklist (public online database), \url{www.catalogueoflife.org}.
#' @inheritSection AMR Read more on our website!
#' @seealso \code{\link{as.mo}} \code{\link{mo_property}} \code{\link{microorganisms}}
"microorganisms.old"
@ -187,7 +202,7 @@
#' \item{\code{certe}}{Commonly used code of a microorganism}
#' \item{\code{mo}}{ID of the microorganism in the \code{\link{microorganisms}} data set}
#' }
#' @inheritSection ITIS ITIS
#' @inheritSection catalogue_of_life Catalogue of Life
#' @inheritSection AMR Read more on our website!
#' @seealso \code{\link{as.mo}} \code{\link{microorganisms}}
"microorganisms.codes"

View File

@ -29,6 +29,7 @@ globalVariables(c(".",
"Becker",
"certe",
"cnt",
"col_id",
"count",
"count.x",
"count.y",
@ -49,6 +50,7 @@ globalVariables(c(".",
"key_ab",
"key_ab_lag",
"key_ab_other",
"kingdom",
"labs",
"Lancefield",
"Last name",
@ -73,7 +75,9 @@ globalVariables(c(".",
"other_pat_or_mo",
"Pasted",
"patient_id",
"phylum",
"prevalence",
"prevalent",
"psae",
"R",
"real_first_isolate",
@ -85,6 +89,7 @@ globalVariables(c(".",
"Sex",
"shortname",
"species",
"superprevalent",
"trade_name",
"transmute",
"tsn",

View File

@ -1,63 +0,0 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# #
# LICENCE #
# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) #
# #
# This R package is free software; you can freely use and distribute #
# it for both personal and commercial purposes under the terms of the #
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
# the Free Software Foundation. #
# #
# This R package was created for academic research and was publicly #
# released in the hope that it will be useful, but it comes WITHOUT #
# ANY WARRANTY OR LIABILITY. #
# Visit our website for more info: https://msberends.gitab.io/AMR. #
# ==================================================================== #
#' ITIS: Integrated Taxonomic Information System
#'
#' All taxonomic names of all microorganisms are included in this package, using the authoritative Integrated Taxonomic Information System (ITIS).
#' @section ITIS:
#' \if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr}
#' This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}).
#'
#' All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.
#'
#' ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].
#' @inheritSection AMR Read more on our website!
#' @name ITIS
#' @rdname ITIS
#' @examples
#' # Get a note when a species was renamed
#' mo_shortname("Chlamydia psittaci")
#' # Note: 'Chlamydia psittaci' (Page, 1968) was renamed
#' # 'Chlamydophila psittaci' (Everett et al., 1999)
#' # [1] "C. psittaci"
#'
#' # Get any property from the entire taxonomic tree for all included species
#' mo_class("E. coli")
#' # [1] "Gammaproteobacteria"
#'
#' mo_family("E. coli")
#' # [1] "Enterobacteriaceae"
#'
#' mo_subkingdom("E. coli")
#' # [1] "Negibacteria"
#'
#' mo_gramstain("E. coli") # based on subkingdom
#' # [1] "Gram negative"
#'
#' mo_ref("E. coli")
#' # [1] "Castellani and Chalmers, 1919"
#'
#' # Do not get mistaken - the package only includes microorganisms
#' mo_phylum("C. elegans")
#' # [1] "Cyanobacteria" # Bacteria?!
#' mo_fullname("C. elegans")
#' # [1] "Chroococcus limneticus elegans" # Because a microorganism was found
NULL

26
R/mo.R
View File

@ -77,7 +77,7 @@
#' \item{It strips off values between brackets and the brackets itself, and re-evaluates the input with all previous rules}
#' \item{It strips off words from the end one by one and re-evaluates the input with all previous rules}
#' \item{It strips off words from the start one by one and re-evaluates the input with all previous rules}
#' \item{It tries to look for some manual changes which are not yet published to the ITIS database (like \emph{Propionibacterium} not yet being \emph{Cutibacterium})}
#' \item{It tries to look for some manual changes which are not yet published to the Catalogue of Life (like \emph{Propionibacterium} not yet being \emph{Cutibacterium})}
#' }
#'
#' Examples:
@ -94,17 +94,17 @@
#'
#' Use \code{mo_renamed()} to get a vector with all values that could be coerced based on an old, previously accepted taxonomic name.
#'
#' @inheritSection ITIS ITIS
#' @inheritSection catalogue_of_life Catalogue of Life
# (source as a section, so it can be inherited by other man pages)
#' @section Source:
#' [1] Becker K \emph{et al.} \strong{Coagulase-Negative Staphylococci}. 2014. Clin Microbiol Rev. 27(4): 870926. \url{https://dx.doi.org/10.1128/CMR.00109-13}
#'
#' [2] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 57195. \url{https://dx.doi.org/10.1084/jem.57.4.571}
#'
#' [3] Integrated Taxonomic Information System (ITIS). Retrieved September 2018. \url{http://www.itis.gov}
#' [3] Catalogue of Life: Annual Checklist (public online database), \url{www.catalogueoflife.org}.
#' @export
#' @return Character (vector) with class \code{"mo"}. Unknown values will return \code{NA}.
#' @seealso \code{\link{microorganisms}} for the \code{data.frame} with ITIS content that is being used to determine ID's. \cr
#' @seealso \code{\link{microorganisms}} for the \code{data.frame} that is being used to determine ID's. \cr
#' The \code{\link{mo_property}} functions (like \code{\link{mo_genus}}, \code{\link{mo_gramstain}}) to get properties based on the returned code.
#' @inheritSection AMR Read more on our website!
#' @examples
@ -216,15 +216,15 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
x <- x[!is.na(x) & !is.null(x) & !identical(x, "")]
# conversion v0.5.0 to v0.6.0, remove for v0.7.0
x <- gsub("B_STRPTC", "B_STRPT", x)
x <- gsub("B_STRPT_EQUI", "B_STRPT_EQU", x)
x <- gsub("B_PDMNS", "B_PSDMN", x)
x <- gsub("B_CTRDM", "B_CLSTR", x)
x <- gsub("F_CANDD_GLB", "F_CANDD_GLA", x)
x <- gsub("F_CANDD_LUS", "F_CANDD", x)
x <- gsub("B_FCTRM", "B_FSBCT", x)
# conversion of old MO codes from v0.5.0 (ITIS) to later versions (Catalogue of Life)
if (any(x %like% "^[BFP]_[A-Z]{3,7}")) {
leftpart <- gsub("^([BFP]_[A-Z]{3,7}).*", "\\1", x)
if (any(leftpart %in% names(mo_codes_v0.5.0))) {
rightpart <- gsub("^[BFP]_[A-Z]{3,7}(.*)", "\\1", x)
leftpart <- mo_codes_v0.5.0[leftpart]
x[!is.na(leftpart)] <- paste0(leftpart[!is.na(leftpart)], rightpart[!is.na(leftpart)])
}
}
# defined df to check for
if (!is.null(reference_df)) {

View File

@ -26,14 +26,18 @@
#' @param property one of the column names of one of the \code{\link{microorganisms}} data set or \code{"shortname"}
#' @param language language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.
#' @param ... other parameters passed on to \code{\link{as.mo}}
#' @details All functions will return the most recently known taxonomic property according to ITIS, except for \code{mo_ref}, \code{mo_authors} and \code{mo_year}. This leads to the following results:
#' @details All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for \code{mo_ref}, \code{mo_authors} and \code{mo_year}. This leads to the following results:
#' \itemize{
#' \item{\code{mo_fullname("Chlamydia psittaci")} will return \code{"Chlamydophila psittaci"} (with a warning about the renaming)}
#' \item{\code{mo_ref("Chlamydia psittaci")} will return \code{"Page, 1968"} (with a warning about the renaming)}
#' \item{\code{mo_ref("Chlamydophila psittaci")} will return \code{"Everett et al., 1999"} (without a warning)}
#' }
#'
#' The Gram stain - \code{mo_gramstain()} - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes (ref: \url{https://itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=956097}). These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value \code{NA}.
#'
#' The function \code{mo_url()} will return the direct URL to the species in the Catalogue of Life.
#' @inheritSection get_locale Supported languages
#' @inheritSection ITIS ITIS
#' @inheritSection catalogue_of_life Catalogue of Life
#' @inheritSection as.mo Source
#' @rdname mo_property
#' @name mo_property
@ -49,14 +53,13 @@
#' # All properties of Escherichia coli
#' ## taxonomic properties
#' mo_kingdom("E. coli") # "Bacteria"
#' mo_subkingdom("E. coli") # "Negibacteria"
#' mo_phylum("E. coli") # "Proteobacteria"
#' mo_class("E. coli") # "Gammaproteobacteria"
#' mo_order("E. coli") # "Enterobacteriales"
#' mo_family("E. coli") # "Enterobacteriaceae"
#' mo_genus("E. coli") # "Escherichia"
#' mo_species("E. coli") # "coli"
#' mo_subspecies("E. coli") # NA
#' mo_subspecies("E. coli") # ""
#'
#' ## colloquial properties
#' mo_fullname("E. coli") # "Escherichia coli"
@ -220,12 +223,6 @@ mo_phylum <- function(x, ...) {
mo_validate(x = x, property = "phylum", ...)
}
#' @rdname mo_property
#' @export
mo_subkingdom <- function(x, ...) {
mo_validate(x = x, property = "subkingdom", ...)
}
#' @rdname mo_property
#' @export
mo_kingdom <- function(x, ...) {
@ -290,6 +287,15 @@ mo_taxonomy <- function(x, ...) {
subspecies = mo_subspecies(x))
}
#' @rdname mo_property
#' @export
mo_url <- function(x, ...) {
u <- mo_validate(x = x, property = "species_id", ...)
u[u != ""] <- paste0(catalogue_of_life$url, "/details/species/id/", u)
u
}
#' @rdname mo_property
#' @importFrom data.table data.table as.data.table setkey
#' @export

192
R/zzz.R
View File

@ -128,6 +128,198 @@ NULL
value = microorganisms.oldDT,
envir = asNamespace("AMR"))
# conversion of old MO codes from v0.5.0 (ITIS) to later versions (Catalogue of Life)
mo_codes_v0.5.0 <- c(B_ACHRMB = "B_ACHRM", B_ANNMA = "B_ACTNS", B_ACLLS = "B_ALCYC",
B_AHNGM = "B_ARCHN", B_ARMTM = "B_ARMTMN", B_ARTHRS = "B_ARTHR",
B_APHLS = "B_AZRHZP", B_BRCHA = "B_BRCHY", B_BCTRM = "B_BRVBCT",
B_CLRBCT = "B_CLRBC", B_CTRDM = "B_CLSTR", B_CPRMM = "B_CYLND",
B_DLCLN = "B_DPLCL", B_DMCLM = "B_DSLFT", B_DSLFVB = "B_DSLFV",
B_FCTRM = "B_FSBCT", B_GNRLA = "B_GRDNR", B_HNRBM = "B_HLNRB",
B_HPHGA = "B_HNPHGA", B_HCCCS = "B_HYDRC", B_MCRCLS = "B_MCRCL",
B_MTHYLS = "B_MLSMA", B_MARCLS = "B_MRCLS", B_MGCLS = "B_MSTGC",
B_MCLLA = "B_MTHYLC", B_MYCPLS = "B_MYCPL", B_NBCTR = "B_NTRBC",
B_OCLLS = "B_OCNBC", B_PTHRX = "B_PLNKT", B_PCCCS = "B_PRCHL",
B_PSPHN = "B_PRPHY", B_PDMNS = "B_PSDMN", B_SCCHRP = "B_SCCHR",
B_SRBCTR = "B_SHRBCTR", B_STRPTC = "B_STRPT", B_SHMNS = "B_SYNTR",
B_TRBCTR = "B_THRMN", P_ALBMN = "C_ABMNA", F_ACHLY = "C_ACHLY",
P_ACINT = "C_ACINT", P_ARTCL = "C_ACLNA", P_ACRVL = "C_ACRVL",
P_ADRCT = "C_ADRCT", P_AMPHS = "C_AHSRS", F_ALBUG = "C_ALBUG",
P_ALCNT = "C_ALCNT", P_ALFRD = "C_ALFRD", P_ALLGR = "C_ALLGR",
P_AMPHL = "C_ALPTS", F_ALTHR = "C_ALTHR", P_AMLLA = "C_AMLLA",
P_ANMLN = "C_AMLNA", P_AMMBC = "C_AMMBC", P_AMMDS = "C_AMMDS",
P_AMMLG = "C_AMMLG", P_AMMMR = "C_AMMMR", P_AMMMS = "C_AMMMS",
P_AMMON = "C_AMMON", P_AMMSC = "C_AMMSC", P_AMMSP = "C_AMMSP",
P_AMMST = "C_AMMST", P_AMMTM = "C_AMMTM", F_AMYCS = "C_AMYCS",
P_ANARM = "C_ANARM", P_ANGLD = "C_ANGLD", P_ANGLG = "C_ANGLG",
P_ANNLC = "C_ANNLC", F_ANSLP = "C_ANSLP", F_APDCH = "C_APDCH",
F_APHND = "C_APHND", F_APLNC = "C_APLNC", F_AQLND = "C_AQLND",
P_ARCHS = "C_ARCHAS", P_ASTRN = "C_ARNNN", P_ARNPR = "C_ARNPR",
F_ARSPR = "C_ARSPR", P_ARTST = "C_ARTSTR", P_AMPHC = "C_ARYNA",
P_ASCHM = "C_ASCHM", P_ASPDS = "C_ASPDS", P_ASTCL = "C_ASTCL",
P_ASTRG = "C_ASTRGR", P_ASTRM = "C_ASTRMM", P_ASTRR = "C_ASTRR",
P_ASTRT = "C_ASTRTR", F_ATKNS = "C_ATKNS", F_AYLLA = "C_AYLLA",
P_BAGGN = "C_BAGGN", P_BCCLL = "C_BCCLL", P_BDLLD = "C_BDLLD",
P_BGNRN = "C_BGNRN", P_BLCLN = "C_BLCLN", P_BLMND = "C_BLMND",
P_BLMNL = "C_BLMNL", P_BLPHR = "C_BLPHR", P_BLVNT = "C_BLVNT",
P_BOLVN = "C_BOLVN", P_BORLS = "C_BORLS", P_BRNNM = "C_BRNNM",
P_BRSLN = "C_BRSLN", P_BRSRD = "C_BRSRD", F_BRVLG = "C_BRVLG",
F_BNLLA = "C_BRVLGN", P_BSCCM = "C_BSCCM", F_BSDPH = "C_BSDPH",
P_BTHYS = "C_BTHYS", P_BTLLN = "C_BTLLN", P_BULMN = "C_BULMN",
P_CCLDM = "C_CCLDM", P_CDNLL = "C_CDNLL", P_CLPSS = "C_CDNLLP",
P_CHLDN = "C_CHLDNL", P_CHLST = "C_CHLST", P_CHNLM = "C_CHNLM",
P_CHRYS = "C_CHRYSL", P_CHTSP = "C_CHTSP", P_CBCDS = "C_CIBCDS",
P_CLCRN = "C_CLCRN", P_CLMNA = "C_CLMNA", P_CLPDM = "C_CLPDM",
P_CLPHR = "C_CLPHRY", P_CLVLN = "C_CLVLN", P_CMPNL = "C_CMPNL",
P_CNCRS = "C_CNCRS", P_CNTCH = "C_CNTCH", F_CNTRM = "C_CNTRMY",
P_COLPD = "C_COLPD", P_COLPS = "C_COLPS", P_CPRDS = "C_CPRDS",
P_CRNSP = "C_CPRMA", P_CRBNL = "C_CRBNL", P_CRBRB = "C_CRBRB",
P_CRBRG = "C_CRBRG", P_CRBRS = "C_CRBRS", P_CRCHS = "C_CRCHS",
P_CRCLC = "C_CRCLC", P_CRNLC = "C_CRNLC", P_CRNTH = "C_CRNTH",
P_CRPNT = "C_CRPNT", P_CRSTG = "C_CRSTG", P_CRTHN = "C_CRTHN",
P_CRTRN = "C_CRTRN", P_CYMBL = "C_CRTTA", P_CRYPT = "C_CRYPT",
P_CSHMN = "C_CSHMNL", P_CSSDL = "C_CSSDL", P_CLNDS = "C_CSSDLN",
P_CHRNA = "C_CTHRN", P_CTPSS = "C_CTPSS", P_CUNLN = "C_CUNLN",
P_CYLND = "C_CVLNA", P_CYCLC = "C_CYCLCB", P_CDNTA = "C_CYCLD",
P_CYCLG = "C_CYCLG", P_CYCLM = "C_CYCLM", P_CYRTL = "C_CYRTL",
P_CYSTM = "C_CYSTM", P_DCHLM = "C_DCHLM", P_DCRBS = "C_DCRBS",
P_DCTYC = "C_DCTYC", P_DIDNM = "C_DIDNM", P_DLPTS = "C_DLPTS",
P_DNTLN = "C_DNTLN", P_DNTST = "C_DNTST", P_DORTH = "C_DORTH",
P_DCTYP = "C_DPHMS", F_DPLCY = "C_DPLCY", P_DNDRT = "C_DRTNA",
P_DSCMM = "C_DSCMM", P_DSCRB = "C_DSCRB", P_DSCRN = "C_DSCRN",
P_DSCSP = "C_DSCSP", P_DSNBR = "C_DSNBR", P_DYCBC = "C_DYCBC",
F_DCTYC = "C_DYCHS", F_ECTRG = "C_ECTRG", B_EDWRD = "C_EDWRD",
P_EGGRL = "C_EGGRL", P_EHLYS = "C_EHLYS", P_EHRNB = "C_EHRNB",
P_ELPHD = "C_ELPHD", P_ENCHL = "C_ELYDM", P_EPHDM = "C_EPHDM",
P_EPLTS = "C_EPLTS", P_EPLXL = "C_EPLXL", P_EPNDL = "C_EPNDL",
P_EPNDS = "C_EPNDS", P_ENLLA = "C_EPSTM", P_EPSTY = "C_EPSTY",
F_ERYCH = "C_ERYCH", F_ESMDM = "C_ESMDM", P_ESSYR = "C_ESSYR",
P_FSCHR = "C_FHRNA", P_FLRLS = "C_FLRLS", P_FLNTN = "C_FNTNA",
P_FRNDC = "C_FRNDC", P_FRNTN = "C_FRNTN", P_FRSNK = "C_FRSNK",
P_FNLLA = "C_FSCHRN", P_FSSRN = "C_FSSRN", P_FVCSS = "C_FVCSS",
P_GDRYN = "C_GDRYN", F_GELGN = "C_GELGN", P_GERDA = "C_GERDA",
P_GLACM = "C_GLACM", P_GLBBL = "C_GLBBL", P_GLBGR = "C_GLBGR",
P_GLBLN = "C_GLBLN", P_GRTLA = "C_GLBRT", P_GLBTX = "C_GLBTX",
P_GLLNA = "C_GLLNA", P_GLMSP = "C_GLMSP", P_GLNDL = "C_GLNDL",
F_GNMCH = "C_GNMCH", P_GOSLL = "C_GOSLL", P_GRNDS = "C_GRNDS",
P_GRNTA = "C_GRNTA", P_GLBRT = "C_GTLLA", P_GTTLN = "C_GTTLN",
P_GVLNP = "C_GVLNP", P_GYPSN = "C_GYPSN", P_GYRDN = "C_GYRDN",
P_HALTR = "C_HALTR", P_HANZW = "C_HANZW", P_HAURN = "C_HAURN",
P_HELNN = "C_HELNN", P_HLPHR = "C_HHRYA", P_HLNTA = "C_HLNTA",
F_HLPHT = "C_HLPHT", P_HLSTC = "C_HLSTC", P_HMSPH = "C_HMSPH",
P_HMTRM = "C_HMTRM", P_HPKNS = "C_HPKNS", P_HPLPH = "C_HPLPH",
P_HPPCR = "C_HPPCR", P_HNLLA = "C_HPPCRP", P_HRMSN = "C_HRMSN",
P_HRNLL = "C_HRNLL", F_HRPCH = "C_HRPCH", P_HSTGR = "C_HSTGR",
P_HSTTL = "C_HSTTL", P_HTRST = "C_HTGNA", P_HTRLL = "C_HTRLL",
P_HTRPH = "C_HTRPH", F_HYPHC = "C_HYPHC", P_HYPRM = "C_HYPRM",
P_INTRN = "C_INTRN", P_IRIDI = "C_IRIDI", P_ISLND = "C_ISLND",
P_JCLLL = "C_JCLLL", P_KHLLL = "C_KHLLL", P_KRNPS = "C_KRNPS",
P_KRRRL = "C_KRRRL", P_LABOE = "C_LABOE", P_LAGEN = "C_LAGEN",
P_LBSLL = "C_LBSLL", F_LTHLA = "C_LBYRN", P_LCRYM = "C_LCRYM",
P_LEMBS = "C_LEMBS", F_LGNDM = "C_LGNDM", P_LGNMM = "C_LGNMM",
P_LGNPH = "C_LGNPHR", F_LGNSM = "C_LGNSM", P_LGYNP = "C_LGYNP",
P_LITTB = "C_LITTB", P_LITUL = "C_LITUL", P_LMBDN = "C_LMBDN",
P_LMRCK = "C_LMRCK", F_LBYRN = "C_LMYXA", P_LNGLN = "C_LNGLN",
P_LNTCL = "C_LNTCL", P_LOXDS = "C_LOXDS", F_LPTLG = "C_LPTLG",
F_LNLLA = "C_LPTLGN", F_LPTMT = "C_LPTMT", P_LRYNG = "C_LRYNG",
P_LTCRN = "C_LTCRN", P_LTHPL = "C_LTHPL", P_LTNTS = "C_LTNTS",
F_LTRST = "C_LTRST", P_LXPHY = "C_LXPHY", P_MCRTH = "C_MCRTH",
P_MELNS = "C_MELNS", P_MSDNM = "C_MESDNM", P_METPS = "C_METPS",
P_MIMSN = "C_MIMSN", P_MINCN = "C_MINCN", P_MLLNL = "C_MLLNL",
P_MLMMN = "C_MLMMN", F_MNDNL = "C_MNDNL", P_MNLYS = "C_MNLYS",
P_MNPSS = "C_MNPSS", P_MRGNL = "C_MRGNL", P_MRGNP = "C_MRGNP",
P_MRSPL = "C_MRSPL", P_MRTNT = "C_MRTNT", P_MSSLN = "C_MSSLN",
P_MSSSS = "C_MSSSS", P_MTCNT = "C_MTCNT", P_MYCHS = "C_MYCHS",
P_MYSCH = "C_MYSCH", F_MYZCY = "C_MYZCY", P_NASSL = "C_NASSL",
P_NBCLN = "C_NBCLN", P_NBCLR = "C_NBCLR", P_NCNRB = "C_NCNRB",
P_NDBCL = "C_NDBCL", P_NRLLA = "C_NDBCLR", P_NMMLC = "C_NMMLC",
F_NMTPH = "C_NMTPH", P_NNNLL = "C_NNNLL", P_NODSR = "C_NODSR",
P_NONIN = "C_NONIN", P_NOURI = "C_NOURI", P_OCLNA = "C_OCLNA",
P_OGLNA = "C_OGLNA", P_OPHTH = "C_OLMDM", F_OLPDP = "C_OLPDP",
P_ONYCH = "C_OMPSS", P_OOLIN = "C_OOLIN", P_OPRCL = "C_OPRCL",
P_ORBLN = "C_ORBLN", F_ORCAD = "C_ORCAD", P_ORDRS = "C_ORDRS",
P_OPHRY = "C_ORYDM", P_OSNGL = "C_OSNGL", P_OXYTR = "C_OXYTR",
P_PARRN = "C_PARRN", P_PATRS = "C_PATRS", P_PAVNN = "C_PAVNN",
P_PTYCH = "C_PCYLS", P_PDPHR = "C_PDPHR", P_PELSN = "C_PELSN",
F_PHGMY = "C_PHGMY", F_PSDSP = "C_PHRTA", P_PHRYG = "C_PHRYG",
P_PHYSL = "C_PHYSL", F_PHYTP = "C_PHYTP", P_PLACS = "C_PLACS",
P_PLCPS = "C_PLCPS", P_PLCPSL = "C_PLCPSL", P_PLCTN = "C_PLCTN",
P_PLGPH = "C_PLGPH", B_PLGTH = "C_PLGTH", P_PLMRN = "C_PLMRN",
P_PLNCT = "C_PLNCT", P_PLNDSC = "C_PLNDSC", P_PLNGY = "C_PLNGY",
P_PLNRBL = "C_PLNLLA", P_PLNLN = "C_PLNLN", P_PLNLR = "C_PLNLR",
P_PLNRB = "C_PLNRB", P_PLNSP = "C_PLNSPR", P_PLRNM = "C_PLRNM",
P_PLRST = "C_PLRST", P_PLRTR = "C_PLRTR", F_PLSMD = "C_PLSMD",
P_PLTYC = "C_PLTYC", P_PSDBL = "C_PLVNA", P_PLYMR = "C_PLYMR",
P_PLTYN = "C_PNMTM", P_PNRPL = "C_PNRPL", F_PNTSM = "C_PNTSM",
P_PRCNT = "C_PRCNT", P_PRFSS = "C_PRFSS", P_PRMCM = "C_PRMCUM",
F_PRNSP = "C_PRNSP", P_PRPND = "C_PRPND", P_PRPYX = "C_PRPYX",
P_PRRDN = "C_PRRDN", P_PSDDF = "C_PSDDF", P_PSDMC = "C_PSDMC",
P_PSDND = "C_PSDND", P_PSDNN = "C_PSDNN", P_PSDPL = "C_PSDPLY",
P_PSMMS = "C_PSMMS", P_PTLLN = "C_PTLLN", P_PTLLND = "C_PTLLND",
F_PTRSN = "C_PTRSN", P_PULLN = "C_PULLN", P_PUTLN = "C_PUTLN",
P_PRTTR = "C_PYMNA", P_PYRGL = "C_PYRGL", P_PYRGO = "C_PYRGO",
P_PYRLN = "C_PYRLN", F_PYTHM = "C_PYTHIM", F_PYTHL = "C_PYTHL",
P_PYXCL = "C_PYXCL", P_QNQLC = "C_QNQLC", P_RAMLN = "C_RAMLN",
P_RBRTN = "C_RBRTN", P_RCRVD = "C_RCRVD", P_RCTBL = "C_RCTBL",
P_RCTCB = "C_RCTCB", P_RCTGL = "C_RCTGL", P_RCTVG = "C_RCTVG",
P_RDGDR = "C_RDGDR", P_REMNC = "C_REMNC", P_REPHX = "C_REPHX",
P_RHBDM = "C_RHBDMM", F_RHBDS = "C_RHBDSP", P_RHPDD = "C_RHPDD",
F_RHPDM = "C_RHPDM", F_RHZDMY = "C_RHZDM", P_RHZMM = "C_RHZMM",
P_RIVRN = "C_RIVRN", P_ROSLN = "C_ROSLN", P_ROTAL = "C_ROTAL",
P_RPHDP = "C_RPHDP", P_RPRTN = "C_RPRTN", P_RSSLL = "C_RSSLL",
P_RTLMM = "C_RTLMM", P_RTYLA = "C_RTYLA", P_RUGID = "C_RUGID",
F_RZLLP = "C_RZLLP", P_SAGRN = "C_SAGRN", P_SCCMM = "C_SCCMM",
P_SCCRH = "C_SCCRH", P_SCHLM = "C_SCHLM", F_SCLRS = "C_SCLRS",
P_SCTLR = "C_SCTLR", P_SEBRK = "C_SEBRK", P_SGMLN = "C_SGMLN",
P_SGMLP = "C_SGMLP", P_SGMMR = "C_SGMMR", P_SGMVR = "C_SGMVR",
F_SMMRS = "C_SMMRS", P_SNNDS = "C_SNNDS", P_SORTS = "C_SORTS",
P_SPHGN = "C_SPHGN", P_SPHNN = "C_SPHNN", P_SNLLA = "C_SPHNNL",
P_SPHTR = "C_SPHTR", P_SPHTX = "C_SPHTX", P_SPHVG = "C_SPHVG",
P_SPRDT = "C_SPRDT", P_SPRLC = "C_SPRLC", F_SPRLG = "C_SPRLG",
P_SPRLL = "C_SPRLL", F_SPRMY = "C_SPRMY", P_SPRPL = "C_SPRPL",
P_SPRSG = "C_SPRSG", P_SPRST = "C_SPRST", P_SPHNP = "C_SPRTA",
P_SPRZN = "C_SPRZN", P_SPHRG = "C_SPSNA", P_STHDM = "C_SPTHD",
P_SRCNR = "C_SRCNR", F_SRLPD = "C_SRLPD", F_SPNGS = "C_SSPRA",
F_STEIN = "C_STEIN", P_SPTHD = "C_STHDDS", P_STHRP = "C_STHRP",
P_STNFR = "C_STNFR", P_STNSM = "C_STNSM", P_STNTR = "C_STNTR",
P_STRBL = "C_STRBL", P_STRMB = "C_STRMB", P_STTSN = "C_STTSN",
P_STYLN = "C_SYCHA", F_SCHZC = "C_SYTRM", P_TBNLL = "C_TBNLL",
P_TRCHL = "C_TCHLS", P_TCHNT = "C_TCHNT", P_THRCL = "C_THRCL",
P_THRMM = "C_THRMM", P_TIARN = "C_TIARN", P_TKPHR = "C_TKPHR",
P_TLNMA = "C_TLNMA", P_TLYPM = "C_TLYPM", P_TMNDS = "C_TMNDS",
P_TMNTA = "C_TMNTA", P_TNTNN = "C_TNNDM", P_TTNNS = "C_TNTNN",
P_TNPSS = "C_TNTNNP", P_TONTN = "C_TONTN", P_TOSAI = "C_TOSAI",
P_TPHTR = "C_TPHTR", P_TRCHH = "C_TRCHH", P_TRPHS = "C_TRCHLR",
P_TMMNA = "C_TRCHM", P_TRCHS = "C_TRCHSP", P_TRFRN = "C_TRFRN",
P_TRLCL = "C_TRLCL", P_TRTXL = "C_TRTXL", P_TRTXS = "C_TRTXS",
P_TTRHY = "C_TTRHY", F_TTRMY = "C_TTRMY", P_TXTLR = "C_TXTLR",
F_THRST = "C_TYTRM", P_URLPT = "C_ULPTS", P_UNGLT = "C_UNGLT",
P_URCNT = "C_URCNT", P_URONM = "C_URONM", P_UROSM = "C_UROSM",
P_URTRC = "C_URTRC", P_URSTY = "C_UTYLA", P_UVGRN = "C_UVGRN",
P_VLVLN = "C_VALVLN", P_VGNLN = "C_VGNLN", P_VGNLNP = "C_VGNLNP",
P_VLNRA = "C_VLVLN", P_VGNCL = "C_VNCLA", P_VRGLN = "C_VRGLN",
P_VRGLNP = "C_VRGLNP", P_VRTCL = "C_VRTCL", P_WBBNL = "C_WBBNL",
P_WEBBN = "C_WEBBN", P_WSNRL = "C_WSNRL", P_ZTHMN = "C_ZHMNM",
B_ZOOGL = "C_ZOOGL", F_DDSCS = "F_DPDSC", F_SCCHR = "F_SMYCS",
P_AMTRN = "P_ACNTH", F_AMBDM = "P_AMBDM", F_ARCYR = "P_ARCYR",
F_BADHM = "P_BADHM", F_BDHMP = "P_BDHMP", F_BRBYL = "P_BRBYL",
F_BRFLD = "P_BRFLD", F_CLMYX = "P_CLMYX", F_CLSTD = "P_CLSTD",
F_CMTRC = "P_CMTRC", F_CRBRR = "P_CRBRR", F_CRTMY = "P_CRTMY",
F_CRTRM = "P_CRTRM", F_DCTYD = "P_DCTYD", F_DDYMM = "P_DDYMM",
F_DIACH = "P_DIACH", F_DIANM = "P_DIANM", F_DIDRM = "P_DIDRM",
F_ELMYX = "P_ELMYX", F_ESTLM = "P_ESTLM", F_FULIG = "P_FULIG",
F_HMTRC = "P_HMTRC", F_LCRPS = "P_LCRPS", F_LICEA = "P_LICEA",
F_LMPRD = "P_LMPRD", F_LPTDR = "P_LPTDR", F_LSTRL = "P_LSTRL",
F_LYCGL = "P_LYCGL", F_MCBRD = "P_MCBRD", F_MNKTL = "P_MNKTL",
F_MTTRC = "P_MTTRC", F_MUCLG = "P_MUCLG", F_PHYSR = "P_PHYSR",
F_PRCHN = "P_PRCHN", F_PRMBD = "P_PRMBD", F_PRTPH = "P_PRTPH",
F_PSRNA = "P_PSRNA", F_PYSRM = "P_PYSRM", F_RTCLR = "P_RTCLR",
F_STMNT = "P_STMNT", F_SYMPH = "P_SYMPH", F_TRBRK = "P_TRBRK",
F_TRICH = "P_TRICH", F_TUBFR = "P_TUBFR")
assign(x = "mo_codes_v0.5.0",
value = mo_codes_v0.5.0,
envir = asNamespace("AMR"))
# packageStartupMessage("OK.", appendLF = TRUE)
}
}

View File

@ -88,7 +88,8 @@ reference:
for more information about how to work with functions in this package.
contents:
- '`AMR`'
- '`ITIS`'
- '`catalogue_of_life`'
- '`catalogue_of_life_version`'
- '`WHOCC`'
- title: 'Cleaning your data'
desc: >
@ -145,7 +146,6 @@ reference:
- '`WHONET`'
- '`microorganisms.codes`'
- '`microorganisms.old`'
- '`supplementary_data`'
- title: Other
desc: >
These functions are mostly for internal use, but some of

Binary file not shown.

Binary file not shown.

View File

@ -192,7 +192,7 @@
<h1>How to conduct AMR analysis</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 February 2019</h4>
<h4 class="date">20 February 2019</h4>
<div class="hidden name"><code>AMR.Rmd</code></div>
@ -201,7 +201,7 @@
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">RMarkdown</a>. However, the methodology remains unchanged. This page was generated on 18 February 2019.</p>
<p><strong>Note:</strong> values on this page will change with every website update since they are based on randomly created values and the page was written in <a href="https://rmarkdown.rstudio.com/">RMarkdown</a>. However, the methodology remains unchanged. This page was generated on 20 February 2019.</p>
<div id="introduction" class="section level1">
<h1 class="hasAnchor">
<a href="#introduction" class="anchor"></a>Introduction</h1>
@ -217,21 +217,21 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2019-02-18</td>
<td align="center">2019-02-20</td>
<td align="center">abcd</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
</tr>
<tr class="even">
<td align="center">2019-02-18</td>
<td align="center">2019-02-20</td>
<td align="center">abcd</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">R</td>
</tr>
<tr class="odd">
<td align="center">2019-02-18</td>
<td align="center">2019-02-20</td>
<td align="center">efgh</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
@ -327,71 +327,71 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2011-01-25</td>
<td align="center">V6</td>
<td align="center">Hospital A</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2013-07-31</td>
<td align="center">A8</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2016-10-12</td>
<td align="center">Y3</td>
<td align="center">Hospital D</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2013-12-31</td>
<td align="center">B4</td>
<td align="center">2012-08-24</td>
<td align="center">V3</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2014-08-10</td>
<td align="center">F9</td>
<td align="center">Hospital A</td>
<tr class="even">
<td align="center">2013-04-28</td>
<td align="center">S3</td>
<td align="center">Hospital B</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2013-05-13</td>
<td align="center">F2</td>
<td align="center">Hospital D</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2017-12-05</td>
<td align="center">H7</td>
<td align="center">Hospital A</td>
<td align="center">2017-04-04</td>
<td align="center">I9</td>
<td align="center">Hospital C</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="odd">
<td align="center">2015-12-23</td>
<td align="center">G9</td>
<td align="center">Hospital B</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2011-12-19</td>
<td align="center">T2</td>
<td align="center">Hospital B</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
</tbody>
</table>
<p>Now, lets start the cleaning and the analysis!</p>
@ -411,8 +411,8 @@
#&gt;
#&gt; Item Count Percent Cum. Count Cum. Percent
#&gt; --- ----- ------- -------- ----------- -------------
#&gt; 1 M 10,283 51.4% 10,283 51.4%
#&gt; 2 F 9,717 48.6% 20,000 100.0%</code></pre>
#&gt; 1 M 10,471 52.4% 10,471 52.4%
#&gt; 2 F 9,529 47.6% 20,000 100.0%</code></pre>
<p>So, we can draw at least two conclusions immediately. From a data scientist perspective, the data looks clean: only values <code>M</code> and <code>F</code>. From a researcher perspective: there are slightly more men. Nothing we didnt already know.</p>
<p>The data is already quite clean, but we still need to transform some variables. The <code>bacteria</code> column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The <code><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate()</a></code> function of the <code>dplyr</code> package makes this really easy:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" title="1">data &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span></a>
@ -443,10 +443,10 @@
<a class="sourceLine" id="cb14-19" title="19"><span class="co">#&gt; Kingella kingae (no changes)</span></a>
<a class="sourceLine" id="cb14-20" title="20"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb14-21" title="21"><span class="co">#&gt; EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)</span></a>
<a class="sourceLine" id="cb14-22" title="22"><span class="co">#&gt; Table 1: Intrinsic resistance in Enterobacteriaceae (1294 changes)</span></a>
<a class="sourceLine" id="cb14-22" title="22"><span class="co">#&gt; Table 1: Intrinsic resistance in Enterobacteriaceae (1288 changes)</span></a>
<a class="sourceLine" id="cb14-23" title="23"><span class="co">#&gt; Table 2: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb14-24" title="24"><span class="co">#&gt; Table 3: Intrinsic resistance in other Gram-negative bacteria (no changes)</span></a>
<a class="sourceLine" id="cb14-25" title="25"><span class="co">#&gt; Table 4: Intrinsic resistance in Gram-positive bacteria (2822 changes)</span></a>
<a class="sourceLine" id="cb14-25" title="25"><span class="co">#&gt; Table 4: Intrinsic resistance in Gram-positive bacteria (2757 changes)</span></a>
<a class="sourceLine" id="cb14-26" title="26"><span class="co">#&gt; Table 8: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)</span></a>
<a class="sourceLine" id="cb14-27" title="27"><span class="co">#&gt; Table 9: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)</span></a>
<a class="sourceLine" id="cb14-28" title="28"><span class="co">#&gt; Table 10: Interpretive rules for B-lactam agents and other Gram-negative bacteria (no changes)</span></a>
@ -462,9 +462,9 @@
<a class="sourceLine" id="cb14-38" title="38"><span class="co">#&gt; Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)</span></a>
<a class="sourceLine" id="cb14-39" title="39"><span class="co">#&gt; Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)</span></a>
<a class="sourceLine" id="cb14-40" title="40"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb14-41" title="41"><span class="co">#&gt; =&gt; EUCAST rules affected 7,463 out of 20,000 rows</span></a>
<a class="sourceLine" id="cb14-41" title="41"><span class="co">#&gt; =&gt; EUCAST rules affected 7,243 out of 20,000 rows</span></a>
<a class="sourceLine" id="cb14-42" title="42"><span class="co">#&gt; -&gt; added 0 test results</span></a>
<a class="sourceLine" id="cb14-43" title="43"><span class="co">#&gt; -&gt; changed 4,116 test results (0 to S; 0 to I; 4,116 to R)</span></a></code></pre></div>
<a class="sourceLine" id="cb14-43" title="43"><span class="co">#&gt; -&gt; changed 4,045 test results (0 to S; 0 to I; 4,045 to R)</span></a></code></pre></div>
</div>
<div id="adding-new-variables" class="section level1">
<h1 class="hasAnchor">
@ -489,8 +489,8 @@
<a class="sourceLine" id="cb16-3" title="3"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `bacteria` as input for `col_mo`.</span></a>
<a class="sourceLine" id="cb16-4" title="4"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `date` as input for `col_date`.</span></a>
<a class="sourceLine" id="cb16-5" title="5"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb16-6" title="6"><span class="co">#&gt; =&gt; Found 5,654 first isolates (28.3% of total)</span></a></code></pre></div>
<p>So only 28.3% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<a class="sourceLine" id="cb16-6" title="6"><span class="co">#&gt; =&gt; Found 5,692 first isolates (28.5% of total)</span></a></code></pre></div>
<p>So only 28.5% is suitable for resistance analysis! We can now filter on it with the <code><a href="https://dplyr.tidyverse.org/reference/filter.html">filter()</a></code> function, also from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" title="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-2" title="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(first <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>)</a></code></pre></div>
<p>For future use, the above two syntaxes can be shortened with the <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> function:</p>
@ -516,8 +516,8 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-04-05</td>
<td align="center">Q7</td>
<td align="center">2010-01-31</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">S</td>
@ -527,30 +527,30 @@
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-05-10</td>
<td align="center">Q7</td>
<td align="center">2010-03-09</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-06-22</td>
<td align="center">Q7</td>
<td align="center">2010-05-30</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-06-25</td>
<td align="center">Q7</td>
<td align="center">2010-06-22</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -560,41 +560,41 @@
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-10-03</td>
<td align="center">Q7</td>
<td align="center">2011-01-10</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-10-08</td>
<td align="center">Q7</td>
<td align="center">2011-02-19</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-03-24</td>
<td align="center">Q7</td>
<td align="center">2011-02-21</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-03-27</td>
<td align="center">Q7</td>
<td align="center">2011-05-11</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -604,21 +604,21 @@
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-05-11</td>
<td align="center">Q7</td>
<td align="center">2011-07-06</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">TRUE</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-07-22</td>
<td align="center">Q7</td>
<td align="center">2011-08-11</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
@ -637,7 +637,7 @@
<a class="sourceLine" id="cb19-7" title="7"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `patient_id` as input for `col_patient_id`.</span></a>
<a class="sourceLine" id="cb19-8" title="8"><span class="co">#&gt; </span><span class="al">NOTE</span><span class="co">: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.</span></a>
<a class="sourceLine" id="cb19-9" title="9"><span class="co">#&gt; [Criterion] Inclusion based on key antibiotics, ignoring I.</span></a>
<a class="sourceLine" id="cb19-10" title="10"><span class="co">#&gt; =&gt; Found 15,805 first weighted isolates (79.0% of total)</span></a></code></pre></div>
<a class="sourceLine" id="cb19-10" title="10"><span class="co">#&gt; =&gt; Found 15,864 first weighted isolates (79.3% of total)</span></a></code></pre></div>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -654,8 +654,8 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-04-05</td>
<td align="center">Q7</td>
<td align="center">2010-01-31</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">S</td>
@ -666,11 +666,11 @@
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-05-10</td>
<td align="center">Q7</td>
<td align="center">2010-03-09</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
@ -678,11 +678,11 @@
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-06-22</td>
<td align="center">Q7</td>
<td align="center">2010-05-30</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
@ -690,8 +690,8 @@
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-06-25</td>
<td align="center">Q7</td>
<td align="center">2010-06-22</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
@ -702,83 +702,83 @@
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-10-03</td>
<td align="center">Q7</td>
<td align="center">2011-01-10</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-10-08</td>
<td align="center">Q7</td>
<td align="center">2011-02-19</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2011-03-24</td>
<td align="center">Q7</td>
<td align="center">2011-02-21</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2011-03-27</td>
<td align="center">Q7</td>
<td align="center">2011-05-11</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2011-05-11</td>
<td align="center">Q7</td>
<td align="center">2011-07-06</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-07-22</td>
<td align="center">Q7</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-08-11</td>
<td align="center">C6</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
</tr>
</tbody>
</table>
<p>Instead of 2, now 4 isolates are flagged. In total, 79% of all isolates are marked first weighted - 50.8% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>Instead of 2, now 6 isolates are flagged. In total, 79.3% of all isolates are marked first weighted - 50.9% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.</p>
<p>As with <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>, theres a shortcut for this new algorithm too:</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" title="1">data_1st &lt;-<span class="st"> </span>data <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb20-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_weighted_isolate</a></span>()</a></code></pre></div>
<p>So we end up with 15,805 isolates for analysis.</p>
<p>So we end up with 15,864 isolates for analysis.</p>
<p>We can remove unneeded columns:</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" title="1">data_1st &lt;-<span class="st"> </span>data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb21-2" title="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/select.html">select</a></span>(<span class="op">-</span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(first, keyab))</a></code></pre></div>
@ -803,45 +803,45 @@
</tr></thead>
<tbody>
<tr class="odd">
<td>2</td>
<td align="center">2013-07-31</td>
<td align="center">A8</td>
<td align="center">Hospital D</td>
<td>1</td>
<td align="center">2012-08-24</td>
<td align="center">V3</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>3</td>
<td align="center">2016-10-12</td>
<td align="center">Y3</td>
<td align="center">Hospital D</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">F</td>
<td align="center">Gram negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>5</td>
<td align="center">2014-08-10</td>
<td align="center">F9</td>
<td align="center">Hospital A</td>
<tr class="even">
<td>2</td>
<td align="center">2013-04-28</td>
<td align="center">S3</td>
<td align="center">Hospital B</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>3</td>
<td align="center">2013-05-13</td>
<td align="center">F2</td>
<td align="center">Hospital D</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
@ -851,53 +851,53 @@
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>5</td>
<td align="center">2015-12-23</td>
<td align="center">G9</td>
<td align="center">Hospital B</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>6</td>
<td align="center">2017-12-05</td>
<td align="center">H7</td>
<td align="center">2011-12-19</td>
<td align="center">T2</td>
<td align="center">Hospital B</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>7</td>
<td align="center">2011-11-26</td>
<td align="center">J1</td>
<td align="center">Hospital A</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">M</td>
<td align="center">Gram negative</td>
<td align="center">Escherichia</td>
<td align="center">coli</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>7</td>
<td align="center">2014-02-06</td>
<td align="center">D7</td>
<td align="center">Hospital C</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>8</td>
<td align="center">2013-05-11</td>
<td align="center">A5</td>
<td align="center">Hospital A</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
<td align="center">Gram positive</td>
<td align="center">Staphylococcus</td>
<td align="center">aureus</td>
<td align="center">TRUE</td>
</tr>
</tbody>
</table>
<p>Time for the analysis!</p>
@ -915,9 +915,9 @@
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb23-1" title="1"><span class="kw"><a href="../reference/freq.html">freq</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste</a></span>(data_1st<span class="op">$</span>genus, data_1st<span class="op">$</span>species))</a></code></pre></div>
<p>Or can be used like the <code>dplyr</code> way, which is easier readable:</p>
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" title="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(genus, species)</a></code></pre></div>
<p><strong>Frequency table of <code>genus</code> and <code>species</code> from a <code>data.frame</code> (15,805 x 13)</strong></p>
<p><strong>Frequency table of <code>genus</code> and <code>species</code> from a <code>data.frame</code> (15,864 x 13)</strong></p>
<p>Columns: 2<br>
Length: 15,805 (of which NA: 0 = 0.00%)<br>
Length: 15,864 (of which NA: 0 = 0.00%)<br>
Unique: 4</p>
<p>Shortest: 16<br>
Longest: 24</p>
@ -934,33 +934,33 @@ Longest: 24</p>
<tr class="odd">
<td align="left">1</td>
<td align="left">Escherichia coli</td>
<td align="right">7,815</td>
<td align="right">49.4%</td>
<td align="right">7,815</td>
<td align="right">49.4%</td>
<td align="right">7,849</td>
<td align="right">49.5%</td>
<td align="right">7,849</td>
<td align="right">49.5%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">3,988</td>
<td align="right">25.2%</td>
<td align="right">11,803</td>
<td align="right">74.7%</td>
<td align="right">4,010</td>
<td align="right">25.3%</td>
<td align="right">11,859</td>
<td align="right">74.8%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,476</td>
<td align="right">15.7%</td>
<td align="right">14,279</td>
<td align="right">90.3%</td>
<td align="right">2,443</td>
<td align="right">15.4%</td>
<td align="right">14,302</td>
<td align="right">90.2%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,526</td>
<td align="right">9.7%</td>
<td align="right">15,805</td>
<td align="right">1,562</td>
<td align="right">9.8%</td>
<td align="right">15,864</td>
<td align="right">100.0%</td>
</tr>
</tbody>
@ -971,7 +971,7 @@ Longest: 24</p>
<a href="#resistance-percentages" class="anchor"></a>Resistance percentages</h2>
<p>The functions <code>portion_R</code>, <code>portion_RI</code>, <code>portion_I</code>, <code>portion_IS</code> and <code>portion_S</code> can be used to determine the portion of a specific antimicrobial outcome. They can be used on their own:</p>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" title="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_IR</a></span>(amox)</a>
<a class="sourceLine" id="cb25-2" title="2"><span class="co">#&gt; [1] 0.4771275</span></a></code></pre></div>
<a class="sourceLine" id="cb25-2" title="2"><span class="co">#&gt; [1] 0.4777484</span></a></code></pre></div>
<p>Or can be used in conjuction with <code><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by()</a></code> and <code><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise()</a></code>, both from the <code>dplyr</code> package:</p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" title="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb26-2" title="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(hospital) <span class="op">%&gt;%</span><span class="st"> </span></a>
@ -984,19 +984,19 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4661749</td>
<td align="center">0.4814277</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4820906</td>
<td align="center">0.4811252</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4847862</td>
<td align="center">0.4843815</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4790875</td>
<td align="center">0.4610721</td>
</tr>
</tbody>
</table>
@ -1014,23 +1014,23 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4661749</td>
<td align="center">4745</td>
<td align="center">0.4814277</td>
<td align="center">4819</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4820906</td>
<td align="center">5472</td>
<td align="center">0.4811252</td>
<td align="center">5510</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4847862</td>
<td align="center">2432</td>
<td align="center">0.4843815</td>
<td align="center">2401</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4790875</td>
<td align="center">3156</td>
<td align="center">0.4610721</td>
<td align="center">3134</td>
</tr>
</tbody>
</table>
@ -1050,27 +1050,27 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.7332054</td>
<td align="center">0.9033909</td>
<td align="center">0.9754319</td>
<td align="center">0.7180533</td>
<td align="center">0.8983310</td>
<td align="center">0.9704421</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.7142857</td>
<td align="center">0.9095675</td>
<td align="center">0.9737877</td>
<td align="center">0.7189501</td>
<td align="center">0.8879641</td>
<td align="center">0.9654289</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.7179037</td>
<td align="center">0.9162487</td>
<td align="center">0.9779338</td>
<td align="center">0.7231920</td>
<td align="center">0.9216958</td>
<td align="center">0.9790524</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.7289984</td>
<td align="center">0.7372084</td>
<td align="center">0.0000000</td>
<td align="center">0.7289984</td>
<td align="center">0.7372084</td>
</tr>
</tbody>
</table>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -192,7 +192,7 @@
<h1>How to apply EUCAST rules</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 February 2019</h4>
<h4 class="date">20 February 2019</h4>
<div class="hidden name"><code>EUCAST.Rmd</code></div>

View File

@ -192,7 +192,7 @@
<h1>How to use the <em>G</em>-test</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 February 2019</h4>
<h4 class="date">20 February 2019</h4>
<div class="hidden name"><code>G_test.Rmd</code></div>

View File

@ -192,7 +192,7 @@
<h1>How to work with WHONET data</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 February 2019</h4>
<h4 class="date">20 February 2019</h4>
<div class="hidden name"><code>WHONET.Rmd</code></div>

View File

@ -192,7 +192,7 @@
<h1>How to get properties of an antibiotic</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 February 2019</h4>
<h4 class="date">20 February 2019</h4>
<div class="hidden name"><code>atc_property.Rmd</code></div>

View File

@ -192,7 +192,7 @@
<h1>Benchmarks</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">14 February 2019</h4>
<h4 class="date">20 February 2019</h4>
<div class="hidden name"><code>benchmarks.Rmd</code></div>
@ -201,161 +201,183 @@
<p>One of the most important features of this package is the complete microbial taxonomic database, supplied by ITIS (<a href="https://www.itis.gov" class="uri">https://www.itis.gov</a>). We created a function <code><a href="../reference/as.mo.html">as.mo()</a></code> that transforms any user input value to a valid microbial ID by using AI (Artificial Intelligence) and based on the taxonomic tree of ITIS.</p>
<p>Using the <code>microbenchmark</code> package, we can review the calculation performance of this function. Its function <code><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark()</a></code> calculates different input expressions independently of each others and runs every expression 100 times.</p>
<p>One of the most important features of this package is the complete microbial taxonomic database, supplied by the Catalogue of Life (<a href="http://catalogueoflife.org" class="uri">http://catalogueoflife.org</a>). We created a function <code><a href="../reference/as.mo.html">as.mo()</a></code> that transforms any user input value to a valid microbial ID by using AI (Artificial Intelligence) combined with the taxonomic tree of Catalogue of Life.</p>
<p>Using the <code>microbenchmark</code> package, we can review the calculation performance of this function. Its function <code><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark()</a></code> runs different input expressions independently of each other and measures their time-to-result.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(microbenchmark)</a>
<a class="sourceLine" id="cb1-2" title="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(AMR)</a></code></pre></div>
<p>In the next test, we try to coerce different input values for <em>Staphylococcus aureus</em>. The actual result is the same every time: it returns its MO code <code>B_STPHY_AUR</code> (<em>B</em> stands for <em>Bacteria</em>, the taxonomic kingdom).</p>
<p>But the calculation time differs a lot. Here, the AI effect can be reviewed best:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1">benchmark &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"sau"</span>),</a>
<a class="sourceLine" id="cb2-2" title="2"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"stau"</span>),</a>
<a class="sourceLine" id="cb2-3" title="3"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"staaur"</span>),</a>
<a class="sourceLine" id="cb2-4" title="4"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. aureus"</span>),</a>
<a class="sourceLine" id="cb2-5" title="5"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. aureus"</span>),</a>
<a class="sourceLine" id="cb2-6" title="6"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"STAAUR"</span>),</a>
<a class="sourceLine" id="cb2-7" title="7"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
<a class="sourceLine" id="cb2-8" title="8"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B_STPHY_AUR"</span>))</a>
<a class="sourceLine" id="cb2-9" title="9"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(benchmark, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb2-10" title="10"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb2-11" title="11"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb2-12" title="12"><span class="co"># as.mo("sau") 18.983141 19.121148 19.9676944 19.1967505 19.2871260 38.635012 100</span></a>
<a class="sourceLine" id="cb2-13" title="13"><span class="co"># as.mo("stau") 37.503863 37.692049 38.9856547 37.8244335 37.9851040 57.576107 100</span></a>
<a class="sourceLine" id="cb2-14" title="14"><span class="co"># as.mo("staaur") 18.945427 19.122579 19.6392560 19.2241285 19.3536140 38.687672 100</span></a>
<a class="sourceLine" id="cb2-15" title="15"><span class="co"># as.mo("S. aureus") 15.305229 15.471103 16.3477096 15.5545630 15.6689280 36.363005 100</span></a>
<a class="sourceLine" id="cb2-16" title="16"><span class="co"># as.mo("S. aureus") 15.308232 15.469881 16.5269706 15.5506870 15.6277560 42.155292 100</span></a>
<a class="sourceLine" id="cb2-17" title="17"><span class="co"># as.mo("STAAUR") 18.984049 19.117166 19.6104597 19.2219285 19.3161095 38.638783 100</span></a>
<a class="sourceLine" id="cb2-18" title="18"><span class="co"># as.mo("Staphylococcus aureus") 8.103546 8.198285 8.6422018 8.2636915 8.3200535 27.002527 100</span></a>
<a class="sourceLine" id="cb2-19" title="19"><span class="co"># as.mo("B_STPHY_AUR") 0.156236 0.196779 0.2017926 0.2035535 0.2115505 0.241861 100</span></a>
<a class="sourceLine" id="cb2-20" title="20"></a>
<a class="sourceLine" id="cb2-21" title="21"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/par">par</a></span>(<span class="dt">mar =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">5</span>, <span class="dv">15</span>, <span class="dv">4</span>, <span class="dv">2</span>)) <span class="co"># set more space for left margin text (15)</span></a>
<a class="sourceLine" id="cb2-22" title="22"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/boxplot">boxplot</a></span>(benchmark, <span class="dt">horizontal =</span> <span class="ot">TRUE</span>, <span class="dt">las =</span> <span class="dv">1</span>, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">log =</span> <span class="ot">FALSE</span>, <span class="dt">xlab =</span> <span class="st">""</span>, <span class="dt">ylim =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">0</span>, <span class="dv">200</span>),</a>
<a class="sourceLine" id="cb2-23" title="23"> <span class="dt">main =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/expression">expression</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste</a></span>(<span class="st">"Benchmark of "</span>, <span class="kw"><a href="https://www.rdocumentation.org/packages/grDevices/topics/plotmath">italic</a></span>(<span class="st">"Staphylococcus aureus"</span>))))</a></code></pre></div>
<p><img src="../reference/figures/benchmark_1.png"></p>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds), tested on a quite regular Linux server from 2007 (Core 2 Duo 2.7 GHz, 2 GB DDR2 RAM). A value of 8 milliseconds means it can determine 125 input values per second. It case of 40 milliseconds, this is only 25 input values per second. The more an input value resembles a full name, the faster the result will be found. In case of <code><a href="../reference/as.mo.html">as.mo("B_STPHY_AUR")</a></code>, the input is already a valid MO code, so it only almost takes no time at all (0.0002 seconds on our server).</p>
<p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined far less faster. See this example for the ID of <em>Burkholderia nodosa</em> (<code>B_BRKHL_NOD</code>):</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1">benchmark &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"buno"</span>),</a>
<a class="sourceLine" id="cb3-2" title="2"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"burnod"</span>),</a>
<a class="sourceLine" id="cb3-3" title="3"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B. nodosa"</span>),</a>
<a class="sourceLine" id="cb3-4" title="4"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B. nodosa"</span>),</a>
<a class="sourceLine" id="cb3-5" title="5"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"BURNOD"</span>),</a>
<a class="sourceLine" id="cb3-6" title="6"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Burkholderia nodosa"</span>),</a>
<a class="sourceLine" id="cb3-7" title="7"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B_BRKHL_NOD"</span>))</a>
<a class="sourceLine" id="cb3-8" title="8"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(benchmark, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb3-9" title="9"></a>
<a class="sourceLine" id="cb3-10" title="10"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb3-11" title="11"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co"># as.mo("buno") 125.141333 125.8553210 129.5727691 126.3899910 127.0954925 194.51985 100</span></a>
<a class="sourceLine" id="cb3-13" title="13"><span class="co"># as.mo("burnod") 142.300359 144.1611750 147.0642288 144.6074960 145.5243025 176.91649 100</span></a>
<a class="sourceLine" id="cb3-14" title="14"><span class="co"># as.mo("B. nodosa") 81.530132 81.9360840 83.3915418 82.1852770 82.6848870 102.63184 100</span></a>
<a class="sourceLine" id="cb3-15" title="15"><span class="co"># as.mo("B. nodosa") 81.109547 81.9836805 84.7595894 82.3437825 82.8282705 110.67036 100</span></a>
<a class="sourceLine" id="cb3-16" title="16"><span class="co"># as.mo("BURNOD") 143.163527 143.9134485 148.7192688 144.5582580 145.7489115 314.92070 100</span></a>
<a class="sourceLine" id="cb3-17" title="17"><span class="co"># as.mo("Burkholderia nodosa") 36.226325 36.5499000 37.1309929 36.6581540 36.7551985 56.25597 100</span></a>
<a class="sourceLine" id="cb3-18" title="18"><span class="co"># as.mo("B_BRKHL_NOD") 0.172509 0.3038455 0.4806591 0.3078265 0.3121215 19.16173 100</span></a>
<a class="sourceLine" id="cb3-19" title="19"></a>
<a class="sourceLine" id="cb3-20" title="20"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/boxplot">boxplot</a></span>(benchmark, <span class="dt">horizontal =</span> <span class="ot">TRUE</span>, <span class="dt">las =</span> <span class="dv">1</span>, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">log =</span> <span class="ot">FALSE</span>, <span class="dt">xlab =</span> <span class="st">""</span>, <span class="dt">ylim =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">0</span>, <span class="dv">200</span>),</a>
<a class="sourceLine" id="cb3-21" title="21"> <span class="dt">main =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/expression">expression</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste</a></span>(<span class="st">"Benchmark of "</span>, <span class="kw"><a href="https://www.rdocumentation.org/packages/grDevices/topics/plotmath">italic</a></span>(<span class="st">"Burkholderia nodosa"</span>))))</a></code></pre></div>
<p><img src="../reference/figures/benchmark_2.png"></p>
<p>That takes up to 8 times as much time! A value of 145 milliseconds means it can only determine ~7 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1">S.aureus &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"sau"</span>),</a>
<a class="sourceLine" id="cb2-2" title="2"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"stau"</span>),</a>
<a class="sourceLine" id="cb2-3" title="3"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"staaur"</span>),</a>
<a class="sourceLine" id="cb2-4" title="4"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. aureus"</span>),</a>
<a class="sourceLine" id="cb2-5" title="5"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. aureus"</span>),</a>
<a class="sourceLine" id="cb2-6" title="6"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"STAAUR"</span>),</a>
<a class="sourceLine" id="cb2-7" title="7"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
<a class="sourceLine" id="cb2-8" title="8"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B_STPHY_AUR"</span>),</a>
<a class="sourceLine" id="cb2-9" title="9"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb2-10" title="10"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(S.aureus, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb2-11" title="11"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb2-12" title="12"><span class="co">#&gt; expr min lq mean median</span></a>
<a class="sourceLine" id="cb2-13" title="13"><span class="co">#&gt; as.mo("sau") 42.58139 42.645368 43.3006677 42.970095</span></a>
<a class="sourceLine" id="cb2-14" title="14"><span class="co">#&gt; as.mo("stau") 76.60094 77.168264 83.7686909 77.316642</span></a>
<a class="sourceLine" id="cb2-15" title="15"><span class="co">#&gt; as.mo("staaur") 42.86607 42.947083 43.5035571 43.497293</span></a>
<a class="sourceLine" id="cb2-16" title="16"><span class="co">#&gt; as.mo("S. aureus") 18.39354 18.432582 22.4304233 18.495928</span></a>
<a class="sourceLine" id="cb2-17" title="17"><span class="co">#&gt; as.mo("S. aureus") 18.46513 18.559903 18.6640991 18.579110</span></a>
<a class="sourceLine" id="cb2-18" title="18"><span class="co">#&gt; as.mo("STAAUR") 42.71975 42.788612 44.3280682 43.069864</span></a>
<a class="sourceLine" id="cb2-19" title="19"><span class="co">#&gt; as.mo("Staphylococcus aureus") 11.56285 11.591419 15.9457298 11.667161</span></a>
<a class="sourceLine" id="cb2-20" title="20"><span class="co">#&gt; as.mo("B_STPHY_AUR") 0.40487 0.450128 0.5036822 0.481417</span></a>
<a class="sourceLine" id="cb2-21" title="21"><span class="co">#&gt; uq max neval</span></a>
<a class="sourceLine" id="cb2-22" title="22"><span class="co">#&gt; 43.448543 45.058105 10</span></a>
<a class="sourceLine" id="cb2-23" title="23"><span class="co">#&gt; 78.335591 127.180349 10</span></a>
<a class="sourceLine" id="cb2-24" title="24"><span class="co">#&gt; 43.817095 44.999509 10</span></a>
<a class="sourceLine" id="cb2-25" title="25"><span class="co">#&gt; 19.007097 56.501460 10</span></a>
<a class="sourceLine" id="cb2-26" title="26"><span class="co">#&gt; 18.651814 19.373275 10</span></a>
<a class="sourceLine" id="cb2-27" title="27"><span class="co">#&gt; 43.741388 54.703256 10</span></a>
<a class="sourceLine" id="cb2-28" title="28"><span class="co">#&gt; 12.323077 50.121808 10</span></a>
<a class="sourceLine" id="cb2-29" title="29"><span class="co">#&gt; 0.519271 0.766578 10</span></a></code></pre></div>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 10 milliseconds means it can determine 100 input values per second. It case of 50 milliseconds, this is only 20 input values per second. The more an input value resembles a full name, the faster the result will be found. In case of <code><a href="../reference/as.mo.html">as.mo("B_STPHY_AUR")</a></code>, the input is already a valid MO code, so it only almost takes no time at all (404 millionths of seconds).</p>
<p>To achieve this speed, the <code>as.mo</code> function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined far less faster. See this example for the ID of <em>Mycoplasma leonicaptivi</em> (<code>B_MYCPL_LEO</code>), a bug probably never found before in humans:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1">M.leonicaptivi &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"myle"</span>),</a>
<a class="sourceLine" id="cb3-2" title="2"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"mycleo"</span>),</a>
<a class="sourceLine" id="cb3-3" title="3"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"M. leonicaptivi"</span>),</a>
<a class="sourceLine" id="cb3-4" title="4"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"M. leonicaptivi"</span>),</a>
<a class="sourceLine" id="cb3-5" title="5"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"MYCLEO"</span>),</a>
<a class="sourceLine" id="cb3-6" title="6"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"Mycoplasma leonicaptivi"</span>),</a>
<a class="sourceLine" id="cb3-7" title="7"> <span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"B_MYCPL_LEO"</span>),</a>
<a class="sourceLine" id="cb3-8" title="8"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb3-9" title="9"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(M.leonicaptivi, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb3-10" title="10"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb3-11" title="11"><span class="co">#&gt; expr min lq mean</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#&gt; as.mo("myle") 112.28656 112.372601 112.751678</span></a>
<a class="sourceLine" id="cb3-13" title="13"><span class="co">#&gt; as.mo("mycleo") 382.46812 382.757612 383.432440</span></a>
<a class="sourceLine" id="cb3-14" title="14"><span class="co">#&gt; as.mo("M. leonicaptivi") 202.68674 203.654949 210.461303</span></a>
<a class="sourceLine" id="cb3-15" title="15"><span class="co">#&gt; as.mo("M. leonicaptivi") 202.89759 203.440956 203.816387</span></a>
<a class="sourceLine" id="cb3-16" title="16"><span class="co">#&gt; as.mo("MYCLEO") 382.27864 383.090895 401.904482</span></a>
<a class="sourceLine" id="cb3-17" title="17"><span class="co">#&gt; as.mo("Mycoplasma leonicaptivi") 102.99676 103.191196 109.196394</span></a>
<a class="sourceLine" id="cb3-18" title="18"><span class="co">#&gt; as.mo("B_MYCPL_LEO") 0.32155 0.564807 4.320068</span></a>
<a class="sourceLine" id="cb3-19" title="19"><span class="co">#&gt; median uq max neval</span></a>
<a class="sourceLine" id="cb3-20" title="20"><span class="co">#&gt; 112.540884 112.76874 113.76321 10</span></a>
<a class="sourceLine" id="cb3-21" title="21"><span class="co">#&gt; 383.232219 384.05897 385.28587 10</span></a>
<a class="sourceLine" id="cb3-22" title="22"><span class="co">#&gt; 204.255445 205.80976 242.53035 10</span></a>
<a class="sourceLine" id="cb3-23" title="23"><span class="co">#&gt; 203.613673 203.82802 206.15038 10</span></a>
<a class="sourceLine" id="cb3-24" title="24"><span class="co">#&gt; 386.478757 421.87837 437.26978 10</span></a>
<a class="sourceLine" id="cb3-25" title="25"><span class="co">#&gt; 103.596136 104.65940 142.25748 10</span></a>
<a class="sourceLine" id="cb3-26" title="26"><span class="co">#&gt; 0.593652 0.62522 37.96384 10</span></a></code></pre></div>
<p>That takes 6 times as much time on average! A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/par">par</a></span>(<span class="dt">mar =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">5</span>, <span class="dv">16</span>, <span class="dv">4</span>, <span class="dv">2</span>)) <span class="co"># set more space for left margin text (16)</span></a>
<a class="sourceLine" id="cb4-2" title="2"></a>
<a class="sourceLine" id="cb4-3" title="3"><span class="co"># highest value on y axis</span></a>
<a class="sourceLine" id="cb4-4" title="4">max_y_axis &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/Extremes">max</a></span>(S.aureus<span class="op">$</span>time, M.leonicaptivi<span class="op">$</span>time, <span class="dt">na.rm =</span> <span class="ot">TRUE</span>) <span class="op">/</span><span class="st"> </span><span class="fl">1e6</span></a>
<a class="sourceLine" id="cb4-5" title="5"></a>
<a class="sourceLine" id="cb4-6" title="6"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/boxplot">boxplot</a></span>(S.aureus, <span class="dt">horizontal =</span> <span class="ot">TRUE</span>, <span class="dt">las =</span> <span class="dv">1</span>, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">log =</span> <span class="ot">FALSE</span>, <span class="dt">xlab =</span> <span class="st">""</span>, <span class="dt">ylim =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">0</span>, max_y_axis),</a>
<a class="sourceLine" id="cb4-7" title="7"> <span class="dt">main =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/expression">expression</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste</a></span>(<span class="st">"Benchmark of "</span>, <span class="kw"><a href="https://www.rdocumentation.org/packages/grDevices/topics/plotmath">italic</a></span>(<span class="st">"Staphylococcus aureus"</span>))))</a></code></pre></div>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-4-1.png" width="720"></p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1"></a>
<a class="sourceLine" id="cb5-2" title="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/graphics/topics/boxplot">boxplot</a></span>(M.leonicaptivi, <span class="dt">horizontal =</span> <span class="ot">TRUE</span>, <span class="dt">las =</span> <span class="dv">1</span>, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">log =</span> <span class="ot">FALSE</span>, <span class="dt">xlab =</span> <span class="st">""</span>, <span class="dt">ylim =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">0</span>, max_y_axis),</a>
<a class="sourceLine" id="cb5-3" title="3"> <span class="dt">main =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/expression">expression</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/paste">paste</a></span>(<span class="st">"Benchmark of "</span>, <span class="kw"><a href="https://www.rdocumentation.org/packages/grDevices/topics/plotmath">italic</a></span>(<span class="st">"Mycoplasma leonicaptivi"</span>))))</a></code></pre></div>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-4-2.png" width="720"></p>
<p>To relieve this pitfall and further improve performance, two important calculations take almost no time at all: <strong>repetitive results</strong> and <strong>already precalculated results</strong>.</p>
<div id="repetitive-results" class="section level3">
<h3 class="hasAnchor">
<a href="#repetitive-results" class="anchor"></a>Repetitive results</h3>
<p>Repetitive results mean that unique values are present more than once. Unique values will only be calculated once by <code><a href="../reference/as.mo.html">as.mo()</a></code>. We will use <code><a href="../reference/mo_property.html">mo_fullname()</a></code> for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) and uses <code><a href="../reference/as.mo.html">as.mo()</a></code> internally.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb4-2" title="2"><span class="co"># take 500,000 random MO codes from the septic_patients data set</span></a>
<a class="sourceLine" id="cb4-3" title="3">x =<span class="st"> </span>septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb4-4" title="4"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/sample.html">sample_n</a></span>(<span class="dv">500000</span>, <span class="dt">replace =</span> <span class="ot">TRUE</span>) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb4-5" title="5"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/pull.html">pull</a></span>(mo)</a>
<a class="sourceLine" id="cb4-6" title="6"> </a>
<a class="sourceLine" id="cb4-7" title="7"><span class="co"># got the right length?</span></a>
<a class="sourceLine" id="cb4-8" title="8"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/length">length</a></span>(x)</a>
<a class="sourceLine" id="cb4-9" title="9"><span class="co"># [1] 500000</span></a>
<a class="sourceLine" id="cb4-10" title="10"></a>
<a class="sourceLine" id="cb4-11" title="11"><span class="co"># and how many unique values do we have?</span></a>
<a class="sourceLine" id="cb4-12" title="12"><span class="kw"><a href="https://dplyr.tidyverse.org/reference/n_distinct.html">n_distinct</a></span>(x)</a>
<a class="sourceLine" id="cb4-13" title="13"><span class="co"># [1] 96</span></a>
<a class="sourceLine" id="cb4-14" title="14"></a>
<a class="sourceLine" id="cb4-15" title="15"><span class="co"># only 96, but distributed in 500,000 results. now let's see:</span></a>
<a class="sourceLine" id="cb4-16" title="16"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">X =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(x),</a>
<a class="sourceLine" id="cb4-17" title="17"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
<a class="sourceLine" id="cb4-18" title="18"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb4-19" title="19"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb4-20" title="20"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb4-21" title="21"><span class="co"># X 114.9342 117.1076 129.6448 120.2047 131.5005 168.6371 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!) of 96 unique values only takes 0.12 seconds (120 ms). You only lose time on your unique input values.</p>
<p>Results of a tenfold - 5,000,000 values:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb5-2" title="2"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb5-3" title="3"><span class="co"># X 882.9045 901.3011 1001.677 940.3421 1168.088 1226.846 10</span></a></code></pre></div>
<p>Even determining the full names of 5 <em>Million</em> values is done within a second.</p>
<p>Repetitive results mean that unique values are present more than once. Unique values will only be calculated once by <code><a href="../reference/as.mo.html">as.mo()</a></code>. We will use <code><a href="../reference/mo_property.html">mo_fullname()</a></code> for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) which uses <code><a href="../reference/as.mo.html">as.mo()</a></code> internally.</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(dplyr)</a>
<a class="sourceLine" id="cb6-2" title="2"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-3" title="3"><span class="co">#&gt; Attaching package: 'dplyr'</span></a>
<a class="sourceLine" id="cb6-4" title="4"><span class="co">#&gt; The following objects are masked from 'package:stats':</span></a>
<a class="sourceLine" id="cb6-5" title="5"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-6" title="6"><span class="co">#&gt; filter, lag</span></a>
<a class="sourceLine" id="cb6-7" title="7"><span class="co">#&gt; The following objects are masked from 'package:base':</span></a>
<a class="sourceLine" id="cb6-8" title="8"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-9" title="9"><span class="co">#&gt; intersect, setdiff, setequal, union</span></a>
<a class="sourceLine" id="cb6-10" title="10"><span class="co"># take 500,000 random MO codes from the septic_patients data set</span></a>
<a class="sourceLine" id="cb6-11" title="11">x =<span class="st"> </span>septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb6-12" title="12"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/sample.html">sample_n</a></span>(<span class="dv">500000</span>, <span class="dt">replace =</span> <span class="ot">TRUE</span>) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb6-13" title="13"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/pull.html">pull</a></span>(mo)</a>
<a class="sourceLine" id="cb6-14" title="14"> </a>
<a class="sourceLine" id="cb6-15" title="15"><span class="co"># got the right length?</span></a>
<a class="sourceLine" id="cb6-16" title="16"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/length">length</a></span>(x)</a>
<a class="sourceLine" id="cb6-17" title="17"><span class="co">#&gt; [1] 500000</span></a>
<a class="sourceLine" id="cb6-18" title="18"></a>
<a class="sourceLine" id="cb6-19" title="19"><span class="co"># and how many unique values do we have?</span></a>
<a class="sourceLine" id="cb6-20" title="20"><span class="kw"><a href="https://dplyr.tidyverse.org/reference/n_distinct.html">n_distinct</a></span>(x)</a>
<a class="sourceLine" id="cb6-21" title="21"><span class="co">#&gt; [1] 95</span></a>
<a class="sourceLine" id="cb6-22" title="22"></a>
<a class="sourceLine" id="cb6-23" title="23"><span class="co"># now let's see:</span></a>
<a class="sourceLine" id="cb6-24" title="24">run_it &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">X =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(x),</a>
<a class="sourceLine" id="cb6-25" title="25"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb6-26" title="26"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb6-27" title="27"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb6-28" title="28"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb6-29" title="29"><span class="co">#&gt; X 435.7086 442.1682 465.5949 468.8453 477.1915 505.961 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!) of 95 unique values only takes 0.47 seconds (468 ms). You only lose time on your unique input values.</p>
</div>
<div id="precalculated-results" class="section level3">
<h3 class="hasAnchor">
<a href="#precalculated-results" class="anchor"></a>Precalculated results</h3>
<p>What about precalculated results? If the input is an already precalculated result of a helper function like <code><a href="../reference/mo_property.html">mo_fullname()</a></code>, it almost doesnt take any time at all (see C below):</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"B_STPHY_AUR"</span>),</a>
<a class="sourceLine" id="cb6-2" title="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. aureus"</span>),</a>
<a class="sourceLine" id="cb6-3" title="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
<a class="sourceLine" id="cb6-4" title="4"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
<a class="sourceLine" id="cb6-5" title="5"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb6-6" title="6"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb6-7" title="7"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb6-8" title="8"><span class="co"># A 11.364086 11.460537 11.5104799 11.4795330 11.524860 11.818263 10</span></a>
<a class="sourceLine" id="cb6-9" title="9"><span class="co"># B 11.976454 12.012352 12.1704592 12.0853020 12.210004 12.881737 10</span></a>
<a class="sourceLine" id="cb6-10" title="10"><span class="co"># C 0.095823 0.102528 0.1167754 0.1153785 0.132629 0.140661 10</span></a></code></pre></div>
<p>So going from <code><a href="../reference/mo_property.html">mo_fullname("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0001 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),</a>
<a class="sourceLine" id="cb7-2" title="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),</a>
<a class="sourceLine" id="cb7-3" title="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
<a class="sourceLine" id="cb7-4" title="4"> <span class="dt">D =</span> <span class="kw"><a href="../reference/mo_property.html">mo_family</a></span>(<span class="st">"Staphylococcaceae"</span>),</a>
<a class="sourceLine" id="cb7-5" title="5"> <span class="dt">E =</span> <span class="kw"><a href="../reference/mo_property.html">mo_order</a></span>(<span class="st">"Bacillales"</span>),</a>
<a class="sourceLine" id="cb7-6" title="6"> <span class="dt">F =</span> <span class="kw"><a href="../reference/mo_property.html">mo_class</a></span>(<span class="st">"Bacilli"</span>),</a>
<a class="sourceLine" id="cb7-7" title="7"> <span class="dt">G =</span> <span class="kw"><a href="../reference/mo_property.html">mo_phylum</a></span>(<span class="st">"Firmicutes"</span>),</a>
<a class="sourceLine" id="cb7-8" title="8"> <span class="dt">H =</span> <span class="kw"><a href="../reference/mo_property.html">mo_subkingdom</a></span>(<span class="st">"Posibacteria"</span>),</a>
<a class="sourceLine" id="cb7-9" title="9"> <span class="dt">I =</span> <span class="kw"><a href="../reference/mo_property.html">mo_kingdom</a></span>(<span class="st">"Bacteria"</span>),</a>
<a class="sourceLine" id="cb7-10" title="10"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
<a class="sourceLine" id="cb7-11" title="11"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb7-12" title="12"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb7-13" title="13"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb7-14" title="14"><span class="co"># A 0.105181 0.121314 0.1478538 0.1465265 0.166711 0.211409 10</span></a>
<a class="sourceLine" id="cb7-15" title="15"><span class="co"># B 0.132558 0.146388 0.1584278 0.1499835 0.164895 0.208477 10</span></a>
<a class="sourceLine" id="cb7-16" title="16"><span class="co"># C 0.135492 0.160355 0.2341847 0.1884665 0.348857 0.395931 10</span></a>
<a class="sourceLine" id="cb7-17" title="17"><span class="co"># D 0.109650 0.115727 0.1270481 0.1264130 0.128648 0.168317 10</span></a>
<a class="sourceLine" id="cb7-18" title="18"><span class="co"># E 0.081574 0.096940 0.0992582 0.0980915 0.101479 0.120477 10</span></a>
<a class="sourceLine" id="cb7-19" title="19"><span class="co"># F 0.081575 0.088489 0.0988463 0.0989650 0.103365 0.126482 10</span></a>
<a class="sourceLine" id="cb7-20" title="20"><span class="co"># G 0.091981 0.095333 0.1043568 0.1001530 0.111327 0.129625 10</span></a>
<a class="sourceLine" id="cb7-21" title="21"><span class="co"># H 0.092610 0.093169 0.1009135 0.0985455 0.101828 0.120406 10</span></a>
<a class="sourceLine" id="cb7-22" title="22"><span class="co"># I 0.087371 0.091213 0.1069758 0.0941815 0.109302 0.192831 10</span></a></code></pre></div>
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> too, there is no point in calculating the result. And because this package knows all phyla of all known microorganisms (according to ITIS), it can just return the initial value immediately.</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1">run_it &lt;-<span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"B_STPHY_AUR"</span>),</a>
<a class="sourceLine" id="cb7-2" title="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. aureus"</span>),</a>
<a class="sourceLine" id="cb7-3" title="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
<a class="sourceLine" id="cb7-4" title="4"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb7-5" title="5"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(run_it, <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb7-6" title="6"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb7-7" title="7"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb7-8" title="8"><span class="co">#&gt; A 38.887977 38.920313 39.3674024 39.076862 39.258415 42.166327 10</span></a>
<a class="sourceLine" id="cb7-9" title="9"><span class="co">#&gt; B 19.589084 19.631059 19.8682396 19.781567 19.955611 20.751941 10</span></a>
<a class="sourceLine" id="cb7-10" title="10"><span class="co">#&gt; C 0.255829 0.382732 0.4199913 0.400156 0.499156 0.564807 10</span></a></code></pre></div>
<p>So going from <code><a href="../reference/mo_property.html">mo_fullname("Staphylococcus aureus")</a></code> to <code>"Staphylococcus aureus"</code> takes 0.0004 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">A =</span> <span class="kw"><a href="../reference/mo_property.html">mo_species</a></span>(<span class="st">"aureus"</span>),</a>
<a class="sourceLine" id="cb8-2" title="2"> <span class="dt">B =</span> <span class="kw"><a href="../reference/mo_property.html">mo_genus</a></span>(<span class="st">"Staphylococcus"</span>),</a>
<a class="sourceLine" id="cb8-3" title="3"> <span class="dt">C =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"Staphylococcus aureus"</span>),</a>
<a class="sourceLine" id="cb8-4" title="4"> <span class="dt">D =</span> <span class="kw"><a href="../reference/mo_property.html">mo_family</a></span>(<span class="st">"Staphylococcaceae"</span>),</a>
<a class="sourceLine" id="cb8-5" title="5"> <span class="dt">E =</span> <span class="kw"><a href="../reference/mo_property.html">mo_order</a></span>(<span class="st">"Bacillales"</span>),</a>
<a class="sourceLine" id="cb8-6" title="6"> <span class="dt">F =</span> <span class="kw"><a href="../reference/mo_property.html">mo_class</a></span>(<span class="st">"Bacilli"</span>),</a>
<a class="sourceLine" id="cb8-7" title="7"> <span class="dt">G =</span> <span class="kw"><a href="../reference/mo_property.html">mo_phylum</a></span>(<span class="st">"Firmicutes"</span>),</a>
<a class="sourceLine" id="cb8-8" title="8"> <span class="dt">H =</span> <span class="kw"><a href="../reference/mo_property.html">mo_kingdom</a></span>(<span class="st">"Bacteria"</span>),</a>
<a class="sourceLine" id="cb8-9" title="9"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
<a class="sourceLine" id="cb8-10" title="10"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb8-11" title="11"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb8-12" title="12"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb8-13" title="13"><span class="co">#&gt; A 0.250242 0.292496 0.3891774 0.4266960 0.456902 0.520388 10</span></a>
<a class="sourceLine" id="cb8-14" title="14"><span class="co">#&gt; B 0.259461 0.311702 0.3428727 0.3412800 0.374141 0.443912 10</span></a>
<a class="sourceLine" id="cb8-15" title="15"><span class="co">#&gt; C 0.290960 0.313169 0.4334429 0.4097595 0.520389 0.725373 10</span></a>
<a class="sourceLine" id="cb8-16" title="16"><span class="co">#&gt; D 0.271823 0.282789 0.3187217 0.3192800 0.352909 0.375398 10</span></a>
<a class="sourceLine" id="cb8-17" title="17"><span class="co">#&gt; E 0.245353 0.270985 0.3081197 0.2960235 0.330839 0.429036 10</span></a>
<a class="sourceLine" id="cb8-18" title="18"><span class="co">#&gt; F 0.246122 0.266585 0.2991101 0.3089435 0.332794 0.351582 10</span></a>
<a class="sourceLine" id="cb8-19" title="19"><span class="co">#&gt; G 0.271893 0.272452 0.3085039 0.2850580 0.368204 0.385525 10</span></a>
<a class="sourceLine" id="cb8-20" title="20"><span class="co">#&gt; H 0.252686 0.259251 0.3161791 0.2985025 0.334820 0.422680 10</span></a></code></pre></div>
<p>Of course, when running <code><a href="../reference/mo_property.html">mo_phylum("Firmicutes")</a></code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> too, there is no point in calculating the result. And because this package knows all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.</p>
</div>
<div id="results-in-other-languages" class="section level3">
<h3 class="hasAnchor">
<a href="#results-in-other-languages" class="anchor"></a>Results in other languages</h3>
<p>When the system language is non-English and supported by this <code>AMR</code> package, some functions take a little while longer:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"en"</span>) <span class="co"># or just mo_fullname("CoNS") on an English system</span></a>
<a class="sourceLine" id="cb8-2" title="2"><span class="co"># "Coagulase Negative Staphylococcus (CoNS)"</span></a>
<a class="sourceLine" id="cb8-3" title="3"></a>
<a class="sourceLine" id="cb8-4" title="4"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"fr"</span>) <span class="co"># or just mo_fullname("CoNS") on a French system</span></a>
<a class="sourceLine" id="cb8-5" title="5"><span class="co"># "Staphylococcus à coagulase négative (CoNS)"</span></a>
<a class="sourceLine" id="cb8-6" title="6"></a>
<a class="sourceLine" id="cb8-7" title="7"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">en =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"en"</span>),</a>
<a class="sourceLine" id="cb8-8" title="8"> <span class="dt">de =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"de"</span>),</a>
<a class="sourceLine" id="cb8-9" title="9"> <span class="dt">nl =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"nl"</span>),</a>
<a class="sourceLine" id="cb8-10" title="10"> <span class="dt">es =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"es"</span>),</a>
<a class="sourceLine" id="cb8-11" title="11"> <span class="dt">it =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"it"</span>),</a>
<a class="sourceLine" id="cb8-12" title="12"> <span class="dt">fr =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"fr"</span>),</a>
<a class="sourceLine" id="cb8-13" title="13"> <span class="dt">pt =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"pt"</span>),</a>
<a class="sourceLine" id="cb8-14" title="14"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
<a class="sourceLine" id="cb8-15" title="15"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb8-16" title="16"><span class="co"># Unit: milliseconds</span></a>
<a class="sourceLine" id="cb8-17" title="17"><span class="co"># expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb8-18" title="18"><span class="co"># en 6.093583 6.51724 6.555105 6.562986 6.630663 6.99698 100</span></a>
<a class="sourceLine" id="cb8-19" title="19"><span class="co"># de 13.934874 14.35137 16.891587 14.462210 14.764658 43.63956 100</span></a>
<a class="sourceLine" id="cb8-20" title="20"><span class="co"># nl 13.900092 14.34729 15.943268 14.424565 14.581535 43.76283 100</span></a>
<a class="sourceLine" id="cb8-21" title="21"><span class="co"># es 13.833813 14.34596 14.574783 14.439757 14.653994 17.49168 100</span></a>
<a class="sourceLine" id="cb8-22" title="22"><span class="co"># it 13.811883 14.36621 15.179060 14.453515 14.812359 43.64284 100</span></a>
<a class="sourceLine" id="cb8-23" title="23"><span class="co"># fr 13.798683 14.37019 16.344731 14.468775 14.697610 48.62923 100</span></a>
<a class="sourceLine" id="cb8-24" title="24"><span class="co"># pt 13.789674 14.36244 15.706321 14.443772 14.679905 44.76701 100</span></a></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" title="1"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"en"</span>) <span class="co"># or just mo_fullname("CoNS") on an English system</span></a>
<a class="sourceLine" id="cb9-2" title="2"><span class="co">#&gt; [1] "Coagulase Negative Staphylococcus (CoNS)"</span></a>
<a class="sourceLine" id="cb9-3" title="3"></a>
<a class="sourceLine" id="cb9-4" title="4"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"fr"</span>) <span class="co"># or just mo_fullname("CoNS") on a French system</span></a>
<a class="sourceLine" id="cb9-5" title="5"><span class="co">#&gt; [1] "Staphylococcus à coagulase négative (CoNS)"</span></a>
<a class="sourceLine" id="cb9-6" title="6"></a>
<a class="sourceLine" id="cb9-7" title="7"><span class="kw"><a href="https://www.rdocumentation.org/packages/microbenchmark/topics/microbenchmark">microbenchmark</a></span>(<span class="dt">en =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"en"</span>),</a>
<a class="sourceLine" id="cb9-8" title="8"> <span class="dt">de =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"de"</span>),</a>
<a class="sourceLine" id="cb9-9" title="9"> <span class="dt">nl =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"nl"</span>),</a>
<a class="sourceLine" id="cb9-10" title="10"> <span class="dt">es =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"es"</span>),</a>
<a class="sourceLine" id="cb9-11" title="11"> <span class="dt">it =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"it"</span>),</a>
<a class="sourceLine" id="cb9-12" title="12"> <span class="dt">fr =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"fr"</span>),</a>
<a class="sourceLine" id="cb9-13" title="13"> <span class="dt">pt =</span> <span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"CoNS"</span>, <span class="dt">language =</span> <span class="st">"pt"</span>),</a>
<a class="sourceLine" id="cb9-14" title="14"> <span class="dt">times =</span> <span class="dv">10</span>,</a>
<a class="sourceLine" id="cb9-15" title="15"> <span class="dt">unit =</span> <span class="st">"ms"</span>)</a>
<a class="sourceLine" id="cb9-16" title="16"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb9-17" title="17"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb9-18" title="18"><span class="co">#&gt; en 10.67105 11.03136 11.06332 11.07271 11.15310 11.45006 10</span></a>
<a class="sourceLine" id="cb9-19" title="19"><span class="co">#&gt; de 19.13393 19.50080 26.13799 19.61419 20.23400 52.66501 10</span></a>
<a class="sourceLine" id="cb9-20" title="20"><span class="co">#&gt; nl 19.05410 19.53789 22.94707 19.59205 20.12616 52.47399 10</span></a>
<a class="sourceLine" id="cb9-21" title="21"><span class="co">#&gt; es 19.31635 19.55221 26.22342 19.58633 20.01875 52.97636 10</span></a>
<a class="sourceLine" id="cb9-22" title="22"><span class="co">#&gt; it 19.21725 19.47105 19.63980 19.58053 19.68162 20.58914 10</span></a>
<a class="sourceLine" id="cb9-23" title="23"><span class="co">#&gt; fr 19.07854 19.45450 19.67303 19.56153 19.64517 20.45651 10</span></a>
<a class="sourceLine" id="cb9-24" title="24"><span class="co">#&gt; pt 19.00668 19.28388 19.53493 19.57857 19.66423 20.55317 10</span></a></code></pre></div>
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -192,7 +192,7 @@
<h1>How to create frequency tables</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 February 2019</h4>
<h4 class="date">20 February 2019</h4>
<div class="hidden name"><code>freq.Rmd</code></div>
@ -258,16 +258,16 @@ Longest: 1</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/colnames">colnames</a></span>(microorganisms)</a>
<a class="sourceLine" id="cb3-2" title="2"><span class="co"># [1] "mo" "col_id" "fullname" "kingdom" "phylum" </span></a>
<a class="sourceLine" id="cb3-3" title="3"><span class="co"># [6] "class" "order" "family" "genus" "species" </span></a>
<a class="sourceLine" id="cb3-4" title="4"><span class="co"># [11] "subspecies" "rank" "ref"</span></a></code></pre></div>
<p>If we compare the dimensions between the old and new dataset, we can see that these 12 variables were added:</p>
<a class="sourceLine" id="cb3-4" title="4"><span class="co"># [11] "subspecies" "rank" "ref" "species_id"</span></a></code></pre></div>
<p>If we compare the dimensions between the old and new dataset, we can see that these 13 variables were added:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/dim">dim</a></span>(septic_patients)</a>
<a class="sourceLine" id="cb4-2" title="2"><span class="co"># [1] 2000 49</span></a>
<a class="sourceLine" id="cb4-3" title="3"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/dim">dim</a></span>(my_patients)</a>
<a class="sourceLine" id="cb4-4" title="4"><span class="co"># [1] 2000 61</span></a></code></pre></div>
<a class="sourceLine" id="cb4-4" title="4"><span class="co"># [1] 2000 62</span></a></code></pre></div>
<p>So now the <code>genus</code> and <code>species</code> variables are available. A frequency table of these combined variables can be created like this:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1">my_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb5-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(genus, species, <span class="dt">nmax =</span> <span class="dv">15</span>)</a></code></pre></div>
<p><strong>Frequency table of <code>genus</code> and <code>species</code> from a <code>data.frame</code> (2,000 x 61)</strong></p>
<p><strong>Frequency table of <code>genus</code> and <code>species</code> from a <code>data.frame</code> (2,000 x 62)</strong></p>
<p>Columns: 2<br>
Length: 2,000 (of which NA: 0 = 0.00%)<br>
Unique: 95</p>

View File

@ -192,7 +192,7 @@
<h1>How to get properties of a microorganism</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 February 2019</h4>
<h4 class="date">20 February 2019</h4>
<div class="hidden name"><code>mo_property.Rmd</code></div>

View File

@ -192,7 +192,7 @@
<h1>How to predict antimicrobial resistance</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">18 February 2019</h4>
<h4 class="date">20 February 2019</h4>
<div class="hidden name"><code>resistance_predict.Rmd</code></div>

View File

@ -284,10 +284,17 @@
<div id="microbial-taxonomic-reference-data" class="section level4">
<h4 class="hasAnchor">
<a href="#microbial-taxonomic-reference-data" class="anchor"></a>Microbial (taxonomic) reference data</h4>
<p><img src="reference/figures/logo_itis.jpg" height="60px"></p>
<p>This package contains the <strong>complete microbial taxonomic data</strong> (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, <a href="https://www.itis.gov" class="uri">https://www.itis.gov</a>).</p>
<p>All ~20,000 (sub)species from <strong>the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package</strong>, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.</p>
<p>Read more about the data from ITIS <a href="./reference/ITIS.html">in our manual</a>.</p>
<p><img src="reference/figures/logo_col.png" height="60px"></p>
<p>This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (<a href="http://www.catalogueoflife.org">www.catalogueoflife.org</a>). This data is updated annually - check the included version with <code><a href="reference/catalogue_of_life_version.html">catalogue_of_life_version()</a></code>.</p>
<p>Included are:</p>
<ul>
<li>All ~55,000 species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</li>
<li>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</li>
<li>All ~15,000 previously accepted names of species that have been taxonomically renamed</li>
<li>The responsible author(s) and year of scientific publication</li>
</ul>
<p>The Catalogue of Life (<a href="http://www.catalogueoflife.org">www.catalogueoflife.org</a>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.</p>
<p>Read more about the data from the Catalogue of Life <a href="./reference/catalogue_of_life.html">in our manual</a>.</p>
</div>
<div id="overview-of-functions" class="section level4">
<h4 class="hasAnchor">

View File

@ -249,13 +249,13 @@
<ul>
<li>
<strong>BREAKING</strong>: removed deprecated functions, parameters and references to bactid. Use <code><a href="../reference/as.mo.html">as.mo()</a></code> to identify an MO code.</li>
<li>Catalogue of Life (CoL) inclusion for data about microorganisms, which also contains all ITIS data we used previously. The <code>microorganisms</code> data set now contains:
<li>Catalogue of Life as a new taxonomic source for data about microorganisms, which also contains all ITIS data we used previously. The <code>microorganisms</code> data set now contains:
<ul>
<li>Almost 60,000 species from six different kingdoms</li>
<li>Almost 15,000 previously accepted names which are now taxonomic synonyms</li>
<li>All (sub)species from the kingdoms Archaea, Bacteria, Chromista, Protozoa and Viruses</li>
<li>All (sub)species from the orders Eurotiales, Saccharomycetales and Onygenales of the kingdom Fungi. The complete taxonomy of this kingdom has more than 130,000 species. The orders we included contains at least all memebers of the families <em>Candida</em>, <em>Aspergillus</em> and <em>Trichophyton</em>.</li>
<li>Due to this change, the ID of <em>Streptococcus</em> was changed from <code>B_STRPTC</code> to <code>B_STRPT</code>.</li>
<li>All ~55,000 species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</li>
<li>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</li>
<li>All ~15,000 previously accepted names of species that have been taxonomically renamed</li>
<li>The responsible author(s) and year of scientific publication</li>
<li>Due to this change, some <code>mo</code> codes changed (e.g. <em>Streptococcus</em> changed from <code>B_STRPTC</code> to <code>B_STRPT</code>). A translation table is used internally to support older microorganism IDs, so users will not notice this difference.</li>
</ul>
</li>
<li>Support for data from <a href="https://whonet.org/">WHONET</a> and <a href="https://ecdc.europa.eu/en/about-us/partnerships-and-networks/disease-and-laboratory-networks/ears-net">EARS-Net</a> (European Antimicrobial Resistance Surveillance Network):

View File

@ -318,7 +318,7 @@ When using <code>allow_uncertain = TRUE</code> (which is the default setting), i
<li><p>It strips off values between brackets and the brackets itself, and re-evaluates the input with all previous rules</p></li>
<li><p>It strips off words from the end one by one and re-evaluates the input with all previous rules</p></li>
<li><p>It strips off words from the start one by one and re-evaluates the input with all previous rules</p></li>
<li><p>It tries to look for some manual changes which are not yet published to the ITIS database (like <em>Propionibacterium</em> not yet being <em>Cutibacterium</em>)</p></li>
<li><p>It tries to look for some manual changes which are not yet published to the Catalogue of Life (like <em>Propionibacterium</em> not yet being <em>Cutibacterium</em>)</p></li>
</ul>
<p>Examples:</p><ul>
<li><p><code>"Streptococcus group B (known as S. agalactiae)"</code>. The text between brackets will be removed and a warning will be thrown that the result <em>Streptococcus group B</em> (<code>B_STRPT_GRB</code>) needs review.</p></li>
@ -335,15 +335,22 @@ When using <code>allow_uncertain = TRUE</code> (which is the default setting), i
<p>[1] Becker K <em>et al.</em> <strong>Coagulase-Negative Staphylococci</strong>. 2014. Clin Microbiol Rev. 27(4): 870926. <a href='https://dx.doi.org/10.1128/CMR.00109-13'>https://dx.doi.org/10.1128/CMR.00109-13</a></p>
<p>[2] Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 57195. <a href='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p>
<p>[3] Integrated Taxonomic Information System (ITIS). Retrieved September 2018. <a href='http://www.itis.gov'>http://www.itis.gov</a></p>
<p>[3] Catalogue of Life: Annual Checklist (public online database), <a href='www.catalogueoflife.org'>www.catalogueoflife.org</a>.</p>
<h2 class="hasAnchor" id="itis"><a class="anchor" href="#itis"></a>ITIS</h2>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
<p><img src='figures/logo_itis.jpg' height=60px style=margin-bottom:5px /> <br />
This package contains the <strong>complete microbial taxonomic data</strong> (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, <a href='https://www.itis.gov'>https://www.itis.gov</a>).</p>
<p>All ~20,000 (sub)species from <strong>the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package</strong>, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.</p>
<p>ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].</p>
<p><img src='figures/logo_col.png' height=60px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). This data is updated annually - check the included version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a></code>.</p>
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>
<p>The Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.</p>
<p>The syntax used to transform the original data to a cleansed R format, can be found here: <a href='https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R'>https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R</a>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@ -353,7 +360,7 @@ On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitla
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='microorganisms.html'>microorganisms</a></code> for the <code>data.frame</code> with ITIS content that is being used to determine ID's. <br />
<div class='dont-index'><p><code><a href='microorganisms.html'>microorganisms</a></code> for the <code>data.frame</code> that is being used to determine ID's. <br />
The <code><a href='mo_property.html'>mo_property</a></code> functions (like <code><a href='mo_property.html'>mo_genus</a></code>, <code><a href='mo_property.html'>mo_gramstain</a></code>) to get properties based on the returned code.</p></div>
@ -418,7 +425,7 @@ The <code><a href='mo_property.html'>mo_property</a></code> functions (like <cod
<li><a href="#source">Source</a></li>
<li><a href="#itis">ITIS</a></li>
<li><a href="#catalogue-of-life">Catalogue of Life</a></li>
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>

View File

@ -0,0 +1,345 @@
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Catalogue of Life — catalogue_of_life • AMR (for R)</title>
<!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png" />
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png" />
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<!-- docsearch -->
<script src="../docsearch.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.css" integrity="sha256-QOSRU/ra9ActyXkIBbiIB144aDBdtvXBcNc3OTNuX/Q=" crossorigin="anonymous" />
<link href="../docsearch.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha256-4HLtjeVgH0eIB3aZ9mLYF6E8oU5chNdjU6p6rrXpl9U=" crossorigin="anonymous"></script>
<link href="../extra.css" rel="stylesheet">
<script src="../extra.js"></script>
<meta property="og:title" content="The Catalogue of Life — catalogue_of_life" />
<meta property="og:description" content="This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</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.5.0.9018</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span>
How to
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/atc_property.html">
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="../articles/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>
Other: benchmarks
</a>
</li>
</ul>
</li>
<li>
<a href="../reference/">
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fa fa-users"></span>
Authors
</a>
</li>
<li>
<a href="../news/">
<span class="far fa far fa-newspaper"></span>
Changelog
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://gitlab.com/msberends/AMR">
<span class="fab fa fab fa-gitlab"></span>
Source Code
</a>
</li>
<li>
<a href="../LICENSE-text.html">
<span class="fa fa-book"></span>
Licence
</a>
</li>
</ul>
<form class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="search" class="form-control" name="search-input" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
</div>
</form>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>The Catalogue of Life</h1>
<div class="hidden name"><code>catalogue_of_life.Rd</code></div>
</div>
<div class="ref-description">
<p>This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life.</p>
</div>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
<p><img src='figures/logo_col.png' height=60px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). This data is updated annually - check the included version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a></code>.</p>
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>
<p>The Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.</p>
<p>The syntax used to transform the original data to a cleansed R format, can be found here: <a href='https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R'>https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R</a>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
<p><img src='figures/logo.png' height=40px style=margin-bottom:5px /> <br />
On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitlab.io/AMR</a> you can find <a href='https://msberends.gitlab.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.gitlab.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.gitlab.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>.</p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><span class='co'># NOT RUN {</span>
<span class='co'># Get version info of included data set</span>
<span class='fu'><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a></span>()
<span class='co'># Get a note when a species was renamed</span>
<span class='fu'><a href='mo_property.html'>mo_shortname</a></span>(<span class='st'>"Chlamydia psittaci"</span>)
<span class='co'># Note: 'Chlamydia psittaci' (Page, 1968) was renamed</span>
<span class='co'># 'Chlamydophila psittaci' (Everett et al., 1999)</span>
<span class='co'># [1] "C. psittaci"</span>
<span class='co'># Get any property from the entire taxonomic tree for all included species</span>
<span class='fu'><a href='mo_property.html'>mo_class</a></span>(<span class='st'>"E. coli"</span>)
<span class='co'># [1] "Gammaproteobacteria"</span>
<span class='fu'><a href='mo_property.html'>mo_family</a></span>(<span class='st'>"E. coli"</span>)
<span class='co'># [1] "Enterobacteriaceae"</span>
<span class='fu'><a href='mo_property.html'>mo_gramstain</a></span>(<span class='st'>"E. coli"</span>) <span class='co'># based on kingdom and phylum, see ?mo_gramstain</span>
<span class='co'># [1] "Gram negative"</span>
<span class='fu'><a href='mo_property.html'>mo_ref</a></span>(<span class='st'>"E. coli"</span>)
<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='co'># [1] "Chroococcus limneticus elegans" # Because a microorganism was found</span>
<span class='co'># }</span></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#catalogue-of-life">Catalogue of Life</a></li>
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
<li><a href="#examples">Examples</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.js" integrity="sha256-GKvGqXDznoRYHCwKXGnuchvKSwmx9SRMrZOTh2g4Sb0=" crossorigin="anonymous"></script>
<script>
docsearch({
apiKey: 'f737050abfd4d726c63938e18f8c496e',
indexName: 'amr',
inputSelector: 'input#search-input.form-control',
transformData: function(hits) {
return hits.map(function (hit) {
hit.url = updateHitURL(hit);
return hit;
});
}
});
</script>
</body>
</html>

View File

@ -0,0 +1,311 @@
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Version info of included Catalogue of Life — catalogue_of_life_version • AMR (for R)</title>
<!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png" />
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png" />
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<!-- docsearch -->
<script src="../docsearch.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.css" integrity="sha256-QOSRU/ra9ActyXkIBbiIB144aDBdtvXBcNc3OTNuX/Q=" crossorigin="anonymous" />
<link href="../docsearch.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha256-4HLtjeVgH0eIB3aZ9mLYF6E8oU5chNdjU6p6rrXpl9U=" crossorigin="anonymous"></script>
<link href="../extra.css" rel="stylesheet">
<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="Version info of included Catalogue of Life" />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</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.5.0.9018</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span>
How to
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fa fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fa fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/atc_property.html">
<span class="fa fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/freq.html">
<span class="fa fa-sort-amount-down"></span>
Create frequency tables
</a>
</li>
<li>
<a href="../articles/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>
Other: benchmarks
</a>
</li>
</ul>
</li>
<li>
<a href="../reference/">
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fa fa-users"></span>
Authors
</a>
</li>
<li>
<a href="../news/">
<span class="far fa far fa-newspaper"></span>
Changelog
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://gitlab.com/msberends/AMR">
<span class="fab fa fab fa-gitlab"></span>
Source Code
</a>
</li>
<li>
<a href="../LICENSE-text.html">
<span class="fa fa-book"></span>
Licence
</a>
</li>
</ul>
<form class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="search" class="form-control" name="search-input" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
</div>
</form>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Version info of included Catalogue of Life</h1>
<div class="hidden name"><code>catalogue_of_life_version.Rd</code></div>
</div>
<div class="ref-description">
<p>Version info of included Catalogue of Life</p>
</div>
<pre class="usage"><span class='fu'>catalogue_of_life_version</span>()</pre>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
<p><img src='figures/logo_col.png' height=60px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). This data is updated annually - check the included version with <code>catalogue_of_life_version</code>.</p>
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>
<p>The Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.</p>
<p>The syntax used to transform the original data to a cleansed R format, can be found here: <a href='https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R'>https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R</a>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='microorganisms.html'>microorganisms</a></code></p></div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#catalogue-of-life">Catalogue of Life</a></li>
<li><a href="#see-also">See also</a></li>
</ul>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
</div>
</footer>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.js" integrity="sha256-GKvGqXDznoRYHCwKXGnuchvKSwmx9SRMrZOTh2g4Sb0=" crossorigin="anonymous"></script>
<script>
docsearch({
apiKey: 'f737050abfd4d726c63938e18f8c496e',
indexName: 'amr',
inputSelector: 'input#search-input.form-control',
transformData: function(hits) {
return hits.map(function (hit) {
hit.url = updateHitURL(hit);
return hit;
});
}
});
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -255,9 +255,15 @@
</tr><tr>
<td>
<p><code><a href="ITIS.html">ITIS</a></code> </p>
<p><code><a href="catalogue_of_life.html">catalogue_of_life</a></code> </p>
</td>
<td><p>ITIS: Integrated Taxonomic Information System</p></td>
<td><p>The Catalogue of Life</p></td>
</tr><tr>
<td>
<p><code><a href="catalogue_of_life_version.html">catalogue_of_life_version()</a></code> </p>
</td>
<td><p>Version info of included Catalogue of Life</p></td>
</tr><tr>
<td>
@ -349,7 +355,7 @@
</tr><tr>
<td>
<p><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_subkingdom()</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_taxonomy()</a></code> <code><a href="mo_property.html">mo_property()</a></code> </p>
<p><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_taxonomy()</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

@ -250,13 +250,20 @@
<dt><code>mo</code></dt><dd><p>ID of the microorganism in the <code><a href='microorganisms.html'>microorganisms</a></code> data set</p></dd>
</dl>
<h2 class="hasAnchor" id="itis"><a class="anchor" href="#itis"></a>ITIS</h2>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
<p><img src='figures/logo_itis.jpg' height=60px style=margin-bottom:5px /> <br />
This package contains the <strong>complete microbial taxonomic data</strong> (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, <a href='https://www.itis.gov'>https://www.itis.gov</a>).</p>
<p>All ~20,000 (sub)species from <strong>the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package</strong>, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.</p>
<p>ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].</p>
<p><img src='figures/logo_col.png' height=60px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). This data is updated annually - check the included version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a></code>.</p>
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>
<p>The Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.</p>
<p>The syntax used to transform the original data to a cleansed R format, can be found here: <a href='https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R'>https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R</a>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@ -276,7 +283,7 @@ On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitla
<li><a href="#format">Format</a></li>
<li><a href="#itis">ITIS</a></li>
<li><a href="#catalogue-of-life">Catalogue of Life</a></li>
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>

View File

@ -245,27 +245,26 @@
<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 56,659 observations and 15 variables:</p><dl class='dl-horizontal'>
<dt><code>mo</code></dt><dd><p>ID of microorganism</p></dd>
<p>A <code><a href='https://www.rdocumentation.org/packages/base/topics/data.frame'>data.frame</a></code> with 56,672 observations and 14 variables:</p><dl class='dl-horizontal'>
<dt><code>mo</code></dt><dd><p>ID of microorganism as used by this package</p></dd>
<dt><code>col_id</code></dt><dd><p>Catalogue of Life ID</p></dd>
<dt><code>genus</code></dt><dd><p>Taxonomic genus of the microorganism as found in ITIS, see Source</p></dd>
<dt><code>species</code></dt><dd><p>Taxonomic species of the microorganism as found in ITIS, see Source</p></dd>
<dt><code>subspecies</code></dt><dd><p>Taxonomic subspecies of the microorganism as found in ITIS, see Source</p></dd>
<dt><code>fullname</code></dt><dd><p>Full name, like <code>"Echerichia coli"</code></p></dd>
<dt><code>family</code></dt><dd><p>Taxonomic family of the microorganism as found in ITIS, see Source</p></dd>
<dt><code>order</code></dt><dd><p>Taxonomic order of the microorganism as found in ITIS, see Source</p></dd>
<dt><code>class</code></dt><dd><p>Taxonomic class of the microorganism as found in ITIS, see Source</p></dd>
<dt><code>phylum</code></dt><dd><p>Taxonomic phylum of the microorganism as found in ITIS, see Source</p></dd>
<dt><code>subkingdom</code></dt><dd><p>Taxonomic subkingdom of the microorganism as found in ITIS, see Source</p></dd>
<dt><code>kingdom</code></dt><dd><p>Taxonomic kingdom of the microorganism as found in ITIS, see Source</p></dd>
<dt><code>gramstain</code></dt><dd><p>Gram of microorganism, like <code>"Gram negative"</code></p></dd>
<dt><code>prevalence</code></dt><dd><p>An integer based on estimated prevalence of the microorganism in humans. Used internally by <code><a href='as.mo.html'>as.mo</a></code>, otherwise quite meaningless. It has a value of 25 for manually added items and a value of 1000 for all unprevalent microorganisms whose genus was somewhere in the top 250 (with another species).</p></dd>
<dt><code>ref</code></dt><dd><p>Author(s) and year of concerning publication as found in ITIS, see Source</p></dd>
<dt><code>kingdom</code></dt><dd><p>Taxonomic kingdom of the microorganism</p></dd>
<dt><code>phylum</code></dt><dd><p>Taxonomic phylum of the microorganism</p></dd>
<dt><code>class</code></dt><dd><p>Taxonomic class of the microorganism</p></dd>
<dt><code>order</code></dt><dd><p>Taxonomic order of the microorganism</p></dd>
<dt><code>family</code></dt><dd><p>Taxonomic family of the microorganism</p></dd>
<dt><code>genus</code></dt><dd><p>Taxonomic genus of the microorganism</p></dd>
<dt><code>species</code></dt><dd><p>Taxonomic species of the microorganism</p></dd>
<dt><code>subspecies</code></dt><dd><p>Taxonomic subspecies of the microorganism</p></dd>
<dt><code>rank</code></dt><dd><p>Taxonomic rank of the microorganism, like <code>"species"</code> or <code>"genus"</code></p></dd>
<dt><code>ref</code></dt><dd><p>Author(s) and year of concerning scientific publication</p></dd>
<dt><code>species_id</code></dt><dd><p>ID of the species as used by the Catalogue of Life</p></dd>
</dl>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>Integrated Taxonomic Information System (ITIS) public online database, <a href='https://www.itis.gov'>https://www.itis.gov</a>.</p>
<p>Catalogue of Life: Annual Checklist (public online database), <a href='www.catalogueoflife.org'>www.catalogueoflife.org</a>.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
@ -275,13 +274,20 @@
<li><p>2 other undefined (unknown Gram negatives and unknown Gram positives)</p></li>
</ul>
<h2 class="hasAnchor" id="itis"><a class="anchor" href="#itis"></a>ITIS</h2>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
<p><img src='figures/logo_itis.jpg' height=60px style=margin-bottom:5px /> <br />
This package contains the <strong>complete microbial taxonomic data</strong> (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, <a href='https://www.itis.gov'>https://www.itis.gov</a>).</p>
<p>All ~20,000 (sub)species from <strong>the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package</strong>, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.</p>
<p>ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].</p>
<p><img src='figures/logo_col.png' height=60px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). This data is updated annually - check the included version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a></code>.</p>
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>
<p>The Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.</p>
<p>The syntax used to transform the original data to a cleansed R format, can be found here: <a href='https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R'>https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R</a>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@ -291,7 +297,7 @@ On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitla
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p><code><a href='as.mo.html'>as.mo</a></code> <code><a href='mo_property.html'>mo_property</a></code> <code><a href='microorganisms.codes.html'>microorganisms.codes</a></code></p></div>
<div class='dont-index'><p><code><a href='as.mo.html'>as.mo</a></code>, <code><a href='mo_property.html'>mo_property</a></code>, <code><a href='microorganisms.codes.html'>microorganisms.codes</a></code></p></div>
</div>
@ -305,7 +311,7 @@ On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitla
<li><a href="#details">Details</a></li>
<li><a href="#itis">ITIS</a></li>
<li><a href="#catalogue-of-life">Catalogue of Life</a></li>
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>

View File

@ -47,7 +47,7 @@
<script src="../extra.js"></script>
<meta property="og:title" content="Data set with previously accepted taxonomic names — microorganisms.old" />
<meta property="og:description" content="A data set containing old (previously valid or accepted) taxonomic names according to ITIS. This data set is used internally by as.mo." />
<meta property="og:description" content="A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by as.mo." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" />
@ -237,7 +237,7 @@
<div class="ref-description">
<p>A data set containing old (previously valid or accepted) taxonomic names according to ITIS. This data set is used internally by <code><a href='as.mo.html'>as.mo</a></code>.</p>
<p>A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by <code><a href='as.mo.html'>as.mo</a></code>.</p>
</div>
@ -248,21 +248,28 @@
<p>A <code><a href='https://www.rdocumentation.org/packages/base/topics/data.frame'>data.frame</a></code> with 14,506 observations and 4 variables:</p><dl class='dl-horizontal'>
<dt><code>col_id</code></dt><dd><p>Catalogue of Life ID</p></dd>
<dt><code>tsn_new</code></dt><dd><p>New Catalogue of Life ID</p></dd>
<dt><code>fullname</code></dt><dd><p>Old taxonomic name of the microorganism as found in the CoL, see Source</p></dd>
<dt><code>ref</code></dt><dd><p>Author(s) and year of concerning publication as found in the CoL, see Source</p></dd>
<dt><code>fullname</code></dt><dd><p>Old taxonomic name of the microorganism</p></dd>
<dt><code>ref</code></dt><dd><p>Author(s) and year of concerning scientific publication</p></dd>
</dl>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>[3] Integrated Taxonomic Information System (ITIS) on-line database, <a href='https://www.itis.gov'>https://www.itis.gov</a>.</p>
<p>[3] Catalogue of Life: Annual Checklist (public online database), <a href='www.catalogueoflife.org'>www.catalogueoflife.org</a>.</p>
<h2 class="hasAnchor" id="itis"><a class="anchor" href="#itis"></a>ITIS</h2>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
<p><img src='figures/logo_itis.jpg' height=60px style=margin-bottom:5px /> <br />
This package contains the <strong>complete microbial taxonomic data</strong> (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, <a href='https://www.itis.gov'>https://www.itis.gov</a>).</p>
<p>All ~20,000 (sub)species from <strong>the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package</strong>, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.</p>
<p>ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].</p>
<p><img src='figures/logo_col.png' height=60px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). This data is updated annually - check the included version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a></code>.</p>
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>
<p>The Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.</p>
<p>The syntax used to transform the original data to a cleansed R format, can be found here: <a href='https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R'>https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R</a>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@ -284,7 +291,7 @@ On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitla
<li><a href="#source">Source</a></li>
<li><a href="#itis">ITIS</a></li>
<li><a href="#catalogue-of-life">Catalogue of Life</a></li>
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>

View File

@ -259,8 +259,6 @@
<span class='fu'>mo_phylum</span>(<span class='no'>x</span>, <span class='no'>...</span>)
<span class='fu'>mo_subkingdom</span>(<span class='no'>x</span>, <span class='no'>...</span>)
<span class='fu'>mo_kingdom</span>(<span class='no'>x</span>, <span class='no'>...</span>)
<span class='fu'>mo_type</span>(<span class='no'>x</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)
@ -275,6 +273,8 @@
<span class='fu'>mo_taxonomy</span>(<span class='no'>x</span>, <span class='no'>...</span>)
<span class='fu'>mo_url</span>(<span class='no'>x</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='get_locale.html'>get_locale</a></span>(), <span class='no'>...</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
@ -310,31 +310,40 @@
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>All functions will return the most recently known taxonomic property according to ITIS, except for <code>mo_ref</code>, <code>mo_authors</code> and <code>mo_year</code>. This leads to the following results:</p><ul>
<p>All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for <code>mo_ref</code>, <code>mo_authors</code> and <code>mo_year</code>. This leads to the following results:</p><ul>
<li><p><code>mo_fullname("Chlamydia psittaci")</code> will return <code>"Chlamydophila psittaci"</code> (with a warning about the renaming)</p></li>
<li><p><code>mo_ref("Chlamydia psittaci")</code> will return <code>"Page, 1968"</code> (with a warning about the renaming)</p></li>
<li><p><code>mo_ref("Chlamydophila psittaci")</code> will return <code>"Everett et al., 1999"</code> (without a warning)</p></li>
</ul>
<p>The Gram stain - <code>mo_gramstain()</code> - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes (ref: <a href='https://itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&amp;search_value=956097'>https://itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&amp;search_value=956097</a>). These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value <code>NA</code>.</p>
<p>The function <code>mo_url()</code> will return the direct URL to the species in the Catalogue of Life.</p>
<h2 class="hasAnchor" id="supported-languages"><a class="anchor" href="#supported-languages"></a>Supported languages</h2>
<p>Supported languages are <code>"en"</code> (English), <code>"de"</code> (German), <code>"nl"</code> (Dutch), <code>"es"</code> (Spanish), <code>"it"</code> (Italian), <code>"fr"</code> (French), and <code>"pt"</code> (Portuguese).</p>
<h2 class="hasAnchor" id="itis"><a class="anchor" href="#itis"></a>ITIS</h2>
<h2 class="hasAnchor" id="catalogue-of-life"><a class="anchor" href="#catalogue-of-life"></a>Catalogue of Life</h2>
<p><img src='figures/logo_itis.jpg' height=60px style=margin-bottom:5px /> <br />
This package contains the <strong>complete microbial taxonomic data</strong> (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, <a href='https://www.itis.gov'>https://www.itis.gov</a>).</p>
<p>All ~20,000 (sub)species from <strong>the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package</strong>, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.</p>
<p>ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].</p>
<p><img src='figures/logo_col.png' height=60px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). This data is updated annually - check the included version with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a></code>.</p>
<p>Included are:</p><ul>
<li><p>All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses</p></li>
<li><p>All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed</p></li>
<li><p>The complete taxonomic tree of all included (sub)species: from kingdom to subspecies</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>
<p>The Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.</p>
<p>The syntax used to transform the original data to a cleansed R format, can be found here: <a href='https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R'>https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R</a>.</p>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
<p>[1] Becker K <em>et al.</em> <strong>Coagulase-Negative Staphylococci</strong>. 2014. Clin Microbiol Rev. 27(4): 870926. <a href='https://dx.doi.org/10.1128/CMR.00109-13'>https://dx.doi.org/10.1128/CMR.00109-13</a></p>
<p>[2] Lancefield RC <strong>A serological differentiation of human and other groups of hemolytic streptococci</strong>. 1933. J Exp Med. 57(4): 57195. <a href='https://dx.doi.org/10.1084/jem.57.4.571'>https://dx.doi.org/10.1084/jem.57.4.571</a></p>
<p>[3] Integrated Taxonomic Information System (ITIS). Retrieved September 2018. <a href='http://www.itis.gov'>http://www.itis.gov</a></p>
<p>[3] Catalogue of Life: Annual Checklist (public online database), <a href='www.catalogueoflife.org'>www.catalogueoflife.org</a>.</p>
<h2 class="hasAnchor" id="read-more-on-our-website-"><a class="anchor" href="#read-more-on-our-website-"></a>Read more on our website!</h2>
@ -352,14 +361,13 @@ On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitla
<span class='co'># All properties of Escherichia coli</span>
<span class='co'>## taxonomic properties</span>
<span class='fu'>mo_kingdom</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Bacteria"</span>
<span class='fu'>mo_subkingdom</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Negibacteria"</span>
<span class='fu'>mo_phylum</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Proteobacteria"</span>
<span class='fu'>mo_class</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Gammaproteobacteria"</span>
<span class='fu'>mo_order</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Enterobacteriales"</span>
<span class='fu'>mo_family</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Enterobacteriaceae"</span>
<span class='fu'>mo_genus</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Escherichia"</span>
<span class='fu'>mo_species</span>(<span class='st'>"E. coli"</span>) <span class='co'># "coli"</span>
<span class='fu'>mo_subspecies</span>(<span class='st'>"E. coli"</span>) <span class='co'># NA</span>
<span class='fu'>mo_subspecies</span>(<span class='st'>"E. coli"</span>) <span class='co'># ""</span>
<span class='co'>## colloquial properties</span>
<span class='fu'>mo_fullname</span>(<span class='st'>"E. coli"</span>) <span class='co'># "Escherichia coli"</span>
@ -440,7 +448,7 @@ On our website <a href='https://msberends.gitlab.io/AMR'>https://msberends.gitla
<li><a href="#supported-languages">Supported languages</a></li>
<li><a href="#itis">ITIS</a></li>
<li><a href="#catalogue-of-life">Catalogue of Life</a></li>
<li><a href="#source">Source</a></li>

View File

@ -9,9 +9,6 @@
<url>
<loc>https://msberends.gitlab.io/AMR/reference/AMR.html</loc>
</url>
<url>
<loc>https://msberends.gitlab.io/AMR/reference/ITIS.html</loc>
</url>
<url>
<loc>https://msberends.gitlab.io/AMR/reference/WHOCC.html</loc>
</url>
@ -51,6 +48,12 @@
<url>
<loc>https://msberends.gitlab.io/AMR/reference/availability.html</loc>
</url>
<url>
<loc>https://msberends.gitlab.io/AMR/reference/catalogue_of_life.html</loc>
</url>
<url>
<loc>https://msberends.gitlab.io/AMR/reference/catalogue_of_life_version.html</loc>
</url>
<url>
<loc>https://msberends.gitlab.io/AMR/reference/count.html</loc>
</url>

View File

@ -97,13 +97,20 @@ Read more about the data from WHOCC [in our manual](./reference/WHOCC.html).
#### Microbial (taxonomic) reference data
<img src="man/figures/logo_itis.jpg" height="60px">
<img src="man/figures/logo_col.png" height="60px">
This package contains the **complete microbial taxonomic data** (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, https://www.itis.gov).
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life ([www.catalogueoflife.org](http://www.catalogueoflife.org)). This data is updated annually - check the included version with `catalogue_of_life_version()`.
All ~20,000 (sub)species from **the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package**, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.
Included are:
Read more about the data from ITIS [in our manual](./reference/ITIS.html).
* All ~55,000 species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses
* All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera *Aspergillus*, *Candida*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*).
* All ~15,000 previously accepted names of species that have been taxonomically renamed
* The responsible author(s) and year of scientific publication
The Catalogue of Life ([www.catalogueoflife.org](http://www.catalogueoflife.org)) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
Read more about the data from the Catalogue of Life [in our manual](./reference/catalogue_of_life.html).
#### Overview of functions

View File

@ -1,53 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/itis.R
\name{ITIS}
\alias{ITIS}
\title{ITIS: Integrated Taxonomic Information System}
\description{
All taxonomic names of all microorganisms are included in this package, using the authoritative Integrated Taxonomic Information System (ITIS).
}
\section{ITIS}{
\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}).
All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.
ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].
}
\section{Read more on our website!}{
\if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr}
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
}
\examples{
# Get a note when a species was renamed
mo_shortname("Chlamydia psittaci")
# Note: 'Chlamydia psittaci' (Page, 1968) was renamed
# 'Chlamydophila psittaci' (Everett et al., 1999)
# [1] "C. psittaci"
# Get any property from the entire taxonomic tree for all included species
mo_class("E. coli")
# [1] "Gammaproteobacteria"
mo_family("E. coli")
# [1] "Enterobacteriaceae"
mo_subkingdom("E. coli")
# [1] "Negibacteria"
mo_gramstain("E. coli") # based on subkingdom
# [1] "Gram negative"
mo_ref("E. coli")
# [1] "Castellani and Chalmers, 1919"
# Do not get mistaken - the package only includes microorganisms
mo_phylum("C. elegans")
# [1] "Cyanobacteria" # Bacteria?!
mo_fullname("C. elegans")
# [1] "Chroococcus limneticus elegans" # Because a microorganism was found
}

View File

@ -84,7 +84,7 @@ When using \code{allow_uncertain = TRUE} (which is the default setting), it will
\item{It strips off values between brackets and the brackets itself, and re-evaluates the input with all previous rules}
\item{It strips off words from the end one by one and re-evaluates the input with all previous rules}
\item{It strips off words from the start one by one and re-evaluates the input with all previous rules}
\item{It tries to look for some manual changes which are not yet published to the ITIS database (like \emph{Propionibacterium} not yet being \emph{Cutibacterium})}
\item{It tries to look for some manual changes which are not yet published to the Catalogue of Life (like \emph{Propionibacterium} not yet being \emph{Cutibacterium})}
}
Examples:
@ -107,17 +107,26 @@ Use \code{mo_renamed()} to get a vector with all values that could be coerced ba
[2] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 57195. \url{https://dx.doi.org/10.1084/jem.57.4.571}
[3] Integrated Taxonomic Information System (ITIS). Retrieved September 2018. \url{http://www.itis.gov}
[3] Catalogue of Life: Annual Checklist (public online database), \url{www.catalogueoflife.org}.
}
\section{ITIS}{
\section{Catalogue of Life}{
\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}).
\if{html}{\figure{logo_col.png}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). This data is updated annually - check the included version with \code{\link{catalogue_of_life_version}}.
All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}
ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].
The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R}.
}
\section{Read more on our website!}{
@ -176,7 +185,7 @@ df <- df \%>\%
}
}
\seealso{
\code{\link{microorganisms}} for the \code{data.frame} with ITIS content that is being used to determine ID's. \cr
\code{\link{microorganisms}} for the \code{data.frame} that is being used to determine ID's. \cr
The \code{\link{mo_property}} functions (like \code{\link{mo_genus}}, \code{\link{mo_gramstain}}) to get properties based on the returned code.
}
\keyword{Becker}

63
man/catalogue_of_life.Rd Normal file
View File

@ -0,0 +1,63 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/catalogue_of_life.R
\name{catalogue_of_life}
\alias{catalogue_of_life}
\title{The Catalogue of Life}
\description{
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life.
}
\section{Catalogue of Life}{
\if{html}{\figure{logo_col.png}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). This data is updated annually - check the included version with \code{\link{catalogue_of_life_version}}.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}
The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R}.
}
\section{Read more on our website!}{
\if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr}
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
}
\examples{
# Get version info of included data set
catalogue_of_life_version()
# Get a note when a species was renamed
mo_shortname("Chlamydia psittaci")
# Note: 'Chlamydia psittaci' (Page, 1968) was renamed
# 'Chlamydophila psittaci' (Everett et al., 1999)
# [1] "C. psittaci"
# Get any property from the entire taxonomic tree for all included species
mo_class("E. coli")
# [1] "Gammaproteobacteria"
mo_family("E. coli")
# [1] "Enterobacteriaceae"
mo_gramstain("E. coli") # based on kingdom and phylum, see ?mo_gramstain
# [1] "Gram negative"
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")
# [1] "Chroococcus limneticus elegans" # Because a microorganism was found
}

View File

@ -0,0 +1,33 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data.R
\name{catalogue_of_life_version}
\alias{catalogue_of_life_version}
\title{Version info of included Catalogue of Life}
\usage{
catalogue_of_life_version()
}
\description{
Version info of included Catalogue of Life
}
\section{Catalogue of Life}{
\if{html}{\figure{logo_col.png}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). This data is updated annually - check the included version with \code{\link{catalogue_of_life_version}}.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}
The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R}.
}
\seealso{
\code{\link{microorganisms}}
}

BIN
man/figures/logo_col.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

View File

@ -4,26 +4,25 @@
\name{microorganisms}
\alias{microorganisms}
\title{Data set with ~60,000 microorganisms}
\format{A \code{\link{data.frame}} with 56,659 observations and 15 variables:
\format{A \code{\link{data.frame}} with 56,672 observations and 14 variables:
\describe{
\item{\code{mo}}{ID of microorganism}
\item{\code{mo}}{ID of microorganism as used by this package}
\item{\code{col_id}}{Catalogue of Life ID}
\item{\code{genus}}{Taxonomic genus of the microorganism as found in ITIS, see Source}
\item{\code{species}}{Taxonomic species of the microorganism as found in ITIS, see Source}
\item{\code{subspecies}}{Taxonomic subspecies of the microorganism as found in ITIS, see Source}
\item{\code{fullname}}{Full name, like \code{"Echerichia coli"}}
\item{\code{family}}{Taxonomic family of the microorganism as found in ITIS, see Source}
\item{\code{order}}{Taxonomic order of the microorganism as found in ITIS, see Source}
\item{\code{class}}{Taxonomic class of the microorganism as found in ITIS, see Source}
\item{\code{phylum}}{Taxonomic phylum of the microorganism as found in ITIS, see Source}
\item{\code{subkingdom}}{Taxonomic subkingdom of the microorganism as found in ITIS, see Source}
\item{\code{kingdom}}{Taxonomic kingdom of the microorganism as found in ITIS, see Source}
\item{\code{gramstain}}{Gram of microorganism, like \code{"Gram negative"}}
\item{\code{prevalence}}{An integer based on estimated prevalence of the microorganism in humans. Used internally by \code{\link{as.mo}}, otherwise quite meaningless. It has a value of 25 for manually added items and a value of 1000 for all unprevalent microorganisms whose genus was somewhere in the top 250 (with another species).}
\item{\code{ref}}{Author(s) and year of concerning publication as found in ITIS, see Source}
\item{\code{kingdom}}{Taxonomic kingdom of the microorganism}
\item{\code{phylum}}{Taxonomic phylum of the microorganism}
\item{\code{class}}{Taxonomic class of the microorganism}
\item{\code{order}}{Taxonomic order of the microorganism}
\item{\code{family}}{Taxonomic family of the microorganism}
\item{\code{genus}}{Taxonomic genus of the microorganism}
\item{\code{species}}{Taxonomic species of the microorganism}
\item{\code{subspecies}}{Taxonomic subspecies of the microorganism}
\item{\code{rank}}{Taxonomic rank of the microorganism, like \code{"species"} or \code{"genus"}}
\item{\code{ref}}{Author(s) and year of concerning scientific publication}
\item{\code{species_id}}{ID of the species as used by the Catalogue of Life}
}}
\source{
Integrated Taxonomic Information System (ITIS) public online database, \url{https://www.itis.gov}.
Catalogue of Life: Annual Checklist (public online database), \url{www.catalogueoflife.org}.
}
\usage{
microorganisms
@ -39,14 +38,23 @@ Manually added were:
\item{2 other undefined (unknown Gram negatives and unknown Gram positives)}
}
}
\section{ITIS}{
\section{Catalogue of Life}{
\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}).
\if{html}{\figure{logo_col.png}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). This data is updated annually - check the included version with \code{\link{catalogue_of_life_version}}.
All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}
ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].
The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R}.
}
\section{Read more on our website!}{
@ -56,6 +64,6 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
}
\seealso{
\code{\link{as.mo}} \code{\link{mo_property}} \code{\link{microorganisms.codes}}
\code{\link{as.mo}}, \code{\link{mo_property}}, \code{\link{microorganisms.codes}}
}
\keyword{datasets}

View File

@ -15,14 +15,23 @@ microorganisms.codes
\description{
A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with \code{\link{set_mo_source}}.
}
\section{ITIS}{
\section{Catalogue of Life}{
\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}).
\if{html}{\figure{logo_col.png}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). This data is updated annually - check the included version with \code{\link{catalogue_of_life_version}}.
All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}
ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].
The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R}.
}
\section{Read more on our website!}{

View File

@ -8,26 +8,35 @@
\describe{
\item{\code{col_id}}{Catalogue of Life ID}
\item{\code{tsn_new}}{New Catalogue of Life ID}
\item{\code{fullname}}{Old taxonomic name of the microorganism as found in the CoL, see Source}
\item{\code{ref}}{Author(s) and year of concerning publication as found in the CoL, see Source}
\item{\code{fullname}}{Old taxonomic name of the microorganism}
\item{\code{ref}}{Author(s) and year of concerning scientific publication}
}}
\source{
[3] Integrated Taxonomic Information System (ITIS) on-line database, \url{https://www.itis.gov}.
[3] Catalogue of Life: Annual Checklist (public online database), \url{www.catalogueoflife.org}.
}
\usage{
microorganisms.old
}
\description{
A data set containing old (previously valid or accepted) taxonomic names according to ITIS. This data set is used internally by \code{\link{as.mo}}.
A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by \code{\link{as.mo}}.
}
\section{ITIS}{
\section{Catalogue of Life}{
\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}).
\if{html}{\figure{logo_col.png}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). This data is updated annually - check the included version with \code{\link{catalogue_of_life_version}}.
All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}
ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].
The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R}.
}
\section{Read more on our website!}{

View File

@ -11,7 +11,6 @@
\alias{mo_order}
\alias{mo_class}
\alias{mo_phylum}
\alias{mo_subkingdom}
\alias{mo_kingdom}
\alias{mo_type}
\alias{mo_gramstain}
@ -19,6 +18,7 @@
\alias{mo_authors}
\alias{mo_year}
\alias{mo_taxonomy}
\alias{mo_url}
\title{Property of a microorganism}
\usage{
mo_fullname(x, language = get_locale(), ...)
@ -39,8 +39,6 @@ mo_class(x, ...)
mo_phylum(x, ...)
mo_subkingdom(x, ...)
mo_kingdom(x, ...)
mo_type(x, language = get_locale(), ...)
@ -55,6 +53,8 @@ mo_year(x, ...)
mo_taxonomy(x, ...)
mo_url(x, ...)
mo_property(x, property = "fullname", language = get_locale(), ...)
}
\arguments{
@ -77,26 +77,39 @@ mo_property(x, property = "fullname", language = get_locale(), ...)
Use these functions to return a specific property of a microorganism from the \code{\link{microorganisms}} data set. All input values will be evaluated internally with \code{\link{as.mo}}.
}
\details{
All functions will return the most recently known taxonomic property according to ITIS, except for \code{mo_ref}, \code{mo_authors} and \code{mo_year}. This leads to the following results:
All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for \code{mo_ref}, \code{mo_authors} and \code{mo_year}. This leads to the following results:
\itemize{
\item{\code{mo_fullname("Chlamydia psittaci")} will return \code{"Chlamydophila psittaci"} (with a warning about the renaming)}
\item{\code{mo_ref("Chlamydia psittaci")} will return \code{"Page, 1968"} (with a warning about the renaming)}
\item{\code{mo_ref("Chlamydophila psittaci")} will return \code{"Everett et al., 1999"} (without a warning)}
}
The Gram stain - \code{mo_gramstain()} - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes (ref: \url{https://itis.gov/servlet/SingleRpt/SingleRpt?search_topic=TSN&search_value=956097}). These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value \code{NA}.
The function \code{mo_url()} will return the direct URL to the species in the Catalogue of Life.
}
\section{Supported languages}{
Supported languages are \code{"en"} (English), \code{"de"} (German), \code{"nl"} (Dutch), \code{"es"} (Spanish), \code{"it"} (Italian), \code{"fr"} (French), and \code{"pt"} (Portuguese).
}
\section{ITIS}{
\section{Catalogue of Life}{
\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}).
\if{html}{\figure{logo_col.png}{options: height=60px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). This data is updated annually - check the included version with \code{\link{catalogue_of_life_version}}.
All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since ITIS honours the taxonomic branching order of bacterial phyla according to Cavalier-Smith (2002), which defines that all bacteria are classified into either subkingdom Negibacteria or subkingdom Posibacteria.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,000 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales and Schizosaccharomycetales. The kingdom of Fungi is a very large taxon with almost 300,000 different species, of which most are not microbial. Including everything tremendously slows down our algortihms, and not all fungi fit the scope of this package. By only including the aforementioned taxonomic orders, the most relevant species are covered (like genera \emph{Aspergillus}, \emph{Candida}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of (sub)species that have been taxonomically renamed}
\item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies}
\item{The responsible author(s) and year of scientific publication}
}
ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].
The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.6 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
The syntax used to transform the original data to a cleansed R format, can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/reproduction_of_microorganisms.R}.
}
\section{Source}{
@ -105,7 +118,7 @@ ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic spec
[2] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 57195. \url{https://dx.doi.org/10.1084/jem.57.4.571}
[3] Integrated Taxonomic Information System (ITIS). Retrieved September 2018. \url{http://www.itis.gov}
[3] Catalogue of Life: Annual Checklist (public online database), \url{www.catalogueoflife.org}.
}
\section{Read more on our website!}{
@ -118,14 +131,13 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
# All properties of Escherichia coli
## taxonomic properties
mo_kingdom("E. coli") # "Bacteria"
mo_subkingdom("E. coli") # "Negibacteria"
mo_phylum("E. coli") # "Proteobacteria"
mo_class("E. coli") # "Gammaproteobacteria"
mo_order("E. coli") # "Enterobacteriales"
mo_family("E. coli") # "Enterobacteriaceae"
mo_genus("E. coli") # "Escherichia"
mo_species("E. coli") # "coli"
mo_subspecies("E. coli") # NA
mo_subspecies("E. coli") # ""
## colloquial properties
mo_fullname("E. coli") # "Escherichia coli"

View File

@ -0,0 +1,256 @@
# Catalogue of Life
# Data retrieved from Encyclopaedia of Life:
# https://opendata.eol.org/dataset/catalogue-of-life/
# unzip and extract taxon.tab, then:
taxon <- data.table::fread("taxon.tab")
# result is over 3.7M rows
taxon %>% freq(kingdom)
# Item Count Percent Cum. Count Cum. Percent
# --- ---------- ---------- -------- ----------- -------------
# 1 Animalia 2,225,627 59.1% 2,225,627 59.1%
# 2 Plantae 1,177,412 31.3% 3,403,039 90.4%
# 3 Fungi 290,145 7.7% 3,693,184 98.1%
# 4 Chromista 47,126 1.3% 3,740,310 99.3%
# 5 Bacteria 14,478 0.4% 3,754,788 99.7%
# 6 Protozoa 6,060 0.2% 3,760,848 99.9%
# 7 Viruses 3,827 0.1% 3,764,675 100.0%
# 8 Archaea 610 0.0% 3,765,285 100.0%
MOs <- taxon %>%
# tibble for future transformations
as_tibble() %>%
filter(
# we only want all microorganisms and viruses
!kingdom %in% c("Animalia", "Plantae"),
# and no entries above genus - they all already have a taxonomic tree
!taxonRank %in% c("kingdom", "phylum", "superfamily", "class", "order", "family"),
# not all fungi: Aspergillus, Candida, Trichphyton and Pneumocystis are the most important,
# so only keep these orders from the fungi:
!(kingdom == "Fungi" & !order %in% c("Eurotiales", "Saccharomycetales", "Schizosaccharomycetales", "Onygenales", "Pneumocystales"))) %>%
# remove text if it contains 'Not assigned' like phylum in viruses
mutate_all(funs(gsub("Not assigned", "", .))) %>%
# only latest ref, not original authors
mutate(scientificNameAuthorship = trimws(gsub(".*[)] ", "", scientificNameAuthorship)),
scientificNameAuthorship = ifelse(grepl(" emend[. ]", scientificNameAuthorship, ignore.case = TRUE),
gsub("(.*)emend[. ]+(.*)", "\\2", scientificNameAuthorship, ignore.case = TRUE),
scientificNameAuthorship),
scientificNameAuthorship = gsub(".", "", scientificNameAuthorship, fixed = TRUE),
scientificNameAuthorship = gsub(",? et al", " et al.", scientificNameAuthorship, fixed = FALSE, ignore.case = TRUE),
scientificNameAuthorship = gsub("[()]", "", scientificNameAuthorship),
# year always preceded by comma
scientificNameAuthorship = gsub(" ([0-9]{4})$", ", \\1", scientificNameAuthorship),
scientificNameAuthorship = gsub(",,", ",", scientificNameAuthorship, fixed = TRUE),
# only first author with *et al.*
scientificNameAuthorship = gsub(",.*,", " et al.,", scientificNameAuthorship),
scientificNameAuthorship = gsub(" (and|&) .*,", " et al.,", scientificNameAuthorship),
scientificNameAuthorship = gsub(", [^0-9]+", ", ", scientificNameAuthorship),
scientificNameAuthorship = gsub(", $", "", scientificNameAuthorship)
)
# remove non-ASCII characters (not allowed by CRAN)
MOs <- MOs %>%
lapply(iconv, from = "UTF-8", to = "ASCII//TRANSLIT") %>%
as_tibble(stringsAsFactors = FALSE)
# split old taxonomic names - they refer to a new `taxonID` with `acceptedNameUsageID`
MOs.old <- MOs %>%
filter(!is.na(acceptedNameUsageID),
scientificNameAuthorship != "") %>%
transmute(col_id = taxonID,
col_id_new = acceptedNameUsageID,
fullname =
trimws(
gsub("(.*)[(].*", "\\1",
stringr::str_replace(
string = scientificName,
pattern = stringr::fixed(scientificNameAuthorship),
replacement = ""))),
ref = scientificNameAuthorship) %>%
filter(!is.na(fullname)) %>%
distinct(fullname, .keep_all = TRUE) %>%
arrange(col_id)
MOs <- MOs %>%
filter(is.na(acceptedNameUsageID)) %>%
transmute(col_id = taxonID,
fullname = trimws(ifelse(kingdom == "Viruses",
paste(specificEpithet, infraspecificEpithet),
paste(genus, specificEpithet, infraspecificEpithet))),
kingdom,
phylum,
class,
order,
family,
genus = gsub(":", "", genus),
species = specificEpithet,
subspecies = infraspecificEpithet,
rank = taxonRank,
ref = scientificNameAuthorship,
species_id = gsub(".*/([a-f0-9]+)", "\\1", furtherInformationURL)) %>%
distinct(fullname, .keep_all = TRUE) %>%
filter(!grepl("unassigned", fullname, ignore.case = TRUE))
# only old names of species that are in MOs:
MOs.old <- MOs.old %>% filter(col_id_new %in% MOs$col_id)
MOs <- MOs %>%
group_by(kingdom) %>%
# abbreviations may be same for genera between kingdoms,
# because each abbreviation starts with the the first character of the kingdom
mutate(abbr_genus = abbreviate(genus,
minlength = 5,
use.classes = TRUE,
method = "both.sides",
strict = FALSE)) %>%
ungroup() %>%
group_by(genus) %>%
# species abbreviations may be the same between genera
# because the genus abbreviation is part of the abbreviation
mutate(abbr_species = abbreviate(species,
minlength = 3,
use.classes = FALSE,
method = "both.sides")) %>%
ungroup() %>%
group_by(genus, species) %>%
mutate(abbr_subspecies = abbreviate(subspecies,
minlength = 3,
use.classes = FALSE,
method = "both.sides")) %>%
ungroup() %>%
# remove trailing underscores
mutate(mo = gsub("_+$", "",
toupper(paste(substr(kingdom, 1, 1),
abbr_genus,
abbr_species,
abbr_subspecies,
sep = "_")))) %>%
mutate(mo = ifelse(duplicated(.$mo), paste0(mo, "1"), mo)) %>%
select(mo, everything(), -abbr_genus, -abbr_species, -abbr_subspecies)
# everything distinct?
sum(duplicated(MOs$mo))
# add non-taxonomic entries
MOs <- MOs %>%
bind_rows(
# CoNS
MOs %>%
filter(genus == "Staphylococcus", species == "epidermidis") %>% .[1,] %>%
mutate(mo = gsub("EPI", "CNS", mo),
col_id = NA_integer_,
species = "coagulase negative",
fullname = "Coagulase Negative Staphylococcus (CoNS)",
ref = NA_character_),
# CoPS
MOs %>%
filter(genus == "Staphylococcus", species == "epidermidis") %>% .[1,] %>%
mutate(mo = gsub("EPI", "CPS", mo),
col_id = NA_integer_,
species = "coagulase positive",
fullname = "Coagulase Positive Staphylococcus (CoPS)",
ref = NA_character_),
# Streptococci groups A, B, C, F, H, K
MOs %>%
filter(genus == "Streptococcus", species == "agalactiae") %>% .[1,] %>%
mutate(mo = gsub("AGA", "GRA", mo),
col_id = NA_integer_,
species = "group A" ,
fullname = "Streptococcus group A"),
MOs %>%
filter(genus == "Streptococcus", species == "dysgalactiae") %>% .[1,] %>%
mutate(mo = gsub("DYS", "GRB", mo),
col_id = NA_integer_,
species = "group B" ,
fullname = "Streptococcus group B"),
MOs %>%
filter(genus == "Streptococcus", species == "agalactiae") %>% .[1,] %>%
mutate(mo = gsub("AGA", "GRC", mo),
col_id = NA_integer_,
species = "group C" ,
fullname = "Streptococcus group C",
ref = NA_character_),
MOs %>%
filter(genus == "Streptococcus", species == "agalactiae") %>% .[1,] %>%
mutate(mo = gsub("AGA", "GRD", mo),
col_id = NA_integer_,
species = "group D" ,
fullname = "Streptococcus group D",
ref = NA_character_),
MOs %>%
filter(genus == "Streptococcus", species == "agalactiae") %>% .[1,] %>%
mutate(mo = gsub("AGA", "GRF", mo),
col_id = NA_integer_,
species = "group F" ,
fullname = "Streptococcus group F",
ref = NA_character_),
MOs %>%
filter(genus == "Streptococcus", species == "agalactiae") %>% .[1,] %>%
mutate(mo = gsub("AGA", "GRG", mo),
col_id = NA_integer_,
species = "group F" ,
fullname = "Streptococcus group G",
ref = NA_character_),
MOs %>%
filter(genus == "Streptococcus", species == "agalactiae") %>% .[1,] %>%
mutate(mo = gsub("AGA", "GRH", mo),
col_id = NA_integer_,
species = "group H" ,
fullname = "Streptococcus group H",
ref = NA_character_),
MOs %>%
filter(genus == "Streptococcus", species == "agalactiae") %>% .[1,] %>%
mutate(mo = gsub("AGA", "GRK", mo),
col_id = NA_integer_,
species = "group K" ,
fullname = "Streptococcus group K",
ref = NA_character_),
# Beta haemolytic Streptococci
MOs %>%
filter(genus == "Streptococcus", species == "agalactiae") %>% .[1,] %>%
mutate(mo = gsub("AGA", "HAE", mo),
col_id = NA_integer_,
species = "beta-haemolytic" ,
fullname = "Beta-haemolytic Streptococcus",
ref = NA_character_),
# unknowns
data.frame(mo = "B_GRAMN",
col_id = NA_integer_,
fullname = "(unknown Gram negatives)",
kingdom = "Bacteria",
phylum = NA_character_,
class = NA_character_,
order = NA_character_,
family = NA_character_,
genus = "(unknown Gram negatives)",
species = NA_character_,
subspecies = NA_character_,
rank = "species",
ref = NA_character_,
stringsAsFactors = FALSE),
data.frame(mo = "B_GRAMP",
col_id = NA_integer_,
fullname = "(unknown Gram positives)",
kingdom = "Bacteria",
phylum = NA_character_,
class = NA_character_,
order = NA_character_,
family = NA_character_,
genus = "(unknown Gram positives)",
species = NA_character_,
subspecies = NA_character_,
rank = "species",
ref = NA_character_,
stringsAsFactors = FALSE)
)
# save it
MOs <- as.data.frame(MOs %>% arrange(mo), stringsAsFactors = FALSE)
MOs.old <- as.data.frame(MOs.old, stringsAsFactors = FALSE)
class(MOs$mo) <- "mo"
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)

View File

@ -1,7 +1,7 @@
---
title: "Benchmarks"
author: "Matthijs S. Berends"
date: "14 February 2019"
date: '`r format(Sys.Date(), "%d %B %Y")`'
output:
rmarkdown::html_vignette:
toc: true
@ -17,17 +17,17 @@ editor_options:
```{r setup, include = FALSE, results = 'markup'}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#",
comment = "#>",
fig.width = 7.5,
fig.height = 4.5
)
```
One of the most important features of this package is the complete microbial taxonomic database, supplied by ITIS (https://www.itis.gov). We created a function `as.mo()` that transforms any user input value to a valid microbial ID by using AI (Artificial Intelligence) and based on the taxonomic tree of ITIS.
One of the most important features of this package is the complete microbial taxonomic database, supplied by the Catalogue of Life (http://catalogueoflife.org). We created a function `as.mo()` that transforms any user input value to a valid microbial ID by using AI (Artificial Intelligence) combined with the taxonomic tree of Catalogue of Life.
Using the `microbenchmark` package, we can review the calculation performance of this function. Its function `microbenchmark()` calculates different input expressions independently of each others and runs every expression 100 times.
Using the `microbenchmark` package, we can review the calculation performance of this function. Its function `microbenchmark()` runs different input expressions independently of each other and measures their time-to-result.
```{r, eval = FALSE}
```{r}
library(microbenchmark)
library(AMR)
```
@ -36,73 +36,57 @@ In the next test, we try to 'coerce' different input values for *Staphylococcus
But the calculation time differs a lot. Here, the AI effect can be reviewed best:
```{r, eval = FALSE}
benchmark <- microbenchmark(as.mo("sau"),
as.mo("stau"),
as.mo("staaur"),
as.mo("S. aureus"),
as.mo("S. aureus"),
as.mo("STAAUR"),
as.mo("Staphylococcus aureus"),
as.mo("B_STPHY_AUR"))
print(benchmark, unit = "ms")
# Unit: milliseconds
# expr min lq mean median uq max neval
# as.mo("sau") 18.983141 19.121148 19.9676944 19.1967505 19.2871260 38.635012 100
# as.mo("stau") 37.503863 37.692049 38.9856547 37.8244335 37.9851040 57.576107 100
# as.mo("staaur") 18.945427 19.122579 19.6392560 19.2241285 19.3536140 38.687672 100
# as.mo("S. aureus") 15.305229 15.471103 16.3477096 15.5545630 15.6689280 36.363005 100
# as.mo("S. aureus") 15.308232 15.469881 16.5269706 15.5506870 15.6277560 42.155292 100
# as.mo("STAAUR") 18.984049 19.117166 19.6104597 19.2219285 19.3161095 38.638783 100
# as.mo("Staphylococcus aureus") 8.103546 8.198285 8.6422018 8.2636915 8.3200535 27.002527 100
# as.mo("B_STPHY_AUR") 0.156236 0.196779 0.2017926 0.2035535 0.2115505 0.241861 100
```{r}
S.aureus <- microbenchmark(as.mo("sau"),
as.mo("stau"),
as.mo("staaur"),
as.mo("S. aureus"),
as.mo("S. aureus"),
as.mo("STAAUR"),
as.mo("Staphylococcus aureus"),
as.mo("B_STPHY_AUR"),
times = 10)
print(S.aureus, unit = "ms")
```
par(mar = c(5, 15, 4, 2)) # set more space for left margin text (15)
boxplot(benchmark, horizontal = TRUE, las = 1, unit = "ms", log = FALSE, xlab = "", ylim = c(0, 200),
In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 10 milliseconds means it can determine 100 input values per second. It case of 50 milliseconds, this is only 20 input values per second. The more an input value resembles a full name, the faster the result will be found. In case of `as.mo("B_STPHY_AUR")`, the input is already a valid MO code, so it only almost takes no time at all (`r as.integer(min(S.aureus$time, na.rm = TRUE) / 1000)` millionths of seconds).
To achieve this speed, the `as.mo` function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined far less faster. See this example for the ID of *Mycoplasma leonicaptivi* (`B_MYCPL_LEO`), a bug probably never found before in humans:
```{r}
M.leonicaptivi <- microbenchmark(as.mo("myle"),
as.mo("mycleo"),
as.mo("M. leonicaptivi"),
as.mo("M. leonicaptivi"),
as.mo("MYCLEO"),
as.mo("Mycoplasma leonicaptivi"),
as.mo("B_MYCPL_LEO"),
times = 10)
print(M.leonicaptivi, unit = "ms")
```
That takes `r round(mean(M.leonicaptivi$time, na.rm = TRUE) / mean(S.aureus$time, na.rm = TRUE), 1)` times as much time on average! A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance:
```{r}
par(mar = c(5, 16, 4, 2)) # set more space for left margin text (16)
# highest value on y axis
max_y_axis <- max(S.aureus$time, M.leonicaptivi$time, na.rm = TRUE) / 1e6
boxplot(S.aureus, horizontal = TRUE, las = 1, unit = "ms", log = FALSE, xlab = "", ylim = c(0, max_y_axis),
main = expression(paste("Benchmark of ", italic("Staphylococcus aureus"))))
boxplot(M.leonicaptivi, horizontal = TRUE, las = 1, unit = "ms", log = FALSE, xlab = "", ylim = c(0, max_y_axis),
main = expression(paste("Benchmark of ", italic("Mycoplasma leonicaptivi"))))
```
![](../reference/figures/benchmark_1.png)
In the table above, all measurements are shown in milliseconds (thousands of seconds), tested on a quite regular Linux server from 2007 (Core 2 Duo 2.7 GHz, 2 GB DDR2 RAM). A value of 8 milliseconds means it can determine 125 input values per second. It case of 40 milliseconds, this is only 25 input values per second. The more an input value resembles a full name, the faster the result will be found. In case of `as.mo("B_STPHY_AUR")`, the input is already a valid MO code, so it only almost takes no time at all (0.0002 seconds on our server).
To achieve this speed, the `as.mo` function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined far less faster. See this example for the ID of *Burkholderia nodosa* (`B_BRKHL_NOD`):
```{r, eval = FALSE}
benchmark <- microbenchmark(as.mo("buno"),
as.mo("burnod"),
as.mo("B. nodosa"),
as.mo("B. nodosa"),
as.mo("BURNOD"),
as.mo("Burkholderia nodosa"),
as.mo("B_BRKHL_NOD"))
print(benchmark, unit = "ms")
# Unit: milliseconds
# expr min lq mean median uq max neval
# as.mo("buno") 125.141333 125.8553210 129.5727691 126.3899910 127.0954925 194.51985 100
# as.mo("burnod") 142.300359 144.1611750 147.0642288 144.6074960 145.5243025 176.91649 100
# as.mo("B. nodosa") 81.530132 81.9360840 83.3915418 82.1852770 82.6848870 102.63184 100
# as.mo("B. nodosa") 81.109547 81.9836805 84.7595894 82.3437825 82.8282705 110.67036 100
# as.mo("BURNOD") 143.163527 143.9134485 148.7192688 144.5582580 145.7489115 314.92070 100
# as.mo("Burkholderia nodosa") 36.226325 36.5499000 37.1309929 36.6581540 36.7551985 56.25597 100
# as.mo("B_BRKHL_NOD") 0.172509 0.3038455 0.4806591 0.3078265 0.3121215 19.16173 100
boxplot(benchmark, horizontal = TRUE, las = 1, unit = "ms", log = FALSE, xlab = "", ylim = c(0, 200),
main = expression(paste("Benchmark of ", italic("Burkholderia nodosa"))))
```
![](../reference/figures/benchmark_2.png)
That takes up to 8 times as much time! A value of 145 milliseconds means it can only determine ~7 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance.
To relieve this pitfall and further improve performance, two important calculations take almost no time at all: **repetitive results** and **already precalculated results**.
### Repetitive results
Repetitive results mean that unique values are present more than once. Unique values will only be calculated once by `as.mo()`. We will use `mo_fullname()` for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) and uses `as.mo()` internally.
Repetitive results mean that unique values are present more than once. Unique values will only be calculated once by `as.mo()`. We will use `mo_fullname()` for this test - a helper function that returns the full microbial name (genus, species and possibly subspecies) which uses `as.mo()` internally.
```{r, eval = FALSE}
```{r}
library(dplyr)
# take 500,000 random MO codes from the septic_patients data set
x = septic_patients %>%
@ -111,53 +95,33 @@ x = septic_patients %>%
# got the right length?
length(x)
# [1] 500000
# and how many unique values do we have?
n_distinct(x)
# [1] 96
# only 96, but distributed in 500,000 results. now let's see:
microbenchmark(X = mo_fullname(x),
times = 10,
unit = "ms")
# Unit: milliseconds
# expr min lq mean median uq max neval
# X 114.9342 117.1076 129.6448 120.2047 131.5005 168.6371 10
# now let's see:
run_it <- microbenchmark(X = mo_fullname(x),
times = 10)
print(run_it, unit = "ms")
```
So transforming 500,000 values (!) of 96 unique values only takes 0.12 seconds (120 ms). You only lose time on your unique input values.
Results of a tenfold - 5,000,000 values:
```{r, eval = FALSE}
# Unit: milliseconds
# expr min lq mean median uq max neval
# X 882.9045 901.3011 1001.677 940.3421 1168.088 1226.846 10
```
Even determining the full names of 5 *Million* values is done within a second.
So transforming 500,000 values (!) of `r n_distinct(x)` unique values only takes `r round(median(run_it$time, na.rm = TRUE) / 1e9, 2)` seconds (`r as.integer(median(run_it$time, na.rm = TRUE) / 1e6)` ms). You only lose time on your unique input values.
### Precalculated results
What about precalculated results? If the input is an already precalculated result of a helper function like `mo_fullname()`, it almost doesn't take any time at all (see 'C' below):
```{r, eval = FALSE}
microbenchmark(A = mo_fullname("B_STPHY_AUR"),
B = mo_fullname("S. aureus"),
C = mo_fullname("Staphylococcus aureus"),
times = 10,
unit = "ms")
# Unit: milliseconds
# expr min lq mean median uq max neval
# A 11.364086 11.460537 11.5104799 11.4795330 11.524860 11.818263 10
# B 11.976454 12.012352 12.1704592 12.0853020 12.210004 12.881737 10
# C 0.095823 0.102528 0.1167754 0.1153785 0.132629 0.140661 10
```{r}
run_it <- microbenchmark(A = mo_fullname("B_STPHY_AUR"),
B = mo_fullname("S. aureus"),
C = mo_fullname("Staphylococcus aureus"),
times = 10)
print(run_it, unit = "ms")
```
So going from `mo_fullname("Staphylococcus aureus")` to `"Staphylococcus aureus"` takes 0.0001 seconds - it doesn't even start calculating *if the result would be the same as the expected resulting value*. That goes for all helper functions:
So going from `mo_fullname("Staphylococcus aureus")` to `"Staphylococcus aureus"` takes `r format(round(run_it %>% filter(expr == "C") %>% pull(time) %>% median() / 1e9, 4), scientific = FALSE)` seconds - it doesn't even start calculating *if the result would be the same as the expected resulting value*. That goes for all helper functions:
```{r, eval = FALSE}
```{r}
microbenchmark(A = mo_species("aureus"),
B = mo_genus("Staphylococcus"),
C = mo_fullname("Staphylococcus aureus"),
@ -165,35 +129,21 @@ microbenchmark(A = mo_species("aureus"),
E = mo_order("Bacillales"),
F = mo_class("Bacilli"),
G = mo_phylum("Firmicutes"),
H = mo_subkingdom("Posibacteria"),
I = mo_kingdom("Bacteria"),
H = mo_kingdom("Bacteria"),
times = 10,
unit = "ms")
# Unit: milliseconds
# expr min lq mean median uq max neval
# A 0.105181 0.121314 0.1478538 0.1465265 0.166711 0.211409 10
# B 0.132558 0.146388 0.1584278 0.1499835 0.164895 0.208477 10
# C 0.135492 0.160355 0.2341847 0.1884665 0.348857 0.395931 10
# D 0.109650 0.115727 0.1270481 0.1264130 0.128648 0.168317 10
# E 0.081574 0.096940 0.0992582 0.0980915 0.101479 0.120477 10
# F 0.081575 0.088489 0.0988463 0.0989650 0.103365 0.126482 10
# G 0.091981 0.095333 0.1043568 0.1001530 0.111327 0.129625 10
# H 0.092610 0.093169 0.1009135 0.0985455 0.101828 0.120406 10
# I 0.087371 0.091213 0.1069758 0.0941815 0.109302 0.192831 10
```
Of course, when running `mo_phylum("Firmicutes")` the function has zero knowledge about the actual microorganism, namely *S. aureus*. But since the result would be `"Firmicutes"` too, there is no point in calculating the result. And because this package 'knows' all phyla of all known microorganisms (according to ITIS), it can just return the initial value immediately.
Of course, when running `mo_phylum("Firmicutes")` the function has zero knowledge about the actual microorganism, namely *S. aureus*. But since the result would be `"Firmicutes"` too, there is no point in calculating the result. And because this package 'knows' all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.
### Results in other languages
When the system language is non-English and supported by this `AMR` package, some functions take a little while longer:
```{r, eval = FALSE}
```{r}
mo_fullname("CoNS", language = "en") # or just mo_fullname("CoNS") on an English system
# "Coagulase Negative Staphylococcus (CoNS)"
mo_fullname("CoNS", language = "fr") # or just mo_fullname("CoNS") on a French system
# "Staphylococcus à coagulase négative (CoNS)"
microbenchmark(en = mo_fullname("CoNS", language = "en"),
de = mo_fullname("CoNS", language = "de"),
@ -204,15 +154,6 @@ microbenchmark(en = mo_fullname("CoNS", language = "en"),
pt = mo_fullname("CoNS", language = "pt"),
times = 10,
unit = "ms")
# Unit: milliseconds
# expr min lq mean median uq max neval
# en 6.093583 6.51724 6.555105 6.562986 6.630663 6.99698 100
# de 13.934874 14.35137 16.891587 14.462210 14.764658 43.63956 100
# nl 13.900092 14.34729 15.943268 14.424565 14.581535 43.76283 100
# es 13.833813 14.34596 14.574783 14.439757 14.653994 17.49168 100
# it 13.811883 14.36621 15.179060 14.453515 14.812359 43.64284 100
# fr 13.798683 14.37019 16.344731 14.468775 14.697610 48.62923 100
# pt 13.789674 14.36244 15.706321 14.443772 14.679905 44.76701 100
```
Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.