diff --git a/DESCRIPTION b/DESCRIPTION index 45f7ab3e..ec533542 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 0.7.1.9079 +Version: 0.7.1.9080 Date: 2019-09-22 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index 5b8024ed..2f2680f5 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 0.7.1.9079 +# AMR 0.7.1.9080 Last updated: 22-Sep-2019 ### Breaking @@ -79,6 +79,7 @@ * These new trivial names known to the field are now understood: meningococcus, gonococcus, pneumococcus * Updated to the latest taxonomic data (updated to August 2019, from the International Journal of Systematic and Evolutionary Microbiology * Added support for Viridans Group Streptococci (VGS) and Milleri Group Streptococci (MGS) + * Added support for *Blastocystis* * Added support for 5,000 new fungi * Added support for unknown yeasts and fungi * Changed most microorganism IDs to improve readability. **IMPORTANT:** Because of these changes, the microorganism IDs have been changed to a slightly different format. Old microorganism IDs are still supported, but support will be dropped in a future version. Use `as.mo()` on your old codes to transform them to the new format. @@ -105,6 +106,7 @@ * Using negative values for `x` in `age_groups()` will now introduce `NA`s and not return an error anymore * Fix for determining the system's language * Fix for `key_antibiotics()` on foreign systems +* Added 80 new LIS codes for microorganisms #### Other * Added Prof. Dr. Casper Albers as doctoral advisor and added Dr. Judith Fonville, Eric Hazenberg, Dr. Bart Meijer, Dr. Dennis Souverein and Annick Lenglet as contributors diff --git a/R/data.R b/R/data.R index e4c4477d..755cff3b 100755 --- a/R/data.R +++ b/R/data.R @@ -55,7 +55,7 @@ #' #' A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using \code{\link{as.mo}}. #' @inheritSection catalogue_of_life Catalogue of Life -#' @format A \code{\link{data.frame}} with 69,454 observations and 16 variables: +#' @format A \code{\link{data.frame}} with 69,465 observations and 16 variables: #' \describe{ #' \item{\code{mo}}{ID of microorganism as used by this package} #' \item{\code{col_id}}{Catalogue of Life ID} @@ -72,6 +72,7 @@ #' \item{11 entries of \emph{Streptococcus} (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)} #' \item{2 entries of \emph{Staphylococcus} (coagulase-negative [CoNS] and coagulase-positive [CoPS])} #' \item{3 entries of \emph{Trichomonas} (\emph{Trichomonas vaginalis}, and its family and genus)} +#' \item{1 entry of \emph{Blastocystis} (\emph{Blastocystis hominis}), although it officially does not exist (Noel et al. 2005, PMID 15634993)} #' \item{5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)} #' \item{9,460 species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications} #' } @@ -114,7 +115,7 @@ catalogue_of_life <- list( #' Translation table for common microorganism codes #' #' A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with \code{\link{set_mo_source}}. -#' @format A \code{\link{data.frame}} with 4,927 observations and 2 variables: +#' @format A \code{\link{data.frame}} with 5,006 observations and 2 variables: #' \describe{ #' \item{\code{code}}{Commonly used code of a microorganism} #' \item{\code{mo}}{ID of the microorganism in the \code{\link{microorganisms}} data set} diff --git a/R/filter_ab_class.R b/R/filter_ab_class.R index 634aa8d2..6b3bfd88 100644 --- a/R/filter_ab_class.R +++ b/R/filter_ab_class.R @@ -26,7 +26,7 @@ #' @param ab_class an antimicrobial class, like \code{"carbapenems"}, as can be found in \code{AMR::antibiotics$group} #' @param result an antibiotic result: S, I or R (or a combination of more of them) #' @param scope the scope to check which variables to check, can be \code{"any"} (default) or \code{"all"} -#' @param ... parameters passed on to \code{\link[dplyr]{filter_at}} +#' @param ... parameters passed on to \code{filter_at} from the \code{dplyr} package #' @details The \code{group} column in \code{\link{antibiotics}} data set will be searched for \code{ab_class} (case-insensitive). If no results are found, the \code{atc_group1} and \code{atc_group2} columns will be searched. Next, \code{x} will be checked for column names with a value in any abbreviations, codes or official names found in the \code{antibiotics} data set. #' @rdname filter_ab_class #' @keywords filter fillter_class diff --git a/R/freq.R b/R/freq.R index 40a0032f..bd58d646 100755 --- a/R/freq.R +++ b/R/freq.R @@ -29,22 +29,21 @@ clean::freq #' @export #' @noRd freq.mo <- function(x, ...) { - x <- as.mo(x) # to get the newest mo codes - x_noNA <- x[!is.na(x)] + x_noNA <- as.mo(x[!is.na(x)]) # as.mo() to get the newest mo codes grams <- mo_gramstain(x_noNA, language = NULL) freq.default(x = x, ..., .add_header = list(`Gram-negative` = paste0(format(sum(grams == "Gram-negative", na.rm = TRUE), big.mark = ",", decimal.mark = "."), - " (", percent(sum(grams == "Gram-negative", na.rm = TRUE) / length(grams), force_zero = TRUE), - " of total)"), + " (", percent(sum(grams == "Gram-negative", na.rm = TRUE) / length(grams), force_zero = TRUE, round = 2), + ")"), `Gram-positive` = paste0(format(sum(grams == "Gram-positive", na.rm = TRUE), big.mark = ",", decimal.mark = "."), - " (", percent(sum(grams == "Gram-positive", na.rm = TRUE) / length(grams), force_zero = TRUE), - " of total)"), - genera = n_distinct(mo_genus(x_noNA, language = NULL)), - species = n_distinct(paste(mo_genus(x_noNA, language = NULL), + " (", percent(sum(grams == "Gram-positive", na.rm = TRUE) / length(grams), force_zero = TRUE, round = 2), + ")"), + `Unique genera` = n_distinct(mo_genus(x_noNA, language = NULL)), + `Unique species` = n_distinct(paste(mo_genus(x_noNA, language = NULL), mo_species(x_noNA, language = NULL))))) } diff --git a/data-raw/internals.R b/data-raw/internals.R index 9d26e23c..2961c350 100644 --- a/data-raw/internals.R +++ b/data-raw/internals.R @@ -49,14 +49,14 @@ rm(translations_file) rm(microorganisms.translation) # Clean mo history ---- -mo_history_file <- file.path(file.path(system.file(package = "AMR"), "mo_history"), "mo_history.csv") -usethis::ui_done(paste0("Resetting {usethis::ui_value('", mo_history_file, "')}")) +usethis::ui_done(paste0("Resetting {usethis::ui_value('mo_history.csv')}")) tryCatch( write.csv(x = data.frame(x = character(0), mo = character(0), uncertainty_level = integer(0), - package_v = character(0), + package_version = character(0), stringsAsFactors = FALSE), - file = mo_history_file), - warning = function(w) invisible(), - error = function(e) TRUE) + row.names = FALSE, + file = "inst/mo_history/mo_history.csv"), + warning = function(w) cat("Warning:", w$message, "\n"), + error = function(e) cat("Error:", e$message, "\n")) diff --git a/data-raw/reproduction_of_microorganisms.R b/data-raw/reproduction_of_microorganisms.R index 36dddc00..4334b842 100644 --- a/data-raw/reproduction_of_microorganisms.R +++ b/data-raw/reproduction_of_microorganisms.R @@ -94,7 +94,7 @@ rm(ref_taxonomy) mo_found_in_NL <- c("Absidia", "Acremonium", "Actinotignum", "Aedes", "Alternaria", "Anaerosalibacter", "Ancylostoma", "Angiostrongylus", "Anisakis", "Anopheles", "Apophysomyces", "Arachnia", "Ascaris", "Aspergillus", "Aureobacterium", "Aureobasidium", "Bacteroides", "Balantidum", "Basidiobolus", "Beauveria", - "Bilophilia", "Branhamella", "Brochontrix", "Brugia", "Calymmatobacterium", "Candida", "Capillaria", + "Bilophilia", "Blastocystis", "Branhamella", "Brochontrix", "Brugia", "Calymmatobacterium", "Candida", "Capillaria", "Capnocytophaga", "Catabacter", "Cdc", "Chaetomium", "Chilomastix", "Chryseobacterium", "Chryseomonas", "Chrysonilia", "Cladophialophora", "Cladosporium", "Clonorchis", "Conidiobolus", "Contracaecum", "Cordylobia", "Cryptococcus", "Curvularia", "Demodex", "Dermatobia", "Dicrocoelium", @@ -113,7 +113,7 @@ mo_found_in_NL <- c("Absidia", "Acremonium", "Actinotignum", "Aedes", "Alternari "Rhodotorula", "Salinococcus", "Sanguibacteroides", "Sarcophagidae", "Sarcoptes", "Schistosoma", "Scolecobasidium", "Scopulariopsis", "Scytalidium", "Spirometra", "Sporobolomyces", "Stachybotrys", "Stenotrophomononas", "Stomatococcus", "Strongyloides", "Syncephalastraceae", "Syngamus", "Taenia", - "Ternidens", "Torulopsis", "Toxocara", "Treponema", "Trichinella", "Trichobilharzia", "Trichoderma", + "Ternidens", "Torulopsis", "Toxocara", "Toxoplasma", "Treponema", "Trichinella", "Trichobilharzia", "Trichoderma", "Trichomonas", "Trichophyton", "Trichosporon", "Trichostrongylus", "Trichuris", "Tritirachium", "Trombicula", "Trypanosoma", "Tunga", "Ureaplasma", "Wuchereria") @@ -219,6 +219,8 @@ MOs.old <- MOs %>% distinct(fullname, .keep_all = TRUE) %>% arrange(col_id) +MO.bak <- MOs + MOs <- MOs %>% filter(is.na(col_id_new) | source == "DSMZ") %>% transmute(col_id, @@ -594,6 +596,17 @@ MOs <- MOs %>% ref = NA_character_, species_id = "", source = "manually added"), + # Blastocystis hominis does not exist (it means 'got a Bastocystis from humans', PMID 15634993) + # but let's be nice to the clinical people in microbiology + MOs %>% + filter(fullname == "Blastocystis") %>% + mutate(mo = paste0(mo, "_HMNS"), + fullname = paste(fullname, "hominis"), + species = "hominis", + col_id = NA, + source = "manually added", + ref = NA_character_, + species_id = ""), # Trichomonas vaginalis is missing, same order as Dientamoeba MOs %>% filter(fullname == "Dientamoeba") %>% @@ -636,6 +649,7 @@ MOs <- MOs %>% ungroup() %>% filter(fullname != "") +# add prevalence to old taxonomic names MOs.old <- MOs.old %>% left_join(MOs %>% select(col_id, prevalence), by = c("col_id_new" = "col_id")) @@ -645,7 +659,8 @@ sum(duplicated(MOs$fullname)) colnames(MOs) # here we welcome the new ones: -MOs %>% arrange(genus, species, subspecies) %>% filter(!fullname %in% AMR::microorganisms$fullname) %>% View() +MOs %>% arrange(fullname) %>% filter(!fullname %in% AMR::microorganisms$fullname) %>% View() +MOs.old %>% arrange(fullname) %>% filter(!fullname %in% AMR::microorganisms.old$fullname) %>% View() # and the ones we lost: AMR::microorganisms %>% filter(!fullname %in% MOs$fullname) %>% View() # and these IDs have changed: @@ -659,9 +674,11 @@ old_new %>% View() # and these codes are now missing (which will throw a unit test error): AMR::microorganisms.codes %>% filter(!mo %in% MOs$mo) +AMR::rsi_translation %>% filter(!mo %in% MOs$mo) +AMR::microorganisms.translation %>% filter(!mo_new %in% MOs$mo) # this is how to fix it microorganisms.codes <- AMR::microorganisms.codes %>% - left_join(MOs %>% + left_join(MOs %>% mutate(kingdom_fullname = paste(kingdom, fullname)) %>% left_join(AMR::microorganisms %>% mutate(kingdom_fullname = paste(kingdom, fullname)) %>% @@ -673,7 +690,7 @@ microorganisms.codes <- AMR::microorganisms.codes %>% microorganisms.codes %>% filter(!mo %in% MOs$mo) # arrange -MOs <- MOs %>% arrange(genus, species, subspecies) +MOs <- MOs %>% arrange(fullname) MOs.old <- MOs.old %>% arrange(fullname) microorganisms.codes <- microorganisms.codes %>% arrange(code) diff --git a/data/microorganisms.codes.rda b/data/microorganisms.codes.rda index ff2420b4..8da06281 100644 Binary files a/data/microorganisms.codes.rda and b/data/microorganisms.codes.rda differ diff --git a/data/microorganisms.old.rda b/data/microorganisms.old.rda index 4be20397..a1cbd95c 100644 Binary files a/data/microorganisms.old.rda and b/data/microorganisms.old.rda differ diff --git a/data/microorganisms.rda b/data/microorganisms.rda index 382f2fa8..0e070c49 100644 Binary files a/data/microorganisms.rda and b/data/microorganisms.rda differ diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 32d087e6..d82259ff 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@
diff --git a/docs/articles/index.html b/docs/articles/index.html index 2eb61aec..013e15c6 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ diff --git a/docs/authors.html b/docs/authors.html index 7c2b5617..cc3a0bbd 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ diff --git a/docs/index.html b/docs/index.html index 72e64c5a..4818540b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ @@ -283,7 +283,7 @@This package contains the complete taxonomic tree of almost all 70,000 microorganisms from the authoritative and comprehensive Catalogue of Life (CoL, www.catalogueoflife.org). With catalogue_of_life_version()
can be checked which version of the CoL is included in this package.
This package contains the complete taxonomic tree of almost all 70,000 microorganisms from the authoritative and comprehensive Catalogue of Life (CoL, www.catalogueoflife.org). With catalogue_of_life_version()
can be checked which version of the CoL is included in this package.
Read more about which data from the Catalogue of Life in our manual.
It cleanses existing data by providing new classes for microoganisms, antibiotics and antimicrobial results (both S/I/R and MIC). By installing this package, you teach R everything about microbiology that is needed for analysis. These functions all use intelligent rules to guess results that you would expect:
as.mo()
to get a microbial ID. The IDs are human readable for the trained eye - the ID of Klebsiella pneumoniae is “B_KLBSL_PNMN” (B stands for Bacteria) and the ID of S. aureus is “B_STPHY_AURS”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” or “esccol” and tries to find expected results using intelligent rules combined with the included Catalogue of Life data set. It only takes milliseconds to find results, please see our benchmarks. Moreover, it can group Staphylococci into coagulase negative and positive (CoNS and CoPS, see source) and can categorise Streptococci into Lancefield groups (like beta-haemolytic Streptococcus Group B, source).as.ab()
to get an antibiotic ID. Like microbial IDs, these IDs are also human readable based on those used by EARS-Net. For example, the ID of amoxicillin is AMX
and the ID of gentamicin is GEN
. The as.ab()
function also uses intelligent rules to find results like accepting misspelling, trade names and abbrevations used in many laboratory systems. For instance, the values “Furabid”, “Furadantin”, “nitro” all return the ID of Nitrofurantoine. To accomplish this, the package contains a database with most LIS codes, official names, trade names, ATC codes, defined daily doses (DDD) and drug categories of antibiotics.as.rsi()
to get antibiotic interpretations based on raw MIC values (in mg/L) or disk diffusion values (in mm), or transform existing values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like “<=0.002; S” (combined MIC/RSI) will result in “S”.as.mic()
to cleanse your MIC values. It produces a so-called factor (called ordinal in SPSS) with valid MIC values as levels. A value like “<=0.002; S” (combined MIC/RSI) will result in “<=0.002”.as.mo()
to get a microbial ID. The IDs are human readable for the trained eye - the ID of Klebsiella pneumoniae is “B_KLBSL_PNMN” (B stands for Bacteria) and the ID of S. aureus is “B_STPHY_AURS”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” or “esccol” and tries to find expected results using intelligent rules combined with the included Catalogue of Life data set. It only takes milliseconds to find results, please see our benchmarks. Moreover, it can group Staphylococci into coagulase negative and positive (CoNS and CoPS, see source) and can categorise Streptococci into Lancefield groups (like beta-haemolytic Streptococcus Group B, source).as.ab()
to get an antibiotic ID. Like microbial IDs, these IDs are also human readable based on those used by EARS-Net. For example, the ID of amoxicillin is AMX
and the ID of gentamicin is GEN
. The as.ab()
function also uses intelligent rules to find results like accepting misspelling, trade names and abbrevations used in many laboratory systems. For instance, the values “Furabid”, “Furadantin”, “nitro” all return the ID of Nitrofurantoine. To accomplish this, the package contains a database with most LIS codes, official names, trade names, ATC codes, defined daily doses (DDD) and drug categories of antibiotics.as.rsi()
to get antibiotic interpretations based on raw MIC values (in mg/L) or disk diffusion values (in mm), or transform existing values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like “<=0.002; S” (combined MIC/RSI) will result in “S”.as.mic()
to cleanse your MIC values. It produces a so-called factor (called ordinal in SPSS) with valid MIC values as levels. A value like “<=0.002; S” (combined MIC/RSI) will result in “<=0.002”.It enhances existing data and adds new data from data sets included in this package.
eucast_rules()
to apply EUCAST expert rules to isolates (not the translation from MIC to RSI values, use as.rsi()
for that).first_isolate()
to identify the first isolates of every patient using guidelines from the CLSI (Clinical and Laboratory Standards Institute).
+eucast_rules()
to apply EUCAST expert rules to isolates (not the translation from MIC to RSI values, use as.rsi()
for that).first_isolate()
to identify the first isolates of every patient using guidelines from the CLSI (Clinical and Laboratory Standards Institute).
mdro()
(abbreviation of Multi Drug Resistant Organisms) to check your isolates for exceptional resistance with country-specific guidelines or EUCAST rules. Currently, national guidelines for Germany and the Netherlands are supported.microorganisms
contains the complete taxonomic tree of ~70,000 microorganisms. Furthermore, some colloquial names and all Gram stains are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like mo_genus()
, mo_family()
, mo_gramstain()
or even mo_phylum()
. As they use as.mo()
internally, they also use the same intelligent rules for determination. For example, mo_genus("MRSA")
and mo_genus("S. aureus")
will both return "Staphylococcus"
. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.antibiotics
contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, official name, common LIS codes and DDDs of both oral and parenteral administration. It also contains all (thousands of) trade names found in PubChem. The function ab_atc()
will return the ATC code of an antibiotic as defined by the WHO. Use functions like ab_name()
, ab_group()
and ab_tradenames()
to look up values. The ab_*
functions use as.ab()
internally so they support the same intelligent rules to guess the most probable result. For example, ab_name("Fluclox")
, ab_name("Floxapen")
and ab_name("J01CF05")
will all return "Flucloxacillin"
. These functions can again be used to add new variables to your data.mdro()
(abbreviation of Multi Drug Resistant Organisms) to check your isolates for exceptional resistance with country-specific guidelines or EUCAST rules. Currently, national guidelines for Germany and the Netherlands are supported.microorganisms
contains the complete taxonomic tree of ~70,000 microorganisms. Furthermore, some colloquial names and all Gram stains are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like mo_genus()
, mo_family()
, mo_gramstain()
or even mo_phylum()
. As they use as.mo()
internally, they also use the same intelligent rules for determination. For example, mo_genus("MRSA")
and mo_genus("S. aureus")
will both return "Staphylococcus"
. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.antibiotics
contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, official name, common LIS codes and DDDs of both oral and parenteral administration. It also contains all (thousands of) trade names found in PubChem. The function ab_atc()
will return the ATC code of an antibiotic as defined by the WHO. Use functions like ab_name()
, ab_group()
and ab_tradenames()
to look up values. The ab_*
functions use as.ab()
internally so they support the same intelligent rules to guess the most probable result. For example, ab_name("Fluclox")
, ab_name("Floxapen")
and ab_name("J01CF05")
will all return "Flucloxacillin"
. These functions can again be used to add new variables to your data.It analyses the data with convenient functions that use well-known methods.
portion_R()
, portion_IR()
, portion_I()
, portion_SI()
and portion_S()
functions. Similarly, the number of isolates can be determined with the count_R()
, count_IR()
, count_I()
, count_SI()
and count_S()
functions. All these functions can be used with the dplyr
package (e.g. in conjunction with summarise()
)geom_rsi()
, a function made for the ggplot2
packageresistance_predict()
functionportion_R()
, portion_IR()
, portion_I()
, portion_SI()
and portion_S()
functions. Similarly, the number of isolates can be determined with the count_R()
, count_IR()
, count_I()
, count_SI()
and count_S()
functions. All these functions can be used with the dplyr
package (e.g. in conjunction with summarise()
)geom_rsi()
, a function made for the ggplot2
packageresistance_predict()
functionLast updated: 22-Sep-2019
Determination of first isolates now excludes all ‘unknown’ microorganisms at default, i.e. microbial code "UNKNOWN"
. They can be included with the new parameter include_unknown
:
"con"
(contamination) will be excluded at default, since as.mo("con") = "UNKNOWN"
. The function always shows a note with the number of ‘unknown’ microorganisms that were included or excluded.For code consistency, classes ab
and mo
will now be preserved in any subsetting or assignment. For the sake of data integrity, this means that invalid assignments will now result in NA
:
#> invalid factor level, NA generated
# how it now works similarly for classes 'mo' and 'ab':
-x <- as.mo("E. coli")
+x <- as.mo("E. coli")
x[1] <- "testvalue"
#> Warning message:
#> invalid microorganism code, NA generated
"testvalue"
could never be understood by e.g. mo_name()
, although the class would suggest a valid microbial code.
-Function freq()
has moved to a new package, clean
(CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq()
function still works, since it is re-exported from the clean
package (which will be installed automatically upon updating this AMR
package).
"testvalue"
could never be understood by e.g. mo_name()
, although the class would suggest a valid microbial code.
+Function freq()
has moved to a new package, clean
(CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq()
function still works, since it is re-exported from the clean
package (which will be installed automatically upon updating this AMR
package).
"testvalue"
could never be
New
Function bug_drug_combinations()
to quickly get a data.frame
with the antimicrobial resistance of any bug-drug combination in a data set:
x <- bug_drug_combinations(example_isolates)
+Function bug_drug_combinations()
to quickly get a data.frame
with the antimicrobial resistance of any bug-drug combination in a data set:
+x <- bug_drug_combinations(example_isolates)
x
# NOTE: Using column `mo` as input for `col_mo`.
#> ab mo S I R total
@@ -306,48 +306,51 @@ Since this is a major change, usage of the old also_single_tested
w
Changed
-- Many algorithm improvements for
as.mo()
(of which some led to additions to the microorganisms
data set). Many thanks to all contributors that helped improving the algorithms.
+ - Many algorithm improvements for
as.mo()
(of which some led to additions to the microorganisms
data set). Many thanks to all contributors that helped improving the algorithms.
- Self-learning algorithm - the function now gains experience from previously determined microorganism IDs and learns from it (yielding 80-95% speed improvement for any guess after the first try)
- Big improvement for misspelled input
- These new trivial names known to the field are now understood: meningococcus, gonococcus, pneumococcus
- Updated to the latest taxonomic data (updated to August 2019, from the International Journal of Systematic and Evolutionary Microbiology
- Added support for Viridans Group Streptococci (VGS) and Milleri Group Streptococci (MGS)
+- Added support for Blastocystis
+
- Added support for 5,000 new fungi
- Added support for unknown yeasts and fungi
-- Changed most microorganism IDs to improve readability. IMPORTANT: Because of these changes, the microorganism IDs have been changed to a slightly different format. Old microorganism IDs are still supported, but support will be dropped in a future version. Use
as.mo()
on your old codes to transform them to the new format.
+- Changed most microorganism IDs to improve readability. IMPORTANT: Because of these changes, the microorganism IDs have been changed to a slightly different format. Old microorganism IDs are still supported, but support will be dropped in a future version. Use
as.mo()
on your old codes to transform them to the new format.
- Renamed data set
septic_patients
to example_isolates
-- Function
eucast_rules()
:
+ - Function
eucast_rules()
:
- Fixed a bug for Yersinia pseudotuberculosis
- Added more informative errors and warnings
- Printed info now distinguishes between added and changes values
-- Using Verbose mode (i.e.
eucast_rules(..., verbose = TRUE)
) returns more informative and readable output
+- Using Verbose mode (i.e.
eucast_rules(..., verbose = TRUE)
) returns more informative and readable output
- Using factors as input now adds missing factors levels when the function changes antibiotic results
- Improved the internal auto-guessing function for determining antibiotics in your data set (
AMR:::get_column_abx()
)
-- Removed class
atc
- using as.atc()
is now deprecated in favour of ab_atc()
and this will return a character, not the atc
class anymore
+- Removed class
atc
- using as.atc()
is now deprecated in favour of ab_atc()
and this will return a character, not the atc
class anymore
- Removed deprecated functions
abname()
, ab_official()
, atc_name()
, atc_official()
, atc_property()
, atc_tradenames()
, atc_trivial_nl()
-- Fix and speed improvement for
mo_shortname()
+ - Fix and speed improvement for
mo_shortname()
-- Fix for using
mo_*
functions where the coercion uncertainties and failures would not be available through mo_uncertainties()
and mo_failures()
anymore
-- Deprecated the
country
parameter of mdro()
in favour of the already existing guideline
parameter to support multiple guidelines within one country
+- Fix for using
mo_*
functions where the coercion uncertainties and failures would not be available through mo_uncertainties()
and mo_failures()
anymore
+- Deprecated the
country
parameter of mdro()
in favour of the already existing guideline
parameter to support multiple guidelines within one country
- The
name
of RIF
is now Rifampicin instead of Rifampin
- The
antibiotics
data set is now sorted by name and all cephalosporins now have their generation between brackets
-- Speed improvement for
guess_ab_col()
which is now 30 times faster for antibiotic abbreviations
-- Improved
filter_ab_class()
to be more reliable and to support 5th generation cephalosporins
-- Function
availability()
now uses portion_R()
instead of portion_IR()
, to comply with EUCAST insights
-- Functions
age()
and age_groups()
now have a na.rm
parameter to remove empty values
-- Renamed function
p.symbol()
to p_symbol()
(the former is now deprecated and will be removed in a future version)
-- Using negative values for
x
in age_groups()
will now introduce NA
s and not return an error anymore
+- Speed improvement for
guess_ab_col()
which is now 30 times faster for antibiotic abbreviations
+- Improved
filter_ab_class()
to be more reliable and to support 5th generation cephalosporins
+- Function
availability()
now uses portion_R()
instead of portion_IR()
, to comply with EUCAST insights
+- Functions
age()
and age_groups()
now have a na.rm
parameter to remove empty values
+- Renamed function
p.symbol()
to p_symbol()
(the former is now deprecated and will be removed in a future version)
+- Using negative values for
x
in age_groups()
will now introduce NA
s and not return an error anymore
- Fix for determining the system’s language
-- Fix for
key_antibiotics()
on foreign systems
+- Fix for
key_antibiotics()
on foreign systems
+- Added 80 new LIS codes for microorganisms
@@ -367,10 +370,10 @@ Since this is a major change, usage of the old also_single_tested
w
New
-
-
Function rsi_df()
to transform a data.frame
to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions count_df()
and portion_df()
to immediately show resistance percentages and number of available isolates:
+Function rsi_df()
to transform a data.frame
to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions count_df()
and portion_df()
to immediately show resistance percentages and number of available isolates:
septic_patients %>%
select(AMX, CIP) %>%
- rsi_df()
+ rsi_df()
# antibiotic interpretation value isolates
# 1 Amoxicillin SI 0.4442636 546
# 2 Amoxicillin R 0.5557364 683
@@ -393,41 +396,41 @@ Since this is a major change, usage of the old also_single_tested
w
- UPEC (Uropathogenic E. coli)
All these lead to the microbial ID of E. coli:
-as.mo("UPEC")
+as.mo("UPEC")
# B_ESCHR_COL
-mo_name("UPEC")
+mo_name("UPEC")
# "Escherichia coli"
-mo_gramstain("EHEC")
+mo_gramstain("EHEC")
# "Gram-negative"
-- Function
mo_info()
as an analogy to ab_info()
. The mo_info()
prints a list with the full taxonomy, authors, and the URL to the online database of a microorganism
-Function mo_synonyms()
to get all previously accepted taxonomic names of a microorganism
+- Function
mo_info()
as an analogy to ab_info()
. The mo_info()
prints a list with the full taxonomy, authors, and the URL to the online database of a microorganism
+Function mo_synonyms()
to get all previously accepted taxonomic names of a microorganism
Changed
-- Column names of output
count_df()
and portion_df()
are now lowercase
+- Column names of output
count_df()
and portion_df()
are now lowercase
- Fixed bug in translation of microorganism names
- Fixed bug in determining taxonomic kingdoms
-- Algorithm improvements for
as.ab()
and as.mo()
to understand even more severely misspelled input
-- Function
as.ab()
now allows spaces for coercing antibiotics names
+- Algorithm improvements for
as.ab()
and as.mo()
to understand even more severely misspelled input
+- Function
as.ab()
now allows spaces for coercing antibiotics names
- Added
ggplot2
methods for automatically determining the scale type of classes mo
and ab
- Added names of object in the header in frequency tables, even when using pipes
-- Prevented
"bacteria"
from getting coerced by as.ab()
because Bacterial is a brand name of trimethoprim (TMP)
-- Fixed a bug where setting an antibiotic would not work for
eucast_rules()
and mdro()
+ - Prevented
"bacteria"
from getting coerced by as.ab()
because Bacterial is a brand name of trimethoprim (TMP)
+- Fixed a bug where setting an antibiotic would not work for
eucast_rules()
and mdro()
- Fixed a EUCAST rule for Staphylococci, where amikacin resistance would not be inferred from tobramycin
-- Removed
latest_annual_release
from the catalogue_of_life_version()
function
+- Removed
latest_annual_release
from the catalogue_of_life_version()
function
- Removed antibiotic code
PVM1
from the antibiotics
data set as this was a duplicate of PME
-- Fixed bug where not all old taxonomic names would be printed, when using a vector as input for
as.mo()
+ - Fixed bug where not all old taxonomic names would be printed, when using a vector as input for
as.mo()
- Manually added Trichomonas vaginalis from the kingdom of Protozoa, which is missing from the Catalogue of Life
- Small improvements to
plot()
and barplot()
for MIC and RSI classes
-- Allow Catalogue of Life IDs to be coerced by
as.mo()
+ - Allow Catalogue of Life IDs to be coerced by
as.mo()
@@ -447,18 +450,18 @@ Since this is a major change, usage of the old also_single_tested
w
New
-- Support for translation of disk diffusion and MIC values to RSI values (i.e. antimicrobial interpretations). Supported guidelines are EUCAST (2011 to 2019) and CLSI (2011 to 2019). Use
as.rsi()
on an MIC value (created with as.mic()
), a disk diffusion value (created with the new as.disk()
) or on a complete date set containing columns with MIC or disk diffusion values.
-- Function
mo_name()
as alias of mo_fullname()
+ - Support for translation of disk diffusion and MIC values to RSI values (i.e. antimicrobial interpretations). Supported guidelines are EUCAST (2011 to 2019) and CLSI (2011 to 2019). Use
as.rsi()
on an MIC value (created with as.mic()
), a disk diffusion value (created with the new as.disk()
) or on a complete date set containing columns with MIC or disk diffusion values.
+- Function
mo_name()
as alias of mo_fullname()
-- Added guidelines of the WHO to determine multi-drug resistance (MDR) for TB (
mdr_tb()
) and added a new vignette about MDR. Read this tutorial here on our website.
+- Added guidelines of the WHO to determine multi-drug resistance (MDR) for TB (
mdr_tb()
) and added a new vignette about MDR. Read this tutorial here on our website.
Changed
-- Fixed a critical bug in
first_isolate()
where missing species would lead to incorrect FALSEs. This bug was not present in AMR v0.5.0, but was in v0.6.0 and v0.6.1.
-- Fixed a bug in
eucast_rules()
where antibiotics from WHONET software would not be recognised
+- Fixed a critical bug in
first_isolate()
where missing species would lead to incorrect FALSEs. This bug was not present in AMR v0.5.0, but was in v0.6.0 and v0.6.1.
+- Fixed a bug in
eucast_rules()
where antibiotics from WHONET software would not be recognised
- Completely reworked the
antibiotics
data set:
- All entries now have 3 different identifiers:
@@ -477,20 +480,20 @@ Since this is a major change, usage of the old
also_single_tested
w
Please create an issue in one of our repositories if you want additions in this file.
-- Improvements to plotting AMR results with
ggplot_rsi()
:
+ - Improvements to plotting AMR results with
ggplot_rsi()
:
- New parameter
colours
to set the bar colours
- New parameters
title
, subtitle
, caption
, x.title
and y.title
to set titles and axis descriptions
-- Improved intelligence of looking up antibiotic columns in a data set using
guess_ab_col()
+ - Improved intelligence of looking up antibiotic columns in a data set using
guess_ab_col()
-- Added ~5,000 more old taxonomic names to the
microorganisms.old
data set, which leads to better results finding when using the as.mo()
function
-- This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as ‘increased exposure’ and not ‘intermediate’ anymore. For functions like
portion_df()
and count_df()
this means that their new parameter combine_SI
is TRUE at default. Our plotting function ggplot_rsi()
also reflects this change since it uses count_df()
internally.
-- The
age()
function gained a new parameter exact
to determine ages with decimals
+- Added ~5,000 more old taxonomic names to the
microorganisms.old
data set, which leads to better results finding when using the as.mo()
function
+- This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as ‘increased exposure’ and not ‘intermediate’ anymore. For functions like
portion_df()
and count_df()
this means that their new parameter combine_SI
is TRUE at default. Our plotting function ggplot_rsi()
also reflects this change since it uses count_df()
internally.
+- The
age()
function gained a new parameter exact
to determine ages with decimals
- Removed deprecated functions
guess_mo()
, guess_atc()
, EUCAST_rules()
, interpretive_reading()
, rsi()
-- Frequency tables (
freq()
):
+ - Frequency tables (
freq()
):
@@ -513,18 +516,18 @@ Please create an issue in one of our repositories if you want changes in this file.
- Added ceftazidim intrinsic resistance to Streptococci
-- Changed default settings for
age_groups()
, to let groups of fives and tens end with 100+ instead of 120+
-- Fix for
freq()
for when all values are NA
+ - Changed default settings for
age_groups()
, to let groups of fives and tens end with 100+ instead of 120+
+- Fix for
freq()
for when all values are NA
-- Fix for
first_isolate()
for when dates are missing
-- Improved speed of
guess_ab_col()
+ - Fix for
first_isolate()
for when dates are missing
+- Improved speed of
guess_ab_col()
-- Function
as.mo()
now gently interprets any number of whitespace characters (like tabs) as one space
-- Function
as.mo()
now returns UNKNOWN
for "con"
(WHONET ID of ‘contamination’) and returns NA
for "xxx"
(WHONET ID of ‘no growth’)
-- Small algorithm fix for
as.mo()
+ - Function
as.mo()
now gently interprets any number of whitespace characters (like tabs) as one space
+- Function
as.mo()
now returns UNKNOWN
for "con"
(WHONET ID of ‘contamination’) and returns NA
for "xxx"
(WHONET ID of ‘no growth’)
+- Small algorithm fix for
as.mo()
- Removed viruses from data set
microorganisms.codes
and cleaned it up
-Fix for mo_shortname()
where species would not be determined correctly
+Fix for mo_shortname()
where species would not be determined correctly
@@ -544,7 +547,7 @@ Please
Changed
-- Fixed a critical bug when using
eucast_rules()
with verbose = TRUE
+ - Fixed a critical bug when using
eucast_rules()
with verbose = TRUE
- Coercion of microbial IDs are now written to the package namespace instead of the user’s home folder, to comply with the CRAN policy
@@ -565,7 +568,7 @@ Please New
-
-BREAKING: removed deprecated functions, parameters and references to ‘bactid’. Use
as.mo()
to identify an MO code.
+BREAKING: removed deprecated functions, parameters and references to ‘bactid’. Use as.mo()
to identify an MO code.
- Catalogue of Life as a new taxonomic source for data about microorganisms, which also contains all ITIS data we used previously. The
microorganisms
data set now contains:
- All ~55,000 (sub)species from the kingdoms of Archaea, Bacteria and Protozoa
@@ -574,36 +577,36 @@ Please catalogue_of_life_version().
+This data is updated annually - check the included version with the new function catalogue_of_life_version()
.
- Due to this change, some
mo
codes changed (e.g. Streptococcus changed from B_STRPTC
to B_STRPT
). A translation table is used internally to support older microorganism IDs, so users will not notice this difference.
-- New function
mo_rank()
for the taxonomic rank (genus, species, infraspecies, etc.)
-- New function
mo_url()
to get the direct URL of a species from the Catalogue of Life
+- New function
mo_rank()
for the taxonomic rank (genus, species, infraspecies, etc.)
+- New function
mo_url()
to get the direct URL of a species from the Catalogue of Life
- Support for data from WHONET and 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.
+- 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
.
-- The function
as.mo()
now knows all WHONET species abbreviations too, because almost 2,000 microbial abbreviations were added to the microorganisms.codes
data set.
+- The function
as.mo()
now knows all WHONET species abbreviations too, because almost 2,000 microbial abbreviations were added to the microorganisms.codes
data set.
-
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")
+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")
+septic_patients %>% filter_glycopeptides(result = "R", scope = "all")
# Filtering on glycopeptide antibacterials: all of `vanc` and `teic` is R
-
@@ -615,33 +618,33 @@ This data is updated annually - check the included version with the new function
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
+These functions use as.atc()
internally. The old atc_property
has been renamed atc_online_property()
. This is done for two reasons: firstly, not all ATC codes are of antibiotics (ab) but can also be of antivirals or antifungals. Secondly, the input must have class atc
or must be coerable to this class. Properties of these classes should start with the same class name, analogous to as.mo()
and e.g. mo_genus
.
+- New functions
set_mo_source()
and get_mo_source()
to use your own predefined MO codes as input for as.mo()
and consequently all mo_*
functions
- Support for the upcoming
dplyr
version 0.8.0
-- New function
guess_ab_col()
to find an antibiotic column in a table
-- New function
mo_failures()
to review values that could not be coerced to a valid MO code, using as.mo()
. This latter function will now only show a maximum of 10 uncoerced values and will refer to mo_failures()
.
-- New function
mo_uncertainties()
to review values that could be coerced to a valid MO code using as.mo()
, but with uncertainty.
-- New function
mo_renamed()
to get a list of all returned values from as.mo()
that have had taxonomic renaming
-- New function
age()
to calculate the (patients) age in years
-- New function
age_groups()
to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.
+- New function
guess_ab_col()
to find an antibiotic column in a table
+- New function
mo_failures()
to review values that could not be coerced to a valid MO code, using as.mo()
. This latter function will now only show a maximum of 10 uncoerced values and will refer to mo_failures()
.
+- New function
mo_uncertainties()
to review values that could be coerced to a valid MO code using as.mo()
, but with uncertainty.
+- New function
mo_renamed()
to get a list of all returned values from as.mo()
that have had taxonomic renaming
+- New function
age()
to calculate the (patients) age in years
+- New function
age_groups()
to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.
-
-
New function ggplot_rsi_predict()
as well as the base R plot()
function can now be used for resistance prediction calculated with resistance_predict()
:
-x <- resistance_predict(septic_patients, col_ab = "amox")
+New function ggplot_rsi_predict()
as well as the base R plot()
function can now be used for resistance prediction calculated with resistance_predict()
:
+
+ggplot_rsi_predict(x)
-
-
Functions filter_first_isolate()
and filter_first_weighted_isolate()
to shorten and fasten filtering on data sets with antimicrobial results, e.g.:
-septic_patients %>% filter_first_isolate(...)
+Functions filter_first_isolate()
and filter_first_weighted_isolate()
to shorten and fasten filtering on data sets with antimicrobial results, e.g.:
+
+filter_first_isolate(septic_patients, ...)
is equal to:
-- New function
availability()
to check the number of available (non-empty) results in a data.frame
+ - New function
availability()
to check the number of available (non-empty) results in a data.frame
New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the G-test and more. These are also available (and even easier readable) on our website: https://msberends.gitlab.io/AMR.
@@ -650,48 +653,48 @@ These functions use as.atc()
Changed
-- Function
eucast_rules()
:
+ - Function
eucast_rules()
:
- Updated EUCAST Clinical breakpoints to version 9.0 of 1 January 2019, the data set
septic_patients
now reflects these changes
- 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)
-- 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.
+- 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.
- 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.
-- Function
guess_mo()
is now deprecated in favour of as.mo()
and will be removed in future versions
-- Function
guess_atc()
is now deprecated in favour of as.atc()
and will be removed in future versions
-- Improvements for
as.mo()
:
+ - 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.
+- Function
guess_mo()
is now deprecated in favour of as.mo()
and will be removed in future versions
+- Function
guess_atc()
is now deprecated in favour of as.atc()
and will be removed in future versions
+- Improvements for
as.mo()
:
-
Now handles incorrect spelling, like i
instead of y
and f
instead of ph
:
-
-
Uncertainty of the algorithm is now divided into four levels, 0 to 3, where the default allow_uncertain = TRUE
is equal to uncertainty level 2. Run ?as.mo
for more info about these levels.
+Uncertainty of the algorithm is now divided into four levels, 0 to 3, where the default allow_uncertain = TRUE
is equal to uncertainty level 2. Run ?as.mo
for more info about these levels.
# equal:
-as.mo(..., allow_uncertain = TRUE)
-as.mo(..., allow_uncertain = 2)
+as.mo(..., allow_uncertain = TRUE)
+as.mo(..., allow_uncertain = 2)
# also equal:
-as.mo(..., allow_uncertain = FALSE)
-as.mo(..., allow_uncertain = 0)
-Using as.mo(..., allow_uncertain = 3)
could lead to very unreliable results.
+as.mo(..., allow_uncertain = FALSE)
+as.mo(..., allow_uncertain = 0)
+Using as.mo(..., allow_uncertain = 3)
could lead to very unreliable results.
- Implemented the latest publication of Becker et al. (2019), for categorising coagulase-negative Staphylococci
- All microbial IDs that found are now saved to a local file
~/.Rhistory_mo
. Use the new function clean_mo_history()
to delete this file, which resets the algorithms.
-
Incoercible results will now be considered ‘unknown’, MO code UNKNOWN
. On foreign systems, properties of these will be translated to all languages already previously supported: German, Dutch, French, Italian, Spanish and Portuguese:
-mo_genus("qwerty", language = "es")
+mo_genus("qwerty", language = "es")
# Warning:
# one unique value (^= 100.0%) could not be coerced and is considered 'unknown': "qwerty". Use mo_failures() to review it.
#> [1] "(género desconocido)"
@@ -709,7 +712,7 @@ Using as.mo(..., allow_uncertain = 3)Console will return the percentage of uncoercable input
-- Function
first_isolate()
:
+ - Function
first_isolate()
:
- Fixed a bug where distances between dates would not be calculated right - in the
septic_patients
data set this yielded a difference of 0.15% more isolates
- Will now use a column named like “patid” for the patient ID (parameter
col_patientid
), when this parameter was left blank
@@ -721,38 +724,38 @@ Using as.mo(..., allow_uncertain = 3)A note to the manual pages of the portion
functions, that low counts can influence the outcome and that the portion
functions may camouflage this, since they only return the portion (albeit being dependent on the minimum
parameter)
- Merged data sets
microorganisms.certe
and microorganisms.umcg
into microorganisms.codes
-- Function
mo_taxonomy()
now contains the kingdom too
-- Reduce false positives for
is.rsi.eligible()
using the new threshold
parameter
-- New colours for
scale_rsi_colours()
+ - Function
mo_taxonomy()
now contains the kingdom too
+- Reduce false positives for
is.rsi.eligible()
using the new threshold
parameter
+- New colours for
scale_rsi_colours()
- Summaries of class
mo
will now return the top 3 and the unique count, e.g. using summary(mo)
- Small text updates to summaries of class
rsi
and mic
-- Function
as.rsi()
:
+ - Function
as.rsi()
:
- Now gives a warning when inputting MIC values
- Now accepts high and low resistance:
"HIGH S"
will return S
-- Frequency tables (
freq()
function):
+ - Frequency tables (
freq()
function):
-
Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:
# Determine genus of microorganisms (mo) in `septic_patients` data set:
# OLD WAY
septic_patients %>%
- mutate(genus = mo_genus(mo)) %>%
- freq(genus)
+ mutate(genus = mo_genus(mo)) %>%
+ freq(genus)
# NEW WAY
septic_patients %>%
- freq(mo_genus(mo))
+ freq(mo_genus(mo))
# Even supports grouping variables:
septic_patients %>%
group_by(gender) %>%
- freq(mo_genus(mo))
+ freq(mo_genus(mo))
- Header info is now available as a list, with the
header
function
- The parameter
header
is now set to TRUE
at default, even for markdown
@@ -767,11 +770,11 @@ Using as.mo(..., allow_uncertain = 3)Fix for using select()
on frequency tables
-- Function
scale_y_percent()
now contains the limits
parameter
-- Automatic parameter filling for
mdro()
, key_antibiotics()
and eucast_rules()
+ - Function
scale_y_percent()
now contains the limits
parameter
+- Automatic parameter filling for
mdro()
, key_antibiotics()
and eucast_rules()
-- Updated examples for resistance prediction (
resistance_predict()
function)
-- Fix for
as.mic()
to support more values ending in (several) zeroes
+- Updated examples for resistance prediction (
resistance_predict()
function)
+- Fix for
as.mic()
to support more values ending in (several) zeroes
- if using different lengths of pattern and x in
%like%
, it will now return the call
@@ -827,30 +830,30 @@ Using as.mo(..., allow_uncertain = 3)Fewer than 3 characters as input for as.mo
will return NA
-
Function as.mo
(and all mo_*
wrappers) now supports genus abbreviations with “species” attached
-
+
- Added parameter
combine_IR
(TRUE/FALSE) to functions portion_df
and count_df
, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)
- Fix for
portion_*(..., as_percent = TRUE)
when minimal number of isolates would not be met
-- Added parameter
also_single_tested
for portion_*
and count_*
functions to also include cases where not all antibiotics were tested but at least one of the tested antibiotics includes the target antimicribial interpretation, see ?portion
+ - Added parameter
also_single_tested
for portion_*
and count_*
functions to also include cases where not all antibiotics were tested but at least one of the tested antibiotics includes the target antimicribial interpretation, see ?portion
- Using
portion_*
functions now throws a warning when total available isolate is below parameter minimum
- Functions
as.mo
, as.rsi
, as.mic
, as.atc
and freq
will not set package name as attribute anymore
-- Frequency tables -
freq()
:
+ - Frequency tables -
freq()
:
-
Support for grouping variables, test with:
+ freq(gender)
Support for (un)selecting columns:
hms::is.hms
@@ -931,16 +934,16 @@ Using as.mo(..., allow_uncertain = 3)
They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:
-mo_gramstain("E. coli")
+mo_gramstain("E. coli")
# [1] "Gram negative"
-mo_gramstain("E. coli", language = "de") # German
+mo_gramstain("E. coli", language = "de") # German
# [1] "Gramnegativ"
-mo_gramstain("E. coli", language = "es") # Spanish
+mo_gramstain("E. coli", language = "es") # Spanish
# [1] "Gram negativo"
-mo_fullname("S. group A", language = "pt") # Portuguese
+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:
-mo_gramstain("Esc blattae")
+mo_gramstain("Esc blattae")
# Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010)
# [1] "Gram negative"
@@ -953,15 +956,15 @@ Using as.mo(..., allow_uncertain = 3)
Functions as.mo
and is.mo
as replacements for as.bactid
and is.bactid
(since the microoganisms
data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The as.mo
function determines microbial IDs using intelligent rules:
-as.mo("E. coli")
+as.mo("E. coli")
# [1] B_ESCHR_COL
-as.mo("MRSA")
+as.mo("MRSA")
# [1] B_STPHY_AUR
-as.mo("S group A")
+as.mo("S group A")
# [1] B_STRPTC_GRA
And with great speed too - on a quite regular Linux server from 2007 it takes us less than 0.02 seconds to transform 25,000 items:
thousands_of_E_colis <- rep("E. coli", 25000)
-microbenchmark::microbenchmark(as.mo(thousands_of_E_colis), unit = "s")
+microbenchmark::microbenchmark(as.mo(thousands_of_E_colis), unit = "s")
# Unit: seconds
# min median max neval
# 0.01817717 0.01843957 0.03878077 100
@@ -994,9 +997,9 @@ Using as.mo(..., allow_uncertain = 3)Added 163 trade names to the antibiotics
data set, it now contains 298 different trade names in total, e.g.:
ab_official("Bactroban")
# [1] "Mupirocin"
-ab_name(c("Bactroban", "Amoxil", "Zithromax", "Floxapen"))
+ab_name(c("Bactroban", "Amoxil", "Zithromax", "Floxapen"))
# [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin"
-ab_atc(c("Bactroban", "Amoxil", "Zithromax", "Floxapen"))
+ab_atc(c("Bactroban", "Amoxil", "Zithromax", "Floxapen"))
# [1] "R01AX06" "J01CA04" "J01FA10" "J01CF05"
For first_isolate
, rows will be ignored when there’s no species available
@@ -1008,13 +1011,13 @@ Using as.mo(..., allow_uncertain = 3)
Support for quasiquotation in the functions series count_*
and portions_*
, and n_rsi
. This allows to check for more than 2 vectors or columns.
-septic_patients %>% select(amox, cipr) %>% count_IR()
+septic_patients %>% select(amox, cipr) %>% count_IR()
# which is the same as:
-septic_patients %>% count_IR(amox, cipr)
+septic_patients %>% count_IR(amox, cipr)
-septic_patients %>% portion_S(amcl)
-septic_patients %>% portion_S(amcl, gent)
-septic_patients %>% portion_S(amcl, gent, pita)
+septic_patients %>% portion_S(amcl)
+septic_patients %>% portion_S(amcl, gent)
+septic_patients %>% portion_S(amcl, gent, pita)
Edited ggplot_rsi
and geom_rsi
so they can cope with count_df
. The new fun
parameter has value portion_df
at default, but can be set to count_df
.
Fix for ggplot_rsi
when the ggplot2
package was not loaded
@@ -1029,11 +1032,11 @@ Using as.mo(..., allow_uncertain = 3)
Support for types (classes) list and matrix for freq
+freq(my_matrix)
For lists, subsetting is possible:
my_list = list(age = septic_patients$age, gender = septic_patients$gender)
-my_list %>% freq(age)
-my_list %>% freq(gender)
+my_list %>% freq(age)
+my_list %>% freq(gender)
as.mo(..., allow_uncertain = 3)
septic_patients %>% select(tobr, gent) %>% ggplot_rsi
will show portions of S, I and R immediately in a pretty plot
-Support for grouped variables, see ?ggplot_rsi
+ Support for grouped variables, see ?ggplot_rsi
@@ -1107,13 +1110,13 @@ Using as.mo(..., allow_uncertain = 3)
A vignette to explain its usage
Support for rsi
(antimicrobial resistance) to use as input
-Support for table
to use as input: freq(table(x, y))
+ Support for table
to use as input: freq(table(x, y))
Support for existing functions hist
and plot
to use a frequency table as input: hist(freq(df$age))
Support for as.vector
, as.data.frame
, as_tibble
and format
-Support for quasiquotation: freq(mydata, mycolumn)
is the same as mydata %>% freq(mycolumn)
+ Support for quasiquotation: freq(mydata, mycolumn)
is the same as mydata %>% freq(mycolumn)
Function top_freq
function to return the top/below n items as vector
Header of frequency tables now also show Mean Absolute Deviaton (MAD) and Interquartile Range (IQR)
@@ -1145,14 +1148,14 @@ Using as.mo(..., allow_uncertain = 3)Combined MIC/RSI values will now be coerced by the rsi
and mic
functions:
-
-
as.rsi("<=0.002; S")
will return S
+as.rsi("<=0.002; S")
will return S
-
-
as.mic("<=0.002; S")
will return <=0.002
+as.mic("<=0.002; S")
will return <=0.002
-Now possible to coerce MIC values with a space between operator and value, i.e. as.mic("<= 0.002")
now works
+Now possible to coerce MIC values with a space between operator and value, i.e. as.mic("<= 0.002")
now works
Classes rsi
and mic
do not add the attribute package.version
anymore
Added "groups"
option for atc_property(..., property)
. It will return a vector of the ATC hierarchy as defined by the WHO. The new function atc_groups
is a convenient wrapper around this.
Build-in host check for atc_property
as it requires the host set by url
to be responsive
@@ -1203,7 +1206,7 @@ Using as.mo(..., allow_uncertain = 3)Functions BRMO
and MRGN
are wrappers for Dutch and German guidelines, respectively
-New algorithm to determine weighted isolates, can now be "points"
or "keyantibiotics"
, see ?first_isolate
+ New algorithm to determine weighted isolates, can now be "points"
or "keyantibiotics"
, see ?first_isolate
New print format for tibble
s and data.table
s
@@ -1267,7 +1270,7 @@ Using as.mo(..., allow_uncertain = 3)
Contents
parameters passed on to filter_at
parameters passed on to filter_at
from the dplyr
package
The group
column in antibiotics
data set will be searched for ab_class
(case-insensitive). If no results are found, the atc_group1
and atc_group2
columns will be searched. Next, x
will be checked for column names with a value in any abbreviations, codes or official names found in the antibiotics
data set.
The group
column in antibiotics
data set will be searched for ab_class
(case-insensitive). If no results are found, the atc_group1
and atc_group2
columns will be searched. Next, x
will be checked for column names with a value in any abbreviations, codes or official names found in the antibiotics
data set.
A data.frame
with 4,927 observations and 2 variables:
A data.frame
with 5,006 observations and 2 variables:
code
Commonly used code of a microorganism
mo
ID of the microorganism in the microorganisms
data set
A data.frame
with 69,454 observations and 16 variables:
A data.frame
with 69,465 observations and 16 variables:
mo
ID of microorganism as used by this package
col_id
Catalogue of Life ID
fullname
Full name, like "Escherichia coli"
11 entries of Streptococcus (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)
2 entries of Staphylococcus (coagulase-negative [CoNS] and coagulase-positive [CoPS])
3 entries of Trichomonas (Trichomonas vaginalis, and its family and genus)
1 entry of Blastocystis (Blastocystis hominis), although it officially does not exist (Noel et al. 2005, PMID 15634993)
5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)
9,460 species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications