mirror of
https://github.com/msberends/AMR.git
synced 2025-01-12 02:51:39 +01:00
fix AMR vignette
This commit is contained in:
parent
e975a3043c
commit
e7af5fc716
2
.github/workflows/check.yaml
vendored
2
.github/workflows/check.yaml
vendored
@ -156,4 +156,4 @@ jobs:
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: artifacts-${{ matrix.config.os }}-r${{ matrix.config.r }}
|
||||
path: ~/AMR.Rcheck
|
||||
path: ${{ github.workspace }}/AMR.Rcheck
|
||||
|
@ -1,5 +1,5 @@
|
||||
Package: AMR
|
||||
Version: 1.8.1.9043
|
||||
Version: 1.8.1.9045
|
||||
Date: 2022-08-28
|
||||
Title: Antimicrobial Resistance Data Analysis
|
||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||
@ -20,6 +20,7 @@ Authors@R: c(
|
||||
person(family = "Knight", c("Gwen"), role = "ctb", comment = c(ORCID = "0000-0002-7263-9896")),
|
||||
person(family = "Lenglet", c("Annick"), role = "ctb", comment = c(ORCID = "0000-0003-2013-8405")),
|
||||
person(family = "Meijer", c("Bart", "C."), role = "ctb"),
|
||||
person(family = "Mykhailenko", c("Dmytro"), role = "ctb"),
|
||||
person(family = "Mymrikov", c("Anton"), role = "ctb"),
|
||||
person(family = "Ny", c("Sofia"), role = "ctb", comment = c(ORCID = "0000-0002-2017-1363")),
|
||||
person(family = "Schade", c("Rogier", "P."), role = "ctb"),
|
||||
|
2
NEWS.md
2
NEWS.md
@ -1,4 +1,4 @@
|
||||
# AMR 1.8.1.9043
|
||||
# AMR 1.8.1.9045
|
||||
|
||||
### New
|
||||
* EUCAST 2022 and CLSI 2022 guidelines have been added for `as.rsi()`. EUCAST 2022 is now the new default guideline for all MIC and disks diffusion interpretations.
|
||||
|
@ -26,7 +26,7 @@
|
||||
#' Calculate the Matching Score for Microorganisms
|
||||
#'
|
||||
#' This algorithm is used by [as.mo()] and all the [`mo_*`][mo_property()] functions to determine the most probable match of taxonomic records based on user input.
|
||||
#' @author Dr Matthijs Berends
|
||||
#' @author Dr. Matthijs Berends
|
||||
#' @param x Any user input value(s)
|
||||
#' @param n A full taxonomic name, that exists in [`microorganisms$fullname`][microorganisms]
|
||||
#' @section Matching Score for Microorganisms:
|
||||
|
BIN
R/sysdata.rda
BIN
R/sysdata.rda
Binary file not shown.
@ -29,7 +29,7 @@
|
||||
library(dplyr, warn.conflicts = FALSE)
|
||||
devtools::load_all(quiet = TRUE)
|
||||
|
||||
suppressMessages(set_AMR_locale("en"))
|
||||
suppressMessages(set_AMR_locale("English"))
|
||||
|
||||
old_globalenv <- ls(envir = globalenv())
|
||||
|
||||
@ -473,7 +473,7 @@ rm(list = current_globalenv[!current_globalenv %in% old_globalenv])
|
||||
rm(current_globalenv)
|
||||
|
||||
devtools::load_all(quiet = TRUE)
|
||||
|
||||
suppressMessages(set_AMR_locale("English"))
|
||||
|
||||
# Update URLs -------------------------------------------------------------
|
||||
usethis::ui_info("Checking URLs for redirects")
|
||||
@ -500,3 +500,4 @@ invisible(capture.output(styler::style_dir(
|
||||
|
||||
# Finished ----------------------------------------------------------------
|
||||
usethis::ui_done("All done")
|
||||
suppressMessages(reset_AMR_locale())
|
||||
|
@ -1,6 +1,6 @@
|
||||
pattern regular_expr case_sensitive affect_ab_name affect_mo_name zh da nl fr de el it ja pl pt ru es sv tr uk
|
||||
language name English FALSE FALSE FALSE FALSE Chinese Danish Dutch French German Greek Italian Japanese Polish Portuguese Russian Spanish Swedish Turkish Ukrainian
|
||||
language name FALSE FALSE FALSE FALSE 汉语 Dansk Nederlands Français Deutsch Ελληνικά Italiano 日本語 Polski Português Русский Español Svenska Türkçe украї́нська
|
||||
language name FALSE FALSE FALSE FALSE 汉语 Dansk Nederlands Français Deutsch Ελληνικά Italiano 日本語 Polski Português Русский Español Svenska Türkçe Українська
|
||||
Coagulase-negative Staphylococcus TRUE TRUE FALSE TRUE 凝固酶阴性葡萄球菌 Koagulase-negative stafylokokker Coagulase-negatieve Staphylococcus Staphylococcus à coagulase négative Koagulase-negative Staphylococcus Σταφυλόκοκκος με αρνητική πηκτικότητα Staphylococcus negativo coagulasi コアグラーゼ陰性ブドウ球菌 Staphylococcus koagulazoujemny Staphylococcus coagulase negativo Коагулазоотрицательный стафилококк Staphylococcus coagulasa negativo Koagulasnegativa stafylokocker Koagülaz-negatif Stafilokok Коагулазонегативний стафілокок
|
||||
Coagulase-positive Staphylococcus TRUE TRUE FALSE TRUE 凝固酶阳性葡萄球菌 Koagulase-positive stafylokokker Coagulase-positieve Staphylococcus Staphylococcus à coagulase positif Koagulase-positive Staphylococcus Σταφυλόκοκκος θετικός στην πήξη Staphylococcus positivo coagulasi コアグラーゼ陽性ブドウ球菌 Staphylococcus koagulazo-dodatni Staphylococcus coagulase positivo Коагулазоположительный стафилококк Staphylococcus coagulasa positivo Koagulaspositiva stafylokocker Koagülaz-pozitif Stafilokok Коагулазопозитивний стафілокок
|
||||
Beta-haemolytic Streptococcus TRUE TRUE FALSE TRUE β-溶血性链球菌 Beta-haemolytiske streptokokker Beta-hemolytische Streptococcus Streptococcus Bêta-hémolytique Beta-hämolytischer Streptococcus Β-αιμολυτικός στρεπτόκοκκος Streptococcus Beta-emolitico ベータ溶血性レンサ球菌 Streptococcus beta-hemolityczny Streptococcus Beta-hemolítico Бета-гемолитический стрептококк Streptococcus Beta-hemolítico Beta-hemolytiska streptokocker Beta-hemolitik Streptokok Бета-гемолітичний стрептокок
|
||||
|
|
@ -54,5 +54,5 @@ mo_matching_score(
|
||||
)
|
||||
}
|
||||
\author{
|
||||
Dr Matthijs Berends
|
||||
Dr. Matthijs Berends
|
||||
}
|
||||
|
@ -569,7 +569,8 @@ plot(disk_values, mo = "E. coli", ab = "cipro")
|
||||
And when using the `ggplot2` package, but now choosing the latest implemented CLSI guideline (notice that the EUCAST-specific term "Susceptible, incr. exp." has changed to "Intermediate"):
|
||||
|
||||
```{r disk_plots_mo_ab, message = FALSE, warning = FALSE}
|
||||
autoplot(disk_values,
|
||||
autoplot(
|
||||
disk_values,
|
||||
mo = "E. coli",
|
||||
ab = "cipro",
|
||||
guideline = "CLSI"
|
||||
@ -580,22 +581,22 @@ autoplot(disk_values,
|
||||
|
||||
The next example uses the `example_isolates` data set. This is a data set included with this package and contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practise AMR data analysis.
|
||||
|
||||
We will compare the resistance to fosfomycin (column `FOS`) in hospital A and D. The input for the `fisher.test()` can be retrieved with a transformation like this:
|
||||
We will compare the resistance to amoxicillin/clavulanic acid (column `FOS`) between an ICU and other clinical wards. The input for the `fisher.test()` can be retrieved with a transformation like this:
|
||||
|
||||
```{r, results = 'markup'}
|
||||
# use package 'tidyr' to pivot data:
|
||||
library(tidyr)
|
||||
|
||||
check_FOS <- example_isolates %>%
|
||||
filter(ward %in% c("A", "D")) %>% # filter on only hospitals A and D
|
||||
select(ward, FOS) %>% # select the hospitals and fosfomycin
|
||||
group_by(ward) %>% # group on the hospitals
|
||||
filter(ward %in% c("ICU", "Clinical")) %>% # filter on only these wards
|
||||
select(ward, AMC) %>% # select the wards and amoxi/clav
|
||||
group_by(ward) %>% # group on the wards
|
||||
count_df(combine_SI = TRUE) %>% # count all isolates per group (ward)
|
||||
pivot_wider(
|
||||
names_from = ward, # transform output so A and D are columns
|
||||
names_from = ward, # transform output so "ICU" and "Clinical" are columns
|
||||
values_from = value
|
||||
) %>%
|
||||
select(A, D) %>% # and only select these columns
|
||||
select(ICU, Clinical) %>% # and only select these columns
|
||||
as.matrix() # transform to a good old matrix for fisher.test()
|
||||
|
||||
check_FOS
|
||||
@ -608,4 +609,4 @@ We can apply the test now with:
|
||||
fisher.test(check_FOS)
|
||||
```
|
||||
|
||||
As can be seen, the p value is `r round(fisher.test(check_FOS)$p.value, 3)`, which means that the fosfomycin resistance found in isolates from patients in hospital A and D are really different.
|
||||
As can be seen, the p value is practically zero (`r format(fisher.test(check_FOS)$p.value, scientific = FALSE)`), which means that the amoxicillin/clavulanic acid resistance found in isolates between patients in ICUs and other clinical wards are really different.
|
||||
|
Loading…
Reference in New Issue
Block a user