From 20c26cd21b47a9dd573d48cd427aae02991b37a6 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 22:18:38 +0000 Subject: [PATCH] Built site for AMR@2.1.1.9134: e740aa6 --- 404.html | 2 +- LICENSE-text.html | 2 +- articles/AMR.html | 2 +- articles/AMR_for_Python.html | 2 +- articles/AMR_with_tidymodels.html | 4 ++-- articles/EUCAST.html | 2 +- articles/MDR.html | 2 +- articles/PCA.html | 2 +- articles/WHONET.html | 2 +- articles/datasets.html | 2 +- articles/index.html | 2 +- articles/resistance_predict.html | 2 +- articles/welcome_to_AMR.html | 2 +- authors.html | 2 +- index.html | 2 +- news/index.html | 16 +++++++------- pkgdown.yml | 2 +- reference/AMR-deprecated.html | 2 +- reference/AMR-options.html | 2 +- reference/AMR.html | 2 +- reference/WHOCC.html | 2 +- reference/WHONET.html | 2 +- reference/ab_from_text.html | 2 +- reference/ab_property.html | 2 +- reference/add_custom_antimicrobials.html | 2 +- reference/add_custom_microorganisms.html | 2 +- reference/age.html | 2 +- reference/age_groups.html | 2 +- reference/antibiogram.html | 20 +++++++++++------- reference/antibiotics.html | 2 +- reference/antimicrobial_class_selectors.html | 2 +- reference/as.ab.html | 2 +- reference/as.av.html | 2 +- reference/as.disk.html | 2 +- reference/as.mic.html | 2 +- reference/as.mo.html | 2 +- reference/as.sir.html | 22 ++++++++++---------- reference/atc_online.html | 2 +- reference/av_from_text.html | 2 +- reference/av_property.html | 2 +- reference/availability.html | 2 +- reference/bug_drug_combinations.html | 2 +- reference/clinical_breakpoints.html | 2 +- reference/count.html | 2 +- reference/custom_eucast_rules.html | 2 +- reference/dosage.html | 2 +- reference/eucast_rules.html | 2 +- reference/example_isolates.html | 2 +- reference/example_isolates_unclean.html | 2 +- reference/export_ncbi_biosample.html | 2 +- reference/first_isolate.html | 2 +- reference/g.test.html | 2 +- reference/get_episode.html | 2 +- reference/ggplot_pca.html | 2 +- reference/ggplot_sir.html | 2 +- reference/guess_ab_col.html | 2 +- reference/index.html | 2 +- reference/intrinsic_resistant.html | 2 +- reference/italicise_taxonomy.html | 2 +- reference/join.html | 2 +- reference/key_antimicrobials.html | 2 +- reference/kurtosis.html | 2 +- reference/like.html | 2 +- reference/mdro.html | 2 +- reference/mean_amr_distance.html | 2 +- reference/microorganisms.codes.html | 2 +- reference/microorganisms.groups.html | 2 +- reference/microorganisms.html | 2 +- reference/mo_matching_score.html | 2 +- reference/mo_property.html | 2 +- reference/mo_source.html | 2 +- reference/pca.html | 2 +- reference/plot.html | 2 +- reference/proportion.html | 2 +- reference/random.html | 2 +- reference/resistance_predict.html | 2 +- reference/skewness.html | 2 +- reference/top_n_microorganisms.html | 2 +- reference/translate.html | 2 +- search.json | 2 +- 80 files changed, 109 insertions(+), 105 deletions(-) diff --git a/404.html b/404.html index 6871b294a..431f27c0e 100644 --- a/404.html +++ b/404.html @@ -32,7 +32,7 @@ AMR (for R) - 2.1.1.9133 + 2.1.1.9134
#> ✖ dplyr::filter() masks stats::filter() #> ✖ dplyr::lag() masks stats::lag() #> ✖ recipes::step() masks stats::step() -#> • Use suppressPackageStartupMessages() to eliminate package startup messages +#> • Use tidymodels_prefer() to resolve common conflicts. library(AMR) # For AMR data analysis # Load the example_isolates dataset diff --git a/articles/EUCAST.html b/articles/EUCAST.html index 523114794..be4048bb8 100644 --- a/articles/EUCAST.html +++ b/articles/EUCAST.html @@ -31,7 +31,7 @@ AMR (for R) - 2.1.1.9133 + 2.1.1.9134(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.)
This package now supports not only tools for AMR data analysis in clinical settings, but also for veterinary and environmental microbiology. This was made possible through a collaboration with the University of Prince Edward Island’s Atlantic Veterinary College, Canada. To celebrate this great improvement of the package, we also updated the package logo to reflect this change.
rsi
class, which were all replaced with their sir
equivalents two years agoas.sir()
now has extensive support for veterinary breakpoints from CLSI. Use breakpoint_type = "animal"
and set the host
argument to a variable that contains animal species names.ab
, mo
, and uti
: as.sir(..., ab = "column1", mo = "column2", uti = "column3")
. This greatly improves the flexibility for users.vctrs
integration, a Tidyverse package working in the background for many Tidyverse functions. For users, this means that functions such as dplyr
’s bind_rows()
, rowwise()
and c_across()
are now supported for e.g. columns of class mic
. Despite this, this AMR
package is still zero-dependent on any other package, including dplyr
and vctrs
..xpt
) files, since their file structure and extremely inefficient and requires more disk space than GitHub allows in a single commit.This changelog only contains changes from AMR v3.0 (February 2025) and later.
All types of antibiograms as listed above can be plotted (using ggplot2::autoplot()
or base R's plot()
and barplot()
).
THe outcome of antibiogram()
can also be used directly in R Markdown / Quarto (i.e., knitr
) for reports. In this case, knitr::kable()
will be applied automatically and microorganism names will even be printed in italics at default (see argument italicise
).
All types of antibiograms as listed above can be plotted (using ggplot2::autoplot()
or base R's plot()
and barplot()
). As mentioned above, the numeric values of an antibiogram are stored in a long format as the attribute long_numeric
. You can retrieve them using attributes(x)$long_numeric
, where x
is the outcome of antibiogram()
or wisca()
.
The outcome of antibiogram()
can also be used directly in R Markdown / Quarto (i.e., knitr
) for reports. In this case, knitr::kable()
will be applied automatically and microorganism names will even be printed in italics at default (see argument italicise
).
You can also use functions from specific 'table reporting' packages to transform the output of antibiogram()
to your needs, e.g. with flextable::as_flextable()
or gt::gt()
.
WISCA, as outlined by Barbieri et al. (doi:10.1186/s13756-021-00939-2 +
WISCA, as outlined by Bielicki et al. (doi:10.1093/jac/dkv397 ), stands for Weighted-Incidence Syndromic Combination Antibiogram, which estimates the probability of adequate empirical antimicrobial regimen coverage for specific infection syndromes. This method leverages a Bayesian hierarchical logistic regression framework with random effects for pathogens and regimens, enabling robust estimates in the presence of sparse data.
The Bayesian model assumes conjugate priors for parameter estimation. For example, the coverage probability \(\theta\) for a given antimicrobial regimen is modelled using a Beta distribution as a prior:
$$\theta \sim \text{Beta}(\alpha_0, \beta_0)$$
@@ -313,13 +313,17 @@ Adhering to previously described approaches (see Source) and especially the Baye$$y \sim \text{Binomial}(n, \theta)$$
Posterior parameter estimates are obtained by combining the prior and likelihood using Bayes' theorem. The posterior distribution of \(\theta\) is also a Beta distribution:
$$\theta | y \sim \text{Beta}(\alpha_0 + y, \beta_0 + n - y)$$
+Pathogen incidence, representing the proportion of infections caused by different pathogens, is modelled using a Dirichlet distribution, which is the natural conjugate prior for multinomial outcomes. The Dirichlet distribution is parameterised by a vector of concentration parameters \(\alpha\), where each \(\alpha_i\) corresponds to a specific pathogen. The prior is typically chosen to be uniform (\(\alpha_i = 1\)), reflecting an assumption of equal prior probability across pathogens.
+The posterior distribution of pathogen incidence is then given by:
+$$\text{Dirichlet}(\alpha_1 + n_1, \alpha_2 + n_2, \dots, \alpha_K + n_K)$$
+where \(n_i\) is the number of infections caused by pathogen \(i\) observed in the data. For practical implementation, pathogen incidences are sampled from their posterior using normalised Gamma-distributed random variables:
+$$x_i \sim \text{Gamma}(\alpha_i + n_i, 1)$$ +$$p_i = \frac{x_i}{\sum_{j=1}^K x_j}$$
+where \(x_i\) represents unnormalised pathogen counts, and \(p_i\) is the normalised proportion for pathogen \(i\).
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:
$$\text{OR}_{\text{covariate}} = \frac{\exp(\beta_{\text{covariate}})}{\exp(\beta_0)}$$
-By combining empirical data with prior knowledge, WISCA overcomes the limitations -of traditional combination antibiograms, offering disease-specific, patient-stratified -estimates with robust uncertainty quantification. This tool is invaluable for antimicrobial -stewardship programs and empirical treatment guideline refinement.
+By combining empirical data with prior knowledge, WISCA overcomes the limitations of traditional combination antibiograms, offering disease-specific, patient-stratified estimates with robust uncertainty quantification. This tool is invaluable for antimicrobial stewardship programs and empirical treatment guideline refinement.