From 72f2e723fb6fbd14564d6c268faa0748a33d927a Mon Sep 17 00:00:00 2001 From: Matthijs Berends Date: Fri, 14 Mar 2025 17:01:50 +0100 Subject: [PATCH] (v2.1.1.9200) new argument `capped_mic_handling`, add Search to website --- .github/workflows/website.yaml | 1 - DESCRIPTION | 2 +- NEWS.md | 4 +- PythonPackage/AMR/AMR.egg-info/PKG-INFO | 2 +- PythonPackage/AMR/dist/amr-2.1.1.9199.tar.gz | Bin 10101 -> 0 bytes ...ny.whl => amr-2.1.1.9200-py3-none-any.whl} | Bin 10280 -> 10280 bytes PythonPackage/AMR/dist/amr-2.1.1.9200.tar.gz | Bin 0 -> 10104 bytes PythonPackage/AMR/setup.py | 2 +- R/aa_options.R | 1 + R/ab.R | 8 +- R/sir.R | 71 +++++++---- R/zz_deprecated.R | 1 + _pkgdown.yml | 118 +++++++++--------- ....txt => gpt_training_text_v2.1.1.9200.txt} | 25 +++- man/AMR-options.Rd | 1 + man/as.sir.Rd | 22 +++- pkgdown/extra.css | 8 +- 17 files changed, 161 insertions(+), 105 deletions(-) delete mode 100644 PythonPackage/AMR/dist/amr-2.1.1.9199.tar.gz rename PythonPackage/AMR/dist/{amr-2.1.1.9199-py3-none-any.whl => amr-2.1.1.9200-py3-none-any.whl} (86%) create mode 100644 PythonPackage/AMR/dist/amr-2.1.1.9200.tar.gz rename data-raw/{gpt_training_text_v2.1.1.9199.txt => gpt_training_text_v2.1.1.9200.txt} (99%) diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index 0169301cf..dff226cf3 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -40,7 +40,6 @@ name: Update website jobs: update-website: runs-on: ubuntu-latest - continue-on-error: true steps: - uses: actions/checkout@v4 diff --git a/DESCRIPTION b/DESCRIPTION index 48985de19..1c16a0e99 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 2.1.1.9199 +Version: 2.1.1.9200 Date: 2025-03-14 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index 9dca0b846..ec2cae4e4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.1.1.9199 +# AMR 2.1.1.9200 *(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://msberends.github.io/AMR/#latest-development-version).)* @@ -46,7 +46,7 @@ This package now supports not only tools for AMR data analysis in clinical setti * It is now possible to use column names for argument `ab`, `mo`, and `uti`: `as.sir(..., ab = "column1", mo = "column2", uti = "column3")`. This greatly improves the flexibility for users. * Users can now set their own criteria (using regular expressions) as to what should be considered S, I, R, SDD, and NI. * To get quantitative values, `as.double()` on a `sir` object will return 1 for S, 2 for SDD/I, and 3 for R (NI will become `NA`). Other functions using `sir` classes (e.g., `summary()`) are updated to reflect the change to contain NI and SDD. - * Fix for `conserve_capped_values`, which now again works as expected: in MIC values, `x` will always be R + * The argument `conserve_capped_values` in `as.sir()` has been replaced with `capped_mic_handling`, which allows greater flexibility in handling capped MIC values (`<`, `<=`, `>`, `>=`). The four available options (`"standard"`, `"strict"`, `"relaxed"`, `"inverse"`) provide full control over whether these values should be interpreted conservatively or ignored. Using `conserve_capped_values` is now deprecated and returns a warning. * `antibiogram()` function * Argument `antibiotics` has been renamed to `antimicrobials`. Using `antibiotics` will still work, but now returns a warning. * Added argument `formatting_type` to set any of the 22 options for the formatting of all 'cells'. This defaults to `18` for non-WISCA and `14` for WISCA, changing the output of antibiograms to cells with more info. diff --git a/PythonPackage/AMR/AMR.egg-info/PKG-INFO b/PythonPackage/AMR/AMR.egg-info/PKG-INFO index 4087ca95d..73e2fa51e 100644 --- a/PythonPackage/AMR/AMR.egg-info/PKG-INFO +++ b/PythonPackage/AMR/AMR.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.2 Name: AMR -Version: 2.1.1.9199 +Version: 2.1.1.9200 Summary: A Python wrapper for the AMR R package Home-page: https://github.com/msberends/AMR Author: Matthijs Berends diff --git a/PythonPackage/AMR/dist/amr-2.1.1.9199.tar.gz b/PythonPackage/AMR/dist/amr-2.1.1.9199.tar.gz deleted file mode 100644 index 75218755123f00f404802d9d410ea16568af1191..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10101 zcmch6RZtwjwk_@w+}&M+!{F}j?yf-s3?3|a@C3KuZo%ClxV!7%I&*XGy&v!E{k>P+ zt9tEKt9EtO{^;7fDdLcjif9+?U?3JQo^0IgT>q9Jm!KfKw}mIvWzd`FdRvMwcuDKV zubWMY$!KY@!Q@`Octw zC_UVW!Ea|2K{?Ai(v4EK^LJqD1ppZZ=5X1j2c&qJB(I6Q;=Hma`jP^pBk1|K2^bJ? zKlBQ*7D<4Rj{v`hH;b8_K*B+UuaIY|w;nR(3NtoKg&o$>WF#|B2@zDb2W=Zbj(K@o$`uSc6_4gHOW6j6h z49fC$$yO1QJ`FHs9Tv&r=@ja5#0BR{@|<#*r!I^I9?>c`jG0UWb)Lp{HWTJiVrU)u zG4b|SoyiPi3Q<{?s}p4-K=I|F}hQIcoEAvT1|nsmPryGKa~8PZy7+z&>u^>rD@PEggh1Z&=Fy zo1`x;b73MMa_A1t+yMox$Qmc{&IGMmUOZRPN|{d5i-}w*!`wv?A*_i(>LoW`(8F@b zXnY|r$X=FfkbK?=iOsKITV~Qjs9`66kjxtH9racMyI22c4qp=|XQX7zDi)9Pzf%3Y z4%bmZSK>}q6O26sqjb{QILdICZw1ao-b+DpLcHpN|J!y*)(6YAR%xVwwfOz0kto!a zfr$nwD2cUI6#MrlRx~bM0Sd-iwD?b%KO@ikwlxb!%O*F*%2$GiB4Ci1?QrScheG7I zBmHsWr8`J2WGB)~6!)Uc-6b#dCTD|)dwI;a6ywmnx!JBcQj`hB3cQJ7G9;jg8i>>X z?Gy$Td}F0wKWql(IRzBS(+^;*IBSc!u}A-Qd8lOvt)+%~*{p1M3PW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)lp z1X~LCRY5#a%|&4Q7|}KQ&qaRpzrNEwShm}yGI55nCE)!R>wIBQa5}=Q_kw;YyHACZ b$(d$G$3n^fjlLq(K;R=t+2f&hprQT?2{ti* diff --git a/PythonPackage/AMR/dist/amr-2.1.1.9199-py3-none-any.whl b/PythonPackage/AMR/dist/amr-2.1.1.9200-py3-none-any.whl similarity index 86% rename from PythonPackage/AMR/dist/amr-2.1.1.9199-py3-none-any.whl rename to PythonPackage/AMR/dist/amr-2.1.1.9200-py3-none-any.whl index e14381586d482511f360a640cf1fa6183c2bfe1f..63fc07bff75b97017d2f7f18f935ac5595f05b42 100644 GIT binary patch delta 678 zcmZ1xup)pbz?+#xgn@y9gCVG4BToY>Q&7X^K2|Xn5WS4^Ew@rgLtd2Tbiv9SybKHp z>I@8uK*foS6(6HB8-W)g>m^s0h@9EIRXiPE9-`&^1g94DuLC^-?m6OLQ~y((?6#T%G-cTuRRz z%-dwZ!0=%A`JkBFjuQ{_tx#~3Y-+mVeRv7a700bd8T|k2*C%c2{`qdc?2-JQtG;U` zW_K~3&^pfcGvdyX%+ChQpB7teId*9A?ZWzdm32pAe?NOIR6hUByDwXEm=k8bFG%`t z=en-w3co|KD{&DclWA07S{9lX59*G;GFfh{?t0l zmAi8PxryD1*WIu5Y4zoR`8Mlj#R>msto3s827Rk=!kRSk~|N6TNMTb83|fGgn{Lx_P#t zHE#JT(Kn~$|5%0Yt$Oxs7K{0`jTf{x74$GAH>mi2QnJ2$`h@aHgR-Y=qH4;2IbW=Q ze0-3C%W(`ajlQSXIGBq0xSn`Q%CCNK2|Xn5WS4^Ew@rvYF?D+Td@x}co`TH z)EO8Qfr=Azi*$|j41v(n(9&}9R?$kPHs{R-VpY6MU8$4TD9bW~gwH6KfpyDkd=p{= z>S6(6HB8-W)g>m^s0h@9EOO{Sw>6#-=o%&l26+sndMTO3CAyh;Y5Dp=uFn2JE~RID zC(klqV7Rb*zv>Q^qYCYE0)eO6H9ENCjIOjaX*de$e0aV4vSj+VM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`L7VszQUB(fam0wEC1!wt4foNaQN#(&E$qV|X;$2;v63fYQ9MI%P9wVy^(dsX&E!rVec?nd%sO!0f`p{14^f=r;fW literal 0 HcmV?d00001 diff --git a/PythonPackage/AMR/setup.py b/PythonPackage/AMR/setup.py index d7e863aaf..95a66acb0 100644 --- a/PythonPackage/AMR/setup.py +++ b/PythonPackage/AMR/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='AMR', - version='2.1.1.9199', + version='2.1.1.9200', packages=find_packages(), install_requires=[ 'rpy2', diff --git a/R/aa_options.R b/R/aa_options.R index 1e6443fd1..1713ae2f9 100755 --- a/R/aa_options.R +++ b/R/aa_options.R @@ -33,6 +33,7 @@ #' @section Options: #' * `AMR_antibiogram_formatting_type` \cr A [numeric] (1-22) to use in [antibiogram()], to indicate which formatting type to use. #' * `AMR_breakpoint_type` \cr A [character] to use in [as.sir()], to indicate which breakpoint type to use. This must be either `r vector_or(clinical_breakpoints$type)`. +#' * `AMR_capped_mic_handling` \cr A [character] to use in [as.sir()], to indicate how capped MIC values (`<`, `<=`, `>`, `>=`) should be interpreted. Must be one of `"standard"`, `"strict"`, `"relaxed"`, or `"inverse"` - the default is `"standard"`. #' * `AMR_cleaning_regex` \cr A [regular expression][base::regex] (case-insensitive) to use in [as.mo()] and all [`mo_*`][mo_property()] functions, to clean the user input. The default is the outcome of [mo_cleaning_regex()], which removes texts between brackets and texts such as "species" and "serovar". #' * `AMR_custom_ab` \cr A file location to an RDS file, to use custom antimicrobial drugs with this package. This is explained in [add_custom_antimicrobials()]. #' * `AMR_custom_mo` \cr A file location to an RDS file, to use custom microorganisms with this package. This is explained in [add_custom_microorganisms()]. diff --git a/R/ab.R b/R/ab.R index d4454be6a..20b1c3cfa 100755 --- a/R/ab.R +++ b/R/ab.R @@ -172,11 +172,11 @@ as.ab <- function(x, flag_multiple_results = TRUE, language = get_AMR_locale(), x_new[known_codes_cid] <- AMR_env$AB_lookup$ab[match(x[known_codes_cid], AMR_env$AB_lookup$cid)] previously_coerced <- x %in% AMR_env$ab_previously_coerced$x x_new[previously_coerced & is.na(x_new)] <- AMR_env$ab_previously_coerced$ab[match(x[is.na(x_new) & x %in% AMR_env$ab_previously_coerced$x], AMR_env$ab_previously_coerced$x)] - prev <- x_bak[which(x[which(previously_coerced)] %in% x_bak_clean)] - if (any(previously_coerced) && isTRUE(info) && message_not_thrown_before("as.ab", prev, entire_session = TRUE)) { + if (any(previously_coerced) && isTRUE(info) && message_not_thrown_before("as.ab", entire_session = TRUE)) { message_( - "Returning previously coerced value", ifelse(length(unique(prev)) > 1, "s", ""), - " for ", vector_and(prev), ". Run `ab_reset_session()` to reset this. This note will be shown once per session for this input." + "Returning previously coerced ", + ifelse(length(unique(which(x[which(previously_coerced)] %in% x_bak_clean))) > 1, "value for an antimicrobial", "values for various antimicrobials"), + ". Run `ab_reset_session()` to reset this. This note will be shown once per session." ) } diff --git a/R/sir.R b/R/sir.R index a8fb93cc0..2c21d253f 100755 --- a/R/sir.R +++ b/R/sir.R @@ -44,7 +44,17 @@ #' @param uti (Urinary Tract Infection) a vector (or column name) with [logical]s (`TRUE` or `FALSE`) to specify whether a UTI specific interpretation from the guideline should be chosen. For using [as.sir()] on a [data.frame], this can also be a column containing [logical]s or when left blank, the data set will be searched for a column 'specimen', and rows within this column containing 'urin' (such as 'urine', 'urina') will be regarded isolates from a UTI. See *Examples*. #' @inheritParams first_isolate #' @param guideline defaults to `r AMR::clinical_breakpoints$guideline[1]` (the latest implemented EUCAST guideline in the [AMR::clinical_breakpoints] data set), but can be set with the package option [`AMR_guideline`][AMR-options]. Currently supports EUCAST (`r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "EUCAST")$guideline)))`) and CLSI (`r min(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "CLSI")$guideline)))`-`r max(as.integer(gsub("[^0-9]", "", subset(AMR::clinical_breakpoints, guideline %like% "CLSI")$guideline)))`), see *Details*. -#' @param conserve_capped_values a [logical] to indicate that MIC values starting with `">"` (but not `">="`) must always return "R" , and that MIC values starting with `"<"` (but not `"<="`) must always return "S" +#' @param capped_mic_handling A [character] string that controls how MIC values with a cap (i.e., starting with `<`, `<=`, `>`, or `>=`) are interpreted. Supports the following options: +#' - `"standard"` (default)\cr +#' `<=` and `>=` return `"NI"` if the value is **within** the breakpoint guideline range, while `<` and `>` are interpreted normally. +#' - `"strict"`\cr +#' Enforces conservative handling; `<` always returns `"S"`, `>` always returns `"R"`, and `<=`/`>=` return `"NI"` when within breakpoint guideline range. +#' - `"relaxed"`\cr +#' Ignores all signs, treating values as their numeric equivalents (e.g., `>0.5` is regarded `0.5`). +#' - `"inverse"`\cr +#' Opposite of `"standard"`; `<` always returns `"S"`, `>` always returns `"R"`, and `<=`/`>=` are treated as their numeric equivalents +#' +#' The default `"standard"` setting ensures cautious handling of uncertain values while preserving interpretability. This option can also be set with the package option [`AMR_capped_mic_handling`][AMR-options]. #' @param add_intrinsic_resistance *(only useful when using a EUCAST guideline)* a [logical] to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in *Klebsiella* species. Determination is based on the [intrinsic_resistant] data set, that itself is based on `r format_eucast_version_nr(3.3)`. #' @param substitute_missing_r_breakpoint a [logical] to indicate that a missing clinical breakpoints for R (resistant) must be substituted with R - the default is `FALSE`. Some (especially CLSI) breakpoints only have a breakpoint for S, meaning the outcome can only be `"S"` or `NA`. Setting this to `TRUE` will convert the `NA`s to `"R"` only if the R breakpoint is missing. Can also be set with the package option [`AMR_substitute_missing_r_breakpoint`][AMR-options]. #' @param include_screening a [logical] to indicate that clinical breakpoints for screening are allowed - the default is `FALSE`. Can also be set with the package option [`AMR_include_screening`][AMR-options]. @@ -75,7 +85,7 @@ #' # for veterinary breakpoints, also set `host`: #' your_data %>% mutate_if(is.mic, as.sir, host = "column_with_animal_species", guideline = "CLSI") #' ``` -#' * Operators like "<=" will be stripped before interpretation. When using `conserve_capped_values = TRUE`, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (`conserve_capped_values = FALSE`) considers ">2" to be lower than ">=4" and might in this case return "S" or "I". +#' * Operators like "<=" will be stripped before interpretation. When using `capped_mic_handling = "strict"`, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (`capped_mic_handling = "standard"`) considers ">2" to be lower than ">=4" and might in this case return "S" or "I". #' 3. For **interpreting disk diffusion diameters** according to EUCAST or CLSI. You must clean your disk zones first using [as.disk()], that also gives your columns the new data class [`disk`]. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the `mo` argument. #' * Using `dplyr`, SIR interpretation can be done very easily with either: #' ```r @@ -561,7 +571,7 @@ as.sir.mic <- function(x, ab = deparse(substitute(x)), guideline = getOption("AMR_guideline", "EUCAST"), uti = NULL, - conserve_capped_values = FALSE, + capped_mic_handling = getOption("AMR_capped_mic_handling", "standard"), add_intrinsic_resistance = FALSE, reference_data = AMR::clinical_breakpoints, substitute_missing_r_breakpoint = getOption("AMR_substitute_missing_r_breakpoint", FALSE), @@ -579,7 +589,7 @@ as.sir.mic <- function(x, ab = ab, guideline = guideline, uti = uti, - conserve_capped_values = conserve_capped_values, + capped_mic_handling = capped_mic_handling, add_intrinsic_resistance = add_intrinsic_resistance, reference_data = reference_data, substitute_missing_r_breakpoint = substitute_missing_r_breakpoint, @@ -616,7 +626,7 @@ as.sir.disk <- function(x, ab = ab, guideline = guideline, uti = uti, - conserve_capped_values = FALSE, + capped_mic_handling = FALSE, # there are no MICs here add_intrinsic_resistance = add_intrinsic_resistance, reference_data = reference_data, substitute_missing_r_breakpoint = substitute_missing_r_breakpoint, @@ -636,7 +646,7 @@ as.sir.data.frame <- function(x, col_mo = NULL, guideline = getOption("AMR_guideline", "EUCAST"), uti = NULL, - conserve_capped_values = FALSE, + capped_mic_handling = getOption("AMR_capped_mic_handling", "standard"), add_intrinsic_resistance = FALSE, reference_data = AMR::clinical_breakpoints, substitute_missing_r_breakpoint = getOption("AMR_substitute_missing_r_breakpoint", FALSE), @@ -645,11 +655,15 @@ as.sir.data.frame <- function(x, breakpoint_type = getOption("AMR_breakpoint_type", "human"), host = NULL, verbose = FALSE) { + if (isTRUE(list(...)$converse_capped_values)) { + deprecation_warning(old = "converse_capped_values", new = "capped_mic_handling", fn = "as.sir", is_argument = TRUE) + capped_mic_handling <- "strict" + } meet_criteria(x, allow_class = "data.frame") # will also check for dimensions > 0 meet_criteria(col_mo, allow_class = "character", is_in = colnames(x), allow_NULL = TRUE) meet_criteria(guideline, allow_class = "character", has_length = 1) meet_criteria(uti, allow_class = c("logical", "character"), allow_NULL = TRUE, allow_NA = TRUE) - meet_criteria(conserve_capped_values, allow_class = "logical", has_length = 1) + meet_criteria(capped_mic_handling, allow_class = "character", has_length = 1, is_in = c("standard", "strict", "relaxed", "inverse")) meet_criteria(add_intrinsic_resistance, allow_class = "logical", has_length = 1) meet_criteria(reference_data, allow_class = "data.frame") meet_criteria(substitute_missing_r_breakpoint, allow_class = "logical", has_length = 1) @@ -801,7 +815,7 @@ as.sir.data.frame <- function(x, ab = ab_cols[i], guideline = guideline, uti = uti, - conserve_capped_values = conserve_capped_values, + capped_mic_handling = capped_mic_handling, add_intrinsic_resistance = add_intrinsic_resistance, reference_data = reference_data, substitute_missing_r_breakpoint = substitute_missing_r_breakpoint, @@ -931,7 +945,7 @@ as_sir_method <- function(method_short, ab, guideline, uti, - conserve_capped_values, + capped_mic_handling, add_intrinsic_resistance, reference_data, substitute_missing_r_breakpoint, @@ -941,12 +955,16 @@ as_sir_method <- function(method_short, host, verbose, ...) { + if (isTRUE(list(...)$converse_capped_values)) { + deprecation_warning(old = "converse_capped_values", new = "capped_mic_handling", fn = "as.sir", is_argument = TRUE) + capped_mic_handling <- "strict" + } meet_criteria(x, allow_NA = TRUE, .call_depth = -2) meet_criteria(mo, allow_class = c("mo", "character"), has_length = c(1, length(x)), allow_NULL = TRUE, .call_depth = -2) meet_criteria(ab, allow_class = c("ab", "character"), has_length = c(1, length(x)), .call_depth = -2) meet_criteria(guideline, allow_class = "character", has_length = 1, .call_depth = -2) meet_criteria(uti, allow_class = c("logical", "character"), has_length = c(1, length(x)), allow_NULL = TRUE, allow_NA = TRUE, .call_depth = -2) - meet_criteria(conserve_capped_values, allow_class = "logical", has_length = 1, .call_depth = -2) + meet_criteria(capped_mic_handling, allow_class = "character", has_length = 1, is_in = c("standard", "strict", "relaxed", "inverse"), .call_depth = -2) meet_criteria(add_intrinsic_resistance, allow_class = "logical", has_length = 1, .call_depth = -2) meet_criteria(reference_data, allow_class = "data.frame", .call_depth = -2) meet_criteria(substitute_missing_r_breakpoint, allow_class = "logical", has_length = 1, .call_depth = -2) @@ -959,11 +977,13 @@ as_sir_method <- function(method_short, # backward compatibilty dots <- list(...) - dots <- dots[which(!names(dots) %in% c("warn", "mo.bak", "is_data.frame"))] + dots <- dots[which(!names(dots) %in% c("warn", "mo.bak", "is_data.frame", "conserve_capped_values"))] if (length(dots) != 0) { warning_("These arguments in `as.sir()` are no longer used: ", vector_and(names(dots), quotes = "`"), ".", call = FALSE) } + current_sir_interpretation_history <- NROW(AMR_env$sir_interpretation_history) + guideline_coerced <- get_guideline(guideline, reference_data) if (message_not_thrown_before("as.sir", "sir_interpretation_history")) { @@ -1504,11 +1524,14 @@ as_sir_method <- function(method_short, if (any(breakpoints_current$site %like% "screen", na.rm = TRUE) | any(breakpoints_current$ref_tbl %like% "screen", na.rm = TRUE)) { notes_current <- c(notes_current, "Some screening breakpoints were applied - use `include_screening = FALSE` to prevent this") } - if (method == "mic" && conserve_capped_values == TRUE && any(as.character(values) %like% "^[<][0-9]")) { - notes_current <- c(notes_current, "MIC values 'lower than' are all considered 'S' since conserve_capped_values = TRUE") + if (capped_mic_handling %in% c("strict", "inverse") && any(as.character(values) %like% "^[<][0-9]")) { + notes_current <- c(notes_current, paste0("MIC values with the sign '<' are all considered 'S' since capped_mic_handling = \"", capped_mic_handling, "\"")) } - if (method == "mic" && conserve_capped_values == TRUE && any(as.character(values) %like% "^[>][0-9]")) { - notes_current <- c(notes_current, "MIC values 'greater than' are all considered 'R' since conserve_capped_values = TRUE") + if (capped_mic_handling %in% c("strict", "inverse") && any(as.character(values) %like% "^[>][0-9]")) { + notes_current <- c(notes_current, paste0("MIC values with the sign '>' are all considered 'R' since capped_mic_handling = \"", capped_mic_handling, "\"")) + } + if (capped_mic_handling %in% c("strict", "standard") && any(as.character(values) %like% "^[><]=[0-9]" & as.double(values) > breakpoints_current$breakpoint_S & as.double(values) < breakpoints_current$breakpoint_R, na.rm = TRUE)) { + notes_current <- c(notes_current, paste0("MIC values within the breakpoint guideline range with the sign '<=' or '>=' are considered 'NI' since capped_mic_handling = \"", capped_mic_handling, "\"")) } if (isTRUE(substitute_missing_r_breakpoint) && !is.na(breakpoints_current$breakpoint_S) && is.na(breakpoints_current$breakpoint_R)) { breakpoints_current$breakpoint_R <- breakpoints_current$breakpoint_S # breakpoints_current only has 1 row at this moment @@ -1518,8 +1541,9 @@ as_sir_method <- function(method_short, if (method == "mic") { new_sir <- case_when_AMR( is.na(values) ~ NA_sir_, - conserve_capped_values == TRUE & as.character(values) %like% "^[<][0-9]" ~ as.sir("S"), - conserve_capped_values == TRUE & as.character(values) %like% "^[>][0-9]" ~ as.sir("R"), + capped_mic_handling %in% c("strict", "inverse") & as.character(values) %like% "^[<][0-9]" ~ as.sir("S"), + capped_mic_handling %in% c("strict", "inverse") & as.character(values) %like% "^[>][0-9]" ~ as.sir("R"), + capped_mic_handling %in% c("strict", "standard") & as.character(values) %like% "^[><]=[0-9]" & as.double(values) > breakpoints_current$breakpoint_S & as.double(values) < breakpoints_current$breakpoint_R ~ as.sir("NI"), values <= breakpoints_current$breakpoint_S ~ as.sir("S"), guideline_coerced %like% "EUCAST" & values > breakpoints_current$breakpoint_R ~ as.sir("R"), guideline_coerced %like% "CLSI" & values >= breakpoints_current$breakpoint_R ~ as.sir("R"), @@ -1599,6 +1623,12 @@ as_sir_method <- function(method_short, load_mo_uncertainties(metadata_mo) + # reorder AMR_env$sir_interpretation_history to get a clean ordering on index + old_part <- AMR_env$sir_interpretation_history[seq_len(current_sir_interpretation_history), , drop = FALSE] + new_part <- AMR_env$sir_interpretation_history[c((current_sir_interpretation_history + 1):NROW(AMR_env$sir_interpretation_history)), , drop = FALSE] + new_part <- new_part[order(new_part$index), , drop = FALSE] + AMR_env$sir_interpretation_history <- rbind_AMR(old_part, new_part) + df$result } @@ -1607,18 +1637,11 @@ as_sir_method <- function(method_short, #' @export sir_interpretation_history <- function(clean = FALSE) { meet_criteria(clean, allow_class = "logical", has_length = 1) - out <- AMR_env$sir_interpretation_history out$outcome <- as.sir(out$outcome) - if (NROW(out) > 0) { - # sort descending on time - out <- out[order(format(out$datetime, "%Y%m%d%H%M"), out$index, decreasing = TRUE), , drop = FALSE] - } - if (isTRUE(clean)) { AMR_env$sir_interpretation_history <- AMR_env$sir_interpretation_history[0, , drop = FALSE] } - if (pkg_is_available("tibble")) { out <- import_fn("as_tibble", "tibble")(out) } diff --git a/R/zz_deprecated.R b/R/zz_deprecated.R index e5ea93d5d..30a9b7f5d 100755 --- a/R/zz_deprecated.R +++ b/R/zz_deprecated.R @@ -41,6 +41,7 @@ NULL "antibiotics" # REMEMBER to also remove the deprecated `antibiotics` argument in `antibiogram()` +# REMEMBER to also remove the deprecated `converse_capped_values` argument in `as.sir()` #' @rdname AMR-deprecated #' @export diff --git a/_pkgdown.yml b/_pkgdown.yml index 352e5ddb1..136247f8a 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -65,70 +65,70 @@ home: structure: [toc, links, authors] navbar: + title: "AMR (for R)" + left: + - text: "How to" + icon: "fa-question-circle" + menu: + - text: "Conduct AMR Analysis" + icon: "fa-directions" + href: "articles/AMR.html" + - text: "Generate Antibiogram (Trad./Syndromic/WISCA)" + icon: "fa-file-prescription" + href: "reference/antibiogram.html" # reference instead of an article + - text: "Predict Antimicrobial Resistance" + icon: "fa-dice" + href: "articles/resistance_predict.html" + - text: "Download Data Sets for Own Use" + icon: "fa-database" + href: "articles/datasets.html" + - text: "Use AMR for Predictive Modelling (tidymodels)" + icon: "fa-square-root-variable" + href: "articles/AMR_with_tidymodels.html" + - text: "Set User- Or Team-specific Package Settings" + icon: "fa-gear" + href: "reference/AMR-options.html" + - text: "Conduct Principal Component Analysis for AMR" + icon: "fa-compress" + href: "articles/PCA.html" + - text: "Determine Multi-Drug Resistance (MDR)" + icon: "fa-skull-crossbones" + href: "articles/MDR.html" + - text: "Work with WHONET Data" + icon: "fa-globe-americas" + href: "articles/WHONET.html" + - text: "Apply Eucast Rules" + icon: "fa-exchange-alt" + href: "articles/EUCAST.html" + - text: "Get Taxonomy of a Microorganism" + icon: "fa-bug" + href: "reference/mo_property.html" # reference instead of an article + - text: "Get Properties of an Antibiotic Drug" + icon: "fa-capsules" + href: "reference/ab_property.html" # reference instead of an article + - text: "Get Properties of an Antiviral Drug" + icon: "fa-capsules" + href: "reference/av_property.html" # reference instead of an article + - text: "AMR for Python" + icon: "fab fa-python" + href: "articles/AMR_for_Python.html" + - text: "Manual" + icon: "fa-book-open" + href: "reference/index.html" + - text: "Authors" + icon: "fa-users" + href: "authors.html" structure: - title: "AMR (for R)" - left: - - text: "How to" - icon: "fa-question-circle" - menu: - - text: "Conduct AMR Analysis" - icon: "fa-directions" - href: "articles/AMR.html" - - text: "Generate Antibiogram (Trad./Syndromic/WISCA)" - icon: "fa-file-prescription" - href: "reference/antibiogram.html" # reference instead of an article - - text: "Predict Antimicrobial Resistance" - icon: "fa-dice" - href: "articles/resistance_predict.html" - - text: "Download Data Sets for Own Use" - icon: "fa-database" - href: "articles/datasets.html" - - text: "Use AMR for Predictive Modelling (tidymodels)" - icon: "fa-square-root-variable" - href: "articles/AMR_with_tidymodels.html" - - text: "Set User- Or Team-specific Package Settings" - icon: "fa-gear" - href: "reference/AMR-options.html" - - text: "Conduct Principal Component Analysis for AMR" - icon: "fa-compress" - href: "articles/PCA.html" - - text: "Determine Multi-Drug Resistance (MDR)" - icon: "fa-skull-crossbones" - href: "articles/MDR.html" - - text: "Work with WHONET Data" - icon: "fa-globe-americas" - href: "articles/WHONET.html" - - text: "Apply Eucast Rules" - icon: "fa-exchange-alt" - href: "articles/EUCAST.html" - - text: "Get Taxonomy of a Microorganism" - icon: "fa-bug" - href: "reference/mo_property.html" # reference instead of an article - - text: "Get Properties of an Antibiotic Drug" - icon: "fa-capsules" - href: "reference/ab_property.html" # reference instead of an article - - text: "Get Properties of an Antiviral Drug" - icon: "fa-capsules" - href: "reference/av_property.html" # reference instead of an article - - text: "AMR for Python" - icon: "fab fa-python" - href: "articles/AMR_for_Python.html" - - text: "Manual" - icon: "fa-book-open" - href: "reference/index.html" - - text: "Authors" - icon: "fa-users" - href: "authors.html" right: [search, amrchangelog, amrgit] components: amrchangelog: - icon: fa-newspaper - href: news/index.html - aria-label: Changelog + text: "Changelog" + icon: "fa-newspaper" + href: "news/index.html" amrgit: - icon: fa-github - href: https://github.com/msberends/AMR" - aria-label: Source Code + text: "Source Code" + icon: "fa-github" + href: "https://github.com/msberends/AMR" reference: - title: "Introduction to the package" diff --git a/data-raw/gpt_training_text_v2.1.1.9199.txt b/data-raw/gpt_training_text_v2.1.1.9200.txt similarity index 99% rename from data-raw/gpt_training_text_v2.1.1.9199.txt rename to data-raw/gpt_training_text_v2.1.1.9200.txt index 1fcc296ef..bacbf05da 100644 --- a/data-raw/gpt_training_text_v2.1.1.9199.txt +++ b/data-raw/gpt_training_text_v2.1.1.9200.txt @@ -1,6 +1,6 @@ This knowledge base contains all context you must know about the AMR package for R. You are a GPT trained to be an assistant for the AMR package in R. You are an incredible R specialist, especially trained in this package and in the tidyverse. -First and foremost, you are trained on version 2.1.1.9199. Remember this whenever someone asks which AMR package version you’re at. +First and foremost, you are trained on version 2.1.1.9200. Remember this whenever someone asks which AMR package version you’re at. Below are the contents of the file, the file, and all the files (documentation) in the package. Every file content is split using 100 hypens. ---------------------------------------------------------------------------------------------------- @@ -764,6 +764,7 @@ This is an overview of all the package-specific \code{\link[=options]{options()} \itemize{ \item \code{AMR_antibiogram_formatting_type} \cr A \link{numeric} (1-22) to use in \code{\link[=antibiogram]{antibiogram()}}, to indicate which formatting type to use. \item \code{AMR_breakpoint_type} \cr A \link{character} to use in \code{\link[=as.sir]{as.sir()}}, to indicate which breakpoint type to use. This must be either "ECOFF", "animal", or "human". +\item \code{AMR_capped_mic_handling} \cr A \link{character} to use in \code{\link[=as.sir]{as.sir()}}, to indicate how capped MIC values (\code{<}, \code{<=}, \code{>}, \code{>=}) should be interpreted. Must be one of \code{"standard"}, \code{"strict"}, \code{"relaxed"}, or \code{"inverse"} - the default is \code{"standard"}. \item \code{AMR_cleaning_regex} \cr A \link[base:regex]{regular expression} (case-insensitive) to use in \code{\link[=as.mo]{as.mo()}} and all \code{\link[=mo_property]{mo_*}} functions, to clean the user input. The default is the outcome of \code{\link[=mo_cleaning_regex]{mo_cleaning_regex()}}, which removes texts between brackets and texts such as "species" and "serovar". \item \code{AMR_custom_ab} \cr A file location to an RDS file, to use custom antimicrobial drugs with this package. This is explained in \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}}. \item \code{AMR_custom_mo} \cr A file location to an RDS file, to use custom microorganisms with this package. This is explained in \code{\link[=add_custom_microorganisms]{add_custom_microorganisms()}}. @@ -3340,7 +3341,8 @@ is_sir_eligible(x, threshold = 0.05) \method{as.sir}{mic}(x, mo = NULL, ab = deparse(substitute(x)), guideline = getOption("AMR_guideline", "EUCAST"), uti = NULL, - conserve_capped_values = FALSE, add_intrinsic_resistance = FALSE, + capped_mic_handling = getOption("AMR_capped_mic_handling", "standard"), + add_intrinsic_resistance = FALSE, reference_data = AMR::clinical_breakpoints, substitute_missing_r_breakpoint = getOption("AMR_substitute_missing_r_breakpoint", FALSE), include_screening = getOption("AMR_include_screening", FALSE), @@ -3360,7 +3362,8 @@ is_sir_eligible(x, threshold = 0.05) \method{as.sir}{data.frame}(x, ..., col_mo = NULL, guideline = getOption("AMR_guideline", "EUCAST"), uti = NULL, - conserve_capped_values = FALSE, add_intrinsic_resistance = FALSE, + capped_mic_handling = getOption("AMR_capped_mic_handling", "standard"), + add_intrinsic_resistance = FALSE, reference_data = AMR::clinical_breakpoints, substitute_missing_r_breakpoint = getOption("AMR_substitute_missing_r_breakpoint", FALSE), include_screening = getOption("AMR_include_screening", FALSE), @@ -3387,7 +3390,19 @@ sir_interpretation_history(clean = FALSE) \item{uti}{(Urinary Tract Infection) a vector (or column name) with \link{logical}s (\code{TRUE} or \code{FALSE}) to specify whether a UTI specific interpretation from the guideline should be chosen. For using \code{\link[=as.sir]{as.sir()}} on a \link{data.frame}, this can also be a column containing \link{logical}s or when left blank, the data set will be searched for a column 'specimen', and rows within this column containing 'urin' (such as 'urine', 'urina') will be regarded isolates from a UTI. See \emph{Examples}.} -\item{conserve_capped_values}{a \link{logical} to indicate that MIC values starting with \code{">"} (but not \code{">="}) must always return "R" , and that MIC values starting with \code{"<"} (but not \code{"<="}) must always return "S"} +\item{capped_mic_handling}{A \link{character} string that controls how MIC values with a cap (i.e., starting with \code{<}, \code{<=}, \code{>}, or \code{>=}) are interpreted. Supports the following options: +\itemize{ +\item \code{"standard"} (default)\cr +\code{<=} and \code{>=} return \code{"NI"} if the value is \strong{within} the breakpoint guideline range, while \code{<} and \code{>} are interpreted normally. +\item \code{"strict"}\cr +Enforces conservative handling; \code{<} always returns \code{"S"}, \code{>} always returns \code{"R"}, and \code{<=}/\code{>=} return \code{"NI"} when within breakpoint guideline range. +\item \code{"relaxed"}\cr +Ignores all signs, treating values as their numeric equivalents (e.g., \verb{>0.5} is regarded \code{0.5}). +\item \code{"inverse"}\cr +Opposite of \code{"standard"}; \code{<} always returns \code{"S"}, \code{>} always returns \code{"R"}, and \code{<=}/\code{>=} are treated as their numeric equivalents +} + +The default \code{"standard"} setting ensures cautious handling of uncertain values while preserving interpretability. This option can also be set with the package option \code{\link[=AMR-options]{AMR_capped_mic_handling}}.} \item{add_intrinsic_resistance}{\emph{(only useful when using a EUCAST guideline)} a \link{logical} to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in \emph{Klebsiella} species. Determination is based on the \link{intrinsic_resistant} data set, that itself is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021).} @@ -3443,7 +3458,7 @@ your_data \%>\% mutate_if(is.mic, as.sir, ab = c("cipro", "ampicillin", ...), mo # for veterinary breakpoints, also set `host`: your_data \%>\% mutate_if(is.mic, as.sir, host = "column_with_animal_species", guideline = "CLSI") }\if{html}{\out{}} -\item Operators like "<=" will be stripped before interpretation. When using \code{conserve_capped_values = TRUE}, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (\code{conserve_capped_values = FALSE}) considers ">2" to be lower than ">=4" and might in this case return "S" or "I". +\item Operators like "<=" will be stripped before interpretation. When using \code{capped_mic_handling = "strict"}, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (\code{capped_mic_handling = "standard"}) considers ">2" to be lower than ">=4" and might in this case return "S" or "I". } \item For \strong{interpreting disk diffusion diameters} according to EUCAST or CLSI. You must clean your disk zones first using \code{\link[=as.disk]{as.disk()}}, that also gives your columns the new data class \code{\link{disk}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} argument. \itemize{ diff --git a/man/AMR-options.Rd b/man/AMR-options.Rd index 99bcbac99..689272959 100644 --- a/man/AMR-options.Rd +++ b/man/AMR-options.Rd @@ -11,6 +11,7 @@ This is an overview of all the package-specific \code{\link[=options]{options()} \itemize{ \item \code{AMR_antibiogram_formatting_type} \cr A \link{numeric} (1-22) to use in \code{\link[=antibiogram]{antibiogram()}}, to indicate which formatting type to use. \item \code{AMR_breakpoint_type} \cr A \link{character} to use in \code{\link[=as.sir]{as.sir()}}, to indicate which breakpoint type to use. This must be either "ECOFF", "animal", or "human". +\item \code{AMR_capped_mic_handling} \cr A \link{character} to use in \code{\link[=as.sir]{as.sir()}}, to indicate how capped MIC values (\code{<}, \code{<=}, \code{>}, \code{>=}) should be interpreted. Must be one of \code{"standard"}, \code{"strict"}, \code{"relaxed"}, or \code{"inverse"} - the default is \code{"standard"}. \item \code{AMR_cleaning_regex} \cr A \link[base:regex]{regular expression} (case-insensitive) to use in \code{\link[=as.mo]{as.mo()}} and all \code{\link[=mo_property]{mo_*}} functions, to clean the user input. The default is the outcome of \code{\link[=mo_cleaning_regex]{mo_cleaning_regex()}}, which removes texts between brackets and texts such as "species" and "serovar". \item \code{AMR_custom_ab} \cr A file location to an RDS file, to use custom antimicrobial drugs with this package. This is explained in \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}}. \item \code{AMR_custom_mo} \cr A file location to an RDS file, to use custom microorganisms with this package. This is explained in \code{\link[=add_custom_microorganisms]{add_custom_microorganisms()}}. diff --git a/man/as.sir.Rd b/man/as.sir.Rd index 8c51eb765..32e2eb16d 100644 --- a/man/as.sir.Rd +++ b/man/as.sir.Rd @@ -37,7 +37,8 @@ is_sir_eligible(x, threshold = 0.05) \method{as.sir}{mic}(x, mo = NULL, ab = deparse(substitute(x)), guideline = getOption("AMR_guideline", "EUCAST"), uti = NULL, - conserve_capped_values = FALSE, add_intrinsic_resistance = FALSE, + capped_mic_handling = getOption("AMR_capped_mic_handling", "standard"), + add_intrinsic_resistance = FALSE, reference_data = AMR::clinical_breakpoints, substitute_missing_r_breakpoint = getOption("AMR_substitute_missing_r_breakpoint", FALSE), include_screening = getOption("AMR_include_screening", FALSE), @@ -57,7 +58,8 @@ is_sir_eligible(x, threshold = 0.05) \method{as.sir}{data.frame}(x, ..., col_mo = NULL, guideline = getOption("AMR_guideline", "EUCAST"), uti = NULL, - conserve_capped_values = FALSE, add_intrinsic_resistance = FALSE, + capped_mic_handling = getOption("AMR_capped_mic_handling", "standard"), + add_intrinsic_resistance = FALSE, reference_data = AMR::clinical_breakpoints, substitute_missing_r_breakpoint = getOption("AMR_substitute_missing_r_breakpoint", FALSE), include_screening = getOption("AMR_include_screening", FALSE), @@ -84,7 +86,19 @@ sir_interpretation_history(clean = FALSE) \item{uti}{(Urinary Tract Infection) a vector (or column name) with \link{logical}s (\code{TRUE} or \code{FALSE}) to specify whether a UTI specific interpretation from the guideline should be chosen. For using \code{\link[=as.sir]{as.sir()}} on a \link{data.frame}, this can also be a column containing \link{logical}s or when left blank, the data set will be searched for a column 'specimen', and rows within this column containing 'urin' (such as 'urine', 'urina') will be regarded isolates from a UTI. See \emph{Examples}.} -\item{conserve_capped_values}{a \link{logical} to indicate that MIC values starting with \code{">"} (but not \code{">="}) must always return "R" , and that MIC values starting with \code{"<"} (but not \code{"<="}) must always return "S"} +\item{capped_mic_handling}{A \link{character} string that controls how MIC values with a cap (i.e., starting with \code{<}, \code{<=}, \code{>}, or \code{>=}) are interpreted. Supports the following options: +\itemize{ +\item \code{"standard"} (default)\cr +\code{<=} and \code{>=} return \code{"NI"} if the value is \strong{within} the breakpoint guideline range, while \code{<} and \code{>} are interpreted normally. +\item \code{"strict"}\cr +Enforces conservative handling; \code{<} always returns \code{"S"}, \code{>} always returns \code{"R"}, and \code{<=}/\code{>=} return \code{"NI"} when within breakpoint guideline range. +\item \code{"relaxed"}\cr +Ignores all signs, treating values as their numeric equivalents (e.g., \verb{>0.5} is regarded \code{0.5}). +\item \code{"inverse"}\cr +Opposite of \code{"standard"}; \code{<} always returns \code{"S"}, \code{>} always returns \code{"R"}, and \code{<=}/\code{>=} are treated as their numeric equivalents +} + +The default \code{"standard"} setting ensures cautious handling of uncertain values while preserving interpretability. This option can also be set with the package option \code{\link[=AMR-options]{AMR_capped_mic_handling}}.} \item{add_intrinsic_resistance}{\emph{(only useful when using a EUCAST guideline)} a \link{logical} to indicate whether intrinsic antibiotic resistance must also be considered for applicable bug-drug combinations, meaning that e.g. ampicillin will always return "R" in \emph{Klebsiella} species. Determination is based on the \link{intrinsic_resistant} data set, that itself is based on \href{https://www.eucast.org/expert_rules_and_expected_phenotypes}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021).} @@ -140,7 +154,7 @@ your_data \%>\% mutate_if(is.mic, as.sir, ab = c("cipro", "ampicillin", ...), mo # for veterinary breakpoints, also set `host`: your_data \%>\% mutate_if(is.mic, as.sir, host = "column_with_animal_species", guideline = "CLSI") }\if{html}{\out{}} -\item Operators like "<=" will be stripped before interpretation. When using \code{conserve_capped_values = TRUE}, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (\code{conserve_capped_values = FALSE}) considers ">2" to be lower than ">=4" and might in this case return "S" or "I". +\item Operators like "<=" will be stripped before interpretation. When using \code{capped_mic_handling = "strict"}, an MIC value of e.g. ">2" will always return "R", even if the breakpoint according to the chosen guideline is ">=4". This is to prevent that capped values from raw laboratory data would not be treated conservatively. The default behaviour (\code{capped_mic_handling = "standard"}) considers ">2" to be lower than ">=4" and might in this case return "S" or "I". } \item For \strong{interpreting disk diffusion diameters} according to EUCAST or CLSI. You must clean your disk zones first using \code{\link[=as.disk]{as.disk()}}, that also gives your columns the new data class \code{\link{disk}}. Also, be sure to have a column with microorganism names or codes. It will be found automatically, but can be set manually using the \code{mo} argument. \itemize{ diff --git a/pkgdown/extra.css b/pkgdown/extra.css index 7a68dca63..88dff5bb7 100644 --- a/pkgdown/extra.css +++ b/pkgdown/extra.css @@ -98,12 +98,14 @@ body.amr-for-python * { .bg-primary .navbar-nav .nav-link:focus { color: var(--amr-green-light) !important; } -.navbar-dark .navbar-nav .nav-item > .nav-link:hover, -.navbar-light .navbar-nav .nav-item>.nav-link:hover { +.navbar-nav .nav-item > .nav-link:hover { background: none !important; } -.navbar-dark input[type="search"] { +input[type="search"] { background-color: var(--amr-green-light) !important; + max-width: 160px; + border-color: var(--amr-green-dark) !important; + border-radius: 2px !important; } .navbar-nav .nav-item > .nav-link { border-radius: 0 !important;