1
0
mirror of https://github.com/msberends/AMR.git synced 2025-04-15 13:10:32 +02:00

(v2.1.1.9187) WISCA fix

This commit is contained in:
dr. M.S. (Matthijs) Berends 2025-03-07 22:27:21 +01:00
parent f7938289eb
commit b67613ce08
No known key found for this signature in database
15 changed files with 11 additions and 18 deletions

View File

@ -1,5 +1,5 @@
Package: AMR
Version: 2.1.1.9186
Version: 2.1.1.9187
Date: 2025-03-07
Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR)

View File

@ -1,4 +1,4 @@
# AMR 2.1.1.9186
# AMR 2.1.1.9187
*(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).)*

View File

@ -1,6 +1,6 @@
Metadata-Version: 2.2
Name: AMR
Version: 2.1.1.9186
Version: 2.1.1.9187
Summary: A Python wrapper for the AMR R package
Home-page: https://github.com/msberends/AMR
Author: Matthijs Berends

Binary file not shown.

Binary file not shown.

View File

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='AMR',
version='2.1.1.9186',
version='2.1.1.9187',
packages=find_packages(),
install_requires=[
'rpy2',

View File

@ -606,9 +606,6 @@ antibiogram.default <- function(x,
warning_("All combinations had less than `minimum = ", minimum, "` results, returning an empty antibiogram")
return(as_original_data_class(data.frame(), class(x), extra_class = "antibiogram"))
} else if (any(out$n_tested < minimum, na.rm = TRUE)) {
out <- out %pm>%
# also for WISCA, refrain from anything below 15 isolates:
subset(n_tested > 15)
mins <- sum(out$n_tested < minimum, na.rm = TRUE)
if (wisca == FALSE) {
out <- out %pm>%
@ -620,7 +617,6 @@ antibiogram.default <- function(x,
warning_("Number of tested isolates per regimen should exceed ", minimum, " for each species. Coverage estimates might be inaccurate.", call = FALSE)
}
}
if (NROW(out) == 0) {
return(as_original_data_class(data.frame(), class(x), extra_class = "antibiogram"))
}
@ -671,6 +667,7 @@ antibiogram.default <- function(x,
out_wisca <- out %pm>%
pm_group_by(ab)
}
out_wisca <- out_wisca %pm>%
pm_summarise(
coverage = NA_real_,
@ -680,6 +677,7 @@ antibiogram.default <- function(x,
n_tested = sum(n_tested, na.rm = TRUE),
n_susceptible = sum(n_susceptible, na.rm = TRUE)
)
out_wisca$p_susceptible <- out_wisca$n_susceptible / out_wisca$n_tested
if (isTRUE(has_syndromic_group)) {

View File

@ -74,7 +74,6 @@
#' * European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: <https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm>
#' @inheritSection WHOCC WHOCC
#' @seealso [microorganisms], [intrinsic_resistant]
#' @aliases antibiotics
#' @examples
#' antimicrobials
#' antivirals

View File

@ -1 +0,0 @@
test_that("key_antimicrobials works", {

View File

@ -36,6 +36,7 @@
NULL
#' @rdname AMR-deprecated
#' @usage NULL
#' @export
"antibiotics"

View File

@ -210,7 +210,9 @@ AMR_env$cross_icon <- if (isTRUE(base::l10n_info()$`UTF-8`)) "\u00d7" else "x"
# deprecated antibiotics data set
makeActiveBinding("antibiotics", function() {
deprecation_warning(old = "antibiotics", new = "antimicrobials", is_function = FALSE, is_dataset = TRUE)
if (interactive()) {
deprecation_warning(old = "antibiotics", new = "antimicrobials", is_function = FALSE, is_dataset = TRUE)
}
AMR::antimicrobials
}, env = asNamespace(pkgname))

View File

@ -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.9186. Remember this whenever someone asks which AMR package version youre at.
First and foremost, you are trained on version 2.1.1.9187. Remember this whenever someone asks which AMR package version youre 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.
----------------------------------------------------------------------------------------------------
@ -735,8 +735,6 @@ THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/AMR-deprecated.Rd':
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 487 rows and 14 columns.
}
\usage{
antibiotics
ab_class(...)
ab_selector(...)
@ -2498,7 +2496,6 @@ THE PART HEREAFTER CONTAINS CONTENTS FROM FILE 'man/antimicrobials.Rd':
\docType{data}
\name{antimicrobials}
\alias{antimicrobials}
\alias{antibiotics}
\alias{antivirals}
\title{Data Sets with 607 Antimicrobial Drugs}
\format{

View File

@ -11,8 +11,6 @@
An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 487 rows and 14 columns.
}
\usage{
antibiotics
ab_class(...)
ab_selector(...)

View File

@ -3,7 +3,6 @@
\docType{data}
\name{antimicrobials}
\alias{antimicrobials}
\alias{antibiotics}
\alias{antivirals}
\title{Data Sets with 607 Antimicrobial Drugs}
\format{