rlang dependency, new fungi

This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-02-28 13:56:28 +01:00
parent cf3bdb54c7
commit 2565b60024
86 changed files with 762 additions and 705 deletions

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 0.5.0.9019
Date: 2019-02-27
Version: 0.5.0.9020
Date: 2019-02-28
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(
@ -52,7 +52,7 @@ Imports:
hms,
knitr (>= 1.0.0),
microbenchmark,
rlang (>= 0.2.0),
rlang (>= 0.3.1),
tidyr (>= 0.7.0)
Suggests:
covr (>= 3.0.1),

View File

@ -26,6 +26,8 @@ S3method(print,atc)
S3method(print,frequency_tbl)
S3method(print,mic)
S3method(print,mo)
S3method(print,mo_renamed)
S3method(print,mo_uncertainties)
S3method(print,rsi)
S3method(pull,atc)
S3method(pull,mo)
@ -179,6 +181,8 @@ exportMethods(print.atc)
exportMethods(print.frequency_tbl)
exportMethods(print.mic)
exportMethods(print.mo)
exportMethods(print.mo_renamed)
exportMethods(print.mo_uncertainties)
exportMethods(print.rsi)
exportMethods(pull.atc)
exportMethods(pull.mo)
@ -203,6 +207,7 @@ importFrom(crayon,magenta)
importFrom(crayon,red)
importFrom(crayon,silver)
importFrom(crayon,strip_style)
importFrom(crayon,yellow)
importFrom(data.table,as.data.table)
importFrom(data.table,data.table)
importFrom(data.table,setkey)

View File

@ -13,6 +13,7 @@ We've got a new website: [https://msberends.gitlab.io/AMR](https://msberends.git
* 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 (sub)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 (covering at least like all species of *Aspergillus*, *Candida*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*)
* All ~2,000 (sub)species from ~100 other relevant genera, from the kingdoms of Animalia and Plantae (like *Strongyloides* and *Taenia*)
* All ~15,000 previously accepted names of included (sub)species that have been taxonomically renamed
* The responsible author(s) and year of scientific publication

View File

@ -23,13 +23,16 @@
#'
#' 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}()}.
#' \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
#' This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.
#'
#' \link[=catalogue_of_life]{Click here} for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with \code{\link{catalogue_of_life_version}()}.
#' @section Included taxa:
#' Included are:
#' \itemize{
#' \item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
#' \item{All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
#' \item{All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, like mushrooms). Because of this, not all fungi fit the scope of this package and including everything would tremendously slow down our algorithms too. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
#' \item{All ~2,000 (sub)species from ~100 other relevant genera, from the kingdoms of Animalia and Plantae (like \emph{Strongyloides} and \emph{Taenia})}
#' \item{All ~15,000 previously accepted names of included (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}

121
R/mo.R
View File

@ -47,12 +47,13 @@
#' | | | ----> subspecies, a 3-4 letter acronym
#' | | ----> species, a 3-4 letter acronym
#' | ----> genus, a 5-7 letter acronym, mostly without vowels
#' ----> taxonomic kingdom: A (Archaea), B (Bacteria), C (Chromista),
#' F (Fungi), P (Protozoa) or V (Viruses)
#' ----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria), C (Chromista),
#' F (Fungi), P (Protozoa), PL (Plantae) or V (Viruses)
#' }
#'
#' Use the \code{\link{mo_property}} functions to get properties based on the returned code, see Examples.
#'
#' \strong{Artificial Intelligence} \cr
#' This function uses Artificial Intelligence (AI) to help getting fast and logical results. It tries to find matches in this order:
#' \itemize{
#' \item{Taxonomic kingdom: it first searches in Bacteria, then Fungi, then Protozoa}
@ -67,9 +68,9 @@
#' \item{\code{"H. influenzae"} will return the ID of \emph{Haemophilus influenzae} and not \emph{Haematobacter influenzae} for the same reason}
#' \item{Something like \code{"stau"} or \code{"S aur"} will return the ID of \emph{Staphylococcus aureus} and not \emph{Staphylococcus auricularis}}
#' }
#' This means that looking up human pathogenic microorganisms takes less time than looking up human \strong{non}-pathogenic microorganisms.
#' This means that looking up human pathogenic microorganisms takes less time than looking up human non-pathogenic microorganisms.
#'
#' \strong{UNCERTAIN RESULTS} \cr
#' \strong{Uncertain results} \cr
#' When using \code{allow_uncertain = TRUE} (which is the default setting), it will use additional rules if all previous AI rules failed to get valid results. These are:
#' \itemize{
#' \item{It tries to look for previously accepted (but now invalid) taxonomic names}
@ -88,11 +89,11 @@
#'
#' Use \code{mo_failures()} to get a vector with all values that could not be coerced to a valid value.
#'
#' Use \code{mo_uncertainties()} to get info about all values that were coerced to a valid value, but with uncertainty.
#' Use \code{mo_uncertainties()} to get a data.frame with all values that were coerced to a valid value, but with uncertainty.
#'
#' Use \code{mo_renamed()} to get a vector with all values that could be coerced based on an old, previously accepted taxonomic name.
#'
#' @section Microbial prevalence of pathogens in humans:
#' \strong{Microbial prevalence of pathogens in humans} \cr
#' The artificial intelligence takes into account microbial prevalence of pathogens in humans. It uses three groups and every (sub)species is in the group it matches first. These groups are:
#' \itemize{
#' \item{1 (most prevalent): class is Gammaproteobacteria \strong{or} genus is one of: \emph{Enterococcus}, \emph{Staphylococcus}, \emph{Streptococcus}.}
@ -102,7 +103,7 @@
#'
#' Group 1 contains all common Gram negatives, like all Enterobacteriaceae and e.g. \emph{Pseudomonas} and \emph{Legionella}.
#'
#' Group 2 probably contains all microbial pathogens ever found in humans.
#' Group 2 probably contains all other microbial pathogens ever found in humans.
#' @inheritSection catalogue_of_life Catalogue of Life
# (source as a section, so it can be inherited by other man pages)
#' @section Source:
@ -618,10 +619,6 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
if (length(found) > 0) {
return(found[1L])
}
found <- data_to_check[fullname %like% f.x_withspaces_end_only, ..property][[1]]
if (length(found) > 0 & nchar(b.x_trimmed) >= 6) {
return(found[1L])
}
# try splitting of characters in the middle and then find ID ----
# only when text length is 6 or lower
@ -709,7 +706,7 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
# check for uncertain results ----
if (allow_uncertain == TRUE) {
uncertain_fn <- function(a.x_backup, b.x_trimmed, c.x_withspaces_start_end, d.x_withspaces_start_only) {
uncertain_fn <- function(a.x_backup, b.x_trimmed, c.x_withspaces_start_end, d.x_withspaces_start_only, f.x_withspaces_end_only) {
# (1) look for genus only, part of name ----
if (nchar(b.x_trimmed) > 4 & !b.x_trimmed %like% " ") {
@ -719,7 +716,8 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
if (length(found) > 0) {
x[i] <- found[1L]
uncertainties <<- rbind(uncertainties,
data.frame(input = a.x_backup,
data.frame(uncertainty = 2,
input = a.x_backup,
fullname = microorganismsDT[mo == found[1L], fullname][[1]],
mo = found[1L]))
return(x)
@ -745,27 +743,42 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
ref_new = microorganismsDT[col_id == found[1, col_id_new], ref],
mo = microorganismsDT[col_id == found[1, col_id_new], mo])
uncertainties <<- rbind(uncertainties,
data.frame(input = a.x_backup,
data.frame(uncertainty = 1,
input = a.x_backup,
fullname = found[1, fullname],
mo = paste("CoL", found[1, col_id])))
return(x)
}
# (3) strip values between brackets ----
a.x_backup_stripped <- gsub("( [(].*[)])", "", a.x_backup)
a.x_backup_stripped <- trimws(gsub(" ", " ", a.x_backup_stripped, fixed = TRUE))
found <- suppressMessages(suppressWarnings(exec_as.mo(a.x_backup_stripped, clear_options = FALSE, allow_uncertain = FALSE)))
if (!is.na(found) & nchar(b.x_trimmed) >= 6) {
# (3) not yet implemented taxonomic changes in Catalogue of Life ----
found <- suppressMessages(suppressWarnings(exec_as.mo(TEMPORARY_TAXONOMY(b.x_trimmed), clear_options = FALSE, allow_uncertain = FALSE)))
if (!is.na(found)) {
found_result <- found
found <- microorganismsDT[mo == found, ..property][[1]]
uncertainties <<- rbind(uncertainties,
data.frame(input = a.x_backup,
data.frame(uncertainty = 1,
input = a.x_backup,
fullname = microorganismsDT[mo == found_result[1L], fullname][[1]],
mo = found_result[1L]))
return(found[1L])
}
# (4) try to strip off one element from end and check the remains ----
# (4) strip values between brackets ----
a.x_backup_stripped <- gsub("( *[(].*[)] *)", " ", a.x_backup)
a.x_backup_stripped <- trimws(gsub(" +", " ", a.x_backup_stripped))
found <- suppressMessages(suppressWarnings(exec_as.mo(a.x_backup_stripped, clear_options = FALSE, allow_uncertain = FALSE)))
if (!is.na(found) & nchar(b.x_trimmed) >= 6) {
found_result <- found
found <- microorganismsDT[mo == found, ..property][[1]]
uncertainties <<- rbind(uncertainties,
data.frame(uncertainty = 2,
input = a.x_backup,
fullname = microorganismsDT[mo == found_result[1L], fullname][[1]],
mo = found_result[1L]))
return(found[1L])
}
# (5) try to strip off one element from end and check the remains ----
x_strip <- a.x_backup %>% strsplit(" ") %>% unlist()
if (length(x_strip) > 1 & nchar(b.x_trimmed) >= 6) {
for (i in 1:(length(x_strip) - 1)) {
@ -775,7 +788,8 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
found_result <- found
found <- microorganismsDT[mo == found, ..property][[1]]
uncertainties <<- rbind(uncertainties,
data.frame(input = a.x_backup,
data.frame(uncertainty = 2,
input = a.x_backup,
fullname = microorganismsDT[mo == found_result[1L], fullname][[1]],
mo = found_result[1L]))
return(found[1L])
@ -783,7 +797,7 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
}
}
# (5) try to strip off one element from start and check the remains ----
# (6) try to strip off one element from start and check the remains ----
x_strip <- a.x_backup %>% strsplit(" ") %>% unlist()
if (length(x_strip) > 1 & nchar(b.x_trimmed) >= 6) {
for (i in 2:(length(x_strip))) {
@ -793,7 +807,8 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
found_result <- found
found <- microorganismsDT[mo == found, ..property][[1]]
uncertainties <<- rbind(uncertainties,
data.frame(input = a.x_backup,
data.frame(uncertainty = 3,
input = a.x_backup,
fullname = microorganismsDT[mo == found_result[1L], fullname][[1]],
mo = found_result[1L]))
return(found[1L])
@ -801,13 +816,14 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
}
}
# (6) not yet implemented taxonomic changes in Catalogue of Life ----
found <- suppressMessages(suppressWarnings(exec_as.mo(TEMPORARY_TAXONOMY(b.x_trimmed), clear_options = FALSE, allow_uncertain = FALSE)))
if (!is.na(found)) {
found_result <- found
found <- microorganismsDT[mo == found, ..property][[1]]
# (7) part of a name (very unlikely match) ----
found <- microorganismsDT[fullname %like% f.x_withspaces_end_only]
if (nrow(found) > 0) {
found_result <- found[["mo"]]
found <- microorganismsDT[mo == found_result[1L], ..property][[1]]
uncertainties <<- rbind(uncertainties,
data.frame(input = a.x_backup,
data.frame(uncertainty = 3,
input = a.x_backup,
fullname = microorganismsDT[mo == found_result[1L], fullname][[1]],
mo = found_result[1L]))
return(found[1L])
@ -817,7 +833,7 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
return(NA_character_)
}
x[i] <- uncertain_fn(x_backup[i], x_trimmed[i], x_withspaces_start_end[i], x_withspaces_start_only[i])
x[i] <- uncertain_fn(x_backup[i], x_trimmed[i], x_withspaces_start_end[i], x_withspaces_start_only[i], x_withspaces_end_only[i])
if (!is.na(x[i])) {
next
}
@ -1041,20 +1057,53 @@ mo_failures <- function() {
#' @importFrom crayon italic
#' @export
mo_uncertainties <- function() {
df <- as.data.frame(getOption("mo_uncertainties"))
structure(.Data = as.data.frame(getOption("mo_uncertainties"), stringsAsFactors = FALSE),
class = c("mo_uncertainties", "data.frame"))
}
#' @exportMethod print.mo_uncertainties
#' @importFrom crayon green yellow red bgGreen bgYellow bgRed
#' @export
#' @noRd
print.mo_uncertainties <- function(x, ...) {
cat(paste0(bold(nrow(x), "unique result(s) guessed with uncertainty:"),
"\n(1 = ", green("renamed"),
", 2 = ", yellow("uncertain"),
", 3 = ", red("very uncertain"), ")\n"))
msg <- ""
for (i in 1:nrow(df)) {
for (i in 1:nrow(x)) {
if (x[i, "uncertainty"] == 1) {
colour1 <- green
colour2 <- bgGreen
} else if (x[i, "uncertainty"] == 2) {
colour1 <- yellow
colour2 <- bgYellow
} else {
colour1 <- red
colour2 <- bgRed
}
msg <- paste(msg,
paste0('"', df[i, "input"], '" -> ', italic(df[i, "fullname"]), " (", df[i, "mo"], ")"),
paste0("[", colour2(paste0(" ", x[i, "uncertainty"], " ")), '] - "', x[i, "input"], '" -> ',
colour1(paste0(italic(x[i, "fullname"]), " (", x[i, "mo"], ")"))),
sep = "\n")
}
cat(paste0(bold("Results guessed with uncertainty:"), msg))
cat(msg)
}
#' @rdname as.mo
#' @export
mo_renamed <- function() {
strip_style(gsub("was renamed", "->", getOption("mo_renamed"), fixed = TRUE))
structure(.Data = strip_style(gsub("was renamed", "->", getOption("mo_renamed"), fixed = TRUE)),
class = c("mo_renamed", "character"))
}
#' @exportMethod print.mo_renamed
#' @importFrom crayon blue
#' @export
#' @noRd
print.mo_renamed <- function(x, ...) {
cat(blue(paste(getOption("mo_renamed"), collapse = "\n")))
}
nr2char <- function(x) {

View File

@ -260,13 +260,17 @@ mo_type <- function(x, language = get_locale(), ...) {
#' @export
mo_gramstain <- function(x, language = get_locale(), ...) {
x.bak <- x
x <- mo_phylum(x, ...)
x[x %in% c("Actinobacteria",
"Chloroflexi",
"Firmicutes",
"Tenericutes")] <- "Gram positive"
x.mo <- as.mo(x, ...)
x.phylum <- mo_phylum(x.mo)
x[x.phylum %in% c("Actinobacteria",
"Chloroflexi",
"Firmicutes",
"Tenericutes")] <- "Gram positive"
x[x != "Gram positive"] <- "Gram negative"
x[mo_kingdom(x.bak) != "Bacteria"] <- NA_character_
x[mo_kingdom(x.mo) != "Bacteria"] <- NA_character_
x[x.mo == "B_GRAMP"] <- "Gram positive"
x[x.mo == "B_GRAMN"] <- "Gram negative"
mo_translate(x, language = language)
}

View File

@ -21,7 +21,9 @@
#' Use predefined reference data set
#'
#' These functions can be used to predefine your own reference to be used in \code{\link{as.mo}} and consequently all \code{mo_*} functions like \code{\link{mo_genus}} and \code{\link{mo_gramstain}}.
#' @description These functions can be used to predefine your own reference to be used in \code{\link{as.mo}} and consequently all \code{mo_*} functions like \code{\link{mo_genus}} and \code{\link{mo_gramstain}}.
#'
#' This is \strong{the fastest way} to have your organisation (or analysis) specific codes picked up and translated by this package.
#' @param path location of your reference file, see Details
#' @rdname mo_source
#' @name mo_source
@ -33,45 +35,71 @@
#' \code{get_mo_source} will return the data set by reading \code{"~/.mo_source.rds"} with \code{\link{readRDS}}. If the original file has changed (the file defined with \code{path}), it will call \code{set_mo_source} to update the data file automatically.
#'
#' Reading an Excel file (\code{.xlsx}) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read by \code{get_mo_source} in only a couple of microseconds (a millionth of a second).
#' @section How it works:
#' Imagine this data on a sheet of an Excel file (mo codes were looked up in the `microorganisms` data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:
#' \preformatted{
#' | A | B |
#' --|--------------------|-------------|
#' 1 | Organisation XYZ | mo |
#' 2 | lab_mo_ecoli | B_ESCHR_COL |
#' 3 | lab_mo_kpneumoniae | B_KLBSL_PNE |
#' 4 | | |
#' }
#'
#' We save it as \code{'home/me/ourcodes.xlsx'}. Now we have to set it as a source:
#' \preformatted{
#' set_mo_source("home/me/ourcodes.xlsx")
#' # Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
#' }
#'
#' It has now created a file "~/.mo_source.rds" with the contents of our Excel file. It it an R specific format with great compression.
#'
#' And now we can use it in our functions:
#' \preformatted{
#' as.mo("lab_mo_ecoli")
#' # B_ESCHR_COL
#'
#' mo_genus("lab_mo_kpneumoniae")
#' # "Klebsiella"
#' }
#'
#' If we edit the Excel file to, let's say, this:
#' \preformatted{
#' | A | B |
#' --|--------------------|-------------|
#' 1 | Organisation XYZ | mo |
#' 2 | lab_mo_ecoli | B_ESCHR_COL |
#' 3 | lab_mo_kpneumoniae | B_KLBSL_PNE |
#' 4 | lab_Staph_aureus | B_STPHY_AUR |
#' 5 | | |
#' }
#'
#' ...any new usage of an MO function in this package will update your data:
#' \preformatted{
#' as.mo("lab_mo_ecoli")
#' # Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
#' # B_ESCHR_COL
#'
#' mo_genus("lab_Staph_aureus")
#' # "Staphylococcus"
#' }
#'
#' To remove the reference completely, just use any of these:
#' \preformatted{
#' set_mo_source("")
#' set_mo_source(NULL)
#' # Removed mo_source file '~/.mo_source.rds'.
#' }
#' @importFrom dplyr select everything
#' @export
#' @inheritSection AMR Read more on our website!
#' @examples
#' \dontrun{
#'
#' # imagine this Excel file (mo codes looked up in `microorganisms` data set):
#' # A B
#' # 1 our code mo
#' # 2 lab_mo_ecoli B_ESCHR_COL
#' # 3 lab_mo_kpneumoniae B_KLBSL_PNE
#'
#' # 1. We save it as 'home/me/ourcodes.xlsx'
#'
#' # 2. We use it for input:
#' set_mo_source("home/me/ourcodes.xlsx")
#' #> Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
#'
#' # 3. And use it in our functions:
#' as.mo("lab_mo_ecoli")
#' #> B_ESCHR_COL
#'
#' mo_genus("lab_mo_kpneumoniae")
#' #> "Klebsiella"
#'
#' # 4. It will look for changes itself:
#' # (add new row to the Excel file and save it)
#'
#' mo_genus("lab_mo_kpneumoniae")
#' #> Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
#' #> "Klebsiella"
#' }
set_mo_source <- function(path) {
if (!is.character(path) | length(path) > 1) {
stop("`path` must be a character of length 1.")
}
if (path == "") {
if (path %in% c(NULL, "")) {
options(mo_source = NULL)
options(mo_source_timestamp = NULL)
if (file.exists("~/.mo_source.rds")) {

Binary file not shown.

Binary file not shown.

View File

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

View File

@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -192,7 +192,7 @@
<h1>How to conduct AMR analysis</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">27 February 2019</h4>
<h4 class="date">28 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 27 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 28 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-27</td>
<td align="center">2019-02-28</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-27</td>
<td align="center">2019-02-28</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-27</td>
<td align="center">2019-02-28</td>
<td align="center">efgh</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
@ -327,70 +327,70 @@
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">2012-02-27</td>
<td align="center">B4</td>
<td align="center">Hospital C</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">S</td>
<td align="center">2015-09-11</td>
<td align="center">C6</td>
<td align="center">Hospital D</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">M</td>
</tr>
<tr class="even">
<td align="center">2014-02-11</td>
<td align="center">T4</td>
<td align="center">Hospital B</td>
<td align="center">Escherichia coli</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">F</td>
</tr>
<tr class="odd">
<td align="center">2015-04-14</td>
<td align="center">N3</td>
<td align="center">Hospital B</td>
<td align="center">Klebsiella pneumoniae</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">M</td>
</tr>
<tr class="even">
<td align="center">2017-03-09</td>
<td align="center">D1</td>
<td align="center">2015-05-10</td>
<td align="center">N2</td>
<td align="center">Hospital A</td>
<td align="center">Escherichia coli</td>
<td align="center">I</td>
<td align="center">I</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="odd">
<td align="center">2013-10-22</td>
<td align="center">W9</td>
<td align="center">Hospital B</td>
<td align="center">Klebsiella pneumoniae</td>
<td align="center">2012-03-06</td>
<td align="center">C2</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="even">
<td align="center">2011-11-09</td>
<td align="center">X3</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">F</td>
</tr>
<tr class="odd">
<td align="center">2017-02-01</td>
<td align="center">O6</td>
<td align="center">Hospital A</td>
<td align="center">Staphylococcus aureus</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">F</td>
</tr>
<tr class="even">
<td align="center">2012-08-12</td>
<td align="center">C10</td>
<td align="center">Hospital B</td>
<td align="center">Streptococcus pneumoniae</td>
<td align="center">2017-02-26</td>
<td align="center">X1</td>
<td align="center">Hospital D</td>
<td align="center">Klebsiella pneumoniae</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>
</tbody>
</table>
@ -411,8 +411,8 @@
#&gt;
#&gt; Item Count Percent Cum. Count Cum. Percent
#&gt; --- ----- ------- -------- ----------- -------------
#&gt; 1 M 10,333 51.7% 10,333 51.7%
#&gt; 2 F 9,667 48.3% 20,000 100.0%</code></pre>
#&gt; 1 M 10,244 51.2% 10,244 51.2%
#&gt; 2 F 9,756 48.8% 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 (1264 changes)</span></a>
<a class="sourceLine" id="cb14-22" title="22"><span class="co">#&gt; Table 1: Intrinsic resistance in Enterobacteriaceae (1275 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 (2835 changes)</span></a>
<a class="sourceLine" id="cb14-25" title="25"><span class="co">#&gt; Table 4: Intrinsic resistance in Gram-positive bacteria (2727 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,417 out of 20,000 rows</span></a>
<a class="sourceLine" id="cb14-41" title="41"><span class="co">#&gt; =&gt; EUCAST rules affected 7,427 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,099 test results (0 to S; 0 to I; 4,099 to R)</span></a></code></pre></div>
<a class="sourceLine" id="cb14-43" title="43"><span class="co">#&gt; -&gt; changed 4,002 test results (0 to S; 0 to I; 4,002 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,647 first isolates (28.2% of total)</span></a></code></pre></div>
<p>So only 28.2% 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,650 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>
<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,43 +516,43 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-01-07</td>
<td align="center">E5</td>
<td align="center">2010-04-26</td>
<td align="center">H9</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-01-14</td>
<td align="center">E5</td>
<td align="center">2010-05-27</td>
<td align="center">H9</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">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-02-07</td>
<td align="center">E5</td>
<td align="center">2010-07-20</td>
<td align="center">H9</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">I</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-03-28</td>
<td align="center">E5</td>
<td align="center">2010-11-25</td>
<td align="center">H9</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>
@ -560,54 +560,54 @@
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-05-25</td>
<td align="center">E5</td>
<td align="center">2011-01-19</td>
<td align="center">H9</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">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
<tr class="even">
<td align="center">6</td>
<td align="center">2010-07-23</td>
<td align="center">E5</td>
<td align="center">2011-01-24</td>
<td align="center">H9</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</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">7</td>
<td align="center">2010-08-18</td>
<td align="center">E5</td>
<td align="center">2011-03-09</td>
<td align="center">H9</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</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">2010-11-19</td>
<td align="center">E5</td>
<td align="center">2011-06-07</td>
<td align="center">H9</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">FALSE</td>
<td align="center">S</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2010-12-05</td>
<td align="center">E5</td>
<td align="center">2011-07-30</td>
<td align="center">H9</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>
@ -615,14 +615,14 @@
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-02-04</td>
<td align="center">E5</td>
<td align="center">2011-08-01</td>
<td align="center">H9</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">S</td>
<td align="center">TRUE</td>
<td align="center">S</td>
<td align="center">FALSE</td>
</tr>
</tbody>
</table>
@ -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,867 first weighted isolates (79.3% of total)</span></a></code></pre></div>
<a class="sourceLine" id="cb19-10" title="10"><span class="co">#&gt; =&gt; Found 15,814 first weighted isolates (79.1% of total)</span></a></code></pre></div>
<table class="table">
<thead><tr class="header">
<th align="center">isolate</th>
@ -654,11 +654,11 @@
<tbody>
<tr class="odd">
<td align="center">1</td>
<td align="center">2010-01-07</td>
<td align="center">E5</td>
<td align="center">2010-04-26</td>
<td align="center">H9</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">TRUE</td>
@ -666,23 +666,23 @@
</tr>
<tr class="even">
<td align="center">2</td>
<td align="center">2010-01-14</td>
<td align="center">E5</td>
<td align="center">2010-05-27</td>
<td align="center">H9</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">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">3</td>
<td align="center">2010-02-07</td>
<td align="center">E5</td>
<td align="center">2010-07-20</td>
<td align="center">H9</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">I</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">FALSE</td>
@ -690,70 +690,70 @@
</tr>
<tr class="even">
<td align="center">4</td>
<td align="center">2010-03-28</td>
<td align="center">E5</td>
<td align="center">2010-11-25</td>
<td align="center">H9</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>
</tr>
<tr class="odd">
<td align="center">5</td>
<td align="center">2010-05-25</td>
<td align="center">E5</td>
<td align="center">2011-01-19</td>
<td align="center">H9</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">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">6</td>
<td align="center">2010-07-23</td>
<td align="center">E5</td>
<td align="center">2011-01-24</td>
<td align="center">H9</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</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">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">7</td>
<td align="center">2010-08-18</td>
<td align="center">E5</td>
<td align="center">2011-03-09</td>
<td align="center">H9</td>
<td align="center">B_ESCHR_COL</td>
<td align="center">I</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">R</td>
<td align="center">FALSE</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td align="center">8</td>
<td align="center">2010-11-19</td>
<td align="center">E5</td>
<td align="center">2011-06-07</td>
<td align="center">H9</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">FALSE</td>
<td align="center">S</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td align="center">9</td>
<td align="center">2010-12-05</td>
<td align="center">E5</td>
<td align="center">2011-07-30</td>
<td align="center">H9</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>
@ -762,23 +762,23 @@
</tr>
<tr class="even">
<td align="center">10</td>
<td align="center">2011-02-04</td>
<td align="center">E5</td>
<td align="center">2011-08-01</td>
<td align="center">H9</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">S</td>
<td align="center">TRUE</td>
<td align="center">TRUE</td>
<td align="center">S</td>
<td align="center">FALSE</td>
<td align="center">FALSE</td>
</tr>
</tbody>
</table>
<p>Instead of 2, now 7 isolates are flagged. In total, 79.3% of all isolates are marked first weighted - 51.1% 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.1% 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>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,867 isolates for analysis.</p>
<p>So we end up with 15,814 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,63 +803,63 @@
</tr></thead>
<tbody>
<tr class="odd">
<td>2</td>
<td align="center">2014-02-11</td>
<td align="center">T4</td>
<td align="center">Hospital B</td>
<td align="center">B_ESCHR_COL</td>
<td>1</td>
<td align="center">2015-09-11</td>
<td align="center">C6</td>
<td align="center">Hospital D</td>
<td align="center">B_STPHY_AUR</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</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">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>3</td>
<td align="center">2015-04-14</td>
<td align="center">N3</td>
<td align="center">Hospital B</td>
<td align="center">B_KLBSL_PNE</td>
<td align="center">R</td>
<td align="center">R</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">Klebsiella</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>4</td>
<td align="center">2017-03-09</td>
<td align="center">D1</td>
<td align="center">Hospital A</td>
<td align="center">2012-03-06</td>
<td align="center">C2</td>
<td align="center">Hospital C</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">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>5</td>
<td align="center">2013-10-22</td>
<td align="center">W9</td>
<tr class="odd">
<td>4</td>
<td align="center">2011-11-09</td>
<td align="center">X3</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">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>6</td>
<td align="center">2017-02-26</td>
<td align="center">X1</td>
<td align="center">Hospital D</td>
<td align="center">B_KLBSL_PNE</td>
<td align="center">R</td>
<td align="center">I</td>
<td align="center">S</td>
<td align="center">R</td>
<td align="center">S</td>
<td align="center">S</td>
<td align="center">F</td>
<td align="center">Gram negative</td>
<td align="center">Klebsiella</td>
@ -867,10 +867,26 @@
<td align="center">TRUE</td>
</tr>
<tr class="odd">
<td>6</td>
<td align="center">2012-08-12</td>
<td align="center">C10</td>
<td align="center">Hospital B</td>
<td>7</td>
<td align="center">2010-02-15</td>
<td align="center">P3</td>
<td align="center">Hospital C</td>
<td align="center">B_STRPT_PNE</td>
<td align="center">S</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 positive</td>
<td align="center">Streptococcus</td>
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>8</td>
<td align="center">2012-10-20</td>
<td align="center">H4</td>
<td align="center">Hospital D</td>
<td align="center">B_STRPT_PNE</td>
<td align="center">S</td>
<td align="center">S</td>
@ -882,22 +898,6 @@
<td align="center">pneumoniae</td>
<td align="center">TRUE</td>
</tr>
<tr class="even">
<td>7</td>
<td align="center">2012-05-06</td>
<td align="center">V7</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">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>
</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,867 x 13)</strong></p>
<p><strong>Frequency table of <code>genus</code> and <code>species</code> from a <code>data.frame</code> (15,814 x 13)</strong></p>
<p>Columns: 2<br>
Length: 15,867 (of which NA: 0 = 0.00%)<br>
Length: 15,814 (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,816</td>
<td align="right">49.3%</td>
<td align="right">7,816</td>
<td align="right">49.3%</td>
<td align="right">7,918</td>
<td align="right">50.1%</td>
<td align="right">7,918</td>
<td align="right">50.1%</td>
</tr>
<tr class="even">
<td align="left">2</td>
<td align="left">Staphylococcus aureus</td>
<td align="right">4,004</td>
<td align="right">25.2%</td>
<td align="right">11,820</td>
<td align="right">3,865</td>
<td align="right">24.4%</td>
<td align="right">11,783</td>
<td align="right">74.5%</td>
</tr>
<tr class="odd">
<td align="left">3</td>
<td align="left">Streptococcus pneumoniae</td>
<td align="right">2,496</td>
<td align="right">15.7%</td>
<td align="right">14,316</td>
<td align="right">90.2%</td>
<td align="right">2,458</td>
<td align="right">15.5%</td>
<td align="right">14,241</td>
<td align="right">90.1%</td>
</tr>
<tr class="even">
<td align="left">4</td>
<td align="left">Klebsiella pneumoniae</td>
<td align="right">1,551</td>
<td align="right">9.8%</td>
<td align="right">15,867</td>
<td align="right">1,573</td>
<td align="right">9.9%</td>
<td align="right">15,814</td>
<td align="right">100.0%</td>
</tr>
</tbody>
@ -969,9 +969,9 @@ Longest: 24</p>
<div id="resistance-percentages" class="section level2">
<h2 class="hasAnchor">
<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>
<p>The functions <code><a href="../reference/portion.html">portion_R()</a></code>, <code>portion_RI()</code>, <code><a href="../reference/portion.html">portion_I()</a></code>, <code>portion_IS()</code> and <code><a href="../reference/portion.html">portion_S()</a></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.4757673</span></a></code></pre></div>
<a class="sourceLine" id="cb25-2" title="2"><span class="co">#&gt; [1] 0.4762868</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.4797111</td>
<td align="center">0.4752371</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4868636</td>
<td align="center">0.4825898</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4661747</td>
<td align="center">0.4705631</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4581512</td>
<td align="center">0.4711928</td>
</tr>
</tbody>
</table>
@ -1014,72 +1014,72 @@ Longest: 24</p>
<tbody>
<tr class="odd">
<td align="center">Hospital A</td>
<td align="center">0.4797111</td>
<td align="center">4707</td>
<td align="center">0.4752371</td>
<td align="center">4745</td>
</tr>
<tr class="even">
<td align="center">Hospital B</td>
<td align="center">0.4868636</td>
<td align="center">5519</td>
<td align="center">0.4825898</td>
<td align="center">5514</td>
</tr>
<tr class="odd">
<td align="center">Hospital C</td>
<td align="center">0.4661747</td>
<td align="center">2439</td>
<td align="center">0.4705631</td>
<td align="center">2344</td>
</tr>
<tr class="even">
<td align="center">Hospital D</td>
<td align="center">0.4581512</td>
<td align="center">3202</td>
<td align="center">0.4711928</td>
<td align="center">3211</td>
</tr>
</tbody>
</table>
<p>These functions can also be used to get the portion of multiple antibiotics, to calculate co-resistance very easily:</p>
<p>These functions can also be used to get the portion of multiple antibiotics, to calculate empiric susceptibility of combination therapies very easily:</p>
<div class="sourceCode" id="cb28"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb28-1" title="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb28-2" title="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(genus) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb28-3" title="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise</a></span>(<span class="dt">amoxicillin =</span> <span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl),</a>
<a class="sourceLine" id="cb28-3" title="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise</a></span>(<span class="dt">amoxiclav =</span> <span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl),</a>
<a class="sourceLine" id="cb28-4" title="4"> <span class="dt">gentamicin =</span> <span class="kw"><a href="../reference/portion.html">portion_S</a></span>(gent),</a>
<a class="sourceLine" id="cb28-5" title="5"> <span class="st">"amox + gent"</span> =<span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl, gent))</a></code></pre></div>
<a class="sourceLine" id="cb28-5" title="5"> <span class="dt">amoxiclav_genta =</span> <span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl, gent))</a></code></pre></div>
<table class="table">
<thead><tr class="header">
<th align="center">genus</th>
<th align="center">amoxicillin</th>
<th align="center">amoxiclav</th>
<th align="center">gentamicin</th>
<th align="center">amox + gent</th>
<th align="center">amoxiclav_genta</th>
</tr></thead>
<tbody>
<tr class="odd">
<td align="center">Escherichia</td>
<td align="center">0.7345189</td>
<td align="center">0.8976459</td>
<td align="center">0.9721085</td>
<td align="center">0.7346552</td>
<td align="center">0.8993433</td>
<td align="center">0.9744885</td>
</tr>
<tr class="even">
<td align="center">Klebsiella</td>
<td align="center">0.7433914</td>
<td align="center">0.8949065</td>
<td align="center">0.9767892</td>
<td align="center">0.7406230</td>
<td align="center">0.9020979</td>
<td align="center">0.9726637</td>
</tr>
<tr class="odd">
<td align="center">Staphylococcus</td>
<td align="center">0.7285215</td>
<td align="center">0.9153347</td>
<td align="center">0.9787712</td>
<td align="center">0.7322122</td>
<td align="center">0.9210867</td>
<td align="center">0.9785252</td>
</tr>
<tr class="even">
<td align="center">Streptococcus</td>
<td align="center">0.7315705</td>
<td align="center">0.7135883</td>
<td align="center">0.0000000</td>
<td align="center">0.7315705</td>
<td align="center">0.7135883</td>
</tr>
</tbody>
</table>
<p>To make a transition to the next part, lets see how this difference could be plotted:</p>
<div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb29-1" title="1">data_1st <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb29-2" title="2"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(genus) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb29-3" title="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise</a></span>(<span class="st">"1. Amoxicillin"</span> =<span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl),</a>
<a class="sourceLine" id="cb29-3" title="3"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/summarise.html">summarise</a></span>(<span class="st">"1. Amoxi/clav"</span> =<span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl),</a>
<a class="sourceLine" id="cb29-4" title="4"> <span class="st">"2. Gentamicin"</span> =<span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(gent),</a>
<a class="sourceLine" id="cb29-5" title="5"> <span class="st">"3. Amox + gent"</span> =<span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl, gent)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb29-5" title="5"> <span class="st">"3. Amoxi/clav + gent"</span> =<span class="st"> </span><span class="kw"><a href="../reference/portion.html">portion_S</a></span>(amcl, gent)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb29-6" title="6"><span class="st"> </span>tidyr<span class="op">::</span><span class="kw"><a href="https://tidyr.tidyverse.org/reference/gather.html">gather</a></span>(<span class="st">"Antibiotic"</span>, <span class="st">"S"</span>, <span class="op">-</span>genus) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb29-7" title="7"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(<span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x =</span> genus,</a>
<a class="sourceLine" id="cb29-8" title="8"> <span class="dt">y =</span> S,</a>
@ -1100,9 +1100,9 @@ Longest: 24</p>
<a class="sourceLine" id="cb30-7" title="7"> <span class="dt">x =</span> <span class="st">"My X axis"</span>,</a>
<a class="sourceLine" id="cb30-8" title="8"> <span class="dt">y =</span> <span class="st">"My Y axis"</span>)</a>
<a class="sourceLine" id="cb30-9" title="9"></a>
<a class="sourceLine" id="cb30-10" title="10"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(a_data_set,</a>
<a class="sourceLine" id="cb30-11" title="11"> <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(year, value) <span class="op">+</span></a>
<a class="sourceLine" id="cb30-12" title="12"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_bar.html">geom_bar</a></span>()</a></code></pre></div>
<a class="sourceLine" id="cb30-10" title="10"><span class="co"># or as short as:</span></a>
<a class="sourceLine" id="cb30-11" title="11"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(a_data_set) <span class="op">+</span></a>
<a class="sourceLine" id="cb30-12" title="12"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_bar.html">geom_bar</a></span>(<span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(year))</a></code></pre></div>
<p>The <code>AMR</code> package contains functions to extend this <code>ggplot2</code> package, for example <code><a href="../reference/ggplot_rsi.html">geom_rsi()</a></code>. It automatically transforms data with <code><a href="../reference/count.html">count_df()</a></code> or <code><a href="../reference/portion.html">portion_df()</a></code> and show results in stacked bars. Its simplest and shortest example:</p>
<div class="sourceCode" id="cb31"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb31-1" title="1"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(data_1st) <span class="op">+</span></a>
<a class="sourceLine" id="cb31-2" title="2"><span class="st"> </span><span class="kw"><a href="../reference/ggplot_rsi.html">geom_rsi</a></span>(<span class="dt">translate_ab =</span> <span class="ot">FALSE</span>)</a></code></pre></div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 35 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

@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -192,7 +192,7 @@
<h1>How to apply EUCAST rules</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">27 February 2019</h4>
<h4 class="date">28 February 2019</h4>
<div class="hidden name"><code>EUCAST.Rmd</code></div>

View File

@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -192,7 +192,7 @@
<h1>How to use the <em>G</em>-test</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">27 February 2019</h4>
<h4 class="date">28 February 2019</h4>
<div class="hidden name"><code>G_test.Rmd</code></div>

View File

@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -218,16 +218,16 @@
</li>
<li>
<p><strong>R is extremely flexible.</strong></p>
<p>Because you write the syntax yourself, you can do anything you want. The flexibility in transforming, gathering, grouping, summarising and drawing plots is endless - with SPSS, SAS or Stata you are bound to their algorithms and styles. It may be a bit flexible, but you can never create that very specific publication-ready plot without using other (paid) software.</p>
<p>Because you write the syntax yourself, you can do anything you want. The flexibility in transforming, gathering, grouping, summarising and drawing plots is endless - with SPSS, SAS or Stata you are bound to their algorithms and styles. They may be a bit flexible, but you can probably never create that very specific publication-ready plot without using other (paid) software.</p>
</li>
<li>
<p><strong>R can be easily automated.</strong></p>
<p>Over the last years, <a href="https://rmarkdown.rstudio.com/">R Markdown</a> has really made an interesting development. With R Markdown, you can very easily reproduce your reports, whether its to Word, Powerpoint, a website, a PDF document or just the raw data to Excel. I use this a lot to generate monthly reports automatically. Just write the code once and enjoy the automatically updated reports at any interval you like.</p>
<p>For an even more professional environment, you could create <a href="https://shiny.rstudio.com/">Shiny apps</a>: live manipulation of data using a custom made website. The webdesign knowledge needed (Javascript, CSS, HTML) is almost <em>zero</em>.</p>
<p>For an even more professional environment, you could create <a href="https://shiny.rstudio.com/">Shiny apps</a>: live manipulation of data using a custom made website. The webdesign knowledge needed (JavaScript, CSS, HTML) is almost <em>zero</em>.</p>
</li>
<li>
<p><strong>R has a huge community.</strong></p>
<p>Many R users just ask questions on website like <a href="https://stackoverflow.com">stackoverflow.com</a>, the largest online community for programmers. At the time of writing, around <a href="https://stackoverflow.com/questions/tagged/r?sort=votes">275,000 R questions</a> have been asked on this platform (which covers questions and answer for any programming language). In my own experience, most questions are answered within a couple of minutes.</p>
<p>Many R users just ask questions on websites like <a href="https://stackoverflow.com">StackOverflow.com</a>, the largest online community for programmers. At the time of writing, more than <a href="https://stackoverflow.com/questions/tagged/r?sort=votes">275,000 R-related questions</a> have already been asked on this platform (which covers questions and answers for any programming language). In my own experience, most questions are answered within a couple of minutes.</p>
</li>
<li>
<p><strong>R understands any data type, including SPSS/SAS/Stata.</strong></p>

View File

@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -192,7 +192,7 @@
<h1>How to work with WHONET data</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">27 February 2019</h4>
<h4 class="date">28 February 2019</h4>
<div class="hidden name"><code>WHONET.Rmd</code></div>

View File

@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -192,7 +192,7 @@
<h1>How to get properties of an antibiotic</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">27 February 2019</h4>
<h4 class="date">28 February 2019</h4>
<div class="hidden name"><code>atc_property.Rmd</code></div>

View File

@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -192,7 +192,7 @@
<h1>Benchmarks</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">27 February 2019</h4>
<h4 class="date">28 February 2019</h4>
<div class="hidden name"><code>benchmarks.Rmd</code></div>
@ -217,14 +217,14 @@
<a class="sourceLine" id="cb2-8" title="8"> <span class="dt">times =</span> <span class="dv">10</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>(S.aureus, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb2-10" title="10"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb2-11" title="11"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb2-12" title="12"><span class="co">#&gt; as.mo("sau") 16.70 16.80 21.50 16.8 17.50 56.6 10</span></a>
<a class="sourceLine" id="cb2-13" title="13"><span class="co">#&gt; as.mo("stau") 33.70 34.00 46.60 40.2 50.50 83.7 10</span></a>
<a class="sourceLine" id="cb2-14" title="14"><span class="co">#&gt; as.mo("staaur") 16.70 16.80 28.60 17.3 41.90 59.7 10</span></a>
<a class="sourceLine" id="cb2-15" title="15"><span class="co">#&gt; as.mo("STAAUR") 16.60 16.70 21.90 17.1 20.00 56.6 10</span></a>
<a class="sourceLine" id="cb2-16" title="16"><span class="co">#&gt; as.mo("S. aureus") 24.50 24.90 25.40 25.2 26.10 26.7 10</span></a>
<a class="sourceLine" id="cb2-17" title="17"><span class="co">#&gt; as.mo("S. aureus") 24.60 25.00 31.30 25.1 25.30 85.1 10</span></a>
<a class="sourceLine" id="cb2-18" title="18"><span class="co">#&gt; as.mo("Staphylococcus aureus") 7.37 7.42 8.17 7.5 8.27 11.8 10</span></a></code></pre></div>
<a class="sourceLine" id="cb2-11" title="11"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb2-12" title="12"><span class="co">#&gt; as.mo("sau") 16.70 16.80 17.10 16.90 17.20 18.4 10</span></a>
<a class="sourceLine" id="cb2-13" title="13"><span class="co">#&gt; as.mo("stau") 31.70 31.80 48.90 31.90 73.00 117.0 10</span></a>
<a class="sourceLine" id="cb2-14" title="14"><span class="co">#&gt; as.mo("staaur") 16.70 16.80 23.10 16.90 17.90 76.0 10</span></a>
<a class="sourceLine" id="cb2-15" title="15"><span class="co">#&gt; as.mo("STAAUR") 16.80 17.00 33.20 18.20 56.00 58.6 10</span></a>
<a class="sourceLine" id="cb2-16" title="16"><span class="co">#&gt; as.mo("S. aureus") 24.60 24.70 29.00 24.70 25.30 65.8 10</span></a>
<a class="sourceLine" id="cb2-17" title="17"><span class="co">#&gt; as.mo("S. aureus") 24.60 24.70 29.20 24.80 25.10 67.4 10</span></a>
<a class="sourceLine" id="cb2-18" title="18"><span class="co">#&gt; as.mo("Staphylococcus aureus") 7.02 7.11 7.73 7.26 7.33 11.9 10</span></a></code></pre></div>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 100 milliseconds, this is only 10 input values per second. The second input is the only one that has to be looked up thoroughly. All the others are known codes (the first one is a WHONET code) or common laboratory codes, or common full organism names like the last one. Full organism names are always preferred.</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 less fast. See this example for the ID of <em>Thermus islandicus</em> (<code>B_THERMS_ISL</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">T.islandicus &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">"theisl"</span>),</a>
@ -235,13 +235,13 @@
<a class="sourceLine" id="cb3-6" title="6"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb3-7" title="7"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/print">print</a></span>(T.islandicus, <span class="dt">unit =</span> <span class="st">"ms"</span>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb3-8" title="8"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb3-9" title="9"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb3-10" title="10"><span class="co">#&gt; as.mo("theisl") 289.0 291.0 314.0 312.0 336.0 343 10</span></a>
<a class="sourceLine" id="cb3-11" title="11"><span class="co">#&gt; as.mo("THEISL") 290.0 293.0 319.0 331.0 337.0 344 10</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#&gt; as.mo("T. islandicus") 73.5 73.8 90.6 75.1 114.0 118 10</span></a>
<a class="sourceLine" id="cb3-13" title="13"><span class="co">#&gt; as.mo("T. islandicus") 73.7 73.9 78.5 74.6 74.7 115 10</span></a>
<a class="sourceLine" id="cb3-14" title="14"><span class="co">#&gt; as.mo("Thermus islandicus") 66.5 67.3 80.3 69.5 107.0 108 10</span></a></code></pre></div>
<p>That takes 6.7 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. Full names (like <em>Thermus islandicus</em>) are almost fast - these are the most probable input from most data sets.</p>
<a class="sourceLine" id="cb3-9" title="9"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb3-10" title="10"><span class="co">#&gt; as.mo("theisl") 262.0 292.0 296.0 304.0 310 312 10</span></a>
<a class="sourceLine" id="cb3-11" title="11"><span class="co">#&gt; as.mo("THEISL") 261.0 263.0 286.0 288.0 307 311 10</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#&gt; as.mo("T. islandicus") 142.0 143.0 164.0 165.0 184 187 10</span></a>
<a class="sourceLine" id="cb3-13" title="13"><span class="co">#&gt; as.mo("T. islandicus") 142.0 143.0 170.0 163.0 192 229 10</span></a>
<a class="sourceLine" id="cb3-14" title="14"><span class="co">#&gt; as.mo("Thermus islandicus") 67.7 68.1 94.3 89.4 117 132 10</span></a></code></pre></div>
<p>That takes 7.5 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. Full names (like <em>Thermus islandicus</em>) are almost fast - these are the most probable input from most data sets.</p>
<p>In the figure below, we compare <em>Escherichia coli</em> (which is very common) with <em>Prevotella brevis</em> (which is moderately common) and with <em>Thermus islandicus</em> (which is very uncommon):</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>
@ -260,7 +260,7 @@
<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) which uses <code><a href="../reference/as.mo.html">as.mo()</a></code> internally.</p>
<p>Repetitive results are unique values that 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="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-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="cb5-2" title="2"><span class="co"># take all MO codes from the septic_patients data set</span></a>
<a class="sourceLine" id="cb5-3" title="3">x &lt;-<span class="st"> </span>septic_patients<span class="op">$</span>mo <span class="op">%&gt;%</span></a>
@ -286,9 +286,9 @@
<a class="sourceLine" id="cb5-23" title="23"> <span class="dt">times =</span> <span class="dv">10</span>)</a>
<a class="sourceLine" id="cb5-24" title="24"><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>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb5-25" title="25"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb5-26" title="26"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb5-27" title="27"><span class="co">#&gt; mo_fullname(x) 732 768 800 794 799 949 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!!) of 50 unique values only takes 0.79 seconds (793 ms). You only lose time on your unique input values.</p>
<a class="sourceLine" id="cb5-26" title="26"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb5-27" title="27"><span class="co">#&gt; mo_fullname(x) 732 739 818 819 837 1040 10</span></a></code></pre></div>
<p>So transforming 500,000 values (!!) of 50 unique values only takes 0.82 seconds (818 ms). You only lose time on your unique input values.</p>
</div>
<div id="precalculated-results" class="section level3">
<h3 class="hasAnchor">
@ -301,10 +301,10 @@
<a class="sourceLine" id="cb6-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>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb6-6" title="6"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb6-7" title="7"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb6-8" title="8"><span class="co">#&gt; A 10.900 11.300 11.900 11.500 11.700 15.200 10</span></a>
<a class="sourceLine" id="cb6-9" title="9"><span class="co">#&gt; B 22.000 22.600 26.900 22.600 22.800 62.400 10</span></a>
<a class="sourceLine" id="cb6-10" title="10"><span class="co">#&gt; C 0.311 0.502 0.531 0.533 0.577 0.765 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.0005 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>
<a class="sourceLine" id="cb6-8" title="8"><span class="co">#&gt; A 11.100 11.300 11.500 11.500 11.600 11.700 10</span></a>
<a class="sourceLine" id="cb6-9" title="9"><span class="co">#&gt; B 22.200 22.500 22.800 22.900 23.000 23.500 10</span></a>
<a class="sourceLine" id="cb6-10" title="10"><span class="co">#&gt; C 0.325 0.566 0.571 0.579 0.599 0.704 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.0006 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">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_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>
@ -317,14 +317,14 @@
<a class="sourceLine" id="cb7-10" title="10"><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>, <span class="dt">signif =</span> <span class="dv">3</span>)</a>
<a class="sourceLine" id="cb7-11" title="11"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb7-12" title="12"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb7-13" title="13"><span class="co">#&gt; A 0.274 0.333 0.417 0.412 0.481 0.611 10</span></a>
<a class="sourceLine" id="cb7-14" title="14"><span class="co">#&gt; B 0.337 0.353 0.403 0.411 0.438 0.461 10</span></a>
<a class="sourceLine" id="cb7-15" title="15"><span class="co">#&gt; C 0.336 0.362 0.530 0.528 0.682 0.755 10</span></a>
<a class="sourceLine" id="cb7-16" title="16"><span class="co">#&gt; D 0.263 0.316 0.340 0.331 0.360 0.474 10</span></a>
<a class="sourceLine" id="cb7-17" title="17"><span class="co">#&gt; E 0.252 0.326 0.326 0.329 0.345 0.389 10</span></a>
<a class="sourceLine" id="cb7-18" title="18"><span class="co">#&gt; F 0.250 0.300 0.319 0.327 0.351 0.351 10</span></a>
<a class="sourceLine" id="cb7-19" title="19"><span class="co">#&gt; G 0.240 0.246 0.288 0.277 0.325 0.351 10</span></a>
<a class="sourceLine" id="cb7-20" title="20"><span class="co">#&gt; H 0.242 0.257 0.304 0.294 0.332 0.395 10</span></a></code></pre></div>
<a class="sourceLine" id="cb7-13" title="13"><span class="co">#&gt; A 0.308 0.392 0.419 0.406 0.478 0.524 10</span></a>
<a class="sourceLine" id="cb7-14" title="14"><span class="co">#&gt; B 0.377 0.406 0.424 0.418 0.442 0.486 10</span></a>
<a class="sourceLine" id="cb7-15" title="15"><span class="co">#&gt; C 0.359 0.516 0.580 0.574 0.664 0.730 10</span></a>
<a class="sourceLine" id="cb7-16" title="16"><span class="co">#&gt; D 0.266 0.326 0.337 0.342 0.350 0.383 10</span></a>
<a class="sourceLine" id="cb7-17" title="17"><span class="co">#&gt; E 0.254 0.281 0.332 0.336 0.359 0.446 10</span></a>
<a class="sourceLine" id="cb7-18" title="18"><span class="co">#&gt; F 0.237 0.315 0.329 0.340 0.360 0.374 10</span></a>
<a class="sourceLine" id="cb7-19" title="19"><span class="co">#&gt; G 0.261 0.295 0.318 0.323 0.341 0.390 10</span></a>
<a class="sourceLine" id="cb7-20" title="20"><span class="co">#&gt; H 0.271 0.290 0.321 0.317 0.343 0.403 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">
@ -351,13 +351,13 @@
<a class="sourceLine" id="cb8-18" title="18"><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>, <span class="dt">signif =</span> <span class="dv">4</span>)</a>
<a class="sourceLine" id="cb8-19" title="19"><span class="co">#&gt; Unit: milliseconds</span></a>
<a class="sourceLine" id="cb8-20" title="20"><span class="co">#&gt; expr min lq mean median uq max neval</span></a>
<a class="sourceLine" id="cb8-21" title="21"><span class="co">#&gt; en 14.68 15.11 15.28 15.27 15.34 16.21 10</span></a>
<a class="sourceLine" id="cb8-22" title="22"><span class="co">#&gt; de 23.53 23.65 24.04 23.82 24.63 24.88 10</span></a>
<a class="sourceLine" id="cb8-23" title="23"><span class="co">#&gt; nl 23.36 23.53 27.76 23.81 23.87 63.45 10</span></a>
<a class="sourceLine" id="cb8-24" title="24"><span class="co">#&gt; es 23.59 23.83 23.94 23.96 24.07 24.22 10</span></a>
<a class="sourceLine" id="cb8-25" title="25"><span class="co">#&gt; it 23.30 23.76 27.92 23.83 24.18 64.01 10</span></a>
<a class="sourceLine" id="cb8-26" title="26"><span class="co">#&gt; fr 23.47 23.78 31.80 23.84 24.90 63.25 10</span></a>
<a class="sourceLine" id="cb8-27" title="27"><span class="co">#&gt; pt 23.28 23.69 27.97 23.85 24.42 64.14 10</span></a></code></pre></div>
<a class="sourceLine" id="cb8-21" title="21"><span class="co">#&gt; en 15.06 15.54 22.29 15.71 31.46 40.83 10</span></a>
<a class="sourceLine" id="cb8-22" title="22"><span class="co">#&gt; de 23.57 23.91 28.72 24.04 26.24 47.77 10</span></a>
<a class="sourceLine" id="cb8-23" title="23"><span class="co">#&gt; nl 23.46 23.87 33.14 24.71 45.69 68.77 10</span></a>
<a class="sourceLine" id="cb8-24" title="24"><span class="co">#&gt; es 23.76 23.98 37.40 24.72 46.85 90.39 10</span></a>
<a class="sourceLine" id="cb8-25" title="25"><span class="co">#&gt; it 23.98 24.07 30.76 24.49 25.18 67.52 10</span></a>
<a class="sourceLine" id="cb8-26" title="26"><span class="co">#&gt; fr 24.03 24.04 27.06 24.14 26.51 47.08 10</span></a>
<a class="sourceLine" id="cb8-27" title="27"><span class="co">#&gt; pt 23.66 24.00 30.90 24.17 25.84 65.76 10</span></a></code></pre></div>
<p>Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.</p>
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -192,7 +192,7 @@
<h1>How to create frequency tables</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">27 February 2019</h4>
<h4 class="date">28 February 2019</h4>
<div class="hidden name"><code>freq.Rmd</code></div>

View File

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

View File

@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -192,7 +192,7 @@
<h1>How to get properties of a microorganism</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">27 February 2019</h4>
<h4 class="date">28 February 2019</h4>
<div class="hidden name"><code>mo_property.Rmd</code></div>

View File

@ -40,7 +40,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -192,7 +192,7 @@
<h1>How to predict antimicrobial resistance</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">27 February 2019</h4>
<h4 class="date">28 February 2019</h4>
<div class="hidden name"><code>resistance_predict.Rmd</code></div>

View File

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

View File

@ -42,7 +42,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -280,6 +280,7 @@
<p>All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales.</p>
<p>The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, like mushrooms). Because of this, not all fungi fit the scope of this package and including everything would tremendously slow down our algorithms too. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (like all species of <em>Aspergillus</em>, <em>Candida</em>, <em>Cryptococcus</em>, <em>Histoplasma</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p>
</li>
<li><p>All ~2,000 (sub)species from ~100 other relevant genera, from the kingdoms of Animalia and Plantae (like <em>Strongyloides</em> and <em>Taenia</em>)</p></li>
<li><p>All ~15,000 previously accepted names of included (sub)species that have been taxonomically renamed</p></li>
<li><p>The responsible author(s) and year of scientific publication</p></li>
</ul>

View File

@ -78,7 +78,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -253,6 +253,7 @@
<ul>
<li>All ~55,000 (sub)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 (covering at least like all species of <em>Aspergillus</em>, <em>Candida</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>)</li>
<li>All ~2,000 (sub)species from ~100 other relevant genera, from the kingdoms of Animalia and Plantae (like <em>Strongyloides</em> and <em>Taenia</em>)</li>
<li>All ~15,000 previously accepted names of included (sub)species that have been taxonomically renamed</li>
<li>
<p>The responsible author(s) and year of scientific publication</p>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -296,11 +296,12 @@
| | | ----&gt; subspecies, a 3-4 letter acronym
| | ----&gt; species, a 3-4 letter acronym
| ----&gt; genus, a 5-7 letter acronym, mostly without vowels
----&gt; taxonomic kingdom: A (Archaea), B (Bacteria), C (Chromista),
F (Fungi), P (Protozoa) or V (Viruses)
----&gt; taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria), C (Chromista),
F (Fungi), P (Protozoa), PL (Plantae) or V (Viruses)
</pre>
<p>Use the <code><a href='mo_property.html'>mo_property</a></code> functions to get properties based on the returned code, see Examples.</p>
<p>This function uses Artificial Intelligence (AI) to help getting fast and logical results. It tries to find matches in this order:</p><ul>
<p><strong>Artificial Intelligence</strong> <br />
This function uses Artificial Intelligence (AI) to help getting fast and logical results. It tries to find matches in this order:</p><ul>
<li><p>Taxonomic kingdom: it first searches in Bacteria, then Fungi, then Protozoa</p></li>
<li><p>Human pathogenic prevalence: it first searches in more prevalent microorganisms, then less prevalent ones (see section <em>Microbial prevalence of pathogens in humans</em>)</p></li>
<li><p>Valid MO codes and full names: it first searches in already valid MO code and known genus/species combinations</p></li>
@ -310,8 +311,8 @@
<li><p><code>"E. coli"</code> will return the ID of <em>Escherichia coli</em> and not <em>Entamoeba coli</em>, although the latter would alphabetically come first</p></li>
<li><p><code>"H. influenzae"</code> will return the ID of <em>Haemophilus influenzae</em> and not <em>Haematobacter influenzae</em> for the same reason</p></li>
<li><p>Something like <code>"stau"</code> or <code>"S aur"</code> will return the ID of <em>Staphylococcus aureus</em> and not <em>Staphylococcus auricularis</em></p></li>
</ul><p>This means that looking up human pathogenic microorganisms takes less time than looking up human <strong>non</strong>-pathogenic microorganisms.</p>
<p><strong>UNCERTAIN RESULTS</strong> <br />
</ul><p>This means that looking up human pathogenic microorganisms takes less time than looking up human non-pathogenic microorganisms.</p>
<p><strong>Uncertain results</strong> <br />
When using <code>allow_uncertain = TRUE</code> (which is the default setting), it will use additional rules if all previous AI rules failed to get valid results. These are:</p><ul>
<li><p>It tries to look for previously accepted (but now invalid) taxonomic names</p></li>
<li><p>It strips off values between brackets and the brackets itself, and re-evaluates the input with all previous rules</p></li>
@ -325,19 +326,16 @@ When using <code>allow_uncertain = TRUE</code> (which is the default setting), i
<li><p><code>"Fluoroquinolone-resistant Neisseria gonorrhoeae"</code>. The first word will be stripped, after which the function will try to find a match. A warning will be thrown that the result <em>Neisseria gonorrhoeae</em> (<code>B_NESSR_GON</code>) needs review.</p></li>
</ul>
<p>Use <code>mo_failures()</code> to get a vector with all values that could not be coerced to a valid value.</p>
<p>Use <code>mo_uncertainties()</code> to get info about all values that were coerced to a valid value, but with uncertainty.</p>
<p>Use <code>mo_uncertainties()</code> to get a data.frame with all values that were coerced to a valid value, but with uncertainty.</p>
<p>Use <code>mo_renamed()</code> to get a vector with all values that could be coerced based on an old, previously accepted taxonomic name.</p>
<h2 class="hasAnchor" id="microbial-prevalence-of-pathogens-in-humans"><a class="anchor" href="#microbial-prevalence-of-pathogens-in-humans"></a>Microbial prevalence of pathogens in humans</h2>
<p>The artificial intelligence takes into account microbial prevalence of pathogens in humans. It uses three groups and every (sub)species is in the group it matches first. These groups are:</p><ul>
<p><strong>Microbial prevalence of pathogens in humans</strong> <br />
The artificial intelligence takes into account microbial prevalence of pathogens in humans. It uses three groups and every (sub)species is in the group it matches first. These groups are:</p><ul>
<li><p>1 (most prevalent): class is Gammaproteobacteria <strong>or</strong> genus is one of: <em>Enterococcus</em>, <em>Staphylococcus</em>, <em>Streptococcus</em>.</p></li>
<li><p>2: phylum is one of: Proteobacteria, Firmicutes, Actinobacteria, Sarcomastigophora <strong>or</strong> genus is one of: <em>Aspergillus</em>, <em>Bacteroides</em>, <em>Candida</em>, <em>Capnocytophaga</em>, <em>Chryseobacterium</em>, <em>Cryptococcus</em>, <em>Elisabethkingia</em>, <em>Flavobacterium</em>, <em>Fusobacterium</em>, <em>Giardia</em>, <em>Leptotrichia</em>, <em>Mycoplasma</em>, <em>Prevotella</em>, <em>Rhodotorula</em>, <em>Treponema</em>, <em>Trichophyton</em>, <em>Ureaplasma</em>.</p></li>
<li><p>3 (least prevalent): all others.</p></li>
</ul>
<p>Group 1 contains all common Gram negatives, like all Enterobacteriaceae and e.g. <em>Pseudomonas</em> and <em>Legionella</em>.</p>
<p>Group 2 probably contains all microbial pathogens ever found in humans.</p>
<p>Group 2 probably contains all other microbial pathogens ever found in humans.</p>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
@ -349,17 +347,9 @@ When using <code>allow_uncertain = TRUE</code> (which is the default setting), i
<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,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of <em>Aspergillus</em>, <em>Candida</em>, <em>Cryptococcus</em>, <em>Histplasma</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of included (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>
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</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>
@ -431,8 +421,6 @@ The <code><a href='mo_property.html'>mo_property</a></code> functions (like <cod
<li><a href="#details">Details</a></li>
<li><a href="#microbial-prevalence-of-pathogens-in-humans">Microbial prevalence of pathogens in humans</a></li>
<li><a href="#source">Source</a></li>
<li><a href="#catalogue-of-life">Catalogue of Life</a></li>

View File

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

View File

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

View File

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

View File

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

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -245,11 +245,17 @@
<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>
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p>Click here for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</p>
<h2 class="hasAnchor" id="included-taxa"><a class="anchor" href="#included-taxa"></a>Included taxa</h2>
<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,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of <em>Aspergillus</em>, <em>Candida</em>, <em>Cryptococcus</em>, <em>Histplasma</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, like mushrooms). Because of this, not all fungi fit the scope of this package and including everything would tremendously slow down our algorithms too. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (like all species of <em>Aspergillus</em>, <em>Candida</em>, <em>Cryptococcus</em>, <em>Histplasma</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~2,000 (sub)species from ~100 other relevant genera, from the kingdoms of Animalia and Plantae (like <em>Strongyloides</em> and <em>Taenia</em>)</p></li>
<li><p>All ~15,000 previously accepted names of included (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>
@ -301,6 +307,8 @@ This package contains the complete taxonomic tree of almost all microorganisms f
<li><a href="#catalogue-of-life">Catalogue of Life</a></li>
<li><a href="#included-taxa">Included taxa</a></li>
<li><a href="#read-more-on-our-website-">Read more on our website!</a></li>
<li><a href="#examples">Examples</a></li>

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -250,17 +250,9 @@
<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,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of <em>Aspergillus</em>, <em>Candida</em>, <em>Cryptococcus</em>, <em>Histplasma</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of included (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>
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with <code>catalogue_of_life_version()</code>.</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>

View File

@ -81,7 +81,7 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_
</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.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>

View File

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

View File

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

View File

@ -81,7 +81,7 @@ top_freq can be used to get the top/bottom n items of a frequency table, with co
</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.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -253,17 +253,9 @@
<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,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of <em>Aspergillus</em>, <em>Candida</em>, <em>Cryptococcus</em>, <em>Histplasma</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of included (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>
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</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>

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -277,17 +277,9 @@
<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,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of <em>Aspergillus</em>, <em>Candida</em>, <em>Cryptococcus</em>, <em>Histplasma</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of included (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>
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</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>

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -259,17 +259,9 @@
<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,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of <em>Aspergillus</em>, <em>Candida</em>, <em>Cryptococcus</em>, <em>Histplasma</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of included (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>
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</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>

View File

@ -80,7 +80,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -333,17 +333,9 @@
<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,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of <em>Aspergillus</em>, <em>Candida</em>, <em>Cryptococcus</em>, <em>Histplasma</em>, <em>Pneumocystis</em>, <em>Saccharomyces</em> and <em>Trichophyton</em>).</p></li>
<li><p>All ~15,000 previously accepted names of included (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>
<p><img src='figures/logo_col.png' height=40px style=margin-bottom:5px /> <br />
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (<a href='http://www.catalogueoflife.org'>http://www.catalogueoflife.org</a>). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.</p>
<p><a href='catalogue_of_life.html'>Click here</a> for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with <code><a href='catalogue_of_life_version.html'>catalogue_of_life_version</a>()</code>.</p>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>

View File

@ -47,7 +47,8 @@
<script src="../extra.js"></script>
<meta property="og:title" content="Use predefined reference data set — mo_source" />
<meta property="og:description" content="These functions can be used to predefine your own reference to be used in as.mo and consequently all mo_* functions like mo_genus and mo_gramstain." />
<meta property="og:description" content="These functions can be used to predefine your own reference to be used in as.mo and consequently all mo_* functions like mo_genus and mo_gramstain.
This is the fastest way to have your organisation (or analysis) specific codes picked up and translated by this package." />
<meta property="og:image" content="https://msberends.gitlab.io/AMR/logo.png" />
<meta name="twitter:card" content="summary" />
@ -80,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>
@ -238,6 +239,7 @@
<div class="ref-description">
<p>These functions can be used to predefine your own reference to be used in <code><a href='as.mo.html'>as.mo</a></code> and consequently all <code>mo_*</code> functions like <code><a href='mo_property.html'>mo_genus</a></code> and <code><a href='mo_property.html'>mo_gramstain</a></code>.</p>
<p>This is <strong>the fastest way</strong> to have your organisation (or analysis) specific codes picked up and translated by this package.</p>
</div>
@ -261,40 +263,56 @@
<p><code>get_mo_source</code> will return the data set by reading <code>"~/.mo_source.rds"</code> with <code><a href='https://www.rdocumentation.org/packages/base/topics/readRDS'>readRDS</a></code>. If the original file has changed (the file defined with <code>path</code>), it will call <code>set_mo_source</code> to update the data file automatically.</p>
<p>Reading an Excel file (<code>.xlsx</code>) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read by <code>get_mo_source</code> in only a couple of microseconds (a millionth of a second).</p>
<h2 class="hasAnchor" id="how-it-works"><a class="anchor" href="#how-it-works"></a>How it works</h2>
<p>Imagine this data on a sheet of an Excel file (mo codes were looked up in the `microorganisms` data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:</p><pre>
| A | B |
--|--------------------|-------------|
1 | Organisation XYZ | mo |
2 | lab_mo_ecoli | B_ESCHR_COL |
3 | lab_mo_kpneumoniae | B_KLBSL_PNE |
4 | | |
</pre>
<p>We save it as <code>'home/me/ourcodes.xlsx'</code>. Now we have to set it as a source:</p><pre>
set_mo_source("home/me/ourcodes.xlsx")
# Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
</pre>
<p>It has now created a file "~/.mo_source.rds" with the contents of our Excel file. It it an R specific format with great compression.</p>
<p>And now we can use it in our functions:</p><pre>
as.mo("lab_mo_ecoli")
# B_ESCHR_COL
mo_genus("lab_mo_kpneumoniae")
# "Klebsiella"
</pre>
<p>If we edit the Excel file to, let's say, this:</p><pre>
| A | B |
--|--------------------|-------------|
1 | Organisation XYZ | mo |
2 | lab_mo_ecoli | B_ESCHR_COL |
3 | lab_mo_kpneumoniae | B_KLBSL_PNE |
4 | lab_Staph_aureus | B_STPHY_AUR |
5 | | |
</pre>
<p>...any new usage of an MO function in this package will update your data:</p><pre>
as.mo("lab_mo_ecoli")
# Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
# B_ESCHR_COL
mo_genus("lab_Staph_aureus")
# "Staphylococcus"
</pre>
<p>To remove the reference completely, just use any of these:</p><pre>
set_mo_source("")
set_mo_source(NULL)
# Removed mo_source file '~/.mo_source.rds'.
</pre>
<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>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'># imagine this Excel file (mo codes looked up in `microorganisms` data set):</span>
<span class='co'># A B</span>
<span class='co'># 1 our code mo</span>
<span class='co'># 2 lab_mo_ecoli B_ESCHR_COL</span>
<span class='co'># 3 lab_mo_kpneumoniae B_KLBSL_PNE</span>
<span class='co'># 1. We save it as 'home/me/ourcodes.xlsx'</span>
<span class='co'># 2. We use it for input:</span>
<span class='fu'>set_mo_source</span>(<span class='st'>"home/me/ourcodes.xlsx"</span>)
<span class='co'>#&gt; Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.</span>
<span class='co'># 3. And use it in our functions:</span>
<span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"lab_mo_ecoli"</span>)
<span class='co'>#&gt; B_ESCHR_COL</span>
<span class='fu'><a href='mo_property.html'>mo_genus</a></span>(<span class='st'>"lab_mo_kpneumoniae"</span>)
<span class='co'>#&gt; "Klebsiella"</span>
<span class='co'># 4. It will look for changes itself:</span>
<span class='co'># (add new row to the Excel file and save it)</span>
<span class='fu'><a href='mo_property.html'>mo_genus</a></span>(<span class='st'>"lab_mo_kpneumoniae"</span>)
<span class='co'>#&gt; Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.</span>
<span class='co'>#&gt; "Klebsiella"</span>
<span class='co'># }</span></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
@ -303,10 +321,10 @@
<li><a href="#details">Details</a></li>
<li><a href="#how-it-works">How it works</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>
</ul>
</div>
</div>

View File

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

View File

@ -81,7 +81,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port
</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.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>

View File

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

View File

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

View File

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

View File

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

View File

@ -81,7 +81,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr
</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.9019</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9020</span>
</span>
</div>

View File

@ -96,6 +96,8 @@ Included are:
The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, like mushrooms). Because of this, not all fungi fit the scope of this package and including everything would tremendously slow down our algorithms too. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (like all species of *Aspergillus*, *Candida*, *Cryptococcus*, *Histoplasma*, *Pneumocystis*, *Saccharomyces* and *Trichophyton*).
* All ~2,000 (sub)species from ~100 other relevant genera, from the kingdoms of Animalia and Plantae (like *Strongyloides* and *Taenia*)
* All ~15,000 previously accepted names of included (sub)species that have been taxonomically renamed
* The responsible author(s) and year of scientific publication

View File

@ -54,12 +54,13 @@ A microbial ID from this package (class: \code{mo}) typically looks like these e
| | | ----> subspecies, a 3-4 letter acronym
| | ----> species, a 3-4 letter acronym
| ----> genus, a 5-7 letter acronym, mostly without vowels
----> taxonomic kingdom: A (Archaea), B (Bacteria), C (Chromista),
F (Fungi), P (Protozoa) or V (Viruses)
----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria), C (Chromista),
F (Fungi), P (Protozoa), PL (Plantae) or V (Viruses)
}
Use the \code{\link{mo_property}} functions to get properties based on the returned code, see Examples.
\strong{Artificial Intelligence} \cr
This function uses Artificial Intelligence (AI) to help getting fast and logical results. It tries to find matches in this order:
\itemize{
\item{Taxonomic kingdom: it first searches in Bacteria, then Fungi, then Protozoa}
@ -74,9 +75,9 @@ A couple of effects because of these rules:
\item{\code{"H. influenzae"} will return the ID of \emph{Haemophilus influenzae} and not \emph{Haematobacter influenzae} for the same reason}
\item{Something like \code{"stau"} or \code{"S aur"} will return the ID of \emph{Staphylococcus aureus} and not \emph{Staphylococcus auricularis}}
}
This means that looking up human pathogenic microorganisms takes less time than looking up human \strong{non}-pathogenic microorganisms.
This means that looking up human pathogenic microorganisms takes less time than looking up human non-pathogenic microorganisms.
\strong{UNCERTAIN RESULTS} \cr
\strong{Uncertain results} \cr
When using \code{allow_uncertain = TRUE} (which is the default setting), it will use additional rules if all previous AI rules failed to get valid results. These are:
\itemize{
\item{It tries to look for previously accepted (but now invalid) taxonomic names}
@ -95,12 +96,11 @@ Examples:
Use \code{mo_failures()} to get a vector with all values that could not be coerced to a valid value.
Use \code{mo_uncertainties()} to get info about all values that were coerced to a valid value, but with uncertainty.
Use \code{mo_uncertainties()} to get a data.frame with all values that were coerced to a valid value, but with uncertainty.
Use \code{mo_renamed()} to get a vector with all values that could be coerced based on an old, previously accepted taxonomic name.
}
\section{Microbial prevalence of pathogens in humans}{
\strong{Microbial prevalence of pathogens in humans} \cr
The artificial intelligence takes into account microbial prevalence of pathogens in humans. It uses three groups and every (sub)species is in the group it matches first. These groups are:
\itemize{
\item{1 (most prevalent): class is Gammaproteobacteria \strong{or} genus is one of: \emph{Enterococcus}, \emph{Staphylococcus}, \emph{Streptococcus}.}
@ -110,9 +110,8 @@ The artificial intelligence takes into account microbial prevalence of pathogens
Group 1 contains all common Gram negatives, like all Enterobacteriaceae and e.g. \emph{Pseudomonas} and \emph{Legionella}.
Group 2 probably contains all microbial pathogens ever found in humans.
Group 2 probably contains all other microbial pathogens ever found in humans.
}
\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}
@ -124,21 +123,10 @@ Group 2 probably contains all microbial pathogens ever found in humans.
\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}()}.
\if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of included (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}.
\link[=catalogue_of_life]{Click here} for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with \code{\link{catalogue_of_life_version}()}.
}
\section{Read more on our website!}{

View File

@ -8,13 +8,19 @@ This package contains the complete taxonomic tree of almost all microorganisms f
}
\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}()}.
\if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.
\link[=catalogue_of_life]{Click here} for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with \code{\link{catalogue_of_life_version}()}.
}
\section{Included taxa}{
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, like mushrooms). Because of this, not all fungi fit the scope of this package and including everything would tremendously slow down our algorithms too. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~2,000 (sub)species from ~100 other relevant genera, from the kingdoms of Animalia and Plantae (like \emph{Strongyloides} and \emph{Taenia})}
\item{All ~15,000 previously accepted names of included (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}

View File

@ -14,21 +14,10 @@ The list item \code{is_latest_annual_release} is based on the system date.
}
\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}()}.
\if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of included (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}.
\link[=catalogue_of_life]{Click here} for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with \code{\link{catalogue_of_life_version}()}.
}
\section{Read more on our website!}{

View File

@ -40,21 +40,10 @@ Manually added were:
}
\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}()}.
\if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of included (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}.
\link[=catalogue_of_life]{Click here} for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with \code{\link{catalogue_of_life_version}()}.
}
\section{Read more on our website!}{

View File

@ -17,21 +17,10 @@ A data set containing commonly used codes for microorganisms, from laboratory sy
}
\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}()}.
\if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of included (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}.
\link[=catalogue_of_life]{Click here} for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with \code{\link{catalogue_of_life_version}()}.
}
\section{Read more on our website!}{

View File

@ -22,21 +22,10 @@ A data set containing old (previously valid or accepted) taxonomic names accordi
}
\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}()}.
\if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of included (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}.
\link[=catalogue_of_life]{Click here} for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with \code{\link{catalogue_of_life_version}()}.
}
\section{Read more on our website!}{

View File

@ -101,21 +101,10 @@ Supported languages are \code{"en"} (English), \code{"de"} (German), \code{"nl"}
\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}()}.
\if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr}
This package contains the complete taxonomic tree of almost all microorganisms (~60,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.
Included are:
\itemize{
\item{All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria, Protozoa and Viruses}
\item{All ~3,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. This covers the most relevant microbial fungi (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).}
\item{All ~15,000 previously accepted names of included (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}.
\link[=catalogue_of_life]{Click here} for more information about the included taxa. The Catalogue of Life releases updates annually; check which version was included in this package with \code{\link{catalogue_of_life_version}()}.
}
\section{Source}{

View File

@ -15,6 +15,8 @@ get_mo_source()
}
\description{
These functions can be used to predefine your own reference to be used in \code{\link{as.mo}} and consequently all \code{mo_*} functions like \code{\link{mo_genus}} and \code{\link{mo_gramstain}}.
This is \strong{the fastest way} to have your organisation (or analysis) specific codes picked up and translated by this package.
}
\details{
The reference file can be a text file seperated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you need to have the \code{readxl} package installed.
@ -25,38 +27,66 @@ The reference file can be a text file seperated with commas (CSV) or tabs or pip
Reading an Excel file (\code{.xlsx}) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read by \code{get_mo_source} in only a couple of microseconds (a millionth of a second).
}
\section{How it works}{
Imagine this data on a sheet of an Excel file (mo codes were looked up in the `microorganisms` data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:
\preformatted{
| A | B |
--|--------------------|-------------|
1 | Organisation XYZ | mo |
2 | lab_mo_ecoli | B_ESCHR_COL |
3 | lab_mo_kpneumoniae | B_KLBSL_PNE |
4 | | |
}
We save it as \code{'home/me/ourcodes.xlsx'}. Now we have to set it as a source:
\preformatted{
set_mo_source("home/me/ourcodes.xlsx")
# Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
}
It has now created a file "~/.mo_source.rds" with the contents of our Excel file. It it an R specific format with great compression.
And now we can use it in our functions:
\preformatted{
as.mo("lab_mo_ecoli")
# B_ESCHR_COL
mo_genus("lab_mo_kpneumoniae")
# "Klebsiella"
}
If we edit the Excel file to, let's say, this:
\preformatted{
| A | B |
--|--------------------|-------------|
1 | Organisation XYZ | mo |
2 | lab_mo_ecoli | B_ESCHR_COL |
3 | lab_mo_kpneumoniae | B_KLBSL_PNE |
4 | lab_Staph_aureus | B_STPHY_AUR |
5 | | |
}
...any new usage of an MO function in this package will update your data:
\preformatted{
as.mo("lab_mo_ecoli")
# Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
# B_ESCHR_COL
mo_genus("lab_Staph_aureus")
# "Staphylococcus"
}
To remove the reference completely, just use any of these:
\preformatted{
set_mo_source("")
set_mo_source(NULL)
# Removed mo_source file '~/.mo_source.rds'.
}
}
\section{Read more on our website!}{
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{
\dontrun{
# imagine this Excel file (mo codes looked up in `microorganisms` data set):
# A B
# 1 our code mo
# 2 lab_mo_ecoli B_ESCHR_COL
# 3 lab_mo_kpneumoniae B_KLBSL_PNE
# 1. We save it as 'home/me/ourcodes.xlsx'
# 2. We use it for input:
set_mo_source("home/me/ourcodes.xlsx")
#> Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
# 3. And use it in our functions:
as.mo("lab_mo_ecoli")
#> B_ESCHR_COL
mo_genus("lab_mo_kpneumoniae")
#> "Klebsiella"
# 4. It will look for changes itself:
# (add new row to the Excel file and save it)
mo_genus("lab_mo_kpneumoniae")
#> Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.
#> "Klebsiella"
}
}

View File

@ -23,13 +23,29 @@ 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", "Tremellales", "Onygenales", "Pneumocystales"))) %>%
(
# 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", "Tremellales", "Onygenales", "Pneumocystales"))
)
# or the genus has to be one of the genera we found in our hospitals last decades
| genus %in% c("Absidia", "Acremonium", "Actinotignum", "Alternaria", "Anaerosalibacter", "Ancylostoma", "Anisakis", "Apophysomyces",
"Arachnia", "Ascaris", "Aureobacterium", "Aureobasidium", "Balantidum", "Bilophilia", "Branhamella", "Brochontrix",
"Brugia", "Calymmatobacterium", "Catabacter", "Cdc", "Chilomastix", "Chryseomonas", "Cladophialophora", "Cladosporium",
"Clonorchis", "Cordylobia", "Curvularia", "Demodex", "Dermatobia", "Diphyllobothrium", "Dracunculus", "Echinococcus",
"Enterobius", "Euascomycetes", "Exophiala", "Fasciola", "Fusarium", "Hendersonula", "Hymenolepis", "Kloeckera",
"Koserella", "Larva", "Leishmania", "Lelliottia", "Loa", "Lumbricus", "Malassezia", "Metagonimus", "Molonomonas",
"Mucor", "Nattrassia", "Necator", "Novospingobium", "Onchocerca", "Opistorchis", "Paragonimus", "Paramyxovirus",
"Pediculus", "Phoma", "Phthirus", "Pityrosporum", "Pseudallescheria", "Pulex", "Rhizomucor", "Rhizopus", "Rhodotorula",
"Salinococcus", "Sanguibacteroides", "Schistosoma", "Scopulariopsis", "Scytalidium", "Sporobolomyces", "Stomatococcus",
"Strongyloides", "Syncephalastraceae", "Taenia", "Torulopsis", "Trichinella", "Trichobilharzia", "Trichomonas",
"Trichosporon", "Trichuris", "Trypanosoma", "Wuchereria")
) %>%
# remove text if it contains 'Not assigned' like phylum in viruses
mutate_all(funs(gsub("Not assigned", "", .))) %>%
# Transform 'Smith, Jones, 2011' to 'Smith et al., 2011':
@ -143,7 +159,11 @@ MOs <- MOs %>%
ungroup() %>%
# remove trailing underscores
mutate(mo = gsub("_+$", "",
toupper(paste(substr(kingdom, 1, 1),
toupper(paste(ifelse(kingdom == "Animalia",
"AN",
ifelse(kingdom == "Plantae",
"PL",
substr(kingdom, 1, 1))),
abbr_genus,
abbr_species,
abbr_subspecies,
@ -152,14 +172,11 @@ MOs <- MOs %>%
paste0(mo, "1"),
mo),
fullname = ifelse(fullname == "",
trimws(paste(genus, species, subspecies),
fullname))) %>%
trimws(paste(genus, species, subspecies)),
fullname)) %>%
select(mo, everything(), -abbr_genus, -abbr_species, -abbr_subspecies)
# everything distinct?
sum(duplicated(MOs$mo))
# add non-taxonomic entries
MOs <- MOs %>%
bind_rows(
@ -273,6 +290,10 @@ MOs <- MOs %>%
stringsAsFactors = FALSE)
)
# everything distinct?
sum(duplicated(MOs$mo))
# save it
MOs <- as.data.frame(MOs %>% arrange(mo), stringsAsFactors = FALSE)
MOs.old <- as.data.frame(MOs.old, stringsAsFactors = FALSE)
@ -282,5 +303,7 @@ saveRDS(MOs, "microorganisms.rds")
saveRDS(MOs.old, "microorganisms.old.rds")
# on the server:
# usethis::use_data(microorganisms, overwrite = TRUE)
# usethis::use_data(microorganisms.old, overwrite = TRUE)
usethis::use_data(microorganisms, overwrite = TRUE)
usethis::use_data(microorganisms.old, overwrite = TRUE)
rm(microorganisms)
rm(microorganisms.old)

View File

@ -193,11 +193,7 @@ test_that("as.mo works", {
# check old names
expect_equal(suppressMessages(as.character(as.mo("Escherichia blattae"))), "B_SHMWL_BLA")
# # - Didymosphaeria spartinae (unprevalent)
# expect_warning(suppressMessages(as.mo("D spartin", allow_uncertain = TRUE)))
# # - was renamed to Leptosphaeria obiones
# expect_equal(suppressWarnings(suppressMessages(as.character(as.mo("D spartin", allow_uncertain = TRUE)))),
# "F_LPTSP_OBI")
print(mo_renamed())
# check uncertain names
expect_equal(suppressWarnings(as.character(as.mo("esco extra_text", allow_uncertain = FALSE))), NA_character_)
@ -234,6 +230,7 @@ test_that("as.mo works", {
"Streptococcus suis (bovis gr)",
"Raoultella (here some text) terrigena")))),
c("B_MCRBC", "B_STRPT_SUI", "B_RLTLL_TER"))
print(mo_uncertainties())
# Salmonella (City) are all actually Salmonella enterica spp (City)
expect_equal(as.character(suppressMessages(as.mo("Salmonella Goettingen"))),

View File

@ -315,7 +315,7 @@ data_1st %>%
## Resistance percentages
The functions `portion_R`, `portion_RI`, `portion_I`, `portion_IS` and `portion_S` can be used to determine the portion of a specific antimicrobial outcome. They can be used on their own:
The functions `portion_R()`, `portion_RI()`, `portion_I()`, `portion_IS()` and `portion_S()` can be used to determine the portion of a specific antimicrobial outcome. They can be used on their own:
```{r}
data_1st %>% portion_IR(amox)
@ -351,21 +351,21 @@ data_1st %>%
knitr::kable(align = "c", big.mark = ",")
```
These functions can also be used to get the portion of multiple antibiotics, to calculate co-resistance very easily:
These functions can also be used to get the portion of multiple antibiotics, to calculate empiric susceptibility of combination therapies very easily:
```{r, eval = FALSE}
data_1st %>%
group_by(genus) %>%
summarise(amoxicillin = portion_S(amcl),
summarise(amoxiclav = portion_S(amcl),
gentamicin = portion_S(gent),
"amox + gent" = portion_S(amcl, gent))
amoxiclav_genta = portion_S(amcl, gent))
```
```{r, echo = FALSE}
data_1st %>%
group_by(genus) %>%
summarise(amoxicillin = portion_S(amcl),
summarise(amoxiclav = portion_S(amcl),
gentamicin = portion_S(gent),
"amox + gent" = portion_S(amcl, gent)) %>%
amoxiclav_genta = portion_S(amcl, gent)) %>%
knitr::kable(align = "c", big.mark = ",")
```
@ -374,9 +374,9 @@ To make a transition to the next part, let's see how this difference could be pl
```{r plot 1}
data_1st %>%
group_by(genus) %>%
summarise("1. Amoxicillin" = portion_S(amcl),
summarise("1. Amoxi/clav" = portion_S(amcl),
"2. Gentamicin" = portion_S(gent),
"3. Amox + gent" = portion_S(amcl, gent)) %>%
"3. Amoxi/clav + gent" = portion_S(amcl, gent)) %>%
tidyr::gather("Antibiotic", "S", -genus) %>%
ggplot(aes(x = genus,
y = S,
@ -397,9 +397,9 @@ ggplot(data = a_data_set,
x = "My X axis",
y = "My Y axis")
ggplot(a_data_set,
aes(year, value) +
geom_bar()
# or as short as:
ggplot(a_data_set) +
geom_bar(aes(year))
```
The `AMR` package contains functions to extend this `ggplot2` package, for example `geom_rsi()`. It automatically transforms data with `count_df()` or `portion_df()` and show results in stacked bars. Its simplest and shortest example:

View File

@ -38,17 +38,17 @@ As said, SPSS is easier to learn than R. But SPSS, SAS and Stata come with major
* **R is extremely flexible.**
Because you write the syntax yourself, you can do anything you want. The flexibility in transforming, gathering, grouping, summarising and drawing plots is endless - with SPSS, SAS or Stata you are bound to their algorithms and styles. It may be a bit flexible, but you can never create that very specific publication-ready plot without using other (paid) software.
Because you write the syntax yourself, you can do anything you want. The flexibility in transforming, gathering, grouping, summarising and drawing plots is endless - with SPSS, SAS or Stata you are bound to their algorithms and styles. They may be a bit flexible, but you can probably never create that very specific publication-ready plot without using other (paid) software.
* **R can be easily automated.**
Over the last years, [R Markdown](https://rmarkdown.rstudio.com/) has really made an interesting development. With R Markdown, you can very easily reproduce your reports, whether it's to Word, Powerpoint, a website, a PDF document or just the raw data to Excel. I use this a lot to generate monthly reports automatically. Just write the code once and enjoy the automatically updated reports at any interval you like.
For an even more professional environment, you could create [Shiny apps](https://shiny.rstudio.com/): live manipulation of data using a custom made website. The webdesign knowledge needed (Javascript, CSS, HTML) is almost *zero*.
For an even more professional environment, you could create [Shiny apps](https://shiny.rstudio.com/): live manipulation of data using a custom made website. The webdesign knowledge needed (JavaScript, CSS, HTML) is almost *zero*.
* **R has a huge community.**
Many R users just ask questions on website like [stackoverflow.com](https://stackoverflow.com), the largest online community for programmers. At the time of writing, around [275,000 R questions](https://stackoverflow.com/questions/tagged/r?sort=votes) have been asked on this platform (which covers questions and answer for any programming language). In my own experience, most questions are answered within a couple of minutes.
Many R users just ask questions on websites like [StackOverflow.com](https://stackoverflow.com), the largest online community for programmers. At the time of writing, more than [275,000 R-related questions](https://stackoverflow.com/questions/tagged/r?sort=votes) have already been asked on this platform (which covers questions and answers for any programming language). In my own experience, most questions are answered within a couple of minutes.
* **R understands any data type, including SPSS/SAS/Stata.**

View File

@ -89,7 +89,7 @@ Uncommon microorganisms take a lot more time than common microorganisms. To reli
### 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) which uses `as.mo()` internally.
Repetitive results are unique values that 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, message = FALSE}
library(dplyr)