mirror of
https://github.com/msberends/AMR.git
synced 2026-04-28 13:43:56 +02:00
(v3.0.1.9047) fix #272
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 3.0.1.9045
|
Version: 3.0.1.9047
|
||||||
Date: 2026-04-21
|
Date: 2026-04-21
|
||||||
Title: Antimicrobial Resistance Data Analysis
|
Title: Antimicrobial Resistance Data Analysis
|
||||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||||
|
|||||||
3
NEWS.md
3
NEWS.md
@@ -1,4 +1,4 @@
|
|||||||
# AMR 3.0.1.9045
|
# AMR 3.0.1.9047
|
||||||
|
|
||||||
### New
|
### New
|
||||||
* Support for clinical breakpoints of 2026 of both CLSI and EUCAST, by adding all of their over 5,700 new clinical breakpoints to the `clinical_breakpoints` data set for usage in `as.sir()`. EUCAST 2026 is now the new default guideline for all MIC and disk diffusion interpretations.
|
* Support for clinical breakpoints of 2026 of both CLSI and EUCAST, by adding all of their over 5,700 new clinical breakpoints to the `clinical_breakpoints` data set for usage in `as.sir()`. EUCAST 2026 is now the new default guideline for all MIC and disk diffusion interpretations.
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
* Fixed a bug to disregard `NI` for susceptibility proportion functions
|
* Fixed a bug to disregard `NI` for susceptibility proportion functions
|
||||||
* Fixed Italian translation of CoNS to Stafilococco coagulasi-negativo and CoPS to Stafilococco coagulasi-positivo (#256)
|
* Fixed Italian translation of CoNS to Stafilococco coagulasi-negativo and CoPS to Stafilococco coagulasi-positivo (#256)
|
||||||
* Fixed SIR and MIC coercion of combined values, e.g. `as.sir("<= 0.002; S") ` or `as.mic("S; 0.002")` (#252)
|
* Fixed SIR and MIC coercion of combined values, e.g. `as.sir("<= 0.002; S") ` or `as.mic("S; 0.002")` (#252)
|
||||||
|
* Fixed translation of foreign languages in `sir_df()` (#272)
|
||||||
|
|
||||||
### Updates
|
### Updates
|
||||||
* Extensive `cli` integration for better message handling and clickable links in messages and warnings (#191, #265)
|
* Extensive `cli` integration for better message handling and clickable links in messages and warnings (#191, #265)
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ ab_property <- function(x, property = "name", language = get_AMR_locale(), ...)
|
|||||||
meet_criteria(x, allow_NA = TRUE)
|
meet_criteria(x, allow_NA = TRUE)
|
||||||
meet_criteria(property, is_in = colnames(AMR::antimicrobials), has_length = 1)
|
meet_criteria(property, is_in = colnames(AMR::antimicrobials), has_length = 1)
|
||||||
language <- validate_language(language)
|
language <- validate_language(language)
|
||||||
translate_into_language(ab_validate(x = x, property = property, ...), language = language)
|
translate_into_language(ab_validate(x = x, property = property, ...), language = language, only_affect_ab_names = TRUE)
|
||||||
}
|
}
|
||||||
|
|
||||||
#' @rdname ab_property
|
#' @rdname ab_property
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ These steps integrate with \code{recipes::recipe()} and work like standard prepr
|
|||||||
}
|
}
|
||||||
\examples{
|
\examples{
|
||||||
if (require("tidymodels")) {
|
if (require("tidymodels")) {
|
||||||
|
|
||||||
# The below approach formed the basis for this paper: DOI 10.3389/fmicb.2025.1582703
|
# The below approach formed the basis for this paper: DOI 10.3389/fmicb.2025.1582703
|
||||||
# Presence of ESBL genes was predicted based on raw MIC values.
|
# Presence of ESBL genes was predicted based on raw MIC values.
|
||||||
|
|
||||||
@@ -92,13 +91,10 @@ if (require("tidymodels")) {
|
|||||||
|
|
||||||
# Create and prep a recipe with MIC log2 transformation
|
# Create and prep a recipe with MIC log2 transformation
|
||||||
mic_recipe <- recipe(esbl ~ ., data = training_data) \%>\%
|
mic_recipe <- recipe(esbl ~ ., data = training_data) \%>\%
|
||||||
|
|
||||||
# Optionally remove non-predictive variables
|
# Optionally remove non-predictive variables
|
||||||
remove_role(genus, old_role = "predictor") \%>\%
|
remove_role(genus, old_role = "predictor") \%>\%
|
||||||
|
|
||||||
# Apply the log2 transformation to all MIC predictors
|
# Apply the log2 transformation to all MIC predictors
|
||||||
step_mic_log2(all_mic_predictors()) \%>\%
|
step_mic_log2(all_mic_predictors()) \%>\%
|
||||||
|
|
||||||
# And apply the preparation steps
|
# And apply the preparation steps
|
||||||
prep()
|
prep()
|
||||||
|
|
||||||
@@ -119,13 +115,15 @@ if (require("tidymodels")) {
|
|||||||
bind_cols(out_testing)
|
bind_cols(out_testing)
|
||||||
|
|
||||||
# Evaluate predictions using standard classification metrics
|
# Evaluate predictions using standard classification metrics
|
||||||
our_metrics <- metric_set(accuracy,
|
our_metrics <- metric_set(
|
||||||
|
accuracy,
|
||||||
recall,
|
recall,
|
||||||
precision,
|
precision,
|
||||||
sensitivity,
|
sensitivity,
|
||||||
specificity,
|
specificity,
|
||||||
ppv,
|
ppv,
|
||||||
npv)
|
npv
|
||||||
|
)
|
||||||
metrics <- our_metrics(predictions, truth = esbl, estimate = .pred_class)
|
metrics <- our_metrics(predictions, truth = esbl, estimate = .pred_class)
|
||||||
|
|
||||||
# Show performance
|
# Show performance
|
||||||
|
|||||||
Reference in New Issue
Block a user