diff --git a/DESCRIPTION b/DESCRIPTION index 9d62c704..a2047d31 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.5.0.9017 -Date: 2019-02-14 +Version: 0.5.0.9018 +Date: 2019-02-18 Title: Antimicrobial Resistance Analysis Authors@R: c( person( diff --git a/NAMESPACE b/NAMESPACE index 4a7ba715..c87056bd 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -108,7 +108,6 @@ export(labels_rsi_count) export(left_join_microorganisms) export(like) export(mdro) -export(mo_TSN) export(mo_authors) export(mo_class) export(mo_failures) diff --git a/NEWS.md b/NEWS.md index 096fbcc9..73952f58 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,21 @@ # AMR 0.5.0.90xx **Note: this is the development version, which will eventually be released as AMR 0.6.0.** +**New website!** + +We've got a new website: [https://msberends.gitlab.io/AMR](https://msberends.gitlab.io/AMR/) (built with the great [`pkgdown`](https://pkgdown.r-lib.org/)) + +* Contains the complete manual of this package and all of its functions with an explanation of their parameters +* Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis, import data from WHONET or SPSS and many more. + #### New * **BREAKING**: removed deprecated functions, parameters and references to 'bactid'. Use `as.mo()` to identify an MO code. +* Catalogue of Life (CoL) inclusion for data about microorganisms, which also contains all ITIS data we used previously. The `microorganisms` data set now contains: + * Almost 60,000 species from six different kingdoms + * Almost 15,000 previously accepted names which are now taxonomic 'synonyms' + * All (sub)species from the kingdoms Archaea, Bacteria, Chromista, Protozoa and Viruses + * All (sub)species from the orders Eurotiales, Saccharomycetales and Onygenales of the kingdom Fungi. The complete taxonomy of this kingdom has more than 130,000 species. The orders we included contains at least all memebers of the families *Candida*, *Aspergillus* and *Trichophyton*. + * Due to this change, the ID of *Streptococcus* was changed from `B_STRPTC` to `B_STRPT`. * Support for data from [WHONET](https://whonet.org/) and [EARS-Net](https://ecdc.europa.eu/en/about-us/partnerships-and-networks/disease-and-laboratory-networks/ears-net) (European Antimicrobial Resistance Surveillance Network): * Exported files from WHONET can be read and used in this package. For functions like `first_isolate()` and `eucast_rules()`, all parameters will be filled in automatically. * This package now knows all antibiotic abbrevations by EARS-Net (which are also being used by WHONET) - the `antibiotics` data set now contains a column `ears_net`. @@ -18,9 +31,6 @@ 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 website: https://msberends.gitlab.io/AMR (built with the great [`pkgdown`](https://pkgdown.r-lib.org/)) - * Contains the complete manual of this package and all of its functions with an explanation of their parameters - * Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis * 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`](https://dplyr.tidyverse.org) version 0.8.0 * New function `guess_ab_col()` to find an antibiotic column in a table @@ -57,7 +67,7 @@ * 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](https://www.whocc.no/atc_ddd_index/?code=J01CE01)) * New info is returned when running this function, stating exactly what has been changed or added. Use `eucast_rules(..., verbose = TRUE)` to get a data set with all changed per bug and drug combination. -* Added 605 *Aspergillus* species and 23 *Trichophyton* species to the `microorganisms` data set +* Removed data sets `microorganisms.oldDT`, `microorganisms.prevDT`, `microorganisms.unprevDT` and `microorganismsDT` since they were no longer needed and only contained info already available in the `microorganisms` data set * 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 * Functions `atc_ddd()` and `atc_groups()` have been renamed `atc_online_ddd()` and `atc_online_groups()`. The old functions are deprecated and will be removed in a future version. diff --git a/R/data.R b/R/data.R index 42e76ea2..3dac1489 100755 --- a/R/data.R +++ b/R/data.R @@ -130,14 +130,14 @@ # "antibiotics" -#' Data set with ~20,000 microorganisms +#' Data set with ~60,000 microorganisms #' -#' 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}}. +#' 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 ITIS ITIS -#' @format A \code{\link{data.frame}} with 19,456 observations and 15 variables: +#' @format A \code{\link{data.frame}} with 56,659 observations and 15 variables: #' \describe{ #' \item{\code{mo}}{ID of microorganism} -#' \item{\code{tsn}}{Taxonomic Serial Number (TSN), as defined by ITIS} +#' \item{\code{col_id}}{Catalogue of Life ID} #' \item{\code{genus}}{Taxonomic genus of the microorganism as found in ITIS, see Source} #' \item{\code{species}}{Taxonomic species of the microorganism as found in ITIS, see Source} #' \item{\code{subspecies}}{Taxonomic subspecies of the microorganism as found in ITIS, see Source} @@ -155,15 +155,10 @@ #' @source Integrated Taxonomic Information System (ITIS) public online database, \url{https://www.itis.gov}. #' @details Manually added were: #' \itemize{ -#' \item{605 species of Aspergillus (as Aspergillus misses from ITIS, list from https://en.wikipedia.org/wiki/List_of_Aspergillus_species on 2019-02-05)} -#' \item{23 species of Trichophyton (as Trichophyton misses from ITIS, list from https://en.wikipedia.org/wiki/Trichophyton on 2019-02-05)} -#' \item{9 species of Streptococcus (beta haemolytic groups A, B, C, D, F, G, H, K and unspecified)} -#' \item{2 species of Straphylococcus (coagulase-negative [CoNS] and coagulase-positive [CoPS])} -#' \item{1 species of Candida (C. glabrata)} +#' \item{9 species of \emph{Streptococcus} (beta haemolytic groups A, B, C, D, F, G, H, K and unspecified)} +#' \item{2 species of \emph{Staphylococcus} (coagulase-negative [CoNS] and coagulase-positive [CoPS])} #' \item{2 other undefined (unknown Gram negatives and unknown Gram positives)} #' } -#' -#' These manual entries have no Taxonomic Serial Number (TSN), so can be looked up with \code{filter(microorganisms, is.na(tsn)}. #' @inheritSection AMR Read more on our website! #' @seealso \code{\link{as.mo}} \code{\link{mo_property}} \code{\link{microorganisms.codes}} "microorganisms" @@ -172,12 +167,12 @@ #' #' 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 -#' @format A \code{\link{data.frame}} with 2,383 observations and 4 variables: +#' @format A \code{\link{data.frame}} with 14,506 observations and 4 variables: #' \describe{ -#' \item{\code{tsn}}{Old Taxonomic Serial Number (TSN), as defined by ITIS} -#' \item{\code{name}}{Old taxonomic name of the microorganism as found in ITIS, see Source} -#' \item{\code{tsn_new}}{New Taxonomic Serial Number (TSN), as defined by ITIS} -#' \item{\code{ref}}{Author(s) and year of concerning publication as found in ITIS, see Source} +#' \item{\code{col_id}}{Catalogue of Life ID} +#' \item{\code{tsn_new}}{New Catalogue of Life ID} +#' \item{\code{fullname}}{Old taxonomic name of the microorganism as found in the CoL, see Source} +#' \item{\code{ref}}{Author(s) and year of concerning publication as found in the CoL, see Source} #' } #' @source [3] Integrated Taxonomic Information System (ITIS) on-line database, \url{https://www.itis.gov}. #' @inheritSection AMR Read more on our website! @@ -250,36 +245,3 @@ #' } #' @inheritSection AMR Read more on our website! "WHONET" - -#' Supplementary Data -#' -#' These \code{\link{data.table}s} are transformed from the \code{\link{microorganisms}} and \code{\link{microorganisms}} data sets to improve speed of \code{\link{as.mo}}. They are meant for internal use only, and are only mentioned here for reference. -#' @rdname supplementary_data -#' @name supplementary_data -#' @inheritSection AMR Read more on our website! -# # Renew data: -# # sorted on (1) bacteria, (2) fungi, (3) protozoa and then human pathogenic prevalence and then TSN: -# microorganismsDT <- data.table::as.data.table(AMR::microorganisms) -# data.table::setkey(microorganismsDT, kingdom, prevalence, fullname) -# microorganisms.prevDT <- microorganismsDT[prevalence != 9999,] -# microorganisms.unprevDT <- microorganismsDT[prevalence == 9999,] -# microorganisms.oldDT <- data.table::as.data.table(AMR::microorganisms.old) -# data.table::setkey(microorganisms.oldDT, tsn, name) -# usethis::use_data(microorganismsDT, overwrite = TRUE) -# usethis::use_data(microorganisms.prevDT, overwrite = TRUE) -# usethis::use_data(microorganisms.unprevDT, overwrite = TRUE) -# usethis::use_data(microorganisms.oldDT, overwrite = TRUE) -# rm(microorganismsDT) -# rm(microorganisms.prevDT) -# rm(microorganisms.unprevDT) -# rm(microorganisms.oldDT) -"microorganismsDT" - -#' @rdname supplementary_data -"microorganisms.prevDT" - -#' @rdname supplementary_data -"microorganisms.unprevDT" - -#' @rdname supplementary_data -"microorganisms.oldDT" diff --git a/R/eucast_rules.R b/R/eucast_rules.R index 77b734df..4739fbea 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -548,6 +548,7 @@ eucast_rules <- function(tbl, tbl <- tbl %>% mutate_at(vars(col_mo), as.mo) %>% left_join_microorganisms(by = col_mo, suffix = c("_oldcols", "")) %>% + mutate(gramstain = mo_gramstain(pull(., col_mo))) %>% as.data.frame(stringsAsFactors = FALSE) if (info == TRUE) { diff --git a/R/first_isolate.R b/R/first_isolate.R index 7e9faa5e..deb9da10 100755 --- a/R/first_isolate.R +++ b/R/first_isolate.R @@ -70,7 +70,7 @@ #' @keywords isolate isolates first #' @seealso \code{\link{key_antibiotics}} #' @export -#' @importFrom dplyr arrange_at lag between row_number filter mutate arrange +#' @importFrom dplyr arrange_at lag between row_number filter mutate arrange pull #' @importFrom crayon blue bold silver #' @return Logical vector #' @source Methodology of this function is based on: \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}. diff --git a/R/key_antibiotics.R b/R/key_antibiotics.R index b5804a11..17310e5f 100755 --- a/R/key_antibiotics.R +++ b/R/key_antibiotics.R @@ -43,7 +43,7 @@ #' @inheritSection first_isolate Key antibiotics #' @rdname key_antibiotics #' @export -#' @importFrom dplyr %>% mutate if_else +#' @importFrom dplyr %>% mutate if_else pull #' @importFrom crayon blue bold #' @seealso \code{\link{first_isolate}} #' @inheritSection AMR Read more on our website! @@ -149,7 +149,8 @@ key_antibiotics <- function(tbl, tbl <- tbl %>% mutate_at(vars(col_mo), as.mo) %>% left_join_microorganisms(by = col_mo) %>% - mutate(key_ab = NA_character_) + mutate(key_ab = NA_character_, + gramstain = mo_gramstain(pull(., col_mo))) # Gram + tbl <- tbl %>% mutate(key_ab = diff --git a/R/mo.R b/R/mo.R index 8b015b05..85b2dfc1 100755 --- a/R/mo.R +++ b/R/mo.R @@ -47,7 +47,8 @@ #' | | | ----> subspecies, a 3-4 letter acronym #' | | ----> species, a 3-4 letter acronym #' | ----> genus, a 5-7 letter acronym, mostly without vowels -#' ----> taxonomic kingdom, either B (Bacteria), F (Fungi) or P (Protozoa) +#' ----> taxonomic kingdom: A (Archaea), B (Bacteria), C (Chromista), +#' F (Fungi), P (Protozoa) or V (Viruses) #' } #' #' Use the \code{\link{mo_property}} functions to get properties based on the returned code, see Examples. @@ -81,7 +82,7 @@ #' #' Examples: #' \itemize{ -#' \item{\code{"Streptococcus group B (known as S. agalactiae)"}. The text between brackets will be removed and a warning will be thrown that the result \emph{Streptococcus group B} (\code{B_STRPTC_GRB}) needs review.} +#' \item{\code{"Streptococcus group B (known as S. agalactiae)"}. The text between brackets will be removed and a warning will be thrown that the result \emph{Streptococcus group B} (\code{B_STRPT_GRB}) needs review.} #' \item{\code{"S. aureus - please mind: MRSA"}. The last word will be stripped, after which the function will try to find a match. If it does not, the second last word will be stripped, etc. Again, a warning will be thrown that the result \emph{Staphylococcus aureus} (\code{B_STPHY_AUR}) needs review.} #' \item{\code{"D. spartina"}. This is the abbreviation of an old taxonomic name: \emph{Didymosphaeria spartinae} (the last "e" was missing from the input). This fungus was renamed to \emph{Leptosphaeria obiones}, so a warning will be thrown that this result (\code{F_LPTSP_OBI}) needs review.} #' \item{\code{"Fluoroquinolone-resistant Neisseria gonorrhoeae"}. The first word will be stripped, after which the function will try to find a match. A warning will be thrown that the result \emph{Neisseria gonorrhoeae} (\code{B_NESSR_GON}) needs review.} @@ -118,8 +119,6 @@ #' as.mo("MRSA") # Methicillin Resistant S. aureus #' as.mo("VISA") # Vancomycin Intermediate S. aureus #' as.mo("VRSA") # Vancomycin Resistant S. aureus -#' as.mo(369) # Search on TSN (Taxonomic Serial Number), a unique identifier -#' # for the Integrated Taxonomic Information System (ITIS) #' #' as.mo("Streptococcus group A") #' as.mo("GAS") # Group A Streptococci @@ -128,8 +127,8 @@ #' as.mo("S. epidermidis") # will remain species: B_STPHY_EPI #' as.mo("S. epidermidis", Becker = TRUE) # will not remain species: B_STPHY_CNS #' -#' as.mo("S. pyogenes") # will remain species: B_STRPTC_PYO -#' as.mo("S. pyogenes", Lancefield = TRUE) # will not remain species: B_STRPTC_GRA +#' as.mo("S. pyogenes") # will remain species: B_STRPT_PYO +#' as.mo("S. pyogenes", Lancefield = TRUE) # will not remain species: B_STRPT_GRA #' #' # Use mo_* functions to get a specific property based on `mo` #' Ecoli <- as.mo("E. coli") # returns `B_ESCHR_COL` @@ -178,11 +177,7 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, if (!"AMR" %in% base::.packages()) { library("AMR") - # These data.tables are available as data sets when the AMR package is loaded: - # microorganismsDT # this one is sorted by kingdom (B 0) { x[i] <- found[1L] next } - found <- microorganisms.prevDT[tsn == x_trimmed[i], ..property][[1]] - # is a valid TSN + found <- microorganisms.superprevDT[mo == toupper(x_backup[i]), ..property][[1]] + # is a valid mo + if (length(found) > 0) { + x[i] <- found[1L] + next + } + found <- microorganisms.superprevDT[tolower(fullname) == tolower(x_trimmed_without_group[i]), ..property][[1]] + if (length(found) > 0) { + x[i] <- found[1L] + next + } + + # try any match keeping spaces ---- + found <- microorganisms.superprevDT[fullname %like% x_withspaces_start_end[i], ..property][[1]] + if (length(found) > 0 & nchar(x_trimmed[i]) >= 6) { + x[i] <- found[1L] + next + } + + # try any match keeping spaces, not ending with $ ---- + found <- microorganisms.superprevDT[fullname %like% x_withspaces_start_only[i], ..property][[1]] + if (length(found) > 0 & nchar(x_trimmed[i]) >= 6) { + x[i] <- found[1L] + next + } + + # try any match diregarding spaces ---- + found <- microorganisms.superprevDT[fullname %like% x[i], ..property][[1]] + if (length(found) > 0 & nchar(x_trimmed[i]) >= 6) { + x[i] <- found[1L] + next + } + + # try splitting of characters in the middle and then find ID ---- + # only when text length is 6 or lower + # like esco = E. coli, klpn = K. pneumoniae, stau = S. aureus, staaur = S. aureus + if (nchar(x_trimmed[i]) <= 6) { + x_length <- nchar(x_trimmed[i]) + x[i] <- paste0(x_trimmed[i] %>% substr(1, x_length / 2), + '.* ', + x_trimmed[i] %>% substr((x_length / 2) + 1, x_length)) + found <- microorganisms.superprevDT[fullname %like% paste0('^', x[i]), ..property][[1]] + if (length(found) > 0) { + x[i] <- found[1L] + next + } + } + + # try fullname without start and stop regex, to also find subspecies ---- + # like "K. pneu rhino" >> "Klebsiella pneumoniae (rhinoscleromatis)" = KLEPNERH + found <- microorganisms.superprevDT[fullname %like% x_withspaces_start_only[i], ..property][[1]] + if (length(found) > 0) { + x[i] <- found[1L] + next + } + + # TRY PREVALENT IN HUMAN INFECTIONS ---- + found <- microorganisms.prevDT[tolower(fullname) %in% tolower(c(x_backup[i], x_trimmed[i])), ..property][[1]] + # most probable: is exact match in fullname if (length(found) > 0) { x[i] <- found[1L] next @@ -559,7 +620,7 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, next } - # THEN TRY ALL OTHERS ---- + # THEN UNPREVALENT IN HUMAN INFECTIONS ---- found <- microorganisms.unprevDT[tolower(fullname) == tolower(x_backup[i]), ..property][[1]] # most probable: is exact match in fullname if (length(found) > 0) { @@ -572,12 +633,6 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, x[i] <- found[1L] next } - found <- microorganisms.unprevDT[tsn == x_trimmed[i], ..property][[1]] - # is a valid TSN - if (length(found) > 0) { - x[i] <- found[1L] - next - } found <- microorganisms.unprevDT[mo == toupper(x_backup[i]), ..property][[1]] # is a valid mo if (length(found) > 0) { @@ -633,23 +688,23 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, # MISCELLANEOUS ---- # look for old taxonomic names ---- - found <- microorganisms.oldDT[tolower(name) == tolower(x_backup[i]) - | tsn == x_trimmed[i] - | name %like% x_withspaces_start_end[i],] + found <- microorganisms.oldDT[tolower(fullname) == tolower(x_backup[i]) + | fullname %like% x_withspaces_start_end[i],] if (NROW(found) > 0) { + col_id_new <- found[1, col_id_new] # when property is "ref" (which is the case in mo_ref, mo_authors and mo_year), return the old value, so: # mo_ref("Chlamydia psittaci) = "Page, 1968" (with warning) # mo_ref("Chlamydophila psittaci) = "Everett et al., 1999" if (property == "ref") { x[i] <- found[1, ref] } else { - x[i] <- microorganismsDT[tsn == found[1, tsn_new], ..property][[1]] + x[i] <- microorganismsDT[col_id == found[1, col_id_new], ..property][[1]] } - was_renamed(name_old = found[1, name], - name_new = microorganismsDT[tsn == found[1, tsn_new], fullname], + was_renamed(name_old = found[1, fullname], + name_new = microorganismsDT[col_id == found[1, col_id_new], fullname], ref_old = found[1, ref], - ref_new = microorganismsDT[tsn == found[1, tsn_new], ref], - mo = microorganismsDT[tsn == found[1, tsn_new], mo]) + ref_new = microorganismsDT[col_id == found[1, col_id_new], ref], + mo = microorganismsDT[col_id == found[1, col_id_new], mo]) next } @@ -673,9 +728,9 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, } # (2) look again for old taxonomic names, now for G. species ---- - found <- microorganisms.oldDT[name %like% c.x_withspaces_start_end - | name %like% d.x_withspaces_start_only - | name %like% e.x,] + found <- microorganisms.oldDT[fullname %like% c.x_withspaces_start_end + | fullname %like% d.x_withspaces_start_only + | fullname %like% e.x,] if (NROW(found) > 0 & nchar(b.x_trimmed) >= 6) { if (property == "ref") { # when property is "ref" (which is the case in mo_ref, mo_authors and mo_year), return the old value, so: @@ -683,15 +738,15 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, # mo_ref("Chlamydophila psittaci) = "Everett et al., 1999" x <- found[1, ref] } else { - x <- microorganismsDT[tsn == found[1, tsn_new], ..property][[1]] + x <- microorganismsDT[col_id == found[1, col_id_new], ..property][[1]] } - was_renamed(name_old = found[1, name], - name_new = microorganismsDT[tsn == found[1, tsn_new], fullname], + was_renamed(name_old = found[1, fullname], + name_new = microorganismsDT[col_id == found[1, col_id_new], fullname], ref_old = found[1, ref], - ref_new = microorganismsDT[tsn == found[1, tsn_new], ref], - mo = microorganismsDT[tsn == found[1, tsn_new], mo]) + ref_new = microorganismsDT[col_id == found[1, col_id_new], ref], + mo = microorganismsDT[col_id == found[1, col_id_new], mo]) uncertainties <<- c(uncertainties, - paste0("'", a.x_backup, "' >> ", found[1, name], " (TSN ", found[1, tsn], ")")) + paste0("'", a.x_backup, "' >> ", found[1, fullname], " (Catalogue of Life ID ", found[1, col_id], ")")) return(x) } @@ -835,25 +890,25 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, # Lancefield ---- if (Lancefield == TRUE | Lancefield == "all") { # group A - S. pyogenes - x[x == microorganismsDT[mo == 'B_STRPTC_PYO', ..property][[1]][1L]] <- microorganismsDT[mo == 'B_STRPTC_GRA', ..property][[1]][1L] + x[x == microorganismsDT[mo == 'B_STRPT_PYO', ..property][[1]][1L]] <- microorganismsDT[mo == 'B_STRPT_GRA', ..property][[1]][1L] # group B - S. agalactiae - x[x == microorganismsDT[mo == 'B_STRPTC_AGA', ..property][[1]][1L]] <- microorganismsDT[mo == 'B_STRPTC_GRB', ..property][[1]][1L] + x[x == microorganismsDT[mo == 'B_STRPT_AGA', ..property][[1]][1L]] <- microorganismsDT[mo == 'B_STRPT_GRB', ..property][[1]][1L] # group C S_groupC <- microorganismsDT %>% filter(genus == "Streptococcus", species %in% c("equisimilis", "equi", "zooepidemicus", "dysgalactiae")) %>% pull(property) - x[x %in% S_groupC] <- microorganismsDT[mo == 'B_STRPTC_GRC', ..property][[1]][1L] + x[x %in% S_groupC] <- microorganismsDT[mo == 'B_STRPT_GRC', ..property][[1]][1L] if (Lancefield == "all") { # all Enterococci - x[x %like% "^(Enterococcus|B_ENTRC)"] <- microorganismsDT[mo == 'B_STRPTC_GRD', ..property][[1]][1L] + x[x %like% "^(Enterococcus|B_ENTRC)"] <- microorganismsDT[mo == 'B_STRPT_GRD', ..property][[1]][1L] } # group F - S. anginosus - x[x == microorganismsDT[mo == 'B_STRPTC_ANG', ..property][[1]][1L]] <- microorganismsDT[mo == 'B_STRPTC_GRF', ..property][[1]][1L] + x[x == microorganismsDT[mo == 'B_STRPT_ANG', ..property][[1]][1L]] <- microorganismsDT[mo == 'B_STRPT_GRF', ..property][[1]][1L] # group H - S. sanguinis - x[x == microorganismsDT[mo == 'B_STRPTC_SAN', ..property][[1]][1L]] <- microorganismsDT[mo == 'B_STRPTC_GRH', ..property][[1]][1L] + x[x == microorganismsDT[mo == 'B_STRPT_SAN', ..property][[1]][1L]] <- microorganismsDT[mo == 'B_STRPT_GRH', ..property][[1]][1L] # group K - S. salivarius - x[x == microorganismsDT[mo == 'B_STRPTC_SAL', ..property][[1]][1L]] <- microorganismsDT[mo == 'B_STRPTC_GRK', ..property][[1]][1L] + x[x == microorganismsDT[mo == 'B_STRPT_SAL', ..property][[1]][1L]] <- microorganismsDT[mo == 'B_STRPT_GRK', ..property][[1]][1L] } @@ -875,8 +930,6 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, if (property == "mo") { class(x) <- "mo" - } else if (property == "tsn") { - x <- as.integer(x) } if (length(mo_renamed()) > 0) { diff --git a/R/mo_property.R b/R/mo_property.R index 5d67e37d..9443687e 100755 --- a/R/mo_property.R +++ b/R/mo_property.R @@ -38,7 +38,7 @@ #' @rdname mo_property #' @name mo_property #' @return \itemize{ -#' \item{An \code{integer} in case of \code{mo_TSN} and \code{mo_year}} +#' \item{An \code{integer} in case of \code{mo_year}} #' \item{A \code{list} in case of \code{mo_taxonomy}} #' \item{A \code{character} in all other cases} #' } @@ -57,7 +57,6 @@ #' mo_genus("E. coli") # "Escherichia" #' mo_species("E. coli") # "coli" #' mo_subspecies("E. coli") # NA -#' mo_TSN("E. coli") # 285 (Taxonomic Serial Number) #' #' ## colloquial properties #' mo_fullname("E. coli") # "Escherichia coli" @@ -242,17 +241,15 @@ mo_type <- function(x, language = get_locale(), ...) { #' @rdname mo_property #' @export mo_gramstain <- function(x, language = get_locale(), ...) { - mo_translate(mo_validate(x = x, property = "gramstain", ...), language = language) -} - -#' @rdname mo_property -#' @export -mo_TSN <- function(x, ...) { - res <- mo_validate(x = x, property = "tsn", ...) - if (any(is.na(res))) { - warning("Some results do not have a TSN, because they are missing from ITIS and were added manually. See ?microorganisms.") - } - res + x.bak <- x + x <- mo_phylum(x, ...) + x[x %in% c("Actinobacteria", + "Chloroflexi", + "Firmicutes", + "Tenericutes")] <- "Gram positive" + x[x != "Gram positive"] <- "Gram negative" + x[mo_kingdom(x.bak) != "Bacteria"] <- NA_character_ + mo_translate(x, language = language) } #' @rdname mo_property @@ -284,7 +281,6 @@ mo_year <- function(x, ...) { mo_taxonomy <- function(x, ...) { x <- AMR::as.mo(x, ...) base::list(kingdom = mo_kingdom(x), - subkingdom = mo_subkingdom(x), phylum = mo_phylum(x), class = mo_class(x), order = mo_order(x), @@ -472,11 +468,7 @@ mo_validate <- function(x, property, ...) { if (!"AMR" %in% base::.packages()) { library("AMR") - # These data.tables are available as data sets when the AMR package is loaded: - # microorganismsDT # this one is sorted by kingdom (B% + mutate(prevalent = ifelse(phylum %in% c("Proteobacteria", + "Firmicutes", + "Actinobacteria", + "Bacteroidetes") + | genus %in% c("Candida", + "Aspergillus", + "Trichophyton", + "Giardia", + "Dientamoeba", + "Entamoeba"), + 0, + 1), + superprevalent = ifelse( + # most important Gram negatives + class == "Gammaproteobacteria" + # Streptococci and Staphylococci + | order %in% c("Lactobacillales", + "Bacillales"), + 0, + 1)) %>% + as.data.table() + setkey(microorganismsDT, kingdom, superprevalent, prevalent, fullname) + microorganisms.superprevDT <- microorganismsDT[superprevalent == 0,] + microorganisms.prevDT <- microorganismsDT[superprevalent == 1 & prevalent == 0,] + microorganisms.unprevDT <- microorganismsDT[superprevalent == 1 & prevalent == 1,] + microorganisms.oldDT <- as.data.table(AMR::microorganisms.old) + setkey(microorganisms.oldDT, col_id, fullname) + + assign(x = "microorganismsDT", + value = microorganismsDT, + envir = asNamespace("AMR")) + + assign(x = "microorganisms.superprevDT", + value = microorganisms.superprevDT, + envir = asNamespace("AMR")) + + assign(x = "microorganisms.prevDT", + value = microorganisms.prevDT, + envir = asNamespace("AMR")) + + assign(x = "microorganisms.unprevDT", + value = microorganisms.unprevDT, + envir = asNamespace("AMR")) + + assign(x = "microorganisms.oldDT", + value = microorganisms.oldDT, + envir = asNamespace("AMR")) + + # packageStartupMessage("OK.", appendLF = TRUE) + } } diff --git a/data/microorganisms.codes.rda b/data/microorganisms.codes.rda index a7f81ff2..e5254a13 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 178ff45c..02c8c939 100644 Binary files a/data/microorganisms.old.rda and b/data/microorganisms.old.rda differ diff --git a/data/microorganisms.oldDT.rda b/data/microorganisms.oldDT.rda deleted file mode 100644 index a9d189ef..00000000 Binary files a/data/microorganisms.oldDT.rda and /dev/null differ diff --git a/data/microorganisms.prevDT.rda b/data/microorganisms.prevDT.rda deleted file mode 100644 index a84a2d25..00000000 Binary files a/data/microorganisms.prevDT.rda and /dev/null differ diff --git a/data/microorganisms.rda b/data/microorganisms.rda index 9c7a29d4..24a35f47 100755 Binary files a/data/microorganisms.rda and b/data/microorganisms.rda differ diff --git a/data/microorganisms.unprevDT.rda b/data/microorganisms.unprevDT.rda deleted file mode 100644 index 78e1b8d4..00000000 Binary files a/data/microorganisms.unprevDT.rda and /dev/null differ diff --git a/data/microorganismsDT.rda b/data/microorganismsDT.rda deleted file mode 100644 index 2b4f8a68..00000000 Binary files a/data/microorganismsDT.rda and /dev/null differ diff --git a/data/septic_patients.rda b/data/septic_patients.rda index 4fa1a989..e189e0ae 100755 Binary files a/data/septic_patients.rda and b/data/septic_patients.rda differ diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 78f0eccf..8c8e0abf 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index 26a20446..212c53ae 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 @@ -192,7 +192,7 @@

How to conduct AMR analysis

Matthijs S. Berends

-

14 February 2019

+

18 February 2019

@@ -201,7 +201,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 14 February 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 18 February 2019.

Introduction

@@ -217,21 +217,21 @@ -2019-02-14 +2019-02-18 abcd Escherichia coli S S -2019-02-14 +2019-02-18 abcd Escherichia coli S R -2019-02-14 +2019-02-18 efgh Escherichia coli R @@ -327,70 +327,70 @@ -2017-12-27 -C5 +2011-01-25 +V6 Hospital A Staphylococcus aureus +I S S S -S -M +F -2012-11-20 -Y5 +2013-07-31 +A8 Hospital D Escherichia coli S S S S -F +M -2011-06-25 -I4 +2016-10-12 +Y3 +Hospital D +Escherichia coli +R +S +S +R +F + + +2013-12-31 +B4 Hospital B Escherichia coli S S -R +S S M - -2016-10-16 -N10 -Hospital A -Escherichia coli -S -S -S -S -F - -2015-09-01 -L1 -Hospital D -Escherichia coli +2014-08-10 +F9 +Hospital A +Staphylococcus aureus R S -S +R S M -2013-12-14 -Z3 +2017-12-05 +H7 Hospital A -Klebsiella pneumoniae -R +Escherichia coli S S S -F +S +M @@ -411,8 +411,8 @@ #> #> Item Count Percent Cum. Count Cum. Percent #> --- ----- ------- -------- ----------- ------------- -#> 1 M 10,432 52.2% 10,432 52.2% -#> 2 F 9,568 47.8% 20,000 100.0% +#> 1 M 10,283 51.4% 10,283 51.4% +#> 2 F 9,717 48.6% 20,000 100.0%

So, we can draw at least two conclusions immediately. From a data scientist perspective, the data looks clean: only values M and F. From a researcher perspective: there are slightly more men. Nothing we didn’t already know.

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:

+#> -> changed 4,116 test results (0 to S; 0 to I; 4,116 to R)
+#> => Found 5,654 first isolates (28.3% of total)

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

@@ -516,43 +516,43 @@ 1 -2010-01-04 -M1 +2010-04-05 +Q7 B_ESCHR_COL R S -R +S S TRUE 2 -2010-01-27 -M1 +2010-05-10 +Q7 B_ESCHR_COL -R S +R S S FALSE 3 -2010-05-07 -M1 +2010-06-22 +Q7 B_ESCHR_COL S -S +I S S FALSE 4 -2010-06-09 -M1 +2010-06-25 +Q7 B_ESCHR_COL -R +S S S S @@ -560,10 +560,10 @@ 5 -2010-07-23 -M1 +2010-10-03 +Q7 B_ESCHR_COL -R +S S S S @@ -571,30 +571,30 @@ 6 -2010-09-29 -M1 +2010-10-08 +Q7 B_ESCHR_COL S -R +S S S FALSE 7 -2010-10-14 -M1 +2011-03-24 +Q7 B_ESCHR_COL -R S -R +S +S S FALSE 8 -2010-10-15 -M1 +2011-03-27 +Q7 B_ESCHR_COL S S @@ -604,21 +604,21 @@ 9 -2010-10-16 -M1 +2011-05-11 +Q7 B_ESCHR_COL S +S R -S -S -FALSE +R +TRUE 10 -2010-11-16 -M1 +2011-07-22 +Q7 B_ESCHR_COL -S +R S S S @@ -626,7 +626,7 @@ -

Only 1 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 should 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 2 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 should 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:

+#> => Found 15,805 first weighted isolates (79.0% of total) @@ -654,23 +654,23 @@ - - + + - + - - + + - + @@ -678,34 +678,34 @@ - - + + - + - + - - + + - + - + - - + + - + @@ -714,58 +714,58 @@ - - + + - + - + - - + + - - + + - + - - + + - + - - + + + - - - + + - - + + - + @@ -774,11 +774,11 @@
isolate
12010-01-04M12010-04-05Q7 B_ESCHR_COL R SRS S TRUE TRUE
22010-01-27M12010-05-10Q7 B_ESCHR_COLR SR S S FALSE
32010-05-07M12010-06-22Q7 B_ESCHR_COL SSI S S FALSETRUEFALSE
42010-06-09M12010-06-25Q7 B_ESCHR_COLRS S S S FALSETRUEFALSE
52010-07-23M12010-10-03Q7 B_ESCHR_COLRS S S S
62010-09-29M12010-10-08Q7 B_ESCHR_COL SRS S S FALSETRUEFALSE
72010-10-14M12011-03-24Q7 B_ESCHR_COLR SRSS S FALSETRUEFALSE
82010-10-15M12011-03-27Q7 B_ESCHR_COL S S S S FALSETRUEFALSE
92010-10-16M12011-05-11Q7 B_ESCHR_COL SS RSSFALSERTRUE TRUE
102010-11-16M12011-07-22Q7 B_ESCHR_COLSR S S S
-

Instead of 1, now 9 isolates are flagged. In total, 79.3% of all isolates are marked ‘first weighted’ - 51% 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 2, now 4 isolates are flagged. In total, 79% of all isolates are marked ‘first weighted’ - 50.8% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

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

-

So we end up with 15,859 isolates for analysis.

+

So we end up with 15,805 isolates for analysis.

We can remove unneeded columns:

@@ -803,30 +803,62 @@ -4 -2016-10-16 -N10 -Hospital A +2 +2013-07-31 +A8 +Hospital D B_ESCHR_COL S S S S -F +M Gram negative Escherichia coli TRUE -5 -2015-09-01 -L1 +3 +2016-10-12 +Y3 Hospital D B_ESCHR_COL R S S +R +F +Gram negative +Escherichia +coli +TRUE + + +5 +2014-08-10 +F9 +Hospital A +B_STPHY_AUR +R +S +R +S +M +Gram positive +Staphylococcus +aureus +TRUE + + +6 +2017-12-05 +H7 +Hospital A +B_ESCHR_COL +S +S +S S M Gram negative @@ -835,69 +867,37 @@ TRUE -6 -2013-12-14 -Z3 -Hospital A -B_KLBSL_PNE +7 +2014-02-06 +D7 +Hospital C +B_STPHY_AUR +R +R R S -S -S -F -Gram negative -Klebsiella -pneumoniae +M +Gram positive +Staphylococcus +aureus TRUE -7 -2011-09-19 -U9 +8 +2013-05-11 +A5 Hospital A B_STPHY_AUR S S S S -F +M Gram positive Staphylococcus aureus TRUE - -8 -2016-02-23 -H1 -Hospital A -B_ESCHR_COL -S -S -S -S -M -Gram negative -Escherichia -coli -TRUE - - -9 -2016-08-02 -I4 -Hospital B -B_ESCHR_COL -R -S -S -S -M -Gram negative -Escherichia -coli -TRUE -

Time for the analysis!

@@ -915,9 +915,9 @@
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)
-

Frequency table of genus and species from a data.frame (15,859 x 13)

+

Frequency table of genus and species from a data.frame (15,805 x 13)

Columns: 2
-Length: 15,859 (of which NA: 0 = 0.00%)
+Length: 15,805 (of which NA: 0 = 0.00%)
Unique: 4

Shortest: 16
Longest: 24

@@ -934,33 +934,33 @@ Longest: 24

1 Escherichia coli -7,917 -49.9% -7,917 -49.9% +7,815 +49.4% +7,815 +49.4% 2 Staphylococcus aureus -3,901 -24.6% -11,818 -74.5% +3,988 +25.2% +11,803 +74.7% 3 Streptococcus pneumoniae -2,478 -15.6% -14,296 -90.1% +2,476 +15.7% +14,279 +90.3% 4 Klebsiella pneumoniae -1,563 -9.9% -15,859 +1,526 +9.7% +15,805 100.0% @@ -971,7 +971,7 @@ 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:

+#> [1] 0.4771275

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

data_1st %>% 
   group_by(hospital) %>% 
@@ -984,19 +984,19 @@ Longest: 24

Hospital A -0.4658398 +0.4661749 Hospital B -0.4821041 +0.4820906 Hospital C -0.4874459 +0.4847862 Hospital D -0.4803681 +0.4790875 @@ -1014,23 +1014,23 @@ Longest: 24

Hospital A -0.4658398 -4757 +0.4661749 +4745 Hospital B -0.4821041 -5532 +0.4820906 +5472 Hospital C -0.4874459 -2310 +0.4847862 +2432 Hospital D -0.4803681 -3260 +0.4790875 +3156 @@ -1050,27 +1050,27 @@ Longest: 24

Escherichia -0.7305798 -0.8974359 -0.9760010 +0.7332054 +0.9033909 +0.9754319 Klebsiella -0.7370441 -0.9040307 -0.9776072 +0.7142857 +0.9095675 +0.9737877 Staphylococcus -0.7303256 -0.9200205 -0.9771853 +0.7179037 +0.9162487 +0.9779338 Streptococcus -0.7332526 +0.7289984 0.0000000 -0.7332526 +0.7289984 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 6c74e47b..86aa274d 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 7e16efff..1f6d21fd 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 913447ee..2689fa2e 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 57c3c5c1..bac17cf6 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 43817373..908711d9 100644 --- a/docs/articles/EUCAST.html +++ b/docs/articles/EUCAST.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018
@@ -192,7 +192,7 @@

How to apply EUCAST rules

Matthijs S. Berends

-

14 February 2019

+

18 February 2019

diff --git a/docs/articles/G_test.html b/docs/articles/G_test.html index 51b354ec..589abac2 100644 --- a/docs/articles/G_test.html +++ b/docs/articles/G_test.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 @@ -192,7 +192,7 @@

How to use the G-test

Matthijs S. Berends

-

14 February 2019

+

18 February 2019

diff --git a/docs/articles/SPSS.html b/docs/articles/SPSS.html index fdf4eab7..7d8a8546 100644 --- a/docs/articles/SPSS.html +++ b/docs/articles/SPSS.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/articles/WHONET.html b/docs/articles/WHONET.html index 34d9fc96..9d3b980e 100644 --- a/docs/articles/WHONET.html +++ b/docs/articles/WHONET.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 @@ -192,7 +192,7 @@

How to work with WHONET data

Matthijs S. Berends

-

14 February 2019

+

18 February 2019

@@ -274,7 +274,7 @@ Species: 36

4 -B_STRPTC_PNE +B_STRPT_PNE 31 6.2% 388 diff --git a/docs/articles/atc_property.html b/docs/articles/atc_property.html index a958d76c..0760a382 100644 --- a/docs/articles/atc_property.html +++ b/docs/articles/atc_property.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 @@ -192,7 +192,7 @@

How to get properties of an antibiotic

Matthijs S. Berends

-

14 February 2019

+

18 February 2019

diff --git a/docs/articles/benchmarks.html b/docs/articles/benchmarks.html index 45722e41..7fdf2257 100644 --- a/docs/articles/benchmarks.html +++ b/docs/articles/benchmarks.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/articles/freq.html b/docs/articles/freq.html index db8b423f..d964bf24 100644 --- a/docs/articles/freq.html +++ b/docs/articles/freq.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 @@ -192,7 +192,7 @@

How to create frequency tables

Matthijs S. Berends

-

14 February 2019

+

18 February 2019

@@ -256,22 +256,22 @@ Longest: 1

# 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:

-

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

+# [1] "mo" "col_id" "fullname" "kingdom" "phylum" +# [6] "class" "order" "family" "genus" "species" +# [11] "subspecies" "rank" "ref" +

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

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

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)
-

