diff --git a/DESCRIPTION b/DESCRIPTION index 4784b50f..a0092870 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.5.0.9011 -Date: 2019-01-21 +Version: 0.5.0.9012 +Date: 2019-01-25 Title: Antimicrobial Resistance Analysis Authors@R: c( person( diff --git a/NEWS.md b/NEWS.md index fe9f3c73..50dcadd1 100755 --- a/NEWS.md +++ b/NEWS.md @@ -35,6 +35,8 @@ * New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the *G*-test and more. These are also available (and even easier readable) on our website: https://msberends.gitlab.io/AMR. #### Changed +* Added 65 antibiotics to the `antibiotics` data set, from the [Pharmaceuticals Community Register](http://ec.europa.eu/health/documents/community-register/html/atc.htm) of the European Commission +* Removed columns `atc_group1_nl` and `atc_group2_nl` from the `antibiotics` data set * Function `eucast_rules()`: * Updated EUCAST Clinical breakpoints to [version 9.0 of 1 January 2019](http://www.eucast.org/clinical_breakpoints/) * Fixed a critical bug where some rules that depend on previous applied rules would not be applied adequately @@ -49,6 +51,7 @@ * Manual now contains more info about the algorithms * Progress bar will be shown when it takes more than 3 seconds to get results * Support for formatted console text + * Console will return the percentage of uncoercable input * Function `first_isolate()`: * Fixed a bug where distances between dates would not be calculated right - in the `septic_patients` data set this yielded a difference of 0.15% more isolates * Will now use a column named like "patid" for the patient ID (parameter `col_patientid`), when this parameter was left blank diff --git a/R/abname.R b/R/abname.R index ff868239..a561ae68 100755 --- a/R/abname.R +++ b/R/abname.R @@ -29,6 +29,7 @@ #' @details \strong{The \code{\link{ab_property}} functions are faster and more concise}, but do not support concatenated strings, like \code{abname("AMCL+GENT"}. #' @keywords ab antibiotics #' @source \code{\link{antibiotics}} +#' @inheritSection WHOCC WHOCC #' @export #' @importFrom dplyr %>% pull #' @inheritSection AMR Read more on our website! diff --git a/R/age.R b/R/age.R index 265b1c9e..421f9626 100755 --- a/R/age.R +++ b/R/age.R @@ -29,6 +29,9 @@ #' @importFrom dplyr if_else #' @inheritSection AMR Read more on our website! #' @export +#' @examples +#' df <- data.frame(birth_date = Sys.Date() - runif(100) * 25000) +#' df$age <- age(df$birth_date) age <- function(x, reference = Sys.Date()) { if (length(x) != length(reference)) { if (length(reference) == 1) { @@ -39,17 +42,21 @@ age <- function(x, reference = Sys.Date()) { } x <- base::as.POSIXlt(x) reference <- base::as.POSIXlt(reference) - if (any(reference < x)) { - stop("`reference` cannot be lower (older) than `x`.") - } - years_gap <- reference$year - x$year + # from https://stackoverflow.com/a/25450756/4575331 + years_gap <- reference$year - x$year ages <- if_else(reference$mon < x$mon | (reference$mon == x$mon & reference$mday < x$mday), as.integer(years_gap - 1), as.integer(years_gap)) - if (any(ages > 120)) { + + if (any(ages < 0, na.rm = TRUE)) { + warning("NAs introduced for ages below 0.") + ages[ages < 0] <- NA_integer_ + } + if (any(ages > 120, na.rm = TRUE)) { warning("Some ages are > 120.") } + ages } diff --git a/R/atc.R b/R/atc.R index 672b5226..23cd1d1d 100755 --- a/R/atc.R +++ b/R/atc.R @@ -26,6 +26,7 @@ #' @rdname as.atc #' @aliases atc #' @keywords atc +#' @inheritSection WHOCC WHOCC #' @export #' @importFrom dplyr %>% filter slice pull #' @details Use the \code{\link{ab_property}} functions to get properties based on the returned ATC code, see Examples. diff --git a/R/data.R b/R/data.R index 2b2838f6..3793064e 100755 --- a/R/data.R +++ b/R/data.R @@ -19,10 +19,10 @@ # Visit our website for more info: https://msberends.gitab.io/AMR. # # ==================================================================== # -#' Data set with 423 antibiotics +#' Data set with ~500 antibiotics #' #' A data set containing all antibiotics with a J0 code and some other antimicrobial agents, with their DDDs. Except for trade names and abbreviations, all properties were downloaded from the WHO, see Source. -#' @format A \code{\link{data.frame}} with 423 observations and 18 variables: +#' @format A \code{\link{data.frame}} with 488 observations and 16 variables: #' \describe{ #' \item{\code{atc}}{ATC code, like \code{J01CR02}} #' \item{\code{certe}}{Certe code, like \code{amcl}} @@ -38,12 +38,14 @@ #' \item{\code{iv_units}}{Units of \code{iv_ddd}} #' \item{\code{atc_group1}}{ATC group, like \code{"Macrolides, lincosamides and streptogramins"}} #' \item{\code{atc_group2}}{Subgroup of \code{atc_group1}, like \code{"Macrolides"}} -#' \item{\code{atc_group1_nl}}{ATC group in Dutch, like \code{"Macroliden, lincosamiden en streptograminen"}} -#' \item{\code{atc_group2_nl}}{Subgroup of \code{atc_group1} in Dutch, like \code{"Macroliden"}} #' \item{\code{useful_gramnegative}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)} #' \item{\code{useful_grampositive}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)} #' } -#' @source - World Health Organization: \url{https://www.whocc.no/atc_ddd_index/} \cr - EUCAST - Expert rules intrinsic exceptional V3.1 \cr - MOLIS (LIS of Certe): \url{https://www.certe.nl} \cr - GLIMS (LIS of UMCG): \url{https://www.umcg.nl} +#' @source - World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/} +#' +#' EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016: \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf} +#' +#' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm} #' @inheritSection AMR Read more on our website! #' @seealso \code{\link{microorganisms}} # use this later to further fill AMR::antibiotics @@ -124,9 +126,9 @@ # "antibiotics" -#' Data set with taxonomic data from ITIS +#' Data set with ~20,000 microorganisms #' -#' A data set containing the complete microbial taxonomy of the kingdoms Bacteria, Fungi and Protozoa. MO codes can be looked up using \code{\link{as.mo}}. +#' A data set containing the complete microbial taxonomy of the kingdoms Bacteria, Fungi and Protozoa from ITIS. MO codes can be looked up using \code{\link{as.mo}}. #' @inheritSection ITIS ITIS #' @format A \code{\link{data.frame}} with 18,833 observations and 15 variables: #' \describe{ @@ -146,12 +148,12 @@ #' \item{\code{prevalence}}{An integer based on estimated prevalence of the microorganism in humans. Used internally by \code{\link{as.mo}}, otherwise quite meaningless. It has a value of 25 for manually added items and a value of 1000 for all unprevalent microorganisms whose genus was somewhere in the top 250 (with another species).} #' \item{\code{ref}}{Author(s) and year of concerning publication as found in ITIS, see Source} #' } -#' @source [3] Integrated Taxonomic Information System (ITIS) on-line database, \url{https://www.itis.gov}. +#' @source Integrated Taxonomic Information System (ITIS) public online database, \url{https://www.itis.gov}. #' @inheritSection AMR Read more on our website! #' @seealso \code{\link{as.mo}} \code{\link{mo_property}} \code{\link{microorganisms.codes}} "microorganisms" -#' Data set with old taxonomic data from ITIS +#' Data set with previously accepted taxonomic names #' #' A data set containing old (previously valid or accepted) taxonomic names according to ITIS. This data set is used internally by \code{\link{as.mo}}. #' @inheritSection as.mo ITIS @@ -179,7 +181,7 @@ #' @seealso \code{\link{as.mo}} \code{\link{microorganisms}} "microorganisms.codes" -#' Data set with 2000 blood culture isolates of septic patients +#' Data set with 2,000 blood culture isolates from septic patients #' #' An anonymised data set containing 2,000 microbial blood culture isolates with their full antibiograms found in septic patients in 4 different hospitals in the Netherlands, between 2001 and 2017. It is true, genuine data. This \code{data.frame} can be used to practice AMR analysis. For examples, please read \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{the tutorial on our website}. #' @format A \code{\link{data.frame}} with 2,000 observations and 49 variables: diff --git a/R/eucast_rules.R b/R/eucast_rules.R index 459db3cf..059c1604 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -222,7 +222,7 @@ eucast_rules <- function(tbl, trsu = guess_ab_col(), vanc = guess_ab_col()) { - EUCAST_VERSION_BREAKPOINTS <- "8.1, 2018" + EUCAST_VERSION_BREAKPOINTS <- "9.0, 2019" EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016" if (!is.data.frame(tbl)) { diff --git a/R/itis.R b/R/itis.R index f1e74752..d8f189cd 100755 --- a/R/itis.R +++ b/R/itis.R @@ -23,10 +23,10 @@ #' #' All taxonomic names of all microorganisms are included in this package, using the authoritative Integrated Taxonomic Information System (ITIS). #' @section ITIS: -#' \if{html}{\figure{itis_logo.jpg}{options: height=60px style=margin-bottom:5px} \cr} +#' \if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr} #' This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}). #' -#' All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. +#' All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. #' #' ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3]. #' @inheritSection AMR Read more on our website! diff --git a/R/mo.R b/R/mo.R index e38004a3..22d78454 100755 --- a/R/mo.R +++ b/R/mo.R @@ -707,7 +707,11 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, if (n_distinct(failures) > 1) { plural <- "s" } - msg <- paste0("\n", n_distinct(failures), " unique value", plural, " could not be coerced to a valid MO code") + total_failures <- length(x_input[x_input %in% failures & !x_input %in% c(NA, NULL, NaN)]) + total_n <- length(x_input[!x_input %in% c(NA, NULL, NaN)]) + msg <- paste0("\n", n_distinct(failures), " unique value", plural, + " (^= ", percent(total_failures / total_n, round = 1, force_zero = TRUE), + ") could not be coerced to a valid MO code") if (n_distinct(failures) <= 10) { msg <- paste0(msg, ": ", paste('"', unique(failures), '"', sep = "", collapse = ', ')) } diff --git a/R/read.4d.R b/R/read.4d.R index c7b792ec..d6f7bb4e 100755 --- a/R/read.4d.R +++ b/R/read.4d.R @@ -124,7 +124,6 @@ read.4D <- function(file, } if ("date_birth" %in% colnames(data_4D)) { data_4D$date_birth <- to_date_4D(data_4D$date_birth) - } if ("date_received" %in% colnames(data_4D)) { data_4D$date_received <- to_date_4D(data_4D$date_received) diff --git a/R/whocc.R b/R/whocc.R new file mode 100755 index 00000000..96200cd9 --- /dev/null +++ b/R/whocc.R @@ -0,0 +1,40 @@ +# ==================================================================== # +# TITLE # +# Antimicrobial Resistance (AMR) Analysis # +# # +# SOURCE # +# https://gitlab.com/msberends/AMR # +# # +# LICENCE # +# (c) 2019 Berends MS (m.s.berends@umcg.nl), Luz CF (c.f.luz@umcg.nl) # +# # +# This R package is free software; you can freely use and distribute # +# it for both personal and commercial purposes under the terms of the # +# GNU General Public License version 2.0 (GNU GPL-2), as published by # +# the Free Software Foundation. # +# # +# This R package was created for academic research and was publicly # +# released in the hope that it will be useful, but it comes WITHOUT # +# ANY WARRANTY OR LIABILITY. # +# Visit our website for more info: https://msberends.gitab.io/AMR. # +# ==================================================================== # + +#' WHO Collaborating Centre for Drug Statistics Methodology +#' +#' All antimicrobial drugs and their official names, ATC codes, ATC groups and defined daily dose (DDD) are included in this package, using the WHO Collaborating Centre for Drug Statistics Methodology. +#' @section WHOCC: +#' \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} +#' This package contains \strong{all ~500 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD)} from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). +#' +#' These have become the gold standard for international drug utilisation monitoring and research. +#' +#' The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. +#' @inheritSection AMR Read more on our website! +#' @name WHOCC +#' @rdname WHOCC +#' @examples +#' as.atc("meropenem") +#' ab_name("J01DH02") +#' +#' ab_tradenames("flucloxacillin") +NULL diff --git a/_pkgdown.yml b/_pkgdown.yml index db7d835f..8c169cd7 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -81,6 +81,7 @@ reference: contents: - '`AMR`' - '`ITIS`' + - '`WHOCC`' - title: 'Cleaning your data' desc: > Functions for cleaning and optimising your data, to be able to add diff --git a/data/antibiotics.rda b/data/antibiotics.rda index ce7b7d6b..f5015913 100755 Binary files a/data/antibiotics.rda and b/data/antibiotics.rda differ diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index a2bbd152..a3db6251 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012 diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index 79ab6ab5..2929e674 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -178,7 +178,7 @@

How to conduct AMR analysis

Matthijs S. Berends

-

12 January 2019

+

25 January 2019

@@ -187,7 +187,7 @@ -

Note: values on this page will change with every website update since they are based on randomly created values and the page was written in RMarkdown. However, the methodology remains unchanged. This page was generated on 12 January 2019.

+

Note: values on this page will change with every website update since they are based on randomly created values and the page was written in RMarkdown. However, the methodology remains unchanged. This page was generated on 25 January 2019.

Introduction

@@ -203,21 +203,21 @@ -2019-01-12 +2019-01-25 abcd Escherichia coli S S -2019-01-12 +2019-01-25 abcd Escherichia coli S R -2019-01-12 +2019-01-25 efgh Escherichia coli R @@ -231,9 +231,9 @@ Needed R packages

As with many uses in R, we need some additional packages for AMR analysis. The most important one is dplyr, which tremendously improves the way we work with data - it allows for a very natural way of writing syntaxes in R. Another important dependency is ggplot2. This package can be used to create beautiful plots in R.

Our AMR package depends on these packages and even extends their use and functions.

-
library(dplyr)   # the data science package
-library(AMR)     # this package, to simplify and automate AMR analysis
-library(ggplot2) # for appealing plots
+
library(dplyr)   # the data science package
+library(AMR)     # this package, to simplify and automate AMR analysis
+library(ggplot2) # for appealing plots

@@ -244,51 +244,51 @@

Patients

To start with patients, we need a unique list of patients.

-
patients <- unlist(lapply(LETTERS, paste0, 1:10))
+
patients <- unlist(lapply(LETTERS, paste0, 1:10))

The LETTERS object is available in R - it’s a vector with 26 characters: A to Z. The patients object we just created is now a vector of length 260, with values (patient IDs) varying from A1 to Z10. Now we we also set the gender of our patients, by putting the ID and the gender in a table:

-
patients_table <- data.frame(patient_id = patients,
-                             gender = c(rep("M", 135),
-                                        rep("F", 125)))
+
patients_table <- data.frame(patient_id = patients,
+                             gender = c(rep("M", 135),
+                                        rep("F", 125)))

The first 135 patient IDs are now male, the other 125 are female.

Dates

Let’s pretend that our data consists of blood cultures isolates from 1 January 2010 until 1 January 2018.

-
dates <- seq(as.Date("2010-01-01"), as.Date("2018-01-01"), by = "day")
+
dates <- seq(as.Date("2010-01-01"), as.Date("2018-01-01"), by = "day")

This dates object now contains all days in our date range.

Microorganisms

For this tutorial, we will uses four different microorganisms: Escherichia coli, Staphylococcus aureus, Streptococcus pneumoniae, and Klebsiella pneumoniae:

-
bacteria <- c("Escherichia coli", "Staphylococcus aureus",
-              "Streptococcus pneumoniae", "Klebsiella pneumoniae")
+
bacteria <- c("Escherichia coli", "Staphylococcus aureus",
+              "Streptococcus pneumoniae", "Klebsiella pneumoniae")

Other variables

For completeness, we can also add the hospital where the patients was admitted and we need to define valid antibmicrobial results for our randomisation:

-
hospitals <- c("Hospital A", "Hospital B", "Hospital C", "Hospital D")
-ab_interpretations <- c("S", "I", "R")
+
hospitals <- c("Hospital A", "Hospital B", "Hospital C", "Hospital D")
+ab_interpretations <- c("S", "I", "R")

Put everything together

-

Using the sample() function, we can randomly select items from all objects we defined earlier. To let our fake data reflect reality a bit, we will also approximately define the probabilities of bacteria and the antibiotic results with the prob parameter.

-
data <- data.frame(date = sample(dates, 5000, replace = TRUE),
-                   patient_id = sample(patients, 5000, replace = TRUE),
-                   hospital = sample(hospitals, 5000, replace = TRUE, prob = c(0.30, 0.35, 0.15, 0.20)),
-                   bacteria = sample(bacteria, 5000, replace = TRUE, prob = c(0.50, 0.25, 0.15, 0.10)),
-                   amox = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.60, 0.05, 0.35)),
-                   amcl = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.75, 0.10, 0.15)),
-                   cipr = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.80, 0.00, 0.20)),
-                   gent = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.92, 0.00, 0.08))
-                   )
-

Using the left_join() function from the dplyr package, we can ‘map’ the gender to the patient ID using the patients_table object we created earlier:

-
data <- data %>% left_join(patients_table)
+

Using the sample() function, we can randomly select items from all objects we defined earlier. To let our fake data reflect reality a bit, we will also approximately define the probabilities of bacteria and the antibiotic results with the prob parameter.

+
data <- data.frame(date = sample(dates, 5000, replace = TRUE),
+                   patient_id = sample(patients, 5000, replace = TRUE),
+                   hospital = sample(hospitals, 5000, replace = TRUE, prob = c(0.30, 0.35, 0.15, 0.20)),
+                   bacteria = sample(bacteria, 5000, replace = TRUE, prob = c(0.50, 0.25, 0.15, 0.10)),
+                   amox = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.60, 0.05, 0.35)),
+                   amcl = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.75, 0.10, 0.15)),
+                   cipr = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.80, 0.00, 0.20)),
+                   gent = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.92, 0.00, 0.08))
+                   )
+

Using the left_join() function from the dplyr package, we can ‘map’ the gender to the patient ID using the patients_table object we created earlier:

+
data <- data %>% left_join(patients_table)

The resulting data set contains 5,000 blood culture isolates. With the head() function we can preview the first 6 values of this data set:

-
head(data)
+
head(data)
@@ -303,8 +303,63 @@ ab_interpretations <- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -313,61 +368,6 @@ ab_interpretations <- S - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
date2013-07-182013-03-25O5Hospital BStreptococcus pneumoniaeSSRSF
2014-05-07W10Hospital AKlebsiella pneumoniaeRSSSF
2014-08-13L5Hospital DEscherichia coliSSSSM
2014-07-10Z2Hospital DEscherichia coliRSSSF
2014-09-18 Z9Hospital DStaphylococcus aureusSSSSF
2015-04-27Q3 Hospital C Escherichia coli SF
2010-02-24P1Hospital DEscherichia coliRSSSF
2014-04-02A10Hospital BStreptococcus pneumoniaeSSSSM
2016-05-30A7Hospital BEscherichia coliRRRSM
2017-11-22O6Hospital DKlebsiella pneumoniaeRISSF
2017-03-08L4Hospital BEscherichia coliRRSSM

Now, let’s start the cleaning and the analysis!

@@ -377,7 +377,7 @@ ab_interpretations <-
Cleaning the data

Use the frequency table function freq() to look specifically for unique values in any variable. For example, for the gender variable:

-
data %>% freq(gender) # this would be the same: freq(data$gender)
+
data %>% freq(gender) # this would be the same: freq(data$gender)
# Frequency table of `gender` 
 # Class:   factor (numeric)  
 # Levels:  F, M  
@@ -386,67 +386,67 @@ ab_interpretations <- mutate() function of the dplyr package makes this really easy:

-
data <- data %>%
-  mutate(bacteria = as.mo(bacteria))
-

We also want to transform the antibiotics, because in real life data we don’t know if they are really clean. The as.rsi() function ensures reliability and reproducibility in these kind of variables. The mutate_at() will run the as.rsi() function on defined variables:

-
data <- data %>%
-  mutate_at(vars(amox:gent), as.rsi)
+

The data is already quite clean, but we still need to transform some variables. The bacteria 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 mutate() function of the dplyr package makes this really easy:

+
data <- data %>%
+  mutate(bacteria = as.mo(bacteria))
+

We also want to transform the antibiotics, because in real life data we don’t know if they are really clean. The as.rsi() function ensures reliability and reproducibility in these kind of variables. The mutate_at() will run the as.rsi() function on defined variables:

+
data <- data %>%
+  mutate_at(vars(amox:gent), as.rsi)

Finally, we will apply EUCAST rules on our antimicrobial results. In Europe, most medical microbiological laboratories already apply these rules. Our package features their latest insights on intrinsic resistance and exceptional phenotypes. Moreover, the eucast_rules() function can also apply additional rules, like forcing ampicillin = R when amoxicillin/clavulanic acid = R.

Because the amoxicillin (column amox) and amoxicillin/clavulanic acid (column amcl) in our data were generated randomly, some rows will undoubtedly contain amox = S and amcl = R, which is technically impossible. The eucast_rules() fixes this:

-
data <- eucast_rules(data, col_mo = "bacteria")
-# 
-# Rules by the European Committee on Antimicrobial Susceptibility Testing (EUCAST)
-# 
-# EUCAST Clinical Breakpoints (v8.1, 2018)
-# Enterobacteriales (Order) (no changes)
-# Staphylococcus (no changes)
-# Enterococcus (no changes)
-# Streptococcus groups A, B, C, G (no changes)
-# Streptococcus pneumoniae (no changes)
-# Viridans group streptococci (no changes)
-# Haemophilus influenzae (no changes)
-# Moraxella catarrhalis (no changes)
-# Anaerobic Gram positives (no changes)
-# Anaerobic Gram negatives (no changes)
-# Pasteurella multocida (no changes)
-# Campylobacter jejuni and C. coli (no changes)
-# Aerococcus sanguinicola and A. urinae (no changes)
-# Kingella kingae (no changes)
-# 
-# EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)
-# Table 1:  Intrinsic resistance in Enterobacteriaceae (307 changes)
-# Table 2:  Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)
-# Table 3:  Intrinsic resistance in other Gram-negative bacteria (no changes)
-# Table 4:  Intrinsic resistance in Gram-positive bacteria (708 changes)
-# Table 8:  Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)
-# Table 9:  Interpretive rules for B-lactam agents and Gram-negative rods (no changes)
-# Table 10: Interpretive rules for B-lactam agents and other Gram-negative bacteria (no changes)
-# Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)
-# Table 12: Interpretive rules for aminoglycosides (no changes)
-# Table 13: Interpretive rules for quinolones (no changes)
-# 
-# Other rules
-# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (no changes)
-# Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no changes)
-# Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no changes)
-# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (no changes)
-# Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)
-# Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)
-# 
-# => EUCAST rules affected 1,871 out of 5,000 rows -> changed 1,015 test results.
+
data <- eucast_rules(data, col_mo = "bacteria")
+# 
+# Rules by the European Committee on Antimicrobial Susceptibility Testing (EUCAST)
+# 
+# EUCAST Clinical Breakpoints (v9.0, 2019)
+# Enterobacteriales (Order) (no changes)
+# Staphylococcus (no changes)
+# Enterococcus (no changes)
+# Streptococcus groups A, B, C, G (no changes)
+# Streptococcus pneumoniae (no changes)
+# Viridans group streptococci (no changes)
+# Haemophilus influenzae (no changes)
+# Moraxella catarrhalis (no changes)
+# Anaerobic Gram positives (no changes)
+# Anaerobic Gram negatives (no changes)
+# Pasteurella multocida (no changes)
+# Campylobacter jejuni and C. coli (no changes)
+# Aerococcus sanguinicola and A. urinae (no changes)
+# Kingella kingae (no changes)
+# 
+# EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)
+# Table 1:  Intrinsic resistance in Enterobacteriaceae (324 changes)
+# Table 2:  Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)
+# Table 3:  Intrinsic resistance in other Gram-negative bacteria (no changes)
+# Table 4:  Intrinsic resistance in Gram-positive bacteria (672 changes)
+# Table 8:  Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)
+# Table 9:  Interpretive rules for B-lactam agents and Gram-negative rods (no changes)
+# Table 10: Interpretive rules for B-lactam agents and other Gram-negative bacteria (no changes)
+# Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)
+# Table 12: Interpretive rules for aminoglycosides (no changes)
+# Table 13: Interpretive rules for quinolones (no changes)
+# 
+# Other rules
+# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (no changes)
+# Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no changes)
+# Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no changes)
+# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (no changes)
+# Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)
+# Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)
+# 
+# => EUCAST rules affected 1,808 out of 5,000 rows -> changed 996 test results.

Adding new variables

Now that we have the microbial ID, we can add some taxonomic properties:

-
data <- data %>% 
-  mutate(gramstain = mo_gramstain(bacteria),
-         genus = mo_genus(bacteria),
-         species = mo_species(bacteria))
+
data <- data %>% 
+  mutate(gramstain = mo_gramstain(bacteria),
+         genus = mo_genus(bacteria),
+         species = mo_species(bacteria))

First isolates

@@ -457,18 +457,18 @@ ab_interpretations <- M39-A4 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition. CLSI, 2014. Chapter 6.4

This AMR package includes this methodology with the first_isolate() function. It adopts the episode of a year (can be changed by user) and it starts counting days after every selected isolate. This new variable can easily be added to our data:

-
data <- data %>% 
-  mutate(first = first_isolate(.))
-# NOTE: Using column `bacteria` as input for `col_mo`.
-# NOTE: Using column `date` as input for `col_date`.
-# NOTE: Using column `patient_id` as input for `col_patient_id`.
-# => Found 2,951 first isolates (59.0% of total)
-

So only 59% is suitable for resistance analysis! We can now filter on is with the filter() function, also from the dplyr package:

-
data_1st <- data %>% 
-  filter(first == TRUE)
+ +

So only 58.6% is suitable for resistance analysis! We can now filter on is with the filter() function, also from the dplyr package:

+

For future use, the above two syntaxes can be shortened with the filter_first_isolate() function:

-
data_1st <- data %>% 
-  filter_first_isolate()
+

@@ -489,8 +489,8 @@ ab_interpretations <- 1 -2010-03-01 -Y4 +2010-03-08 +V6 B_ESCHR_COL S S @@ -500,30 +500,30 @@ ab_interpretations <- 2 -2010-11-02 -Y4 +2011-02-03 +V6 B_ESCHR_COL +R S S -S -S +R FALSE 3 -2011-06-12 -Y4 +2011-12-31 +V6 B_ESCHR_COL -R S -R +I +S S TRUE 4 -2011-09-03 -Y4 +2012-10-20 +V6 B_ESCHR_COL S S @@ -533,21 +533,21 @@ ab_interpretations <- 5 -2011-09-07 -Y4 +2012-12-17 +V6 B_ESCHR_COL S S -R +S S FALSE 6 -2012-06-11 -Y4 +2013-08-27 +V6 B_ESCHR_COL -S +R S S S @@ -555,64 +555,62 @@ ab_interpretations <- 7 -2012-08-16 -Y4 +2013-09-21 +V6 B_ESCHR_COL +I S S -S -S +R FALSE 8 -2012-11-24 -Y4 +2014-07-19 +V6 B_ESCHR_COL S -I S -R +S +S FALSE 9 -2012-12-12 -Y4 +2014-07-24 +V6 B_ESCHR_COL -S -S -S R +S +S +S FALSE 10 -2013-02-02 -Y4 +2014-11-23 +V6 B_ESCHR_COL -R S S S -FALSE +S +TRUE -

Only 3 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and show be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics() function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.

+

Only 4 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and show be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics() function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.

If a column exists with a name like ‘key(…)ab’ the first_isolate() function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:

-
data <- data %>% 
-  mutate(keyab = key_antibiotics(.)) %>% 
-  mutate(first_weighted = first_isolate(.))
-# NOTE: Using column `bacteria` as input for `col_mo`.
-#   amox   amcl   cipr   gent 
-# "amox" "amcl" "cipr" "gent"
-# NOTE: Using column `bacteria` as input for `col_mo`.
-# NOTE: Using column `date` as input for `col_date`.
-# NOTE: Using column `patient_id` as input for `col_patient_id`.
-# NOTE: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.
-# [Criterion] Inclusion based on key antibiotics, ignoring I.
-# => Found 4,431 first weighted isolates (88.6% of total)
+ @@ -629,8 +627,8 @@ ab_interpretations <- - - + + @@ -641,58 +639,58 @@ ab_interpretations <- - - + + + - - - + + - - + + - - + + - - + + - + - - + + - + - + - - + + - + @@ -701,44 +699,32 @@ ab_interpretations <- - - + + + - - - + + - - + + - - + + - - - - - - - - - - - - - - + + @@ -747,21 +733,32 @@ ab_interpretations <- FALSE + + + + + + + + + + + +
isolate12010-03-01Y42010-03-08V6 B_ESCHR_COL S S22010-11-02Y42011-02-03V6 B_ESCHR_COLR S SSSFALSER FALSETRUE
32011-06-12Y42011-12-31V6 B_ESCHR_COLR SRIS S TRUE TRUE
42011-09-03Y42012-10-20V6 B_ESCHR_COL S S S S FALSETRUEFALSE
52011-09-07Y42012-12-17V6 B_ESCHR_COL S SRS S FALSETRUEFALSE
62012-06-11Y42013-08-27V6 B_ESCHR_COLSR S S S72012-08-16Y42013-09-21V6 B_ESCHR_COLI S SSSFALSER FALSETRUE
82012-11-24Y42014-07-19V6 B_ESCHR_COL SI SRSS FALSE TRUE
92012-12-12Y4B_ESCHR_COLSSSRFALSEFALSE
102013-02-02Y42014-07-24V6 B_ESCHR_COL R STRUE
102014-11-23V6B_ESCHR_COLSSSSTRUETRUE
-

Instead of 3, now 7 isolates are flagged. In total, 88.6% of all isolates are marked ‘first weighted’ - 147.6% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

+

Instead of 4, now 8 isolates are flagged. In total, 88.4% of all isolates are marked ‘first weighted’ - 147% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

As with filter_first_isolate(), there’s a shortcut for this new algorithm too:

-
data_1st <- data %>% 
-  filter_first_weighted_isolate()
-

So we end up with 4,431 isolates for analysis.

+ +

So we end up with 4,422 isolates for analysis.

We can remove unneeded columns:

-
data_1st <- data_1st %>% 
-  select(-c(first, keyab))
+

Now our data looks like:

-
head(data_1st)
+
head(data_1st)
- @@ -778,25 +775,53 @@ ab_interpretations <- - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + @@ -810,58 +835,9 @@ ab_interpretations <- TRUE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -873,6 +849,21 @@ ab_interpretations <- aureus + + + + + + + + + + + + + + +
date patient_id hospital12013-07-18Z9Hospital C2013-03-25O5Hospital BB_STRPTC_PNESSRRFGram positiveStreptococcuspneumoniaeTRUE
2014-05-07W10Hospital AB_KLBSL_PNERSSSFGram negativeKlebsiellapneumoniaeTRUE
2014-08-13L5Hospital D B_ESCHR_COL S S S SFM Gram negative Escherichia coli TRUE
22010-02-24P12014-07-10Z2 Hospital D B_ESCHR_COL R
32014-04-02A10Hospital BB_STRPTC_PNESSSRMGram positiveStreptococcuspneumoniaeTRUE
42016-05-30A7Hospital BB_ESCHR_COLRRRSMGram negativeEscherichiacoliTRUE
62017-03-08L4Hospital BB_ESCHR_COLRRSSMGram negativeEscherichiacoliTRUE
72014-06-24O7Hospital B2014-09-18Z9Hospital D B_STPHY_AUR S STRUE
2015-04-27Q3Hospital CB_ESCHR_COLSSSSFGram negativeEscherichiacoliTRUE

Time for the analysis!

@@ -883,12 +874,12 @@ ab_interpretations <-
Analysing the data

You might want to start by getting an idea of how the data is distributed. It’s an important start, because it also decides how you will continue your analysis. ## Dispersion of species To just get an idea how the species are distributed, create a frequency table with our freq() function. We created the genus and species column earlier based on the microbial ID. With paste(), we can concatenate them together.

The freq() function can be used like the base R language was intended:

-
freq(paste(data_1st$genus, data_1st$species))
+
freq(paste(data_1st$genus, data_1st$species))

Or can be used like the dplyr way, which is easier readable:

-
data_1st %>% freq(genus, species)
+
data_1st %>% freq(genus, species)

Frequency table of genus and species
Columns: 2
-Length: 4,431 (of which NA: 0 = 0.00%)
+Length: 4,422 (of which NA: 0 = 0.00%)
Unique: 4

Shortest: 16
Longest: 24

@@ -905,33 +896,33 @@ Longest: 24

1 Escherichia coli -2,143 -48.4% -2,143 -48.4% +2,183 +49.4% +2,183 +49.4% 2 Staphylococcus aureus -1,130 -25.5% -3,273 -73.9% +1,120 +25.3% +3,303 +74.7% 3 Streptococcus pneumoniae -709 -16.0% -3,982 -89.9% +666 +15.1% +3,969 +89.8% 4 Klebsiella pneumoniae -449 -10.1% -4,431 +453 +10.2% +4,422 100.0% @@ -940,12 +931,12 @@ Longest: 24

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:

-
data_1st %>% portion_IR(amox)
-# [1] 0.460167
-

Or can be used in conjuction with group_by() and summarise(), both from the dplyr package:

-
data_1st %>% 
-  group_by(hospital) %>% 
-  summarise(amoxicillin = portion_IR(amox))
+ +

Or can be used in conjuction with group_by() and summarise(), both from the dplyr package:

+
data_1st %>% 
+  group_by(hospital) %>% 
+  summarise(amoxicillin = portion_IR(amox))
@@ -954,27 +945,27 @@ Longest: 24

- + - + - + - +
hospital
Hospital A0.46260600.4980784
Hospital B0.46529560.4516332
Hospital C0.43362830.4705882
Hospital D0.46777780.4767837
-

Of course it would be very convenient to know the number of isolates responsible for the percentages. For that purpose the n_rsi() can be used, which works exactly like n_distinct() from the dplyr package. It counts all isolates available for every group (i.e. values S, I or R):

-
data_1st %>% 
-  group_by(hospital) %>% 
-  summarise(amoxicillin = portion_IR(amox),
-            available = n_rsi(amox))
+

Of course it would be very convenient to know the number of isolates responsible for the percentages. For that purpose the n_rsi() can be used, which works exactly like n_distinct() from the dplyr package. It counts all isolates available for every group (i.e. values S, I or R):

+
data_1st %>% 
+  group_by(hospital) %>% 
+  summarise(amoxicillin = portion_IR(amox),
+            available = n_rsi(amox))
@@ -984,32 +975,32 @@ Longest: 24

- - + + - - + + - - + + - - + +
hospital
Hospital A0.462606012970.49807841301
Hospital B0.465295615560.45163321592
Hospital C0.43362836780.4705882646
Hospital D0.46777789000.4767837883

These functions can also be used to get the portion of multiple antibiotics, to calculate co-resistance very easily:

-
data_1st %>% 
-  group_by(genus) %>% 
-  summarise(amoxicillin = portion_S(amcl),
-            gentamicin = portion_S(gent),
-            "amox + gent" = portion_S(amcl, gent))
+
data_1st %>% 
+  group_by(genus) %>% 
+  summarise(amoxicillin = portion_S(amcl),
+            gentamicin = portion_S(gent),
+            "amox + gent" = portion_S(amcl, gent))
@@ -1020,94 +1011,94 @@ Longest: 24

- - - + + + - - - + + + - - - + + + - + - +
genus
Escherichia0.73121790.90947270.97526830.74988550.90792490.9775538
Klebsiella0.77505570.90645880.98663700.75055190.90066230.9713024
Staphylococcus0.74690270.92477880.97433630.74375000.91964290.9767857
Streptococcus0.76022570.7357357 0.00000000.76022570.7357357

To make a transition to the next part, let’s see how this difference could be plotted:

-
data_1st %>% 
-  group_by(genus) %>% 
-  summarise("1. Amoxicillin" = portion_S(amcl),
-            "2. Gentamicin" = portion_S(gent),
-            "3. Amox + gent" = portion_S(amcl, gent)) %>% 
-  tidyr::gather("Antibiotic", "S", -genus) %>%
-  ggplot(aes(x = genus,
-             y = S,
-             fill = Antibiotic)) +
-  geom_col(position = "dodge2")
+
data_1st %>% 
+  group_by(genus) %>% 
+  summarise("1. Amoxicillin" = portion_S(amcl),
+            "2. Gentamicin" = portion_S(gent),
+            "3. Amox + gent" = portion_S(amcl, gent)) %>% 
+  tidyr::gather("Antibiotic", "S", -genus) %>%
+  ggplot(aes(x = genus,
+             y = S,
+             fill = Antibiotic)) +
+  geom_col(position = "dodge2")

Plots

To show results in plots, most R users would nowadays use the ggplot2 package. This package lets you create plots in layers. You can read more about it on their website. A quick example would look like these syntaxes:

-
ggplot(data = a_data_set,
-       mapping = aes(x = year,
-                     y = value)) +
-  geom_col() +
-  labs(title = "A title",
-       subtitle = "A subtitle",
-       x = "My X axis",
-       y = "My Y axis")
-
-ggplot(a_data_set,
-       aes(year, value) +
-  geom_bar()
+
ggplot(data = a_data_set,
+       mapping = aes(x = year,
+                     y = value)) +
+  geom_col() +
+  labs(title = "A title",
+       subtitle = "A subtitle",
+       x = "My X axis",
+       y = "My Y axis")
+
+ggplot(a_data_set,
+       aes(year, value) +
+  geom_bar()

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:

-
ggplot(data_1st) +
-  geom_rsi(translate_ab = FALSE)
+
ggplot(data_1st) +
+  geom_rsi(translate_ab = FALSE)

Omit the translate_ab = FALSE to have the antibiotic codes (amox, amcl, cipr, gent) translated to official WHO names (amoxicillin, amoxicillin and betalactamase inhibitor, ciprofloxacin, gentamicin).

If we group on e.g. the genus column and add some additional functions from our package, we can create this:

-
# group the data on `genus`
-ggplot(data_1st %>% group_by(genus)) + 
-  # create bars with genus on x axis
-  # it looks for variables with class `rsi`,
-  # of which we have 4 (earlier created with `as.rsi`)
-  geom_rsi(x = "genus") + 
-  # split plots on antibiotic
-  facet_rsi(facet = "Antibiotic") +
-  # make R red, I yellow and S green
-  scale_rsi_colours() +
-  # show percentages on y axis
-  scale_y_percent(breaks = 0:4 * 25) +
-  # turn 90 degrees, make it bars instead of columns
-  coord_flip() +
-  # add labels
-  labs(title = "Resistance per genus and antibiotic", 
-       subtitle = "(this is fake data)") +
-  # and print genus in italic to follow our convention
-  # (is now y axis because we turned the plot)
-  theme(axis.text.y = element_text(face = "italic"))
+

To simplify this, we also created the ggplot_rsi() function, which combines almost all above functions:

-
data_1st %>% 
-  group_by(genus) %>%
-  ggplot_rsi(x = "genus",
-             facet = "Antibiotic",
-             breaks = 0:4 * 25,
-             datalabels = FALSE) +
-  coord_flip()
+

@@ -1135,26 +1126,26 @@ Longest: 24

We can transform the data and apply the test in only a couple of lines:

-
septic_patients %>%
-  filter(hospital_id %in% c("A", "D")) %>% # filter on only hospitals A and D
-  select(hospital_id, fosf) %>%            # select the hospitals and fosfomycin
-  group_by(hospital_id) %>%                # group on the hospitals
-  count_df(combine_IR = TRUE) %>%          # count all isolates per group (hospital_id)
-  tidyr::spread(hospital_id, Value) %>%    # transform output so A and D are columns
-  select(A, D) %>%                         # and select these only
-  as.matrix() %>%                          # transform to good old matrix for fisher.test()
-  fisher.test()                            # do Fisher's Exact Test
-# 
-#   Fisher's Exact Test for Count Data
-# 
-# data:  .
-# p-value = 0.03104
-# alternative hypothesis: true odds ratio is not equal to 1
-# 95 percent confidence interval:
-#  1.054283 4.735995
-# sample estimates:
-# odds ratio 
-#   2.228006
+
septic_patients %>%
+  filter(hospital_id %in% c("A", "D")) %>% # filter on only hospitals A and D
+  select(hospital_id, fosf) %>%            # select the hospitals and fosfomycin
+  group_by(hospital_id) %>%                # group on the hospitals
+  count_df(combine_IR = TRUE) %>%          # count all isolates per group (hospital_id)
+  tidyr::spread(hospital_id, Value) %>%    # transform output so A and D are columns
+  select(A, D) %>%                         # and select these only
+  as.matrix() %>%                          # transform to good old matrix for fisher.test()
+  fisher.test()                            # do Fisher's Exact Test
+# 
+#   Fisher's Exact Test for Count Data
+# 
+# data:  .
+# p-value = 0.03104
+# alternative hypothesis: true odds ratio is not equal to 1
+# 95 percent confidence interval:
+#  1.054283 4.735995
+# sample estimates:
+# odds ratio 
+#   2.228006

As can be seen, the p value is 0.03, which means that the fosfomycin resistances found in hospital A and D are really different.

diff --git a/docs/articles/AMR_files/figure-html/plot 1-1.png b/docs/articles/AMR_files/figure-html/plot 1-1.png index b7934e12..c668b4fd 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 1-1.png and b/docs/articles/AMR_files/figure-html/plot 1-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 3-1.png b/docs/articles/AMR_files/figure-html/plot 3-1.png index c742e8ea..07a7ae2d 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 3-1.png and b/docs/articles/AMR_files/figure-html/plot 3-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 4-1.png b/docs/articles/AMR_files/figure-html/plot 4-1.png index 51fcf483..ce2ce98d 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 4-1.png and b/docs/articles/AMR_files/figure-html/plot 4-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 5-1.png b/docs/articles/AMR_files/figure-html/plot 5-1.png index 311e8370..448130d7 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 5-1.png and b/docs/articles/AMR_files/figure-html/plot 5-1.png differ diff --git a/docs/articles/EUCAST.html b/docs/articles/EUCAST.html index b736e229..fd36c25f 100644 --- a/docs/articles/EUCAST.html +++ b/docs/articles/EUCAST.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -178,7 +178,7 @@

How to apply EUCAST rules

Matthijs S. Berends

-

12 January 2019

+

25 January 2019

diff --git a/docs/articles/G_test.html b/docs/articles/G_test.html index c7c88ea3..6cb2e9a2 100644 --- a/docs/articles/G_test.html +++ b/docs/articles/G_test.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -178,7 +178,7 @@

How to use the G-test

Matthijs S. Berends

-

12 January 2019

+

25 January 2019

diff --git a/docs/articles/Predict.html b/docs/articles/Predict.html index fd98e68b..1855e80c 100644 --- a/docs/articles/Predict.html +++ b/docs/articles/Predict.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -178,7 +178,7 @@

How to predict antimicrobial resistance

Matthijs S. Berends

-

12 January 2019

+

25 January 2019

diff --git a/docs/articles/ab_property.html b/docs/articles/ab_property.html index 85478e42..193760fa 100644 --- a/docs/articles/ab_property.html +++ b/docs/articles/ab_property.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -178,7 +178,7 @@

How to get properties of an antibiotic

Matthijs S. Berends

-

11 January 2019

+

25 January 2019

diff --git a/docs/articles/benchmarks.html b/docs/articles/benchmarks.html index b6d617e2..b58129a7 100644 --- a/docs/articles/benchmarks.html +++ b/docs/articles/benchmarks.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012 @@ -178,7 +178,7 @@

Benchmarks

Matthijs S. Berends

-

21 January 2019

+

25 January 2019

@@ -240,15 +240,15 @@
library(dplyr)
 # take 500,000 random MO codes from the septic_patients data set
 x = septic_patients %>%
-  sample_n(500000, replace = TRUE) %>%
-  pull(mo)
+  sample_n(500000, replace = TRUE) %>%
+  pull(mo)
   
 # got the right length?
 length(x)
 # [1] 500000
 
 # and how many unique values do we have?
-n_distinct(x)
+n_distinct(x)
 # [1] 96
 
 # only 96, but distributed in 500,000 results. now let's see:
diff --git a/docs/articles/freq.html b/docs/articles/freq.html
index a294b649..8156c10b 100644
--- a/docs/articles/freq.html
+++ b/docs/articles/freq.html
@@ -40,7 +40,7 @@
       
       
         AMR (for R)
-        0.5.0.9009
+        0.5.0.9012
       
     
@@ -178,7 +178,7 @@

How to create frequency tables

Matthijs S. Berends

-

12 January 2019

+

25 January 2019

@@ -196,7 +196,7 @@

Frequencies of one variable

To only show and quickly review the content of one variable, you can just select this variable in various ways. Let’s say we want to get the frequencies of the gender variable of the septic_patients dataset:

-
septic_patients %>% freq(gender)
+
septic_patients %>% freq(gender)

Frequency table of gender

@@ -233,21 +233,21 @@ Frequencies of more than one variable

Multiple variables will be pasted into one variable to review individual cases, keeping a univariate frequency table.

For illustration, we could add some more variables to the septic_patients dataset to learn about bacterial properties:

-
my_patients <- septic_patients %>% left_join_microorganisms()
-# Joining, by = "mo"
+
my_patients <- septic_patients %>% left_join_microorganisms()
+# Joining, by = "mo"

Now all variables of the microorganisms dataset have been joined to the septic_patients dataset. The microorganisms dataset consists of the following variables:

-
colnames(microorganisms)
-#  [1] "mo"         "tsn"        "genus"      "species"    "subspecies"
-#  [6] "fullname"   "family"     "order"      "class"      "phylum"    
-# [11] "subkingdom" "kingdom"    "gramstain"  "prevalence" "ref"
+
colnames(microorganisms)
+#  [1] "mo"         "tsn"        "genus"      "species"    "subspecies"
+#  [6] "fullname"   "family"     "order"      "class"      "phylum"    
+# [11] "subkingdom" "kingdom"    "gramstain"  "prevalence" "ref"

If we compare the dimensions between the old and new dataset, we can see that these 14 variables were added:

-
dim(septic_patients)
-# [1] 2000   49
-dim(my_patients)
-# [1] 2000   63
+
dim(septic_patients)
+# [1] 2000   49
+dim(my_patients)
+# [1] 2000   63

So now the genus and species variables are available. A frequency table of these combined variables can be created like this:

-
my_patients %>%
-  freq(genus, species, nmax = 15)
+
my_patients %>%
+  freq(genus, species, nmax = 15)

Frequency table of genus and species

@@ -388,10 +388,10 @@ Frequencies of numeric values

Frequency tables can be created of any input.

In case of numeric values (like integers, doubles, etc.) additional descriptive statistics will be calculated and shown into the header:

-
# # get age distribution of unique patients
-septic_patients %>% 
-  distinct(patient_id, .keep_all = TRUE) %>% 
-  freq(age, nmax = 5, header = TRUE)
+
# # get age distribution of unique patients
+septic_patients %>% 
+  distinct(patient_id, .keep_all = TRUE) %>% 
+  freq(age, nmax = 5, header = TRUE)

Frequency table of age
Class: numeric
Length: 981 (of which NA: 0 = 0.00%)
@@ -469,8 +469,8 @@ Outliers: 15 (unique count: 12)

Frequencies of factors

To sort frequencies of factors on factor level instead of item count, use the sort.count parameter.

sort.count is TRUE by default. Compare this default behaviour…

-
septic_patients %>%
-  freq(hospital_id)
+
septic_patients %>%
+  freq(hospital_id)

Frequency table of hospital_id

@@ -517,8 +517,8 @@ Outliers: 15 (unique count: 12)

… with this, where items are now sorted on count:

-
septic_patients %>%
-  freq(hospital_id, sort.count = FALSE)
+
septic_patients %>%
+  freq(hospital_id, sort.count = FALSE)

Frequency table of hospital_id

@@ -565,8 +565,8 @@ Outliers: 15 (unique count: 12)

All classes will be printed into the header (default is FALSE when using markdown like this document). Variables with the new rsi class of this AMR package are actually ordered factors and have three classes (look at Class in the header):

-
septic_patients %>%
-  freq(amox, header = TRUE)
+
septic_patients %>%
+  freq(amox, header = TRUE)

Frequency table of amox
Class: factor > ordered > rsi (numeric)
Levels: S < I < R
@@ -614,8 +614,8 @@ Unique: 3

Frequencies of dates

Frequencies of dates will show the oldest and newest date in the data, and the amount of days between them:

-
septic_patients %>%
-  freq(date, nmax = 5, header = TRUE)
+
septic_patients %>%
+  freq(date, nmax = 5, header = TRUE)

Frequency table of date
Class: Date (numeric)
Length: 2,000 (of which NA: 0 = 0.00%)
@@ -681,11 +681,11 @@ Median: 31 July 2009 (47.39%)

Assigning a frequency table to an object

A frequency table is actaually a regular data.frame, with the exception that it contains an additional class.

-
my_df <- septic_patients %>% freq(age)
-class(my_df)
+
my_df <- septic_patients %>% freq(age)
+class(my_df)

[1] “frequency_tbl” “data.frame”

Because of this additional class, a frequency table prints like the examples above. But the object itself contains the complete table without a row limitation:

-
dim(my_df)
+
dim(my_df)

[1] 74 5

@@ -696,8 +696,8 @@ Median: 31 July 2009 (47.39%)

Parameter na.rm

With the na.rm parameter (defaults to TRUE, but they will always be shown into the header), you can include NA values in the frequency table:

-
septic_patients %>%
-  freq(amox, na.rm = FALSE)
+
septic_patients %>%
+  freq(amox, na.rm = FALSE)

Frequency table of amox

@@ -749,8 +749,8 @@ Median: 31 July 2009 (47.39%)

Parameter row.names

The default frequency tables shows row indices. To remove them, use row.names = FALSE:

-
septic_patients %>%
-  freq(hospital_id, row.names = FALSE)
+
septic_patients %>%
+  freq(hospital_id, row.names = FALSE)

Frequency table of hospital_id

@@ -797,8 +797,8 @@ Median: 31 July 2009 (47.39%)

Parameter markdown

The markdown parameter is TRUE at default in non-interactive sessions, like in reports created with R Markdown. This will always print all rows, unless nmax is set.

-
septic_patients %>%
-  freq(hospital_id, markdown = TRUE)
+
septic_patients %>%
+  freq(hospital_id, markdown = TRUE)

Frequency table of hospital_id

diff --git a/docs/articles/index.html b/docs/articles/index.html index 2120c8c3..17dd74d7 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012 diff --git a/docs/articles/mo_property.html b/docs/articles/mo_property.html index 97ba39c2..1f380407 100644 --- a/docs/articles/mo_property.html +++ b/docs/articles/mo_property.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -178,7 +178,7 @@

How to get properties of a microorganism

Matthijs S. Berends

-

12 January 2019

+

25 January 2019

diff --git a/docs/authors.html b/docs/authors.html index ebc84305..c78d2883 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012 diff --git a/docs/extra.css b/docs/extra.css index 2736db17..ed8c6f3e 100644 --- a/docs/extra.css +++ b/docs/extra.css @@ -165,7 +165,20 @@ table a:not(.btn):hover, .table a:not(.btn):hover { text-decoration: underline; } +/* text below header in manual overview */ .template-reference-index h2 ~ p { font-size: 110%; /* font-weight: bold; */ } + +/* logos on index page */ +.logo_img { + display: inline-block; +} +.logo_txt { + display: inline; + font-size: 125%; + vertical-align: middle; + color: black; + font-weight: bold; +} diff --git a/docs/index.html b/docs/index.html index d2f921fc..84b5d2f6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012 @@ -214,7 +214,7 @@

Get this package

This package is available on the official R network (CRAN), which has a peer-reviewed submission process. Install this package in R with:

- +

It will be downloaded and installed automatically. For RStudio, click on the menu Tools > Install Packages… and then type in “AMR” and press Install.

@@ -225,30 +225,39 @@

Short introduction

-
+

-Taxonomic reference data

-

+Microbial (taxonomic) reference data +

This package contains the complete microbial taxonomic data (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, https://www.itis.gov).

-

All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

-

Read more about ITIS in our manual.

+

All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

+

Read more about the data from ITIS in our manual.

+
+
+

+Antimicrobial reference data

+
+

WHO Collaborating Centre for Drug Statistics Methodology

+
+

This package contains all ~500 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission.

+

Read more about the data from WHOCC in our manual.

Overview of functions

The AMR package basically does four important things:

    -
  1. It cleanses existing data, by transforming it to reproducible and profound classes, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:
  2. -
+
  • +

    It cleanses existing data, by transforming it to reproducible and profound classes, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:

    • Use as.mo() to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of Klebsiella pneumoniae is “B_KLBSL_PNE” (B stands for Bacteria) and the ID of S. aureus is “B_STPHY_AUR”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” or “esccol” and tries to find expected results using artificial intelligence (AI) on the included ITIS data set, consisting of almost 20,000 microorganisms. It is very fast, please see our benchmarks. Moreover, it can group Staphylococci into coagulase negative and positive (CoNS and CoPS, see source) and can categorise Streptococci into Lancefield groups (like beta-haemolytic Streptococcus Group B, source).
    • Use as.rsi() to transform values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like “<=0.002; S” (combined MIC/RSI) will result in “S”.
    • Use as.mic() to cleanse your MIC values. It produces a so-called factor (called ordinal in SPSS) with valid MIC values as levels. A value like “<=0.002; S” (combined MIC/RSI) will result in “<=0.002”.
    • Use as.atc() to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values “Furabid”, “Furadantin”, “nitro” all return the ATC code of Nitrofurantoine.
    -
      -
    1. It enhances existing data and adds new data from data sets included in this package.
    2. -
    +
  • +
  • +

    It enhances existing data and adds new data from data sets included in this package.

    • Use eucast_rules() to apply EUCAST expert rules to isolates.
    • Use first_isolate() to identify the first isolates of every patient using guidelines from the CLSI (Clinical and Laboratory Standards Institute). @@ -260,9 +269,9 @@
    • The data set microorganisms contains the complete taxonomic tree of more than 18,000 microorganisms (bacteria, fungi/yeasts and protozoa). Furthermore, the colloquial name and Gram stain are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like mo_genus(), mo_family(), mo_gramstain() or even mo_phylum(). As they use as.mo() internally, they also use artificial intelligence. For example, mo_genus("MRSA") and mo_genus("S. aureus") will both return "Staphylococcus". They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.
    • The data set antibiotics contains the ATC code, LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains a total of 298 trade names. Use functions like ab_name() and ab_tradenames() to look up values. The ab_* functions use as.atc() internally so they support AI to guess your expected result. For example, ab_name("Fluclox"), ab_name("Floxapen") and ab_name("J01CF05") will all return "Flucloxacillin". These functions can again be used to add new variables to your data.
    -
      -
    1. It analyses the data with convenient functions that use well-known methods.
    2. -
    +
  • +
  • +

    It analyses the data with convenient functions that use well-known methods.

    -
      -
    1. It teaches the user how to use all the above actions.
    2. -
    +
  • +
  • +

    It teaches the user how to use all the above actions.

    • The package contains extensive help pages with many examples.
    • It also contains an example data set called septic_patients. This data set contains: @@ -283,6 +292,8 @@
  • + +

    diff --git a/docs/news/index.html b/docs/news/index.html index 07a8fc40..c2f8ed50 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012

    @@ -229,9 +229,12 @@

    Changed

      -
    • Function eucast_rules():
    • +
    • Added 65 antibiotics to the antibiotics data set, from the Pharmaceuticals Community Register of the European Commission
    • +
    • Removed columns atc_group1_nl and atc_group2_nl from the antibiotics data set
    • +
    • Function eucast_rules(): +
      • Updated EUCAST Clinical breakpoints to version 9.0 of 1 January 2019
      • Fixed a critical bug where some rules that depend on previous applied rules would not be applied adequately
      • Emphasised in manual that penicillin is meant as benzylpenicillin (ATC J01CE01)
      • +
      +
    • Function guess_mo() is now deprecated in favour of as.mo() and will be removed in future versions
    • -
    • Improvements for as.mo():
    • +
    • Improvements for as.mo(): +
      • Fix for vector containing only empty values
      • Finds better results when input is in other languages
      • Better handling for subspecies
      • @@ -266,12 +288,18 @@
      • Manual now contains more info about the algorithms
      • Progress bar will be shown when it takes more than 3 seconds to get results
      • Support for formatted console text
      • -
      • Function first_isolate():
      • +
      • Console will return the percentage of uncoercable input
      • +
      +
    • +
    • Function first_isolate(): +
      • Fixed a bug where distances between dates would not be calculated right - in the septic_patients data set this yielded a difference of 0.15% more isolates
      • Will now use a column named like “patid” for the patient ID (parameter col_patientid), when this parameter was left blank
      • Will now use a column named like “key(…)ab” or “key(…)antibiotics” for the key antibiotics (parameter col_keyantibiotics()), when this parameter was left blank
      • Removed parameter output_logical, the function will now always return a logical value
      • Renamed parameter filter_specimen to specimen_group, although using filter_specimen will still work
      • +
      +
    • A note to the manual pages of the portion functions, that low counts can influence the outcome and that the portion functions may camouflage this, since they only return the portion (albeit being dependent on the minimum parameter)
    • Merged data sets microorganisms.certe and microorganisms.umcg into microorganisms.codes
    • @@ -282,7 +310,8 @@
    • Small text updates to summaries of class rsi and mic
    • -
    • Frequency tables (freq() function):
    • +
    • Frequency tables (freq() function): +
      • Header info is now available as a list, with the header function
      • Added header info for class mo to show unique count of families, genera and species
      • Now honours the decimal.mark setting, which just like format defaults to getOption("OutDec") @@ -293,6 +322,8 @@
      • New parameter droplevels to exclude empty factor levels when input is a factor
      • Factor levels will be in header when present in input data (maximum of 5)
      • Fix for using select() on frequency tables
      • +
      +
    • Function scale_y_percent() now contains the limits parameter
    • Automatic parameter filling for mdro(), key_antibiotics() and eucast_rules()
    • @@ -334,7 +365,8 @@
    • EUCAST_rules was renamed to eucast_rules, the old function still exists as a deprecated function
    • -
    • Big changes to the eucast_rules function:
    • +
    • Big changes to the eucast_rules function: +
      • Now also applies rules from the EUCAST ‘Breakpoint tables for bacteria’, version 8.1, 2018, http://www.eucast.org/clinical_breakpoints/ (see Source of the function)
      • New parameter rules to specify which rules should be applied (expert rules, breakpoints, others or all)
      • New parameter verbose which can be set to TRUE to get very specific messages about which columns and rows were affected
      • @@ -343,11 +375,18 @@
      • Data set septic_patients now reflects these changes
      • Added parameter pipe for piperacillin (J01CA12), also to the mdro function
      • Small fixes to EUCAST clinical breakpoint rules
      • +
      +
    • Added column kingdom to the microorganisms data set, and function mo_kingdom to look up values
    • Tremendous speed improvement for as.mo (and subsequently all mo_* functions), as empty values wil be ignored a priori
    • Fewer than 3 characters as input for as.mo will return NA
    • -
    • Function as.mo (and all mo_* wrappers) now supports genus abbreviations with “species” attached r as.mo("E. species") # B_ESCHR mo_fullname("E. spp.") # "Escherichia species" as.mo("S. spp") # B_STPHY mo_fullname("S. species") # "Staphylococcus species" +
    • +

      Function as.mo (and all mo_* wrappers) now supports genus abbreviations with “species” attached

      +
      as.mo("E. species")        # B_ESCHR
      +mo_fullname("E. spp.")     # "Escherichia species"
      +as.mo("S. spp")            # B_STPHY
      +mo_fullname("S. species")  # "Staphylococcus species"
    • Added parameter combine_IR (TRUE/FALSE) to functions portion_df and count_df, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)
    • Fix for portion_*(..., as_percent = TRUE) when minimal number of isolates would not be met
    • @@ -356,18 +395,19 @@
    • Using portion_* functions now throws a warning when total available isolate is below parameter minimum
    • Functions as.mo, as.rsi, as.mic, as.atc and freq will not set package name as attribute anymore
    • -
    • Frequency tables - freq():
    • +
    • Frequency tables - freq(): + +
    • first_isolate now tries to find columns to use as input when parameters are left blank
    • Improvements for MDRO algorithm (function mdro)
    • @@ -389,7 +431,8 @@
    • ggplot_rsi and scale_y_percent have breaks parameter
    • -
    • AI improvements for as.mo:
    • +
    • AI improvements for as.mo: +
      • "CRS" -> Stenotrophomonas maltophilia
      • @@ -402,6 +445,8 @@
      • "MSSE" -> Staphylococcus epidermidis
      • +
      +
    • Fix for join functions
    • Speed improvement for is.rsi.eligible, now 15-20 times faster
    • In g.test, when sum(x) is below 1000 or any of the expected values is below 5, Fisher’s Exact Test will be suggested
    • @@ -430,7 +475,8 @@ New
      • The data set microorganisms now contains all microbial taxonomic data from ITIS (kingdoms Bacteria, Fungi and Protozoa), the Integrated Taxonomy Information System, available via https://itis.gov. The data set now contains more than 18,000 microorganisms with all known bacteria, fungi and protozoa according ITIS with genus, species, subspecies, family, order, class, phylum and subkingdom. The new data set microorganisms.old contains all previously known taxonomic names from those kingdoms.
      • -
      • New functions based on the existing function mo_property:
      • +
      • New functions based on the existing function mo_property: +
        • Taxonomic names: mo_phylum, mo_class, mo_order, mo_family, mo_genus, mo_species, mo_subspecies
        • Semantic names: mo_fullname, mo_shortname @@ -440,22 +486,52 @@
        • Author and year: mo_ref
        -

        They also come with support for German, Dutch, French, Italian, Spanish and Portuguese: r mo_gramstain("E. coli") # [1] "Gram negative" mo_gramstain("E. coli", language = "de") # German # [1] "Gramnegativ" mo_gramstain("E. coli", language = "es") # Spanish # [1] "Gram negativo" mo_fullname("S. group A", language = "pt") # Portuguese # [1] "Streptococcus grupo A"

        -

        Furthermore, former taxonomic names will give a note about the current taxonomic name: r mo_gramstain("Esc blattae") # Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010) # [1] "Gram negative"

        +

        They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:

        +
        mo_gramstain("E. coli")
        +# [1] "Gram negative"
        +mo_gramstain("E. coli", language = "de") # German
        +# [1] "Gramnegativ"
        +mo_gramstain("E. coli", language = "es") # Spanish
        +# [1] "Gram negativo"
        +mo_fullname("S. group A", language = "pt") # Portuguese
        +# [1] "Streptococcus grupo A"
        +

        Furthermore, former taxonomic names will give a note about the current taxonomic name:

        + +
      • +
      • Functions count_R, count_IR, count_I, count_SI and count_S to selectively count resistant or susceptible isolates
          -
        • Functions count_R, count_IR, count_I, count_SI and count_S to selectively count resistant or susceptible isolates
        • Extra function count_df (which works like portion_df) to get all counts of S, I and R of a data set with antibiotic columns, with support for grouped variables
        • +
        +
      • Function is.rsi.eligible to check for columns that have valid antimicrobial results, but do not have the rsi class yet. Transform the columns of your raw data with: data %>% mutate_if(is.rsi.eligible, as.rsi)
      • -
      • Functions as.mo and is.mo as replacements for as.bactid and is.bactid (since the microoganisms data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The as.mo function determines microbial IDs using Artificial Intelligence (AI): r as.mo("E. coli") # [1] B_ESCHR_COL as.mo("MRSA") # [1] B_STPHY_AUR as.mo("S group A") # [1] B_STRPTC_GRA And with great speed too - on a quite regular Linux server from 2007 it takes us less than 0.02 seconds to transform 25,000 items: r thousands_of_E_colis <- rep("E. coli", 25000) microbenchmark::microbenchmark(as.mo(thousands_of_E_colis), unit = "s") # Unit: seconds # min median max neval # 0.01817717 0.01843957 0.03878077 100 +
      • +

        Functions as.mo and is.mo as replacements for as.bactid and is.bactid (since the microoganisms data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The as.mo function determines microbial IDs using Artificial Intelligence (AI):

        + +

        And with great speed too - on a quite regular Linux server from 2007 it takes us less than 0.02 seconds to transform 25,000 items:

        +
      • Added parameter reference_df for as.mo, so users can supply their own microbial IDs, name or codes as a reference table
      • -
      • Renamed all previous references to bactid to mo, like:
      • +
      • Renamed all previous references to bactid to mo, like: +
        • Column names inputs of EUCAST_rules, first_isolate and key_antibiotics
        • Column names of datasets microorganisms and septic_patients
        • All old syntaxes will still work with this version, but will throw warnings
        • +
        +
      • Function labels_rsi_count to print datalabels on a RSI ggplot2 model
      • Functions as.atc and is.atc to transform/look up antibiotic ATC codes as defined by the WHO. The existing function guess_atc is now an alias of as.atc.

      • Function ab_property and its aliases: ab_name, ab_tradenames, ab_certe, ab_umcg and ab_trivial_nl @@ -470,7 +546,14 @@ Changed
        • Added three antimicrobial agents to the antibiotics data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)
        • -
        • Added 163 trade names to the antibiotics data set, it now contains 298 different trade names in total, e.g.: r ab_official("Bactroban") # [1] "Mupirocin" ab_name(c("Bactroban", "Amoxil", "Zithromax", "Floxapen")) # [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin" ab_atc(c("Bactroban", "Amoxil", "Zithromax", "Floxapen")) # [1] "R01AX06" "J01CA04" "J01FA10" "J01CF05" +
        • +

          Added 163 trade names to the antibiotics data set, it now contains 298 different trade names in total, e.g.:

          +
          ab_official("Bactroban")
          +# [1] "Mupirocin"
          +ab_name(c("Bactroban", "Amoxil", "Zithromax", "Floxapen"))
          +# [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin"
          +ab_atc(c("Bactroban", "Amoxil", "Zithromax", "Floxapen"))
          +# [1] "R01AX06" "J01CA04" "J01FA10" "J01CF05"
        • For first_isolate, rows will be ignored when there’s no species available
        • Function ratio is now deprecated and will be removed in a future release, as it is not really the scope of this package
        • @@ -479,9 +562,36 @@
        • Added prevalence column to the microorganisms data set
        • Added parameters minimum and as_percent to portion_df
        • -
        • Support for quasiquotation in the functions series count_* and portions_*, and n_rsi. This allows to check for more than 2 vectors or columns. ```r septic_patients %>% select(amox, cipr) %>% count_IR() # which is the same as: septic_patients %>% count_IR(amox, cipr)
        • +
        • +

          Support for quasiquotation in the functions series count_* and portions_*, and n_rsi. This allows to check for more than 2 vectors or columns.

          + +
        • +
        • Edited ggplot_rsi and geom_rsi so they can cope with count_df. The new fun parameter has value portion_df at default, but can be set to count_df.
        • +
        • Fix for ggplot_rsi when the ggplot2 package was not loaded
        • +
        • Added datalabels function labels_rsi_count to ggplot_rsi +
        • +
        • Added possibility to set any parameter to geom_rsi (and ggplot_rsi) so you can set your own preferences
        • +
        • Fix for joins, where predefined suffices would not be honoured
        • +
        • Added parameter quote to the freq function
        • +
        • Added generic function diff for frequency tables
        • +
        • Added longest en shortest character length in the frequency table (freq) header of class character +
        • +
        • +

          Support for types (classes) list and matrix for freq

          +
          my_matrix = with(septic_patients, matrix(c(age, gender), ncol = 2))
          +freq(my_matrix)
          +

          For lists, subsetting is possible:

          +
          my_list = list(age = septic_patients$age, gender = septic_patients$gender)
          +my_list %>% freq(age)
          +my_list %>% freq(gender)
          +
        -

        septic_patients %>% portion_S(amcl) septic_patients %>% portion_S(amcl, gent) septic_patients %>% portion_S(amcl, gent, pita) * Edited `ggplot_rsi` and `geom_rsi` so they can cope with `count_df`. The new `fun` parameter has value `portion_df` at default, but can be set to `count_df`. * Fix for `ggplot_rsi` when the `ggplot2` package was not loaded * Added datalabels function `labels_rsi_count` to `ggplot_rsi` * Added possibility to set any parameter to `geom_rsi` (and `ggplot_rsi`) so you can set your own preferences * Fix for joins, where predefined suffices would not be honoured * Added parameter `quote` to the `freq` function * Added generic function `diff` for frequency tables * Added longest en shortest character length in the frequency table (`freq`) header of class `character` * Support for types (classes) list and matrix for `freq`r my_matrix = with(septic_patients, matrix(c(age, gender), ncol = 2)) freq(my_matrix) For lists, subsetting is possible:r my_list = list(age = septic_patients$age, gender = septic_patients$gender) my_list %>% freq(age) my_list %>% freq(gender) ```

    @@ -500,15 +610,21 @@ New

    • -BREAKING: rsi_df was removed in favour of new functions portion_R, portion_IR, portion_I, portion_SI and portion_S to selectively calculate resistance or susceptibility. These functions are 20 to 30 times faster than the old rsi function. The old function still works, but is deprecated.
    • +BREAKING: rsi_df was removed in favour of new functions portion_R, portion_IR, portion_I, portion_SI and portion_S to selectively calculate resistance or susceptibility. These functions are 20 to 30 times faster than the old rsi function. The old function still works, but is deprecated. +
      • New function portion_df to get all portions of S, I and R of a data set with antibiotic columns, with support for grouped variables
      • +
      +
    • -BREAKING: the methodology for determining first weighted isolates was changed. The antibiotics that are compared between isolates (call key antibiotics) to include more first isolates (afterwards called first weighted isolates) are now as follows:
    • +BREAKING: the methodology for determining first weighted isolates was changed. The antibiotics that are compared between isolates (call key antibiotics) to include more first isolates (afterwards called first weighted isolates) are now as follows: +
      • Universal: amoxicillin, amoxicillin/clavlanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole
      • Gram-positive: vancomycin, teicoplanin, tetracycline, erythromycin, oxacillin, rifampicin
      • Gram-negative: gentamicin, tobramycin, colistin, cefotaxime, ceftazidime, meropenem
      • -
      • Support for ggplot2 +
      +
    • Support for ggplot2 +
      • New functions geom_rsi, facet_rsi, scale_y_percent, scale_rsi_colours and theme_rsi
      • New wrapper function ggplot_rsi to apply all above functions on a data set: @@ -519,22 +635,32 @@
    • -
    • Determining bacterial ID:
    • +
    + +
  • Determining bacterial ID: +
    • New functions as.bactid and is.bactid to transform/ look up microbial ID’s.
    • The existing function guess_bactid is now an alias of as.bactid
    • New Becker classification for Staphylococcus to categorise them into Coagulase Negative Staphylococci (CoNS) and Coagulase Positve Staphylococci (CoPS)
    • New Lancefield classification for Streptococcus to categorise them into Lancefield groups
    • +
    +
  • For convience, new descriptive statistical functions kurtosis and skewness that are lacking in base R - they are generic functions and have support for vectors, data.frames and matrices
  • Function g.test to perform the Χ2 distributed G-test, which use is the same as chisq.test
  • -
  • Function ratio to transform a vector of values to a preset ratio
  • +
  • +Function ratio to transform a vector of values to a preset ratio + +
  • Support for Addins menu in RStudio to quickly insert %in% or %like% (and give them keyboard shortcuts), or to view the datasets that come with this package
  • Function p.symbol to transform p values to their related symbols: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  • Functions clipboard_import and clipboard_export as helper functions to quickly copy and paste from/to software like Excel and SPSS. These functions use the clipr package, but are a little altered to also support headless Linux servers (so you can use it in RStudio Server)
  • -
  • New for frequency tables (function freq):
  • +
  • New for frequency tables (function freq): +
    • A vignette to explain its usage
    • Support for rsi (antimicrobial resistance) to use as input
    • Support for table to use as input: freq(table(x, y)) @@ -549,6 +675,8 @@
    • Header of frequency tables now also show Mean Absolute Deviaton (MAD) and Interquartile Range (IQR)
    • Possibility to globally set the default for the amount of items to print, with options(max.print.freq = n) where n is your preset value
    +
  • +

    @@ -570,21 +698,27 @@
  • Small improvements to the microorganisms dataset (especially for Salmonella) and the column bactid now has the new class "bactid"
  • -
  • Combined MIC/RSI values will now be coerced by the rsi and mic functions:
  • +
  • Combined MIC/RSI values will now be coerced by the rsi and mic functions: + +
  • Now possible to coerce MIC values with a space between operator and value, i.e. as.mic("<= 0.002") now works
  • Classes rsi and mic do not add the attribute package.version anymore
  • Added "groups" option for atc_property(..., property). It will return a vector of the ATC hierarchy as defined by the WHO. The new function atc_groups is a convenient wrapper around this.
  • Build-in host check for atc_property as it requires the host set by url to be responsive
  • Improved first_isolate algorithm to exclude isolates where bacteria ID or genus is unavailable
  • Fix for warning hybrid evaluation forced for row_number (924b62) from the dplyr package v0.7.5 and above
  • -
  • Support for empty values and for 1 or 2 columns as input for guess_bactid (now called as.bactid)
  • +
  • Support for empty values and for 1 or 2 columns as input for guess_bactid (now called as.bactid) +
    • So yourdata %>% select(genus, species) %>% as.bactid() now also works
    • +
    +
  • Other small fixes
  • @@ -592,11 +726,14 @@

    Other

    @@ -615,10 +752,13 @@
  • Function guess_bactid to determine the ID of a microorganism based on genus/species or known abbreviations like MRSA
  • Function guess_atc to determine the ATC of an antibiotic based on name, trade name, or known abbreviations
  • Function freq to create frequency tables, with additional info in a header
  • -
  • Function MDRO to determine Multi Drug Resistant Organisms (MDRO) with support for country-specific guidelines.
  • +
  • Function MDRO to determine Multi Drug Resistant Organisms (MDRO) with support for country-specific guidelines. + +
  • New algorithm to determine weighted isolates, can now be "points" or "keyantibiotics", see ?first_isolate
  • New print format for tibbles and data.tables
  • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 3c396dbb..31227eab 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,4 +1,4 @@ -pandoc: 1.17.2 +pandoc: 2.3.1 pkgdown: 1.3.0 pkgdown_sha: ~ articles: diff --git a/docs/reference/AMR-deprecated.html b/docs/reference/AMR-deprecated.html index a3ad0f9a..7d3c902b 100644 --- a/docs/reference/AMR-deprecated.html +++ b/docs/reference/AMR-deprecated.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012
    diff --git a/docs/reference/AMR.html b/docs/reference/AMR.html index 6e5b904b..23faa41a 100644 --- a/docs/reference/AMR.html +++ b/docs/reference/AMR.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 diff --git a/docs/reference/ITIS.html b/docs/reference/ITIS.html index f52848ae..288839ff 100644 --- a/docs/reference/ITIS.html +++ b/docs/reference/ITIS.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012 @@ -231,9 +231,9 @@

    ITIS

    -


    +


    This package contains the complete microbial taxonomic data (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, https://www.itis.gov).

    -

    All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

    +

    All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

    ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].

    Read more on our website!

    diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html new file mode 100644 index 00000000..1972e1f6 --- /dev/null +++ b/docs/reference/WHOCC.html @@ -0,0 +1,300 @@ + + + + + + + + +WHO Collaborating Centre for Drug Statistics Methodology — WHOCC • AMR (for R) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    All antimicrobial drugs and their official names, ATC codes, ATC groups and defined daily dose (DDD) are included in this package, using the WHO Collaborating Centre for Drug Statistics Methodology.

    + +
    + + +

    WHOCC

    + + +


    +This package contains all ~500 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission (http://ec.europa.eu/health/documents/community-register/html/atc.htm).

    +

    These have become the gold standard for international drug utilisation monitoring and research.

    +

    The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.

    + +

    Read more on our website!

    + + +


    +On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

    + + +

    Examples

    +
    # NOT RUN {
    +as.atc("meropenem")
    +ab_name("J01DH02")
    +
    +ab_tradenames("flucloxacillin")
    +# }
    +
    + +
    + + +
    + + + + + + + + + diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html index 3b186ce0..dbd87926 100644 --- a/docs/reference/ab_property.html +++ b/docs/reference/ab_property.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 diff --git a/docs/reference/abname.html b/docs/reference/abname.html index 2cb1232f..aec546b7 100644 --- a/docs/reference/abname.html +++ b/docs/reference/abname.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -259,6 +259,14 @@

    The ab_property functions are faster and more concise, but do not support concatenated strings, like abname("AMCL+GENT".

    +

    WHOCC

    + + +


    +This package contains all ~500 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission (http://ec.europa.eu/health/documents/community-register/html/atc.htm).

    +

    These have become the gold standard for international drug utilisation monitoring and research.

    +

    The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.

    +

    Read more on our website!

    @@ -307,6 +315,8 @@ On our website https://msberends.gitla
  • Details
  • +
  • WHOCC
  • +
  • Read more on our website!
  • Examples
  • diff --git a/docs/reference/age.html b/docs/reference/age.html index 9300ff81..52a750a5 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012 @@ -257,6 +257,11 @@ On our website https://msberends.gitla

    age_groups to split age into age groups

    +

    Examples

    +
    # NOT RUN {
    +df <- data.frame(birth_date = Sys.Date() - runif(100) * 25000)
    +df$age <- age(df$birth_date)
    +# }
    diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index a33091c3..dda18611 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012 @@ -296,11 +296,11 @@ On our website https://msberends.gitla # resistance of ciprofloxacine per age group library(dplyr) septic_patients%>% - mutate(first_isolate=first_isolate(.)) %>% - filter(first_isolate==TRUE, + mutate(first_isolate=first_isolate(.)) %>% + filter(first_isolate==TRUE, mo==as.mo("E. coli")) %>% - group_by(age_group=age_groups(age)) %>% - select(age_group, + group_by(age_group=age_groups(age)) %>% + select(age_group, cipr) %>%ggplot_rsi(x="age_group") # } diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index 6fdbc034..4db28210 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -6,7 +6,7 @@ -Data set with 423 antibiotics — antibiotics • AMR (for R) +Data set with ~500 antibiotics — antibiotics • AMR (for R) @@ -45,7 +45,7 @@ - + @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -216,7 +216,7 @@
    @@ -231,7 +231,7 @@

    Format

    -

    A data.frame with 423 observations and 18 variables:

    +

    A data.frame with 488 observations and 16 variables:

    atc

    ATC code, like J01CR02

    certe

    Certe code, like amcl

    umcg

    UMCG code, like AMCL

    @@ -246,15 +246,15 @@
    iv_units

    Units of iv_ddd

    atc_group1

    ATC group, like "Macrolides, lincosamides and streptogramins"

    atc_group2

    Subgroup of atc_group1, like "Macrolides"

    -
    atc_group1_nl

    ATC group in Dutch, like "Macroliden, lincosamiden en streptograminen"

    -
    atc_group2_nl

    Subgroup of atc_group1 in Dutch, like "Macroliden"

    useful_gramnegative

    FALSE if not useful according to EUCAST, NA otherwise (see Source)

    useful_grampositive

    FALSE if not useful according to EUCAST, NA otherwise (see Source)

    Source

    -

    - World Health Organization: https://www.whocc.no/atc_ddd_index/
    - EUCAST - Expert rules intrinsic exceptional V3.1
    - MOLIS (LIS of Certe): https://www.certe.nl
    - GLIMS (LIS of UMCG): https://www.umcg.nl

    +

    - World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: https://www.whocc.no/atc_ddd_index/

    +

    EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016: http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf

    +

    European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: http://ec.europa.eu/health/documents/community-register/html/atc.htm

    Read more on our website!

    diff --git a/docs/reference/as.atc.html b/docs/reference/as.atc.html index 8b2bbe7f..29856a79 100644 --- a/docs/reference/as.atc.html +++ b/docs/reference/as.atc.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012
    @@ -252,6 +252,14 @@

    In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups. Source: https://www.whocc.no/atc/structure_and_principles/

    +

    WHOCC

    + + +


    +This package contains all ~500 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission (http://ec.europa.eu/health/documents/community-register/html/atc.htm).

    +

    These have become the gold standard for international drug utilisation monitoring and research.

    +

    The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.

    +

    Read more on our website!

    @@ -291,6 +299,8 @@ On our website https://msberends.gitla
  • Details
  • +
  • WHOCC
  • +
  • Read more on our website!
  • See also
  • diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index 29a21aeb..cfab1956 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012
    diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index 078b4bc2..57cc5092 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012 @@ -307,9 +307,9 @@

    ITIS

    -


    +


    This package contains the complete microbial taxonomic data (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, https://www.itis.gov).

    -

    All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

    +

    All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

    ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].

    Read more on our website!

    diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html index 187c1828..cae1fdab 100644 --- a/docs/reference/as.rsi.html +++ b/docs/reference/as.rsi.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -277,11 +277,11 @@ On our website https://msberends.gitla # using dplyr's mutate library(dplyr) septic_patients%>% - mutate_at(vars(peni:rifa), as.rsi) + mutate_at(vars(peni:rifa), as.rsi) # fastest way to transform all columns with already valid AB results to class `rsi`:septic_patients%>% - mutate_if(is.rsi.eligible, + mutate_if(is.rsi.eligible, as.rsi) # } diff --git a/docs/reference/atc_property.html b/docs/reference/atc_property.html index 1850ce54..c6ad52c9 100644 --- a/docs/reference/atc_property.html +++ b/docs/reference/atc_property.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 diff --git a/docs/reference/count.html b/docs/reference/count.html index 4b430fc3..df8e3222 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -81,7 +81,7 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -282,7 +282,7 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_

    Details

    These functions are meant to count isolates. Use the portion_* functions to calculate microbial resistance.

    -

    n_rsi is an alias of count_all. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to n_distinct. Their function is equal to count_S(...) + count_IR(...).

    +

    n_rsi is an alias of count_all. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to n_distinct. Their function is equal to count_S(...) + count_IR(...).

    count_df takes any variable from data that has an "rsi" class (created with as.rsi) and counts the amounts of R, I and S. The resulting tidy data (see Source) data.frame will have three rows (S/I/R) and a column for each variable with class "rsi".

    Read more on our website!

    @@ -321,13 +321,13 @@ On our website https://msberends.gitla library(dplyr) septic_patients%>% - group_by(hospital_id) %>% - summarise(R=count_R(cipr), + group_by(hospital_id) %>% + summarise(R=count_R(cipr), I=count_I(cipr), S=count_S(cipr), n1=count_all(cipr), # the actual total; sum of all threen2=n_rsi(cipr), # same - analogous to n_distinct - total=n()) # NOT the amount of tested isolates! + total=n()) # NOT the amount of tested isolates!# Count co-resistance between amoxicillin/clav acid and gentamicin,# so we can see that combination therapy does a lot more than mono therapy. @@ -345,13 +345,13 @@ On our website https://msberends.gitla # Get portions S/I/R immediately of all rsi columns septic_patients %>% - select(amox, cipr) %>% + select(amox, cipr) %>%count_df(translate=FALSE) # It also supports grouping variablesseptic_patients%>% - select(hospital_id, amox, cipr) %>% - group_by(hospital_id) %>% + select(hospital_id, amox, cipr) %>% + group_by(hospital_id) %>%count_df(translate=FALSE) # } diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index f0a4078a..2cf3aafe 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012 diff --git a/man/figures/itis_logo.jpg b/docs/reference/figures/logo_itis.jpg similarity index 100% rename from man/figures/itis_logo.jpg rename to docs/reference/figures/logo_itis.jpg diff --git a/docs/reference/figures/logo_who.png b/docs/reference/figures/logo_who.png new file mode 100644 index 00000000..39d33ccb Binary files /dev/null and b/docs/reference/figures/logo_who.png differ diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index 367cf059..3256de9c 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012 @@ -368,11 +368,11 @@ On our website https://msberends.gitla library(dplyr) # Filter on first isolates:septic_patients%>% - mutate(first_isolate=first_isolate(., + mutate(first_isolate=first_isolate(., col_date="date", col_patient_id="patient_id", col_mo="mo")) %>% - filter(first_isolate==TRUE) + filter(first_isolate==TRUE) # Which can be shortened to:septic_patients%>% @@ -383,14 +383,14 @@ On our website https://msberends.gitla # Now let's see if first isolates matter: A <- septic_patients %>% - group_by(hospital_id) %>% - summarise(count=n_rsi(gent), # gentamicin availability + group_by(hospital_id) %>% + summarise(count=n_rsi(gent), # gentamicin availabilityresistance=portion_IR(gent)) # gentamicin resistanceB<-septic_patients%>%filter_first_weighted_isolate() %>%# the 1st isolate filter - group_by(hospital_id) %>% - summarise(count=n_rsi(gent), # gentamicin availability + group_by(hospital_id) %>% + summarise(count=n_rsi(gent), # gentamicin availabilityresistance=portion_IR(gent)) # gentamicin resistance# Have a look at A and B. diff --git a/docs/reference/freq.html b/docs/reference/freq.html index 1cf1f0f8..4f4c7ded 100644 --- a/docs/reference/freq.html +++ b/docs/reference/freq.html @@ -81,7 +81,7 @@ top_freq can be used to get the top/bottom n items of a frequency table, with co AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -385,34 +385,34 @@ On our website https://msberends.gitla # you could also use `select` or `pull` to get your variables septic_patients %>% - filter(hospital_id=="A") %>% - select(mo) %>% + filter(hospital_id=="A") %>% + select(mo) %>%freq() # multiple selected variables will be pasted togetherseptic_patients%>%left_join_microorganisms%>% - filter(hospital_id=="A") %>% + filter(hospital_id=="A") %>%freq(genus, species) # group a variable and analyse anotherseptic_patients%>% - group_by(hospital_id) %>% + group_by(hospital_id) %>%freq(gender) # get top 10 bugs of hospital A as a vectorseptic_patients%>% - filter(hospital_id=="A") %>% + filter(hospital_id=="A") %>%freq(mo) %>%top_freq(10) # save frequency table to an objectyears<-septic_patients%>% - mutate(year=format(date, "%Y")) %>% + mutate(year=format(date, "%Y")) %>%freq(year) @@ -463,11 +463,11 @@ On our website https://msberends.gitla # only get selected columns septic_patients %>% freq(hospital_id) %>% - select(item, percent) + select(item, percent) septic_patients%>%freq(hospital_id) %>% - select(-count, -cum_count) + select(-count, -cum_count) # check differences between frequency tables diff --git a/docs/reference/g.test.html b/docs/reference/g.test.html index b3d44776..b57f4db8 100644 --- a/docs/reference/g.test.html +++ b/docs/reference/g.test.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012 diff --git a/docs/reference/get_locale.html b/docs/reference/get_locale.html index 0ae61eab..f24eb95b 100644 --- a/docs/reference/get_locale.html +++ b/docs/reference/get_locale.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index 6e55fe3c..c4d2ae56 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -334,7 +334,7 @@ On our website https://msberends.gitla library(ggplot2) # get antimicrobial results for drugs against a UTI: -ggplot(septic_patients%>%select(amox, nitr, fosf, trim, cipr)) + +ggplot(septic_patients%>%select(amox, nitr, fosf, trim, cipr)) + geom_rsi() # prettify the plot using some additional functions: @@ -348,17 +348,17 @@ On our website https://msberends.gitla # or better yet, simplify this using the wrapper function - a single command: septic_patients %>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>%ggplot_rsi() # get only portions and no counts:septic_patients%>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>%ggplot_rsi(fun=portion_df) # add other ggplot2 parameters as you like:septic_patients%>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>%ggplot_rsi(width=0.5, colour="black", size=1, @@ -367,25 +367,25 @@ On our website https://msberends.gitla # resistance of ciprofloxacine per age group septic_patients %>% - mutate(first_isolate=first_isolate(.)) %>% - filter(first_isolate==TRUE, + mutate(first_isolate=first_isolate(.)) %>% + filter(first_isolate==TRUE, mo==as.mo("E. coli")) %>%# `age_group` is also a function of this package: - group_by(age_group=age_groups(age)) %>% - select(age_group, + group_by(age_group=age_groups(age)) %>% + select(age_group, cipr) %>%ggplot_rsi(x="age_group") # }# NOT RUN {# for colourblind mode, use divergent colours from the viridis package:septic_patients%>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>%ggplot_rsi() + scale_fill_viridis_d() # it also supports groups (don't forget to use the group var on `x` or `facet`):septic_patients%>% - select(hospital_id, amox, nitr, fosf, trim, cipr) %>% - group_by(hospital_id) %>% + select(hospital_id, amox, nitr, fosf, trim, cipr) %>% + group_by(hospital_id) %>%ggplot_rsi(x=hospital_id, facet=Antibiotic, nrow=1) + @@ -395,22 +395,22 @@ On our website https://msberends.gitla # genuine analysis: check 2 most prevalent microorganisms septic_patients %>% # create new bacterial ID's, with all CoNS under the same group (Becker et al.) - mutate(mo=as.mo(mo, Becker=TRUE)) %>% + mutate(mo=as.mo(mo, Becker=TRUE)) %>%# filter on top three bacterial ID's - filter(mo%in%top_freq(freq(.$mo), 3)) %>% + filter(mo%in%top_freq(freq(.$mo), 3)) %>%# determine first isolates - mutate(first_isolate=first_isolate(., + mutate(first_isolate=first_isolate(., col_date="date", col_patient_id="patient_id", col_mo="mo")) %>%# filter on first isolates - filter(first_isolate==TRUE) %>% + filter(first_isolate==TRUE) %>%# get short MO names (like "E. coli") - mutate(mo=mo_shortname(mo, Becker=TRUE)) %>% + mutate(mo=mo_shortname(mo, Becker=TRUE)) %>%# select this short name and some antiseptic drugs - select(mo, cfur, gent, cipr) %>% + select(mo, cfur, gent, cipr) %>%# group by MO - group_by(mo) %>% + group_by(mo) %>%# plot the thing, putting MOs on the facetggplot_rsi(x=Antibiotic, facet=mo, diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html index 2c99e0a2..3b84569e 100644 --- a/docs/reference/guess_ab_col.html +++ b/docs/reference/guess_ab_col.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012 diff --git a/docs/reference/index.html b/docs/reference/index.html index 7d3685a6..839e49a3 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012 @@ -244,6 +244,12 @@

    ITIS

    + + + + @@ -449,19 +455,19 @@ - + - + - + - +

    ITIS: Integrated Taxonomic Information System

    +

    WHOCC

    +

    WHO Collaborating Centre for Drug Statistics Methodology

    antibiotics

    Data set with 423 antibiotics

    Data set with ~500 antibiotics

    microorganisms

    Data set with taxonomic data from ITIS

    Data set with ~20,000 microorganisms

    septic_patients

    Data set with 2000 blood culture isolates of septic patients

    Data set with 2,000 blood culture isolates from septic patients

    @@ -473,7 +479,7 @@

    microorganisms.old

    Data set with old taxonomic data from ITIS

    Data set with previously accepted taxonomic names

    diff --git a/docs/reference/join.html b/docs/reference/join.html index 0df6d4d2..ff20d244 100644 --- a/docs/reference/join.html +++ b/docs/reference/join.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html index 85cb95f8..57ca05ad 100644 --- a/docs/reference/key_antibiotics.html +++ b/docs/reference/key_antibiotics.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012 @@ -334,8 +334,8 @@ On our website https://msberends.gitla library(dplyr) # set key antibiotics to a new variable my_patients <- septic_patients %>% - mutate(keyab = key_antibiotics(.)) %>% - mutate( + mutate(keyab = key_antibiotics(.)) %>% + mutate( # now calculate first isolates first_regular = first_isolate(., col_keyantibiotics = FALSE), # and first WEIGHTED isolates diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html index a946dc17..65f65f9d 100644 --- a/docs/reference/kurtosis.html +++ b/docs/reference/kurtosis.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 diff --git a/docs/reference/like.html b/docs/reference/like.html index eb0bf08d..6dfd0338 100644 --- a/docs/reference/like.html +++ b/docs/reference/like.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -295,7 +295,7 @@ On our website https://msberends.gitla library(dplyr) septic_patients %>% left_join_microorganisms() %>% - filter(genus %like% '^ent') %>% + filter(genus %like% '^ent') %>% freq(genus, species) # } diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index 0bccdc5d..43ed5daa 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012 @@ -618,7 +618,7 @@ On our website https://msberends.gitla library(dplyr) septic_patients %>% - mutate(EUCAST = mdro(.), + mutate(EUCAST = mdro(.), BRMO = brmo(.)) # } diff --git a/docs/reference/microorganisms.codes.html b/docs/reference/microorganisms.codes.html index 0cc3f176..4ef7aecb 100644 --- a/docs/reference/microorganisms.codes.html +++ b/docs/reference/microorganisms.codes.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012 diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index b8d69189..767e0847 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -6,7 +6,7 @@ -Data set with taxonomic data from ITIS — microorganisms • AMR (for R) +Data set with ~20,000 microorganisms — microorganisms • AMR (for R) @@ -45,9 +45,9 @@ - + - + @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012 @@ -216,14 +216,14 @@
    -

    A data set containing the complete microbial taxonomy of the kingdoms Bacteria, Fungi and Protozoa. MO codes can be looked up using as.mo.

    +

    A data set containing the complete microbial taxonomy of the kingdoms Bacteria, Fungi and Protozoa from ITIS. MO codes can be looked up using as.mo.

    @@ -251,14 +251,14 @@

    Source

    -

    [3] Integrated Taxonomic Information System (ITIS) on-line database, https://www.itis.gov.

    +

    Integrated Taxonomic Information System (ITIS) public online database, https://www.itis.gov.

    ITIS

    -


    +


    This package contains the complete microbial taxonomic data (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, https://www.itis.gov).

    -

    All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

    +

    All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

    ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].

    Read more on our website!

    diff --git a/docs/reference/microorganisms.old.html b/docs/reference/microorganisms.old.html index 6a8449e5..3b949e8d 100644 --- a/docs/reference/microorganisms.old.html +++ b/docs/reference/microorganisms.old.html @@ -6,7 +6,7 @@ -Data set with old taxonomic data from ITIS — microorganisms.old • AMR (for R) +Data set with previously accepted taxonomic names — microorganisms.old • AMR (for R) @@ -45,7 +45,7 @@ - + @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012
    @@ -216,7 +216,7 @@
    @@ -245,9 +245,9 @@

    ITIS

    -


    +


    This package contains the complete microbial taxonomic data (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, https://www.itis.gov).

    -

    All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

    +

    All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

    ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].

    Read more on our website!

    diff --git a/docs/reference/mo_failures.html b/docs/reference/mo_failures.html index 309f5734..cd653b0b 100644 --- a/docs/reference/mo_failures.html +++ b/docs/reference/mo_failures.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012
    diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index a7547f80..7b9099f2 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012
    @@ -312,9 +312,9 @@

    ITIS

    -


    +


    This package contains the complete microbial taxonomic data (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, https://www.itis.gov).

    -

    All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

    +

    All ~20,000 (sub)species from the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria.

    ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].

    Source

    diff --git a/docs/reference/mo_renamed.html b/docs/reference/mo_renamed.html index 11ec3055..599f638e 100644 --- a/docs/reference/mo_renamed.html +++ b/docs/reference/mo_renamed.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012
    diff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html index 2a624675..c0f7d109 100644 --- a/docs/reference/mo_source.html +++ b/docs/reference/mo_source.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9011 + 0.5.0.9012 diff --git a/docs/reference/p.symbol.html b/docs/reference/p.symbol.html index 1ea7acd0..a2628c1b 100644 --- a/docs/reference/p.symbol.html +++ b/docs/reference/p.symbol.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 diff --git a/docs/reference/portion.html b/docs/reference/portion.html index 38753337..d046bdcc 100644 --- a/docs/reference/portion.html +++ b/docs/reference/portion.html @@ -81,7 +81,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -340,17 +340,17 @@ On our website https://msberends.gitla septic_patients %>% portion_SI(amox) septic_patients %>% - group_by(hospital_id) %>% - summarise(p = portion_S(cipr), + group_by(hospital_id) %>% + summarise(p = portion_S(cipr), n = n_rsi(cipr)) # n_rsi works like n_distinct in dplyr septic_patients %>% - group_by(hospital_id) %>% - summarise(R = portion_R(cipr, as_percent = TRUE), + group_by(hospital_id) %>% + summarise(R = portion_R(cipr, as_percent = TRUE), I = portion_I(cipr, as_percent = TRUE), S = portion_S(cipr, as_percent = TRUE), n = n_rsi(cipr), # works like n_distinct in dplyr - total = n()) # NOT the amount of tested isolates! + total = n()) # NOT the amount of tested isolates! # Calculate co-resistance between amoxicillin/clav acid and gentamicin, # so we can see that combination therapy does a lot more than mono therapy: @@ -365,8 +365,8 @@ On our website https://msberends.gitla septic_patients %>% - group_by(hospital_id) %>% - summarise(cipro_p = portion_S(cipr, as_percent = TRUE), + group_by(hospital_id) %>% + summarise(cipro_p = portion_S(cipr, as_percent = TRUE), cipro_n = count_all(cipr), genta_p = portion_S(gent, as_percent = TRUE), genta_n = count_all(gent), @@ -375,22 +375,22 @@ On our website https://msberends.gitla # Get portions S/I/R immediately of all rsi columns septic_patients %>% - select(amox, cipr) %>% + select(amox, cipr) %>% portion_df(translate = FALSE) # It also supports grouping variables septic_patients %>% - select(hospital_id, amox, cipr) %>% - group_by(hospital_id) %>% + select(hospital_id, amox, cipr) %>% + group_by(hospital_id) %>% portion_df(translate = FALSE) # }# NOT RUN { # calculate current empiric combination therapy of Helicobacter gastritis: my_table %>% - filter(first_isolate == TRUE, + filter(first_isolate == TRUE, genus == "Helicobacter") %>% - summarise(p = portion_S(amox, metr), # amoxicillin with metronidazole + summarise(p = portion_S(amox, metr), # amoxicillin with metronidazole n = count_all(amox, metr)) # } diff --git a/docs/reference/read.4D.html b/docs/reference/read.4D.html index cbf9dec1..03602767 100644 --- a/docs/reference/read.4D.html +++ b/docs/reference/read.4D.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html index b80b0b65..e2f7a9a0 100644 --- a/docs/reference/resistance_predict.html +++ b/docs/reference/resistance_predict.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9010 + 0.5.0.9012 @@ -341,7 +341,7 @@ On our website https://msberends.gitla library(dplyr) x <- septic_patients %>% filter_first_isolate() %>% - filter(mo_genus(mo) == "Staphylococcus") %>% + filter(mo_genus(mo) == "Staphylococcus") %>% resistance_predict("peni") plot(x) @@ -350,7 +350,7 @@ On our website https://msberends.gitla if (!require(ggplot2)) { data <- septic_patients %>% - filter(mo == as.mo("E. coli")) %>% + filter(mo == as.mo("E. coli")) %>% resistance_predict(col_ab = "amox", col_date = "date", info = FALSE, diff --git a/docs/reference/rsi.html b/docs/reference/rsi.html index bfc62eaa..a7bf1ab8 100644 --- a/docs/reference/rsi.html +++ b/docs/reference/rsi.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 diff --git a/docs/reference/septic_patients.html b/docs/reference/septic_patients.html index 997bfc00..b7d1d224 100644 --- a/docs/reference/septic_patients.html +++ b/docs/reference/septic_patients.html @@ -6,7 +6,7 @@ -Data set with 2000 blood culture isolates of septic patients — septic_patients • AMR (for R) +Data set with 2,000 blood culture isolates from septic patients — septic_patients • AMR (for R) @@ -45,7 +45,7 @@ - + @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012 @@ -216,7 +216,7 @@
    diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html index 6e3ef8cd..0340e3cb 100644 --- a/docs/reference/skewness.html +++ b/docs/reference/skewness.html @@ -81,7 +81,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr AMR (for R) - 0.5.0.9009 + 0.5.0.9012
    diff --git a/docs/reference/supplementary_data.html b/docs/reference/supplementary_data.html index 742f1541..172172b6 100644 --- a/docs/reference/supplementary_data.html +++ b/docs/reference/supplementary_data.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9009 + 0.5.0.9012
    diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 5fde7870..23a976c0 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -12,6 +12,9 @@ https://msberends.gitlab.io/AMR/reference/ITIS.html + + https://msberends.gitlab.io/AMR/reference/WHOCC.html + https://msberends.gitlab.io/AMR/reference/ab_property.html diff --git a/index.md b/index.md index 3c8e01a8..fced3873 100644 --- a/index.md +++ b/index.md @@ -52,15 +52,23 @@ To find out how to conduct AMR analysis, please [continue reading here to get st ### Short introduction -#### Taxonomic reference data +#### Microbial (taxonomic) reference data - + This package contains the **complete microbial taxonomic data** (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, https://www.itis.gov). -All ~20,000 (sub)species from **the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package**, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. +All ~20,000 (sub)species from **the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package**, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. -Read more about ITIS [in our manual](./reference/ITIS.html). +Read more about the data from ITIS [in our manual](./reference/ITIS.html). + +#### Antimicrobial reference data + +

    WHO Collaborating Centre for Drug Statistics Methodology

    + +This package contains **all ~500 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD)** from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the [Pharmaceuticals Community Register of the European Commission](http://ec.europa.eu/health/documents/community-register/html/atc.htm). + +Read more about the data from WHOCC [in our manual](./reference/WHOCC.html). #### Overview of functions diff --git a/man/ITIS.Rd b/man/ITIS.Rd index 1da178e2..f3b80113 100644 --- a/man/ITIS.Rd +++ b/man/ITIS.Rd @@ -8,10 +8,10 @@ All taxonomic names of all microorganisms are included in this package, using th } \section{ITIS}{ -\if{html}{\figure{itis_logo.jpg}{options: height=60px style=margin-bottom:5px} \cr} +\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr} This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}). -All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. +All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3]. } diff --git a/man/WHOCC.Rd b/man/WHOCC.Rd new file mode 100644 index 00000000..9b4e1973 --- /dev/null +++ b/man/WHOCC.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/whocc.R +\name{WHOCC} +\alias{WHOCC} +\title{WHO Collaborating Centre for Drug Statistics Methodology} +\description{ +All antimicrobial drugs and their official names, ATC codes, ATC groups and defined daily dose (DDD) are included in this package, using the WHO Collaborating Centre for Drug Statistics Methodology. +} +\section{WHOCC}{ + +\if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} +This package contains \strong{all ~500 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD)} from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). + +These have become the gold standard for international drug utilisation monitoring and research. + +The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. +} + +\section{Read more on our website!}{ + +\if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +} + +\examples{ +as.atc("meropenem") +ab_name("J01DH02") + +ab_tradenames("flucloxacillin") +} diff --git a/man/abname.Rd b/man/abname.Rd index 093eca7b..e59aae6e 100644 --- a/man/abname.Rd +++ b/man/abname.Rd @@ -25,6 +25,16 @@ Convert antibiotic codes to a (trivial) antibiotic name or ATC code, or vice ver \details{ \strong{The \code{\link{ab_property}} functions are faster and more concise}, but do not support concatenated strings, like \code{abname("AMCL+GENT"}. } +\section{WHOCC}{ + +\if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} +This package contains \strong{all ~500 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD)} from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). + +These have become the gold standard for international drug utilisation monitoring and research. + +The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. +} + \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} diff --git a/man/age.Rd b/man/age.Rd index 062d18d9..a332bc80 100644 --- a/man/age.Rd +++ b/man/age.Rd @@ -23,6 +23,10 @@ Calculates age in years based on a reference date, which is the sytem date at de On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. } +\examples{ +df <- data.frame(birth_date = Sys.Date() - runif(100) * 25000) +df$age <- age(df$birth_date) +} \seealso{ \code{\link{age_groups}} to split age into age groups } diff --git a/man/antibiotics.Rd b/man/antibiotics.Rd index 7e274d69..e4b838e0 100644 --- a/man/antibiotics.Rd +++ b/man/antibiotics.Rd @@ -3,8 +3,8 @@ \docType{data} \name{antibiotics} \alias{antibiotics} -\title{Data set with 423 antibiotics} -\format{A \code{\link{data.frame}} with 423 observations and 18 variables: +\title{Data set with ~500 antibiotics} +\format{A \code{\link{data.frame}} with 488 observations and 16 variables: \describe{ \item{\code{atc}}{ATC code, like \code{J01CR02}} \item{\code{certe}}{Certe code, like \code{amcl}} @@ -20,13 +20,15 @@ \item{\code{iv_units}}{Units of \code{iv_ddd}} \item{\code{atc_group1}}{ATC group, like \code{"Macrolides, lincosamides and streptogramins"}} \item{\code{atc_group2}}{Subgroup of \code{atc_group1}, like \code{"Macrolides"}} - \item{\code{atc_group1_nl}}{ATC group in Dutch, like \code{"Macroliden, lincosamiden en streptograminen"}} - \item{\code{atc_group2_nl}}{Subgroup of \code{atc_group1} in Dutch, like \code{"Macroliden"}} \item{\code{useful_gramnegative}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)} \item{\code{useful_grampositive}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)} }} \source{ -- World Health Organization: \url{https://www.whocc.no/atc_ddd_index/} \cr - EUCAST - Expert rules intrinsic exceptional V3.1 \cr - MOLIS (LIS of Certe): \url{https://www.certe.nl} \cr - GLIMS (LIS of UMCG): \url{https://www.umcg.nl} +- World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/} + +EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016: \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf} + +European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm} } \usage{ antibiotics diff --git a/man/as.atc.Rd b/man/as.atc.Rd index 6266375c..bafafb32 100644 --- a/man/as.atc.Rd +++ b/man/as.atc.Rd @@ -28,6 +28,16 @@ Use the \code{\link{ab_property}} functions to get properties based on the retur In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups. Source: \url{https://www.whocc.no/atc/structure_and_principles/} } +\section{WHOCC}{ + +\if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} +This package contains \strong{all ~500 antimicrobial drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD)} from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). + +These have become the gold standard for international drug utilisation monitoring and research. + +The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. +} + \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} diff --git a/man/as.mo.Rd b/man/as.mo.Rd index 5502655b..c759b316 100644 --- a/man/as.mo.Rd +++ b/man/as.mo.Rd @@ -85,10 +85,10 @@ When using \code{allow_uncertain = TRUE} (which is the default setting), it will \section{ITIS}{ -\if{html}{\figure{itis_logo.jpg}{options: height=60px style=margin-bottom:5px} \cr} +\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr} This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}). -All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. +All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3]. } diff --git a/man/figures/logo_certe.png b/man/figures/logo_certe.png deleted file mode 100755 index 001925f1..00000000 Binary files a/man/figures/logo_certe.png and /dev/null differ diff --git a/man/figures/logo_eh1h.png b/man/figures/logo_eh1h.png deleted file mode 100755 index 0efc8e83..00000000 Binary files a/man/figures/logo_eh1h.png and /dev/null differ diff --git a/man/figures/logo_interreg.png b/man/figures/logo_interreg.png deleted file mode 100755 index 723a9aea..00000000 Binary files a/man/figures/logo_interreg.png and /dev/null differ diff --git a/man/figures/logo_itis.jpg b/man/figures/logo_itis.jpg new file mode 100644 index 00000000..e2788e42 Binary files /dev/null and b/man/figures/logo_itis.jpg differ diff --git a/man/figures/logo_rug.png b/man/figures/logo_rug.png deleted file mode 100755 index 23d14c38..00000000 Binary files a/man/figures/logo_rug.png and /dev/null differ diff --git a/man/figures/logo_umcg.png b/man/figures/logo_umcg.png deleted file mode 100755 index d562a34e..00000000 Binary files a/man/figures/logo_umcg.png and /dev/null differ diff --git a/man/figures/logo_who.png b/man/figures/logo_who.png new file mode 100644 index 00000000..39d33ccb Binary files /dev/null and b/man/figures/logo_who.png differ diff --git a/man/microorganisms.Rd b/man/microorganisms.Rd index 75b63fee..e6e67e1a 100755 --- a/man/microorganisms.Rd +++ b/man/microorganisms.Rd @@ -3,7 +3,7 @@ \docType{data} \name{microorganisms} \alias{microorganisms} -\title{Data set with taxonomic data from ITIS} +\title{Data set with ~20,000 microorganisms} \format{A \code{\link{data.frame}} with 18,833 observations and 15 variables: \describe{ \item{\code{mo}}{ID of microorganism} @@ -23,20 +23,20 @@ \item{\code{ref}}{Author(s) and year of concerning publication as found in ITIS, see Source} }} \source{ -[3] Integrated Taxonomic Information System (ITIS) on-line database, \url{https://www.itis.gov}. +Integrated Taxonomic Information System (ITIS) public online database, \url{https://www.itis.gov}. } \usage{ microorganisms } \description{ -A data set containing the complete microbial taxonomy of the kingdoms Bacteria, Fungi and Protozoa. MO codes can be looked up using \code{\link{as.mo}}. +A data set containing the complete microbial taxonomy of the kingdoms Bacteria, Fungi and Protozoa from ITIS. MO codes can be looked up using \code{\link{as.mo}}. } \section{ITIS}{ -\if{html}{\figure{itis_logo.jpg}{options: height=60px style=margin-bottom:5px} \cr} +\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr} This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}). -All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. +All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3]. } diff --git a/man/microorganisms.old.Rd b/man/microorganisms.old.Rd index fc532222..49ceaf13 100644 --- a/man/microorganisms.old.Rd +++ b/man/microorganisms.old.Rd @@ -3,7 +3,7 @@ \docType{data} \name{microorganisms.old} \alias{microorganisms.old} -\title{Data set with old taxonomic data from ITIS} +\title{Data set with previously accepted taxonomic names} \format{A \code{\link{data.frame}} with 2,383 observations and 4 variables: \describe{ \item{\code{tsn}}{Old Taxonomic Serial Number (TSN), as defined by ITIS} @@ -22,10 +22,10 @@ A data set containing old (previously valid or accepted) taxonomic names accordi } \section{ITIS}{ -\if{html}{\figure{itis_logo.jpg}{options: height=60px style=margin-bottom:5px} \cr} +\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr} This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}). -All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. +All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3]. } diff --git a/man/mo_property.Rd b/man/mo_property.Rd index 786c8ea2..68845b44 100644 --- a/man/mo_property.Rd +++ b/man/mo_property.Rd @@ -94,10 +94,10 @@ Supported languages are \code{"en"} (English), \code{"de"} (German), \code{"nl"} \section{ITIS}{ -\if{html}{\figure{itis_logo.jpg}{options: height=60px style=margin-bottom:5px} \cr} +\if{html}{\figure{logo_itis.jpg}{options: height=60px style=margin-bottom:5px} \cr} This package contains the \strong{complete microbial taxonomic data} (with all nine taxonomic ranks - from kingdom to subspecies) from the publicly available Integrated Taxonomic Information System (ITIS, \url{https://www.itis.gov}). -All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. +All ~20,000 (sub)species from \strong{the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package}, as well as all their ~2,500 previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3]. } diff --git a/man/septic_patients.Rd b/man/septic_patients.Rd index 18a6ac18..96393e53 100755 --- a/man/septic_patients.Rd +++ b/man/septic_patients.Rd @@ -3,7 +3,7 @@ \docType{data} \name{septic_patients} \alias{septic_patients} -\title{Data set with 2000 blood culture isolates of septic patients} +\title{Data set with 2,000 blood culture isolates from septic patients} \format{A \code{\link{data.frame}} with 2,000 observations and 49 variables: \describe{ \item{\code{date}}{date of receipt at the laboratory} diff --git a/pkgdown/extra.css b/pkgdown/extra.css index 2736db17..ed8c6f3e 100644 --- a/pkgdown/extra.css +++ b/pkgdown/extra.css @@ -165,7 +165,20 @@ table a:not(.btn):hover, .table a:not(.btn):hover { text-decoration: underline; } +/* text below header in manual overview */ .template-reference-index h2 ~ p { font-size: 110%; /* font-weight: bold; */ } + +/* logos on index page */ +.logo_img { + display: inline-block; +} +.logo_txt { + display: inline; + font-size: 125%; + vertical-align: middle; + color: black; + font-weight: bold; +} diff --git a/tests/testthat/test-age.R b/tests/testthat/test-age.R index dc1857a2..0bf18745 100644 --- a/tests/testthat/test-age.R +++ b/tests/testthat/test-age.R @@ -29,7 +29,7 @@ test_that("age works", { expect_error(age(x = c("1980-01-01", "1985-01-01", "1990-01-01"), reference = c("2019-01-01", "2019-01-01"))) - expect_error(age(x = c("1980-01-01", "1985-01-01", "1990-01-01"), + expect_warning(age(x = c("1980-01-01", "1985-01-01", "1990-01-01"), reference = "1975-01-01")) expect_warning(age(x = c("1800-01-01", "1805-01-01", "1810-01-01"),