diff --git a/.Rbuildignore b/.Rbuildignore index 722e91de6..87240fb2a 100755 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -20,4 +20,4 @@ ^Meta$ ^pkgdown$ ^public$ -^reproduction.*R$ +^data-raw$ diff --git a/DESCRIPTION b/DESCRIPTION index c19186df4..7c391754d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.6.1.9049 -Date: 2019-05-31 +Version: 0.6.1.9050 +Date: 2019-06-01 Title: Antimicrobial Resistance Analysis Authors@R: c( person( @@ -70,5 +70,4 @@ BugReports: https://gitlab.com/msberends/AMR/issues License: GPL-2 | file LICENSE Encoding: UTF-8 LazyData: true -StagedInstall: false RoxygenNote: 6.1.1 diff --git a/NAMESPACE b/NAMESPACE index 4387f6f21..9493fb501 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -92,7 +92,6 @@ export(count_all) export(count_df) export(eucast_exceptional_phenotypes) export(eucast_rules) -export(eucast_rules_file) export(facet_rsi) export(filter_1st_cephalosporins) export(filter_2nd_cephalosporins) diff --git a/NEWS.md b/NEWS.md index 3a7081d06..a6d6e2483 100755 --- a/NEWS.md +++ b/NEWS.md @@ -17,11 +17,8 @@ * All references to antibiotics in our package now use EARS-Net codes, like `AMX` for amoxicillin * Functions `atc_certe`, `ab_umcg` and `atc_trivial_nl` have been removed * All `atc_*` functions are superceded by `ab_*` functions - * All output will be translated by using an included, local translation file that can be found after install with: - ```r - system.file("translations.tsv", package = "AMR") - ``` - Please create an issue in one of our repositories if you want additions in this file. + * All output will be translated by using an included translation file which [can be viewed here](https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv) + Please [create an issue in one of our repositories](https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation%20suggestion) if you want additions in this file. * 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 @@ -44,7 +41,8 @@ freq(age) %>% boxplot() ``` -* Removed all hardcoded EUCAST rules and replaced them with a new reference file: `./inst/eucast/eucast.tsv` +* Removed all hardcoded EUCAST rules and replaced them with a new reference file which [can be viewed here](https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv) + Please [create an issue in one of our repositories](https://gitlab.com/msberends/AMR/issues/new?issue[title]=EUCAST%20edit) 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` @@ -56,8 +54,7 @@ * Fix for `mo_shortname()` where species would not be determined correctly #### Other -* Support for R 3.6.0 -* Prevented [staged install](https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html) in R 3.6.0 and later by adding `StagedInstall: false` to the DESCRIPTION file +* Support for R 3.6.0 and later by providing support for [staged install](https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html) # AMR 0.6.1 diff --git a/R/eucast_rules.R b/R/eucast_rules.R index 1bb224f93..9b7b82c66 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -20,7 +20,6 @@ # ==================================================================== # # global variables -EUCAST_RULES_FILE_LOCATION <- system.file("eucast/eucast_rules.tsv", package = "AMR") EUCAST_VERSION_BREAKPOINTS <- "9.0, 2019" EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016" @@ -37,10 +36,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016" #' \strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link{as.rsi}} for that. \cr #' \strong{Note:} When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance. #' -#' The file used for applying all EUCAST rules can be retrieved with \code{\link{eucast_rules_file}()}. It returns an easily readable data set containing all rules. The original TSV file (tab separated file) that is being read by \code{eucast_rules()} can be found by running this command: \cr -#' \code{AMR::EUCAST_RULES_FILE_LOCATION} (without brackets). -#' -#' In the source code the file containing all rules is located \href{https://gitlab.com/msberends/AMR/blob/master/inst/eucast/eucast_rules.tsv}{here}. +#' The file containing all EUCAST rules is located here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv}. #' #' @section Antibiotics: #' To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. @@ -141,8 +137,6 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016" #' \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx} #' } #' } -#' -#' For editing the reference file (which is available with \code{\link{eucast_rules_file}}), these values can all be used for target antibiotics: aminoglycosides, tetracyclines, polymyxins, macrolides, glycopeptides, streptogramins, cephalosporins, cephalosporins_without_cfta, carbapenems, aminopenicillins, ureidopenicillins, fluoroquinolones, all_betalactams, and all separate four letter codes like AMC. They can be separated by comma: \code{"AMC, fluoroquinolones"}. The mo_property can be any column name from the \code{\link{microorganisms}} data set, or \code{genus_species} or \code{gramstain}. This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: LiPuma JJ, 2015 (PMID 16217180). #' @inheritSection AMR Read more on our website! #' @examples #' a <- eucast_rules(septic_patients) @@ -499,7 +493,7 @@ eucast_rules <- function(x, y[y != "" & y %in% colnames(df)] } - eucast_rules_df <- eucast_rules_file() + eucast_rules_df <- eucast_rules_file # internal data file no_of_changes <- 0 for (i in 1:nrow(eucast_rules_df)) { @@ -754,16 +748,3 @@ eucast_rules <- function(x, } } -#' @rdname eucast_rules -#' @importFrom dplyr %>% arrange -#' @export -eucast_rules_file <- function() { - utils::read.delim(file = EUCAST_RULES_FILE_LOCATION, - sep = "\t", - stringsAsFactors = FALSE, - header = TRUE, - strip.white = TRUE, - na = c(NA, "", NULL)) %>% - arrange(reference.rule_group, - reference.rule) -} diff --git a/R/get_locale.R b/R/get_locale.R index 653e98222..a81a4c1ae 100755 --- a/R/get_locale.R +++ b/R/get_locale.R @@ -22,11 +22,11 @@ #' Translate strings from AMR package #' #' For language-dependent output of AMR functions, like \code{\link{mo_fullname}} and \code{\link{mo_type}}. -#' @details Strings will be translated to foreign languages if they are defined in a local translation file. This file comes with this package and can be found when running: +#' @details Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv}. #' -#' \code{system.file("translations.tsv", package = "AMR")} +#' Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}. #' -#' This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}. +#' This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). #' #' The system language will be used at default, if supported, using \code{\link{get_locale}}. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}. #' @inheritSection AMR Read more on our website! diff --git a/R/misc.R b/R/misc.R index 9c1236aa4..20e64d18e 100755 --- a/R/misc.R +++ b/R/misc.R @@ -243,9 +243,10 @@ generate_warning_abs_missing <- function(missing, any = FALSE) { stopifnot_installed_package <- function(package) { - if (!package %in% base::rownames(utils::installed.packages())) { - stop("this function requires the ", package, " package.", call. = FALSE) - } + # no "utils::installed.packages()" since it requires non-staged install since R 3.6.0 + # https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html + get(".packageName", envir = asNamespace(package)) + return(invisible()) } # translate strings based on inst/translations.tsv @@ -262,16 +263,7 @@ t <- function(from, language = get_locale()) { return(from) } - df_trans <- utils::read.table(file = system.file("translations.tsv", package = "AMR"), - sep = "\t", - stringsAsFactors = FALSE, - header = TRUE, - blank.lines.skip = TRUE, - fill = TRUE, - strip.white = TRUE, - encoding = "UTF-8", - fileEncoding = "UTF-8", - na.strings = c(NA, "", NULL)) + df_trans <- translations_file # internal data file if (!language %in% df_trans$lang) { stop("Unsupported language: '", language, "' - use one of: ", diff --git a/R/mo.R b/R/mo.R index c70b0cc36..b5ff422b9 100755 --- a/R/mo.R +++ b/R/mo.R @@ -191,7 +191,7 @@ #' } as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE, reference_df = get_mo_source(), ...) { if (!"AMR" %in% base::.packages()) { - library("AMR") + require("AMR") # check onLoad() in R/zzz.R: data tables are created there. } @@ -295,7 +295,7 @@ exec_as.mo <- function(x, debug = FALSE) { if (!"AMR" %in% base::.packages()) { - library("AMR") + require("AMR") # check onLoad() in R/zzz.R: data tables are created there. } diff --git a/R/mo_property.R b/R/mo_property.R index 947f3ef72..3d0c60247 100755 --- a/R/mo_property.R +++ b/R/mo_property.R @@ -364,7 +364,7 @@ mo_validate <- function(x, property, ...) { } if (!"AMR" %in% base::.packages()) { - library("AMR") + require("AMR") # check onLoad() in R/zzz.R: data tables are created there. } diff --git a/R/sysdata.rda b/R/sysdata.rda new file mode 100644 index 000000000..ee6d78c55 Binary files /dev/null and b/R/sysdata.rda differ diff --git a/inst/eucast/eucast_rules.tsv b/data-raw/eucast_rules.tsv similarity index 100% rename from inst/eucast/eucast_rules.tsv rename to data-raw/eucast_rules.tsv diff --git a/data-raw/internals.R b/data-raw/internals.R new file mode 100644 index 000000000..0c55d4aae --- /dev/null +++ b/data-raw/internals.R @@ -0,0 +1,40 @@ +# EUCAST rules ---- +# For editing the reference file, these values can all be used for target antibiotics: +# "aminoglycosides", "tetracyclines", "polymyxins", "macrolides", "glycopeptides", +# "streptogramins", "cephalosporins", "cephalosporins_without_CAZ", "carbapenems", +# "minopenicillins", "ureidopenicillins", "fluoroquinolones", "all_betalactams", +# and all separate EARS-Net letter codes like "AMC". They can be separated by comma: "AMC, fluoroquinolones". +# The mo_property can be any column name from the AMR::microorganisms data set, or "genus_species" or "gramstain". +# This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: +# LiPuma JJ, 2015 (PMID 16217180). +eucast_rules_file <- dplyr::arrange( + .data = utils::read.delim(file = "data-raw/eucast_rules.tsv", + sep = "\t", + stringsAsFactors = FALSE, + header = TRUE, + strip.white = TRUE, + na = c(NA, "", NULL)), + reference.rule_group, + reference.rule) + +# Translations ----- +translations_file <- utils::read.table(file = "data-raw/translations.tsv", + sep = "\t", + stringsAsFactors = FALSE, + header = TRUE, + blank.lines.skip = TRUE, + fill = TRUE, + strip.white = TRUE, + encoding = "UTF-8", + fileEncoding = "UTF-8", + na.strings = c(NA, "", NULL)) + +# Export to package as internal data ---- +usethis::use_data(eucast_rules_file, translations_file, + internal = TRUE, + overwrite = TRUE, + version = 2) + +# Remove from global environment ---- +rm(eucast_rules_file) +rm(translations_file) diff --git a/reproduction_of_antibiotics.R b/data-raw/reproduction_of_antibiotics.R similarity index 100% rename from reproduction_of_antibiotics.R rename to data-raw/reproduction_of_antibiotics.R diff --git a/reproduction_of_microorganisms.R b/data-raw/reproduction_of_microorganisms.R similarity index 100% rename from reproduction_of_microorganisms.R rename to data-raw/reproduction_of_microorganisms.R diff --git a/reproduction_of_rsi_translation.R b/data-raw/reproduction_of_rsi_translation.R similarity index 100% rename from reproduction_of_rsi_translation.R rename to data-raw/reproduction_of_rsi_translation.R diff --git a/inst/translations.tsv b/data-raw/translations.tsv similarity index 100% rename from inst/translations.tsv rename to data-raw/translations.tsv diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index bd2d07c03..236e0ffb3 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9049 + 0.6.1.9050 diff --git a/docs/articles/index.html b/docs/articles/index.html index bdc1bf1ab..d564e6458 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9049 + 0.6.1.9050 diff --git a/docs/authors.html b/docs/authors.html index 6445876ce..dbb80836c 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9049 + 0.6.1.9050 diff --git a/docs/index.html b/docs/index.html index aab572012..dd4f82b9c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 0.6.1.9049 + 0.6.1.9050 diff --git a/docs/news/index.html b/docs/news/index.html index efa99712e..aeaa4bc1a 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9049 + 0.6.1.9050 @@ -272,10 +272,7 @@
  • All references to antibiotics in our package now use EARS-Net codes, like AMX for amoxicillin
  • Functions atc_certe, ab_umcg and atc_trivial_nl have been removed
  • All atc_* functions are superceded by ab_* functions
  • -
  • -

    All output will be translated by using an included, local translation file that can be found after install with:

    -
    system.file("translations.tsv", package = "AMR")
    -Please create an issue in one of our repositories if you want additions in this file.
  • +
  • All output will be translated by using an included translation file which can be viewed here Please create an issue in one of our repositories if you want additions in this file.
  • Improvements to plotting AMR results with ggplot_rsi(): @@ -297,19 +294,18 @@ Please create an issue in one of our repositories if you want additions in this
  • fixed level names in markdown
  • support for boxplots:

    -
    septic_patients %>% 
    -  freq(age) %>% 
    -  boxplot()
    -# grouped boxplots:
    -septic_patients %>% 
    -  group_by(hospital_id) %>% 
    -  freq(age) %>%
    -  boxplot()
    +
    septic_patients %>% 
    +  freq(age) %>% 
    +  boxplot()
    +# grouped boxplots:
    +septic_patients %>% 
    +  group_by(hospital_id) %>% 
    +  freq(age) %>%
    +  boxplot()
  • -
  • Removed all hardcoded EUCAST rules and replaced them with a new reference file: ./inst/eucast/eucast.tsv -
  • +
  • Removed all hardcoded EUCAST rules and replaced them with a new reference file which can be viewed here 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+
  • @@ -329,8 +325,8 @@ Please create an issue in one of our repositories if you want additions in this

    Other

    @@ -387,32 +383,32 @@ This data is updated annually - check the included version with the new function
  • New filters for antimicrobial classes. Use these functions to filter isolates on results in one of more antibiotics from a specific class:

    -
    filter_aminoglycosides()
    -filter_carbapenems()
    -filter_cephalosporins()
    -filter_1st_cephalosporins()
    -filter_2nd_cephalosporins()
    -filter_3rd_cephalosporins()
    -filter_4th_cephalosporins()
    -filter_fluoroquinolones()
    -filter_glycopeptides()
    -filter_macrolides()
    -filter_tetracyclines()
    +
    filter_aminoglycosides()
    +filter_carbapenems()
    +filter_cephalosporins()
    +filter_1st_cephalosporins()
    +filter_2nd_cephalosporins()
    +filter_3rd_cephalosporins()
    +filter_4th_cephalosporins()
    +filter_fluoroquinolones()
    +filter_glycopeptides()
    +filter_macrolides()
    +filter_tetracyclines()

    The antibiotics data set will be searched, after which the input data will be checked for column names with a value in any abbreviations, codes or official names found in the antibiotics data set. For example:

    -
    septic_patients %>% filter_glycopeptides(result = "R")
    -# Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R
    -septic_patients %>% filter_glycopeptides(result = "R", scope = "all")
    -# Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R
    +
    septic_patients %>% filter_glycopeptides(result = "R")
    +# Filtering on glycopeptide antibacterials: any of `vanc` or `teic` is R
    +septic_patients %>% filter_glycopeptides(result = "R", scope = "all")
    +# Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R
  • All ab_* functions are deprecated and replaced by atc_* functions:

    -
    ab_property -> atc_property()
    -ab_name -> atc_name()
    -ab_official -> atc_official()
    -ab_trivial_nl -> atc_trivial_nl()
    -ab_certe -> atc_certe()
    -ab_umcg -> atc_umcg()
    -ab_tradenames -> atc_tradenames()
    +
    ab_property -> atc_property()
    +ab_name -> atc_name()
    +ab_official -> atc_official()
    +ab_trivial_nl -> atc_trivial_nl()
    +ab_certe -> atc_certe()
    +ab_umcg -> atc_umcg()
    +ab_tradenames -> atc_tradenames()
    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
  • @@ -424,20 +420,20 @@ These functions use as.atc()
  • 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")
    -plot(x)
    -ggplot_rsi_predict(x)
    +
    x <- resistance_predict(septic_patients, col_ab = "amox")
    +plot(x)
    +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(...)
    -# or
    -filter_first_isolate(septic_patients, ...)
    +
    septic_patients %>% filter_first_isolate(...)
    +# or
    +filter_first_isolate(septic_patients, ...)

    is equal to:

    -
    septic_patients %>%
    -  mutate(only_firsts = first_isolate(septic_patients, ...)) %>%
    -  filter(only_firsts == TRUE) %>%
    -  select(-only_firsts)
    +
    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
  • @@ -466,33 +462,33 @@ These functions use as.atc()

    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"
    +
    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 diff --git a/docs/reference/AMR-deprecated.html b/docs/reference/AMR-deprecated.html index d39cbb8b3..fb83bfed7 100644 --- a/docs/reference/AMR-deprecated.html +++ b/docs/reference/AMR-deprecated.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/AMR.html b/docs/reference/AMR.html index 78e4e3299..b015e709d 100644 --- a/docs/reference/AMR.html +++ b/docs/reference/AMR.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html index 81d032a7e..fb3ea3fb8 100644 --- a/docs/reference/WHOCC.html +++ b/docs/reference/WHOCC.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/WHONET.html b/docs/reference/WHONET.html index f4d8a3036..e6ecfb22a 100644 --- a/docs/reference/WHONET.html +++ b/docs/reference/WHONET.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html index ae6daa27e..a14e414b3 100644 --- a/docs/reference/ab_property.html +++ b/docs/reference/ab_property.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/age.html b/docs/reference/age.html index b2b0e0045..8abf0658d 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index 0581e6741..a7795c7d6 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index c64778036..232ef6108 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/as.ab.html b/docs/reference/as.ab.html index 0d0bee603..828c73a6d 100644 --- a/docs/reference/as.ab.html +++ b/docs/reference/as.ab.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/as.atc.html b/docs/reference/as.atc.html index f4d272860..9a9cbeb10 100644 --- a/docs/reference/as.atc.html +++ b/docs/reference/as.atc.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/as.disk.html b/docs/reference/as.disk.html index d2f3f49cf..e21d6ff77 100644 --- a/docs/reference/as.disk.html +++ b/docs/reference/as.disk.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index a145e6574..449947d2c 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index 0c1b325e8..5fbd9bc42 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html index 650dbccbd..976e414a5 100644 --- a/docs/reference/as.rsi.html +++ b/docs/reference/as.rsi.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/atc_online.html b/docs/reference/atc_online.html index b9ac6c7bf..9fec38704 100644 --- a/docs/reference/atc_online.html +++ b/docs/reference/atc_online.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/availability.html b/docs/reference/availability.html index da8d04c0d..1319356b3 100644 --- a/docs/reference/availability.html +++ b/docs/reference/availability.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/catalogue_of_life.html b/docs/reference/catalogue_of_life.html index 98f7d4111..04e19062a 100644 --- a/docs/reference/catalogue_of_life.html +++ b/docs/reference/catalogue_of_life.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/catalogue_of_life_version.html b/docs/reference/catalogue_of_life_version.html index 19b09d95f..714d13e70 100644 --- a/docs/reference/catalogue_of_life_version.html +++ b/docs/reference/catalogue_of_life_version.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/count.html b/docs/reference/count.html index d1cbbb641..8f7a81b9a 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.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index 9c659d22f..b94e6b51c 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 @@ -249,9 +249,7 @@
    eucast_rules(x, col_mo = NULL, info = TRUE, rules = c("breakpoints",
    -  "expert", "other", "all"), verbose = FALSE, ...)
    -
    -eucast_rules_file()
    + "expert", "other", "all"), verbose = FALSE, ...)

    Arguments

    @@ -293,7 +291,6 @@
  • EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019.
    http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx

  • -

    For editing the reference file (which is available with eucast_rules_file), these values can all be used for target antibiotics: aminoglycosides, tetracyclines, polymyxins, macrolides, glycopeptides, streptogramins, cephalosporins, cephalosporins_without_cfta, carbapenems, aminopenicillins, ureidopenicillins, fluoroquinolones, all_betalactams, and all separate four letter codes like AMC. They can be separated by comma: "AMC, fluoroquinolones". The mo_property can be any column name from the microorganisms data set, or genus_species or gramstain. This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: LiPuma JJ, 2015 (PMID 16217180).

    Value

    @@ -303,9 +300,7 @@

    Note: This function does not translate MIC values to RSI values. Use as.rsi for that.
    Note: When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.

    -

    The file used for applying all EUCAST rules can be retrieved with eucast_rules_file(). It returns an easily readable data set containing all rules. The original TSV file (tab separated file) that is being read by eucast_rules() can be found by running this command:
    -AMR::EUCAST_RULES_FILE_LOCATION (without brackets).

    -

    In the source code the file containing all rules is located here.

    +

    The file containing all EUCAST rules is located here: https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv.

    Antibiotics

    diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index 1533a7dd8..6ea8c8056 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/freq.html b/docs/reference/freq.html index 0b79a5c13..59cb060a0 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.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/g.test.html b/docs/reference/g.test.html index 9b2120b23..1e3105f3e 100644 --- a/docs/reference/g.test.html +++ b/docs/reference/g.test.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index e062e36d5..a320dbdbe 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9049 + 0.6.1.9050 diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html index fe134088c..ecb432d47 100644 --- a/docs/reference/guess_ab_col.html +++ b/docs/reference/guess_ab_col.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9045 + 0.6.1.9050 diff --git a/docs/reference/index.html b/docs/reference/index.html index 60a5339f0..8a898c26d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.6.1.9049 + 0.6.1.9050 @@ -330,7 +330,7 @@ diff --git a/docs/reference/join.html b/docs/reference/join.html index 8617257a4..aef9f25af 100644 --- a/docs/reference/join.html +++ b/docs/reference/join.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html index b48490c31..7ed6e9bcb 100644 --- a/docs/reference/key_antibiotics.html +++ b/docs/reference/key_antibiotics.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html index 5078c32b6..913a35363 100644 --- a/docs/reference/kurtosis.html +++ b/docs/reference/kurtosis.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/like.html b/docs/reference/like.html index 11709b363..7cb6b1254 100644 --- a/docs/reference/like.html +++ b/docs/reference/like.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index 9559d3874..e8e684740 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/microorganisms.codes.html b/docs/reference/microorganisms.codes.html index b3f1136b9..35362ad6b 100644 --- a/docs/reference/microorganisms.codes.html +++ b/docs/reference/microorganisms.codes.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index 533e2882b..189cc1778 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/microorganisms.old.html b/docs/reference/microorganisms.old.html index 84186a1c9..bac80be82 100644 --- a/docs/reference/microorganisms.old.html +++ b/docs/reference/microorganisms.old.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index 534eff3e6..9f5107726 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html index f0ba88374..56c4c0778 100644 --- a/docs/reference/mo_source.html +++ b/docs/reference/mo_source.html @@ -81,7 +81,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/p.symbol.html b/docs/reference/p.symbol.html index b07608f5e..a1131a919 100644 --- a/docs/reference/p.symbol.html +++ b/docs/reference/p.symbol.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/portion.html b/docs/reference/portion.html index 49c508a80..d8f511662 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.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/read.4D.html b/docs/reference/read.4D.html index 924325bcb..7cd9d9894 100644 --- a/docs/reference/read.4D.html +++ b/docs/reference/read.4D.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html index 644e66943..3ddec5a59 100644 --- a/docs/reference/resistance_predict.html +++ b/docs/reference/resistance_predict.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/rsi_translation.html b/docs/reference/rsi_translation.html index 5663398d3..770638b33 100644 --- a/docs/reference/rsi_translation.html +++ b/docs/reference/rsi_translation.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/septic_patients.html b/docs/reference/septic_patients.html index 7f005bbf8..e1fe762e0 100644 --- a/docs/reference/septic_patients.html +++ b/docs/reference/septic_patients.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html index f781b940c..d49f811e7 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.6.1.9044 + 0.6.1.9050 diff --git a/docs/reference/translate.html b/docs/reference/translate.html index 52dc26ff2..3453a276a 100644 --- a/docs/reference/translate.html +++ b/docs/reference/translate.html @@ -80,7 +80,7 @@ AMR (for R) - 0.6.1.9044 + 0.6.1.9050 @@ -252,9 +252,9 @@

    Details

    -

    Strings will be translated to foreign languages if they are defined in a local translation file. This file comes with this package and can be found when running:

    -

    system.file("translations.tsv", package = "AMR")

    -

    This file will be read by all functions where a translated output can be desired, like all mo_property functions (mo_fullname, mo_type, etc.). Please suggest your own translations by creating a new issue on our repository.

    +

    Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv.

    +

    Please suggest your own translations by creating a new issue on our repository.

    +

    This file will be read by all functions where a translated output can be desired, like all mo_property functions (mo_fullname, mo_type, etc.).

    The system language will be used at default, if supported, using get_locale. The system language can be overwritten with getOption("AMR_locale").

    Read more on our website!

    diff --git a/git_merge.sh b/git_merge.sh index 0e088a546..08e4828ae 100755 --- a/git_merge.sh +++ b/git_merge.sh @@ -13,13 +13,15 @@ git checkout master --quiet echo "changed branch to master" # import everything from premaster -git merge premaster +git merge premaster --quiet # and send it to git -git push -# echo "pushed changes to master" +git push --quiet +echo "pushed changes to master" # return to premaster git checkout premaster --quiet echo "changed branch back to premaster" +git status --short + # and get stashed changes back # git stash apply --quiet diff --git a/git_premaster.sh b/git_premaster.sh index 5495d1870..8d82a8e5b 100755 --- a/git_premaster.sh +++ b/git_premaster.sh @@ -31,17 +31,21 @@ echo "First 3 lines of DESCRIPTION:" head -3 DESCRIPTION echo echo "•••••••••••••••••••••••••••••••••" -echo "• Reloading/Documenting package •" +echo "• Reloading/documenting package •" echo "•••••••••••••••••••••••••••••••••" Rscript -e "devtools::load_all(quiet = TRUE)" Rscript -e "suppressMessages(devtools::document())" Rscript -e "devtools::install(quiet = TRUE, dependencies = FALSE)" echo +echo "••••••••••••••••••••••••••" +echo "• Updating internal data •" +echo "••••••••••••••••••••••••••" +Rscript -e "source('data-raw/internals.R')" +echo echo "•••••••••••••••••" echo "• Building site •" echo "•••••••••••••••••" Rscript -e "suppressMessages(pkgdown::build_site(lazy = $lazy, examples = FALSE))" - echo echo "•••••••••••••••••••••••••" echo "• List of changed files •" diff --git a/man/eucast_rules.Rd b/man/eucast_rules.Rd index 334daa5ea..bf13470f1 100644 --- a/man/eucast_rules.Rd +++ b/man/eucast_rules.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/eucast_rules.R \name{eucast_rules} \alias{eucast_rules} -\alias{eucast_rules_file} \title{EUCAST rules} \source{ \itemize{ @@ -20,14 +19,10 @@ \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx} } } - - For editing the reference file (which is available with \code{\link{eucast_rules_file}}), these values can all be used for target antibiotics: aminoglycosides, tetracyclines, polymyxins, macrolides, glycopeptides, streptogramins, cephalosporins, cephalosporins_without_cfta, carbapenems, aminopenicillins, ureidopenicillins, fluoroquinolones, all_betalactams, and all separate four letter codes like AMC. They can be separated by comma: \code{"AMC, fluoroquinolones"}. The mo_property can be any column name from the \code{\link{microorganisms}} data set, or \code{genus_species} or \code{gramstain}. This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: LiPuma JJ, 2015 (PMID 16217180). } \usage{ eucast_rules(x, col_mo = NULL, info = TRUE, rules = c("breakpoints", "expert", "other", "all"), verbose = FALSE, ...) - -eucast_rules_file() } \arguments{ \item{x}{data with antibiotic columns, like e.g. \code{AMX} and \code{AMC}} @@ -52,10 +47,7 @@ Apply susceptibility rules as defined by the European Committee on Antimicrobial \strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link{as.rsi}} for that. \cr \strong{Note:} When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance. -The file used for applying all EUCAST rules can be retrieved with \code{\link{eucast_rules_file}()}. It returns an easily readable data set containing all rules. The original TSV file (tab separated file) that is being read by \code{eucast_rules()} can be found by running this command: \cr -\code{AMR::EUCAST_RULES_FILE_LOCATION} (without brackets). - -In the source code the file containing all rules is located \href{https://gitlab.com/msberends/AMR/blob/master/inst/eucast/eucast_rules.tsv}{here}. +The file containing all EUCAST rules is located here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv}. } \section{Antibiotics}{ diff --git a/man/translate.Rd b/man/translate.Rd index be730069b..479458571 100644 --- a/man/translate.Rd +++ b/man/translate.Rd @@ -11,11 +11,11 @@ get_locale() For language-dependent output of AMR functions, like \code{\link{mo_fullname}} and \code{\link{mo_type}}. } \details{ -Strings will be translated to foreign languages if they are defined in a local translation file. This file comes with this package and can be found when running: +Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv}. -\code{system.file("translations.tsv", package = "AMR")} +Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}. -This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}. +This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). The system language will be used at default, if supported, using \code{\link{get_locale}}. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}. }
    -

    eucast_rules() eucast_rules_file()

    +

    eucast_rules()

    EUCAST rules