mirror of
https://github.com/msberends/AMR.git
synced 2025-04-22 06:03:47 +02:00
Compare commits
2 Commits
b67613ce08
...
c7af397edf
Author | SHA1 | Date | |
---|---|---|---|
c7af397edf | |||
245483e41c |
@ -1,5 +1,5 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 2.1.1.9187
|
Version: 2.1.1.9189
|
||||||
Date: 2025-03-07
|
Date: 2025-03-07
|
||||||
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)
|
||||||
@ -9,6 +9,7 @@ Authors@R: c(
|
|||||||
person(given = c("Matthijs", "S."), family = "Berends", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-7620-1800"), email = "m.s.berends@umcg.nl"),
|
person(given = c("Matthijs", "S."), family = "Berends", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-7620-1800"), email = "m.s.berends@umcg.nl"),
|
||||||
person(given = c("Dennis"), family = "Souverein", role = c("aut", "ctb"), comment = c(ORCID = "0000-0003-0455-0336")),
|
person(given = c("Dennis"), family = "Souverein", role = c("aut", "ctb"), comment = c(ORCID = "0000-0003-0455-0336")),
|
||||||
person(given = c("Erwin", "E.", "A."), family = "Hassing", role = c("aut", "ctb")),
|
person(given = c("Erwin", "E.", "A."), family = "Hassing", role = c("aut", "ctb")),
|
||||||
|
person(given = c("Aislinn"), family = "Cook", role = "ctb", comment = c(ORCID = "0000-0002-9189-7815")),
|
||||||
person(given = c("Andrew", "P."), family = "Norgan", role = "ctb", comment = c(ORCID = "0000-0002-2955-2066")),
|
person(given = c("Andrew", "P."), family = "Norgan", role = "ctb", comment = c(ORCID = "0000-0002-2955-2066")),
|
||||||
person(given = c("Anita"), family = "Williams", role = "ctb", comment = c(ORCID = "0000-0002-5295-8451")),
|
person(given = c("Anita"), family = "Williams", role = "ctb", comment = c(ORCID = "0000-0002-5295-8451")),
|
||||||
person(given = c("Annick"), family = "Lenglet", role = "ctb", comment = c(ORCID = "0000-0003-2013-8405")),
|
person(given = c("Annick"), family = "Lenglet", role = "ctb", comment = c(ORCID = "0000-0003-2013-8405")),
|
||||||
|
10
NEWS.md
10
NEWS.md
@ -1,4 +1,4 @@
|
|||||||
# AMR 2.1.1.9187
|
# AMR 2.1.1.9189
|
||||||
|
|
||||||
*(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).)*
|
*(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).)*
|
||||||
|
|
||||||
@ -6,8 +6,8 @@
|
|||||||
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](https://www.upei.ca/avc), Canada. To celebrate this great improvement of the package, we also updated the package logo to reflect this change.
|
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](https://www.upei.ca/avc), Canada. To celebrate this great improvement of the package, we also updated the package logo to reflect this change.
|
||||||
|
|
||||||
## Breaking
|
## Breaking
|
||||||
* Dataset `antibiotics` has been renamed to `antimicrobials` as the data set contains more than just antibiotics. Calling `antibiotics` will still work, but now returns a warning.
|
* Dataset `antibiotics` has been renamed to `antimicrobials` as the data set contains more than just antibiotics. Using `antibiotics` will still work, but now returns a warning.
|
||||||
* Removed all functions and references that used the deprecated `rsi` class, which were all replaced with their `sir` equivalents two years ago.
|
* Removed all functions and references that used the deprecated `rsi` class, which were all replaced with their `sir` equivalents over two years ago.
|
||||||
|
|
||||||
## New
|
## New
|
||||||
* **One Health implementation**
|
* **One Health implementation**
|
||||||
@ -95,7 +95,7 @@ This package now supports not only tools for AMR data analysis in clinical setti
|
|||||||
* Added console colours support of `sir` class for Positron
|
* Added console colours support of `sir` class for Positron
|
||||||
|
|
||||||
## Other
|
## Other
|
||||||
* Added Dr. Larisse Bolton as contributor for her fantastic implementation of WISCA in a mathematically solid way
|
* Added Dr. Larisse Bolton and Aislinn Cook as contributors for their fantastic implementation of WISCA in a mathematically solid way
|
||||||
* Added Matthew Saab, Dr. Jordan Stull, and Prof. Javier Sanchez as contributors for their tremendous input on veterinary breakpoints and interpretations
|
* Added Matthew Saab, Dr. Jordan Stull, and Prof. Javier Sanchez as contributors for their tremendous input on veterinary breakpoints and interpretations
|
||||||
* Greatly improved `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`.
|
* Greatly improved `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`.
|
||||||
* Greatly updated and expanded documentation
|
* Greatly updated and expanded documentation
|
||||||
@ -103,7 +103,7 @@ This package now supports not only tools for AMR data analysis in clinical setti
|
|||||||
|
|
||||||
## Older Versions
|
## Older Versions
|
||||||
|
|
||||||
This changelog only contains changes from AMR v3.0 (February 2025) and later.
|
This changelog only contains changes from AMR v3.0 (March 2025) and later.
|
||||||
|
|
||||||
* For prior v2 versions, please see [our v2 archive](https://github.com/msberends/AMR/blob/v2.1.1/NEWS.md).
|
* For prior v2 versions, please see [our v2 archive](https://github.com/msberends/AMR/blob/v2.1.1/NEWS.md).
|
||||||
* For prior v1 versions, please see [our v1 archive](https://github.com/msberends/AMR/blob/v1.8.2/NEWS.md).
|
* For prior v1 versions, please see [our v1 archive](https://github.com/msberends/AMR/blob/v1.8.2/NEWS.md).
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Metadata-Version: 2.2
|
Metadata-Version: 2.2
|
||||||
Name: AMR
|
Name: AMR
|
||||||
Version: 2.1.1.9187
|
Version: 2.1.1.9189
|
||||||
Summary: A Python wrapper for the AMR R package
|
Summary: A Python wrapper for the AMR R package
|
||||||
Home-page: https://github.com/msberends/AMR
|
Home-page: https://github.com/msberends/AMR
|
||||||
Author: Matthijs Berends
|
Author: Matthijs Berends
|
||||||
|
BIN
PythonPackage/AMR/dist/amr-2.1.1.9187.tar.gz
vendored
BIN
PythonPackage/AMR/dist/amr-2.1.1.9187.tar.gz
vendored
Binary file not shown.
Binary file not shown.
BIN
PythonPackage/AMR/dist/amr-2.1.1.9189.tar.gz
vendored
Normal file
BIN
PythonPackage/AMR/dist/amr-2.1.1.9189.tar.gz
vendored
Normal file
Binary file not shown.
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='AMR',
|
name='AMR',
|
||||||
version='2.1.1.9187',
|
version='2.1.1.9189',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'rpy2',
|
'rpy2',
|
||||||
|
@ -769,6 +769,32 @@ antibiogram.default <- function(x,
|
|||||||
# prepare for definitive output
|
# prepare for definitive output
|
||||||
out <- out_wisca
|
out <- out_wisca
|
||||||
wisca_parameters <- wisca_parameters[, colnames(wisca_parameters)[!colnames(wisca_parameters) %in% c(levels(NA_sir_), "lower_ci", "upper_ci", "group")], drop = FALSE]
|
wisca_parameters <- wisca_parameters[, colnames(wisca_parameters)[!colnames(wisca_parameters) %in% c(levels(NA_sir_), "lower_ci", "upper_ci", "group")], drop = FALSE]
|
||||||
|
if (isTRUE(has_syndromic_group)) {
|
||||||
|
long_numeric <- out_wisca %pm>%
|
||||||
|
pm_ungroup() %pm>%
|
||||||
|
pm_select(
|
||||||
|
syndromic_group = syndromic_group,
|
||||||
|
ab = ab,
|
||||||
|
coverage = coverage,
|
||||||
|
lower_ci = lower_ci,
|
||||||
|
upper_ci = upper_ci,
|
||||||
|
n_total = n_total,
|
||||||
|
n_tested = n_tested,
|
||||||
|
n_susceptible = n_susceptible
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
long_numeric <- out_wisca %pm>%
|
||||||
|
pm_ungroup() %pm>%
|
||||||
|
pm_select(
|
||||||
|
ab = ab,
|
||||||
|
coverage = coverage,
|
||||||
|
lower_ci = lower_ci,
|
||||||
|
upper_ci = upper_ci,
|
||||||
|
n_total = n_total,
|
||||||
|
n_tested = n_tested,
|
||||||
|
n_susceptible = n_susceptible
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out$digits <- digits # since pm_sumarise() cannot work with an object outside the current frame
|
out$digits <- digits # since pm_sumarise() cannot work with an object outside the current frame
|
||||||
@ -1170,9 +1196,7 @@ tbl_format_footer.antibiogram <- function(x, ...) {
|
|||||||
plot.antibiogram <- function(x, ...) {
|
plot.antibiogram <- function(x, ...) {
|
||||||
df <- attributes(x)$long_numeric
|
df <- attributes(x)$long_numeric
|
||||||
if (!"mo" %in% colnames(df)) {
|
if (!"mo" %in% colnames(df)) {
|
||||||
stop_("Plotting antibiograms using `plot()` is only possible if they were not created using dplyr groups. See `?antibiogram` for how to retrieve numeric values in a long format for advanced plotting.",
|
df$mo <- ""
|
||||||
call = FALSE
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
if ("syndromic_group" %in% colnames(df)) {
|
if ("syndromic_group" %in% colnames(df)) {
|
||||||
# barplot in base R does not support facets - paste columns together
|
# barplot in base R does not support facets - paste columns together
|
||||||
@ -1226,9 +1250,7 @@ barplot.antibiogram <- function(height, ...) {
|
|||||||
autoplot.antibiogram <- function(object, ...) {
|
autoplot.antibiogram <- function(object, ...) {
|
||||||
df <- attributes(object)$long_numeric
|
df <- attributes(object)$long_numeric
|
||||||
if (!"mo" %in% colnames(df)) {
|
if (!"mo" %in% colnames(df)) {
|
||||||
stop_("Plotting antibiograms using `autoplot()` is only possible if they were not created using dplyr groups. See `?antibiogram` for how to retrieve numeric values in a long format for advanced plotting.",
|
df$mo <- ""
|
||||||
call = FALSE
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
out <- ggplot2::ggplot(df,
|
out <- ggplot2::ggplot(df,
|
||||||
mapping = ggplot2::aes(
|
mapping = ggplot2::aes(
|
||||||
@ -1243,6 +1265,10 @@ autoplot.antibiogram <- function(object, ...) {
|
|||||||
) +
|
) +
|
||||||
ggplot2::geom_col(position = ggplot2::position_dodge2(preserve = "single")) +
|
ggplot2::geom_col(position = ggplot2::position_dodge2(preserve = "single")) +
|
||||||
ggplot2::facet_wrap("mo") +
|
ggplot2::facet_wrap("mo") +
|
||||||
|
ggplot2::geom_errorbar(
|
||||||
|
mapping = ggplot2::aes(ymin = lower_ci * 100, ymax = upper_ci * 100),
|
||||||
|
position = ggplot2::position_dodge2(preserve = "single", width = 1)
|
||||||
|
) +
|
||||||
ggplot2::labs(
|
ggplot2::labs(
|
||||||
y = ifelse(isTRUE(attributes(object)$combine_SI), "%SI", "%S"),
|
y = ifelse(isTRUE(attributes(object)$combine_SI), "%SI", "%S"),
|
||||||
x = NULL,
|
x = NULL,
|
||||||
@ -1252,14 +1278,6 @@ autoplot.antibiogram <- function(object, ...) {
|
|||||||
NULL
|
NULL
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (isTRUE(attributes(object)$wisca)) {
|
|
||||||
out <- out +
|
|
||||||
ggplot2::geom_errorbar(
|
|
||||||
mapping = ggplot2::aes(ymin = lower_ci * 100, ymax = upper_ci * 100),
|
|
||||||
position = ggplot2::position_dodge2(preserve = "single"),
|
|
||||||
width = 0.5
|
|
||||||
)
|
|
||||||
}
|
|
||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
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.9187. Remember this whenever someone asks which AMR package version you’re at.
|
First and foremost, you are trained on version 2.1.1.9189. 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.
|
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.
|
||||||
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
||||||
@ -879,6 +879,7 @@ Authors:
|
|||||||
|
|
||||||
Other contributors:
|
Other contributors:
|
||||||
\itemize{
|
\itemize{
|
||||||
|
\item Aislinn Cook (\href{https://orcid.org/0000-0002-9189-7815}{ORCID}) [contributor]
|
||||||
\item Andrew P. Norgan (\href{https://orcid.org/0000-0002-2955-2066}{ORCID}) [contributor]
|
\item Andrew P. Norgan (\href{https://orcid.org/0000-0002-2955-2066}{ORCID}) [contributor]
|
||||||
\item Anita Williams (\href{https://orcid.org/0000-0002-5295-8451}{ORCID}) [contributor]
|
\item Anita Williams (\href{https://orcid.org/0000-0002-5295-8451}{ORCID}) [contributor]
|
||||||
\item Annick Lenglet (\href{https://orcid.org/0000-0003-2013-8405}{ORCID}) [contributor]
|
\item Annick Lenglet (\href{https://orcid.org/0000-0003-2013-8405}{ORCID}) [contributor]
|
@ -61,6 +61,7 @@ Authors:
|
|||||||
|
|
||||||
Other contributors:
|
Other contributors:
|
||||||
\itemize{
|
\itemize{
|
||||||
|
\item Aislinn Cook (\href{https://orcid.org/0000-0002-9189-7815}{ORCID}) [contributor]
|
||||||
\item Andrew P. Norgan (\href{https://orcid.org/0000-0002-2955-2066}{ORCID}) [contributor]
|
\item Andrew P. Norgan (\href{https://orcid.org/0000-0002-2955-2066}{ORCID}) [contributor]
|
||||||
\item Anita Williams (\href{https://orcid.org/0000-0002-5295-8451}{ORCID}) [contributor]
|
\item Anita Williams (\href{https://orcid.org/0000-0002-5295-8451}{ORCID}) [contributor]
|
||||||
\item Annick Lenglet (\href{https://orcid.org/0000-0003-2013-8405}{ORCID}) [contributor]
|
\item Annick Lenglet (\href{https://orcid.org/0000-0003-2013-8405}{ORCID}) [contributor]
|
||||||
|
@ -35,8 +35,9 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// replace 'Developers' with 'Maintainers' on the main page, and "Contributors" on the Authors page
|
// replace 'Developers' with 'Maintainers' on the main page, and "Contributors" on the Authors page
|
||||||
$(".developers h2").text("Maintainers");
|
$(".developers h2").text("Maintainers");
|
||||||
$(".citation h2:nth(0)").text("All contributors");
|
$(".template-citation-authors h1:nth(0)").text("Contributors and Citation");
|
||||||
$(".citation h2:nth(1)").text("How to Cite");
|
$(".template-citation-authors h2:nth(0)").text("All contributors");
|
||||||
|
$(".template-citation-authors h2:nth(1)").text("How to Cite");
|
||||||
|
|
||||||
// remove \donttest and \dontrun texts in Examples
|
// remove \donttest and \dontrun texts in Examples
|
||||||
if ($("#ref-examples ~ div pre").length > 0) {
|
if ($("#ref-examples ~ div pre").length > 0) {
|
||||||
@ -69,6 +70,8 @@ $(document).ready(function() {
|
|||||||
if (typeof(x) != "undefined") {
|
if (typeof(x) != "undefined") {
|
||||||
const prefix = '<img src="lang_';
|
const prefix = '<img src="lang_';
|
||||||
const suffix = '.svg" style="height: 13px !important; border: 1px solid #cccccc; aspect-ratio: 1 / 0.6; object-fit: cover; vertical-align: initial !important;"> ';
|
const suffix = '.svg" style="height: 13px !important; border: 1px solid #cccccc; aspect-ratio: 1 / 0.6; object-fit: cover; vertical-align: initial !important;"> ';
|
||||||
|
// bit weird, but we refer to languages here! So "uk" is Ukrain, not UK - take "en" for that.
|
||||||
|
x = x.replace("Aislinn", prefix + "en" + suffix + "Aislinn");
|
||||||
x = x.replace("Alex", prefix + "de" + suffix + "Alex");
|
x = x.replace("Alex", prefix + "de" + suffix + "Alex");
|
||||||
x = x.replace("Andrew", prefix + "us" + suffix + "Andrew");
|
x = x.replace("Andrew", prefix + "us" + suffix + "Andrew");
|
||||||
x = x.replace("Anita", prefix + "au" + suffix + "Anita");
|
x = x.replace("Anita", prefix + "au" + suffix + "Anita");
|
||||||
|
@ -113,6 +113,8 @@ test_that("antibiogram works", {
|
|||||||
))
|
))
|
||||||
|
|
||||||
expect_inherits(ab8, "antibiogram")
|
expect_inherits(ab8, "antibiogram")
|
||||||
|
expect_inherits(retrieve_wisca_parameters(ab8), "data.frame")
|
||||||
|
expect_inherits(attributes(ab8)$long_numeric, "data.frame")
|
||||||
expect_equal(colnames(ab8), c("Piperacillin/tazobactam", "Piperacillin/tazobactam + Gentamicin", "Piperacillin/tazobactam + Tobramycin"))
|
expect_equal(colnames(ab8), c("Piperacillin/tazobactam", "Piperacillin/tazobactam + Gentamicin", "Piperacillin/tazobactam + Tobramycin"))
|
||||||
|
|
||||||
# grouped tibbles
|
# grouped tibbles
|
||||||
|
Loading…
x
Reference in New Issue
Block a user