diff --git a/DESCRIPTION b/DESCRIPTION index c830c822..bc1c573c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.4.0.9061 +Version: 1.4.0.9062 Date: 2021-01-04 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index ed9fe9a9..e6862e4a 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 1.4.0.9061 +# AMR 1.4.0.9062 ## Last updated: 4 January 2021 ### New * Functions `get_episode()` and `is_new_episode()` to determine (patient) episodes which are not necessarily based on microorganisms. The `get_episode()` function returns the index number of the episode per group, while the `is_new_episode()` function returns values `TRUE`/`FALSE` to indicate whether an item in a vector is the start of a new episode. They also support `dplyr`s grouping (i.e. using `group_by()`): diff --git a/data-raw/AMR_1.4.0.9061.tar.gz b/data-raw/AMR_1.4.0.9062.tar.gz similarity index 83% rename from data-raw/AMR_1.4.0.9061.tar.gz rename to data-raw/AMR_1.4.0.9062.tar.gz index 80d69692..81e8a275 100644 Binary files a/data-raw/AMR_1.4.0.9061.tar.gz and b/data-raw/AMR_1.4.0.9062.tar.gz differ diff --git a/docs/404.html b/docs/404.html index 80acc5ce..5c610abb 100644 --- a/docs/404.html +++ b/docs/404.html @@ -81,7 +81,7 @@ library(dplyr) example_isolates %>% - mutate(mo = mo_fullname(mo)) %>% - filter(mo_is_gram_negative(), mo_is_intrinsic_resistant(ab = "cefotax")) %>% - select(mo, aminoglycosides(), carbapenems()) + mutate(mo = mo_fullname(mo)) %>% + filter(mo_is_gram_negative(), mo_is_intrinsic_resistant(ab = "cefotax")) %>% + select(mo, aminoglycosides(), carbapenems()) #> NOTE: Using column 'mo' as input for mo_is_gram_negative() #> NOTE: Using column 'mo' as input for mo_is_intrinsic_resistant() #> NOTE: Determining intrinsic resistance based on 'EUCAST Expert Rules' and @@ -359,7 +359,7 @@ Since you are one of our users, we would like to know how you use the package an
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index f27fe245..2afb34b2 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -81,7 +81,7 @@ diff --git a/docs/articles/index.html b/docs/articles/index.html index 52e593b0..4c6f7946 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -81,7 +81,7 @@ diff --git a/docs/authors.html b/docs/authors.html index 0673f3fb..7b6ce0a8 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -81,7 +81,7 @@ diff --git a/docs/index.html b/docs/index.html index 883c4418..90126aab 100644 --- a/docs/index.html +++ b/docs/index.html @@ -43,7 +43,7 @@ @@ -222,9 +222,9 @@ Since you are one of our users, we would like to know how you use the package anThe latest and unpublished development version can be installed from GitHub using:
install.packages("remotes")
-remotes::install_github("msberends/AMR")
It analyses the data with convenient functions that use well-known methods.
susceptibility()
and resistance()
functions, or be even more specific with the proportion_R()
, proportion_IR()
, proportion_I()
, proportion_SI()
and proportion_S()
functions. Similarly, the number of isolates can be determined with the count_resistant()
, count_susceptible()
and count_all()
functions. All these functions can be used with the dplyr
package (e.g. in conjunction with summarise()
)susceptibility()
and resistance()
functions, or be even more specific with the proportion_R()
, proportion_IR()
, proportion_I()
, proportion_SI()
and proportion_S()
functions. Similarly, the number of isolates can be determined with the count_resistant()
, count_susceptible()
and count_all()
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()
functionNEWS.md
- Functions get_episode()
and is_new_episode()
to determine (patient) episodes which are not necessarily based on microorganisms. The get_episode()
function returns the index number of the episode per group, while the is_new_episode()
function returns values TRUE
/FALSE
to indicate whether an item in a vector is the start of a new episode. They also support dplyr
s grouping (i.e. using group_by()
):
Functions get_episode()
and is_new_episode()
to determine (patient) episodes which are not necessarily based on microorganisms. The get_episode()
function returns the index number of the episode per group, while the is_new_episode()
function returns values TRUE
/FALSE
to indicate whether an item in a vector is the start of a new episode. They also support dplyr
s grouping (i.e. using group_by()
):
library(dplyr)
example_isolates %>%
- group_by(patient_id, hospital_id) %>%
- filter(is_new_episode(date, episode_days = 60))
Functions mo_is_gram_negative()
and mo_is_gram_positive()
as wrappers around mo_gramstain()
. They always return TRUE
or FALSE
(except when the input is NA
or the MO code is UNKNOWN
), thus always return FALSE
for species outside the taxonomic kingdom of Bacteria.
Function mo_is_intrinsic_resistant()
to test for intrinsic resistance, based on EUCAST Intrinsic Resistance and Unusual Phenotypes v3.2 from 2020.
Some functions are now context-aware when used inside dplyr
verbs, such as filter()
, mutate()
and summarise()
. This means that then the data argument does not need to be set anymore. This is the case for the new functions:
Some functions are now context-aware when used inside dplyr
verbs, such as filter()
, mutate()
and summarise()
. This means that then the data argument does not need to be set anymore. This is the case for the new functions:
mo_is_gram_negative()
mo_is_gram_positive()
Support for veterinary ATC codes
Improvements for as.rsi()
:
Support for using dplyr
’s across()
to interpret MIC values or disk zone diameters, which also automatically determines the column with microorganism names or codes.
Support for using dplyr
’s across()
to interpret MIC values or disk zone diameters, which also automatically determines the column with microorganism names or codes.
# until dplyr 1.0.0
-your_data %>% mutate_if(is.mic, as.rsi)
-your_data %>% mutate_if(is.disk, as.rsi)
+your_data %>% mutate_if(is.mic, as.rsi)
+your_data %>% mutate_if(is.disk, as.rsi)
# since dplyr 1.0.0
-your_data %>% mutate(across(where(is.mic), as.rsi))
-your_data %>% mutate(across(where(is.disk), as.rsi))
Cleaning columns in a data.frame now allows you to specify those columns with tidy selection, e.g. as.rsi(df, col1:col9)
Big speed improvement for interpreting MIC values and disk zone diameters. When interpreting 5,000 MIC values of two antibiotics (10,000 values in total), our benchmarks showed a total run time going from 80.7-85.1 seconds to 1.8-2.0 seconds.
Function ab_from_text()
to retrieve antimicrobial drug names, doses and forms of administration from clinical texts in e.g. health care records, which also corrects for misspelling since it uses as.ab()
internally
Tidyverse selection helpers for antibiotic classes, that help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations. They can be used in any function that allows selection helpers, like dplyr::select()
and tidyr::pivot_longer()
:
Tidyverse selection helpers for antibiotic classes, that help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations. They can be used in any function that allows selection helpers, like dplyr::select()
and tidyr::pivot_longer()
:
library(dplyr)
# Columns 'IPM' and 'MEM' are in the example_isolates data set
example_isolates %>%
- select(carbapenems())
+ select(carbapenems())
#> Selecting carbapenems: `IPM` (imipenem), `MEM` (meropenem)
Added mo_domain()
as an alias to mo_kingdom()
Fixed important floating point error for some MIC comparisons in EUCAST 2020 guideline
Interpretation from MIC values (and disk zones) to R/SI can now be used with mutate_at()
of the dplyr
package:
Interpretation from MIC values (and disk zones) to R/SI can now be used with mutate_at()
of the dplyr
package:
yourdata %>%
- mutate_at(vars(antibiotic1:antibiotic25), as.rsi, mo = "E. coli")
+ mutate_at(vars(antibiotic1:antibiotic25), as.rsi, mo = "E. coli")
yourdata %>%
- mutate_at(vars(antibiotic1:antibiotic25), as.rsi, mo = .$mybacteria)
Added antibiotic abbreviations for a laboratory manufacturer (GLIMS) for cefuroxime, cefotaxime, ceftazidime, cefepime, cefoxitin and trimethoprim/sulfamethoxazole
Added uti
(as abbreviation of urinary tract infections) as argument to as.rsi()
, so interpretation of MIC values and disk zones can be made dependent on isolates specifically from UTIs
library(dplyr)
example_isolates %>%
- group_by(bug = mo_name(mo)) %>%
- summarise(amoxicillin = resistance(AMX),
+ group_by(bug = mo_name(mo)) %>%
+ summarise(amoxicillin = resistance(AMX),
amox_clav = resistance(AMC)) %>%
- filter(!is.na(amoxicillin) | !is.na(amox_clav))
+ filter(!is.na(amoxicillin) | !is.na(amox_clav))
Support for a new MDRO guideline: Magiorakos AP, Srinivasan A et al. “Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance.” Clinical Microbiology and Infection (2012).
@@ -958,7 +958,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/ # (run this on your own console, as this page does not support colour printing) library(dplyr) example_isolates %>% - select(mo:AMC) %>% + select(mo:AMC) %>% as_tibble()
septic_patients %>%
- select(AMX, CIP) %>%
+ select(AMX, CIP) %>%
rsi_df()
# antibiotic interpretation value isolates
# 1 Amoxicillin SI 0.4442636 546
@@ -1175,7 +1175,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
boxplot()
# grouped boxplots:
septic_patients %>%
- group_by(hospital_id) %>%
+ group_by(hospital_id) %>%
freq(age) %>%
boxplot()
septic_patients %>%
- mutate(only_firsts = first_isolate(septic_patients, ...)) %>%
- filter(only_firsts == TRUE) %>%
- select(-only_firsts)
New function availability()
to check the number of available (non-empty) results in a data.frame
New 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.
Header info is now available as a list, with the header
function
Fix for header text where all observations are NA
New argument droplevels
to exclude empty factor levels when input is a factor
Factor levels will be in header when present in input data (maximum of 5)
Fix for using select()
on frequency tables
Fix for using select()
on frequency tables
scale_y_percent()
now contains the limits
argument
septic_patients %>%
freq(hospital_id) %>%
- select(-count, -cum_count) # only get item, percent, cum_percent
+ select(-count, -cum_count) # only get item, percent, cum_percent
Check for hms::is.hms
Now prints in markdown at default in non-interactive sessions
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)
@@ -1894,7 +1894,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
- Full support for Windows, Linux and macOS
- Full support for old R versions, only R-3.0.0 (April 2013) or later is needed (needed packages may have other dependencies)
-- Function
n_rsi
to count cases where antibiotic test results were available, to be used in conjunction with dplyr::summarise
, see ?rsi
+- Function
n_rsi
to count cases where antibiotic test results were available, to be used in conjunction with dplyr::summarise
, see ?rsi
- Function
guess_bactid
to determine the ID of a microorganism based on genus/species or known abbreviations like MRSA
- Function
guess_atc
to determine the ATC of an antibiotic based on name, trade name, or known abbreviations
- Function
freq
to create frequency tables, with additional info in a header
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 872b5c60..c801664b 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -12,7 +12,7 @@ articles:
datasets: datasets.html
resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html
-last_built: 2021-01-04T13:15Z
+last_built: 2021-01-04T13:44Z
urls:
reference: https://msberends.github.io/AMR//reference
article: https://msberends.github.io/AMR//articles
diff --git a/docs/reference/index.html b/docs/reference/index.html
index 2ee69cb8..64e7089b 100644
--- a/docs/reference/index.html
+++ b/docs/reference/index.html
@@ -81,7 +81,7 @@