diff --git a/DESCRIPTION b/DESCRIPTION index 45f7ab3e..ec533542 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 0.7.1.9079 +Version: 0.7.1.9080 Date: 2019-09-22 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index 5b8024ed..2f2680f5 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 0.7.1.9079 +# AMR 0.7.1.9080 Last updated: 22-Sep-2019 ### Breaking @@ -79,6 +79,7 @@ * These new trivial names known to the field are now understood: meningococcus, gonococcus, pneumococcus * Updated to the latest taxonomic data (updated to August 2019, from the International Journal of Systematic and Evolutionary Microbiology * Added support for Viridans Group Streptococci (VGS) and Milleri Group Streptococci (MGS) + * Added support for *Blastocystis* * Added support for 5,000 new fungi * Added support for unknown yeasts and fungi * Changed most microorganism IDs to improve readability. **IMPORTANT:** Because of these changes, the microorganism IDs have been changed to a slightly different format. Old microorganism IDs are still supported, but support will be dropped in a future version. Use `as.mo()` on your old codes to transform them to the new format. @@ -105,6 +106,7 @@ * Using negative values for `x` in `age_groups()` will now introduce `NA`s and not return an error anymore * Fix for determining the system's language * Fix for `key_antibiotics()` on foreign systems +* Added 80 new LIS codes for microorganisms #### Other * Added Prof. Dr. Casper Albers as doctoral advisor and added Dr. Judith Fonville, Eric Hazenberg, Dr. Bart Meijer, Dr. Dennis Souverein and Annick Lenglet as contributors diff --git a/R/data.R b/R/data.R index e4c4477d..755cff3b 100755 --- a/R/data.R +++ b/R/data.R @@ -55,7 +55,7 @@ #' #' A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using \code{\link{as.mo}}. #' @inheritSection catalogue_of_life Catalogue of Life -#' @format A \code{\link{data.frame}} with 69,454 observations and 16 variables: +#' @format A \code{\link{data.frame}} with 69,465 observations and 16 variables: #' \describe{ #' \item{\code{mo}}{ID of microorganism as used by this package} #' \item{\code{col_id}}{Catalogue of Life ID} @@ -72,6 +72,7 @@ #' \item{11 entries of \emph{Streptococcus} (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)} #' \item{2 entries of \emph{Staphylococcus} (coagulase-negative [CoNS] and coagulase-positive [CoPS])} #' \item{3 entries of \emph{Trichomonas} (\emph{Trichomonas vaginalis}, and its family and genus)} +#' \item{1 entry of \emph{Blastocystis} (\emph{Blastocystis hominis}), although it officially does not exist (Noel et al. 2005, PMID 15634993)} #' \item{5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)} #' \item{9,460 species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications} #' } @@ -114,7 +115,7 @@ catalogue_of_life <- list( #' Translation table for common microorganism codes #' #' A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with \code{\link{set_mo_source}}. -#' @format A \code{\link{data.frame}} with 4,927 observations and 2 variables: +#' @format A \code{\link{data.frame}} with 5,006 observations and 2 variables: #' \describe{ #' \item{\code{code}}{Commonly used code of a microorganism} #' \item{\code{mo}}{ID of the microorganism in the \code{\link{microorganisms}} data set} diff --git a/R/filter_ab_class.R b/R/filter_ab_class.R index 634aa8d2..6b3bfd88 100644 --- a/R/filter_ab_class.R +++ b/R/filter_ab_class.R @@ -26,7 +26,7 @@ #' @param ab_class an antimicrobial class, like \code{"carbapenems"}, as can be found in \code{AMR::antibiotics$group} #' @param result an antibiotic result: S, I or R (or a combination of more of them) #' @param scope the scope to check which variables to check, can be \code{"any"} (default) or \code{"all"} -#' @param ... parameters passed on to \code{\link[dplyr]{filter_at}} +#' @param ... parameters passed on to \code{filter_at} from the \code{dplyr} package #' @details The \code{group} column in \code{\link{antibiotics}} data set will be searched for \code{ab_class} (case-insensitive). If no results are found, the \code{atc_group1} and \code{atc_group2} columns will be searched. Next, \code{x} will be checked for column names with a value in any abbreviations, codes or official names found in the \code{antibiotics} data set. #' @rdname filter_ab_class #' @keywords filter fillter_class diff --git a/R/freq.R b/R/freq.R index 40a0032f..bd58d646 100755 --- a/R/freq.R +++ b/R/freq.R @@ -29,22 +29,21 @@ clean::freq #' @export #' @noRd freq.mo <- function(x, ...) { - x <- as.mo(x) # to get the newest mo codes - x_noNA <- x[!is.na(x)] + x_noNA <- as.mo(x[!is.na(x)]) # as.mo() to get the newest mo codes grams <- mo_gramstain(x_noNA, language = NULL) freq.default(x = x, ..., .add_header = list(`Gram-negative` = paste0(format(sum(grams == "Gram-negative", na.rm = TRUE), big.mark = ",", decimal.mark = "."), - " (", percent(sum(grams == "Gram-negative", na.rm = TRUE) / length(grams), force_zero = TRUE), - " of total)"), + " (", percent(sum(grams == "Gram-negative", na.rm = TRUE) / length(grams), force_zero = TRUE, round = 2), + ")"), `Gram-positive` = paste0(format(sum(grams == "Gram-positive", na.rm = TRUE), big.mark = ",", decimal.mark = "."), - " (", percent(sum(grams == "Gram-positive", na.rm = TRUE) / length(grams), force_zero = TRUE), - " of total)"), - genera = n_distinct(mo_genus(x_noNA, language = NULL)), - species = n_distinct(paste(mo_genus(x_noNA, language = NULL), + " (", percent(sum(grams == "Gram-positive", na.rm = TRUE) / length(grams), force_zero = TRUE, round = 2), + ")"), + `Unique genera` = n_distinct(mo_genus(x_noNA, language = NULL)), + `Unique species` = n_distinct(paste(mo_genus(x_noNA, language = NULL), mo_species(x_noNA, language = NULL))))) } diff --git a/data-raw/internals.R b/data-raw/internals.R index 9d26e23c..2961c350 100644 --- a/data-raw/internals.R +++ b/data-raw/internals.R @@ -49,14 +49,14 @@ rm(translations_file) rm(microorganisms.translation) # Clean mo history ---- -mo_history_file <- file.path(file.path(system.file(package = "AMR"), "mo_history"), "mo_history.csv") -usethis::ui_done(paste0("Resetting {usethis::ui_value('", mo_history_file, "')}")) +usethis::ui_done(paste0("Resetting {usethis::ui_value('mo_history.csv')}")) tryCatch( write.csv(x = data.frame(x = character(0), mo = character(0), uncertainty_level = integer(0), - package_v = character(0), + package_version = character(0), stringsAsFactors = FALSE), - file = mo_history_file), - warning = function(w) invisible(), - error = function(e) TRUE) + row.names = FALSE, + file = "inst/mo_history/mo_history.csv"), + warning = function(w) cat("Warning:", w$message, "\n"), + error = function(e) cat("Error:", e$message, "\n")) diff --git a/data-raw/reproduction_of_microorganisms.R b/data-raw/reproduction_of_microorganisms.R index 36dddc00..4334b842 100644 --- a/data-raw/reproduction_of_microorganisms.R +++ b/data-raw/reproduction_of_microorganisms.R @@ -94,7 +94,7 @@ rm(ref_taxonomy) mo_found_in_NL <- c("Absidia", "Acremonium", "Actinotignum", "Aedes", "Alternaria", "Anaerosalibacter", "Ancylostoma", "Angiostrongylus", "Anisakis", "Anopheles", "Apophysomyces", "Arachnia", "Ascaris", "Aspergillus", "Aureobacterium", "Aureobasidium", "Bacteroides", "Balantidum", "Basidiobolus", "Beauveria", - "Bilophilia", "Branhamella", "Brochontrix", "Brugia", "Calymmatobacterium", "Candida", "Capillaria", + "Bilophilia", "Blastocystis", "Branhamella", "Brochontrix", "Brugia", "Calymmatobacterium", "Candida", "Capillaria", "Capnocytophaga", "Catabacter", "Cdc", "Chaetomium", "Chilomastix", "Chryseobacterium", "Chryseomonas", "Chrysonilia", "Cladophialophora", "Cladosporium", "Clonorchis", "Conidiobolus", "Contracaecum", "Cordylobia", "Cryptococcus", "Curvularia", "Demodex", "Dermatobia", "Dicrocoelium", @@ -113,7 +113,7 @@ mo_found_in_NL <- c("Absidia", "Acremonium", "Actinotignum", "Aedes", "Alternari "Rhodotorula", "Salinococcus", "Sanguibacteroides", "Sarcophagidae", "Sarcoptes", "Schistosoma", "Scolecobasidium", "Scopulariopsis", "Scytalidium", "Spirometra", "Sporobolomyces", "Stachybotrys", "Stenotrophomononas", "Stomatococcus", "Strongyloides", "Syncephalastraceae", "Syngamus", "Taenia", - "Ternidens", "Torulopsis", "Toxocara", "Treponema", "Trichinella", "Trichobilharzia", "Trichoderma", + "Ternidens", "Torulopsis", "Toxocara", "Toxoplasma", "Treponema", "Trichinella", "Trichobilharzia", "Trichoderma", "Trichomonas", "Trichophyton", "Trichosporon", "Trichostrongylus", "Trichuris", "Tritirachium", "Trombicula", "Trypanosoma", "Tunga", "Ureaplasma", "Wuchereria") @@ -219,6 +219,8 @@ MOs.old <- MOs %>% distinct(fullname, .keep_all = TRUE) %>% arrange(col_id) +MO.bak <- MOs + MOs <- MOs %>% filter(is.na(col_id_new) | source == "DSMZ") %>% transmute(col_id, @@ -594,6 +596,17 @@ MOs <- MOs %>% ref = NA_character_, species_id = "", source = "manually added"), + # Blastocystis hominis does not exist (it means 'got a Bastocystis from humans', PMID 15634993) + # but let's be nice to the clinical people in microbiology + MOs %>% + filter(fullname == "Blastocystis") %>% + mutate(mo = paste0(mo, "_HMNS"), + fullname = paste(fullname, "hominis"), + species = "hominis", + col_id = NA, + source = "manually added", + ref = NA_character_, + species_id = ""), # Trichomonas vaginalis is missing, same order as Dientamoeba MOs %>% filter(fullname == "Dientamoeba") %>% @@ -636,6 +649,7 @@ MOs <- MOs %>% ungroup() %>% filter(fullname != "") +# add prevalence to old taxonomic names MOs.old <- MOs.old %>% left_join(MOs %>% select(col_id, prevalence), by = c("col_id_new" = "col_id")) @@ -645,7 +659,8 @@ sum(duplicated(MOs$fullname)) colnames(MOs) # here we welcome the new ones: -MOs %>% arrange(genus, species, subspecies) %>% filter(!fullname %in% AMR::microorganisms$fullname) %>% View() +MOs %>% arrange(fullname) %>% filter(!fullname %in% AMR::microorganisms$fullname) %>% View() +MOs.old %>% arrange(fullname) %>% filter(!fullname %in% AMR::microorganisms.old$fullname) %>% View() # and the ones we lost: AMR::microorganisms %>% filter(!fullname %in% MOs$fullname) %>% View() # and these IDs have changed: @@ -659,9 +674,11 @@ old_new %>% View() # and these codes are now missing (which will throw a unit test error): AMR::microorganisms.codes %>% filter(!mo %in% MOs$mo) +AMR::rsi_translation %>% filter(!mo %in% MOs$mo) +AMR::microorganisms.translation %>% filter(!mo_new %in% MOs$mo) # this is how to fix it microorganisms.codes <- AMR::microorganisms.codes %>% - left_join(MOs %>% + left_join(MOs %>% mutate(kingdom_fullname = paste(kingdom, fullname)) %>% left_join(AMR::microorganisms %>% mutate(kingdom_fullname = paste(kingdom, fullname)) %>% @@ -673,7 +690,7 @@ microorganisms.codes <- AMR::microorganisms.codes %>% microorganisms.codes %>% filter(!mo %in% MOs$mo) # arrange -MOs <- MOs %>% arrange(genus, species, subspecies) +MOs <- MOs %>% arrange(fullname) MOs.old <- MOs.old %>% arrange(fullname) microorganisms.codes <- microorganisms.codes %>% arrange(code) diff --git a/data/microorganisms.codes.rda b/data/microorganisms.codes.rda index ff2420b4..8da06281 100644 Binary files a/data/microorganisms.codes.rda and b/data/microorganisms.codes.rda differ diff --git a/data/microorganisms.old.rda b/data/microorganisms.old.rda index 4be20397..a1cbd95c 100644 Binary files a/data/microorganisms.old.rda and b/data/microorganisms.old.rda differ diff --git a/data/microorganisms.rda b/data/microorganisms.rda index 382f2fa8..0e070c49 100644 Binary files a/data/microorganisms.rda and b/data/microorganisms.rda differ diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 32d087e6..d82259ff 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.1.9079 + 0.7.1.9080 diff --git a/docs/articles/index.html b/docs/articles/index.html index 2eb61aec..013e15c6 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.1.9079 + 0.7.1.9080 diff --git a/docs/authors.html b/docs/authors.html index 7c2b5617..cc3a0bbd 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.1.9079 + 0.7.1.9080 diff --git a/docs/index.html b/docs/index.html index 72e64c5a..4818540b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 0.7.1.9079 + 0.7.1.9080 @@ -283,7 +283,7 @@

Microbial (taxonomic) reference data

-

This package contains the complete taxonomic tree of almost all 70,000 microorganisms from the authoritative and comprehensive Catalogue of Life (CoL, www.catalogueoflife.org). With catalogue_of_life_version() can be checked which version of the CoL is included in this package.

+

This package contains the complete taxonomic tree of almost all 70,000 microorganisms from the authoritative and comprehensive Catalogue of Life (CoL, www.catalogueoflife.org). With catalogue_of_life_version() can be checked which version of the CoL is included in this package.

Read more about which data from the Catalogue of Life in our manual.

@@ -307,32 +307,32 @@
  • It cleanses existing data by providing new classes for microoganisms, antibiotics and antimicrobial results (both S/I/R and MIC). By installing this package, you teach R everything about microbiology that is needed for analysis. These functions all use intelligent rules to guess results that you would expect:

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

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

  • diff --git a/docs/news/index.html b/docs/news/index.html index fddc477d..c7d8f08c 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.7.1.9079 + 0.7.1.9080
  • @@ -225,9 +225,9 @@ -
    +

    -AMR 0.7.1.9079 Unreleased +AMR 0.7.1.9080 Unreleased

    Last updated: 22-Sep-2019

    @@ -236,7 +236,7 @@
    -This is important, because a value like "testvalue" could never be understood by e.g. mo_name(), although the class would suggest a valid microbial code. -
  • Function freq() has moved to a new package, clean (CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq() function still works, since it is re-exported from the clean package (which will be installed automatically upon updating this AMR package).

  • +This is important, because a value like "testvalue" could never be understood by e.g. mo_name(), although the class would suggest a valid microbial code. +
  • Function freq() has moved to a new package, clean (CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq() function still works, since it is re-exported from the clean package (which will be installed automatically upon updating this AMR package).

  • @@ -260,8 +260,8 @@ This is important, because a value like "testvalue" could never be New

    Changed

      -
    • Column names of output count_df() and portion_df() are now lowercase
    • +
    • Column names of output count_df() and portion_df() are now lowercase
    • Fixed bug in translation of microorganism names
    • Fixed bug in determining taxonomic kingdoms
    • -
    • Algorithm improvements for as.ab() and as.mo() to understand even more severely misspelled input
    • -
    • Function as.ab() now allows spaces for coercing antibiotics names
    • +
    • Algorithm improvements for as.ab() and as.mo() to understand even more severely misspelled input
    • +
    • Function as.ab() now allows spaces for coercing antibiotics names
    • Added ggplot2 methods for automatically determining the scale type of classes mo and ab
    • Added names of object in the header in frequency tables, even when using pipes
    • -
    • Prevented "bacteria" from getting coerced by as.ab() because Bacterial is a brand name of trimethoprim (TMP)
    • -
    • Fixed a bug where setting an antibiotic would not work for eucast_rules() and mdro() +
    • Prevented "bacteria" from getting coerced by as.ab() because Bacterial is a brand name of trimethoprim (TMP)
    • +
    • Fixed a bug where setting an antibiotic would not work for eucast_rules() and mdro()
    • Fixed a EUCAST rule for Staphylococci, where amikacin resistance would not be inferred from tobramycin
    • -
    • Removed latest_annual_release from the catalogue_of_life_version() function
    • +
    • Removed latest_annual_release from the catalogue_of_life_version() function
    • Removed antibiotic code PVM1 from the antibiotics data set as this was a duplicate of PME
    • -
    • Fixed bug where not all old taxonomic names would be printed, when using a vector as input for as.mo() +
    • Fixed bug where not all old taxonomic names would be printed, when using a vector as input for as.mo()
    • Manually added Trichomonas vaginalis from the kingdom of Protozoa, which is missing from the Catalogue of Life
    • Small improvements to plot() and barplot() for MIC and RSI classes
    • -
    • Allow Catalogue of Life IDs to be coerced by as.mo() +
    • Allow Catalogue of Life IDs to be coerced by as.mo()
    @@ -447,18 +450,18 @@ Since this is a major change, usage of the old also_single_tested w

    New

      -
    • Support for translation of disk diffusion and MIC values to RSI values (i.e. antimicrobial interpretations). Supported guidelines are EUCAST (2011 to 2019) and CLSI (2011 to 2019). Use as.rsi() on an MIC value (created with as.mic()), a disk diffusion value (created with the new as.disk()) or on a complete date set containing columns with MIC or disk diffusion values.
    • -
    • Function mo_name() as alias of mo_fullname() +
    • Support for translation of disk diffusion and MIC values to RSI values (i.e. antimicrobial interpretations). Supported guidelines are EUCAST (2011 to 2019) and CLSI (2011 to 2019). Use as.rsi() on an MIC value (created with as.mic()), a disk diffusion value (created with the new as.disk()) or on a complete date set containing columns with MIC or disk diffusion values.
    • +
    • Function mo_name() as alias of mo_fullname()
    • -
    • Added guidelines of the WHO to determine multi-drug resistance (MDR) for TB (mdr_tb()) and added a new vignette about MDR. Read this tutorial here on our website.
    • +
    • Added guidelines of the WHO to determine multi-drug resistance (MDR) for TB (mdr_tb()) and added a new vignette about MDR. Read this tutorial here on our website.

    Changed

      -
    • Fixed a critical bug in first_isolate() where missing species would lead to incorrect FALSEs. This bug was not present in AMR v0.5.0, but was in v0.6.0 and v0.6.1.
    • -
    • Fixed a bug in eucast_rules() where antibiotics from WHONET software would not be recognised
    • +
    • Fixed a critical bug in first_isolate() where missing species would lead to incorrect FALSEs. This bug was not present in AMR v0.5.0, but was in v0.6.0 and v0.6.1.
    • +
    • Fixed a bug in eucast_rules() where antibiotics from WHONET software would not be recognised
    • Completely reworked the antibiotics data set:
      • All entries now have 3 different identifiers: @@ -477,20 +480,20 @@ Since this is a major change, usage of the old also_single_tested w Please create an issue in one of our repositories if you want additions in this file.
    • -
    • Improvements to plotting AMR results with ggplot_rsi(): +
    • Improvements to plotting AMR results with ggplot_rsi():
      • New parameter colours to set the bar colours
      • New parameters title, subtitle, caption, x.title and y.title to set titles and axis descriptions
    • -
    • Improved intelligence of looking up antibiotic columns in a data set using guess_ab_col() +
    • Improved intelligence of looking up antibiotic columns in a data set using guess_ab_col()
    • -
    • Added ~5,000 more old taxonomic names to the microorganisms.old data set, which leads to better results finding when using the as.mo() function
    • -
    • This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as ‘increased exposure’ and not ‘intermediate’ anymore. For functions like portion_df() and count_df() this means that their new parameter combine_SI is TRUE at default. Our plotting function ggplot_rsi() also reflects this change since it uses count_df() internally.
    • -
    • The age() function gained a new parameter exact to determine ages with decimals
    • +
    • Added ~5,000 more old taxonomic names to the microorganisms.old data set, which leads to better results finding when using the as.mo() function
    • +
    • This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as ‘increased exposure’ and not ‘intermediate’ anymore. For functions like portion_df() and count_df() this means that their new parameter combine_SI is TRUE at default. Our plotting function ggplot_rsi() also reflects this change since it uses count_df() internally.
    • +
    • The age() function gained a new parameter exact to determine ages with decimals
    • Removed deprecated functions guess_mo(), guess_atc(), EUCAST_rules(), interpretive_reading(), rsi()
    • -
    • Frequency tables (freq()): +
    • Frequency tables (freq()):
    @@ -513,18 +516,18 @@ Please create an issue in one of our repositories if you want changes in this file.
  • Added ceftazidim intrinsic resistance to Streptococci
  • -
  • Changed default settings for age_groups(), to let groups of fives and tens end with 100+ instead of 120+
  • -
  • Fix for freq() for when all values are NA +
  • Changed default settings for age_groups(), to let groups of fives and tens end with 100+ instead of 120+
  • +
  • Fix for freq() for when all values are NA
  • -
  • Fix for first_isolate() for when dates are missing
  • -
  • Improved speed of guess_ab_col() +
  • Fix for first_isolate() for when dates are missing
  • +
  • Improved speed of guess_ab_col()
  • -
  • Function as.mo() now gently interprets any number of whitespace characters (like tabs) as one space
  • -
  • Function as.mo() now returns UNKNOWN for "con" (WHONET ID of ‘contamination’) and returns NA for "xxx"(WHONET ID of ‘no growth’)
  • -
  • Small algorithm fix for as.mo() +
  • Function as.mo() now gently interprets any number of whitespace characters (like tabs) as one space
  • +
  • Function as.mo() now returns UNKNOWN for "con" (WHONET ID of ‘contamination’) and returns NA for "xxx"(WHONET ID of ‘no growth’)
  • +
  • Small algorithm fix for as.mo()
  • Removed viruses from data set microorganisms.codes and cleaned it up
  • -
  • Fix for mo_shortname() where species would not be determined correctly

  • +
  • Fix for mo_shortname() where species would not be determined correctly

  • @@ -544,7 +547,7 @@ Please Changed
      -
    • Fixed a critical bug when using eucast_rules() with verbose = TRUE +
    • Fixed a critical bug when using eucast_rules() with verbose = TRUE
    • Coercion of microbial IDs are now written to the package namespace instead of the user’s home folder, to comply with the CRAN policy
    @@ -565,7 +568,7 @@ Please New
    -These functions use as.atc() internally. The old atc_property has been renamed atc_online_property(). This is done for two reasons: firstly, not all ATC codes are of antibiotics (ab) but can also be of antivirals or antifungals. Secondly, the input must have class atc or must be coerable to this class. Properties of these classes should start with the same class name, analogous to as.mo() and e.g. mo_genus. -
  • New functions set_mo_source() and get_mo_source() to use your own predefined MO codes as input for as.mo() and consequently all mo_* functions
  • +These functions use as.atc() internally. The old atc_property has been renamed atc_online_property(). This is done for two reasons: firstly, not all ATC codes are of antibiotics (ab) but can also be of antivirals or antifungals. Secondly, the input must have class atc or must be coerable to this class. Properties of these classes should start with the same class name, analogous to as.mo() and e.g. mo_genus. +
  • New functions set_mo_source() and get_mo_source() to use your own predefined MO codes as input for as.mo() and consequently all mo_* functions
  • Support for the upcoming dplyr version 0.8.0
  • -
  • New function guess_ab_col() to find an antibiotic column in a table
  • -
  • New function mo_failures() to review values that could not be coerced to a valid MO code, using as.mo(). This latter function will now only show a maximum of 10 uncoerced values and will refer to mo_failures().
  • -
  • New function mo_uncertainties() to review values that could be coerced to a valid MO code using as.mo(), but with uncertainty.
  • -
  • New function mo_renamed() to get a list of all returned values from as.mo() that have had taxonomic renaming
  • -
  • New function age() to calculate the (patients) age in years
  • -
  • New function age_groups() to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.
  • +
  • New function guess_ab_col() to find an antibiotic column in a table
  • +
  • New function mo_failures() to review values that could not be coerced to a valid MO code, using as.mo(). This latter function will now only show a maximum of 10 uncoerced values and will refer to mo_failures().
  • +
  • New function mo_uncertainties() to review values that could be coerced to a valid MO code using as.mo(), but with uncertainty.
  • +
  • New function mo_renamed() to get a list of all returned values from as.mo() that have had taxonomic renaming
  • +
  • New function age() to calculate the (patients) age in years
  • +
  • New function age_groups() to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.
  • -

    New function ggplot_rsi_predict() as well as the base R plot() function can now be used for resistance prediction calculated with resistance_predict():

    -
    x <- resistance_predict(septic_patients, col_ab = "amox")
    +

    New function ggplot_rsi_predict() as well as the base R plot() function can now be used for resistance prediction calculated with resistance_predict():

    + +ggplot_rsi_predict(x)
  • -

    Functions filter_first_isolate() and filter_first_weighted_isolate() to shorten and fasten filtering on data sets with antimicrobial results, e.g.:

    -
    septic_patients %>% filter_first_isolate(...)
    +

    Functions filter_first_isolate() and filter_first_weighted_isolate() to shorten and fasten filtering on data sets with antimicrobial results, e.g.:

    + +filter_first_isolate(septic_patients, ...)

    is equal to:

    septic_patients %>%
    -  mutate(only_firsts = first_isolate(septic_patients, ...)) %>%
    +  mutate(only_firsts = first_isolate(septic_patients, ...)) %>%
       filter(only_firsts == TRUE) %>%
       select(-only_firsts)
  • -
  • New function availability() to check the number of available (non-empty) results in a data.frame +
  • New function availability() to check the number of available (non-empty) results in a data.frame
  • 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.

  • @@ -650,48 +653,48 @@ These functions use as.atc() Changed @@ -1075,7 +1078,7 @@ Using as.mo(..., allow_uncertain = 3)
  • septic_patients %>% select(tobr, gent) %>% ggplot_rsi will show portions of S, I and R immediately in a pretty plot
  • -
  • Support for grouped variables, see ?ggplot_rsi +
  • Support for grouped variables, see ?ggplot_rsi
  • @@ -1107,13 +1110,13 @@ Using as.mo(..., allow_uncertain = 3)
  • 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)) +
  • Support for table to use as input: freq(table(x, y))
  • Support for existing functions hist and plot to use a frequency table as input: hist(freq(df$age))
  • Support for as.vector, as.data.frame, as_tibble and format
  • -
  • Support for quasiquotation: freq(mydata, mycolumn) is the same as mydata %>% freq(mycolumn) +
  • Support for quasiquotation: freq(mydata, mycolumn) is the same as mydata %>% freq(mycolumn)
  • Function top_freq function to return the top/below n items as vector
  • Header of frequency tables now also show Mean Absolute Deviaton (MAD) and Interquartile Range (IQR)
  • @@ -1145,14 +1148,14 @@ Using as.mo(..., allow_uncertain = 3)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
  • +
  • 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
  • @@ -1203,7 +1206,7 @@ Using as.mo(..., allow_uncertain = 3)Functions BRMO and MRGN are wrappers for Dutch and German guidelines, respectively -
  • New algorithm to determine weighted isolates, can now be "points" or "keyantibiotics", see ?first_isolate +
  • New algorithm to determine weighted isolates, can now be "points" or "keyantibiotics", see ?first_isolate
  • New print format for tibbles and data.tables
  • @@ -1267,7 +1270,7 @@ Using as.mo(..., allow_uncertain = 3)

    Contents

    diff --git a/git_premaster.sh b/git_premaster.sh index 3af88f94..1e287397 100755 --- a/git_premaster.sh +++ b/git_premaster.sh @@ -51,8 +51,6 @@ echo "•••••••••••••••••••••••• Rscript -e "devtools::load_all(quiet = TRUE)" echo "• Documenting..." Rscript -e "suppressMessages(devtools::document())" -echo "• Installing..." -Rscript -e "devtools::install(quiet = TRUE, dependencies = FALSE)" echo echo "••••••••••••••••••••••••••" echo "• Updating internal data •" @@ -62,6 +60,8 @@ echo echo "•••••••••••••••••" echo "• Building site •" echo "•••••••••••••••••" +echo "• Installing..." +Rscript -e "devtools::install(quiet = TRUE, dependencies = FALSE)" Rscript -e "suppressMessages(pkgdown::build_site(lazy = $lazy, examples = FALSE))" echo echo "•••••••••••••••••••••••••" diff --git a/man/filter_ab_class.Rd b/man/filter_ab_class.Rd index 48e5b711..237f955d 100644 --- a/man/filter_ab_class.Rd +++ b/man/filter_ab_class.Rd @@ -51,7 +51,7 @@ filter_tetracyclines(x, result = NULL, scope = "any", ...) \item{scope}{the scope to check which variables to check, can be \code{"any"} (default) or \code{"all"}} -\item{...}{parameters passed on to \code{\link[dplyr]{filter_at}}} +\item{...}{parameters passed on to \code{filter_at} from the \code{dplyr} package} } \description{ Filter isolates on results in specific antibiotic variables based on their class (ATC groups). This makes it easy to get a list of isolates that were tested for e.g. any aminoglycoside. diff --git a/man/microorganisms.Rd b/man/microorganisms.Rd index 399a5635..0f12ecc5 100755 --- a/man/microorganisms.Rd +++ b/man/microorganisms.Rd @@ -4,7 +4,7 @@ \name{microorganisms} \alias{microorganisms} \title{Data set with ~70,000 microorganisms} -\format{A \code{\link{data.frame}} with 69,454 observations and 16 variables: +\format{A \code{\link{data.frame}} with 69,465 observations and 16 variables: \describe{ \item{\code{mo}}{ID of microorganism as used by this package} \item{\code{col_id}}{Catalogue of Life ID} @@ -33,6 +33,7 @@ Manually added were: \item{11 entries of \emph{Streptococcus} (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)} \item{2 entries of \emph{Staphylococcus} (coagulase-negative [CoNS] and coagulase-positive [CoPS])} \item{3 entries of \emph{Trichomonas} (\emph{Trichomonas vaginalis}, and its family and genus)} + \item{1 entry of \emph{Blastocystis} (\emph{Blastocystis hominis}), although it officially does not exist (Noel et al. 2005, PMID 15634993)} \item{5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)} \item{9,460 species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications} } diff --git a/man/microorganisms.codes.Rd b/man/microorganisms.codes.Rd index 46d101a8..41a93e59 100644 --- a/man/microorganisms.codes.Rd +++ b/man/microorganisms.codes.Rd @@ -4,7 +4,7 @@ \name{microorganisms.codes} \alias{microorganisms.codes} \title{Translation table for common microorganism codes} -\format{A \code{\link{data.frame}} with 4,927 observations and 2 variables: +\format{A \code{\link{data.frame}} with 5,006 observations and 2 variables: \describe{ \item{\code{code}}{Commonly used code of a microorganism} \item{\code{mo}}{ID of the microorganism in the \code{\link{microorganisms}} data set}