diff --git a/DESCRIPTION b/DESCRIPTION index 71a599cba..351d9aefa 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.4.0.9041 -Date: 2020-12-17 +Version: 1.4.0.9042 +Date: 2020-12-21 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index dae2f341b..05e9abd62 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,9 @@ -# AMR 1.4.0.9041 -## Last updated: 17 December 2020 - -Note: some changes in this version were suggested by anonymous reviewers from the journal we submitted our manuscript about this package to. We are those reviewers very grateful for going through our code so thoroughly! +# AMR 1.4.0.9042 +## Last updated: 21 December 2020 ### New * Function `is_new_episode()` to determine patient episodes which are not necessarily based on microorganisms. It also supports grouped variables with e.g. `mutate()`, `filter()` and `summarise()` of the `dplyr` package: + ```r library(dplyr) example_isolates %>% @@ -18,6 +17,7 @@ Note: some changes in this version were suggested by anonymous reviewers from th ### Changed * Reference data used for `as.rsi()` can now be set by the user, using the `reference_data` parameter. This allows for using own interpretation guidelines. The user-set data must have the same structure as `rsi_translation`. * Some functions are now context-aware when used inside `dplyr` verbs, such as `filter()`, `mutate()` and `summarise()`. This means that then the data parameter does not need to be set anymore. This is the case for the new functions `mo_is_gram_negative()`, `mo_is_gram_positive()`, `mo_is_intrinsic_resistant()` and for the existing functions `first_isolate()`, `key_antibiotics()`, `mdro()`, `brmo()`, `mrgn()`, `mdr_tb()`, `mdr_cmi2012()`, `eucast_exceptional_phenotypes()`. This was already the case for antibiotic selection functions (such as using `penicillins()` in `dplyr::select()`). + ```r # to select first isolates that are Gram-negative # and view results of cephalosporins and aminoglycosides: @@ -26,7 +26,7 @@ Note: some changes in this version were suggested by anonymous reviewers from th filter(first_isolate(), mo_is_gram_negative()) %>% select(mo, cephalosporins(), aminoglycosides()) %>% as_tibble() -``` + ``` * For all function parameters in the code, it is now defined what the exact type of user input should be (inspired by the [`typed`](https://github.com/moodymudskipper/typed) package). If the user input for a certain function does not meet the requirements for a specific parameter (such as the class or length), an informative error will be thrown. This makes the package more robust and the use of it more reproducible and reliable. In total, more than 400 arguments were defined. * Fix for `set_mo_source()`, that previously would not remember the file location of the original file * Deprecated function `p_symbol()` that not really fits the scope of this package. It will be removed in a future version. See [here](https://github.com/msberends/AMR/blob/v1.4.0/R/p_symbol.R) for the source code to preserve it. @@ -49,17 +49,17 @@ Note: some changes in this version were suggested by anonymous reviewers from th * All messages and warnings thrown by this package now break sentences on whole words * More extensive unit tests * Internal calls to `options()` were all removed in favour of a new internal environment `mo_env` +* Our website now also has a dark theme, that switches on automatically based on system settings (such as Night Mode in macOS) # AMR 1.4.0 -Note: some changes in this version were suggested by anonymous reviewers from the journal we submitted our manuscript about this package to. We are those reviewers very grateful for going through our code so thoroughly! - ### New * Support for 'EUCAST Expert Rules' / 'EUCAST Intrinsic Resistance and Unusual Phenotypes' version 3.2 of May 2020. With this addition to the previously implemented version 3.1 of 2016, the `eucast_rules()` function can now correct for more than 180 different antibiotics and the `mdro()` function can determine multidrug resistance based on more than 150 different antibiotics. All previously implemented versions of the EUCAST rules are now maintained and kept available in this package. The `eucast_rules()` function consequently gained the parameters `version_breakpoints` (at the moment defaults to v10.0, 2020) and `version_expertrules` (at the moment defaults to v3.2, 2020). The `example_isolates` data set now also reflects the change from v3.1 to v3.2. The `mdro()` function now accepts `guideline == "EUCAST3.1"` and `guideline == "EUCAST3.2"`. * A new vignette and website page with info about all our public and freely available data sets, that can be downloaded as flat files or in formats for use in R, SPSS, SAS, Stata and Excel: https://msberends.github.io/AMR/articles/datasets.html * Data set `intrinsic_resistant`. This data set contains all bug-drug combinations where the 'bug' is intrinsic resistant to the 'drug' according to the latest EUCAST insights. It contains just two columns: `microorganism` and `antibiotic`. Curious about which enterococci are actually intrinsic resistant to vancomycin? + ```r library(AMR) library(dplyr) diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index ddc601c3a..470264b0d 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -514,7 +514,7 @@ meet_criteria <- function(object, } get_current_data <- function(arg_name, call) { - # this mimics dplyr::cur_data_all for users that use our content-aware functions in dplyr verbs + # this mimics dplyr::cur_data_all for users that use our context-aware functions in dplyr verbs cur_data_all_dplyr <- import_fn("cur_data_all", "dplyr", error_on_fail = FALSE) if (is.null(cur_data_all_dplyr)) { # dplyr not installed diff --git a/R/amr.R b/R/amr.R index 34f350180..eb6f405ae 100644 --- a/R/amr.R +++ b/R/amr.R @@ -27,11 +27,11 @@ #' #' Welcome to the `AMR` package. #' @details -#' `AMR` is a free, open-source and independent R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. Our aim is to provide a standard for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting. +#' `AMR` is a free, open-source and independent \R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. Our aim is to provide a standard for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting. #' -#' After installing this package, R knows ~70,000 distinct microbial species and all ~550 antibiotic, antimycotic and antiviral drugs by name and code (including ATC, EARS-NET, LOINC and SNOMED CT), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data. +#' After installing this package, \R knows ~70,000 distinct microbial species and all ~550 antibiotic, antimycotic and antiviral drugs by name and code (including ATC, EARS-NET, LOINC and SNOMED CT), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data. #' -#' This package is fully independent of any other R package and works on Windows, macOS and Linux with all versions of R since R-3.0.0 (April 2013). It was designed to work in any setting, including those with very limited resources. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the University of Groningen, in collaboration with non-profit organisations Certe Medical Diagnostics and Advice and University Medical Center Groningen. This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation. +#' This package is fully independent of any other \R package and works on Windows, macOS and Linux with all versions of \R since R-3.0.0 (April 2013). It was designed to work in any setting, including those with very limited resources. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the University of Groningen, in collaboration with non-profit organisations Certe Medical Diagnostics and Advice and University Medical Center Groningen. This \R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation. #' #' This package can be used for: #' - Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the Catalogue of Life and List of Prokaryotic names with Standing in Nomenclature diff --git a/R/catalogue_of_life.R b/R/catalogue_of_life.R index 239e6b388..2ed305cce 100755 --- a/R/catalogue_of_life.R +++ b/R/catalogue_of_life.R @@ -58,7 +58,7 @@ format_included_data_number <- function(data) { #' #' The Catalogue of Life () is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.9 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation. #' -#' The syntax used to transform the original data to a cleansed R format, can be found here: . +#' The syntax used to transform the original data to a cleansed \R format, can be found here: . #' @inheritSection AMR Read more on our website! #' @name catalogue_of_life #' @rdname catalogue_of_life diff --git a/R/data.R b/R/data.R index 2db759734..c72e0c1c0 100755 --- a/R/data.R +++ b/R/data.R @@ -58,12 +58,12 @@ #' Synonyms (i.e. trade names) are derived from the Compound ID (`cid`) and consequently only available where a CID is available. #' #' ### Direct download -#' These data sets are available as 'flat files' for use even without R - you can find the files here: +#' These data sets are available as 'flat files' for use even without \R - you can find the files here: #' #' * #' * #' -#' Files in R format (with preserved data structure) can be found here: +#' Files in \R format (with preserved data structure) can be found here: #' #' * #' * @@ -106,11 +106,11 @@ #' - `r format(nrow(subset(microorganisms, source == "DSMZ")), big.mark = ",")` species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications #' #' ### Direct download -#' This data set is available as 'flat file' for use even without R - you can find the file here: +#' This data set is available as 'flat file' for use even without \R - you can find the file here: #' #' * #' -#' The file in R format (with preserved data structure) can be found here: +#' The file in \R format (with preserved data structure) can be found here: #' #' * #' @section About the records from DSMZ (see source): diff --git a/R/mo_source.R b/R/mo_source.R index db55a1dc8..186ef2fbf 100644 --- a/R/mo_source.R +++ b/R/mo_source.R @@ -34,9 +34,9 @@ #' @rdname mo_source #' @name mo_source #' @aliases set_mo_source get_mo_source -#' @details The reference file can be a text file separated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you will need to have the `readxl` package installed. +#' @details The reference file can be a text file separated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an \R object file (extension '.rds'). To use an Excel file, you will need to have the `readxl` package installed. #' -#' [set_mo_source()] will check the file for validity: it must be a [data.frame], must have a column named `"mo"` which contains values from [`microorganisms$mo`][microorganisms] and must have a reference column with your own defined values. If all tests pass, [set_mo_source()] will read the file into R and will ask to export it to `"~/mo_source.rds"`. The CRAN policy disallows packages to write to the file system, although '*exceptions may be allowed in interactive sessions if the package obtains confirmation from the user*'. For this reason, this function only works in interactive sessions so that the user can **specifically confirm and allow** that this file will be created. The destination of this file can be set with the `destination` parameter and defaults to the user's home directory. It can also be set as an \R option, using `options(AMR_mo_source = "my/location/file.rds)`. +#' [set_mo_source()] will check the file for validity: it must be a [data.frame], must have a column named `"mo"` which contains values from [`microorganisms$mo`][microorganisms] and must have a reference column with your own defined values. If all tests pass, [set_mo_source()] will read the file into \R and will ask to export it to `"~/mo_source.rds"`. The CRAN policy disallows packages to write to the file system, although '*exceptions may be allowed in interactive sessions if the package obtains confirmation from the user*'. For this reason, this function only works in interactive sessions so that the user can **specifically confirm and allow** that this file will be created. The destination of this file can be set with the `destination` parameter and defaults to the user's home directory. It can also be set as an \R option, using `options(AMR_mo_source = "my/location/file.rds")`. #' #' The created compressed data file `"mo_source.rds"` will be used at default for MO determination (function [as.mo()] and consequently all `mo_*` functions like [mo_genus()] and [mo_gramstain()]). The location and timestamp of the original file will be saved as an attribute to the compressed data file. #' diff --git a/_pkgdown.yml b/_pkgdown.yml index d2e1f4912..d0bb5f754 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -212,7 +212,8 @@ authors: href: https://www.rug.nl/staff/c.glasner/ template: + # this requires the 'preferably' package, https://github.com/amirmasoudabdol/preferably/ + package: preferably assets: "pkgdown/logos" # use logos in this folder params: noindex: false - bootswatch: "flatly" diff --git a/docs/404.html b/docs/404.html index 85039b20f..4ef2cd57d 100644 --- a/docs/404.html +++ b/docs/404.html @@ -6,6 +6,22 @@ + + + + Page not found (404) • AMR (for R) @@ -19,11 +35,22 @@ - - + + + + + + + + + + + + + @@ -58,6 +85,9 @@ + + + + + + License • AMR (for R) @@ -19,11 +35,22 @@ - - + + + + + + + + + + + + + @@ -58,6 +85,9 @@ + + + +How to conduct AMR analysis • AMR (for R) - - + + + + + + @@ -39,7 +56,7 @@ AMR (for R) - 1.4.0.9032 + 1.4.0.9042 @@ -47,14 +64,14 @@