diff --git a/DESCRIPTION b/DESCRIPTION index 644efd616..93e73e484 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 2.1.1.9134 -Date: 2025-01-27 +Version: 2.1.1.9135 +Date: 2025-01-28 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by diff --git a/NEWS.md b/NEWS.md index b43580523..b1a111e44 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.1.1.9134 +# AMR 2.1.1.9135 *(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).)* diff --git a/PythonPackage/AMR/AMR.egg-info/PKG-INFO b/PythonPackage/AMR/AMR.egg-info/PKG-INFO index 7d7c38b45..40d884a21 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.9134 +Version: 2.1.1.9135 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.9134-py3-none-any.whl b/PythonPackage/AMR/dist/AMR-2.1.1.9135-py3-none-any.whl similarity index 85% rename from PythonPackage/AMR/dist/AMR-2.1.1.9134-py3-none-any.whl rename to PythonPackage/AMR/dist/AMR-2.1.1.9135-py3-none-any.whl index 50bd386ae..5e634cf79 100644 Binary files a/PythonPackage/AMR/dist/AMR-2.1.1.9134-py3-none-any.whl and b/PythonPackage/AMR/dist/AMR-2.1.1.9135-py3-none-any.whl differ diff --git a/PythonPackage/AMR/dist/amr-2.1.1.9134.tar.gz b/PythonPackage/AMR/dist/amr-2.1.1.9134.tar.gz deleted file mode 100644 index fb19fe823..000000000 Binary files a/PythonPackage/AMR/dist/amr-2.1.1.9134.tar.gz and /dev/null differ diff --git a/PythonPackage/AMR/dist/amr-2.1.1.9135.tar.gz b/PythonPackage/AMR/dist/amr-2.1.1.9135.tar.gz new file mode 100644 index 000000000..467a28140 Binary files /dev/null and b/PythonPackage/AMR/dist/amr-2.1.1.9135.tar.gz differ diff --git a/PythonPackage/AMR/setup.py b/PythonPackage/AMR/setup.py index 3572c9c00..2a7dc80e5 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.9134', + version='2.1.1.9135', packages=find_packages(), install_requires=[ 'rpy2', diff --git a/R/antibiogram.R b/R/antibiogram.R index e3371925c..59ec410a6 100755 --- a/R/antibiogram.R +++ b/R/antibiogram.R @@ -32,7 +32,7 @@ #' @description #' Create detailed antibiograms with options for traditional, combination, syndromic, and Bayesian WISCA methods. #' -#' Adhering to previously described approaches (see *Source*) and especially the Bayesian WISCA model (Weighted-Incidence Syndromic Combination Antibiogram) by Bielicki *et al.*, these functions provides flexible output formats including plots and tables, ideal for integration with R Markdown and Quarto reports. +#' Adhering to previously described approaches (see *Source*) and especially the Bayesian WISCA model (Weighted-Incidence Syndromic Combination Antibiogram) by Bielicki *et al.*, these functions provide flexible output formats including plots and tables, ideal for integration with R Markdown and Quarto reports. #' @param x a [data.frame] containing at least a column with microorganisms and columns with antimicrobial results (class 'sir', see [as.sir()]) #' @param antibiotics vector of any antimicrobial name or code (will be evaluated with [as.ab()], column name of `x`, or (any combinations of) [antimicrobial selectors][antimicrobial_class_selectors] such as [aminoglycosides()] or [carbapenems()]. For combination antibiograms, this can also be set to values separated with `"+"`, such as "TZP+TOB" or "cipro + genta", given that columns resembling such antimicrobials exist in `x`. See *Examples*. #' @param mo_transform a character to transform microorganism input - must be `"name"`, `"shortname"` (default), `"gramstain"`, or one of the column names of the [microorganisms] data set: `r vector_or(colnames(microorganisms), sort = FALSE, quotes = TRUE)`. Can also be `NULL` to not transform the input. @@ -54,9 +54,9 @@ #' @param info a [logical] to indicate info should be printed - the default is `TRUE` only in interactive mode #' @param object an [antibiogram()] object #' @param ... when used in [R Markdown or Quarto][knitr::kable()]: arguments passed on to [knitr::kable()] (otherwise, has no use) -#' @details This function returns a table with values between 0 and 100 for *susceptibility*, not resistance. +#' @details These functions return a table with values between 0 and 100 for *susceptibility*, not resistance. #' -#' **Remember that you should filter your data to let it contain only first isolates!** This is needed to exclude duplicates and to reduce selection bias. Use [first_isolate()] to determine them in your data set with one of the four available algorithms. +#' **Remember that you should filter your data to let it contain only first isolates!** This is needed to exclude duplicates and to reduce selection bias. Use [first_isolate()] to determine them with one of the four available algorithms: isolate-based, patient-based, episode-based, or phenotype-based. #' #' For estimating antimicrobial coverage, especially when creating a WISCA, the outcome might become more reliable by only including the top *n* species encountered in the data. You can filter on this top *n* using [top_n_microorganisms()]. For example, use `top_n_microorganisms(your_data, n = 10)` as a pre-processing step to only include the top 10 species in the data. #' @@ -225,7 +225,7 @@ #' #' For hierarchical modelling, pathogen-level effects (e.g., differences in resistance patterns) and regimen-level effects are modelled using Gaussian priors on log-odds. This hierarchical structure ensures partial pooling of estimates across groups, improving stability in strata with small sample sizes. The model is implemented using Hamiltonian Monte Carlo (HMC) sampling. #' -#' Stratified results can be provided based on covariates such as age, sex, and clinical complexity (e.g., prior antimicrobial treatments or renal/urological comorbidities) using `dplyr`'s [group_by()] as a pre-processing step before running [wisca()]. In this case, posterior odds ratios (ORs) are derived to quantify the effect of these covariates on coverage probabilities: +#' Stratified results can be provided based on covariates such as age, sex, and clinical complexity (e.g., prior antimicrobial treatments or renal/urological comorbidities) using `dplyr`'s [`group_by()`][dplyr::group_by()] as a pre-processing step before running [wisca()]. Posterior odds ratios (ORs) are derived to quantify the effect of these covariates on coverage probabilities: #' #' \deqn{\text{OR}_{\text{covariate}} = \frac{\exp(\beta_{\text{covariate}})}{\exp(\beta_0)}} #' diff --git a/data-raw/gpt_training_text_v2.1.1.9134.txt b/data-raw/gpt_training_text_v2.1.1.9135.txt similarity index 99% rename from data-raw/gpt_training_text_v2.1.1.9134.txt rename to data-raw/gpt_training_text_v2.1.1.9135.txt index 6849314aa..179669b9b 100644 --- a/data-raw/gpt_training_text_v2.1.1.9134.txt +++ b/data-raw/gpt_training_text_v2.1.1.9135.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.9134. Remember this whenever someone asks which AMR package version you’re at. +First and foremost, you are trained on version 2.1.1.9135. 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. ---------------------------------------------------------------------------------------------------- @@ -1713,12 +1713,12 @@ wisca(x, antibiotics = where(is.sir), mo_transform = "shortname", \description{ Create detailed antibiograms with options for traditional, combination, syndromic, and Bayesian WISCA methods. -Adhering to previously described approaches (see \emph{Source}) and especially the Bayesian WISCA model (Weighted-Incidence Syndromic Combination Antibiogram) by Bielicki \emph{et al.}, these functions provides flexible output formats including plots and tables, ideal for integration with R Markdown and Quarto reports. +Adhering to previously described approaches (see \emph{Source}) and especially the Bayesian WISCA model (Weighted-Incidence Syndromic Combination Antibiogram) by Bielicki \emph{et al.}, these functions provide flexible output formats including plots and tables, ideal for integration with R Markdown and Quarto reports. } \details{ -This function returns a table with values between 0 and 100 for \emph{susceptibility}, not resistance. +These functions return a table with values between 0 and 100 for \emph{susceptibility}, not resistance. -\strong{Remember that you should filter your data to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link[=first_isolate]{first_isolate()}} to determine them in your data set with one of the four available algorithms. +\strong{Remember that you should filter your data to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link[=first_isolate]{first_isolate()}} to determine them with one of the four available algorithms: isolate-based, patient-based, episode-based, or phenotype-based. For estimating antimicrobial coverage, especially when creating a WISCA, the outcome might become more reliable by only including the top \emph{n} species encountered in the data. You can filter on this top \emph{n} using \code{\link[=top_n_microorganisms]{top_n_microorganisms()}}. For example, use \code{top_n_microorganisms(your_data, n = 10)} as a pre-processing step to only include the top 10 species in the data. @@ -1884,7 +1884,7 @@ where \eqn{x_i} represents unnormalised pathogen counts, and \eqn{p_i} is the no For hierarchical modelling, pathogen-level effects (e.g., differences in resistance patterns) and regimen-level effects are modelled using Gaussian priors on log-odds. This hierarchical structure ensures partial pooling of estimates across groups, improving stability in strata with small sample sizes. The model is implemented using Hamiltonian Monte Carlo (HMC) sampling. -Stratified results can be provided based on covariates such as age, sex, and clinical complexity (e.g., prior antimicrobial treatments or renal/urological comorbidities) using \code{dplyr}'s \code{\link[=group_by]{group_by()}} as a pre-processing step before running \code{\link[=wisca]{wisca()}}. In this case, posterior odds ratios (ORs) are derived to quantify the effect of these covariates on coverage probabilities: +Stratified results can be provided based on covariates such as age, sex, and clinical complexity (e.g., prior antimicrobial treatments or renal/urological comorbidities) using \code{dplyr}'s \code{\link[dplyr:group_by]{group_by()}} as a pre-processing step before running \code{\link[=wisca]{wisca()}}. Posterior odds ratios (ORs) are derived to quantify the effect of these covariates on coverage probabilities: \deqn{\text{OR}_{\text{covariate}} = \frac{\exp(\beta_{\text{covariate}})}{\exp(\beta_0)}} diff --git a/man/antibiogram.Rd b/man/antibiogram.Rd index 57cae0723..8cfa0b357 100644 --- a/man/antibiogram.Rd +++ b/man/antibiogram.Rd @@ -91,12 +91,12 @@ wisca(x, antibiotics = where(is.sir), mo_transform = "shortname", \description{ Create detailed antibiograms with options for traditional, combination, syndromic, and Bayesian WISCA methods. -Adhering to previously described approaches (see \emph{Source}) and especially the Bayesian WISCA model (Weighted-Incidence Syndromic Combination Antibiogram) by Bielicki \emph{et al.}, these functions provides flexible output formats including plots and tables, ideal for integration with R Markdown and Quarto reports. +Adhering to previously described approaches (see \emph{Source}) and especially the Bayesian WISCA model (Weighted-Incidence Syndromic Combination Antibiogram) by Bielicki \emph{et al.}, these functions provide flexible output formats including plots and tables, ideal for integration with R Markdown and Quarto reports. } \details{ -This function returns a table with values between 0 and 100 for \emph{susceptibility}, not resistance. +These functions return a table with values between 0 and 100 for \emph{susceptibility}, not resistance. -\strong{Remember that you should filter your data to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link[=first_isolate]{first_isolate()}} to determine them in your data set with one of the four available algorithms. +\strong{Remember that you should filter your data to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link[=first_isolate]{first_isolate()}} to determine them with one of the four available algorithms: isolate-based, patient-based, episode-based, or phenotype-based. For estimating antimicrobial coverage, especially when creating a WISCA, the outcome might become more reliable by only including the top \emph{n} species encountered in the data. You can filter on this top \emph{n} using \code{\link[=top_n_microorganisms]{top_n_microorganisms()}}. For example, use \code{top_n_microorganisms(your_data, n = 10)} as a pre-processing step to only include the top 10 species in the data. @@ -262,7 +262,7 @@ where \eqn{x_i} represents unnormalised pathogen counts, and \eqn{p_i} is the no For hierarchical modelling, pathogen-level effects (e.g., differences in resistance patterns) and regimen-level effects are modelled using Gaussian priors on log-odds. This hierarchical structure ensures partial pooling of estimates across groups, improving stability in strata with small sample sizes. The model is implemented using Hamiltonian Monte Carlo (HMC) sampling. -Stratified results can be provided based on covariates such as age, sex, and clinical complexity (e.g., prior antimicrobial treatments or renal/urological comorbidities) using \code{dplyr}'s \code{\link[=group_by]{group_by()}} as a pre-processing step before running \code{\link[=wisca]{wisca()}}. In this case, posterior odds ratios (ORs) are derived to quantify the effect of these covariates on coverage probabilities: +Stratified results can be provided based on covariates such as age, sex, and clinical complexity (e.g., prior antimicrobial treatments or renal/urological comorbidities) using \code{dplyr}'s \code{\link[dplyr:group_by]{group_by()}} as a pre-processing step before running \code{\link[=wisca]{wisca()}}. Posterior odds ratios (ORs) are derived to quantify the effect of these covariates on coverage probabilities: \deqn{\text{OR}_{\text{covariate}} = \frac{\exp(\beta_{\text{covariate}})}{\exp(\beta_0)}}