From a62a35d91db9b354504799cf96988d397d0634c2 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 28 Aug 2022 20:45:38 +0000 Subject: [PATCH] Built site for AMR: 1.8.1.9045@e7af5fc --- 404.html | 2 +- LICENSE-text.html | 2 +- articles/AMR.html | 767 ++++++++-------- .../AMR_files/figure-html/disk_plots-1.png | Bin 39189 -> 38117 bytes .../figure-html/disk_plots_mo_ab-1.png | Bin 51060 -> 52825 bytes .../AMR_files/figure-html/mic_plots-1.png | Bin 27621 -> 28305 bytes .../AMR_files/figure-html/mic_plots-2.png | Bin 40918 -> 37632 bytes .../figure-html/mic_plots_mo_ab-1.png | Bin 37377 -> 38548 bytes .../figure-html/mic_plots_mo_ab-2.png | Bin 51909 -> 52388 bytes articles/AMR_files/figure-html/plot 1-1.png | Bin 43123 -> 43233 bytes articles/AMR_files/figure-html/plot 3-1.png | Bin 28409 -> 28461 bytes articles/AMR_files/figure-html/plot 4-1.png | Bin 78126 -> 78072 bytes articles/AMR_files/figure-html/plot 5-1.png | Bin 49786 -> 49869 bytes articles/AMR_intro.png | Bin 128003 -> 0 bytes articles/EUCAST.html | 54 +- articles/MDR.html | 102 ++- articles/PCA.html | 113 +-- articles/SPSS.html | 18 +- articles/WHONET.html | 10 +- articles/datasets.html | 536 ++++++++++- articles/index.html | 2 +- articles/resistance_predict.html | 81 +- articles/welcome_to_AMR.html | 3 +- authors.html | 20 +- extra.css | 9 +- extra.js | 3 + index.html | 174 ++-- news/index.html | 30 +- pkgdown.yml | 2 +- reference/AMR-deprecated.html | 2 +- reference/AMR.html | 14 +- reference/Rplot005.png | Bin 13142 -> 12804 bytes reference/Rplot006.png | Bin 12661 -> 12323 bytes reference/Rplot008.png | Bin 0 -> 11960 bytes reference/Rplot009.png | Bin 0 -> 16761 bytes reference/Rplot010.png | Bin 0 -> 20453 bytes reference/WHOCC.html | 2 +- reference/WHONET.html | 95 +- reference/ab_from_text.html | 42 +- reference/ab_property.html | 186 ++-- reference/age.html | 22 +- reference/age_groups.html | 17 +- reference/antibiotic_class_selectors.html | 844 +++++++++++++----- reference/antibiotics.html | 126 +-- reference/as.ab.html | 57 +- reference/as.disk.html | 40 +- reference/as.mic-3.png | Bin 0 -> 50060 bytes reference/as.mic-4.png | Bin 0 -> 48036 bytes reference/as.mic-5.png | Bin 0 -> 48668 bytes reference/as.mic.html | 52 +- reference/as.mo.html | 20 +- reference/as.rsi.html | 461 +++++----- reference/atc_online.html | 4 +- reference/availability.html | 103 +-- reference/bug_drug_combinations.html | 410 ++------- reference/catalogue_of_life.html | 20 +- reference/catalogue_of_life_version.html | 2 +- reference/count.html | 78 +- reference/custom_eucast_rules.html | 75 +- reference/dosage.html | 47 +- reference/eucast_rules.html | 96 +- reference/example_isolates.html | 67 +- reference/example_isolates_unclean.html | 33 +- reference/first_isolate.html | 193 ++-- reference/g.test.html | 2 +- reference/get_episode.html | 204 +++-- reference/ggplot_pca.html | 29 +- reference/ggplot_rsi-1.png | Bin 58244 -> 31389 bytes reference/ggplot_rsi-10.png | Bin 0 -> 52732 bytes reference/ggplot_rsi-2.png | Bin 0 -> 50151 bytes reference/ggplot_rsi-3.png | Bin 0 -> 49416 bytes reference/ggplot_rsi-4.png | Bin 0 -> 40196 bytes reference/ggplot_rsi-5.png | Bin 0 -> 52078 bytes reference/ggplot_rsi-6.png | Bin 0 -> 35035 bytes reference/ggplot_rsi-7.png | Bin 0 -> 21942 bytes reference/ggplot_rsi-8.png | Bin 0 -> 37574 bytes reference/ggplot_rsi-9.png | Bin 0 -> 49416 bytes reference/ggplot_rsi.html | 100 ++- reference/guess_ab_col.html | 20 +- reference/index.html | 2 +- reference/intrinsic_resistant.html | 41 +- reference/italicise_taxonomy.html | 2 +- reference/join.html | 87 +- reference/key_antimicrobials.html | 6 +- reference/kurtosis.html | 6 +- reference/like.html | 110 +-- reference/mdro.html | 18 +- reference/microorganisms.codes.html | 33 +- reference/microorganisms.html | 58 +- reference/microorganisms.old.html | 44 +- reference/mo_matching_score.html | 12 +- reference/mo_property.html | 56 +- reference/mo_source.html | 6 +- reference/pca.html | 28 +- reference/plot-1.png | Bin 26939 -> 26305 bytes reference/plot-2.png | Bin 26534 -> 27524 bytes reference/plot-4.png | Bin 38725 -> 38207 bytes reference/plot-5.png | Bin 38200 -> 39076 bytes reference/plot-6.png | Bin 36916 -> 37713 bytes reference/plot.html | 2 +- reference/proportion.html | 126 +-- reference/random.html | 42 +- reference/resistance_predict.html | 30 +- reference/rsi_translation.html | 44 +- reference/skewness.html | 4 +- reference/translate.html | 8 +- search.json | 2 +- 107 files changed, 3425 insertions(+), 2733 deletions(-) delete mode 100644 articles/AMR_intro.png create mode 100644 reference/Rplot008.png create mode 100644 reference/Rplot009.png create mode 100644 reference/Rplot010.png create mode 100644 reference/as.mic-3.png create mode 100644 reference/as.mic-4.png create mode 100644 reference/as.mic-5.png create mode 100644 reference/ggplot_rsi-10.png create mode 100644 reference/ggplot_rsi-2.png create mode 100644 reference/ggplot_rsi-3.png create mode 100644 reference/ggplot_rsi-4.png create mode 100644 reference/ggplot_rsi-5.png create mode 100644 reference/ggplot_rsi-6.png create mode 100644 reference/ggplot_rsi-7.png create mode 100644 reference/ggplot_rsi-8.png create mode 100644 reference/ggplot_rsi-9.png diff --git a/404.html b/404.html index 6bc55b6c2..a97fa64e9 100644 --- a/404.html +++ b/404.html @@ -36,7 +36,7 @@ AMR (for R) - 1.8.1.9030 + 1.8.1.9045
As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (proportion_R()
, equal to resistance()
) and susceptibility as the proportion of S and I (proportion_SI()
, equal to susceptibility()
). These functions can be used on their own:
data_1st %>% resistance(AMX)
-# [1] 0.5464563
Or can be used in conjunction with group_by()
and summarise()
, both from the dplyr
package:
-data_1st %>%
- group_by(hospital) %>%
+data_1st %>%
+ group_by(hospital) %>%
summarise(amoxicillin = resistance(AMX))
Hospital A | -0.5425565 | +0.5551059 |
Hospital B | -0.5403611 | +0.5576464 |
Hospital C | -0.5634772 | +0.5445860 |
Hospital D | -0.5504023 | +0.5464581 |
Of course it would be very convenient to know the number of isolates responsible for the percentages. For that purpose the n_rsi()
can be used, which works exactly like n_distinct()
from the dplyr
package. It counts all isolates available for every group (i.e. values S, I or R):
-data_1st %>%
- group_by(hospital) %>%
- summarise(amoxicillin = resistance(AMX),
- available = n_rsi(AMX))
data_1st %>%
+ group_by(hospital) %>%
+ summarise(
+ amoxicillin = resistance(AMX),
+ available = n_rsi(AMX)
+ )
hospital | @@ -989,33 +1008,35 @@ Longest: 24||||
---|---|---|---|---|
Hospital A | -0.5425565 | -3231 | +0.5551059 | +3212 |
Hospital B | -0.5403611 | -3766 | +0.5576464 | +3773 |
Hospital C | -0.5634772 | -1599 | +0.5445860 | +1570 |
Hospital D | -0.5504023 | -2113 | +0.5464581 | +2174 |
These functions can also be used to get the proportion of multiple antibiotics, to calculate empiric susceptibility of combination therapies very easily:
-data_1st %>%
- group_by(genus) %>%
- summarise(amoxiclav = susceptibility(AMC),
- gentamicin = susceptibility(GEN),
- amoxiclav_genta = susceptibility(AMC, GEN))
data_1st %>%
+ group_by(genus) %>%
+ summarise(
+ amoxiclav = susceptibility(AMC),
+ gentamicin = susceptibility(GEN),
+ amoxiclav_genta = susceptibility(AMC, GEN)
+ )
genus | @@ -1026,39 +1047,39 @@ Longest: 24||||||
---|---|---|---|---|---|---|
Escherichia | -0.7672751 | -0.8720122 | -0.9778357 | +0.7560189 | +0.8770421 | +0.9804385 |
Klebsiella | -0.8333333 | -0.8820132 | -0.9768977 | +0.8309623 | +0.9062762 | +0.9866109 |
Staphylococcus | -0.8004261 | -0.8895597 | -0.9808239 | +0.7805057 | +0.8809088 | +0.9783804 |
Streptococcus | -0.5430495 | +0.5332095 | 0.0000000 | -0.5430495 | +0.5332095 |
Or if you are curious for the resistance within certain antibiotic classes, use a antibiotic class selector such as penicillins()
, which automatically will include the columns AMX
and AMC
of our data:
-data_1st %>%
+data_1st %>%
# group by hospital
- group_by(hospital) %>%
+ group_by(hospital) %>%
# / -> select all penicillins in the data for calculation
# | / -> use resistance() for all peni's per hospital
# | | / -> print as percentages
- summarise(across(penicillins(), resistance, as_percent = TRUE)) %>%
+ summarise(across(penicillins(), resistance, as_percent = TRUE)) %>%
# format the antibiotic column names, using so-called snake case,
# so 'Amoxicillin/clavulanic acid' becomes 'amoxicillin_clavulanic_acid'
rename_with(set_ab_names, penicillins())
To make a transition to the next part, let’s see how differences in the previously calculated combination therapies could be plotted:
-data_1st %>%
- group_by(genus) %>%
- summarise("1. Amoxi/clav" = susceptibility(AMC),
- "2. Gentamicin" = susceptibility(GEN),
- "3. Amoxi/clav + genta" = susceptibility(AMC, GEN)) %>%
+data_1st %>%
+ group_by(genus) %>%
+ summarise(
+ "1. Amoxi/clav" = susceptibility(AMC),
+ "2. Gentamicin" = susceptibility(GEN),
+ "3. Amoxi/clav + genta" = susceptibility(AMC, GEN)
+ ) %>%
# pivot_longer() from the tidyr package "lengthens" data:
- tidyr::pivot_longer(-genus, names_to = "antibiotic") %>%
- ggplot(aes(x = genus,
- y = value,
- fill = antibiotic)) +
+ tidyr::pivot_longer(-genus, names_to = "antibiotic") %>%
+ ggplot(aes(
+ x = genus,
+ y = value,
+ fill = antibiotic
+ )) +
geom_col(position = "dodge2")
To show results in plots, most R users would nowadays use the ggplot2
package. This package lets you create plots in layers. You can read more about it on their website. A quick example would look like these syntaxes:
-ggplot(data = a_data_set,
- mapping = aes(x = year,
- y = value)) +
+ggplot(
+ data = a_data_set,
+ mapping = aes(
+ x = year,
+ y = value
+ )
+) +
geom_col() +
- labs(title = "A title",
- subtitle = "A subtitle",
- x = "My X axis",
- y = "My Y axis")
+ labs(
+ title = "A title",
+ subtitle = "A subtitle",
+ x = "My X axis",
+ y = "My Y axis"
+ )
# or as short as:
ggplot(a_data_set) +
@@ -1132,11 +1163,11 @@ Longest: 24
If we group on e.g. the genus
column and add some additional functions from our package, we can create this:
# group the data on `genus`
-ggplot(data_1st %>% group_by(genus)) +
+ggplot(data_1st %>% group_by(genus)) +
# create bars with genus on x axis
# it looks for variables with class `rsi`,
# of which we have 4 (earlier created with `as.rsi`)
- geom_rsi(x = "genus") +
+ geom_rsi(x = "genus") +
# split plots on antibiotic
facet_rsi(facet = "antibiotic") +
# set colours to the R/SI interpretations (colour-blind friendly)
@@ -1146,20 +1177,24 @@ Longest: 24
# turn 90 degrees, to make it bars instead of columns
coord_flip() +
# add labels
- labs(title = "Resistance per genus and antibiotic",
- subtitle = "(this is fake data)") +
+ labs(
+ title = "Resistance per genus and antibiotic",
+ subtitle = "(this is fake data)"
+ ) +
# and print genus in italic to follow our convention
# (is now y axis because we turned the plot)
theme(axis.text.y = element_text(face = "italic"))

To simplify this, we also created the ggplot_rsi()
function, which combines almost all above functions:
-data_1st %>%
+data_1st %>%
group_by(genus) %>%
- ggplot_rsi(x = "genus",
- facet = "antibiotic",
- breaks = 0:4 * 25,
- datalabels = FALSE) +
+ ggplot_rsi(
+ x = "genus",
+ facet = "antibiotic",
+ breaks = 0:4 * 25,
+ datalabels = FALSE
+ ) +
coord_flip()

@@ -1171,16 +1206,18 @@ Longest: 24
mic_values <- random_mic(size = 100)
mic_values
# Class <mic>
-# [1] 0.5 0.025 0.025 2 0.005 64 0.001 0.025 >=256 0.025
-# [11] 4 1 32 0.002 0.01 64 16 0.001 4 0.005
-# [21] 0.125 2 >=256 8 >=256 64 0.5 64 0.0625 2
-# [31] 128 1 4 8 >=256 4 0.5 0.025 0.0625 >=256
-# [41] 0.125 64 1 >=256 1 0.001 0.01 2 0.005 0.025
-# [51] 16 0.001 8 32 0.025 1 0.025 0.25 64 0.125
-# [61] 0.0625 0.01 128 0.5 0.025 0.001 32 0.001 0.01 0.0625
-# [71] 8 2 0.25 0.002 2 0.01 0.025 0.025 128 128
-# [81] 0.002 1 0.25 >=256 128 >=256 0.5 0.0625 4 0.01
-# [91] 0.002 0.002 0.0625 2 0.01 8 0.0625 0.01 0.025 0.25
+# [1] 2 64 0.25 >=256 4 0.025 128 0.125 2
+# [10] 0.25 32 32 2 0.25 32 0.125 16 32
+# [19] 0.025 1 16 0.01 64 8 32 128 2
+# [28] 1 2 0.002 0.01 2 0.25 0.002 0.01 1
+# [37] 4 8 0.005 0.002 0.005 0.025 8 0.5 8
+# [46] 128 0.25 0.025 0.01 0.01 128 32 1 <=0.001
+# [55] 16 0.002 8 0.0625 0.125 64 0.125 0.0625 0.5
+# [64] 0.025 <=0.001 128 0.01 0.01 1 0.002 >=256 128
+# [73] 0.005 32 0.25 0.002 0.25 0.5 0.5 16 16
+# [82] 2 64 0.005 2 0.025 2 32 0.005 0.0625
+# [91] <=0.001 0.0625 64 0.002 0.025 0.005 64 0.002 1
+# [100] 32
# base R:
plot(mic_values)
# base R:
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”):
-autoplot(disk_values,
- mo = "E. coli",
- ab = "cipro",
- guideline = "CLSI")
autoplot(
+ disk_values,
+ mo = "E. coli",
+ ab = "cipro",
+ guideline = "CLSI"
+)
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 practice 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:
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 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:
# use package 'tidyr' to pivot data:
library(tidyr)
check_FOS <- example_isolates %>%
- filter(hospital_id %in% c("A", "D")) %>% # filter on only hospitals A and D
- select(hospital_id, FOS) %>% # select the hospitals and fosfomycin
- group_by(hospital_id) %>% # group on the hospitals
- count_df(combine_SI = TRUE) %>% # count all isolates per group (hospital_id)
- pivot_wider(names_from = hospital_id, # transform output so A and D are columns
- values_from = value) %>%
- select(A, D) %>% # and only select these columns
- as.matrix() # transform to a good old matrix for fisher.test()
+ 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 "ICU" and "Clinical" are columns
+ values_from = value
+ ) %>%
+ select(ICU, Clinical) %>% # and only select these columns
+ as.matrix() # transform to a good old matrix for fisher.test()
check_FOS
-# A D
-# [1,] 25 77
-# [2,] 24 33
We can apply the test now with:
# do Fisher's Exact Test
-fisher.test(check_FOS)
+fisher.test(check_FOS)
#
# Fisher's Exact Test for Count Data
#
# data: check_FOS
-# p-value = 0.03104
+# p-value = 2.263e-07
# alternative hypothesis: true odds ratio is not equal to 1
# 95 percent confidence interval:
-# 0.2111489 0.9485124
+# 0.435261 0.691614
# sample estimates:
# odds ratio
-# 0.4488318
As can be seen, the p value is 0.031, which means that the fosfomycin resistance found in isolates from patients in hospital A and D are really different.
+# 0.5485079 +As can be seen, the p value is practically zero (0.0000002263247), which means that the amoxicillin/clavulanic acid resistance found in isolates between patients in ICUs and other clinical wards are really different.