Frequency table of genus and species from a data.frame (2,000 x 63)

+

Frequency table of genus and species from a data.frame (2,000 x 61)

Columns: 2
Length: 2,000 (of which NA: 0 = 0.00%)
-Unique: 96

-

Shortest: 12
+Unique: 95

+

Shortest: 8
Longest: 34

@@ -405,7 +405,7 @@ Longest: 34

-

(omitted 81 entries, n = 340 [17.0%])

+

(omitted 80 entries, n = 340 [17.0%])

diff --git a/docs/articles/index.html b/docs/articles/index.html index 87d81222..6645d5b5 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018

diff --git a/docs/articles/mo_property.html b/docs/articles/mo_property.html index 7cd41212..1700164e 100644 --- a/docs/articles/mo_property.html +++ b/docs/articles/mo_property.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 @@ -192,7 +192,7 @@

How to get properties of a microorganism

Matthijs S. Berends

-

14 February 2019

+

18 February 2019

diff --git a/docs/articles/resistance_predict.html b/docs/articles/resistance_predict.html index 20f66452..03e8e556 100644 --- a/docs/articles/resistance_predict.html +++ b/docs/articles/resistance_predict.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 @@ -192,7 +192,7 @@

How to predict antimicrobial resistance

Matthijs S. Berends

-

14 February 2019

+

18 February 2019

diff --git a/docs/authors.html b/docs/authors.html index dded1b7f..391ebb8a 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/index.html b/docs/index.html index 08845d9e..e8870b83 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/news/index.html b/docs/news/index.html index 31d150a4..59b41ad3 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 @@ -237,12 +237,27 @@ AMR 0.5.0.90xx Unreleased

Note: this is the development version, which will eventually be released as AMR 0.6.0.

+

New website!

+

We’ve got a new website: https://msberends.gitlab.io/AMR (built with the great pkgdown)

+

New

  • BREAKING: removed deprecated functions, parameters and references to ‘bactid’. Use as.mo() to identify an MO code.
  • +
  • Catalogue of Life (CoL) inclusion for data about microorganisms, which also contains all ITIS data we used previously. The microorganisms data set now contains: +
      +
    • Almost 60,000 species from six different kingdoms
    • +
    • Almost 15,000 previously accepted names which are now taxonomic ‘synonyms’
    • +
    • All (sub)species from the kingdoms Archaea, Bacteria, Chromista, Protozoa and Viruses
    • +
    • All (sub)species from the orders Eurotiales, Saccharomycetales and Onygenales of the kingdom Fungi. The complete taxonomy of this kingdom has more than 130,000 species. The orders we included contains at least all memebers of the families Candida, Aspergillus and Trichophyton.
    • +
    • Due to this change, the ID of Streptococcus was changed from B_STRPTC to B_STRPT.
    • +
    +
  • Support for data from WHONET and EARS-Net (European Antimicrobial Resistance Surveillance Network):
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 website: https://msberends.gitlab.io/AMR (built with the great pkgdown) -
      -
    • Contains the complete manual of this package and all of its functions with an explanation of their parameters
    • -
    • Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis
    • -
    -
  • 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
  • @@ -308,7 +317,7 @@ These functions use as.atc()
  • New info is returned when running this function, stating exactly what has been changed or added. Use eucast_rules(..., verbose = TRUE) to get a data set with all changed per bug and drug combination.
  • -
  • Added 605 Aspergillus species and 23 Trichophyton species to the microorganisms data set
  • +
  • Removed data sets microorganisms.oldDT, microorganisms.prevDT, microorganisms.unprevDT and microorganismsDT since they were no longer needed and only contained info already available in the microorganisms data set
  • 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
  • Functions atc_ddd() and atc_groups() have been renamed atc_online_ddd() and atc_online_groups(). The old functions are deprecated and will be removed in a future version.
  • diff --git a/docs/reference/AMR-deprecated.html b/docs/reference/AMR-deprecated.html index 58c0c043..a224f671 100644 --- a/docs/reference/AMR-deprecated.html +++ b/docs/reference/AMR-deprecated.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/AMR.html b/docs/reference/AMR.html index ef80a315..3147b145 100644 --- a/docs/reference/AMR.html +++ b/docs/reference/AMR.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/ITIS.html b/docs/reference/ITIS.html index e2cf9b6a..12a08129 100644 --- a/docs/reference/ITIS.html +++ b/docs/reference/ITIS.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html index a1bd7443..83e33dfc 100644 --- a/docs/reference/WHOCC.html +++ b/docs/reference/WHOCC.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/WHONET.html b/docs/reference/WHONET.html index b25d7f49..24336a43 100644 --- a/docs/reference/WHONET.html +++ b/docs/reference/WHONET.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/abname.html b/docs/reference/abname.html index 34e3e196..e3230a1f 100644 --- a/docs/reference/abname.html +++ b/docs/reference/abname.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/age.html b/docs/reference/age.html index 60a469dd..8f2123c0 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index 9436195a..2b538a24 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index 457f6757..9c5ac1db 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/as.atc.html b/docs/reference/as.atc.html index fd39f120..4ed669e7 100644 --- a/docs/reference/as.atc.html +++ b/docs/reference/as.atc.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index 4dbe3ae2..c83cf55a 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index 0e5fb0f2..ce6138ea 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9017 + 0.5.0.9018 @@ -296,7 +296,8 @@ | | | ----> subspecies, a 3-4 letter acronym | | ----> species, a 3-4 letter acronym | ----> genus, a 5-7 letter acronym, mostly without vowels - ----> taxonomic kingdom, either B (Bacteria), F (Fungi) or P (Protozoa) + ----> taxonomic kingdom: A (Archaea), B (Bacteria), C (Chromista), + F (Fungi), P (Protozoa) or V (Viruses)

    Use the mo_property functions to get properties based on the returned code, see Examples.

    This function uses Artificial Intelligence (AI) to help getting fast and logical results. It tries to find matches in this order:

    Examples: